summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorJustin Dickow <jjdickow@gmail.com>2014-10-20 17:44:41 -0400
committerJustin Dickow <jjdickow@gmail.com>2014-10-20 17:44:41 -0400
commit34e7256493ff0e6594029b9857d7e2aa31f5dbeb (patch)
tree367306b507c52d3af211533810adbc22004e0192 /src/components
parent2eef966e9b5fd4d94dd98820095eb765e200c64b (diff)
downloadsdl_core-34e7256493ff0e6594029b9857d7e2aa31f5dbeb.tar.gz
SDL 3.8!
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
Diffstat (limited to 'src/components')
-rw-r--r--src/components/CMakeLists.txt94
-rw-r--r--src/components/HMI/IVSU/PROPRIETARY_REQUEST2
-rw-r--r--src/components/HMI/IVSU/PROPRIETARY_REQUEST~0
-rw-r--r--src/components/HMI/app/AppViews.js113
-rw-r--r--src/components/HMI/app/Flags.js62
-rw-r--r--src/components/HMI/app/SDLApp.js80
-rw-r--r--src/components/HMI/app/StateManager.js284
-rw-r--r--src/components/HMI/app/controller/AppController.js36
-rw-r--r--src/components/HMI/app/controller/InfoController.js80
-rw-r--r--src/components/HMI/app/controller/MediaController.js83
-rw-r--r--src/components/HMI/app/controller/PhoneController.js56
-rw-r--r--src/components/HMI/app/controller/SettingsController.js322
-rw-r--r--src/components/HMI/app/controller/sdl/AppController.js213
-rw-r--r--src/components/HMI/app/controller/sdl/Controller.js887
-rw-r--r--src/components/HMI/app/controller/sdl/MediaController.js140
-rw-r--r--src/components/HMI/app/controller/sdl/NonMediaController.js112
-rw-r--r--src/components/HMI/app/controller/sdl/RPCController.js3100
-rwxr-xr-xsrc/components/HMI/app/controlls/AZERTYLayout.js264
-rw-r--r--src/components/HMI/app/controlls/Button.js169
-rw-r--r--src/components/HMI/app/controlls/Indicator.js134
-rw-r--r--src/components/HMI/app/controlls/Label.js55
-rw-r--r--src/components/HMI/app/controlls/List.js186
-rw-r--r--src/components/HMI/app/controlls/MenuList.js204
-rwxr-xr-xsrc/components/HMI/app/controlls/QWERTYLayout.js264
-rwxr-xr-xsrc/components/HMI/app/controlls/QWERTZLayout.js264
-rw-r--r--src/components/HMI/app/controlls/ScrollBar.js167
-rw-r--r--src/components/HMI/app/controlls/ScrollableText.js209
-rw-r--r--src/components/HMI/app/mixins/PresetEventCustom.js57
-rw-r--r--src/components/HMI/app/mixins/PresetEvents.js44
-rw-r--r--src/components/HMI/app/model/PhoneModel.js88
-rw-r--r--src/components/HMI/app/model/abstract/RangedValue.js137
-rw-r--r--src/components/HMI/app/model/media/CDModel.js43
-rw-r--r--src/components/HMI/app/model/sdl/AppModel.js421
-rw-r--r--src/components/HMI/app/model/sdl/MediaModel.js359
-rw-r--r--src/components/HMI/app/model/sdl/Model.js1476
-rw-r--r--src/components/HMI/app/model/sdl/NonMediaModel.js226
-rw-r--r--src/components/HMI/app/model/sdl/VehicleInfoModel.js501
-rw-r--r--src/components/HMI/app/util/Audio.js43
-rw-r--r--src/components/HMI/app/util/StreamAudio.js49
-rw-r--r--src/components/HMI/app/view/WarningView.js335
-rw-r--r--src/components/HMI/app/view/climateView.js56
-rw-r--r--src/components/HMI/app/view/home/bottomControls.js90
-rw-r--r--src/components/HMI/app/view/home/controlButtons.js579
-rw-r--r--src/components/HMI/app/view/home/statusClimateView.js66
-rw-r--r--src/components/HMI/app/view/home/statusInfoView.js60
-rw-r--r--src/components/HMI/app/view/home/statusMediaView.js99
-rw-r--r--src/components/HMI/app/view/home/statusNavigationView.js59
-rw-r--r--src/components/HMI/app/view/home/statusPhoneView.js68
-rw-r--r--src/components/HMI/app/view/home/topControls.js59
-rw-r--r--src/components/HMI/app/view/homeView.js40
-rw-r--r--src/components/HMI/app/view/info/alertsView.js118
-rw-r--r--src/components/HMI/app/view/info/appsView.js148
-rw-r--r--src/components/HMI/app/view/info/calendarView.js104
-rw-r--r--src/components/HMI/app/view/info/devicelistView.js142
-rw-r--r--src/components/HMI/app/view/info/nonMediaView.js264
-rw-r--r--src/components/HMI/app/view/info/servicesView.js54
-rw-r--r--src/components/HMI/app/view/info/travelLinkView.js164
-rw-r--r--src/components/HMI/app/view/infoView.js190
-rw-r--r--src/components/HMI/app/view/media/common/LeftMenuView.js82
-rw-r--r--src/components/HMI/app/view/media/playerView.js43
-rw-r--r--src/components/HMI/app/view/media/sdl/controllsView.js238
-rw-r--r--src/components/HMI/app/view/media/sdlmediaView.js110
-rw-r--r--src/components/HMI/app/view/mediaView.js49
-rw-r--r--src/components/HMI/app/view/navigationApp/baseNavigationView.js169
-rw-r--r--src/components/HMI/app/view/navigationAppView.js76
-rw-r--r--src/components/HMI/app/view/navigationView.js53
-rw-r--r--src/components/HMI/app/view/phone/dialpadView.js214
-rw-r--r--src/components/HMI/app/view/phoneView.js97
-rw-r--r--src/components/HMI/app/view/sdl/AlertManeuverPopUp.js184
-rw-r--r--src/components/HMI/app/view/sdl/AlertPopUp.js251
-rw-r--r--src/components/HMI/app/view/sdl/AudioPassThruPopUp.js184
-rw-r--r--src/components/HMI/app/view/sdl/ExitAppView.js113
-rw-r--r--src/components/HMI/app/view/sdl/PopUp.js142
-rw-r--r--src/components/HMI/app/view/sdl/SystemRequestView.js113
-rw-r--r--src/components/HMI/app/view/sdl/TTSPopUp.js141
-rw-r--r--src/components/HMI/app/view/sdl/VRHelpListView.js106
-rw-r--r--src/components/HMI/app/view/sdl/VRPopUp.js236
-rw-r--r--src/components/HMI/app/view/sdl/VehicleInfoView.js203
-rw-r--r--src/components/HMI/app/view/sdl/driverDistraction.js84
-rw-r--r--src/components/HMI/app/view/sdl/shared/AbstractView.js95
-rw-r--r--src/components/HMI/app/view/sdl/shared/interactionChoicesView.js391
-rw-r--r--src/components/HMI/app/view/sdl/shared/keyboard.js297
-rw-r--r--src/components/HMI/app/view/sdl/shared/optionsView.js132
-rw-r--r--src/components/HMI/app/view/sdl/shared/scrollableMessage.js148
-rw-r--r--src/components/HMI/app/view/sdl/shared/sliderView.js211
-rw-r--r--src/components/HMI/app/view/sdl/shared/tbtTurnList.js125
-rw-r--r--src/components/HMI/app/view/sdl/shared/turnByTurnView.js236
-rw-r--r--src/components/HMI/app/view/sdl/tbtClientStateView.js113
-rw-r--r--src/components/HMI/app/view/settings/policies/appPermissionsListView.js126
-rw-r--r--src/components/HMI/app/view/settings/policies/appPermissionsView.js136
-rw-r--r--src/components/HMI/app/view/settings/policies/deviceConfigView.js135
-rw-r--r--src/components/HMI/app/view/settings/policies/deviceStateChangeView.js113
-rw-r--r--src/components/HMI/app/view/settings/policies/statisticsInfoView.js88
-rw-r--r--src/components/HMI/app/view/settings/policies/systemErrorView.js88
-rw-r--r--src/components/HMI/app/view/settings/policiesView.js152
-rw-r--r--src/components/HMI/app/view/settingsView.js100
-rw-r--r--src/components/HMI/audio/alert.wavbin0 -> 37428 bytes
-rw-r--r--src/components/HMI/audio/initial.wavbin0 -> 46834 bytes
-rw-r--r--src/components/HMI/audio/listen.wavbin0 -> 11070 bytes
-rw-r--r--src/components/HMI/audio/positive.wavbin0 -> 20302 bytes
-rw-r--r--src/components/HMI/audio/say.wavbin0 -> 47292 bytes
-rw-r--r--src/components/HMI/css/buttonControls.css546
-rw-r--r--src/components/HMI/css/general.css1541
-rw-r--r--src/components/HMI/css/info.css671
-rw-r--r--src/components/HMI/css/mcs.css3703
-rw-r--r--src/components/HMI/css/media.css528
-rw-r--r--src/components/HMI/css/navigation.css102
-rw-r--r--src/components/HMI/css/phone.css300
-rw-r--r--src/components/HMI/css/sdl.css1219
-rw-r--r--src/components/HMI/css/settings.css129
-rw-r--r--src/components/HMI/ffw/BasicCommunicationRPC.js1194
-rw-r--r--src/components/HMI/ffw/ButtonsRPC.js347
-rw-r--r--src/components/HMI/ffw/Framework.js40
-rw-r--r--src/components/HMI/ffw/NavigationRPC.js334
-rw-r--r--src/components/HMI/ffw/RPCClient.js333
-rw-r--r--src/components/HMI/ffw/RPCObserver.js116
-rw-r--r--src/components/HMI/ffw/TTSRPC.js412
-rw-r--r--src/components/HMI/ffw/UIRPC.js1658
-rw-r--r--src/components/HMI/ffw/VRRPC.js467
-rw-r--r--src/components/HMI/ffw/VehicleInfoRPC.js481
-rw-r--r--src/components/HMI/ffw/WebSocket.js77
-rw-r--r--src/components/HMI/images/common/arr-r-disable.pngbin0 -> 1268 bytes
-rw-r--r--src/components/HMI/images/common/arr-r.pngbin0 -> 1467 bytes
-rw-r--r--src/components/HMI/images/common/arrow_ico.pngbin0 -> 1194 bytes
-rw-r--r--src/components/HMI/images/common/bt_bg.pngbin0 -> 1204 bytes
-rw-r--r--src/components/HMI/images/common/bt_bg_pressed.pngbin0 -> 1211 bytes
-rw-r--r--src/components/HMI/images/common/btn-28h-gray-active.pngbin0 -> 957 bytes
-rw-r--r--src/components/HMI/images/common/btn-28h.pngbin0 -> 1080 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h-active-gray.pngbin0 -> 952 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h-active.pngbin0 -> 972 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h-pressed.pngbin0 -> 3011 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h.pngbin0 -> 1141 bytes
-rw-r--r--src/components/HMI/images/common/btn-98h.pngbin0 -> 1266 bytes
-rw-r--r--src/components/HMI/images/common/button.pngbin0 -> 655 bytes
-rw-r--r--src/components/HMI/images/common/button_active_blue.pngbin0 -> 170 bytes
-rw-r--r--src/components/HMI/images/common/button_large.pngbin0 -> 1192 bytes
-rw-r--r--src/components/HMI/images/common/button_small.pngbin0 -> 487 bytes
-rw-r--r--src/components/HMI/images/common/center-button-150.pngbin0 -> 1390 bytes
-rw-r--r--src/components/HMI/images/common/center-button.pngbin0 -> 1300 bytes
-rw-r--r--src/components/HMI/images/common/climate-status-bg.pngbin0 -> 2315 bytes
-rw-r--r--src/components/HMI/images/common/defaultButtonImage.pngbin0 -> 3874 bytes
-rw-r--r--src/components/HMI/images/common/delim.pngbin0 -> 1120 bytes
-rw-r--r--src/components/HMI/images/common/divider.pngbin0 -> 1157 bytes
-rw-r--r--src/components/HMI/images/common/header_bg.pngbin0 -> 6743 bytes
-rw-r--r--src/components/HMI/images/common/ico_back.pngbin0 -> 1123 bytes
-rw-r--r--src/components/HMI/images/common/ind_vert_active.pngbin0 -> 2346 bytes
-rw-r--r--src/components/HMI/images/common/ind_vert_def.pngbin0 -> 1066 bytes
-rw-r--r--src/components/HMI/images/common/ls_border.pngbin0 -> 3403 bytes
-rw-r--r--src/components/HMI/images/common/media-status-bg.pngbin0 -> 2048 bytes
-rw-r--r--src/components/HMI/images/common/minus-ico.pngbin0 -> 934 bytes
-rw-r--r--src/components/HMI/images/common/nav-status-bg.pngbin0 -> 2971 bytes
-rw-r--r--src/components/HMI/images/common/okbut.pngbin0 -> 3102 bytes
-rw-r--r--src/components/HMI/images/common/okbut_pressed.pngbin0 -> 3155 bytes
-rw-r--r--src/components/HMI/images/common/page-back-button.pngbin0 -> 1112 bytes
-rw-r--r--src/components/HMI/images/common/phone-statusbar-bg.pngbin0 -> 2910 bytes
-rw-r--r--src/components/HMI/images/common/plus-ico.pngbin0 -> 958 bytes
-rw-r--r--src/components/HMI/images/common/scroll_down.pngbin0 -> 1072 bytes
-rw-r--r--src/components/HMI/images/common/scroll_down_active.pngbin0 -> 1070 bytes
-rw-r--r--src/components/HMI/images/common/scroll_down_inactive.pngbin0 -> 1033 bytes
-rw-r--r--src/components/HMI/images/common/scroll_up.pngbin0 -> 1186 bytes
-rw-r--r--src/components/HMI/images/common/scroll_up_inactive.pngbin0 -> 1108 bytes
-rw-r--r--src/components/HMI/images/common/seat-act-led.pngbin0 -> 1383 bytes
-rw-r--r--src/components/HMI/images/common/seat-inact-led.pngbin0 -> 967 bytes
-rw-r--r--src/components/HMI/images/common/skipbuttonbg.pngbin0 -> 1562 bytes
-rw-r--r--src/components/HMI/images/common/skippbuttonbg_pressed.pngbin0 -> 1544 bytes
-rw-r--r--src/components/HMI/images/common/system_settings_btn_bg.pngbin0 -> 962 bytes
-rw-r--r--src/components/HMI/images/common/system_settings_btn_bg_active.pngbin0 -> 970 bytes
-rw-r--r--src/components/HMI/images/common/system_settings_btn_h54.pngbin0 -> 966 bytes
-rw-r--r--src/components/HMI/images/common/toggle.pngbin0 -> 3596 bytes
-rw-r--r--src/components/HMI/images/home/bottom_controlls_full.pngbin0 -> 28638 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/DownButton.pngbin0 -> 6391 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/DownButton_pressed.pngbin0 -> 6278 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/LeftButton.pngbin0 -> 6547 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/LeftButton_pressed.pngbin0 -> 6630 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/OkButton.pngbin0 -> 4939 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/OkButton_pressed.pngbin0 -> 4809 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/RightButton.pngbin0 -> 6550 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/RightButton_pressed.pngbin0 -> 6549 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/UpButton.pngbin0 -> 6397 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/UpButton_pressed.pngbin0 -> 6536 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/backGroundControllButtons.pngbin0 -> 3157 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/vr.pngbin0 -> 5429 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/vrImage.pngbin0 -> 2461 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/vr_pressed.pngbin0 -> 6165 bytes
-rw-r--r--src/components/HMI/images/home/home_main_image.pngbin0 -> 39085 bytes
-rw-r--r--src/components/HMI/images/home/home_phone.pngbin0 -> 2774 bytes
-rw-r--r--src/components/HMI/images/info/callendar-btn.pngbin0 -> 1366 bytes
-rw-r--r--src/components/HMI/images/info/ico_assist.pngbin0 -> 1553 bytes
-rw-r--r--src/components/HMI/images/info/ico_info_install.pngbin0 -> 2022 bytes
-rw-r--r--src/components/HMI/images/info/ico_vehicle.pngbin0 -> 1614 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_apps_ico.pngbin0 -> 1632 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_calendar_ico.pngbin0 -> 1868 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_services_ico.pngbin0 -> 2493 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_travelLink_ico.pngbin0 -> 3646 bytes
-rw-r--r--src/components/HMI/images/info/info_services_bg.pngbin0 -> 11109 bytes
-rw-r--r--src/components/HMI/images/info/info_travelLink_sirius_logo.pngbin0 -> 3627 bytes
-rw-r--r--src/components/HMI/images/info/menu_active.pngbin0 -> 973 bytes
-rw-r--r--src/components/HMI/images/info/view_info_calendar.pngbin0 -> 5924 bytes
-rw-r--r--src/components/HMI/images/list/list_item_bg.pngbin0 -> 1099 bytes
-rw-r--r--src/components/HMI/images/list/list_item_pressed.pngbin0 -> 1091 bytes
-rw-r--r--src/components/HMI/images/list/scrollbar/button-down-active.pngbin0 -> 1407 bytes
-rw-r--r--src/components/HMI/images/list/scrollbar/button-up-active.pngbin0 -> 1406 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgL.pngbin0 -> 1472 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgL_pressed.png0
-rw-r--r--src/components/HMI/images/media/bcs-item_bgR.pngbin0 -> 1423 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgR_pressed.pngbin0 -> 1407 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgS.pngbin0 -> 1542 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgS_pressed.pngbin0 -> 1541 bytes
-rw-r--r--src/components/HMI/images/media/bg.pngbin0 -> 4614 bytes
-rw-r--r--src/components/HMI/images/media/btn_bg.pngbin0 -> 1286 bytes
-rw-r--r--src/components/HMI/images/media/cd-next-btn.pngbin0 -> 1744 bytes
-rw-r--r--src/components/HMI/images/media/cd-next-btn_pressed.pngbin0 -> 1752 bytes
-rw-r--r--src/components/HMI/images/media/cd-prev-btn.pngbin0 -> 1845 bytes
-rw-r--r--src/components/HMI/images/media/cd-prev-btn_pressed.pngbin0 -> 1872 bytes
-rw-r--r--src/components/HMI/images/media/cd_play_btn.pngbin0 -> 1999 bytes
-rw-r--r--src/components/HMI/images/media/divider_o.pngbin0 -> 1136 bytes
-rw-r--r--src/components/HMI/images/media/ico-play.pngbin0 -> 1162 bytes
-rw-r--r--src/components/HMI/images/media/ico_arrow_down.pngbin0 -> 1723 bytes
-rw-r--r--src/components/HMI/images/media/ico_arrow_up.pngbin0 -> 1726 bytes
-rw-r--r--src/components/HMI/images/media/ico_back.pngbin0 -> 1123 bytes
-rw-r--r--src/components/HMI/images/media/ico_cd.pngbin0 -> 2479 bytes
-rw-r--r--src/components/HMI/images/media/ico_next.pngbin0 -> 1423 bytes
-rw-r--r--src/components/HMI/images/media/ico_pause.pngbin0 -> 1134 bytes
-rw-r--r--src/components/HMI/images/media/ico_prew.pngbin0 -> 1435 bytes
-rw-r--r--src/components/HMI/images/media/ls-item_bg.pngbin0 -> 1481 bytes
-rw-r--r--src/components/HMI/images/media/ls-item_bg_act.pngbin0 -> 1219 bytes
-rw-r--r--src/components/HMI/images/media/player_view.pngbin0 -> 62443 bytes
-rw-r--r--src/components/HMI/images/phone/bg.pngbin0 -> 13851 bytes
-rw-r--r--src/components/HMI/images/phone/del.pngbin0 -> 207 bytes
-rw-r--r--src/components/HMI/images/phone/dial.pngbin0 -> 510 bytes
-rw-r--r--src/components/HMI/images/phone/end.pngbin0 -> 499 bytes
-rw-r--r--src/components/HMI/images/phone/ico_phone.pngbin0 -> 1204 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/center_btn.pngbin0 -> 706 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/center_btn_pressed.pngbin0 -> 699 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/left_btn.pngbin0 -> 636 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/left_btn_pressed.pngbin0 -> 624 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/right_btn.pngbin0 -> 571 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/right_btn_pressed.pngbin0 -> 563 bytes
-rw-r--r--src/components/HMI/images/phone/menu_active.pngbin0 -> 172 bytes
-rw-r--r--src/components/HMI/images/phone/menu_bg.pngbin0 -> 555 bytes
-rw-r--r--src/components/HMI/images/sdl/Warning.pngbin0 -> 7546 bytes
-rw-r--r--src/components/HMI/images/sdl/audio_icon.jpgbin0 -> 5560 bytes
-rw-r--r--src/components/HMI/images/sdl/devices.pngbin0 -> 632 bytes
-rw-r--r--src/components/HMI/images/sdl/new_apps.pngbin0 -> 1424 bytes
-rw-r--r--src/components/HMI/images/sdl/progress.gifbin0 -> 2327 bytes
-rw-r--r--src/components/HMI/images/sdl/progressindicator.gifbin0 -> 7703 bytes
-rw-r--r--src/components/HMI/images/settings/ico_settings.pngbin0 -> 2561 bytes
-rw-r--r--src/components/HMI/index.html189
-rw-r--r--src/components/HMI/lib/ember-1.0.pre.js20709
-rw-r--r--src/components/HMI/lib/ember-1.0.pre.min.js18
-rw-r--r--src/components/HMI/lib/handlebars-1.0.0.beta.6.js1550
-rw-r--r--src/components/HMI/lib/iscroll-lite.js594
-rw-r--r--src/components/HMI/lib/jquery-1.7.2.js9404
-rw-r--r--src/components/HMI/lib/jquery-1.7.2.min.js4
-rw-r--r--src/components/HMI/locale/eng.js62
-rw-r--r--src/components/HMI/locale/locale.js42
-rw-r--r--src/components/application_manager/CMakeLists.txt338
-rw-r--r--src/components/application_manager/include/application_manager/application.h549
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h328
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h275
-rw-r--r--src/components/application_manager/include/application_manager/application_manager.h79
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h820
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h99
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h123
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_impl.h64
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h209
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_response_impl.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h79
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h58
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h78
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h66
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h66
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h63
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h69
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h71
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h92
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h147
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h88
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_request.h142
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h162
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h179
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h97
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h84
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h99
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/generic_response.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h94
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h86
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h85
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h77
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h82
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h132
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h220
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h174
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h75
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h130
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h85
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h87
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h121
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h88
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h81
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h89
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_request.h88
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_request.h91
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/slider_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_request.h93
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/speak_response.h67
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h88
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h97
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_request.h80
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h76
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h72
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h96
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h97
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/pending.h75
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event.h147
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h117
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_observer.h116
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities.h538
-rw-r--r--src/components/application_manager/include/application_manager/hmi_command_factory.h63
-rw-r--r--src/components/application_manager/include/application_manager/message.h128
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h492
-rw-r--r--src/components/application_manager/include/application_manager/mobile_command_factory.h63
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h64
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_event_observer.h59
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h376
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h54
-rw-r--r--src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h47
-rw-r--r--src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h52
-rw-r--r--src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h61
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h266
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h236
-rw-r--r--src/components/application_manager/include/application_manager/resume_ctrl.h285
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h369
-rw-r--r--src/components/application_manager/include/application_manager/time_metric_observer.h59
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h71
-rw-r--r--src/components/application_manager/include/application_manager/vehicle_info_data.h71
-rw-r--r--src/components/application_manager/src/application_data_impl.cc504
-rw-r--r--src/components/application_manager/src/application_impl.cc740
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc2338
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc80
-rw-r--r--src/components/application_manager/src/commands/command_notification_impl.cc74
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc548
-rw-r--r--src/components/application_manager/src/commands/command_response_impl.cc88
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_request.cc101
-rw-r--r--src/components/application_manager/src/commands/hmi/activate_app_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/allow_app_response.cc65
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/close_popup_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_request.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/get_system_info_response.cc73
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls.cc75
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc72
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_send_location_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc73
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc23
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_from_hmi.cc103
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_to_hmi.cc69
-rw-r--r--src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc140
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc92
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_event_notification.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/on_button_press_notification.cc64
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc70
-rw-r--r--src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc98
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc113
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc81
-rw-r--r--src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_find_applications.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_policy_update.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/on_put_file_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ready_notification.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/on_received_policy_update.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/on_record_start_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/on_status_update_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_context_notification.cc87
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_error_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc64
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_request_notification.cc96
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc96
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc31
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc94
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/on_update_device_list.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc101
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc91
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/request_from_hmi.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/request_to_hmi.cc70
-rw-r--r--src/components/application_manager/src/commands/hmi/response_from_hmi.cc108
-rw-r--r--src/components/application_manager/src/commands/hmi/response_to_hmi.cc66
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc93
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc51
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc67
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_language_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc66
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_speak_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_command_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_alert_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc75
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_language_response.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc66
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc63
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_icon_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_show_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_slider_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/update_app_list_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_request.cc96
-rw-r--r--src/components/application_manager/src/commands/hmi/update_device_list_response.cc54
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_request.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/update_sdl_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc95
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc65
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_read_did_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_add_command_response.cc57
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc58
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_language_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc66
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc62
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc414
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc146
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc232
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_request.cc415
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_response.cc59
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_request.cc433
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc343
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc68
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_request.cc183
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_request.cc115
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_response.cc69
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc138
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc77
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc179
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc94
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/dial_number_request.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc88
-rw-r--r--src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/generic_response.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_request.cc108
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc302
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_request.cc97
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc55
-rw-r--r--src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc53
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_event_notification.cc163
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_press_notification.cc163
-rw-r--r--src/components/application_manager/src/commands/mobile/on_command_notification.cc80
-rw-r--r--src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc63
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc75
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc87
-rw-r--r--src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc73
-rw-r--r--src/components/application_manager/src/commands/mobile/on_language_change_notification.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc61
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc80
-rw-r--r--src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc72
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc72
-rw-r--r--src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc89
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc316
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc870
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_request.cc250
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_response.cc67
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_request.cc122
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc881
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc93
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc302
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_request.cc155
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_response.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_request.cc166
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_request.cc123
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_response.cc59
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc515
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_request.cc141
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc152
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc283
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/show_request.cc341
-rw-r--r--src/components/application_manager/src/commands/mobile/show_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc185
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_request.cc160
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_response.cc58
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_request.cc101
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_response.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc283
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/system_request.cc168
-rw-r--r--src/components/application_manager/src/commands/mobile/system_response.cc56
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc60
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc47
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc79
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc69
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc279
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc66
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_request.cc227
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_response.cc57
-rw-r--r--src/components/application_manager/src/commands/pending.cc67
-rw-r--r--src/components/application_manager/src/event_engine/event.cc56
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher.cc123
-rw-r--r--src/components/application_manager/src/event_engine/event_observer.cc63
-rw-r--r--src/components/application_manager/src/hmi_capabilities.cc874
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc2043
-rw-r--r--src/components/application_manager/src/message.cc209
-rw-r--r--src/components/application_manager/src/message_helper.cc2357
-rw-r--r--src/components/application_manager/src/mobile_command_factory.cc549
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc221
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc104
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc1319
-rw-r--r--src/components/application_manager/src/policies/policy_retry_sequence.cc80
-rw-r--r--src/components/application_manager/src/policies/pt_exchange_handler_ext.cc88
-rw-r--r--src/components/application_manager/src/policies/pt_exchange_handler_impl.cc76
-rw-r--r--src/components/application_manager/src/request_controller.cc508
-rw-r--r--src/components/application_manager/src/request_info.cc83
-rw-r--r--src/components/application_manager/src/resume_ctrl.cpp941
-rw-r--r--src/components/application_manager/src/usage_statistics.cc125
-rw-r--r--src/components/application_manager/test/CMakeLists.txt107
-rw-r--r--src/components/application_manager/test/command_impl_test.cc45
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application.h549
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application_data_impl.h328
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application_impl.h275
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application_manager.h79
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h292
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/command.h99
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h123
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h64
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h209
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h68
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h79
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h70
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h69
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h58
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h78
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h78
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h66
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h69
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h77
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h76
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h77
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h76
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h77
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h66
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h77
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h63
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h69
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h92
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h147
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h88
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h94
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h142
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h162
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h179
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h97
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h77
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h84
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h99
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h70
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h94
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h74
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h86
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h85
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h75
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h77
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h75
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h76
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h76
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h76
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h82
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h132
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h220
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h81
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h174
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h75
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h130
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h85
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h68
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h87
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h121
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h88
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h81
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h89
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h88
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h91
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h93
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h67
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h88
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h97
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h80
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h76
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h72
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h96
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h97
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h73
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/commands/pending.h75
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/event_engine/event.h147
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h117
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h116
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h538
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h63
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/message.h128
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/message_helper.h492
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h63
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h64
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h59
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h376
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h54
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h47
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h52
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h61
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/request_controller.h266
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/request_info.h236
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h285
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h369
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h59
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/usage_statistics.h71
-rw-r--r--src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h71
-rw-r--r--src/components/application_manager/test/mock/src/application_manager_impl.cc33
-rw-r--r--src/components/config_profile/CMakeLists.txt13
-rw-r--r--src/components/config_profile/include/config_profile/ini_file.h133
-rw-r--r--src/components/config_profile/include/config_profile/profile.h623
-rw-r--r--src/components/config_profile/src/ini_file.cc411
-rw-r--r--src/components/config_profile/src/profile.cc1323
-rw-r--r--src/components/connection_handler/CMakeLists.txt23
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h298
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler.h151
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h423
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_observer.h108
-rw-r--r--src/components/connection_handler/include/connection_handler/device.h115
-rw-r--r--src/components/connection_handler/include/connection_handler/devices_discovery_starter.h72
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h114
-rw-r--r--src/components/connection_handler/src/connection.cc360
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc863
-rw-r--r--src/components/connection_handler/src/device.cc74
-rw-r--r--src/components/connection_handler/src/heartbeat_monitor.cc169
-rw-r--r--src/components/dbus/CMakeLists.txt45
-rw-r--r--src/components/dbus/codegen/code_formatter.py58
-rw-r--r--src/components/dbus/codegen/ford_xml_parser.py231
-rwxr-xr-xsrc/components/dbus/codegen/make_hmi_requests.py343
-rwxr-xr-xsrc/components/dbus/codegen/make_introspection_c.py126
-rwxr-xr-xsrc/components/dbus/codegen/make_message_descriptions.py273
-rwxr-xr-xsrc/components/dbus/codegen/make_notifications_qml.py387
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_cpp.py736
-rwxr-xr-xsrc/components/dbus/codegen/make_qml_dbus_qml.py217
-rw-r--r--src/components/dbus/codegen/make_qml_requests_cpp.py253
-rwxr-xr-xsrc/components/dbus/codegen/make_request_to_sdl.py335
-rw-r--r--src/components/dbus/include/dbus/dbus_adapter.h369
-rw-r--r--src/components/dbus/include/dbus/dbus_message.h176
-rw-r--r--src/components/dbus/include/dbus/dbus_message_controller.h85
-rw-r--r--src/components/dbus/include/dbus/dbus_message_inl.h218
-rw-r--r--src/components/dbus/include/dbus/message_descriptions.h73
-rw-r--r--src/components/dbus/include/dbus/schema.h98
-rw-r--r--src/components/dbus/src/dbus_adapter.cc918
-rw-r--r--src/components/dbus/src/dbus_message.cc243
-rw-r--r--src/components/dbus/src/dbus_message_controller.cc73
-rw-r--r--src/components/dbus/src/schema.cc149
-rw-r--r--src/components/formatters/CMakeLists.txt25
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonBase.hpp122
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.hpp235
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.hpp176
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.hpp422
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h497
-rw-r--r--src/components/formatters/include/formatters/generic_json_formatter.h71
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h78
-rw-r--r--src/components/formatters/src/CFormatterJsonBase.cpp118
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv1.cpp157
-rw-r--r--src/components/formatters/src/CFormatterJsonSDLRPCv2.cpp106
-rw-r--r--src/components/formatters/src/CSmartFactory.cpp46
-rw-r--r--src/components/formatters/src/formatter_json_rpc.cc204
-rw-r--r--src/components/formatters/src/generic_json_formatter.cc63
-rw-r--r--src/components/formatters/src/meta_formatter.cc60
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt44
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h101
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h81
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h56
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h122
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h53
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h48
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h88
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h63
-rw-r--r--src/components/hmi_message_handler/src/dbus_message_adapter.cc206
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_adapter.cc44
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_handler_impl.cc126
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc176
-rw-r--r--src/components/hmi_message_handler/src/mqueue_adapter.cc139
-rw-r--r--src/components/include/protocol/common.h227
-rw-r--r--src/components/include/protocol/message_priority.h66
-rw-r--r--src/components/include/protocol/raw_message.h117
-rw-r--r--src/components/include/protocol/rpc_type.h58
-rw-r--r--src/components/include/protocol/service_type.h87
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h108
-rw-r--r--src/components/include/protocol_handler/protocol_observer.h68
-rw-r--r--src/components/include/protocol_handler/session_observer.h200
-rw-r--r--src/components/include/security_manager/crypto_manager.h71
-rw-r--r--src/components/include/security_manager/security_manager.h133
-rw-r--r--src/components/include/security_manager/security_manager_listener.h49
-rw-r--r--src/components/include/security_manager/ssl_context.h85
-rw-r--r--src/components/include/transport_manager/common.h94
-rw-r--r--src/components/include/transport_manager/error.h146
-rw-r--r--src/components/include/transport_manager/info.h163
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h125
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h267
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h92
-rw-r--r--src/components/include/transport_manager/transport_manager.h166
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h174
-rw-r--r--src/components/include/transport_manager/transport_manager_listener_empty.h188
-rw-r--r--src/components/include/utils/atomic.h69
-rw-r--r--src/components/include/utils/byte_order.h46
-rw-r--r--src/components/include/utils/conditional_variable.h93
-rw-r--r--src/components/include/utils/date_time.h84
-rw-r--r--src/components/include/utils/lock.h139
-rw-r--r--src/components/include/utils/logger.h180
-rw-r--r--src/components/include/utils/logger_status.h52
-rw-r--r--src/components/include/utils/macro.h83
-rw-r--r--src/components/include/utils/memory_barrier.h54
-rw-r--r--src/components/include/utils/message_queue.h203
-rw-r--r--src/components/include/utils/prioritized_queue.h89
-rw-r--r--src/components/include/utils/push_log.h52
-rw-r--r--src/components/include/utils/rwlock.h96
-rw-r--r--src/components/include/utils/shared_ptr.h371
-rw-r--r--src/components/include/utils/threads/message_loop_thread.h172
-rw-r--r--src/components/include/utils/threads/thread.h251
-rw-r--r--src/components/include/utils/threads/thread_delegate.h69
-rw-r--r--src/components/include/utils/threads/thread_options.h105
-rw-r--r--src/components/include/utils/timer_thread.h384
-rw-r--r--src/components/interfaces/CMakeLists.txt50
-rw-r--r--src/components/interfaces/HMI_API.xml3888
-rw-r--r--src/components/interfaces/Json_HMI_message_specification.txt317
-rw-r--r--src/components/interfaces/Json_Mobile_side_message_spec.txt62
-rw-r--r--src/components/interfaces/MOBILE_API.xml4898
-rw-r--r--src/components/interfaces/QT_HMI_API.xml4077
-rw-r--r--src/components/interfaces/v4_protocol_v1_2_no_extra.xml1153
-rw-r--r--src/components/media_manager/CMakeLists.txt81
-rw-r--r--src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h65
-rw-r--r--src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h137
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h65
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h66
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h98
-rw-r--r--src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h51
-rw-r--r--src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h50
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter.h52
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_impl.h61
-rw-r--r--src/components/media_manager/include/media_manager/media_adapter_listener.h56
-rw-r--r--src/components/media_manager/include/media_manager/media_manager.h55
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h90
-rw-r--r--src/components/media_manager/include/media_manager/pipe_streamer_adapter.h114
-rw-r--r--src/components/media_manager/include/media_manager/socket_streamer_adapter.h136
-rw-r--r--src/components/media_manager/include/media_manager/streamer_listener.h59
-rw-r--r--src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h51
-rw-r--r--src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h51
-rw-r--r--src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h111
-rw-r--r--src/components/media_manager/src/audio/a2dp_source_player_adapter.cc278
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc149
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_adapter.cc110
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_listener.cc99
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc266
-rw-r--r--src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc52
-rw-r--r--src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc51
-rw-r--r--src/components/media_manager/src/media_adapter_impl.cc58
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc291
-rw-r--r--src/components/media_manager/src/pipe_streamer_adapter.cc227
-rw-r--r--src/components/media_manager/src/socket_streamer_adapter.cc324
-rw-r--r--src/components/media_manager/src/streamer_listener.cc80
-rw-r--r--src/components/media_manager/src/video/pipe_video_streamer_adapter.cc51
-rw-r--r--src/components/media_manager/src/video/socket_video_streamer_adapter.cc52
-rw-r--r--src/components/media_manager/src/video/video_stream_to_file_adapter.cc203
-rw-r--r--src/components/media_manager/test/CMakeLists.txt14
-rw-r--r--src/components/media_manager/test/main.cc7
-rw-r--r--src/components/media_manager/test/media_adapter_impl_test.cc37
m---------src/components/policy0
-rw-r--r--src/components/protocol/CMakeLists.txt14
-rw-r--r--src/components/protocol/src/message_priority.cc59
-rw-r--r--src/components/protocol/src/raw_message.cc91
-rw-r--r--src/components/protocol/src/rpc_type.cc86
-rw-r--r--src/components/protocol/src/service_type.cc71
-rw-r--r--src/components/protocol_handler/CMakeLists.txt21
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h524
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h306
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_payload.h79
-rw-r--r--src/components/protocol_handler/include/protocol_handler/time_metric_observer.h56
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc1339
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc301
-rw-r--r--src/components/protocol_handler/src/protocol_payload.cc101
-rw-r--r--src/components/qt_hmi/CMakeLists.txt38
-rw-r--r--src/components/qt_hmi/Readme.txt7
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttfbin0 -> 246000 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttfbin0 -> 246040 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttfbin0 -> 260780 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttfbin0 -> 380840 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttfbin0 -> 314564 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttfbin0 -> 332128 bytes
-rw-r--r--src/components/qt_hmi/References/Look/ImageHardkey.qml52
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml378
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml9
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml69
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml111
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml57
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/FMLayout.qml217
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml152
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml61
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ListLayout.qml59
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml130
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml547
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml78
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/OffLayout.qml71
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml123
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml40
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml195
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/StartLayout.qml30
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml76
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml107
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml73
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/USBLayout.qml132
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml155
-rw-r--r--src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml373
-rw-r--r--src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject20
-rw-r--r--src/components/qt_hmi/References/Look/Resources/CButton.pngbin0 -> 4607 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psdbin0 -> 1111637 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.pngbin0 -> 40425 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/Map.pngbin0 -> 335952 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.pngbin0 -> 5760 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.pngbin0 -> 10538 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.pngbin0 -> 10625 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/compass.pngbin0 -> 3528 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.pngbin0 -> 2892 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.pngbin0 -> 2898 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/destIcon.pngbin0 -> 3097 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.pngbin0 -> 3000 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.pngbin0 -> 2894 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/OButton.pngbin0 -> 5287 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.pngbin0 -> 2861 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.pngbin0 -> 3859 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.pngbin0 -> 3911 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.pngbin0 -> 42473 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.pngbin0 -> 5292 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.pngbin0 -> 5251 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.pngbin0 -> 5059 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/blueBall.pngbin0 -> 2874 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.pngbin0 -> 2850 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.pngbin0 -> 13194 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.pngbin0 -> 2866 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.pngbin0 -> 11177 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.pngbin0 -> 11472 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.pngbin0 -> 11089 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.pngbin0 -> 11325 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/albumArt.pngbin0 -> 45068 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pause.pngbin0 -> 3276 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.pngbin0 -> 12559 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.pngbin0 -> 13816 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.pngbin0 -> 12335 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/play_9_9.pngbin0 -> 13219 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/cal.pngbin0 -> 3699 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/folders.pngbin0 -> 3337 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.pngbin0 -> 4426 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/sun.pngbin0 -> 4773 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.pngbin0 -> 10154 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/keySelected.pngbin0 -> 4396 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.pngbin0 -> 9590 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/muteActive.pngbin0 -> 5614 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.pngbin0 -> 4903 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.pngbin0 -> 10510 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.pngbin0 -> 11248 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.pngbin0 -> 8915 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.pngbin0 -> 4017 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.pngbin0 -> 8401 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.pngbin0 -> 8107 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.pngbin0 -> 3611 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.pngbin0 -> 8490 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.pngbin0 -> 5166 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.pngbin0 -> 4264 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.pngbin0 -> 13064 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.pngbin0 -> 12252 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ring.pngbin0 -> 10987 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/dn-arrow.pngbin0 -> 1097 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/g136p.pngbin0 -> 274 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/g137p.pngbin0 -> 357 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/arrow.pngbin0 -> 3745 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/car.pngbin0 -> 4114 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/gear.pngbin0 -> 4806 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/notes.pngbin0 -> 1962 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/phone.pngbin0 -> 2528 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/snow.pngbin0 -> 3976 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/DNDoff.pngbin0 -> 7073 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/DNDon.pngbin0 -> 5564 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/contacts.pngbin0 -> 4036 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/keypad.pngbin0 -> 3200 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/messages.pngbin0 -> 2576 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/more.pngbin0 -> 3447 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/recent.pngbin0 -> 3104 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/texts.pngbin0 -> 3917 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/scrollbar.pngbin0 -> 1008 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/slider.pngbin0 -> 1017 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/up-arrow.pngbin0 -> 1101 bytes
-rw-r--r--src/components/qt_hmi/References/Look/TextHardkey.qml52
-rw-r--r--src/components/qt_hmi/References/Look/Views/AM.qml86
-rw-r--r--src/components/qt_hmi/References/Look/Views/AMPCA.qml122
-rw-r--r--src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml151
-rw-r--r--src/components/qt_hmi/References/Look/Views/AuxPCA.qml41
-rw-r--r--src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/CDPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/Chrome.qml55
-rw-r--r--src/components/qt_hmi/References/Look/Views/ClimatePCA.qml74
-rw-r--r--src/components/qt_hmi/References/Look/Views/ControlMirror.qml55
-rw-r--r--src/components/qt_hmi/References/Look/Views/FM.qml94
-rw-r--r--src/components/qt_hmi/References/Look/Views/FMPCA.qml175
-rw-r--r--src/components/qt_hmi/References/Look/Views/GenListHandling.qml14
-rw-r--r--src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml87
-rw-r--r--src/components/qt_hmi/References/Look/Views/Home.qml50
-rw-r--r--src/components/qt_hmi/References/Look/Views/List.qml74
-rw-r--r--src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavInRoute.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml159
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavMenu.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavNoRoute.qml35
-rw-r--r--src/components/qt_hmi/References/Look/Views/Off.qml34
-rw-r--r--src/components/qt_hmi/References/Look/Views/On.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml104
-rw-r--r--src/components/qt_hmi/References/Look/Views/PhonePCA.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml61
-rw-r--r--src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/Sirius.qml71
-rw-r--r--src/components/qt_hmi/References/Look/Views/SiriusPCA.qml115
-rw-r--r--src/components/qt_hmi/References/Look/Views/SourceChange.qml73
-rw-r--r--src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml105
-rw-r--r--src/components/qt_hmi/References/Look/Views/Start.qml43
-rw-r--r--src/components/qt_hmi/References/Look/Views/USB.qml59
-rw-r--r--src/components/qt_hmi/References/Look/Views/USBPCA.qml49
-rw-r--r--src/components/qt_hmi/References/Look/Views/iPodPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml34
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml25
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml24
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml56
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml22
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml61
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml50
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml40
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml40
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml24
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml50
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml97
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml143
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml95
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml325
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/BaseText.qml50
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/CondText.qml14
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml45
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml31
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml32
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml41
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml35
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml31
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml60
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml28
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml78
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton.qml77
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml32
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml34
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml18
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdbbin0 -> 5516288 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes682
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml40
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml8
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml35
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml43
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml104
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js12
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml14
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml25
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml51
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js132
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml28
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml56
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml41
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml19
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml15
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir35
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro21
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop11
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas64.pngbin0 -> 3400 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas80.pngbin0 -> 4945 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop11
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/README.md37
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject19
-rwxr-xr-xsrc/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh8
-rwxr-xr-xsrc/components/qt_hmi/References/Work/bananasnacks/load_env.sh1
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/main.cpp17
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir2
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.pngbin0 -> 4369 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.pngbin0 -> 2975 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.pngbin0 -> 6876 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.pngbin0 -> 10475 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.pngbin0 -> 16926 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.pngbin0 -> 13849 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.pngbin0 -> 4471 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.pngbin0 -> 3848 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.pngbin0 -> 49513 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.pngbin0 -> 1035032 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.pngbin0 -> 16044 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.pngbin0 -> 5932 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.pngbin0 -> 2890 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.pngbin0 -> 8217 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.pngbin0 -> 7355 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.pngbin0 -> 6218 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.pngbin0 -> 3072 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.pngbin0 -> 5305 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.pngbin0 -> 4473 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.pngbin0 -> 5374 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.pngbin0 -> 5073 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.pngbin0 -> 6456 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.pngbin0 -> 3115 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.pngbin0 -> 3992 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.pngbin0 -> 4974 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.pngbin0 -> 55017 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.pngbin0 -> 4821 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.pngbin0 -> 6918 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.pngbin0 -> 2826 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.pngbin0 -> 4156 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.pngbin0 -> 7277 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.pngbin0 -> 4759 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.pngbin0 -> 5748 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.pngbin0 -> 3020 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.pngbin0 -> 4517 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.pngbin0 -> 9198 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.pngbin0 -> 5831 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.pngbin0 -> 5807 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.pngbin0 -> 3092 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.pngbin0 -> 8684 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.pngbin0 -> 6611 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.pngbin0 -> 395 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.pngbin0 -> 7897 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.pngbin0 -> 5832 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.pngbin0 -> 3149 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.pngbin0 -> 6570 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.pngbin0 -> 5976 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.pngbin0 -> 3592 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.pngbin0 -> 31003 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.pngbin0 -> 4741 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.pngbin0 -> 7070 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.pngbin0 -> 7500 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.pngbin0 -> 4767 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.pngbin0 -> 8214 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.pngbin0 -> 4698 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml9
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml32
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml36
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml24
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml40
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml9
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml7
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml129
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml43
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml40
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml46
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml30
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml5
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml29
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml72
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml34
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml59
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml34
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml14
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swpbin0 -> 12288 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml29
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml46
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml54
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml59
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swpbin0 -> 12288 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml64
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml63
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml57
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml205
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml20
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml21
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml23
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml55
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml54
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml62
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml60
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml68
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml144
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml51
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml133
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml55
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml49
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml37
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml17
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml79
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h33
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro48
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp470
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h87
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp792
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h170
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro21
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj328
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp31
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h16
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp6
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h18
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp6
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h47
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp263
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/CMakeLists.txt87
-rw-r--r--src/components/qt_hmi/qml_model_qt4/MainWindow.qml356
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml68
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml87
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml143
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml108
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml134
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/Icon.qml65
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml240
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/Pager.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml106
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml136
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml49
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js39
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml104
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml42
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js7
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml88
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml127
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml115
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml449
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml749
-rw-r--r--src/components/qt_hmi/qml_model_qt4/log4cxx.properties41
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml57
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml91
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/Constants.js249
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml510
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml58
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/Internal.js163
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml112
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml72
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml52
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml43
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml51
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml234
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml285
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml56
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml81
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml149
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml214
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml71
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml111
-rw-r--r--src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject20
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml123
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml62
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml63
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml102
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml118
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml86
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml173
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml73
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml325
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml250
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml221
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml205
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml171
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml55
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml160
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml223
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml194
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml120
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml216
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml284
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml46
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml201
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml135
-rw-r--r--src/components/qt_hmi/qml_model_qt5/CMakeLists.txt87
-rw-r--r--src/components/qt_hmi/qml_model_qt5/MainWindow.qml462
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml68
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml87
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml108
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml133
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/Icon.qml65
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml246
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/Pager.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml106
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml136
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml49
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js39
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml97
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml42
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js7
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml187
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml246
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml38
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml203
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml725
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml114
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml764
-rw-r--r--src/components/qt_hmi/qml_model_qt5/log4cxx.properties41
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml59
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/Constants.js250
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml659
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/Internal.js176
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml124
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml72
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml50
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml43
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml51
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml401
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml234
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml290
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml56
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml82
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml157
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml153
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml150
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml217
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml71
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml104
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml113
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml96
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml112
-rw-r--r--src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject20
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml126
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml62
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml63
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml102
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml118
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml82
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml86
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml73
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml302
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml250
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml221
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml205
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml171
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml55
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml160
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml117
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml223
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml179
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml120
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml176
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml88
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml293
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml46
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml202
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml135
-rw-r--r--src/components/qt_hmi/qml_plugins/CMakeLists.txt41
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt164
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc93
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h65
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc97
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h70
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc46
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h64
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h61
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h94
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h236
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h47
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc68
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h42
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt85
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc39
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h64
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc58
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h59
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc155
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h89
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h47
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt86
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc108
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h77
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt84
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc59
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h65
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc52
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h59
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h47
-rw-r--r--src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST2
-rw-r--r--src/components/qt_hmi/res/SPT.pngbin0 -> 11718 bytes
-rw-r--r--src/components/qt_hmi/res/album_art.pngbin0 -> 45068 bytes
-rw-r--r--src/components/qt_hmi/res/app_911_assist.pngbin0 -> 6982 bytes
-rw-r--r--src/components/qt_hmi/res/app_vehicle_info.pngbin0 -> 4842 bytes
-rw-r--r--src/components/qt_hmi/res/apps.pngbin0 -> 5957 bytes
-rw-r--r--src/components/qt_hmi/res/arrow.pngbin0 -> 3745 bytes
-rw-r--r--src/components/qt_hmi/res/blue_ball.pngbin0 -> 2874 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/long_oval_btn.pngbin0 -> 5251 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/long_oval_pressed_btn.pngbin0 -> 5042 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/longest_oval_btn.pngbin0 -> 5292 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.pngbin0 -> 4977 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_bottom.pngbin0 -> 2817 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_left.pngbin0 -> 3893 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_pressed_left.pngbin0 -> 3735 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_pressed_right.pngbin0 -> 3755 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_right.pngbin0 -> 3881 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_top.pngbin0 -> 2814 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_next_btn.pngbin0 -> 11472 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_next_pressed_btn.pngbin0 -> 11177 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_pause_btn.pngbin0 -> 6666 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_pause_pressed_btn.pngbin0 -> 6268 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_play_btn.pngbin0 -> 13219 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_play_pressed_btn.pngbin0 -> 12335 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_prev_btn.pngbin0 -> 11325 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_prev_pressed_btn.pngbin0 -> 11089 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/preset_btn.pngbin0 -> 8401 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/preset_pressed_btn.pngbin0 -> 8915 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/round_btn.pngbin0 -> 9590 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/round_pressed_btn.pngbin0 -> 10154 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/short_oval_btn.pngbin0 -> 5059 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/short_oval_btn_pressed.pngbin0 -> 4733 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/zoom.pngbin0 -> 8490 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/zoom_pressed.pngbin0 -> 8107 bytes
-rw-r--r--src/components/qt_hmi/res/car.pngbin0 -> 4114 bytes
-rw-r--r--src/components/qt_hmi/res/change_devices.pngbin0 -> 5188 bytes
-rw-r--r--src/components/qt_hmi/res/climate/AC_off.pngbin0 -> 3566 bytes
-rw-r--r--src/components/qt_hmi/res/climate/AC_on.pngbin0 -> 3871 bytes
-rw-r--r--src/components/qt_hmi/res/climate/climate_round_off_btn.pngbin0 -> 12252 bytes
-rw-r--r--src/components/qt_hmi/res/climate/climate_round_on_btn.pngbin0 -> 13064 bytes
-rw-r--r--src/components/qt_hmi/res/climate/defrost_off.pngbin0 -> 3887 bytes
-rw-r--r--src/components/qt_hmi/res/climate/defrost_on.pngbin0 -> 3509 bytes
-rw-r--r--src/components/qt_hmi/res/climate/face_off.pngbin0 -> 3593 bytes
-rw-r--r--src/components/qt_hmi/res/climate/face_on.pngbin0 -> 3931 bytes
-rw-r--r--src/components/qt_hmi/res/climate/feet_off.pngbin0 -> 3568 bytes
-rw-r--r--src/components/qt_hmi/res/climate/feet_on.pngbin0 -> 3878 bytes
-rw-r--r--src/components/qt_hmi/res/climate/headed_dash_off.pngbin0 -> 3638 bytes
-rw-r--r--src/components/qt_hmi/res/climate/headed_dash_on.pngbin0 -> 3326 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_seat_off.pngbin0 -> 3967 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_seat_on.pngbin0 -> 4406 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_wheel_off.pngbin0 -> 3807 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_wheel_on.pngbin0 -> 4272 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/DownButton.pngbin0 -> 4688 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/DownButton_pressed.pngbin0 -> 4612 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/LeftButton.pngbin0 -> 5170 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/LeftButton_pressed.pngbin0 -> 5269 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/OkButton.pngbin0 -> 4497 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/OkButton_pressed.pngbin0 -> 4622 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/RightButton.pngbin0 -> 5242 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/RightButton_pressed.pngbin0 -> 5138 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/UpButton.pngbin0 -> 4553 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/UpButton_pressed.pngbin0 -> 4681 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/backGroundControllButtons.pngbin0 -> 3157 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrButton.pngbin0 -> 5429 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrButton_pressed.pngbin0 -> 6165 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrImage.pngbin0 -> 2461 bytes
-rw-r--r--src/components/qt_hmi/res/find_apps.pngbin0 -> 4085 bytes
-rw-r--r--src/components/qt_hmi/res/gear.pngbin0 -> 4806 bytes
-rw-r--r--src/components/qt_hmi/res/hd_logo_off.pngbin0 -> 3543 bytes
-rw-r--r--src/components/qt_hmi/res/hd_logo_on.pngbin0 -> 3609 bytes
-rw-r--r--src/components/qt_hmi/res/initial.wavbin0 -> 46834 bytes
-rw-r--r--src/components/qt_hmi/res/install_apps.pngbin0 -> 6517 bytes
-rw-r--r--src/components/qt_hmi/res/nav/compass.pngbin0 -> 3552 bytes
-rw-r--r--src/components/qt_hmi/res/nav/current_street.pngbin0 -> 5491 bytes
-rw-r--r--src/components/qt_hmi/res/nav/delete_icon.pngbin0 -> 2892 bytes
-rw-r--r--src/components/qt_hmi/res/nav/delete_icon_black.pngbin0 -> 2898 bytes
-rw-r--r--src/components/qt_hmi/res/nav/dest_icon.pngbin0 -> 3097 bytes
-rw-r--r--src/components/qt_hmi/res/nav/dest_icon_black.pngbin0 -> 3000 bytes
-rw-r--r--src/components/qt_hmi/res/nav/map.pngbin0 -> 332637 bytes
-rw-r--r--src/components/qt_hmi/res/nav/mute_off.pngbin0 -> 11248 bytes
-rw-r--r--src/components/qt_hmi/res/nav/mute_on.pngbin0 -> 4334 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options.pngbin0 -> 10625 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options_in_active.pngbin0 -> 5760 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options_pressed.pngbin0 -> 10538 bytes
-rw-r--r--src/components/qt_hmi/res/nav/turnArrow.pngbin0 -> 2894 bytes
-rw-r--r--src/components/qt_hmi/res/notes.pngbin0 -> 1962 bytes
-rw-r--r--src/components/qt_hmi/res/phone/contacts.pngbin0 -> 4036 bytes
-rw-r--r--src/components/qt_hmi/res/phone/dnd_off.pngbin0 -> 7073 bytes
-rw-r--r--src/components/qt_hmi/res/phone/dnd_on.pngbin0 -> 5564 bytes
-rw-r--r--src/components/qt_hmi/res/phone/keypad.pngbin0 -> 3200 bytes
-rw-r--r--src/components/qt_hmi/res/phone/messages.pngbin0 -> 2576 bytes
-rw-r--r--src/components/qt_hmi/res/phone/more.pngbin0 -> 3447 bytes
-rw-r--r--src/components/qt_hmi/res/phone/phone.pngbin0 -> 2528 bytes
-rw-r--r--src/components/qt_hmi/res/phone/recent.pngbin0 -> 3104 bytes
-rw-r--r--src/components/qt_hmi/res/phone/texts.pngbin0 -> 3917 bytes
-rw-r--r--src/components/qt_hmi/res/snow.pngbin0 -> 3976 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/cal.pngbin0 -> 3699 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/folders.pngbin0 -> 3337 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/key_car.pngbin0 -> 4426 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/sun.pngbin0 -> 4773 bytes
-rw-r--r--src/components/qt_hmi/res/warning.pngbin0 -> 7546 bytes
-rw-r--r--src/components/qt_hmi/res/white_ball.pngbin0 -> 2866 bytes
-rw-r--r--src/components/resumption/CMakeLists.txt13
-rw-r--r--src/components/resumption/include/resumption/last_state.h80
-rw-r--r--src/components/resumption/src/last_state.cc78
-rw-r--r--src/components/rpc_base/CMakeLists.txt21
-rw-r--r--src/components/rpc_base/include/rpc_base/gtest_support.h62
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h415
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h449
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_inl.h681
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h387
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_message.h98
-rw-r--r--src/components/rpc_base/include/rpc_base/validation_report.h119
-rw-r--r--src/components/rpc_base/src/rpc_base/rpc_base.cc37
-rw-r--r--src/components/security_manager/CMakeLists.txt19
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_impl.h108
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h210
-rw-r--r--src/components/security_manager/include/security_manager/security_query.h186
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc202
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc367
-rw-r--r--src/components/security_manager/src/security_query.cc183
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc287
-rw-r--r--src/components/smart_objects/CMakeLists.txt26
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h63
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h63
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h124
-rw-r--r--src/components/smart_objects/include/smart_objects/bool_schema_item.h65
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h130
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h255
-rw-r--r--src/components/smart_objects/include/smart_objects/errors.h70
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h179
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h132
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h114
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item_parameter.h104
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h952
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h113
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h89
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc49
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc48
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc109
-rw-r--r--src/components/smart_objects/src/bool_schema_item.cc57
-rw-r--r--src/components/smart_objects/src/default_shema_item.cc32
-rw-r--r--src/components/smart_objects/src/enum_schema_item.cc32
-rw-r--r--src/components/smart_objects/src/number_schema_item.cc54
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc173
-rw-r--r--src/components/smart_objects/src/schema_item.cc65
-rw-r--r--src/components/smart_objects/src/smart_object.cc880
-rw-r--r--src/components/smart_objects/src/smart_schema.cc68
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc80
-rw-r--r--src/components/time_tester/CMakeLists.txt30
-rw-r--r--src/components/time_tester/include/time_tester/application_manager_metric.h56
-rw-r--r--src/components/time_tester/include/time_tester/application_manager_observer.h55
-rw-r--r--src/components/time_tester/include/time_tester/json_keys.h52
-rw-r--r--src/components/time_tester/include/time_tester/metric_wrapper.h59
-rw-r--r--src/components/time_tester/include/time_tester/protocol_handler_metric.h51
-rw-r--r--src/components/time_tester/include/time_tester/protocol_handler_observer.h56
-rw-r--r--src/components/time_tester/include/time_tester/time_manager.h94
-rw-r--r--src/components/time_tester/include/time_tester/transport_manager_metric.h49
-rw-r--r--src/components/time_tester/include/time_tester/transport_manager_observer.h54
-rw-r--r--src/components/time_tester/src/application_manager_metric.cc54
-rw-r--r--src/components/time_tester/src/application_manager_observer.cc49
-rw-r--r--src/components/time_tester/src/metric_wrapper.cc46
-rw-r--r--src/components/time_tester/src/protocol_handler_metric.cc51
-rw-r--r--src/components/time_tester/src/protocol_handler_observer.cc72
-rw-r--r--src/components/time_tester/src/time_manager.cc242
-rw-r--r--src/components/time_tester/src/transport_manager_metric.cc51
-rw-r--r--src/components/time_tester/src/transport_manager_observer.cc63
-rw-r--r--src/components/transport_manager/CMakeLists.txt127
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h98
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h128
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h181
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h83
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h81
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h133
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h119
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h99
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_device.h148
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h112
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h83
-rw-r--r--src/components/transport_manager/include/transport_manager/time_metric_observer.h55
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h91
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/connection.h81
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h86
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h89
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h162
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h206
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h534
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h254
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h292
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_default.h71
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h461
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/common.h115
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h78
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h96
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h101
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h78
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h101
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h85
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h64
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h67
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h105
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device.h74
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h78
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc82
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device.cc112
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc497
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc132
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc161
-rw-r--r--src/components/transport_manager/src/tcp/dnssd_service_browser.cc381
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc286
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc79
-rw-r--r--src/components/transport_manager/src/tcp/tcp_device.cc153
-rw-r--r--src/components/transport_manager/src/tcp/tcp_socket_connection.cc121
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc158
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc357
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc845
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc277
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc107
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc987
-rw-r--r--src/components/transport_manager/src/usb/libusb/platform_usb_device.cc85
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc348
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_handler.cc474
-rw-r--r--src/components/transport_manager/src/usb/qnx/platform_usb_device.cc79
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_connection.cc404
-rw-r--r--src/components/transport_manager/src/usb/qnx/usb_handler.cc302
-rw-r--r--src/components/transport_manager/src/usb/usb_aoa_adapter.cc90
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc100
-rw-r--r--src/components/transport_manager/src/usb/usb_device_scanner.cc258
-rw-r--r--src/components/utils/CMakeLists.txt64
-rw-r--r--src/components/utils/include/utils/appenders_loader.h51
-rw-r--r--src/components/utils/include/utils/back_trace.h75
-rw-r--r--src/components/utils/include/utils/bitstream.h170
-rw-r--r--src/components/utils/include/utils/file_system.h241
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h80
-rw-r--r--src/components/utils/include/utils/resource_usage.h168
-rw-r--r--src/components/utils/include/utils/signals.h41
-rw-r--r--src/components/utils/include/utils/singleton.h179
-rw-r--r--src/components/utils/include/utils/stl_utils.h81
-rw-r--r--src/components/utils/include/utils/system.h93
-rw-r--r--src/components/utils/include/utils/threads/pulse_thread_delegate.h96
-rw-r--r--src/components/utils/include/utils/threads/thread_manager.h117
-rw-r--r--src/components/utils/include/utils/threads/thread_validator.h105
-rw-r--r--src/components/utils/src/appenders_loader.cc55
-rw-r--r--src/components/utils/src/back_trace.cc107
-rw-r--r--src/components/utils/src/bitstream.cc132
-rw-r--r--src/components/utils/src/conditional_variable_posix.cc136
-rw-r--r--src/components/utils/src/date_time.cc102
-rw-r--r--src/components/utils/src/file_system.cc423
-rw-r--r--src/components/utils/src/lock_posix.cc150
-rw-r--r--src/components/utils/src/log_message_loop_thread.cc56
-rw-r--r--src/components/utils/src/logger_status.cc39
-rw-r--r--src/components/utils/src/push_log.cc68
-rw-r--r--src/components/utils/src/resource_usage.cc192
-rw-r--r--src/components/utils/src/rwlock_posix.cc70
-rw-r--r--src/components/utils/src/signals_linux.cc50
-rw-r--r--src/components/utils/src/system.cc167
-rw-r--r--src/components/utils/src/threads/posix_thread.cc259
-rw-r--r--src/components/utils/src/threads/pulse_thread_delegate.cc116
-rw-r--r--src/components/utils/src/threads/thread_manager.cc115
-rw-r--r--src/components/utils/src/threads/thread_validator.cc92
-rw-r--r--src/components/utils/test/CMakeLists.txt17
-rw-r--r--src/components/utils/test/date_time_test.cc128
-rw-r--r--src/components/utils/test/file_system_test.cc111
-rw-r--r--src/components/utils/test/main.cc7
2346 files changed, 278683 insertions, 0 deletions
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
new file mode 100644
index 0000000000..fc1f0c63c7
--- /dev/null
+++ b/src/components/CMakeLists.txt
@@ -0,0 +1,94 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# --- HMI_API interfaces
+add_subdirectory(./interfaces)
+
+# --- ProtocolHandler
+add_subdirectory(./protocol)
+
+# --- TransportManager
+add_subdirectory(./transport_manager)
+
+# --- Policies
+add_subdirectory(./resumption)
+
+# --- formatters
+add_subdirectory(./formatters)
+
+# --- ProtocolHandler
+add_subdirectory(./protocol_handler)
+
+# --- ConnectionHandler
+add_subdirectory(./connection_handler)
+
+# --- Utils
+add_subdirectory(./utils)
+
+# --- Security manager
+if(ENABLE_SECURITY)
+ add_subdirectory(./security_manager)
+endif()
+#
+# --- Policy_impl
+add_subdirectory(./policy)
+
+# --- Validated types
+add_subdirectory(./rpc_base)
+
+# --- SmartObjects
+add_subdirectory(./smart_objects)
+
+# --- Application manager
+add_subdirectory(./application_manager)
+
+# --- HMI Message Handler
+add_subdirectory(./hmi_message_handler)
+
+# --- Config
+add_subdirectory(./config_profile)
+
+# --- AudioManager
+add_subdirectory(./media_manager)
+
+if (TIME_TESTER)
+ add_subdirectory(./time_tester)
+endif()
+
+
+if (${HMI_DBUS_API})
+# --- DBus
+ add_subdirectory(./dbus)
+endif ()
+if (${QT_HMI})
+# --- Qt HMI
+ add_subdirectory(./qt_hmi)
+endif ()
+
diff --git a/src/components/HMI/IVSU/PROPRIETARY_REQUEST b/src/components/HMI/IVSU/PROPRIETARY_REQUEST
new file mode 100644
index 0000000000..ab0a27b552
--- /dev/null
+++ b/src/components/HMI/IVSU/PROPRIETARY_REQUEST
@@ -0,0 +1,2 @@
+4Ezay^ק<yi'*';(*'-N)z:nx:Rǂi^^笴ǭO9$ySgږ爞ZDžYhږǜzۭקoj[nruZL
+w>^7k͆
diff --git a/src/components/HMI/IVSU/PROPRIETARY_REQUEST~ b/src/components/HMI/IVSU/PROPRIETARY_REQUEST~
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/components/HMI/IVSU/PROPRIETARY_REQUEST~
diff --git a/src/components/HMI/app/AppViews.js b/src/components/HMI/app/AppViews.js
new file mode 100644
index 0000000000..ec31c13399
--- /dev/null
+++ b/src/components/HMI/app/AppViews.js
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL
+ * @desc Setup application container for all views
+ * @category Application
+ * @filesource app/AppViews.js
+ * @version 1.0
+ */
+
+/** Appending views */
+SDL.AppViews = Em.ContainerView.extend( {
+
+ elementId: 'app',
+
+ childViews: [
+ SDL.HomeView,
+ SDL.MediaView,
+ SDL.NavigationAppView,
+ SDL.InfoView,
+ SDL.PhoneView,
+ SDL.ClimateView,
+ SDL.NavigationView,
+ SDL.ControlButtons,
+ SDL.SettingsView,
+ SDL.TurnByTurnView,
+ SDL.TBTTurnList,
+ SDL.OptionsView,
+ SDL.InteractionChoicesView,
+ SDL.Keyboard,
+ SDL.VRHelpListView,
+ SDL.ScrollableMessage,
+ SDL.SliderView,
+ SDL.StatusClimateView,
+ SDL.StatusMediaView,
+ SDL.StatusNavigationView,
+ SDL.StatusInfoView,
+ SDL.StatusPhoneView,
+ SDL.TopControls,
+ SDL.BottomControls,
+ SDL.TTSPopUp,
+ SDL.AlertPopUp,
+ SDL.AlertManeuverPopUp,
+ SDL.AudioPassThruPopUp,
+ SDL.VRPopUp,
+ SDL.VehicleInfo,
+ SDL.TBTClientStateView,
+ SDL.DriverDistraction,
+ SDL.ExitApp,
+ SDL.SystemRequest
+ ],
+
+ /*
+ * This method is called when the app is fully rendered and ready to be
+ * displayed. We notify the backend to hide the splash and load internal
+ * view modules
+ */
+ didInsertElement: function() {
+
+ this._super();
+
+ SDL.set('appReady', true);
+
+ $(window).bind("beforeunload", function(e) {
+
+ FFW.BasicCommunication.OnIgnitionCycleOver();
+
+ FFW.BasicCommunication.disconnect();
+ FFW.UI.disconnect();
+ FFW.VR.disconnect();
+ FFW.VehicleInfo.disconnect();
+ FFW.TTS.disconnect();
+ FFW.Buttons.disconnect();
+ FFW.Navigation.disconnect();
+
+ if(confirm('The "ignition off" emulation executed!')){
+ return 'OK, Good Bye then';
+ }
+ else {
+ e = e || event;
+ if (e.preventDefault) {
+ e.preventDefault();
+ }
+ e.returnValue = false;
+ return 'The "ignition off" emulation executed!';
+ }
+ })
+
+ }
+});
diff --git a/src/components/HMI/app/Flags.js b/src/components/HMI/app/Flags.js
new file mode 100644
index 0000000000..c1e755a510
--- /dev/null
+++ b/src/components/HMI/app/Flags.js
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL
+ * @desc flags for application flags used for diffeerent configurations of
+ * application As the same code base is used fro Production and RnD work
+ * pakackages, it is necessary to configare application for different
+ * needs/releases It is NOT recommended to extend this object with new
+ * flags. Each modification should be discussed with PM in advance
+ * @category Application
+ * @filesource app/AppFlags.js
+ * @version 1.0
+ */
+
+FLAGS = Em.Object.create( {
+ /**
+ * Set language for localization
+ */
+ SET_LOCALIZATION: 'eng',
+
+ WEBSOCKET_URL: "ws://127.0.0.1:8087",
+
+ TOUCH_EVENT_STARTED: false,
+
+ BC: true,
+
+ UI: true,
+
+ VI: true,
+
+ VR: true,
+
+ Buttons: true,
+
+ TTS: true,
+
+ Navi: true
+
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/SDLApp.js b/src/components/HMI/app/SDLApp.js
new file mode 100644
index 0000000000..bbe4644008
--- /dev/null
+++ b/src/components/HMI/app/SDLApp.js
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL
+ * @desc Setup application namespace and settings
+ * @category Application
+ * @filesource app/App.js
+ * @version 1.0
+ */
+
+SDL = Em.Application.create( {
+
+ /** Override for mouse/touch events */
+ customEvents: ('ontouchstart' in document.documentElement) ? {
+ touchstart: 'actionDown',
+ touchend: 'actionUp',
+ touchmove: 'actionMove'
+ } : {
+ mousedown: 'actionDown',
+ mouseup: 'actionUp',
+ mousemove: 'actionMove'
+ },
+
+ /** Help mode flag {boolean} */
+ helpMode: false,
+
+ // determine home view {string}
+ homeView: 'home',
+
+ /** Set language for localization */
+ localization: 'eng',
+
+ // Application ready flag
+ appReady: false,
+
+ // Debug text
+ debugText: 'debug&nbsp;mode',
+
+ init: function() {
+
+ Em.Logger.log('SDL: Application init!');
+
+ this._super();
+ },
+
+ /** Application ready event */
+ ready: function() {
+
+ Em.Logger.log('SDL: Application ready!');
+
+ /** State manager init */
+ SDL.States = StateManager.create();
+
+ /** container for all views */
+ SDL.views = SDL.AppViews.create().appendTo('body');
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/StateManager.js b/src/components/HMI/app/StateManager.js
new file mode 100644
index 0000000000..b11ce0b835
--- /dev/null
+++ b/src/components/HMI/app/StateManager.js
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.States
+ * @desc State manager definition
+ * @category State Manager
+ * @filesource app/StateManager.js
+ * @version 1.0
+ */
+
+ // Extend base Em.State object
+Em.State.reopen({
+
+ // used for determine display status
+ active: false,
+
+ enter: function () {
+
+ this.set('active', true);
+ },
+
+ exit: function () {
+
+ this.set('active', false);
+ SDL.SDLController.triggerState();
+ }
+});
+
+// State Manager class
+var StateManager = Em.StateManager.extend({
+
+ // default state
+ initialState: 'home',
+
+ /**
+ * Name of the next state to which at the moment is a transition
+ */
+ nextState: 'home',
+
+ /**
+ * Method used for determine previous currentState and make
+ */
+ goToStates: function (stateName) {
+
+ SDL.SDLController.userStateAction();
+ this.set('nextState', stateName);
+ this.transitionTo(stateName);
+ },
+
+ /** Go to parent state */
+ back: function () {
+
+ if (this.currentState.parentState.hasOwnProperty('name')) {
+ this.goToStates(this.currentState.parentState.get('path'));
+ } else {
+ this.goToStates('home');
+ }
+
+ SDL.StateVisitor.visit(this.currentState);
+ },
+
+ /** Home state */
+ home: Em.State.create({
+
+ }),
+
+ /** Climate state */
+ climate: Em.State.create({
+
+ }),
+
+ /** info state */
+ info: Em.State.create({
+
+ exit: function () {
+
+ SDL.InfoController.set('activeState', SDL.States.currentState.get('path'));
+ this._super();
+ },
+
+ services: Em.State.create({
+
+ }),
+
+ travelLink: Em.State.create({
+
+ }),
+
+ alerts: Em.State.create({
+
+ }),
+
+ calendar: Em.State.create({
+
+ }),
+
+ apps: Em.State.create({
+
+ /**
+ * Calls function from BasicCommunicationRPC to get new list of
+ * applications
+ */
+ enter: function () {
+
+ this._super();
+ FFW.BasicCommunication.OnFindApplications();
+ }
+ }),
+
+ devicelist: Em.State.create({
+ /**
+ * Calls function to clear device list on DeviceListView
+ */
+ enter: function () {
+
+ this._super();
+ SDL.DeviceListView.clearDeviceList();
+ FFW.BasicCommunication.OnStartDeviceDiscovery();
+ }
+ }),
+
+ nonMedia: Em.State.create({
+
+ enter: function () {
+
+ this._super();
+ SDL.SDLController.activateTBT();
+ },
+
+ exit: function () {
+
+ this._super();
+
+ SDL.SDLAppController.deactivateApp();
+ }
+ })
+ }),
+
+ /** settings state */
+ settings: Em.State.create({
+
+ exit: function () {
+
+ SDL.SettingsController.set('activeState', SDL.States.currentState.get('path'));
+ this._super();
+ },
+
+ policies: Em.State.create({
+ statisticsInfo: Em.State.create({
+
+ }),
+
+ deviceConfig: Em.State.create({
+
+ enter: function () {
+
+ this._super();
+ SDL.DeviceConfigView.showDeviceList();
+ }
+ }),
+
+ appPermissionsList: Em.State.create({
+
+ enter: function () {
+
+ this._super();
+
+ }
+ }),
+
+ appPermissions: Em.State.create({
+
+ }),
+
+ systemError: Em.State.create({
+
+ }),
+
+ deviceStateChange: Em.State.create({
+
+ enter: function () {
+
+ this._super();
+ SDL.DeviceStateChangeView.showDeviceList();
+ }
+ })
+ })
+ }),
+
+ /** Media state */
+ media: Em.State.create({
+
+ exit: function () {
+
+ SDL.MediaController.set('activeState', SDL.States.currentState.get('path'));
+ this._super();
+ },
+
+ player: Em.State.create({
+
+ enter: function () {
+
+ this._super();
+ if (SDL.SDLModel.stateLimited) {
+
+ FFW.BasicCommunication.OnAppDeactivated('AUDIO', SDL.SDLModel.stateLimited);
+ SDL.SDLModel.stateLimited = null;
+ SDL.SDLModel.set('limitedExist', false);
+ }
+ }
+ }),
+
+ sdlmedia: Em.State.create({
+
+ enter: function () {
+
+ this._super();
+ SDL.SDLController.activateTBT();
+ },
+
+ exit: function () {
+
+ this._super();
+
+ SDL.SDLModel.stateLimited = SDL.SDLAppController.model.appID;
+ SDL.SDLModel.set('limitedExist', true);
+ SDL.SDLAppController.deactivateApp();
+ }
+
+ })
+ }),
+
+ navigationApp: Em.State.create({
+
+ baseNavigation: Em.State.create({
+
+ }),
+
+ exit: function () {
+
+ this._super();
+
+ SDL.SDLModel.stateLimited = SDL.SDLAppController.model.appID;
+ SDL.SDLModel.set('limitedExist', true);
+ SDL.SDLAppController.deactivateApp();
+ }
+ }),
+
+ /** Navigation state */
+ navigation: Em.State.create({
+
+ }),
+
+ /** Phone state */
+ phone: Em.State.create({
+
+ dialpad: Em.State.create({
+
+ })
+ })
+});
diff --git a/src/components/HMI/app/controller/AppController.js b/src/components/HMI/app/controller/AppController.js
new file mode 100644
index 0000000000..c655463391
--- /dev/null
+++ b/src/components/HMI/app/controller/AppController.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.AppController
+ * @desc App general logic
+ * @category Controller
+ * @filesource app/controller/AppController.js
+ * @version 1.0
+ */
+
+SDL.AppController = Em.Object.create( {
+ active: false
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/InfoController.js b/src/components/HMI/app/controller/InfoController.js
new file mode 100644
index 0000000000..8ad129dd4f
--- /dev/null
+++ b/src/components/HMI/app/controller/InfoController.js
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoController
+ * @desc Info Controller logic
+ * @category Controller
+ * @filesource app/controller/InfoController.js
+ * @version 1.0
+ */
+
+SDL.InfoController = Em.Object.create( {
+
+ activeState: 'info.apps',
+
+ hiddenLeftMenu: false,
+
+ onState: function(event) {
+
+ SDL.States.goToStates('info.' + event.goToState);
+ },
+
+ onChildState: function(event) {
+
+ SDL.States.goToStates(SDL.States.currentState.get('path') + '.'
+ + event.goToState);
+ },
+
+ /**
+ * Switching on Application
+ */
+ turnOnSDL: function () {
+
+ //SDL.CDModel.set('active', false);
+ /**
+ * Set SDL Data active, flag for status bar
+ */
+ if (SDL.SDLAppController.model) {
+ SDL.SDLAppController.model.set('active', true);
+ }
+ /**
+ * Go to SDL state
+ */
+ if (SDL.SDLAppController.model.appType) {
+ for (var i = 0; i < SDL.SDLAppController.model.appType.length; i++) {
+ if (SDL.SDLAppController.model.appType[i] == "NAVIGATION") {
+ SDL.BaseNavigationView.update();
+ SDL.States.goToStates('navigationApp.baseNavigation');
+ return;
+ }
+ }
+ }
+
+ SDL.States.goToStates('info.nonMedia');
+ //SDL.States.goToStates('media.sdlmedia');
+
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/MediaController.js b/src/components/HMI/app/controller/MediaController.js
new file mode 100644
index 0000000000..45b46437be
--- /dev/null
+++ b/src/components/HMI/app/controller/MediaController.js
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.MediaController
+ * @desc Media module logic
+ * @category Controller
+ * @filesource app/controller/MediaController.js
+ * @version 1.0
+ */
+SDL.MediaController = Em.Object.create({
+
+ /**
+ * Initial substate
+ */
+ activeState: 'media.player',
+
+ /**
+ * Turn on CD
+ */
+ turnOnCD: function () {
+
+ if (!SDL.States.media.player.active) {
+ SDL.States.goToStates('media.player');
+ }
+
+ if (SDL.SDLAppController.model) {
+ SDL.SDLAppController.model.set('active', false);
+ }
+ SDL.CDModel.set('active', true);
+ },
+
+ /**
+ * Switching on Application
+ */
+ turnOnSDL: function () {
+
+ SDL.CDModel.set('active', false);
+ /**
+ * Set SDL Data active, flag for status bar
+ */
+ if (SDL.SDLAppController.model) {
+ SDL.SDLAppController.model.set('active', true);
+ }
+ /**
+ * Go to SDL state
+ */
+ if (SDL.SDLAppController.model.appType) {
+ for (var i = 0; i < SDL.SDLAppController.model.appType.length; i++) {
+ if (SDL.SDLAppController.model.appType[i] == "NAVIGATION") {
+ SDL.BaseNavigationView.update();
+ SDL.States.goToStates('navigationApp.baseNavigation');
+ return;
+ }
+ }
+ }
+
+ SDL.States.goToStates('media.sdlmedia');
+
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/PhoneController.js b/src/components/HMI/app/controller/PhoneController.js
new file mode 100644
index 0000000000..dd722df80d
--- /dev/null
+++ b/src/components/HMI/app/controller/PhoneController.js
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PhoneController
+ * @desc Phone module logic
+ * @category Controller
+ * @filesource app/controller/PhoneController.js
+ * @version 1.0
+ */
+
+SDL.PhoneController = Em.Object.create( {
+
+ /** Model binding */
+ modelBinding: "SDL.PhoneModel",
+
+ /** Dialpad delete key press handeler */
+ onDelete: function() {
+
+ this.model.deleteDialpadNumber();
+ },
+
+ /** Dial call handeler */
+ onEndCall: function() {
+
+ this.model.endCall();
+ },
+
+ /** Dial call handeler */
+ onDialCall: function() {
+
+ this.model.dialCall();
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/SettingsController.js b/src/components/HMI/app/controller/SettingsController.js
new file mode 100644
index 0000000000..e8f7c84653
--- /dev/null
+++ b/src/components/HMI/app/controller/SettingsController.js
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SettingsController
+ * @desc Info Controller logic
+ * @category Controller
+ * @filesource app/controller/SettingsController.js
+ * @version 1.0
+ */
+
+SDL.SettingsController = Em.Object.create( {
+
+ activeState: 'settings.policies',
+
+ hiddenLeftMenu: false,
+
+ /**
+ * File name for SDL.OnSystemRequest
+ * Came in SDL.PolicyUpdate request
+ */
+ policyUpdateFile: null,
+
+ /**
+ * Data of current requested devices which access will be allowed or disallowed.
+ */
+ currentDeviceAllowance: null,
+
+ onState: function(event) {
+
+ SDL.States.goToStates('settings.' + event.goToState);
+ },
+
+ onChildState: function(event) {
+
+ SDL.States.goToStates(SDL.States.currentState.get('path') + '.'
+ + event.goToState);
+ },
+
+ getStatusUpdate: function(){
+ FFW.BasicCommunication.GetStatusUpdate();
+ },
+
+ phoneCall: function() {
+ if (SDL.SDLAppController.model) {
+ SDL.SDLModel.onDeactivateApp('call', SDL.SDLAppController.model.appID);
+ SDL.States.goToStates('phone.dialpad');
+ }
+ },
+
+ allDeviceAccess: function(){
+
+ var allowedValue, allowedText;
+
+ if (SDL.DeviceConfigView.globalConfigurationValue) {
+ SDL.DeviceConfigView.set('globalConfigurationValue', false);
+ allowedValue = false;
+ allowedText = " - Not allowed";
+ } else {
+ SDL.DeviceConfigView.set('globalConfigurationValue', true);
+ allowedValue = true;
+ allowedText = " - Allowed";
+ }
+
+ var dev = SDL.SDLModel.connectedDevices;
+ for (var key in dev) {
+ if (dev.hasOwnProperty(key)) {
+ dev[key].allowed = allowedValue;
+ }
+ }
+
+ SDL.DeviceConfigView.showDeviceList();
+
+ FFW.BasicCommunication.OnAllowSDLFunctionality(allowedValue, "GUI");
+ },
+
+ changeDeviceAccess: function(event) {
+
+ var dev = SDL.SDLModel.connectedDevices;
+ for (var key in dev) {
+
+ if (dev.hasOwnProperty(key)) {
+
+ if (dev[key].id == event.id) {
+
+ if (dev[key].allowed) {
+
+ dev[key].allowed = false;
+ event.set('text', event.name + " - Not allowed");
+ } else {
+
+ dev[key].allowed = true;
+ event.set('text', event.name + " - Allowed");
+ }
+
+ var device = {
+ "name": dev[key].name,
+ "id": dev[key].id
+ };
+
+ SDL.DeviceConfigView.set('globalConfigurationValue', null);
+
+ FFW.BasicCommunication.OnAllowSDLFunctionality(dev[key].allowed, "GUI", device);
+ break;
+ }
+ }
+ }
+ },
+
+ changeAppPermission: function(element) {
+
+ if (element.allowed) {
+
+ element.allowed = false;
+ element.set('text', element.name + " - Not allowed");
+ } else {
+
+ element.allowed = true;
+ element.set('text', element.name + " - Allowed");
+ }
+ },
+
+ /**
+ * Method to send request to update array with app permissions
+ *
+ * @param {Object} element
+ *
+ */
+ GetListOfPermissions: function(element) {
+ FFW.BasicCommunication.GetListOfPermissions(element.appID);
+ },
+
+ /**
+ * Method to update array with app permissions which came from SDL
+ *
+ * @param {Object} message
+ *
+ */
+ GetListOfPermissionsResponse: function(message) {
+
+ if (message.id in SDL.SDLModel.getListOfPermissionsPull) {
+
+ var appID = SDL.SDLModel.getListOfPermissionsPull[message.id],
+ messageCodes = [];
+
+ for (var i = 0; i < message.result.allowedFunctions.length; i++) {
+ messageCodes.push(message.result.allowedFunctions[i].name);
+ }
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.permissionsFriendlyMessageUpdate, appID, messageCodes);
+
+ SDL.AppPermissionsView.update(message.result.allowedFunctions, appID);
+
+ delete SDL.SDLModel.getListOfPermissionsPull[message.id];
+ }
+ },
+
+ /**
+ * Method to update array with app permissions with UserFriendlyMessage from SDL
+ *
+ * @param {Object} message
+ *
+ */
+ permissionsFriendlyMessageUpdate: function(message, appID) {
+
+ SDL.States.goToStates('settings.policies.appPermissions');
+ },
+
+ updateSDL: function() {
+ FFW.BasicCommunication.UpdateSDL();
+ },
+
+ getURLS: function() {
+ FFW.BasicCommunication.GetURLS();
+ },
+
+ AllowSDLFunctionality: function(messages) {
+
+ var str = '';
+
+ if (messages[0].line1) {
+ str += messages[0].line1;
+ }
+
+ if (messages[0].line2) {
+ str += messages[0].line2;
+ }
+
+ if (messages[0].textBody) {
+ str += messages[0].textBody;
+ }
+
+ if (str) {
+ SDL.PopUp.create().appendTo('body').popupActivate(messages[0].textBody, SDL.SettingsController.OnAllowSDLFunctionality);
+ } else {
+ SDL.PopUp.create().appendTo('body').popupActivate('WARNING!!!!!!!!!!!!!! There is no text from SDL in GetUserFriendlyMessage for DataConsent parameter!!! Please allow the device...', SDL.SettingsController.OnAllowSDLFunctionality);
+ }
+
+ },
+
+ userFriendlyMessagePopUp: function(appId, messageCode) {
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.PopUp.create().appendTo('body').popupActivate(message)}, appId, messageCode);
+ },
+
+ simpleParseUserFriendlyMessageData: function (messages) {
+ var tts = "",
+ text = "";
+
+ messages.forEach(function (x) {
+ if (x.ttsString) {
+ tts += x.ttsString;
+ }
+ if (x.textBody) {
+ text += x.textBody;
+ }
+ if (x.line1) {
+ text += x.line1;
+ }
+ if (x.line2) {
+ text += x.line2;
+ }
+ });
+
+ if (tts) {
+ SDL.TTSPopUp.ActivateTTS(tts);
+ }
+
+
+ if (text) {
+ SDL.PopUp.create().appendTo('body').popupActivate(text);
+ }
+ },
+
+ OnAllowSDLFunctionality: function(result) {
+
+ var dev = SDL.SDLModel.connectedDevices;
+ for (var key in dev) {
+ if (dev.hasOwnProperty(key)) {
+ if (dev[key].id == SDL.SettingsController.currentDeviceAllowance.id) {
+ dev[key].allowed = result;
+ }
+ }
+ }
+
+ SDL.DeviceConfigView.set('globalConfigurationValue', null);
+
+ SDL.DeviceConfigView.showDeviceList();
+
+ FFW.BasicCommunication.OnAllowSDLFunctionality(result, "GUI", SDL.SettingsController.currentDeviceAllowance);
+
+ SDL.SDLModel.connectedDevices[SDL.SettingsController.currentDeviceAllowance.id].sdlFunctionality.allowed = result;
+
+ SDL.SDLModel.connectedDevices[SDL.SettingsController.currentDeviceAllowance.id].sdlFunctionality.popUpId = null;
+
+ SDL.SettingsController.currentDeviceAllowance = null;
+ },
+
+ /**
+ * Method responsible for PolicyUpdate retry sequence
+ * abort parameter if set to true means that retry sequence if finished
+ *
+ * @param {Boolean} abort
+ */
+ policyUpdateRetry: function(abort) {
+
+ clearTimeout(SDL.SDLModel.policyUpdateRetry.timer);
+ SDL.SDLModel.policyUpdateRetry.timer = null;
+
+ if (abort !== "ABORT" && (SDL.SDLModel.policyUpdateRetry.try < SDL.SDLModel.policyUpdateRetry.retry.length)) {
+
+ SDL.SDLModel.policyUpdateRetry.oldTimer = SDL.SDLModel.policyUpdateRetry.oldTimer +
+ SDL.SDLModel.policyUpdateRetry.timeout * 1000 +
+ SDL.SDLModel.policyUpdateRetry.retry[SDL.SDLModel.policyUpdateRetry.try] * 1000;
+
+ SDL.SDLModel.policyUpdateRetry.timer = setTimeout(
+ function(){
+ FFW.BasicCommunication.OnSystemRequest(
+ "PROPRIETARY",
+ SDL.SDLModel.policyURLs[0].policyAppId,
+ SDL.SettingsController.policyUpdateFile,
+ SDL.SDLModel.policyURLs[0].url
+ );
+ SDL.SettingsController.policyUpdateRetry();
+ }, SDL.SDLModel.policyUpdateRetry.oldTimer
+ );
+
+ SDL.SDLModel.policyUpdateRetry.try++;
+ } else {
+ clearTimeout(SDL.SDLModel.policyUpdateRetry.timer);
+ SDL.SDLModel.policyUpdateRetry = {
+ timeout: null,
+ retry: [],
+ try: null,
+ timer: null,
+ oldTimer: 0
+ };
+ }
+ }
+});
diff --git a/src/components/HMI/app/controller/sdl/AppController.js b/src/components/HMI/app/controller/sdl/AppController.js
new file mode 100644
index 0000000000..784e7e8d1c
--- /dev/null
+++ b/src/components/HMI/app/controller/sdl/AppController.js
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLAppController
+ * @desc SDL abstract application controller
+ * @category Controller
+ * @filesource app/controller/sdl/AppController.js
+ * @version 1.0
+ */
+
+SDL.SDLAppController = Em.Object.create({
+
+ init: function () {
+
+ this._super();
+
+ //FFW.UI.set('isReady', true);
+ //FFW.Navigation.set('isReady', true);
+ },
+
+ /**
+ * Active application model binding type {SDLAppModel}
+ */
+ model: null,
+
+ /**
+ * Function to add application to application list
+ */
+ showAppList: function() {
+
+ SDL.InfoAppsView.showAppList();
+ SDL.AppPermissionsListView.showAppList();
+ }.observes('SDL.SDLModel.registeredApps.@each'),
+
+ /**
+ * Handeler for command button press
+ *
+ * @param element:
+ * SDL.Button
+ */
+ onCommand: function (element) {
+
+ if (element.commandID < 0) {
+
+ switch (element.commandID) {
+ case -1: {
+ FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID, "DRIVER_DISTRACTION_VIOLATION");
+ break;
+ }
+ case -2: {
+ FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID, "USER_EXIT");
+ break;
+ }
+ default: {
+ console.log("Unknown command with ID: " + element.commandID);
+ }
+ }
+
+ SDL.OptionsView.deactivate();
+ SDL.States.goToStates('info.apps');
+
+ } else if (element.menuID >= 0) {
+
+ // if subMenu
+ // activate driver destruction if necessary
+ if (SDL.SDLModel.driverDistractionState) {
+ SDL.DriverDistraction.activate();
+ } else {
+ this.onSubMenu(element.menuID);
+ }
+
+ return;
+ } else {
+
+ FFW.UI.onCommand(element.commandID, this.model.appID);
+ SDL.OptionsView.deactivate();
+ }
+ },
+
+ /**
+ * Handeler for VR command button press
+ *
+ * @param element: SDL.Button
+ */
+ VRPerformAction: function (element) {
+
+ SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode["SUCCESS"], element.commandID);
+
+ if (SDL.SDLModel.VRActive) {
+ SDL.SDLModel.toggleProperty('VRActive');
+ }
+ },
+
+ /**
+ * Open commands submenu
+ *
+ * @param {Number}
+ */
+ onSubMenu: function (id) {
+
+ this.model.set('currentSubMenuId', id);
+ },
+
+ /**
+ * Comparison function for sort array of buttons in options list by 'position' parameter
+ *
+ * @param {Number}
+ */
+ buttonsSort: function (arrayId, appID) {
+
+ SDL.SDLController.getApplicationModel(appID).commandsList[arrayId].sort(function (a, b) {
+ return a.position - b.position;
+ })
+ },
+
+ /**
+ * Handeler for command button press
+ *
+ * @param element:
+ * SDL.Button
+ */
+ onVRCommand: function (element) {
+
+ FFW.VR.onCommand(element.commandID, element.appID);
+ },
+
+ /**
+ * Handler for preform interaction choice send response to device and
+ * deactivate interactions window
+ *
+ * @param element:
+ * SDL.Button
+ */
+ onChoiceInteraction: function (element) {
+
+ SDL.InteractionChoicesView.deactivate("SUCCESS", element.choiceID);
+ },
+
+ /**
+ * Handeler for Navigation preform interaction choice send response to device and
+ * deactivate interactions window
+ *
+ * @param {Object}
+ */
+ onChoiceNaviInteraction: function(element) {
+
+ SDL.SDLModel.uiShowKeyboard();
+
+ FFW.UI.interactionResponse(SDL.SDLModel.resultCode["SUCCESS"], element.choiceID);
+
+ SDL.InteractionChoicesView.deactivate("SUCCESS");
+ },
+
+ /**
+ * Open commands list
+ */
+ openCommandsList: function () {
+
+ SDL.OptionsView.activate();
+ },
+
+ /**
+ * Notification of deactivation of current application model initiated in
+ * StateManager
+ */
+ deactivateApp: function () {
+
+ if (this.model) {
+ SDL.SDLModel.onDeactivateApp(SDL.States.nextState, this.model.appID);
+ }
+
+ SDL.SDLAppController.onSubMenu('top');
+ SDL.SDLAppController.model.set('tbtActivate', false);
+ this.set('model', null);
+ },
+
+ /**
+ * Method clears all applications data and unregister models
+ */
+ onSDLDisconected: function () {
+
+ var i = 0, apps = SDL.SDLModel.registeredApps;
+
+ for (i = 0; i < apps.length; i++) {
+ SDL.SDLModel.onAppUnregistered({
+ "appID": apps[i].appID
+ });
+ }
+ }
+});
diff --git a/src/components/HMI/app/controller/sdl/Controller.js b/src/components/HMI/app/controller/sdl/Controller.js
new file mode 100644
index 0000000000..7c3ba164ef
--- /dev/null
+++ b/src/components/HMI/app/controller/sdl/Controller.js
@@ -0,0 +1,887 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLController
+ * @desc Main SDL Controller
+ * @category Controller
+ * @filesource app/controller/sdl/SDLController.js
+ * @version 1.0
+ */
+SDL.SDLController = Em.Object
+ .create( {
+
+ init: function () {
+
+ /**
+ * Added object size counter
+ */
+ Object.size = function(obj) {
+ var size = 0, key;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) size++;
+ }
+ return size;
+ }
+
+ },
+
+ /**
+ * Current system context
+ *
+ * @type {String}
+ */
+ sysContext: function() {
+
+ if (SDL.VRPopUp.VRActive) {
+ return 'VRSESSION';
+ }
+ if (SDL.AlertPopUp.active) {
+ return 'ALERT';
+ }
+ if ( SDL.SliderView.active
+ || SDL.InteractionChoicesView.active
+ || SDL.ScrollableMessage.active
+ || SDL.SDLModel.AudioPassThruState
+ || SDL.Keyboard.active) {
+
+ return 'HMI_OBSCURED';
+ }
+ if (SDL.OptionsView.active) {
+ return 'MENU';
+ }
+
+ return 'MAIN';
+
+ }.property('SDL.OptionsView.active',
+ 'SDL.SliderView.active',
+ 'SDL.SDLModel.AudioPassThruState',
+ 'SDL.VRPopUp.VRActive',
+ 'SDL.AlertPopUp.active',
+ 'SDL.States.info.nonMedia.active',
+ 'SDL.States.media.sdlmedia.active',
+ 'SDL.States.navigationApp.baseNavigation.active',
+ 'SDL.ScrollableMessage.active',
+ 'SDL.InteractionChoicesView.active',
+ 'SDL.VRHelpListView.active',
+ 'SDL.Keyboard.active'),
+
+ /**
+ * Flag consider that previously alert request was received from SDL for app in BACKGROUND HMI level
+ * the applications appID will be stashed as current value
+ *
+ * @type number
+ */
+ backgroundAlertAppID: null,
+
+ /**
+ * List of SDL application models
+ *
+ * @type object
+ */
+ applicationModels: {
+ 0: SDL.SDLMediaModel,
+ 1: SDL.SDLNonMediaModel
+ },
+
+ /**
+ * Registered components handler
+ *
+ * @type object
+ */
+ activateTBT: function(){
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.tbtActivate) {
+ SDL.TurnByTurnView.activate(SDL.SDLAppController.model.appID);
+ }
+ },
+
+ /**
+ * Registered components handler
+ *
+ * @type object
+ */
+ registeredComponentStatus: function(component) {
+
+ for ( var i = 0; i < SDL.SDLModel.registeredComponents.length; i++) {
+ if (SDL.SDLModel.registeredComponents[i].type == component) {
+ SDL.SDLModel.set('registeredComponents.' + i + '.state', true);
+ return;
+ }
+ }
+ },
+
+ /**
+ * Registered components handler
+ *
+ * @type object
+ */
+ unregisterComponentStatus: function(component) {
+
+ for ( var i = 0; i < SDL.SDLModel.registeredComponents.length; i++) {
+ if (SDL.SDLModel.registeredComponents[i].type == component) {
+ SDL.SDLModel.set('registeredComponents.' + i + '.state', false);
+ return;
+ }
+ }
+ },
+
+ /**
+ * Notification from state manager about triggered state
+ * Method aborts all popups and requests currently in process
+ *
+ * @type object
+ */
+ triggerState: function(){
+ if (SDL.SliderView.active) {
+ SDL.SliderView.deactivate(false);
+ }
+ },
+
+ /**
+ * Notify SDLCore that HMI is ready and all components are registered
+ *
+ * @type {String}
+ */
+ componentsReadiness: function(component) {
+
+ for ( var i = 0; i < SDL.SDLModel.registeredComponents.length; i++) {
+ if (!SDL.SDLModel.registeredComponents[i].state) {
+ return;
+ }
+ }
+ FFW.BasicCommunication.onReady();
+ SDL.SDLModel.timeStamp = new Date().getTime();
+
+ console.log(SDL.SDLModel.timeStamp);
+
+ }.observes('SDL.SDLModel.registeredComponents.@each.state'),
+
+ /**
+ * Show VrHelpItems popup with necessary params
+ * if VRPopUp is active - show data from Global Properties
+ * if VRPopUp and InteractionChoicesView are active - show data from PerformInteraction request
+ *
+ */
+ showVRHelpItems: function() {
+
+ if (SDL.SDLAppController.model) {
+ if (SDL.SDLModel.VRActive && SDL.SDLModel.interactionData.vrHelp) {
+
+ SDL.SDLModel.ShowVrHelp(SDL.SDLModel.interactionData.vrHelpTitle, SDL.SDLModel.interactionData.vrHelp);
+ } else if (SDL.SDLModel.VRActive && !SDL.SDLModel.interactionData.vrHelp && SDL.SDLAppController.model.globalProperties.vrHelp) {
+
+ if (SDL.SDLAppController.model) {
+ SDL.SDLModel.ShowVrHelp(SDL.SDLAppController.model.globalProperties.vrHelpTitle, SDL.SDLAppController.model.globalProperties.vrHelp );
+ }
+ } else {
+ if (SDL.VRHelpListView.active) {
+ SDL.VRHelpListView.deactivate();
+ }
+ }
+ }
+ }.observes('SDL.SDLModel.VRActive', 'SDL.SDLModel.interactionData.vrHelp'),
+
+ /**
+ * Handler for Help button in VR menu
+ * triggers helpPrompt on HMI
+ *
+ */
+ vrHelpAction: function() {
+ if (SDL.SDLModel.interactionData.helpPrompt) {
+ SDL.SDLModel.onPrompt(SDL.SDLModel.interactionData.helpPrompt);
+ } else if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.helpPrompt.length) {
+ SDL.SDLModel.onPrompt(SDL.SDLAppController.model.globalProperties.helpPrompt);
+ }
+ },
+
+ /**
+ * Notify SDLCore that TTS haas finished processing
+ *
+ * @type {String}
+ */
+ TTSResponseHandler: function() {
+
+ if (FFW.TTS.requestId) {
+ if (FFW.TTS.aborted) {
+ FFW.TTS.sendError(SDL.SDLModel.resultCode["ABORTED"], FFW.TTS.requestId, "TTS.Speak", "TTS Speak request aborted");
+ } else {
+ FFW.TTS.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"], FFW.TTS.requestId, "TTS.Speak");
+ }
+ FFW.TTS.requestId = null;
+ FFW.TTS.aborted = false;
+ }
+ },
+
+ /**
+ * Move VR list to right side when VRHelpList was activated
+ *
+ * @type {String}
+ */
+ VRMove: function() {
+
+ if (SDL.VRHelpListView.active || SDL.InteractionChoicesView.active) {
+ SDL.SDLModel.set('VRHelpListActivated', true);
+ } else {
+ SDL.SDLModel.set('VRHelpListActivated', false);
+ }
+ },
+
+ /**
+ * Activate navigationApp method to set navigationApp data to controlls on main screen
+ */
+ navigationAppUpdate: function() {
+ SDL.BaseNavigationView.update(SDL.SDLAppController.model.appID);
+ },
+
+ /**
+ * Default action for SoftButtons: closes window, popUp or clears
+ * applications screen
+ *
+ * @param {Object}
+ */
+ defaultActionSoftButton: function(element) {
+
+ switch (element.groupName) {
+ case "AlertPopUp": {
+ SDL.AlertPopUp.deactivate();
+ break;
+ }
+ case "ScrollableMessage": {
+ SDL.ScrollableMessage.deactivate(true);
+ break;
+ }
+ }
+ },
+
+ /**
+ * SDL notification call function
+ * to notify that SDL Core should reset timeout for some method
+ */
+ onResetTimeout: function (appID, methodName) {
+ FFW.UI.onResetTimeout(appID, methodName);
+ },
+ /**
+ * Action to show Voice Recognition PopUp
+ */
+ activateVRPopUp: function() {
+
+ SDL.SDLModel.toggleProperty('VRActive');
+ },
+ /**
+ * Action for SoftButtons that closes popUp or window and opens
+ * applications screen
+ *
+ * @param {Object}
+ */
+ stealFocusSoftButton: function(element) {
+
+ switch (element.groupName) {
+ case "AlertPopUp": {
+ SDL.AlertPopUp.deactivate();
+ this.onActivateSDLApp(element);
+ break;
+ }
+ case "ScrollableMessage": {
+ SDL.ScrollableMessage.deactivate();
+ this.onActivateSDLApp(element);
+ break;
+ }
+ }
+ },
+ /**
+ * Action for SoftButtons that clears popUps timer and it become visible
+ * all the time until user user closes it
+ *
+ * @param {Object}
+ */
+ keepContextSoftButton: function(element) {
+
+ switch (element.groupName) {
+ case "AlertPopUp": {
+ clearTimeout(SDL.AlertPopUp.timer);
+ SDL.AlertPopUp.timer = setTimeout(function() {
+ SDL.AlertPopUp.deactivate();
+ }, SDL.AlertPopUp.timeout);
+ this.onResetTimeout(element.appID, "UI.Alert");
+ break;
+ }
+ case "ScrollableMessage": {
+ clearTimeout(SDL.ScrollableMessage.timer);
+ SDL.ScrollableMessage.timer = setTimeout(function() {
+ SDL.ScrollableMessage.deactivate();
+ }, SDL.ScrollableMessage.timeout);
+ this.onResetTimeout(element.appID, "UI.ScrollableMessage");
+ break;
+ }
+ }
+ },
+ /**
+ * Action for ClosePopUp request that triggers deactivate function from
+ * opened popUp
+ */
+ closePopUp: function(methodName) {
+
+ if (methodName == "UI.Alert") {
+ SDL.AlertPopUp.deactivate();
+ }
+ if (methodName == "UI.PerformAudioPassThru") {
+ SDL.AudioPassThruPopUp.deactivate();
+ this.performAudioPassThruResponse(SDL.SDLModel.resultCode["SUCCESS"]);
+ }
+ if (methodName == "UI.PerformInteraction") {
+ SDL.InteractionChoicesView.deactivate("ABORTED");
+ }
+ if (methodName == "UI.ScrollableMessage") {
+ SDL.ScrollableMessage.deactivate(true);
+ }
+ if (methodName == "UI.Slider") {
+ SDL.SliderView.deactivate(true);
+ }
+// if (SDL.VRHelpListView.active) {
+// SDL.VRHelpListView.deactivate();
+// }
+ },
+
+ /**
+ * Method to close InteractionChoices view
+ */
+ InteractionChoicesDeactivate: function() {
+
+ SDL.InteractionChoicesView.deactivate("ABORTED");
+ },
+
+ /**
+ * Method to close AlertMeneuverPopUp view
+ */
+ closeAlertMeneuverPopUp: function() {
+
+ SDL.AlertManeuverPopUp.set('activate', false);
+ },
+ /**
+ * Method to open Turn List view from TBT
+ *
+ * @param {Number}
+ * appID AppID of activated sdl application
+ */
+ tbtTurnList: function(appID) {
+
+ SDL.TBTTurnList.activate(appID);
+ },
+ /**
+ * Method to sent notification with selected state of TBT Client State
+ *
+ * @param {String}
+ */
+ tbtClientStateSelected: function(state) {
+
+ FFW.Navigation.onTBTClientState(state);
+ },
+ /**
+ * Method to sent notification with selected reason of Exit Application
+ *
+ * @param {String}
+ */
+ exitAppViewSelected: function(state) {
+
+ //if ignition off if executed than OnIgnitionCycleOver must be sent
+ if (state == SDL.SDLModel.exitAppState[0].name) {
+
+ FFW.BasicCommunication.OnIgnitionCycleOver();
+ }
+
+ FFW.BasicCommunication.ExitAllApplications(state);
+ },
+ /**
+ * Method to sent notification with selected reason of OnSystemRequest
+ *
+ * @param {String}
+ */
+ systemRequestViewSelected: function(state) {
+
+ if (SDL.SDLModel.policyURLs.length) {
+ FFW.BasicCommunication.OnSystemRequest(state, SDL.SDLModel.policyURLs[0].policyAppId, null, SDL.SDLModel.policyURLs[0].url);
+ } else {
+ FFW.BasicCommunication.OnSystemRequest(state);
+ }
+
+ },
+ /**
+ * Method to sent notification ABORTED for PerformInteractionChoise
+ */
+ interactionChoiseCloseResponse: function(appID, result, choiceID, manualTextEntry) {
+
+ FFW.UI.interactionResponse(SDL.SDLController.getApplicationModel(appID).activeRequests.uiPerformInteraction, result, choiceID, manualTextEntry);
+ SDL.SDLModel.set('interactionData.vrHelpTitle', null);
+ SDL.SDLModel.set('interactionData.vrHelp', null);
+
+ SDL.SDLController.getApplicationModel(appID).activeRequests.uiPerformInteraction = null;
+
+ if (SDL.TTSPopUp.active && FFW.TTS.requestId == null) {
+ SDL.TTSPopUp.DeactivateTTS();
+ }
+ },
+ /**
+ * Method to sent notification ABORTED for VR PerformInteraction
+ */
+ vrInteractionResponse: function(result, choiceID) {
+
+ FFW.VR.interactionResponse(SDL.SDLModel.vrActiveRequests.vrPerformInteraction, result, choiceID);
+
+ SDL.SDLModel.vrActiveRequests.vrPerformInteraction = null;
+
+ SDL.SDLModel.set('VRActive', false);
+
+ SDL.InteractionChoicesView.timerUpdate();
+
+ if (choiceID && SDL.TTSPopUp.active && FFW.TTS.requestId == null) {
+ SDL.TTSPopUp.DeactivateTTS();
+ }
+ },
+ /**
+ * Method to sent notification for Alert
+ *
+ * @param {String}
+ * result
+ * @param {Number}
+ * alertRequestID
+ */
+ alertResponse: function(result, alertRequestID) {
+
+ FFW.UI.alertResponse(result, alertRequestID);
+ },
+ /**
+ * Method to sent notification for Scrollable Message
+ *
+ * @param {String}
+ * result
+ * @param {Number}
+ * messageRequestId
+ */
+ scrollableMessageResponse: function(result, messageRequestId) {
+
+ if (result == SDL.SDLModel.resultCode['SUCCESS']) {
+ FFW.UI.sendUIResult(result,
+ messageRequestId,
+ 'UI.ScrollableMessage');
+ } else {
+ FFW.UI.sendError(result,
+ messageRequestId,
+ 'UI.ScrollableMessage',
+ "ScrollableMessage aborted!");
+ }
+ },
+ /**
+ * Method to do necessary actions when user navigate throught the menu
+ */
+ userStateAction: function() {
+ if (SDL.ScrollableMessage.active) {
+ SDL.ScrollableMessage.deactivate(true);
+ }
+ },
+ /**
+ * Method to sent notification for Slider
+ *
+ * @param {String}
+ * result
+ * @param {Number}
+ * sliderRequestId
+ */
+ sliderResponse: function(result, sliderRequestId) {
+
+ FFW.UI.sendUIResult(result, sliderRequestId, 'UI.Slider');
+ },
+ /**
+ * Method to call performAudioPassThruResponse with Result code
+ * parameters
+ *
+ * @param {Object}
+ * element Button object
+ */
+ callPerformAudioPassThruPopUpResponse: function(element) {
+
+ this.performAudioPassThruResponse(element.responseResult);
+ },
+ /**
+ * Method close PerformAudioPassThruPopUp and call response from UI RPC
+ * back to SDLCore
+ *
+ * @param {String}
+ * result Result code
+ */
+ performAudioPassThruResponse: function(result) {
+
+ SDL.SDLModel.set('AudioPassThruState', false);
+ FFW.UI.sendUIResult(result,
+ FFW.UI.performAudioPassThruRequestID,
+ "UI.PerformAudioPassThru");
+ FFW.UI.performAudioPassThruRequestID = -1;
+ },
+ /**
+ * Method close PerformAudioPassThruPopUp and call error response from
+ * UI RPC back to SDLCore
+ *
+ * @param {String}
+ * result Result code
+ */
+ callPerformAudioPassThruPopUpErrorResponse: function(element) {
+
+ SDL.SDLModel.set('AudioPassThruState', false);
+ FFW.UI.sendError(element.responseResult,
+ FFW.UI.performAudioPassThruRequestID,
+ "UI.PerformAudioPassThru",
+ "PerformAudioPassThru was not completed successfuly!");
+ FFW.UI.performAudioPassThruRequestID = -1;
+ },
+ /**
+ * Method to set language for UI component with parameters sent from
+ * SDLCore to UIRPC
+ */
+ onLanguageChangeUI: function() {
+
+ FFW.UI.OnLanguageChange(SDL.SDLModel.hmiUILanguage);
+ FFW.BasicCommunication.OnSystemInfoChanged(SDL.SDLModel.hmiUILanguage);
+ }.observes('SDL.SDLModel.hmiUILanguage'),
+ /**
+ * Method to set language for TTS and VR components with parameters sent
+ * from SDLCore to UIRPC
+ */
+ onLanguageChangeTTSVR: function() {
+
+ FFW.TTS.OnLanguageChange(SDL.SDLModel.hmiTTSVRLanguage);
+ FFW.VR.OnLanguageChange(SDL.SDLModel.hmiTTSVRLanguage);
+ }.observes('SDL.SDLModel.hmiTTSVRLanguage'),
+ /**
+ * Register application
+ *
+ * @param {Object}
+ * params
+ * @param {Number}
+ * applicationType
+ */
+ registerApplication: function(params, applicationType) {
+
+ SDL.SDLModel.get('registeredApps').pushObject(this.applicationModels[applicationType].create( {
+ appID: params.appID,
+ appName: params.appName,
+ deviceName: params.deviceName,
+ appType: params.appType
+ }));
+
+ var exitCommand = {
+ "id": -10,
+ "params": {
+ "menuParams":{
+ "parentID": 0,
+ "menuName": "Exit 'DRIVER_DISTRACTION_VIOLATION'",
+ "position": 0
+ },
+ cmdID: -1
+ }
+ };
+
+ SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
+
+ exitCommand = {
+ "id": -10,
+ "params": {
+ "menuParams":{
+ "parentID": 0,
+ "menuName": "Exit 'USER_EXIT'",
+ "position": 0
+ },
+ cmdID: -2
+ }
+ };
+
+ SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
+ },
+ /**
+ * Unregister application
+ *
+ * @param {Number}
+ * appID
+ */
+ unregisterApplication: function(appID) {
+
+ this.getApplicationModel(appID).VRCommands = [];
+
+ this.getApplicationModel(appID).onDeleteApplication(appID);
+
+ var len = SDL.SDLModel.VRCommands.length;
+ for (var i = len - 1; i >= 0; i--) {
+ if (SDL.SDLModel.VRCommands[i].appID == appID) {
+ SDL.SDLModel.VRCommands.splice(i, 1);
+ }
+ }
+
+ SDL.VRPopUp.DeleteActivateApp(appID);
+ if (SDL.SDLModel.stateLimited == appID) {
+ SDL.SDLModel.set('stateLimited', null);
+ }
+ },
+ /**
+ * SDL Driver Distraction ON/OFF switcher
+ */
+ selectDriverDistraction: function() {
+
+ if (SDL.SDLModel.driverDistractionState) {
+ FFW.UI.onDriverDistraction("DD_ON");
+ } else {
+ FFW.UI.onDriverDistraction("DD_OFF");
+ }
+ }.observes('SDL.SDLModel.driverDistractionState'),
+
+ /**
+ * Ondisplay keyboard event handler
+ * Sends notification on SDL Core with changed value
+ */
+ onKeyboardChanges: function() {
+ if (null !== SDL.SDLModel.keyboardInputValue) {
+
+ var str = SDL.SDLModel.keyboardInputValue;
+
+ if (SDL.SDLAppController.model.globalProperties.keyboardProperties.keypressMode) {
+ switch (SDL.SDLAppController.model.globalProperties.keyboardProperties.keypressMode) {
+ case 'SINGLE_KEYPRESS':{
+ FFW.UI.OnKeyboardInput(str.charAt( str.length-1 ), "KEYPRESS");
+ break;
+ }
+ case 'QUEUE_KEYPRESS':{
+ break;
+ }
+ case 'RESEND_CURRENT_ENTRY':{
+ if (str) {
+ FFW.UI.OnKeyboardInput(str, "KEYPRESS");
+ }
+ break;
+ }
+ }
+ }
+ }
+ }.observes('SDL.SDLModel.keyboardInputValue'),
+
+ /**
+ * Get application model
+ *
+ * @param {Number}
+ */
+ getApplicationModel: function(applicationId) {
+
+ return SDL.SDLModel.registeredApps.filterProperty('appID', applicationId)[0];
+ },
+ /**
+ * Function returns ChangeDeviceView back to previous state
+ */
+ turnChangeDeviceViewBack: function() {
+
+ SDL.States.goToStates('info.apps');
+ },
+ /**
+ * Enter screen vith list of devices application model
+ */
+ onGetDeviceList: function() {
+
+ SDL.States.goToStates('info.devicelist');
+ SDL.SDLModel.set('deviceSearchProgress', true);
+ },
+ /**
+ * Send notification if device was choosed
+ *
+ * @param element:
+ * SDL.Button
+ */
+ onDeviceChoosed: function(element) {
+
+ SDL.SDLModel.set('CurrDeviceInfo.name', element.deviceName);
+ SDL.SDLModel.set('CurrDeviceInfo.id', element.id);
+ FFW.BasicCommunication.OnDeviceChosen(element.deviceName,
+ element.id);
+ this.turnChangeDeviceViewBack();
+ },
+ /**
+ * Method call's request to get list of applications
+ */
+ findNewApps: function() {
+
+ FFW.BasicCommunication.OnFindApplications();
+ },
+ /**
+ * Method activates selected registered application
+ *
+ * @param {Object}
+ */
+ onActivateSDLApp: function(element) {
+
+ FFW.BasicCommunication.ActivateApp(element.appID);
+ },
+ /**
+ * Method sent custom softButtons pressed and event status to RPC
+ *
+ * @param {Object}
+ */
+ onSoftButtonActionUpCustom: function(element) {
+
+ if (element.time > 0) {
+ FFW.Buttons.buttonEventCustom(
+ "CUSTOM_BUTTON",
+ "BUTTONUP",
+ element.softButtonID,
+ element.appID
+ );
+ } else {
+ FFW.Buttons.buttonEventCustom(
+ "CUSTOM_BUTTON",
+ "BUTTONUP",
+ element.softButtonID,
+ element.appID
+ );
+ FFW.Buttons.buttonPressedCustom(
+ "CUSTOM_BUTTON",
+ "SHORT",
+ element.softButtonID,
+ element.appID
+ );
+ }
+ clearTimeout(element.timer);
+ element.time = 0;
+ },
+ /**
+ * Method sent custom softButtons pressed and event status to RPC
+ *
+ * @param {Object}
+ */
+ onSoftButtonActionDownCustom: function(element) {
+
+ FFW.Buttons.buttonEventCustom(
+ "CUSTOM_BUTTON",
+ "BUTTONDOWN",
+ element.softButtonID,
+ element.appID
+ );
+ element.time = 0;
+ element.timer = setTimeout(function() {
+
+ FFW.Buttons.buttonPressedCustom(
+ "CUSTOM_BUTTON",
+ "LONG",
+ element.softButtonID,
+ element.appID
+ );
+ element.time++;
+ }, 2000);
+ },
+ /**
+ * Method sent softButtons pressed and event status to RPC
+ *
+ * @param {String}
+ * @param {Object}
+ */
+ onSoftButtonActionUp: function(element) {
+
+ if (element.time > 0) {
+ FFW.Buttons.buttonEvent(element.presetName, "BUTTONUP");
+ } else {
+ FFW.Buttons.buttonEvent(element.presetName, "BUTTONUP");
+ FFW.Buttons.buttonPressed(element.presetName, "SHORT");
+ }
+ clearTimeout(element.timer);
+ element.time = 0;
+ },
+ /**
+ * Method sent softButtons Ok pressed and event status to RPC
+ *
+ * @param {String}
+ */
+ onSoftButtonOkActionDown: function(name) {
+
+ FFW.Buttons.buttonEvent(name, "BUTTONDOWN");
+ },
+ /**
+ * Method sent softButton OK pressed and event status to RPC
+ *
+ * @param {String}
+ */
+ onSoftButtonOkActionUp: function(name) {
+
+ FFW.Buttons.buttonEvent(name, "BUTTONUP");
+ FFW.Buttons.buttonPressed(name, "SHORT");
+ if (SDL.SDLAppController.model) {
+ SDL.SDLAppController.model.set('isPlaying',
+ !SDL.SDLAppController.model.isPlaying);
+ }
+ },
+ /**
+ * Method sent softButtons pressed and event status to RPC
+ *
+ * @param {String}
+ * @param {Object}
+ */
+ onSoftButtonActionDown: function(element) {
+
+ FFW.Buttons.buttonEvent(element.presetName, "BUTTONDOWN");
+ element.time = 0;
+ element.timer = setTimeout(function() {
+
+ FFW.Buttons.buttonPressed(element.presetName, "LONG");
+ element.time++;
+ }, 2000);
+ },
+ /**
+ * Send system context
+ */
+ onSystemContextChange: function(appID) {
+
+ var sysContextValue = this.get('sysContext');
+
+ if ((appID && SDL.SDLController.getApplicationModel(appID) != SDL.SDLAppController.model)
+ || this.backgroundAlertAppID){
+
+ if (SDL.SDLAppController.model
+ && SDL.SDLAppController.model.appID != appID
+ && this.backgroundAlertAppID == null) {
+
+ this.backgroundAlertAppID = appID;
+ FFW.UI.OnSystemContext(sysContextValue, appID);
+ FFW.UI.OnSystemContext('HMI_OBSCURED', SDL.SDLAppController.model.appID);
+
+ } else if (SDL.SDLAppController.model
+ && SDL.SDLAppController.model.appID != appID
+ && this.backgroundAlertAppID != null
+ && SDL.SDLAppController.model.appID != this.backgroundAlertAppID) {
+
+ FFW.UI.OnSystemContext('MAIN', this.backgroundAlertAppID);
+ FFW.UI.OnSystemContext(sysContextValue, SDL.SDLAppController.model.appID);
+ }
+ } else {
+ if (SDL.SDLAppController.model) {
+ appID = SDL.SDLAppController.model.appID;
+ } else {
+ appID = null;
+ }
+
+ FFW.UI.OnSystemContext(sysContextValue, appID);
+ }
+ }
+ });
diff --git a/src/components/HMI/app/controller/sdl/MediaController.js b/src/components/HMI/app/controller/sdl/MediaController.js
new file mode 100644
index 0000000000..e4e445ffcd
--- /dev/null
+++ b/src/components/HMI/app/controller/sdl/MediaController.js
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLMediaController
+ * @desc SDL Media Controller logic
+ * @category Controller
+ * @filesource app/controller/sdl/SDLMediaController.js
+ * @version 1.0
+ */
+
+SDL.SDLMediaController = Em.Object.create( {
+
+ /**
+ * Current Media application id
+ *
+ * @type {Number}
+ */
+ currentAppId: 0,
+
+ /**
+ * Return current Media application name used for application button
+ */
+ currentAppName: function() {
+
+ if (this.currentAppId) {
+ return SDL.SDLController.getApplicationModel(this.currentAppId).appName;
+ }
+ }.property('this.currentAppId'),
+
+ /**
+ * Return current Media application icon used for application button
+ */
+ currentAppIcon: function() {
+
+ if (this.currentAppId) { return SDL.SDLController
+ .getApplicationModel(this.currentAppId).appIcon; }
+ }.property('this.currentAppId', 'SDL.SDLAppController.model.appIcon'),
+
+ /** Call notification OnCommand on UIRPC */
+ onCommand: function(element) {
+
+ FFW.UI.onCommand(element.commandID, element.appID);
+ },
+
+ /** Call notification OnCommandSoftButton on UIRPC */
+ onCommandSoftButton: function(element) {
+
+ FFW.UI.onCommandSoftButton(element.softButtonID, element.appID);
+ },
+
+ /** Switching on Application */
+ activateApp: function(applicationModel) {
+
+ // store active application id
+ this.set('currentAppId', applicationModel.appID);
+
+ // set active model
+ SDL.SDLAppController.set('model', applicationModel);
+
+ SDL.MediaController.turnOnSDL();
+
+ },
+
+ /**
+ * Restore current application to active state
+ */
+ activateCurrentApp: function() {
+
+ FFW.BasicCommunication.OnAppActivated(this.currentAppId);
+ },
+
+ /** SDL perform interaction action from VR */
+ onVRPerformInteractionChoosed: function(element) {
+
+ if (SDL.States.media.sdl.sdlperforminteractionchoise.active) {
+ FFW.VR.onChoise(element.choiceID);
+ SDL.States.back();
+ }
+
+ },
+
+ /** SDL perform interaction action */
+ onPerformInteractionChoosed: function(element) {
+
+ if (SDL.States.media.sdl.sdlperforminteractionchoise.active) {
+ FFW.UI.interactionResponse("SUCCESS", element.choiceID);
+ SDL.States.back();
+ }
+
+ },
+
+ /**
+ * Method hides sdl activation button and sdl application
+ *
+ * @param {Number}
+ */
+ onDeleteApplication: function(appID) {
+
+ if (this.currentAppId == appID) {
+
+ if (SDL.States.media.sdlmedia.active
+ || SDL.SDLAppController.model) {
+
+ SDL.SDLController.getApplicationModel(appID).set('active', false);
+
+ SDL.States.goToStates('info.apps');
+
+ SDL.MediaController.set('activeState', 'media.player');
+ }
+
+ this.set('currentAppId', 0);
+ }
+
+ SDL.SDLModel.stopStream(appID);
+ SDL.SDLModel.get('registeredApps').removeObjects(SDL.SDLModel.get('registeredApps').filterProperty('appID', appID));
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/sdl/NonMediaController.js b/src/components/HMI/app/controller/sdl/NonMediaController.js
new file mode 100644
index 0000000000..a87221b678
--- /dev/null
+++ b/src/components/HMI/app/controller/sdl/NonMediaController.js
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.NonMediaController
+ * @desc SDL NonMedia Controller logic
+ * @category Controller
+ * @filesource app/controller/sdl/NonMediaController.js
+ * @version 1.0
+ */
+
+SDL.NonMediaController = Em.Object.create( {
+
+ /**
+ * Current NonMedia application id
+ *
+ * @type {Number}
+ */
+ currentAppId: 0,
+
+ /**
+ * Return current NonMedia application name used for application button
+ */
+ currentAppName: function() {
+
+ if (this.currentAppId) { return SDL.SDLController
+ .getApplicationModel(this.currentAppId).appName; }
+ }.property('this.currentAppId'),
+
+ /**
+ * Return current NonMedia application icon used for application button
+ */
+ currentAppIcon: function() {
+
+ if (this.currentAppId) { return SDL.SDLController
+ .getApplicationModel(this.currentAppId).appIcon; }
+ }.property('this.currentAppId', 'SDL.SDLAppController.model.appIcon'),
+
+ /**
+ * Activate application model
+ *
+ * @param {SDLAppModel}
+ */
+ activateApp: function(applicationModel) {
+
+ // store active application id
+ this.set('currentAppId', applicationModel.appID);
+
+ // set active model
+ SDL.SDLAppController.set('model', applicationModel);
+
+ // send response
+ // FFW.BasicCommunication.ActivateApp( applicationModel.appID );
+
+ // Go to SDL state
+ SDL.InfoController.turnOnSDL();
+ //SDL.States.goToStates('info.nonMedia');
+ },
+
+ /**
+ * Restore current application to active state
+ */
+ activateCurrentApp: function() {
+
+ FFW.BasicCommunication.OnAppActivated(this.currentAppId);
+ },
+
+ /**
+ * Method hides sdl activation button and sdl application
+ *
+ * @param {Number}
+ */
+ onDeleteApplication: function(appID) {
+
+ if (this.currentAppId == appID) {
+ if (SDL.States.info.nonMedia.active
+ || SDL.SDLAppController.model) {
+
+ SDL.SDLController.getApplicationModel(appID).set('active', false);
+
+ SDL.States.goToStates('info.apps');
+ }
+
+ SDL.InfoController.set('activeState', 'info.apps');
+
+ this.set('currentAppId', 0);
+ }
+ SDL.SDLModel.get('registeredApps').removeObjects(SDL.SDLModel.get('registeredApps').filterProperty('appID', appID));
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/sdl/RPCController.js b/src/components/HMI/app/controller/sdl/RPCController.js
new file mode 100644
index 0000000000..d7ab4b2d01
--- /dev/null
+++ b/src/components/HMI/app/controller/sdl/RPCController.js
@@ -0,0 +1,3100 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.RPCController
+ * @desc RPC Controller
+ * @category Controller
+ * @filesource app/controller/sdl/RPCController.js
+ * @version 1.0
+ */
+
+SDL.RPCController = Em.Object
+ .create( {
+
+ capabilityCheckResult: null,
+
+ /**
+ * Start register RPC components on controller init
+ */
+ ConnectToSDL: function() {
+
+ if (FLAGS.Buttons) {
+ FFW.Buttons.connect();
+ }
+
+ if (FLAGS.TTS) {
+ FFW.TTS.connect();
+ }
+
+ if (FLAGS.VR) {
+ FFW.VR.connect();
+ }
+
+ if (FLAGS.BC) {
+ FFW.BasicCommunication.connect();
+ }
+
+ if (FLAGS.UI) {
+ FFW.UI.connect();
+ }
+
+ if (FLAGS.VI) {
+ FFW.VehicleInfo.connect();
+ }
+
+ if (FLAGS.Navi) {
+ FFW.Navigation.connect();
+ }
+ },
+
+ capabilitiesCheck: function(key, value) {
+ if (key == "imageType" && value == "STATIC") {
+ SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ }
+ if (key == "type" && value == "PRE_RECORDED") {
+ SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ }
+ if (key == "type" && value == "SAPI_PHONEMES") {
+ SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ }
+ if (key == "type" && value == "LHPLUS_PHONEMES") {
+ SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ }
+ if (key == "type" && value == "SILENCE") {
+ SDL.RPCController.capabilityCheckResult = 'UNSUPPORTED_RESOURCE';
+ }
+ },
+
+ /**
+ * Method to check supported image type in request
+ *
+ * @param {Object}
+ * array
+ */
+ checkImagesArray: function(array) {
+
+ var error = false;
+ if (array instanceof Array) {
+ for ( var i = 0; i < array.length; i++) {
+ if (array[i].image &&
+ ((array[i].image.imageType !== "DYNAMIC") &&
+ (array[i].image.imageType !== "STATIC"))) {
+
+ }
+ }
+ }
+ return error;
+ },
+
+ /**
+ * Object that contains check methods that returns true if mandatory
+ * fields is successful and returns false if not
+ */
+ BasicCommunication: Em.Object
+ .create( {
+
+ resultStruct: {},
+
+ /**
+ * Validate method for request UpdateAppList
+ *
+ * @param {Object}
+ * params
+ */
+ UpdateAppList: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request UpdateDeviceList
+ *
+ * @param {Object}
+ * params
+ */
+ UpdateDeviceList: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.deviceList == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'deviceList' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.deviceList.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'deviceList'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+
+ /**
+ * Validate method for request PolicyUpdate
+ *
+ * @param {Object}
+ * params
+ */
+ PolicyUpdate: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.file == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'file' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.file != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'file'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.timeout == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'timeout' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.timeout != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'timeout'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.retry == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'retry' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.retry.length < 1) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'retry'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request SystemRequest
+ *
+ * @param {Object}
+ * params
+ */
+ SystemRequest: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.fileName == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'fileName' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.fileName != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'fileName'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.requestType == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'requestType' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ActivateApp
+ *
+ * @param {Object}
+ * params
+ */
+ ActivateApp: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AllowSDLFunctionality
+ *
+ * @param {Object}
+ * params
+ */
+ AllowSDLFunctionality: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.device == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'device' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.device != 'object') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'device'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AllowDeviceToConnect
+ *
+ * @param {Object}
+ * params
+ */
+ AllowDeviceToConnect: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.device == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'device' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetSystemInfo
+ *
+ * @param {Object}
+ * params
+ */
+ GetSystemInfo: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request MixingAudioSupported
+ *
+ * @param {Object}
+ * params
+ */
+ MixingAudioSupported: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AllowAllApps
+ *
+ * @param {Object}
+ * params
+ */
+ AllowAllApps: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AllowApp
+ *
+ * @param {Object}
+ * params
+ */
+ AllowApp: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appPermissions == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'app' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appPermissions.length < 1) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appPermissions'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ }
+
+ }),
+
+ /**
+ * Object that contains check methods that returns true if mandatory
+ * fields is successful and returns false if not
+ */
+ TTS: Em.Object
+ .create( {
+
+ resultStruct: {},
+
+ /**
+ * Validate method for request IsReady
+ *
+ * @param {Object}
+ * params
+ */
+ IsReady: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetLanguage
+ *
+ * @param {Object}
+ * params
+ */
+ GetLanguage: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request SetGlobalProperties
+ *
+ * @param {Object}
+ * params
+ */
+ SetGlobalProperties: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetSupportedLanguages
+ *
+ * @param {Object}
+ * params
+ */
+ GetSupportedLanguages: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request StopSpeaking
+ *
+ * @param {Object}
+ * params
+ */
+ StopSpeaking: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Speak
+ *
+ * @param {Object}
+ * params
+ */
+ Speak: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.ttsChunks == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'ttsChunks' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.ttsChunks.length < 1) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'ttsChunks'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ChangeRegistration
+ *
+ * @param {Object}
+ * params
+ */
+ ChangeRegistration: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.language == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'language' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.language != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'language'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request OnLanguageChange
+ *
+ * @param {Object}
+ * params
+ */
+ OnLanguageChange: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.language == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'language' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.language != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'language'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ }
+ }),
+
+ /**
+ * Object that contains check methods that returns true if mandatory
+ * fields is successful and returns false if not
+ */
+ Navigation: Em.Object
+ .create( {
+
+ resultStruct: {},
+
+ /**
+ * Validate method for request IsReady
+ *
+ * @param {Object}
+ * params
+ */
+ IsReady: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Navigation.SendLocation
+ *
+ * @param {Object}
+ * params
+ */
+ SendLocation: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Navigation.AlertManeuver
+ *
+ * @param {Object}
+ * params
+ */
+ AlertManeuver: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request StartStream
+ *
+ * @param {Object}
+ * params
+ */
+ StartStream: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.url == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'url' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.url != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'url'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request StopStream
+ *
+ * @param {Object}
+ * params
+ */
+ StopStream: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request StartAudioStream
+ *
+ * @param {Object}
+ * params
+ */
+ StartAudioStream: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.url == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'url' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.url != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'url'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request StopAudioStream
+ *
+ * @param {Object}
+ * params
+ */
+ StopAudioStream: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Navigation.ShowConstantTBT
+ *
+ * @param {Object}
+ * params
+ */
+ ShowConstantTBT: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("softButtons" in params) {
+ if (SDL.RPCController
+ .checkImagesArray(params.softButtons)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if ("turnIcon" in params
+ && ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("nextTurnIcon" in params
+ && ((params.nextTurnIcon.imageType !== "DYNAMIC") && (params.nextTurnIcon.imageType !== "STATIC"))) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.navigationTexts == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'navigationTexts' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.navigationTexts.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'navigationTexts'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Navigation.UpdateTurnList
+ *
+ * @param {Object}
+ * params
+ */
+ UpdateTurnList: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("softButtons" in params) {
+ if (SDL.RPCController
+ .checkImagesArray(params.softButtons)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if ("turnList" in params) {
+
+ for ( var i = 0; i < params.turnList.length; i++) {
+ if (params.turnList[i].image
+ && ((params.turnIcon.imageType !== "DYNAMIC")
+ && (params.turnIcon.imageType !== "STATIC"))) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ e;
+ }
+ }
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ }
+
+ }),
+
+ /**
+ * Object that contains check methods that returns true if mandatory
+ * fields is successful and returns false if not
+ */
+ UI: Em.Object
+ .create( {
+
+ resultStruct: {},
+
+ /**
+ * Validate method for request SetDisplayLayout
+ *
+ * @param {Object}
+ * params
+ */
+ SetDisplayLayout: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request IsReady
+ *
+ * @param {Object}
+ * params
+ */
+ IsReady: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request UI.Alert
+ *
+ * @param {Object}
+ * params
+ */
+ Alert: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("softButtons" in params) {
+ if (SDL.RPCController
+ .checkImagesArray(params.softButtons)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if (params.alertStrings == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'alertStrings' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.alertStrings.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'alertStrings'!"
+ };
+
+ return this.resultStruct;
+ }
+ if ('duration' in params && typeof params.duration != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'duration'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Show
+ *
+ * @param {Object}
+ * params
+ */
+ ShowNotification: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("icon" in params &&
+ ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.text == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'text' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.text.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'text'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.timeout == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'timeout' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.timeout != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'timeout'!"
+ };
+
+ return this.resultStruct;
+ }
+ },
+
+ /**
+ * Validate method for request Show
+ *
+ * @param {Object}
+ * params
+ */
+ Show: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("softButtons" in params) {
+ if (SDL.RPCController
+ .checkImagesArray(params.softButtons)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if ("graphic" in params
+ && ((params.graphic.imageType !== "DYNAMIC") && (params.graphic.imageType !== "STATIC"))) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.showStrings == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'showStrings' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.showStrings.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'showStrings'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AddCommand
+ *
+ * @param {Object}
+ * params
+ */
+ AddCommand: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("cmdIcon" in params
+ && (params.cmdIcon.imageType !== "DYNAMIC" && params.cmdIcon.imageType !== "STATIC")) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.cmdID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'cmdID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.cmdID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'cmdID'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.menuParams == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'menuParams' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.menuParams != 'object') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'menuParams'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.menuParams.menuName == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'menuName' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.menuParams.menuName != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'menuName'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request DeleteCommand
+ *
+ * @param {Object}
+ * params
+ */
+ DeleteCommand: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.cmdID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'cmdID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.cmdID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'cmdID'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AddSubMenu
+ *
+ * @param {Object}
+ * params
+ */
+ AddSubMenu: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.menuID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'menuID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.menuID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'menuID'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (!params.menuParams) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'menuParams' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request DeleteSubMenu
+ *
+ * @param {Object}
+ * params
+ */
+ DeleteSubMenu: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.menuID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'menuID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.menuID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'menuID'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+ // don't delete if current submenu active
+ if (SDL.SDLController.getApplicationModel(params.appID)
+ .get('currentSubMenuId') == params.menuID) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["IN_USE"],
+ "resultMessage": "SubMenu is already in use!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request PerformInteraction
+ *
+ * @param {Object}
+ * params
+ */
+ PerformInteraction: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.timeout == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'timeout' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.timeout != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'timeout'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request SetMediaClockTimer
+ *
+ * @param {Object}
+ * params
+ */
+ SetMediaClockTimer: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.updateMode == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'updateMode' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.updateMode != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'updateMode'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request SetGlobalProperties
+ *
+ * @param {Object}
+ * params
+ */
+ SetGlobalProperties: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("vrHelp" in params) {
+ if (SDL.RPCController.checkImagesArray(params.vrHelp)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetCapabilities
+ *
+ * @param {Object}
+ * params
+ */
+ GetCapabilities: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ChangeRegistration
+ *
+ * @param {Object}
+ * params
+ */
+ ChangeRegistration: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.language == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'language' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.language != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'language'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetSupportedLanguages
+ *
+ * @param {Object}
+ * params
+ */
+ GetSupportedLanguages: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetLanguage
+ *
+ * @param {Object}
+ * params
+ */
+ GetLanguage: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request SetAppIcon
+ *
+ * @param {Object}
+ * params
+ */
+ SetAppIcon: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.syncFileName == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'syncFileName' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.syncFileName != 'object') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'syncFileName'!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("syncFileName" in params
+ && ((params.syncFileName.imageType !== "DYNAMIC") && (params.syncFileName.imageType !== "STATIC"))) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request Slider
+ *
+ * @param {Object}
+ * params
+ */
+ Slider: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.numTicks == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'numTicks' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.numTicks != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'numTicks'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.position == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'position' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.position != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'position'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.sliderHeader == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'sliderHeader' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.sliderHeader != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'sliderHeader'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.timeout == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'timeout' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.timeout != 'number' || params.timeout < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'timeout'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ScrollableMessage
+ *
+ * @param {Object}
+ * params
+ */
+ ScrollableMessage: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("softButtons" in params) {
+ if (SDL.RPCController
+ .checkImagesArray(params.softButtons)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if (params.messageText == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'messageText' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.messageText.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'messageText'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.timeout == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'timeout' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.timeout != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'timeout'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request PerformAudioPassThru
+ *
+ * @param {Object}
+ * params
+ */
+ PerformAudioPassThru: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.audioPassThruDisplayTexts == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'audioPassThruDisplayTexts' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.audioPassThruDisplayTexts.length < 0
+ || params.audioPassThruDisplayTexts.length > 2) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'audioPassThruDisplayTexts'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request EndAudioPassThru
+ *
+ * @param {Object}
+ * params
+ */
+ EndAudioPassThru: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ClosePopUp
+ *
+ * @param {Object}
+ * params
+ */
+ ClosePopUp: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ShowVrHelp
+ *
+ * @param {Object}
+ * params
+ */
+ ShowVrHelp: function(params) {
+
+ if (params) {
+ if ("vrHelp" in params) {
+ if (SDL.RPCController
+ .checkImagesArray(params.vrHelp)) {
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Unsupported image type!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ if ("appID" in params) {
+
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ }
+ }),
+
+ /**
+ * Object that contains check methods that returns true if mandatory
+ * fields is successful and returns false if not
+ */
+ VehicleInfo: Em.Object
+ .create( {
+
+ resultStruct: {},
+
+ /**
+ * Validate method for request IsReady
+ *
+ * @param {Object}
+ * params
+ */
+ IsReady: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request DiagnosticMessage
+ *
+ * @param {Object}
+ * params
+ */
+ DiagnosticMessage: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetVehicleType
+ *
+ * @param {Object}
+ * params
+ */
+ GetVehicleType: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ReadDID
+ *
+ * @param {Object}
+ * params
+ */
+ ReadDID: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.ecuName == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'ecuName' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.ecuName != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'ecuName'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.didLocation == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'didLocation' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.didLocation.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'didLocation'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetDTCs
+ *
+ * @param {Object}
+ * params
+ */
+ GetDTCs: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.ecuName == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'ecuName' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.ecuName != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'ecuName'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetVehicleData
+ *
+ * @param {Object}
+ * params
+ */
+ GetVehicleData: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ /*if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }*/
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request SubscribeVehicleData
+ *
+ * @param {Object}
+ * params
+ */
+ SubscribeVehicleData: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request UnsubscribeVehicleData
+ *
+ * @param {Object}
+ * params
+ */
+ UnsubscribeVehicleData: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ }
+ }),
+
+ /**
+ * Object that contains check methods that returns true if mandatory
+ * fields is successful and returns false if not
+ */
+ VR: Em.Object
+ .create( {
+
+ resultStruct: {},
+
+ /**
+ * Validate method for request IsReady
+ *
+ * @param {Object}
+ * params
+ */
+ IsReady: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request PerformInteraction
+ *
+ * @param {Object}
+ * params
+ */
+ PerformInteraction: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.timeout == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'timeout' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.timeout != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'timeout'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetCapabilities
+ *
+ * @param {Object}
+ * params
+ */
+ GetCapabilities: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetLanguage
+ *
+ * @param {Object}
+ * params
+ */
+ GetLanguage: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request GetSupportedLanguages
+ *
+ * @param {Object}
+ * params
+ */
+ GetSupportedLanguages: function(params) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request AddCommand
+ *
+ * @param {Object}
+ * params
+ */
+ AddCommand: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.cmdID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'cmdID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.cmdID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'cmdID'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.vrCommands == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'vrCommands' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.vrCommands.length < 0) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'vrCommands'!"
+ };
+
+ return this.resultStruct;
+ }
+ if ("appID" in params) {
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request DeleteCommand
+ *
+ * @param {Object}
+ * params
+ */
+ DeleteCommand: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.cmdID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'cmdID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.cmdID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'cmdID'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ },
+
+ /**
+ * Validate method for request ChangeRegistration
+ *
+ * @param {Object}
+ * params
+ */
+ ChangeRegistration: function(params) {
+
+ if (params == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'params' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.language == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'language' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.language != 'string') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'language'!"
+ };
+
+ return this.resultStruct;
+ }
+ if (params.appID == null) {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Parameter 'appID' does not exists!"
+ };
+
+ return this.resultStruct;
+ }
+ if (typeof params.appID != 'number') {
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
+ "resultMessage": "Wrong type of parameter 'appID'!"
+ };
+
+ return this.resultStruct;
+ }
+
+ this.resultStruct = {
+ "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
+ };
+
+ return this.resultStruct;
+ }
+ })
+ });
diff --git a/src/components/HMI/app/controlls/AZERTYLayout.js b/src/components/HMI/app/controlls/AZERTYLayout.js
new file mode 100755
index 0000000000..d6ae033884
--- /dev/null
+++ b/src/components/HMI/app/controlls/AZERTYLayout.js
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.QWERTYLayout
+ * @desc General list component for SDL application
+ * @category Controlls
+ * @filesource app/controlls/QWERTYLayout.js
+ * @version 1.0
+ */
+
+SDL.AZERTYLayout = Em.ContainerView.extend( {
+
+ classNames: 'keyboardLayout AZERTYLayout wide',
+
+ childViews: [
+ 'a',
+ 'z',
+ 'e',
+ 'r',
+ 't',
+ 'y',
+ 'u',
+ 'i',
+ 'o',
+ 'p',
+ 'q',
+ 's',
+ 'd',
+ 'f',
+ 'g',
+ 'h',
+ 'j',
+ 'k',
+ 'l',
+ 'm',
+ 'w',
+ 'x',
+ 'c',
+ 'v',
+ 'b',
+ 'n',
+ 'dash',
+ 'ampersand'
+ ],
+
+ a: SDL.Button.extend({
+ classNames: 'a k0',
+ text : 'a',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ z: SDL.Button.extend({
+ classNames: 'z k1',
+ text : 'z',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ e: SDL.Button.extend({
+ classNames: 'e k2',
+ text : 'e',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ r: SDL.Button.extend({
+ classNames: 'r k3',
+ text : 'r',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ t: SDL.Button.extend({
+ classNames: 't k4',
+ text : 't',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ y: SDL.Button.extend({
+ classNames: 'y k5',
+ text : 'y',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ u: SDL.Button.extend({
+ classNames: 'u k6',
+ text : 'u',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ i: SDL.Button.extend({
+ classNames: 'i k7',
+ text : 'i',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ o: SDL.Button.extend({
+ classNames: 'o k8',
+ text : 'o',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ p: SDL.Button.extend({
+ classNames: 'p k9',
+ text : 'p',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ q: SDL.Button.extend({
+ classNames: 'q k10',
+ text : 'q',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ s: SDL.Button.extend({
+ classNames: 's k11',
+ text : 's',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ d: SDL.Button.extend({
+ classNames: 'd k12',
+ text : 'd',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ f: SDL.Button.extend({
+ classNames: 'f k13',
+ text : 'f',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ g: SDL.Button.extend({
+ classNames: 'g k14',
+ text : 'g',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ h: SDL.Button.extend({
+ classNames: 'h k15',
+ text : 'h',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ j: SDL.Button.extend({
+ classNames: 'j k16',
+ text : 'j',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ k: SDL.Button.extend({
+ classNames: 'k k17',
+ text : 'k',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ l: SDL.Button.extend({
+ classNames: 'l k18',
+ text : 'l',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ m: SDL.Button.extend({
+ classNames: 'm k19',
+ text : 'm',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ w: SDL.Button.extend({
+ classNames: 'w k21',
+ text : 'w',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ x: SDL.Button.extend({
+ classNames: 'x k22',
+ text : 'x',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ c: SDL.Button.extend({
+ classNames: 'c k23',
+ text : 'c',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ v: SDL.Button.extend({
+ classNames: 'v k24',
+ text : 'v',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ b: SDL.Button.extend({
+ classNames: 'b k25',
+ text : 'b',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ n: SDL.Button.extend({
+ classNames: 'n k26',
+ text : 'n',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ dash: SDL.Button.extend({
+ classNames: 'dash k27',
+ text : '-',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ ampersand: SDL.Button.extend({
+ classNames: 'ampersand k28',
+ text : '&',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/Button.js b/src/components/HMI/app/controlls/Button.js
new file mode 100644
index 0000000000..7d5b4f4ed2
--- /dev/null
+++ b/src/components/HMI/app/controlls/Button.js
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.Button
+ * @desc Universal button component for SDL application
+ * @category Controlls
+ * @filesource app/controlls/Button.js
+ * @version 1.0
+ */
+
+SDL.Button = Em.View
+ .extend(Ember.TargetActionSupport,
+ {
+ classNames: [
+ 'ffw-button', 'notpressed'
+ ],
+
+ classNameBindings: [
+ 'pressed', 'disabled', 'hidden'
+ ],
+
+ /** Pressed state binding */
+ pressed: false,
+
+ /** Disable actions on button */
+ disabled: false,
+
+ /** Button icon class */
+ icon: null,
+
+ /** Button text */
+ text: null,
+
+ rightText: null,
+
+ target: this.target ? this.target : this,
+
+ /** Arrow icon */
+ arrow: false,
+
+ /** Button timer flag */
+ timer: 0,
+
+ timerId: null,
+ /** Touch leave event flag */
+ touchleave: false,
+
+ onDown: true,
+
+ helpMode: false,
+ /** */
+ targetElement: null,
+
+ actionDown: function(event) {
+
+ if (this.get('disabled')) { return; }
+
+ var self = this;
+
+ this.set('pressed', true);
+ /** Set Mouse Leave Event Flag to false */
+ this.set('mouseleave', false);
+
+ // Default trigger action
+ if (this.onDown) {
+ this.triggerAction();
+ }
+
+ // Call trigger with timeout
+ if (this.timer) {
+ this.timerId = setInterval(function() {
+
+ self.triggerAction();
+ }, this.timer);
+ }
+ },
+
+ actionUp: function(event) {
+
+ this.set('pressed', false);
+
+ if (this.timer) {
+ clearInterval(this.timerId);
+ }
+
+ if (this.get('disabled')) {
+ if (this.touchleave == true) {
+ this.set('touchleave', false);
+ }
+ return;
+ }
+
+ if (!this.onDown) {
+ this.triggerAction();
+ }
+ },
+
+ /** Only for desktop */
+ mouseLeave: function(event) {
+
+ this.set('pressed', false);
+
+ if (this.timer) {
+ clearInterval(this.timerId);
+ }
+ },
+
+ /**
+ * Only for IOS Simulation of mouseleave event for touch devices If
+ * target element looses focus during touch move event events dont
+ * trigger
+ */
+ touchMove: function(event) {
+
+ /** Set Mouse Leave Event Flag to true */
+ this.set('touchleave', this.targetElement !== document
+ .elementFromPoint(event.originalEvent.touches[0].pageX,
+ event.originalEvent.touches[0].pageY));
+ },
+
+ // component default template
+ defaultTemplate: Em.Handlebars
+ .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
+ + '<span>{{view.text}}</span>'),
+
+ templates: {
+ text: Em.Handlebars.compile('<span class="text">{{view.text}}</span>'),
+
+ icon: Em.Handlebars
+ .compile('<img class="ico" {{bindAttr src="view.icon"}} />'),
+
+ rightText: Em.Handlebars
+ .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
+ + '<span class="right_text">{{view.text}}</span>'),
+
+ arrow: Em.Handlebars
+ .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
+ + '<span>{{view.text}}</span>'
+ + '<img class="arrow-ico" src="images/common/arrow_ico.png" />'),
+
+ rightIcon: Em.Handlebars
+ .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
+ + '<span>{{view.text}}</span>'
+ + '<img class="right_ico" {{bindAttr src="view.righticon"}} />')
+ }
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/Indicator.js b/src/components/HMI/app/controlls/Indicator.js
new file mode 100644
index 0000000000..4d3804e730
--- /dev/null
+++ b/src/components/HMI/app/controlls/Indicator.js
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.Indicator
+ * @desc Universal button component with value indicator for SDL application
+ * @category Controlls
+ * @filesource app/controlls/Indicator.js
+ * @version 1.0
+ */
+
+SDL.Indicator = Em.View.extend(Ember.TargetActionSupport, {
+
+ /** Content binding */
+ content: null,
+
+ /** internal indicators array */
+ indicators: null,
+
+ /** indicator active class */
+ indActiveClass: null,
+
+ /** indicator default class */
+ indDefaultClass: null,
+
+ /** Set active indicator from the start */
+ startFrom: null,
+
+ /** binding property to enable/disable indicators */
+ enabledBinding: 'content.enabled',
+
+ /**
+ * Before rendering view handeler need to generate indicators array based on
+ * indicator range value
+ */
+ beforeRender: function() {
+
+ // define variables
+ var length = this.content.range, view = this, i;
+
+ // generate indicators
+ this.indicators = [];
+
+ for (i = 0; i < length; i++) {
+ this.indicators.push(Em.Object.create( {
+ index: i,
+ className: this.indDefaultClass
+ }));
+ }
+ // apply indicator visualization rule
+ view.setRecord();
+
+ if (this.startFrom) {
+ this.indicators[this.startFrom].set('className',
+ this.indActiveClass);
+ }
+
+ // add observer to content record
+ this.addObserver('content', function() {
+
+ view.setRecord();
+ });
+
+ // view internal call
+ this.applyAttributesToBuffer(this.buffer);
+ },
+
+ actionDown: function() {
+
+ this.triggerAction();
+ },
+
+ // change record binding
+ setRecord: function() {
+
+ var view = this;
+
+ if (this.content.observersForKey('value').length == 0) {
+
+ this.content.addObserver('value', function() {
+
+ view.toggleIndicators();
+ });
+
+ }
+
+ this.toggleIndicators();
+ },
+
+ // Toggle indicator handeler
+ toggleIndicators: function() {
+
+ var length = this.indicators.length, i;
+
+ for (i = 0; i < length; i++) {
+ if (i >= this.content.value) {
+ this.indicators[i].set('className', 'SDL_indicator '
+ + this.indDefaultClass);
+ } else {
+ this.indicators[i].set('className', 'SDL_indicator '
+ + this.indActiveClass);
+ }
+ }
+ },
+
+ /** Define indicator template */
+ template: Ember.Handlebars.compile('{{#with view}}'
+ + '{{#each indicators}}'
+ + '<div {{bindAttr class="className view.enabled:show"}}></div>'
+ + '{{/each}}' + '{{/with}}')
+
+});
diff --git a/src/components/HMI/app/controlls/Label.js b/src/components/HMI/app/controlls/Label.js
new file mode 100644
index 0000000000..2fc9e6604f
--- /dev/null
+++ b/src/components/HMI/app/controlls/Label.js
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.Label
+ * @desc Universal label component for SDL application
+ * @category Controlls
+ * @filesource app/controlls/Label.js
+ * @version 1.0
+ */
+
+SDL.Label = Em.View.extend( {
+ classNameBindings: [
+ 'disabled'
+ ],
+ classNames: 'label',
+
+ // component default template
+ defaultTemplate: Em.Handlebars.compile('<span>{{view.content}}</span>'),
+
+ templates: {
+ icon: Em.Handlebars
+ .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
+ + '<span>{{view.content}}</span>')
+ }
+
+/** Define button template */
+/*
+ * template: Ember.Handlebars.compile( '{{#with view}}'+ '{{#if icon}}<img
+ * class="ico" {{bindAttr src="icon"}} />{{/if}}'+ '<span>{{content}}</span>'+
+ * '{{/with}}' )
+ */
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/List.js b/src/components/HMI/app/controlls/List.js
new file mode 100644
index 0000000000..e0fc551f40
--- /dev/null
+++ b/src/components/HMI/app/controlls/List.js
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.List
+ * @desc General list component for SDL application
+ * @category Controlls
+ * @filesource app/controlls/List.js
+ * @version 1.0
+ */
+
+SDL.List = Em.ContainerView.extend( {
+
+ classNames: 'list',
+
+ /** flag for scrollbar */
+ disableScrollbar: false,
+
+ /** Set count of items at one time */
+ itemsOnPage: 0,
+
+ /** Speed of scrolling in milliseconds */
+ scrollBarSpeed: 200,
+
+ /** Number of columns on page */
+ columnsNumber: 1,
+
+ itemheight: 50,
+
+ /** Current scroll page */
+ currentPage: 0,
+
+ /** Css style of list */
+ listScrollingAttributes: '',
+
+ /** Count of items in menu */
+ /*
+ * listCount: function(){ if( this.items ) { return this.items.length; }
+ * }.property('items.@each.type'),
+ */
+ listCount: function() {
+
+ if ( (this.get('this.list.childViews.length') / this.get('columnsNumber') / this.get('itemsOnPage') ) < this.get('currentPage')) {
+ this.set('currentPage', 0);
+ }
+ // console.log(this.get('this.list.childViews.length'));
+ return this.get('this.list.childViews.length');
+ }.property('this.list.childViews.length'),
+
+ /** Pages count */
+ pageCount: function() {
+
+ return Math.ceil(this.get('listCount') / this.get('columnsNumber')
+ / this.get('itemsOnPage'));
+ }.property('listCount', 'itemsOnPage'),
+
+ listHeight: function() {
+
+ return this.itemsOnPage * this.itemheight;
+ }.property('itemsOnPage'),
+
+ /** Action of element "sb-top" which show previous list page */
+ sbUp: function() {
+
+ if (this.get('currentPage') > 0) {
+ this.set('currentPage', this.get('currentPage') - 1);
+ }
+ },
+
+ /** Action of element "sb-bottom" which show previous list page */
+ sbDown: function() {
+
+ if (this.get('currentPage') < this.get('pageCount') - 1) {
+ this.set('currentPage', this.get('currentPage') + 1);
+ }
+ },
+
+ /** Scroll content according to current page */
+ onCurrentPageChange: function() {
+
+ this.set('listScrollingAttributes', 'margin-top: '
+ + (this.get('currentPage') * this.itemsOnPage * (-50)) + 'px');
+ }.observes('currentPage'),
+
+ /** Method for delete certain item from list */
+ deleteItem: function(id) {
+
+ this.items.splice(id, 1);
+ this.list.refresh();
+ },
+
+ /** List components */
+ childViews: [
+ 'list', 'scrollbar'
+ ],
+
+ /** List view */
+ list: Em.ContainerView.extend( {
+
+ classNames: 'list-content',
+
+ listStyleBinding: 'parentView.listScrollingAttributes',
+
+ attributeBindings: [
+ 'listStyle:style'
+ ],
+
+ refresh: function() {
+
+ this.rerender();
+ }.observes('_parentView.items.@each.type'),
+
+ afterRender: function() {
+
+ var items = this._parentView.items, element, i, key, binding;
+
+ for (i = 0; i < items.length; i++) {
+
+ element = items[i].type.create( {
+ // element id
+ elementId: this._parentView.elementId + '_item' + i,
+
+ // list item css class
+ classNames: 'list-item',
+
+ classNameBindings: [
+ 'this.voiceOver'
+ ],
+
+ // Dynamic property set
+ init: function() {
+
+ for (key in items[i].params) {
+ if (key.match('Binding') != null) {
+ binding = Ember.Binding
+ .from(items[i].params[key]).to(key
+ .replace('Binding', ''));
+ binding.connect(this);
+ // Set one way binding
+ binding.oneWay();
+ } else {
+ this.set(key, items[i].params[key]);
+ }
+ }
+ this._super();
+ // synchronize bindings
+ Ember.run.sync();
+ }
+ })
+
+ // Push element to list
+ this.get('childViews').pushObject(element);
+ }
+ }
+ }),
+
+ /** Scrollbar view */
+ scrollbar: SDL.ScrollBar.extend( {
+ currentPageBinding: 'parentView.currentPage',
+ pageCountBinding: 'parentView.pageCount',
+ listHeightBinding: 'parentView.listHeight',
+ scrollBarIsDisabledBinding: 'parentView.disableScrollbar'
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/MenuList.js b/src/components/HMI/app/controlls/MenuList.js
new file mode 100644
index 0000000000..b4ba9207ef
--- /dev/null
+++ b/src/components/HMI/app/controlls/MenuList.js
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.MenuList
+ * @desc
+ * @category Controlls
+ * @filesource app/controlls/MenuList.js
+ * @version 1.0
+ */
+
+SDL.MenuList = Em.ContainerView
+ .extend( {
+
+ /**
+ * Add new item to container
+ *
+ * @param buttons:
+ * SoftButton[]
+ */
+ addItems: function(buttons, appID) {
+
+ this.deleteItems();
+
+ if (buttons) {
+ for ( var i = 0; i < buttons.length; i++) {
+ this.get('content.childViews').pushObject(SDL.Button
+ .create(SDL.PresetEventsCustom, {
+ text: buttons[i].text,
+ icon: buttons[i].image ? buttons[i].image.value : "",
+ templateName: buttons[i].image ? 'rightText' : 'text',
+ groupName: "AlertPopUp",
+ classNameBindings: ['isHighlighted:isHighlighted'],
+ isHighlighted: buttons[i].isHighlighted ? true : false,
+ softButtonID: buttons[i].softButtonID,
+ systemAction: buttons[i].systemAction,
+ groupName: this.groupName,
+ classNames: 'softButton',
+ appID: appID
+ }));
+ }
+ }
+ },
+
+ /**
+ * Delete existing Soft Buttons from container
+ */
+ deleteItems: function() {
+
+ this.get('content.childViews').removeObjects(this.get('content.childViews').filterProperty('softButtonID'));
+ this.get('content.childViews').removeObjects(this.get('content.childViews').filterProperty('softButtonID', 0));
+ },
+
+ classNames: [
+ 'ffw_list_menu'
+ ],
+
+ attributeBindings: [
+ 'elementHeight:style'
+ ],
+
+ // Position of current page
+ page: 0,
+
+ // Items per one page
+ itemsOnPage: 5,
+
+ // Height of one item
+ ITEM_HEIGHT: 50,
+
+ pageHeight: function() {
+
+ return this.itemsOnPage * this.ITEM_HEIGHT;
+ }.property('this.itemsOnPage'),
+
+ elementHeight: function() {
+
+ return 'height:'
+ + String(this.get('pageHeight') + this.ITEM_HEIGHT - 2) + 'px;';
+ }.property('this.pageHeight'),
+
+ // Position of content block
+ contentPositon: function() {
+
+ return 'top:'
+ + String(-(this.get('page') * this.get('pageHeight')))
+ + 'px; height:'
+ + String(this.get('pageHeight')
+ - (Boolean(this.get('onLastPage') && this.get('page')) * this.ITEM_HEIGHT))
+ + 'px;';
+ }.property('onLastPage'),
+
+ // Property for show or hide 'down' button
+ onLastPage: function() {
+
+ return ((this.get('page') * this.itemsOnPage) < (this
+ .get('content.childViews.length') - this.itemsOnPage));
+ }.property('page', 'content.childViews.length'),
+
+ // Handeler to go previous page
+ pageUp: function() {
+
+ if (this.get('page')) {
+ this.set('page', (this.get('page') - 1));
+ }
+ },
+
+ // Handeler to go next page
+ pageDown: function() {
+
+ if (this.get('onLastPage')) {
+ this.set('page', (this.get('page') + 1));
+ }
+ },
+
+ childViews: [
+ 'upButton', 'content', 'downButton'
+ ],
+
+ upButton: SDL.Button.extend( {
+
+ classNames: [
+ 'control', 'up_button'
+ ],
+
+ hidden: function() {
+
+ if (this.get('parentView.page')) {
+ return false;
+ } else {
+ return true;
+ }
+ }.property('parentView.page'),
+
+ templateName: 'icon',
+
+ icon: 'images/media/ico_arrow_up.png',
+
+ action: 'pageUp',
+
+ onDown: false,
+
+ target: 'parentView'
+ }),
+
+ downButton: SDL.Button.extend( {
+
+ classNames: [
+ 'control', 'down_button'
+ ],
+
+ hidden: function() {
+
+ if (this.get('parentView.onLastPage')) {
+ return false;
+ } else {
+ return true;
+ }
+ }.property('parentView.onLastPage'),
+
+ templateName: 'icon',
+
+ icon: 'images/media/ico_arrow_down.png',
+
+ action: 'pageDown',
+
+ onDown: false,
+
+ target: 'parentView'
+ }),
+
+ content: Em.ContainerView.extend( {
+
+ classNames: [
+ 'content'
+ ],
+
+ attributeBindings: [
+ 'parentView.contentPositon:style'
+ ]
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/QWERTYLayout.js b/src/components/HMI/app/controlls/QWERTYLayout.js
new file mode 100755
index 0000000000..336587d02a
--- /dev/null
+++ b/src/components/HMI/app/controlls/QWERTYLayout.js
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.QWERTYLayout
+ * @desc General list component for SDL application
+ * @category Controlls
+ * @filesource app/controlls/QWERTYLayout.js
+ * @version 1.0
+ */
+
+SDL.QWERTYLayout = Em.ContainerView.extend( {
+
+ classNames: 'keyboardLayout QWERTYLayout',
+
+ childViews: [
+ 'q',
+ 'w',
+ 'e',
+ 'r',
+ 't',
+ 'y',
+ 'u',
+ 'i',
+ 'o',
+ 'p',
+ 'a',
+ 's',
+ 'd',
+ 'f',
+ 'g',
+ 'h',
+ 'j',
+ 'k',
+ 'l',
+ 'z',
+ 'x',
+ 'c',
+ 'v',
+ 'b',
+ 'n',
+ 'm',
+ 'dash',
+ 'ampersand'
+ ],
+
+ q: SDL.Button.extend({
+ classNames: 'q k0',
+ text : 'q',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ w: SDL.Button.extend({
+ classNames: 'w k1',
+ text : 'w',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ e: SDL.Button.extend({
+ classNames: 'e k2',
+ text : 'e',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ r: SDL.Button.extend({
+ classNames: 'r k3',
+ text : 'r',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ t: SDL.Button.extend({
+ classNames: 't k4',
+ text : 't',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ y: SDL.Button.extend({
+ classNames: 'y k5',
+ text : 'y',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ u: SDL.Button.extend({
+ classNames: 'u k6',
+ text : 'u',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ i: SDL.Button.extend({
+ classNames: 'i k7',
+ text : 'i',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ o: SDL.Button.extend({
+ classNames: 'o k8',
+ text : 'o',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ p: SDL.Button.extend({
+ classNames: 'p k9',
+ text : 'p',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ a: SDL.Button.extend({
+ classNames: 'a k10',
+ text : 'a',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ s: SDL.Button.extend({
+ classNames: 's k11',
+ text : 's',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ d: SDL.Button.extend({
+ classNames: 'd k12',
+ text : 'd',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ f: SDL.Button.extend({
+ classNames: 'f k13',
+ text : 'f',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ g: SDL.Button.extend({
+ classNames: 'g k14',
+ text : 'g',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ h: SDL.Button.extend({
+ classNames: 'h k15',
+ text : 'h',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ j: SDL.Button.extend({
+ classNames: 'j k16',
+ text : 'j',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ k: SDL.Button.extend({
+ classNames: 'k k17',
+ text : 'k',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ l: SDL.Button.extend({
+ classNames: 'l k18',
+ text : 'l',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ z: SDL.Button.extend({
+ classNames: 'z k21',
+ text : 'z',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ x: SDL.Button.extend({
+ classNames: 'x k22',
+ text : 'x',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ c: SDL.Button.extend({
+ classNames: 'c k23',
+ text : 'c',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ v: SDL.Button.extend({
+ classNames: 'v k24',
+ text : 'v',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ b: SDL.Button.extend({
+ classNames: 'b k25',
+ text : 'b',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ n: SDL.Button.extend({
+ classNames: 'n k26',
+ text : 'n',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ m: SDL.Button.extend({
+ classNames: 'm k27',
+ text : 'm',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ dash: SDL.Button.extend({
+ classNames: 'dash k28',
+ text : '-',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ ampersand: SDL.Button.extend({
+ classNames: 'ampersand k29',
+ text : '&',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/QWERTZLayout.js b/src/components/HMI/app/controlls/QWERTZLayout.js
new file mode 100755
index 0000000000..4374c5f78b
--- /dev/null
+++ b/src/components/HMI/app/controlls/QWERTZLayout.js
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.QWERTYLayout
+ * @desc General list component for SDL application
+ * @category Controlls
+ * @filesource app/controlls/QWERTYLayout.js
+ * @version 1.0
+ */
+
+SDL.QWERTZLayout = Em.ContainerView.extend( {
+
+ classNames: 'keyboardLayout QWERTZLayout',
+
+ childViews: [
+ 'q',
+ 'w',
+ 'e',
+ 'r',
+ 't',
+ 'z',
+ 'u',
+ 'i',
+ 'o',
+ 'p',
+ 'a',
+ 's',
+ 'd',
+ 'f',
+ 'g',
+ 'h',
+ 'j',
+ 'k',
+ 'l',
+ 'y',
+ 'x',
+ 'c',
+ 'v',
+ 'b',
+ 'n',
+ 'm',
+ 'dash',
+ 'ampersand'
+ ],
+
+ q: SDL.Button.extend({
+ classNames: 'q k0',
+ text : 'q',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ w: SDL.Button.extend({
+ classNames: 'w k1',
+ text : 'w',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ e: SDL.Button.extend({
+ classNames: 'e k2',
+ text : 'e',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ r: SDL.Button.extend({
+ classNames: 'r k3',
+ text : 'r',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ t: SDL.Button.extend({
+ classNames: 't k4',
+ text : 't',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ z: SDL.Button.extend({
+ classNames: 'z k5',
+ text : 'z',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ u: SDL.Button.extend({
+ classNames: 'u k6',
+ text : 'u',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ i: SDL.Button.extend({
+ classNames: 'i k7',
+ text : 'i',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ o: SDL.Button.extend({
+ classNames: 'o k8',
+ text : 'o',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ p: SDL.Button.extend({
+ classNames: 'p k9',
+ text : 'p',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ a: SDL.Button.extend({
+ classNames: 'a k10',
+ text : 'a',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ s: SDL.Button.extend({
+ classNames: 's k11',
+ text : 's',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ d: SDL.Button.extend({
+ classNames: 'd k12',
+ text : 'd',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ f: SDL.Button.extend({
+ classNames: 'f k13',
+ text : 'f',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ g: SDL.Button.extend({
+ classNames: 'g k14',
+ text : 'g',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ h: SDL.Button.extend({
+ classNames: 'h k15',
+ text : 'h',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ j: SDL.Button.extend({
+ classNames: 'j k16',
+ text : 'j',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ k: SDL.Button.extend({
+ classNames: 'k k17',
+ text : 'k',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ l: SDL.Button.extend({
+ classNames: 'l k18',
+ text : 'l',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ y: SDL.Button.extend({
+ classNames: 'y k21',
+ text : 'y',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ x: SDL.Button.extend({
+ classNames: 'x k22',
+ text : 'x',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ c: SDL.Button.extend({
+ classNames: 'c k23',
+ text : 'c',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ v: SDL.Button.extend({
+ classNames: 'v k24',
+ text : 'v',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ b: SDL.Button.extend({
+ classNames: 'b k25',
+ text : 'b',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ n: SDL.Button.extend({
+ classNames: 'n k26',
+ text : 'n',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ m: SDL.Button.extend({
+ classNames: 'm k27',
+ text : 'm',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ dash: SDL.Button.extend({
+ classNames: 'dash k28',
+ text : '-',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ ampersand: SDL.Button.extend({
+ classNames: 'ampersand k29',
+ text : '&',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/ScrollBar.js b/src/components/HMI/app/controlls/ScrollBar.js
new file mode 100644
index 0000000000..466a29e409
--- /dev/null
+++ b/src/components/HMI/app/controlls/ScrollBar.js
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.ScrollBar
+ * @desc ScrollBar component for List component
+ * @category Controlls
+ * @filesource app/controlls/ScrollBar.js
+ * @version 1.0
+ */
+
+SDL.ScrollBar = Em.ContainerView
+ .extend( {
+
+ /** Define enable/disable scrollbar */
+ classNameBindings: [
+ 'scrollBarIsDisabled:is-disabled'
+ ],
+
+ /** Componet class */
+ classNames: 'scrollbar',
+
+ /** Childs views */
+ childViews: [
+ 'upButton', 'bar', 'downButton'
+ ],
+
+ /** current page */
+ currentPage: 1,
+
+ /** Pages count */
+ pageCount: 0,
+
+ listHeight: 250,
+
+ /** On/OF scrollbar */
+ scrollBarIsDisabled: false,
+
+ /** Define bar height */
+ sbHeight: function() {
+
+ /** Max bar height */
+ this.maxHeight = this.listHeight - 102;
+ if (this.pageCount <= 1) {
+ return this.maxHeight + 1;
+ } else {
+ return (this.maxHeight / this.pageCount);
+ }
+ }.property('pageCount'),
+
+ /** Position of bar */
+ sbTop: function() {
+
+ if (this.get('currentPage') == 0) {
+ return 0;
+ } else {
+ return (this.maxHeight - this.get('sbHeight'))
+ / (this.get('pageCount') - 1) * this.get('currentPage') + 1;
+ }
+ }.property('currentPage', 'pageCount'),
+
+ /** Support function */
+ scrollbarBodyStyleAttributes: function() {
+
+ return 'height: ' + (this.get('listHeight') - 1) + 'px;';
+ }.property('listHeight'),
+
+ /** Support function */
+ sbBodyStyleAttributes: function() {
+
+ return 'height: ' + (this.get('listHeight') - 100 - 1) + 'px;';
+ }.property('listHeight'),
+
+ sbStyleAttributes: function() {
+
+ return 'height: ' + this.get('sbHeight') + 'px; ' + 'top: '
+ + this.get('sbTop') + 'px';
+ }.property('currentPage', 'pageCount'),
+
+ /** Define scroll up button "disable" status */
+ sbUpButtonIsDisabled: function() {
+
+ if (this.get('currentPage') < 1) {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('currentPage', 'pageCount'),
+
+ /** Define scroll down button "disable" status */
+ sbDownButtonIsDisabled: function() {
+
+ if ((this.pageCount - 1) > this.get('currentPage')) {
+ return false;
+ } else {
+ return true;
+ }
+ }.property('currentPage', 'pageCount'),
+
+ attributeBindings: [
+ 'scrollbarBodyStyleAttributes:style'
+ ],
+
+ /** Bottom for scroll up */
+ upButton: SDL.Button.extend( {
+ classNames: [
+ 'sb-top', 'button'
+ ],
+ action: 'sbUp',
+ target: 'parentView.parentView',
+ disabledBinding: 'parentView.sbUpButtonIsDisabled',
+ icon: 'images/list/scrollbar/button-up-active.png',
+ timer: 200
+ }),
+
+ /** Bottom for scroll down */
+ downButton: SDL.Button.extend( {
+ classNames: [
+ 'sb-bottom', 'button'
+ ],
+ action: 'sbDown',
+ target: 'parentView.parentView',
+ disabledBinding: 'parentView.sbDownButtonIsDisabled',
+ icon: 'images/list/scrollbar/button-down-active.png',
+ timer: 200
+ }),
+
+ /** Scrollbar track */
+ bar: Em.View
+ .extend( {
+ barBodyStyleBinding: 'parentView.sbBodyStyleAttributes',
+ barStyleBinding: 'parentView.sbStyleAttributes',
+ cancelAnimationBinding: 'parentView.parentView.cancelAnimation',
+
+ layout: Em.Handlebars
+ .compile('<div class="sb-body" {{bindAttr style="view.barBodyStyle"}}>'
+ + '{{yield}}' + '</div>'),
+
+ template: Em.Handlebars
+ .compile('<div class="sb-bar" '
+ + '{{bindAttr style="view.barStyle"}}'
+ + '{{bindAttr class="view.cancelAnimation:cancelBarAnimation"}}>'
+ + '</div>')
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/ScrollableText.js b/src/components/HMI/app/controlls/ScrollableText.js
new file mode 100644
index 0000000000..40d35f012b
--- /dev/null
+++ b/src/components/HMI/app/controlls/ScrollableText.js
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.ScrollableText
+ * @desc General ScrollableText component
+ * @category Controlls
+ * @filesource app/controlls/scrollableText.js
+ * @version 1.0
+ */
+
+SDL.ScrollableText = Em.ContainerView
+ .extend( {
+
+ classNames: 'scrollableText',
+
+ /** flag for scrollbar */
+ disableScrollbar: false,
+
+ /** Set count of items at one time */
+ itemsOnPage: 0,
+
+ /** Speed of scrolling in milliseconds */
+ scrollBarSpeed: 200,
+
+ /** Number of columns on page */
+ columnsNumber: 1,
+
+ itemheight: 50,
+
+ /** Current scroll page */
+ currentPage: 0,
+
+ /** Css style of scrollableText */
+ scrollableTextScrollingAttributes: '',
+
+ /** Css style of line-height of rows */
+ linesHeght: 23,
+
+ linesCount: 1,
+
+ scrollHeight: null,
+
+ scrollableTextCount: function() {
+
+ if ($('#' + this.get('childViews')[1].elementId)) {
+ $('#' + this.get('childViews')[1].elementId)
+ .removeAttr('style');
+ this.set('scrollHeight', $('#'
+ + this.get('childViews')[1].elementId)[0].scrollHeight);
+ $('#' + this.get('childViews')[1].elementId)
+ .height(this.scrollHeight);
+ this.set('linesCount', $('#'
+ + this.get('childViews')[1].elementId)[0].scrollHeight
+ / this.linesHeght);
+ }
+ },
+
+ /** Pages count */
+ pageCount: function() {
+
+ return Math.ceil(this.get('linesCount') / this.get('itemsOnPage'));
+ }.property('linesCount', 'itemsOnPage'),
+
+ scrollableTextHeight: function() {
+
+ return this.itemsOnPage * this.itemheight;
+ }.property('itemsOnPage'),
+
+ /** Action of element "sb-top" which show previous scrollableText page */
+ sbUp: function() {
+
+ if (this.get('currentPage') > 0) {
+ this.set('currentPage', this.get('currentPage') - 1);
+ }
+ },
+
+ /** Action of element "sb-bottom" which show previous scrollableText page */
+ sbDown: function() {
+
+ if (this.get('currentPage') < this.get('pageCount') - 1) {
+ this.set('currentPage', this.get('currentPage') + 1);
+ }
+ },
+
+ /** Scroll content according to current page */
+ onCurrentPageChange: function() {
+
+ this.set('scrollableTextScrollingAttributes', 'height: '
+ + this.scrollHeight + 'px; top: '
+ + (this.get('currentPage') * this.itemsOnPage * (-23)) + 'px');
+ }.observes('currentPage'),
+
+ /** Method for delete certain item from scrollableText */
+ deleteItem: function(id) {
+
+ this.items.splice(id, 1);
+ this.scrollableText.refresh();
+ },
+
+ /** scrollableText components */
+ childViews: [
+ 'scrollbar',
+ // 'scrollableText'
+ ],
+
+ refreshTextArea: function() {
+
+ if (this.get('childViews')[1]) {
+ this.get('childViews').removeObject(this.get('childViews')[1]);
+ }
+
+ $('#scrollableTextArea').height(23);
+ this.set('scrollHeight', 23);
+ this.set('linesCount', 1);
+ this.set('currentPage', 0);
+
+ this
+ .get('childViews')
+ .pushObject(Ember.TextArea
+ .create( {
+
+ classNames: 'scrollableTextArea',
+
+ elementId: 'scrollableTextArea',
+
+ scrollableTextStyleBinding: 'parentView.scrollableTextScrollingAttributes',
+
+ attributeBindings: [
+ 'scrollableTextStyle:style'
+ ],
+
+ valueBinding: 'this.parentView.items',
+
+ actionDown: function() {
+
+ return false;
+ },
+
+ didInsertElement: function() {
+
+ this.get('parentView').scrollableTextCount();
+ }
+ }));
+ }.observes('items'),
+
+ /** scrollableText view */
+ scrollableText: Ember.TextArea
+ .extend( {
+
+ classNames: 'scrollableTextArea',
+
+ elementId: 'scrollableTextArea',
+
+ scrollableTextStyleBinding: 'parentView.scrollableTextScrollingAttributes',
+
+ attributeBindings: [
+ 'scrollableTextStyle:style'
+ ],
+
+ valueBinding: 'this.parentView.items',
+
+ actionDown: function() {
+
+ return false;
+ },
+
+ didInsertElement: function() {
+
+ this._parentView.scrollableTextCount();
+ },
+
+ refresh: function() {
+
+ this.rerender();
+ }.observes('_parentView.items')
+
+ }),
+
+ /** Scrollbar view */
+ scrollbar: SDL.ScrollBar.extend( {
+ currentPageBinding: 'parentView.currentPage',
+ pageCountBinding: 'parentView.pageCount',
+ scrollableTextHeightBinding: 'parentView.scrollableTextHeight',
+ scrollBarIsDisabledBinding: 'parentView.disableScrollbar'
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/mixins/PresetEventCustom.js b/src/components/HMI/app/mixins/PresetEventCustom.js
new file mode 100644
index 0000000000..b28468e471
--- /dev/null
+++ b/src/components/HMI/app/mixins/PresetEventCustom.js
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PresetEventsCustom
+ * @desc Handler of custom preset butons events
+ * @category mixin
+ * @filesource app/mixins/PresetEventsCustom.js
+ * @version 1.0
+ */
+SDL.PresetEventsCustom = Ember.Mixin.create( {
+ actionDown: function() {
+
+ this._super();
+ SDL.SDLController.onSoftButtonActionDownCustom(this);
+ },
+ actionUp: function() {
+
+ this._super();
+ SDL.SDLController.onSoftButtonActionUpCustom(this);
+ if (this.systemAction == 'DEFAULT_ACTION') {
+
+ SDL.SDLController.defaultActionSoftButton(this);
+
+ } else if (this.systemAction == 'STEAL_FOCUS') {
+
+ SDL.SDLController.stealFocusSoftButton(this);
+
+ } else if (this.systemAction == 'KEEP_CONTEXT') {
+
+ SDL.SDLController.keepContextSoftButton(this);
+
+ }
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/mixins/PresetEvents.js b/src/components/HMI/app/mixins/PresetEvents.js
new file mode 100644
index 0000000000..08e58b6f31
--- /dev/null
+++ b/src/components/HMI/app/mixins/PresetEvents.js
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PresetEvents
+ * @desc Handler of preset butons events
+ * @category mixin
+ * @filesource app/mixins/PresetEvents.js
+ * @version 1.0
+ */
+SDL.PresetEvents = Ember.Mixin.create( {
+ actionDown: function() {
+
+ this._super();
+ SDL.SDLController.onSoftButtonActionDown(this);
+ },
+ actionUp: function() {
+
+ this._super();
+ SDL.SDLController.onSoftButtonActionUp(this);
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/model/PhoneModel.js b/src/components/HMI/app/model/PhoneModel.js
new file mode 100644
index 0000000000..7273be7a9c
--- /dev/null
+++ b/src/components/HMI/app/model/PhoneModel.js
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PhoneModel
+ * @desc Phone model
+ * @category Model
+ * @filesource app/model/PhoneModel.js
+ * @version 1.0
+ */
+
+SDL.PhoneModel = Em.Object.create( {
+
+ /** Dial number */
+ dialpadNumber: '',
+
+ readyForCall: true,
+
+ onCall: false,
+
+ /** Text for phone status bar */
+ statusModeText: null,
+
+ /** Start call */
+ dialCall: function() {
+
+ if (this.dialpadNumber.length) {
+ this.set('onCall', true);
+ this.set('readyForCall', false);
+ }
+ },
+
+ /** End call */
+ endCall: function() {
+
+ this.set('onCall', false);
+ this.set('readyForCall', true);
+ this.set('dialpadNumber', '');
+
+ this.set('statusModeText', null);
+
+ if (SDL.SDLModel.phoneCall) {
+ SDL.SDLModel.set('phoneCall', false);
+ SDL.SDLController
+ .getApplicationModel(SDL.SDLAppController.model.appID)
+ .turnOnSDL();
+ }
+ },
+
+ /** Add symbol to dial pad number */
+ setDialpadNumber: function(key) {
+
+ if (this.dialpadNumber.length < 14) {
+ key = this.dialpadNumber + key;
+ this.set('dialpadNumber', key);
+ }
+ },
+
+ /** Delete last number symbol */
+ deleteDialpadNumber: function() {
+
+ if (this.dialpadNumber.length) {
+ this.set('dialpadNumber', this.dialpadNumber.slice(0, -1));
+ }
+ }
+}) \ No newline at end of file
diff --git a/src/components/HMI/app/model/abstract/RangedValue.js b/src/components/HMI/app/model/abstract/RangedValue.js
new file mode 100644
index 0000000000..425e41806a
--- /dev/null
+++ b/src/components/HMI/app/model/abstract/RangedValue.js
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name Ranged Value
+ * @desc Abstract ranged value class
+ * @category Model
+ * @filesource app/model/abstract/RangedValue.js
+ * @version 1.0
+ */
+
+SDL.RangedValue = Em.Object.extend( {
+
+ range: 3,
+ minValue: 1,
+ value: 0,
+ cycle: true,
+ enabled: true,
+
+ /**
+ * @desc Cyclically increases seat value until it reaches the range value
+ * than value is switched to off (0)
+ */
+ increase: function() {
+
+ if (!this.enabled) {
+ this.enable();
+ return;
+ }
+
+ if (this.value < this.range) {
+ this.set('value', this.value + 1);
+ } else {
+ if (!this.cycle) { return; }
+ this.set('value', 0);
+ }
+ },
+ /**
+ * Toggle indicators one by one
+ */
+ toggleIndicators: function() {
+
+ if (!this.enabled) {
+ this.enable();
+ return;
+ }
+
+ if (this.value < this.range - 1) {
+ this.set('value', this.value + 1);
+ } else {
+ this.set('value', 0);
+ }
+ },
+ /**
+ * @desc Cyclically increases seat value until it reaches zero value (off)
+ * than value is changed to the range value
+ */
+ decrease: function() {
+
+ if (!this.enabled) {
+ this.enable();
+ return;
+ }
+
+ if (this.value >= this.minValue) {
+ if (!this.cycle && (this.value == this.minValue)) { return; }
+ this.set('value', this.value - 1);
+ } else {
+ this.set('value', this.range);
+ }
+ },
+
+ /**
+ * @desc Switch off
+ */
+ off: function() {
+
+ this.set('beforeOff', this.value);
+ this.set('value', 0);
+ },
+
+ /**
+ * Switch on
+ */
+ on: function() {
+
+ this.set('value', this.range);
+ },
+
+ /**
+ * Switch visual enable
+ */
+ enable: function() {
+
+ this.set('enabled', true);
+ },
+
+ /**
+ * Switch visual disable
+ */
+ disable: function() {
+
+ this.set('enabled', false);
+ },
+
+ /**
+ * Revert to value before toggle Off
+ */
+ revert: function() {
+
+ if (this.beforeOff) {
+ this.set('value', this.beforeOff);
+ }
+ }
+}) \ No newline at end of file
diff --git a/src/components/HMI/app/model/media/CDModel.js b/src/components/HMI/app/model/media/CDModel.js
new file mode 100644
index 0000000000..9ded512c5d
--- /dev/null
+++ b/src/components/HMI/app/model/media/CDModel.js
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.CDModel
+ * @desc CD Media data model
+ * @category Model
+ * @filesource app/model/media/CDModel.js
+ * @version 1.0
+ */
+
+SDL.CDModel = Em.Object.create( {
+ active: true,
+
+ statusBar: 'The Electric Broncos',
+
+ init: function() {
+
+ this.set('active', true);
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/model/sdl/AppModel.js b/src/components/HMI/app/model/sdl/AppModel.js
new file mode 100644
index 0000000000..6f93e2d668
--- /dev/null
+++ b/src/components/HMI/app/model/sdl/AppModel.js
@@ -0,0 +1,421 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLAppModel
+ * @desc Abstarct model for SDL applications
+ * @category Model
+ * @filesource app/model/sdl/AppModel.js
+ * @version 1.0
+ */
+
+SDL.SDLAppModel = Em.Object.extend({
+
+ /**
+ * List of subscribed data on VehicleInfo model
+ *
+ * @type {Object}
+ */
+ subscribedData: {},
+
+ /**
+ * Application's container for current processed requests on HMI
+ *
+ * @type {Object}
+ */
+ activeRequests: {},
+
+ /**
+ * Application Id
+ *
+ * @type {Number}
+ */
+ appID: null,
+
+ /**
+ * Application name
+ *
+ * @type {String}
+ */
+ appName: '',
+
+ /**
+ * Navigation streaming url
+ */
+ navigationStream: null,
+
+ /**
+ * Navigation streaming url
+ */
+ navigationAudioStream: null,
+
+ /**
+ * Chosen device name
+ *
+ * @type {String}
+ */
+ deviceName: '',
+
+ /**
+ * Chosen device id
+ *
+ * @type {String}
+ */
+ deviceID: null,
+
+ /**
+ * Global properties for current application
+ *
+ * @type {Object}
+ */
+ globalProperties: {},
+
+ /**
+ * Statusbar text
+ *
+ * @type {String}
+ */
+ statusText: '',
+
+ /**
+ * Info data
+ *
+ * @type: {Em.Object}
+ */
+ appInfo: null,
+
+ /**
+ * Current language of applications UI component
+ *
+ * @type {String}
+ */
+ UILanguage: 'EN-US',
+
+ /**
+ * Current language of applications TTS and applications VR component
+ *
+ * @type {String}
+ */
+ TTSVRLanguage: 'EN-US',
+
+ /**
+ * List of VR commands
+ */
+ VRCommands: [],
+
+ /**
+ * Array of Soft Buttons
+ *
+ * @type {Array}
+ */
+ softButtons: [],
+
+ /**
+ * Array of Soft Buttons
+ *
+ * @type {Array}
+ */
+ turnListSoftButtons: [],
+
+ /**
+ * Array of Objects for TBTTurnList
+ *
+ * @type {Array}
+ */
+ turnList: [],
+
+ /**
+ * Policies
+ * Array of avaliable permission codes for current app
+ * came from SDLCore in SDL.GetListOfPermissions response
+ *
+ * @type {Array}
+ */
+ allowedFunctions: [],
+
+ /**
+ * URL to application Icon
+ *
+ * @type {String}
+ */
+ appIcon: 'images/info/info_leftMenu_apps_ico.png',
+
+ /**
+ * Application commands list
+ *
+ * @type {Array}
+ */
+ commandsList: {
+ 0: []
+ },
+
+ /**
+ * Flag to open ShowConstantTBTview when entering to current screen
+ *
+ * @type {Boolean}
+ */
+ tbtActivate: false,
+
+ /**
+ * Return current menu commands
+ *
+ * @return {Array}
+ */
+ currentCommandsList: function () {
+
+ return this.get('commandsList.' + this.get('currentSubMenuId'));
+ }.property('this.currentSubMenuId'),
+
+ /**
+ * Current command submenu identificator
+ *
+ * @type {Number}
+ */
+ currentSubMenuId: 'top',
+
+ /**
+ * Return current submenu name
+ *
+ * @return {String}
+ */
+ currentSubMenuLabel: function () {
+
+ //Param "top" is Top level menu index
+ var submenu, commands = this.commandsList["top"];
+
+ for (var i = 0; i < commands.length; i++) {
+ if (commands[i].menuID == this.currentSubMenuId) {
+ submenu = commands[i].name;
+ }
+ }
+
+ return this.get('currentSubMenuId') != 'top' ? submenu : 'Options';
+ }.property('this.currentSubMenuId'),
+
+ /**
+ * Interaction chooses data
+ *
+ * @type {Object}
+ */
+ interactionChoices: {},
+
+ /**
+ * Method to remove deleted by SDL Core images used in HMI
+ *
+ * @param imageName
+ */
+ onImageRemoved: function(imageName){
+
+ var result = false;
+
+ // Get list of subMenus with commands
+ for (var commands in this.commandsList) {
+
+ // Check if object item (subMenu list of commands) is added list with command in object and not an inherited method of object
+ if(this.commandsList.hasOwnProperty(commands)){
+
+ var len = this.commandsList[commands].length;
+ for (var i = 0; i < len; i++) {
+
+ // Check image name with each command in each subMenu
+ if (this.commandsList[commands][i].icon) {
+ if (this.commandsList[commands][i].icon.indexOf(imageName) != -1
+ && imageName.length == this.commandsList[commands][i].icon.length) {
+
+ // If found same image path than set default icon path
+ this.commandsList[commands][i].icon = SDL.SDLModel.defaultListOfIcons.command;
+ result = true;
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ },
+
+ /**
+ * Update Soft Buttons will handle on command Show
+ *
+ * @param {Array}
+ */
+ updateSoftButtons: function (buttons) {
+
+ // delete existing buttons from array
+ this.softButtons.splice(0);
+
+ // push new buttons to array
+ this.get('softButtons').pushObjects(buttons);
+ },
+
+ /**
+ * Add command to list
+ *
+ * @param {Object}
+ */
+ addCommand: function (request) {
+
+ var parentID = request.params.menuParams.parentID > 0 ? request.params.menuParams.parentID : 'top';
+
+ if (!this.get('commandsList.' + parentID)) {
+ this.commandsList[parentID] = [];
+ }
+
+ var commands = this.get('commandsList.' + parentID);
+
+ // Magic number is limit of 1000 commands added on one menu
+ if (commands.length <= 999) {
+
+ commands[commands.length] = {
+ commandID: request.params.cmdID,
+ name : request.params.menuParams.menuName,
+ parent : parentID,
+ position : request.params.menuParams.position ? request.params.menuParams.position : 0,
+ icon : request.params.cmdIcon ? request.params.cmdIcon.value : null
+ };
+
+ if (SDL.SDLController.getApplicationModel(request.params.appID) && SDL.OptionsView.active) {
+ SDL.SDLAppController.buttonsSort(parentID, this.appID);
+ SDL.OptionsView.commands.refreshItems();
+ }
+
+ console.log(commands.length);
+ if (request.id >= 0) {
+ FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ }
+ } else {
+ FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Adding more than 1000 item to the top menu or to submenu is not allowed.');
+ }
+
+ },
+
+ /**
+ * Delete command from list
+ *
+ * @param {Number}
+ */
+ deleteCommand: function (commandID, requestID) {
+
+ for (var i in this.commandsList) {
+ if (this.commandsList[i].filterProperty('commandID', commandID).length) {
+ if (i != this.currentSubMenuId || this.currentSubMenuId == 'top') {
+ this.get('commandsList.' + i).removeObjects(this.get('commandsList.' + i).filterProperty('commandID', commandID));
+ SDL.SDLModel.deleteCommandResponse(SDL.SDLModel.resultCode["SUCCESS"], requestID);
+ return;
+ } else {
+ SDL.SDLModel.deleteCommandResponse(SDL.SDLModel.resultCode["IN_USE"], requestID);
+ return;
+ }
+ }
+ }
+ },
+
+ /**
+ * Add submenu to commands list
+ *
+ * @param {Object}
+ */
+ addSubMenu: function (request) {
+
+ // parentID is equal to 'top' cause Top level menu ID
+ var parentID = 'top';
+
+ var commands = this.get('commandsList.' + parentID);
+
+ // Magic number is limit of 1000 commands added on one menu
+ if (commands.length <= 999) {
+
+ this.commandsList[request.params.menuID] = [];
+ commands[commands.length] = {
+ menuID : request.params.menuID,
+ name : request.params.menuParams.menuName ? request.params.menuParams.menuName : '',
+ parent : 0,
+ position: request.params.menuParams.position ? request.params.menuParams.position : 0
+ };
+
+ if (SDL.SDLController.getApplicationModel(request.params.appID) && SDL.OptionsView.active) {
+ SDL.SDLAppController.buttonsSort(parentID, this.appID);
+ SDL.OptionsView.commands.refreshItems();
+ }
+
+ FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ } else {
+ FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Adding more than 1000 item to the top menu or to submenu is not allowed.');
+ }
+ },
+
+ /**
+ * Delete submenu and related commands from list
+ *
+ * @param {Number}
+ */
+ deleteSubMenu: function (menuID) {
+
+ if (this.commandsList['top'].filterProperty('commandID', menuID)) {
+ this.get('commandsList.top').removeObjects(this.get('commandsList.top').filterProperty('menuID', menuID));
+ delete(this.commandsList[menuID]);
+ }
+
+ return SDL.SDLModel.resultCode['SUCCESS'];
+ },
+
+ /**
+ * SDL UI CreateInteraction response handeler push set of commands to
+ * voice recognition list
+ *
+ * @param {Object}
+ */
+ onCreateInteraction: function (message) {
+
+ this.interactionChoices[message.interactionChoiceSetID] = message.choiceSet;
+
+ },
+
+ /**
+ * SDL UI DeleteInteraction response handeler close current interaction
+ * set window (if opened) and delete current set commands from voice
+ * recognition list
+ *
+ * @param {Object}
+ */
+ onDeleteInteraction: function (message) {
+
+ delete this.interactionChoices[message.interactionChoiceSetID];
+ },
+
+ /**
+ * SDL UI Slider response handeler open Slider window with received
+ * parameters
+ *
+ * @param {Object}
+ */
+ onSlider: function (message) {
+
+ SDL.SliderView.loadData(message);
+
+ SDL.SliderView.activate(this.appName, message.params.timeout);
+
+ }
+ });
diff --git a/src/components/HMI/app/model/sdl/MediaModel.js b/src/components/HMI/app/model/sdl/MediaModel.js
new file mode 100644
index 0000000000..b51156d2fd
--- /dev/null
+++ b/src/components/HMI/app/model/sdl/MediaModel.js
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLMediaModel
+ * @desc SDL data model
+ * @category Model
+ * @filesource app/model/media/SDLMediaModel.js
+ * @version 1.0
+ */
+
+SDL.SDLMediaModel = SDL.SDLAppModel.extend({
+
+ init: function () {
+
+ this._super();
+
+ var subscribeVIData = {};
+
+ for (var key in SDL.SDLVehicleInfoModel.vehicleData) {
+ if (key != "externalTemperature") {
+ subscribeVIData[key] = false;
+ }
+ }
+
+ this.set('subscribedData', subscribeVIData);
+
+ // init properties here
+ this.set('appInfo', Em.Object.create({
+ field1 : '<field1>',
+ field2 : '<field2>',
+ field3 : '<field3>',
+ mediaClock : '<mediaClock>',
+ trackIcon : SDL.SDLModel.defaultListOfIcons.trackIcon,
+ customPresets: [
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>'
+ ],
+ alignment : "text-align:center"
+ }));
+
+ this.set('activeRequests', Em.Object.create({
+ uiPerformInteraction: null
+ }));
+
+ this.set('VRCommands', []);
+ this.set('tbtActivate', false);
+ this.set('isPlaying', true);
+ this.set('globalProperties.helpPrompt', []);
+ this.set('globalProperties.timeoutPrompt', []);
+ this.set('globalProperties.keyboardProperties', Em.Object.create());
+ this.set('globalProperties.keyboardProperties.keyboardLayout', 'QWERTY');
+ this.set('globalProperties.keyboardProperties.limitedCharacterList', []);
+
+ this.set('commandsList', {"top": []});
+ this.set('softButtons', []);
+ },
+
+ /**
+ * Parameter for presets for Media App to show presets on media screen
+ *
+ * @type bool
+ */
+ mediaPreset: false,
+
+ /**
+ * Flag for media playing state
+ *
+ * @param {Boolean}
+ */
+ isPlaying: false,
+
+ /**
+ * Flag for model active state currently used for status bar
+ *
+ * @param {Boolean}
+ */
+ active: false,
+
+ /**
+ * Timer for Media Clock
+ */
+ timer: null,
+
+ /**
+ * Current sdl Sub Menu identificator
+ */
+ currentSDLSubMenuid: null,
+
+ /**
+ * Current sdl Perform Interaction Choise identificator
+ */
+ currentSDLPerformInteractionChoiseId: null,
+
+ countUp : true,
+ pause : null,
+ maxTimeValue: 68400, // 19 hours
+ duration : 0,
+ currTime : 0,
+
+ /**
+ * Method hides sdl activation button and sdl application
+ *
+ * @param {Number}
+ */
+ onDeleteApplication: function (appID) {
+
+ SDL.SDLMediaController.onDeleteApplication(appID);
+ },
+
+ /**
+ * Activate current application model
+ */
+ turnOnSDL: function () {
+
+ SDL.SDLMediaController.activateApp(this);
+ },
+
+ startTimer: function () {
+
+ var self = this;
+
+ if (this.pause === false) {
+ this.timer = setInterval(function () {
+
+ self.set('currTime', self.currTime + 1);
+ }, 1000);
+ } else {
+ clearInterval(this.timer);
+ }
+ }.observes('this.pause'),
+
+ stopTimer: function () {
+
+ clearInterval(this.timer);
+ this.pause = null;
+ this.appInfo.set('mediaClock', '');
+ },
+
+ setDuration: function () {
+
+ var number, str = '', hrs = 0, min = 0, sec = 0;
+ if (this.countUp) {
+ number = this.duration + this.currTime;
+ } else {
+ if (this.duration <= this.currTime) {
+ clearInterval(this.timer);
+ this.currTime = 0;
+ this.appInfo.set('mediaClock', '00:00:00');
+ return;
+ }
+ number = this.duration - this.currTime;
+ }
+
+ hrs = parseInt(number / 3600), // hours
+ min = parseInt(number / 60) % 60, // minutes
+ sec = number % 60; // seconds
+
+ str = (hrs < 10 ? '0' : '') + hrs + ':';
+ str += (min < 10 ? '0' : '') + min + ":";
+ str += (sec < 10 ? '0' : '') + sec;
+ this.appInfo.set('mediaClock', str);
+
+ if (!this.get('countUp') && this.duration == this.currTime) {
+ clearInterval(this.timer);
+ return;
+ }
+
+ }.observes('this.currTime'),
+
+ changeDuration: function () {
+
+ clearInterval(this.timer);
+ this.currTime = -1;
+ this.startTimer();
+ }.observes('this.duration'),
+
+ /**
+ * SDL Setter for Media Clock Timer
+ *
+ * @param {Object}
+ */
+ sdlSetMediaClockTimer: function (params) {
+
+ if ((params.updateMode == "PAUSE" && this.pause) || (params.updateMode == "RESUME" && !this.pause) || ((params.updateMode == "RESUME" || params.updateMode == "PAUSE") && this.pause === null )) {
+ return SDL.SDLModel.resultCode['IGNORED'];
+ }
+
+ if (params.updateMode == "CLEAR") {
+ this.stopTimer();
+ return SDL.SDLModel.resultCode['SUCCESS'];
+ }
+
+ if (params.updateMode == "PAUSE") {
+ this.set('pause', true);
+ } else if (params.updateMode == "RESUME") {
+ this.set('pause', false);
+ } else {
+ if (params.startTime) {
+ this.set('countUp', params.updateMode == "COUNTUP" ? true : false);
+ this.set('duration', null);
+ this.set('duration', params.startTime.hours * 3600 + params.startTime.minutes * 60 + params.startTime.seconds);
+ }
+ this.set('pause', false);
+ }
+
+ return SDL.SDLModel.resultCode['SUCCESS'];
+ },
+
+ /**
+ * Method to clear App OverLay
+ */
+ clearAppOverLay: function () {
+
+ clearInterval(this.timer);
+ this.appInfo.set('field1', '');
+ this.appInfo.set('field2', '');
+ this.appInfo.set('field3', '');
+ this.appInfo.set('field4', '');
+ this.appInfo.set('alignment', '');
+ this.set('statusText', '');
+ this.appInfo.set('mediaClock', '');
+ this.appInfo.set('mediaTrack', '');
+ this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg');
+ this.updateSoftButtons();
+ for (i = 0; i < 10; i++) {
+ this.appInfo.set('customPresets.' + i, '');
+ }
+ this.set('mediaPreset', false);
+
+ },
+
+ /**
+ * Applin UI Show handler
+ *
+ * @param {Object}
+ */
+ onSDLUIShow: function (params) {
+
+ clearInterval(this.timer);
+
+ for (var i = 0; i < params.showStrings.length; i++) {
+ switch (params.showStrings[i].fieldName) {
+ case 'mainField1':
+ {
+ this.appInfo.set('field1', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mainField2':
+ {
+ this.appInfo.set('field2', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mainField3':
+ {
+ this.appInfo.set('field3', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mainField4':
+ {
+ this.appInfo.set('field4', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'statusBar':
+ {
+ this.set('statusText', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mediaClock':
+ {
+ this.appInfo.set('mediaClock', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mediaTrack':
+ {
+ this.appInfo.set('mediaTrack', params.showStrings[i].fieldText);
+ break;
+ }
+ default :
+ {
+ break;
+ }
+ }
+ }
+
+ if (params.alignment) {
+ switch (params.alignment) {
+ case "CENTERED":
+ {
+ this.appInfo.set('alignment', "text-align:center");
+ break;
+ }
+ case "LEFT_ALIGNED":
+ {
+ this.appInfo.set('alignment', "text-align:left");
+ break;
+ }
+ case "RIGHT_ALIGNED":
+ {
+ this.appInfo.set('alignment', "text-align:right");
+ break;
+ }
+ }
+ } else {
+
+ this.appInfo.set('alignment', "text-align:center");
+ }
+
+ if (params.graphic && params.graphic.value != '') {
+ this.appInfo.set('trackIcon', params.graphic.value);
+ } else {
+ this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg');
+ }
+
+ if ("softButtons" in params) {
+ this.updateSoftButtons(params.softButtons);
+ }
+
+ // Magic number is a count of Preset Buttons on HMI = 8
+ for (var i = 0; i < 10; i++) {
+ if (!params.customPresets || (params.customPresets[i] == '' || params.customPresets[i] == null)) {
+ this.appInfo.set('customPresets.' + i, 'PRESET_' + i);
+ } else {
+ this.appInfo.set('customPresets.' + i, params.customPresets[i]);
+ }
+ }
+ this.set('mediaPreset', true);
+ }
+ });
diff --git a/src/components/HMI/app/model/sdl/Model.js b/src/components/HMI/app/model/sdl/Model.js
new file mode 100644
index 0000000000..106e95c88d
--- /dev/null
+++ b/src/components/HMI/app/model/sdl/Model.js
@@ -0,0 +1,1476 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLModel
+ * @desc General model for SDL applications
+ * @category Model
+ * @filesource app/model/sdl/SDLModel.js
+ * @version 1.0
+ */
+
+SDL.SDLModel = Em.Object.create({
+
+ /**
+ * Data came from UI.PerformInteractionRequest for ShowVRHelpItems popup
+ *
+ * @type {Object}
+ */
+ interactionData: {
+ 'vrHelpTitle': null,
+ 'vrHelp': null
+ },
+
+ /**
+ * Structure specified for PoliceUpdate retry sequence
+ * contains timeout seconds param, array of retry seconds and counter of number of retries
+ *
+ * @type {Objetc}
+ */
+ policyUpdateRetry:{
+ timeout: null,
+ retry: [],
+ try: null,
+ timer: null,
+ oldTimer: 0
+ },
+
+ /**
+ * Application's container for current processed requests on VR component of HMI
+ *
+ * @type {Object}
+ */
+ vrActiveRequests: {
+ vrPerformInteraction: null
+ },
+
+ /**
+ * List of callback functions for request SDL.GetUserFriendlyMessage
+ * where key is requestId
+ * and parameter is a function that will handle data came in respone from SDL
+ *
+ * @type {Object}
+ */
+ userFriendlyMessagePull: {},
+
+ /**
+ * List of appID functions for request SDL.GetListOfPermissions
+ * where key is requestId
+ * and parameter is a appID that will handle data came in respone from SDL
+ *
+ * @type {Object}
+ */
+ getListOfPermissionsPull: {},
+
+ /**
+ * List of application id's for request SDL.ActivateApp
+ * where key is requestId
+ * and parameter is a id of application to be activated
+ *
+ * @type {Object}
+ */
+ activateAppRequestsList: {},
+
+ /**
+ * ID of app in LIMITED HMI state
+ */
+ stateLimited: null,
+
+ /**
+ * FLAG of any app in limited level exists
+ */
+ limitedExist: false,
+
+ applicationStatusBar: function () {
+
+ if (this.limitedExist && SDL.SDLController.getApplicationModel(this.stateLimited)) {
+ return SDL.SDLController.getApplicationModel(this.stateLimited).statusText;
+ } else {
+ return '';
+ }
+ }.property("this.limitedExist"),
+
+ /**
+ * IScroll object to manage scroll on PerformInteraction view
+ *
+ * @type {Object}
+ */
+ interactionListWrapper: null,
+
+ /**
+ * TimeStamp of current started HMI session
+ *
+ * @type {Number}
+ */
+ timeStamp: null,
+
+ /**
+ * List of VR commands
+ */
+ VRCommands: [],
+
+ /**
+ * Video player object for navigationApp
+ *
+ * @type {Object}
+ */
+ naviVideo: {},
+
+/**
+ * Array of strings came in SDL.GetURLS response
+ *
+ * @type {Object}
+ */
+ policyURLs: [],
+
+ /**
+ * Policy Settings Info state value
+ *
+ * @type {String}
+ */
+ settingsInfoListState: 'iAPP_BUFFER_FULL',
+
+ /**
+ * Policy Settings Info list
+ *
+ * @type {Object}
+ */
+ settingsInfoList: [
+ 'iAPP_BUFFER_FULL',
+ 'blah'
+ ],
+
+ /**
+ * Policy Settings Info state value
+ *
+ * @type {String}
+ */
+ systemErrorListState: 'SYNC_REBOOTED',
+
+ /**
+ * Policy Settings Info list
+ *
+ * @type {Object}
+ */
+ systemErrorList: [
+ 'SYNC_REBOOTED',
+ 'SYNC_OUT_OF_MEMMORY'
+ ],
+
+ /**
+ * Flag to indicate AudioPassThruPopUp activity
+ *
+ * @type {Boolean}
+ */
+ AudioPassThruState: false,
+
+ /**
+ * Current device information
+ *
+ * @type {Object}
+ */
+ CurrDeviceInfo: {
+ "name": null,
+ "id": null
+ },
+
+ /**
+ * Driver Distraction State
+ *
+ * @type bool
+ */
+ driverDistractionState: false,
+
+ /**
+ * Flag to sent Send Data extended params
+ *
+ * @type {Boolean}
+ */
+ sendDataExtend: false,
+
+ /**
+ * VR active status
+ *
+ * @type {Boolean}
+ */
+ VRActive: false,
+
+ /**
+ * Flag to be set true when phone call is initialised
+ *
+ * @type {Boolean}
+ */
+ phoneCall: false,
+
+ /**
+ * Device list search progress flag
+ *
+ * @param {Boolean}
+ */
+ deviceSearchProgress: false,
+
+ /**
+ * Flag to be set true when VRHelpList are activated
+ *
+ * @param {Boolean}
+ */
+ VRHelpListActivated: false,
+
+ /**
+ * Flag to be set true when VRHelpList are activated
+ *
+ * @type {String}
+ */
+ keyboardInputValue: "",
+
+ /**
+ * List of states for OnTBTClientState notification
+ */
+ tbtClientStates: [
+ {
+ name: "ROUTE_UPDATE_REQUEST",
+ id: 0
+ }, {
+ name: "ROUTE_ACCEPTED",
+ id: 1
+ }, {
+ name: "ROUTE_REFUSED",
+ id: 2
+ }, {
+ name: "ROUTE_CANCELLED",
+ id: 3
+ }, {
+ name: "ETA_REQUEST",
+ id: 4
+ }, {
+ name: "NEXT_TURN_REQUEST",
+ id: 5
+ }, {
+ name: "ROUTE_STATUS_REQUEST",
+ id: 6
+ }, {
+ name: "ROUTE_SUMMARY_REQUEST",
+ id: 7
+ }, {
+ name: "TRIP_STATUS_REQUEST",
+ id: 8
+ }, {
+ name: "ROUTE_UPDATE_REQUEST_TIMEOUT",
+ id: 9
+ }
+ ],
+
+ /**
+ * List of states for ExitApplication notification
+ */
+ exitAppState: [
+ {
+ name: "IGNITION_OFF",
+ id : 0
+ },
+ {
+ name: "MASTER_RESET",
+ id : 1
+ },
+ {
+ name: "FACTORY_DEFAULTS",
+ id : 2
+ },
+ {
+ name: "SUSPEND",
+ id : 3
+ }
+ ],
+
+ /**
+ * List of states for OnSystemRequest notification
+ */
+ systemRequestState: [
+ {
+ name: "HTTP",
+ id : 0
+ },
+ {
+ name: "FILE_RESUME",
+ id : 1
+ },
+ {
+ name: "AUTH_REQUEST",
+ id : 2
+ },
+ {
+ name: "AUTH_CHALLENGE",
+ id : 3
+ },
+ {
+ name: "AUTH_ACK",
+ id : 4
+ },
+ {
+ name: "PROPRIETARY",
+ id : 5
+ }
+ ],
+
+ /**
+ * Data for AudioPassThruPopUp that contains params for visualisation
+ *
+ * @type {Object}
+ */
+ AudioPassThruData: {},
+
+ /**
+ * Enum with result codes for RPC
+ */
+ resultCode: {
+ "SUCCESS" : 0,
+ "UNSUPPORTED_REQUEST" : 1,
+ "UNSUPPORTED_RESOURCE" : 2,
+ "DISALLOWED" : 3,
+ "REJECTED" : 4,
+ "ABORTED" : 5,
+ "IGNORED" : 6,
+ "RETRY" : 7,
+ "IN_USE" : 8,
+ "DATA_NOT_AVAILABLE" : 9,
+ "TIMED_OUT" : 10,
+ "INVALID_DATA" : 11,
+ "CHAR_LIMIT_EXCEEDED" : 12,
+ "INVALID_ID" : 13,
+ "DUPLICATE_NAME" : 14,
+ "APPLICATION_NOT_REGISTERED": 15,
+ "WRONG_LANGUAGE" : 16,
+ "OUT_OF_MEMORY" : 17,
+ "TOO_MANY_PENDING_REQUESTS" : 18,
+ "NO_APPS_REGISTERED" : 19,
+ "NO_DEVICES_CONNECTED" : 20,
+ "WARNINGS" : 21,
+ "GENERIC_ERROR" : 22,
+ "USER_DISALLOWED" : 23
+ },
+
+ /**
+ * Info navigationApp data for ShowConstantTBT request
+ *
+ * @type: {Object}
+ */
+ constantTBTParams: {
+ "navigationTexts":[
+ {
+ "fieldName": "navigationText1",
+ "fieldText": "mainField1"
+ },
+ {
+ "fieldName": "navigationText2",
+ "fieldText": "mainField2"
+ },
+ {
+ "fieldName": "ETA",
+ "fieldText": "mainField3"
+ },
+ {
+ "fieldName": "totalDistance",
+ "fieldText": "mainField4"
+ },
+ {
+ "fieldName": "navigationText",
+ "fieldText": "mainField5"
+ },
+ {
+ "fieldName": "timeToDestination",
+ "fieldText": "mainField6"
+ }
+ ],
+ "softButtons": [
+ {
+ "text" : "Menu",
+ "isHighlighted" : true,
+ "softButtonID" : 1
+ },
+ {
+ "text" : "Custom button",
+ "isHighlighted" : false,
+ "softButtonID" : 2
+ },
+ {
+ "text" : "+",
+ "isHighlighted" : true,
+ "softButtonID" : 3
+ },
+ {
+ "text" : "-",
+ "isHighlighted" : false,
+ "softButtonID" : 4
+ }
+ ]
+ },
+
+ /**
+ * List of registered applications, To prevent errors without registered
+ * application "-1" used as test appID
+ *
+ * @type object
+ */
+ registeredApps: [],
+
+ /**
+ * List of unregistered applications, to verify which app is reestablished connection
+ *
+ * @type object
+ */
+ unRegisteredApps: [],
+
+ /**
+ * List of objects with params for connected devices
+ *
+ * @type object
+ */
+ connectedDevices: {},
+
+ /**
+ * List of devices with registered applications
+ *
+ * @type object
+ */
+ conectedDevices: [],
+
+ /**
+ * List of registered components
+ *
+ * @type object
+ */
+ registeredComponents: [
+ {
+ type: "UI",
+ state: false
+ }, {
+ type: "TTS",
+ state: false
+ }, {
+ type: "VR",
+ state: false
+ }, {
+ type: "BasicCommunication",
+ state: false
+ }, {
+ type: "VehicleInfo",
+ state: false
+ }, {
+ type: "Buttons",
+ state: false
+ }, {
+ type: "Navigation",
+ state: false
+ }
+ ],
+
+ /**
+ * List of icons
+ *
+ * @type {Object}
+ */
+ defaultListOfIcons: {
+ // appID: syncFileName
+ //0: "images/media/ico_li.png"
+ 'app': 'images/info/info_leftMenu_apps_ico.png',
+ 'command': 'images/common/defaultButtonImage.png',
+ 'trackIcon': 'images/sdl/audio_icon.jpg'
+ },
+
+ /**
+ * Array of active applications
+ *
+ * @type {Array}
+ */
+ applicationsList: [],
+
+ /**
+ * Array of connected devices
+ *
+ * @type {Array}
+ */
+ devicesList: [],
+
+ /**
+ * TTS + VR language
+ *
+ * @type {String}
+ */
+ hmiTTSVRLanguage: 'EN-US',
+
+ /**
+ * UI language
+ *
+ * @type {String}
+ */
+ hmiUILanguage: 'EN-US',
+
+ /**
+ * Parameter describes if performInteraction session was started on HMI
+ * this flag set to true when UI.PerformInteraction request came on HMI
+ * and set to false when HMI send response to SDL Core on UI.PerformInteraction request
+ *
+ * @type {Boolean}
+ */
+ performInteractionSession: [],
+
+/**
+ * Array with app permissions
+ * used for policies
+ *
+ * @type {Object}
+ */
+ appPermissions: [],
+
+ /**
+ * List of supported languages
+ *
+ * @type {Array}
+ */
+ sdlLanguagesList: [
+ 'EN-US',
+ 'ES-MX',
+ 'FR-CA',
+ 'DE-DE',
+ 'ES-ES',
+ 'EN-GB',
+ 'RU-RU',
+ 'TR-TR',
+ 'PL-PL',
+ 'FR-FR',
+ 'IT-IT',
+ 'SV-SE',
+ 'PT-PT',
+ 'NL-NL',
+ 'ZH-TW',
+ 'JA-JP',
+ 'AR-SA',
+ 'KO-KR',
+ 'PT-BR',
+ 'CS-CZ',
+ 'DA-DK',
+ 'NO-NO'
+ ],
+
+ /**
+ * Function make diff between two arrays of permissions
+ * remove argument array from existed array of permissions
+ */
+ setAppPermissions: function(appID, permissions){
+
+ var messageCodes = [];
+
+ permissions.forEach(function (x) {
+ messageCodes.push(x.name);
+ });
+
+ messageCodes.push("AppPermissionsRevoked");
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(function(message){SDL.SettingsController.simpleParseUserFriendlyMessageData(message)}, appID, messageCodes);
+
+ },
+
+ /**
+ * Method to set selected state of settings Info List
+ */
+ settingsInfoListStateChange: function() {
+
+ FFW.BasicCommunication.AddStatisticsInfo(this.settingsInfoListState);
+ }.observes('this.settingsInfoListState'),
+
+ /**
+ * Method to set selected state of settings Info List
+ */
+ systemErrorListStateChange: function() {
+
+ FFW.BasicCommunication.OnSystemError(this.systemErrorListState);
+ }.observes('this.systemErrorListState'),
+
+ /**
+ * Method to open Phone view and dial phone number
+ *
+ * @param {Object}
+ */
+ dialNumber: function(params) {
+
+ this.set('phoneCall', true);
+ SDL.States.goToStates('phone.dialpad');
+ SDL.PhoneModel.set('dialpadNumber', params.number);
+ SDL.PhoneController.onDialCall();
+ },
+
+ /**
+ * Notification method to send touch event data to SDLCore
+ *
+ * @param {Object}
+ */
+ onTouchEvent: function(event){
+
+ if (event.target.parentElement.className.indexOf("navButton") >= 0 || event.target.className.indexOf("navButton") >= 0) {
+ return;
+ }
+
+ var type = "",
+ changedTouches = event.originalEvent.changedTouches ? event.originalEvent.changedTouches.length : 1;
+
+ switch (event.originalEvent.type) {
+ case "touchstart": {
+ FLAGS.TOUCH_EVENT_STARTED = true;
+ type = "BEGIN";
+ break;
+ }
+ case "touchmove": {
+ type = "MOVE";
+ break;
+ }
+ case "touchend": {
+ type = "END";
+ break;
+ }
+ case "mousedown": {
+ FLAGS.TOUCH_EVENT_STARTED = true;
+ type = "BEGIN";
+ break;
+ }
+ case "mousemove": {
+ type = "MOVE";
+ break;
+ }
+ case "mouseup": {
+ type = "END";
+ break;
+ }
+ }
+
+ if (FLAGS.TOUCH_EVENT_STARTED ) {
+
+ var events = [];
+ for(var i = 0; i < changedTouches; i++){
+
+ if (event.originalEvent.changedTouches && (event.originalEvent.changedTouches[i].pageX > SDL.SDLVehicleInfoModel.vehicleData.displayResolution.width || event.originalEvent.changedTouches[i].pageY > SDL.SDLVehicleInfoModel.vehicleData.displayResolution.height)) {
+ return;
+ }
+
+ events[i] = {};
+ events[i].c = [{}];
+
+ events[i].id = event.originalEvent.changedTouches ? event.originalEvent.changedTouches[i].identifier : 0;
+ events[i].c[0].x = event.originalEvent.changedTouches ? event.originalEvent.changedTouches[i].pageX : event.originalEvent.pageX;
+ events[i].c[0].y = event.originalEvent.changedTouches ? event.originalEvent.changedTouches[i].pageY : event.originalEvent.pageY;
+ events[i].ts = [event.timeStamp - SDL.SDLModel.timeStamp];
+
+
+
+ }
+ FFW.UI.onTouchEvent(type, events);
+ }
+
+ if (event.originalEvent.type == "mouseup") {
+ FLAGS.TOUCH_EVENT_STARTED = false;
+ }
+ },
+
+ /**
+ * Method to remove deleted by SDL Core images used in HMI
+ * check images came in request from SDLCore like UI.Show, UI.AddCommand, UI.SetGlobalProperties,
+ * UI.SeAppIcon, Navigation.ShowConstantTBT, Navigation.UpdateTurnList, UI.ShowNotification
+ *
+ * @param {Object}
+ */
+ onFileRemoved: function(params) {
+
+ var result = false;
+
+ if ((params.fileType === "GRAPHIC_PNG" || params.fileType === "GRAPHIC_BMP" || params.fileType === "GRAPHIC_JPEG") && SDL.SDLController.getApplicationModel(params.appID)) {
+ result = SDL.SDLController.getApplicationModel(params.appID).onImageRemoved(params.fileName);
+
+ if (SDL.SDLController.getApplicationModel(params.appID).appIcon.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).appIcon.length) {
+ SDL.SDLController.getApplicationModel(params.appID).set('appIcon', SDL.SDLModel.defaultListOfIcons.app);
+ }
+
+ if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams) {
+
+ if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon
+ && SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value.length) {
+ SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
+ SDL.TurnByTurnView.activate(params.appID);
+ }
+
+ if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon
+ && SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value.length) {
+ SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
+ SDL.TurnByTurnView.activate(params.appID);
+ }
+ }
+
+ if (SDL.SDLAppController.model.appInfo.trackIcon && SDL.SDLAppController.model.appInfo.trackIcon.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLAppController.model.appInfo.trackIcon.length) {
+ SDL.SDLAppController.model.appInfo.set('trackIcon', SDL.SDLModel.defaultListOfIcons.trackIcon);
+ }
+
+ if (SDL.SDLAppController.model.appInfo.mainImage && SDL.SDLAppController.model.appInfo.mainImage.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLAppController.model.appInfo.mainImage.length) {
+ SDL.SDLAppController.model.appInfo.set('mainImage', SDL.SDLModel.defaultListOfIcons.trackIcon);
+ }
+
+ var len = SDL.SDLController.getApplicationModel(params.appID).turnList.length;
+ for (var i = 0; i < len; i++) {
+ if (!SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon) {
+ continue;
+ }
+ if (SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value.length) {
+ SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
+ }
+ }
+
+ SDL.TBTTurnList.updateList(params.appID);
+
+ if (SDL.SDLController.getApplicationModel(params.appID).softButtons) {
+ var len = SDL.SDLController.getApplicationModel(params.appID).softButtons.length;
+ for (var i = 0; i < len; i++) {
+ if (!SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image) {
+ continue;
+ }
+ if (SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value.length) {
+ SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value = SDL.SDLModel.defaultListOfIcons.command;
+ }
+ }
+
+ if (params.appID == SDL.SDLAppController.model.appID) {
+ SDL.sdlView.innerMenu.refreshItems();
+ }
+ }
+
+ var len = SDL.VRHelpListView.helpList.items.length;
+ for (var i = 0; i < len; i++) {
+ if (!SDL.VRHelpListView.helpList.items[i].params.icon) {
+ continue;
+ }
+ if (SDL.VRHelpListView.helpList.items[i].params.icon.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.VRHelpListView.helpList.items[i].params.icon.length) {
+ SDL.VRHelpListView.helpList.items[i].params.icon = SDL.SDLModel.defaultListOfIcons.command;
+ }
+ }
+
+ SDL.VRHelpListView.helpList.list.refresh();
+
+ var len = SDL.InteractionChoicesView.listOfChoices.items.length;
+ for (var i = 0; i < len; i++) {
+ if (!SDL.InteractionChoicesView.listOfChoices.items[i].params.icon) {
+ continue;
+ }
+ if (SDL.InteractionChoicesView.listOfChoices.items[i].params.icon.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.InteractionChoicesView.listOfChoices.items[i].params.icon.length) {
+ SDL.InteractionChoicesView.listOfChoices.items[i].params.icon = SDL.SDLModel.defaultListOfIcons.command;
+ }
+ }
+
+ SDL.InteractionChoicesView.listOfChoices.list.refresh();
+
+ var len = SDL.InteractionChoicesView.listWrapper.naviChoises._childViews.length;
+ for (var i = 0; i < len; i++) {
+ if (!SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon) {
+ continue;
+ }
+ if (SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon.indexOf(params.fileName) != -1
+ && params.fileName.length == SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon.length) {
+ SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon = SDL.SDLModel.defaultListOfIcons.command;
+ }
+ }
+
+ SDL.InteractionChoicesView.listWrapper.naviChoises.rerender();
+
+ }
+
+
+ if (result && SDL.OptionsView.active && SDL.SDLAppController.model.appID == params.appID) {
+ SDL.OptionsView.commands.refreshItems();
+ }
+ },
+
+ /**
+ * Method to start playing video from streaming video source
+ * provided by SDLCore
+ *
+ * @param {Object}
+ */
+ startStream: function(params) {
+
+ SDL.SDLController.getApplicationModel(params.appID).set('navigationStream', params.url);
+ SDL.SDLModel.playVideo(params.appID);
+ },
+
+ /**
+ * Method to stop playing video streaming
+ *
+ * @param {Number}
+ */
+ stopStream: function(appID) {
+
+ var createVideoView = Ember.View.create({
+ templateName: "video",
+ template: Ember.Handlebars.compile('<video id="html5Player"></video>')
+ }),
+ videoChild = null;
+
+ SDL.NavigationAppView.videoView.remove();
+ SDL.NavigationAppView.videoView.destroy();
+
+ SDL.SDLController.getApplicationModel(appID).set('navigationStream', null);
+
+ //this.pauseVideo();
+
+ videoChild = SDL.NavigationAppView.createChildView(createVideoView);
+
+ SDL.NavigationAppView.get('childViews').pushObject(videoChild);
+ SDL.NavigationAppView.set('videoView', videoChild);
+ },
+
+ /**
+ * Method to start playing audio from streaming audio source
+ * provided by SDLCore
+ *
+ * @param {Object}
+ */
+ startAudioStream: function(params) {
+
+ SDL.SDLController.getApplicationModel(params.appID).set('navigationAudioStream', params.url);
+ SDL.StreamAudio.play(params.url);
+ },
+
+ /**
+ * Method to set navigationApp streaming url to current app model
+ *
+ * @param {Number}
+ */
+ stoptAudioStream: function(appID) {
+
+ SDL.SDLController.getApplicationModel(appID).set('navigationAudioStream', null);
+ SDL.StreamAudio.stop();
+ },
+
+ /**
+ * Method to reset navigationApp streaming url from current app model
+ */
+ playVideo: function(appID){
+ if (SDL.SDLController.getApplicationModel(appID).navigationStream !== null) {
+
+ SDL.SDLModel.naviVideo = document.getElementById("html5Player");
+ SDL.SDLModel.naviVideo.src = SDL.SDLController.getApplicationModel(appID).navigationStream;
+ SDL.SDLModel.naviVideo.play();
+ }
+ },
+
+ /**
+ * Video player trigger to stop playing video
+ */
+ pauseVideo: function(){
+ if (SDL.SDLModel.naviVideo != null) {
+
+ SDL.SDLModel.naviVideo.pause();
+ }
+ },
+
+ /**
+ * Method to open Turn By Turn view
+ *
+ * @param {Object}
+ */
+ tbtActivate: function(params) {
+
+ SDL.SDLController.getApplicationModel(params.appID).set('constantTBTParams', params);
+ SDL.SDLController.getApplicationModel(params.appID).set('tbtActivate', true);
+
+ if (SDL.SDLAppController.model) {
+ SDL.SDLController.activateTBT();
+ }
+ },
+
+ /**
+ * Method to set data for Turn List in applications model
+ *
+ * @param {Object}
+ */
+ tbtTurnListUpdate: function(params) {
+
+ SDL.SDLController.getApplicationModel(params.appID).turnList = params.turnList ? params.turnList : [];
+ SDL.SDLController.getApplicationModel(params.appID).turnListSoftButtons = params.softButtons ? params.softButtons : [];
+ SDL.TBTTurnList.updateList(params.appID);
+ },
+
+ /**
+ * Method to VRHelpList on UI with request parameters
+ * It opens VrHelpList PopUp with current list of readable VR commands
+ *
+ * @param {Object}
+ */
+ ShowVrHelp: function(vrHelpTitle, vrHelp) {
+
+ SDL.VRHelpListView.showVRHelp(vrHelpTitle, vrHelp);
+ },
+
+ /**
+ * Method to set language for UI component with parameters sent from
+ * SDLCore to UIRPC
+ *
+ * @type {String} lang
+ */
+ changeRegistrationUI: function (lang, appID) {
+
+ if (SDL.SDLController.getApplicationModel(appID)) {
+ SDL.SDLController.getApplicationModel(appID).set('UILanguage', lang);
+ }
+ },
+
+ /**
+ * Method to set language for TTS and VR components with parameters sent
+ * from SDLCore to UIRPC
+ *
+ * @type {String} lang
+ */
+ changeRegistrationTTSVR: function (lang, appID) {
+
+ if (SDL.SDLController.getApplicationModel(appID)) {
+ SDL.SDLController.getApplicationModel(appID).set('TTSVRLanguage', lang);
+ }
+ },
+
+ /**
+ * Method to add activation button to VR commands and set device
+ * parameters to model
+ *
+ * @param {Object}
+ */
+ onAppRegistered: function (params) {
+
+ var applicationType = 1;
+
+ if (SDL.SDLController.getApplicationModel(params.application.appID)) {
+ return;
+ }
+
+ if (params.vrSynonyms) {
+
+ var message = {"cmdID": 0, "vrCommands": params.vrSynonyms, "appID": params.application.appID, "type": "Application"};
+ this.addCommandVR(message);
+ }
+
+ if (params.application.isMediaApplication) {
+ applicationType = 0;
+ }
+
+ SDL.SDLController.registerApplication(params.application, applicationType);
+
+ if (SDL.SDLModel.unRegisteredApps.indexOf(params.application.appID) >= 0) {
+ setTimeout(function(){ SDL.PopUp.create().appendTo('body').popupActivate("Connection with " + params.application.appName + " is re-established.")}, 1000);
+ this.unRegisteredApps.pop(params.application.appID);
+ }
+ },
+
+ /**
+ * Method to delete activation button from VR commands and delete device
+ * parameters from model
+ *
+ * @param {Object}
+ */
+ onAppUnregistered: function (params) {
+
+ if (SDL.SDLController.getApplicationModel(params.appID)) {
+
+ if (params.unexpectedDisconnect) {
+ SDL.PopUp.create().appendTo('body').popupActivate("The connection with the " + SDL.SDLController.getApplicationModel(params.appID).appName + " was unexpectedly lost.");
+ this.unRegisteredApps.push(params.appID);
+ }
+
+ if (SDL.SDLController.getApplicationModel(params.appID).activeRequests.uiPerformInteraction) {
+ SDL.InteractionChoicesView.deactivate("ABORTED");
+ }
+ SDL.SDLController.unregisterApplication(params.appID);
+ }
+ },
+
+ /**
+ * SDL UI ScrolableMessage activation function dependent of Driver
+ * Distraction toggle state
+ *
+ * @param {Object}
+ * params Object with parameters come from SDLCore.
+ * @param {Number}
+ * messageRequestId Identification of unique request
+ */
+ onSDLScrolableMessage: function (request, messageRequestId) {
+
+ if (!SDL.ScrollableMessage.active) {
+ if (SDL.SDLModel.driverDistractionState) {
+ SDL.DriverDistraction.activate();
+ FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'DD mode is active!');
+ } else {
+ SDL.ScrollableMessage.activate(SDL.SDLController.getApplicationModel(request.params.appID).appName, request.params, messageRequestId);
+ }
+ return true;
+ } else {
+ FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Higher priority request is being processed on HMI!');
+ return false;
+ }
+ },
+
+ /**
+ * setGlobalProperties
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore.
+ */
+ setProperties: function(params) {
+
+ if (SDL.SDLController.getApplicationModel(params.appID)) {
+ for (var i in params) {
+ if (i === "keyboardProperties") {
+ if (params[i].language) {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.language', params[i].language);
+ }
+ if (params[i].keyboardLayout) {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keyboardLayout', params[i].keyboardLayout);
+ }
+ if (params[i].keypressMode) {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keypressMode', params[i].keypressMode);
+ }
+ if (params[i].limitedCharacterList) {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', params[i].limitedCharacterList);
+ } else {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', []);
+ }
+ if (params[i].autoCompleteText) {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.autoCompleteText', params[i].autoCompleteText);
+ } else {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.autoCompleteText', '');
+ }
+ } else {
+ SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.' + i, params[i]);
+ }
+ }
+ } else {
+ console.error("CriticalError! No app registered with current appID!");
+ }
+ },
+
+ /**
+ * Method to call function from DeviceListView to show list of connected
+ * devices
+ *
+ * @param {Object}
+ * params
+ */
+ onGetDeviceList: function (params) {
+
+ //SDL.SDLModel.set('connectedDevices', params.deviceList);
+ var exist = false;
+
+ for (var i = 0; i < params.deviceList.length; i++) {
+
+ if (params.deviceList[i].id in SDL.SDLModel.connectedDevices) {
+ exist = true;
+ }
+
+ if (!exist) {
+ SDL.SDLModel.connectedDevices[params.deviceList[i].id] = {
+ "name": params.deviceList[i].name,
+ "id": params.deviceList[i].id,
+ "sdlFunctionality": {
+ "popUpId": null,
+ "allowed": false
+ }
+ }
+ } else {
+
+ exist = false;
+ }
+ }
+
+ if (SDL.States.info.devicelist.active) {
+ SDL.DeviceListView.ShowDeviceList(params);
+ }
+
+ SDL.SDLModel.set('deviceSearchProgress', false);
+ },
+
+ /**
+ * SDL UI SetAppIcon handler
+ *
+ * @param {Object}
+ * message
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ onSDLSetAppIcon: function (message, id, method) {
+
+ if (!SDL.SDLController.getApplicationModel(message.appID)){
+ FFW.UI.sendUIResult(SDL.SDLModel.resultCode["APPLICATION_NOT_REGISTERED"], id, method);
+ } else {
+
+ var img = new Image();
+ img.onload = function () {
+
+ // code to set the src on success
+ SDL.SDLController.getApplicationModel(message.appID).set('appIcon', message.syncFileName.value);
+ FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], id, method);
+ };
+ img.onerror = function (event) {
+
+ // doesn't exist or error loading
+ FFW.UI.sendError(SDL.SDLModel.resultCode["INVALID_DATA"], id, method, 'Image does not exist!');
+ return false;
+ };
+
+ img.src = message.syncFileName.value;
+ }
+ },
+
+ /**
+ * SDL UI Alert response handler show popup window
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore
+ * @param {Number}
+ * alertRequestId Id of current handled request
+ */
+ onUIAlert: function (message, alertRequestId) {
+
+ if (!SDL.AlertPopUp.active) {
+ SDL.AlertPopUp.AlertActive(message, alertRequestId);
+ return true;
+ } else {
+ SDL.SDLController.alertResponse(this.resultCode['REJECTED'], alertRequestId);
+ return false;
+ }
+ },
+
+ /**
+ * SDL UI PerformInteraction response handler show popup window
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore
+ */
+ uiPerformInteraction: function (message) {
+
+ if (!SDL.SDLController.getApplicationModel(message.params.appID).activeRequests.uiPerformInteraction) {
+ SDL.SDLController.getApplicationModel(message.params.appID).activeRequests.uiPerformInteraction = message.id;
+
+ if (message.params && message.params.vrHelpTitle && message.params.vrHelp) {
+
+ SDL.SDLModel.set('interactionData.vrHelpTitle', message.params.vrHelpTitle);
+ SDL.SDLModel.set('interactionData.vrHelp', message.params.vrHelp);
+ }
+
+ SDL.InteractionChoicesView.activate(message);
+ SDL.SDLController.VRMove();
+
+ return true;
+ } else {
+
+ FFW.UI.sendError(SDL.SDLModel.resultCode['REJECTED'], message.id, message.method, "UI PerformInterection REJECTED on HMI");
+ return false;
+ }
+ },
+
+ /**
+ * SDL VR PerformInteraction response handler
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore
+ */
+ vrPerformInteraction: function (message) {
+
+ if (!SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
+ SDL.SDLModel.vrActiveRequests.vrPerformInteraction = message.id;
+ } else {
+ FFW.VR.sendError(SDL.SDLModel.resultCode['REJECTED'], message.id, message.method, "VR PerformInterection REJECTED on HMI")
+ return;
+ }
+
+ setTimeout(function(){
+ if (SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
+ SDL.SDLModel.onPrompt(message.params.timeoutPrompt);
+ SDL.SDLModel.interactionData.helpPrompt = null;
+ }
+ }, message.params.timeout - 2000); //Magic numer is a platform depended HMI behavior: -2 seconds for timeout prompt
+
+ SDL.SDLModel.onPrompt(message.params.initialPrompt);
+
+ SDL.SDLModel.interactionData.helpPrompt = message.params.helpPrompt;
+
+ if (message.params.grammarID) {
+
+ this.set('performInteractionSession', message.params.grammarID);
+ SDL.SDLModel.set('VRActive', true);
+
+ setTimeout(function(){
+ if (SDL.SDLModel.VRActive) {
+ if (SDL.SDLAppController.model && SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
+ SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['TIMED_OUT']);
+ }
+
+ SDL.SDLModel.set('VRActive', false);
+ }
+ }, message.params.timeout);
+
+ SDL.InteractionChoicesView.timerUpdate();
+ } else {
+
+ SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['SUCCESS']);
+ }
+ },
+
+ /**
+ * SDL UI Slider response handler show popup window
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore
+ */
+ uiSlider: function (message) {
+
+ if (!SDL.SliderView.active) {
+ SDL.SDLController.getApplicationModel(message.params.appID).onSlider(message);
+ return true;
+ } else {
+ FFW.UI.sendSliderResult(this.resultCode["REJECTED"], message.id);
+ return false;
+ }
+ },
+
+ /**
+ * SDL ShowKeyboard show method with incoming parameters of layout, language etc...
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore
+ */
+ uiShowKeyboard: function(element){
+ SDL.Keyboard.activate(element);
+ },
+
+ /**
+ * SDL UI AudioPassThru response handler show popup window
+ *
+ * @param {Object}
+ * message Object with parameters come from SDLCore.
+ */
+ UIPerformAudioPassThru: function(message) {
+
+ this.set('AudioPassThruData', message);
+ this.set('AudioPassThruState', true);
+ },
+
+ /**
+ * Method ends processing of AudioPassThru and call AudioPassThru UI
+ * response handler
+ */
+ UIEndAudioPassThru: function () {
+
+ if (this.AudioPassThruState) {
+ FFW.UI.sendUIResult(this.resultCode["SUCCESS"], FFW.UI.endAudioPassThruRequestID, "UI.EndAudioPassThru");
+ SDL.SDLController.performAudioPassThruResponse(this.resultCode["SUCCESS"]);
+ } else {
+ FFW.UI.sendError(this.resultCode["REJECTED"], FFW.UI.endAudioPassThruRequestID, "UI.EndAudioPassThru", "UI.PerformAudioPassThru are not processed at the moment!");
+ }
+ },
+
+ /**
+ * Prompt activation
+ *
+ * @param {Object}
+ * @param {Number}
+ */
+ onPrompt: function (ttsChunks, appID) {
+
+ var message = '';
+ if (ttsChunks) {
+ for (var i = 0; i < ttsChunks.length; i++) {
+ message += ttsChunks[i].text + '\n';
+ }
+ SDL.TTSPopUp.ActivateTTS(message, appID);
+ }
+ },
+
+ /**
+ * Play audio file on PlayTone notification
+ */
+ onPlayTone: function () {
+
+ SDL.Audio.play('audio/initial.wav');
+ },
+
+ /**
+ * Prompt deactivation
+ */
+ TTSStopSpeaking: function () {
+ //true parameter makes send error response ABORTED
+ FFW.TTS.set('aborted', true);
+ SDL.TTSPopUp.DeactivateTTS();
+ },
+
+ /**
+ * SDL DeleteCommand response handler to sent delete command error or normal result
+ *
+ * @param {Number}
+ * @param {Number}
+ */
+ deleteCommandResponse: function (resultCode, requestID) {
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ FFW.UI.sendUIResult(resultCode, requestID, "UI.DeleteCommand");
+ } else {
+ FFW.UI.sendError(resultCode, requestID, "UI.DeleteCommand", "SubMenu is opened")
+ }
+ },
+
+ /**
+ * SDL VR AddCommand response handler add command to voice recognition
+ * window
+ *
+ * @param {Object}
+ */
+ addCommandVR: function (message) {
+
+ if (message.type == "Application") {
+
+ SDL.SDLModel.VRCommands.push(message);
+ SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, message.appID, message.type);
+ } else if ("appID" in message) {
+
+ SDL.SDLController.getApplicationModel(message.appID).VRCommands.push(message);
+
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == message.appID) {
+
+ SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, message.appID, message.type, message.grammarID);
+ }
+ } else {
+
+ SDL.SDLModel.VRCommands.push(message);
+ SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, 0, message.type, message.grammarID);
+ }
+ },
+
+ /**
+ * SDL VR DeleteCommand response handler delete command from voice
+ * recognition window
+ *
+ * @param {Number}
+ */
+ deleteCommandVR: function (request) {
+
+ var appModel = SDL.SDLController.getApplicationModel(request.params.appID);
+
+ if (appModel.currentSubMenuId != 'top') {
+ for (var i in appModel.commandsList) {
+ if (appModel.commandsList[i].filterProperty('commandID', request.params.cmdID).length) {
+ if (i == appModel.currentSubMenuId) {
+
+ FFW.VR.sendError(SDL.SDLModel.resultCode["IN_USE"], request.id, request.method, "SubMenu is currently opened on UI!");
+ return;
+ }
+ }
+ }
+ }
+
+ SDL.VRPopUp.DeleteCommand(request.params.cmdID, request.params.appID);
+ var len = appModel.VRCommands.length;
+
+ for (var i = len - 1; i >= 0 ; i--) {
+ if (appModel.VRCommands[i].appID == request.params.appID &&
+ appModel.VRCommands[i].cmdID == request.params.cmdID) {
+ appModel.VRCommands.splice(i, 1);
+ }
+ }
+
+ FFW.VR.sendVRResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+
+ },
+
+ onDeactivateApp: function (target, appID) {
+
+ if (SDL.SDLController.getApplicationModel(appID)) {
+ /**
+ * Close Options menu if opened
+ */
+ if (SDL.OptionsView.active) {
+ SDL.OptionsView.set('active', false);
+ }
+
+ var dest = target.split('.'), reason;
+
+ switch (dest[0]) {
+ case 'media':
+ {
+ reason = 'AUDIO';
+ break;
+ }
+ case "phone":
+ {
+ reason = 'PHONEMENU';
+ break;
+ }
+ case "navigation":
+ {
+ reason = 'NAVIGATIONMAP';
+ break;
+ }
+ case "settings":
+ {
+ reason = 'SYNCSETTINGS';
+ break;
+ }
+ case "call":
+ {
+ reason = 'PHONECALL';
+ break;
+ }
+ default:
+ {
+ reason = 'GENERAL';
+ break;
+ }
+ }
+
+ if (SDL.SDLModel.stateLimited && reason === 'AUDIO') {
+
+ SDL.SDLModel.stateLimited = null;
+ SDL.SDLModel.set('limitedExist', false);
+ }
+
+ SDL.TurnByTurnView.deactivate();
+
+ FFW.BasicCommunication.OnAppDeactivated(reason, appID);
+ }
+ }
+});
diff --git a/src/components/HMI/app/model/sdl/NonMediaModel.js b/src/components/HMI/app/model/sdl/NonMediaModel.js
new file mode 100644
index 0000000000..d9a14b32f2
--- /dev/null
+++ b/src/components/HMI/app/model/sdl/NonMediaModel.js
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLNonMediaModel
+ * @desc Concrate model for SDL NonMedia application
+ * @category Model
+ * @filesource app/model/sdl/NonMediaModel.js
+ * @version 1.0
+ */
+
+SDL.SDLNonMediaModel = SDL.SDLAppModel.extend({
+
+ init: function () {
+
+ this._super();
+
+ var subscribeVIData = {};
+
+ for (var key in SDL.SDLVehicleInfoModel.vehicleData) {
+ if (key != "externalTemperature") {
+ subscribeVIData[key] = false;
+ }
+ }
+
+ this.set('subscribedData', subscribeVIData);
+
+ // init properties here
+ this.set('appInfo', Em.Object.create({
+ field1 : '<field1>',
+ field2 : '<field2>',
+ field3 : '<field3>',
+ field4 : '<field4>',
+ mainImage : SDL.SDLModel.defaultListOfIcons.trackIcon,
+ image : '',
+ customPresets: [
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>',
+ '<no definition>'
+ ],
+ alignment : "text-align:center"
+ }));
+
+ this.set('activeRequests', Em.Object.create({
+ uiPerformInteraction: null
+ }));
+
+ this.set('constantTBTParams', null);
+
+ this.set('VRCommands', []);
+ this.set('tbtActivate', false);
+ this.set('globalProperties.helpPrompt', []);
+ this.set('globalProperties.timeoutPrompt', []);
+ this.set('globalProperties.keyboardProperties', Em.Object.create());
+ this.set('globalProperties.keyboardProperties.keyboardLayout', 'QWERTY');
+ this.set('globalProperties.keyboardProperties.limitedCharacterList', []);
+
+ this.set('commandsList', {'top': []});
+ this.set('softButtons', []);
+ },
+
+ /**
+ * Method hides sdl activation button and sdl application
+ *
+ * @param {Number}
+ */
+ onDeleteApplication: function (appID) {
+
+ SDL.NonMediaController.onDeleteApplication(appID);
+ },
+
+ /**
+ * Activate current application model
+ */
+ turnOnSDL: function () {
+
+ SDL.NonMediaController.activateApp(this);
+ },
+
+ /**
+ * Method to clear App OverLay
+ */
+ clearAppOverLay: function () {
+
+ clearInterval(this.timer);
+ this.appInfo.set('field1', '');
+ this.appInfo.set('field2', '');
+ this.appInfo.set('field3', '');
+ this.appInfo.set('field4', '');
+ this.appInfo.set('alignment', '');
+ this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg');
+ this.updateSoftButtons();
+ for (i = 0; i < 10; i++) {
+ this.appInfo.set('customPresets.' + i, '');
+ }
+
+ },
+
+ /**
+ * Applin UI Show handler
+ *
+ * @param {Object}
+ */
+ onSDLUIShow: function (params) {
+
+ for (var i = 0; i < params.showStrings.length; i++) {
+ switch (params.showStrings[i].fieldName) {
+ case 'mainField1':
+ {
+ this.appInfo.set('field1', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mainField2':
+ {
+ this.appInfo.set('field2', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mainField3':
+ {
+ this.appInfo.set('field3', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mainField4':
+ {
+ this.appInfo.set('field4', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'statusBar':
+ {
+ this.appInfo.set('statusText', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mediaClock':
+ {
+ this.appInfo.set('mediaClock', params.showStrings[i].fieldText);
+ break;
+ }
+ case 'mediaTrack':
+ {
+ this.appInfo.set('mediaTrack', params.showStrings[i].fieldText);
+ break;
+ }
+ default :{
+ break;
+ }
+ }
+ }
+
+ if (params.alignment) {
+ switch (params.alignment) {
+ case "CENTERED":
+ {
+ this.appInfo.set('alignment', "text-align:center");
+ break;
+ }
+ case "LEFT_ALIGNED":
+ {
+ this.appInfo.set('alignment', "text-align:left");
+ break;
+ }
+ case "RIGHT_ALIGNED":
+ {
+ this.appInfo.set('alignment', "text-align:right");
+ break;
+ }
+ }
+ } else {
+
+ this.appInfo.set('alignment', "text-align:center");
+ }
+
+ if (params.graphic) {
+ this.appInfo.set('mainImage', params.graphic.value);
+ } else {
+ this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg');
+ }
+
+ // Magic number is a count of Preset Buttons on HMI = 8
+ this.appInfo.set('customPresets', []);
+ for (var i = 0; i < 10; i++) {
+ if (!params.customPresets || (params.customPresets[i] == '' || params.customPresets[i] == null)) {
+ this.appInfo.get('customPresets').pushObject('PRESET_' + i);
+ } else {
+ this.appInfo.get('customPresets').pushObject(params.customPresets[i]);
+ }
+ }
+
+ if ("softButtons" in params) {
+ this.updateSoftButtons(params.softButtons);
+ }
+ },
+
+ sdlSetMediaClockTimer: function () {
+
+ return;
+ }
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/model/sdl/VehicleInfoModel.js b/src/components/HMI/app/model/sdl/VehicleInfoModel.js
new file mode 100644
index 0000000000..f2b896190e
--- /dev/null
+++ b/src/components/HMI/app/model/sdl/VehicleInfoModel.js
@@ -0,0 +1,501 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLVehicleInfoModel
+ * @desc SDL model with vehicle information used instead of CAN network.
+ * VehicleInfoModel is simulation of real CAN network.
+ * @category Model
+ * @filesource app/model/sdl/SDLVehicleInfoModel.js
+ * @version 1.0
+ */
+
+SDL.SDLVehicleInfoModel = Em.Object
+ .create( {
+
+ /**
+ * Stored VehicleInfo transmission state Data
+ *
+ * @type {Array}
+ */
+ vehicleInfoPRNDL: [
+ "PARK",
+ "REVERSE",
+ "NEUTRAL",
+ "DRIVE",
+ "SPORT",
+ "LOWGEAR",
+ "FIRST",
+ "SECOND",
+ "THIRD",
+ "FOURTH",
+ "FIFTH",
+ "SIXTH"
+ ],
+
+ /**
+ * Data changed in Odometr Input in VehicleInfo popUp
+ *
+ * @type {String}
+ */
+ odometrInputBinding: 'this.vehicleData.odometer',
+
+ /**
+ * PRNDL state value
+ *
+ * @type {String}
+ */
+ prndlSelectState: 'PARK',
+
+ /**
+ * Stored VehicleInfo Data
+ *
+ * @type {Array}
+ */
+ ecuDIDData: [
+ {
+ 'data': "ECU 1 Test Data"
+ }, {
+ 'data': "ECU 2 Test Data"
+ }
+ ],
+
+ /**
+ * Type of current vehicle: make of the vehicle, model of the vehicle,
+ * model Year of the vehicle, trim of the vehicle.
+ *
+ * @type {Object}
+ */
+ vehicleType: {
+ make: "Ford",
+ model: "Fiesta",
+ modelYear: "2013",
+ trim: "SE"
+ },
+
+ eVehicleDataType:{
+ "gps" :"VEHICLEDATA_GPS",
+ "speed": "VEHICLEDATA_SPEED",
+ "rpm": "VEHICLEDATA_RPM",
+ "fuelLevel": "VEHICLEDATA_FUELLEVEL",
+ "fuelLevel_State": "VEHICLEDATA_FUELLEVEL_STATE",
+ "instantFuelConsumption": "VEHICLEDATA_FUELCONSUMPTION",
+ "prndl": "VEHICLEDATA_PRNDL",
+ "externalTemperature": "VEHICLEDATA_EXTERNTEMP",
+ "tirePressure": "VEHICLEDATA_TIREPRESSURE",
+ "odometer": "VEHICLEDATA_ODOMETER",
+ "beltStatus": "VEHICLEDATA_BELTSTATUS",
+ "bodyInformation": "VEHICLEDATA_BODYINFO",
+ "deviceStatus": "VEHICLEDATA_DEVICESTATUS",
+ "eCallInfo": "VEHICLEDATA_ECALLINFO",
+ "airbagStatus": "VEHICLEDATA_AIRBAGSTATUS",
+ "emergencyEvent": "VEHICLEDATA_EMERGENCYEVENT",
+ "clusterModes": "VEHICLEDATA_CLUSTERMODESTATUS",
+ "myKey": "VEHICLEDATA_MYKEY",
+ "driverBraking": "VEHICLEDATA_BRAKING",
+ "wiperStatus": "VEHICLEDATA_WIPERSTATUS",
+ "headLampStatus": "VEHICLEDATA_HEADLAMPSTATUS",
+ "engineTorque":"VEHICLEDATA_ENGINETORQUE",
+ "accPedalPosition": "VEHICLEDATA_ACCPEDAL",
+ "steeringWheelAngle": "VEHICLEDATA_STEERINGWHEEL"
+ },
+
+ /**
+ * Stored VehicleInfo Data
+ *
+ * @type {Object}
+ */
+ vehicleData: {
+ 'displayResolution':{
+ 'width': 800,
+ 'height': 480
+ },
+ 'speed': 80.0,
+ 'fuelLevel': 0.2,
+ 'fuelLevel_State': "UNKNOWN",
+ 'instantFuelConsumption': 2.2,
+ 'tirePressure': {
+ 'pressureTelltale': 'OFF',
+ 'leftFront': {
+ 'status': 'UNKNOWN'
+ },
+ 'rightFront': {
+ 'status': 'UNKNOWN'
+ },
+ 'leftRear': {
+ 'status': 'UNKNOWN'
+ },
+ 'rightRear': {
+ 'status': 'UNKNOWN'
+ },
+ 'innerLeftRear': {
+ 'status': 'UNKNOWN'
+ },
+ 'innerRightRear': {
+ 'status': 'UNKNOWN'
+ }
+ },
+ 'beltStatus': {
+ 'driverBeltDeployed': "NOT_SUPPORTED",
+ 'passengerBeltDeployed': "NOT_SUPPORTED",
+ 'passengerBuckleBelted': "NOT_SUPPORTED",
+ 'driverBuckleBelted': "NOT_SUPPORTED",
+ 'leftRow2BuckleBelted': "NOT_SUPPORTED",
+ 'passengerChildDetected': "NOT_SUPPORTED",
+ 'rightRow2BuckleBelted': "NOT_SUPPORTED",
+ 'middleRow2BuckleBelted': "NOT_SUPPORTED",
+ 'middleRow3BuckleBelted': "NOT_SUPPORTED",
+ 'leftRow3BuckleBelted': "NOT_SUPPORTED",
+ 'rightRow3BuckleBelted': "NOT_SUPPORTED",
+ 'leftRearInflatableBelted': "NOT_SUPPORTED",
+ 'rightRearInflatableBelted': "NOT_SUPPORTED",
+ 'middleRow1BeltDeployed': "NOT_SUPPORTED",
+ 'middleRow1BuckleBelted': "NOT_SUPPORTED"
+ },
+ 'bodyInformation': {
+ 'parkBrakeActive': false,
+ 'ignitionStableStatus': "MISSING_FROM_TRANSMITTER",
+ 'ignitionStatus': "UNKNOWN",
+ 'driverDoorAjar': true,
+ 'passengerDoorAjar': true,
+ 'rearLeftDoorAjar': true,
+ 'rearRightDoorAjar': true
+ },
+ 'deviceStatus': {
+ 'voiceRecOn': false,
+ 'btIconOn': false,
+ 'callActive': false,
+ 'phoneRoaming': false,
+ 'textMsgAvailable': false,
+ 'battLevelStatus': "NOT_PROVIDED",
+ 'stereoAudioOutputMuted': false,
+ 'monoAudioOutputMuted': false,
+ 'signalLevelStatus': "NOT_PROVIDED",
+ 'primaryAudioSource': "NO_SOURCE_SELECTED",
+ 'eCallEventActive': false
+ },
+ 'driverBraking': "NOT_SUPPORTED",
+ 'wiperStatus': "NO_DATA_EXISTS",
+ 'headLampStatus': {
+ "lowBeamsOn": false,
+ "highBeamsOn": false,
+ "ambientLightSensorStatus": "NIGHT"
+ },
+ 'engineTorque': 2.5,
+ 'accPedalPosition': 10.5,
+ 'steeringWheelAngle': 1.2,
+ 'myKey': {
+ "e911Override": "NO_DATA_EXISTS"
+ },
+ 'avgFuelEconomy': 0.1,
+ 'batteryVoltage': 12.5,
+ 'vin': '52-452-52-752',
+ 'prndl': 'PARK',
+ 'odometer': 23,
+ 'batteryPackVoltage': 12.5,
+ 'batteryPackCurrent': 7.0,
+ 'batteryPackTemperature': 30,
+ 'tripOdometer': 0,
+ 'genericbinary': '165165650',
+ 'satRadioESN': "165165650",
+ 'rainSensor': 165165650,
+ 'gps': {
+ 'longitudeDegrees': 42,
+ 'latitudeDegrees': -83,
+ 'utcYear': 2013,
+ 'utcMonth': 2,
+ 'utcDay': 14,
+ 'utcHours': 13,
+ 'utcMinutes': 16,
+ 'utcSeconds': 54,
+ 'compassDirection': 'SOUTHWEST',
+ 'pdop': 8,
+ 'hdop': 5,
+ 'vdop': 3,
+ 'actual': false,
+ 'satellites': 8,
+ 'dimension': '2D',
+ 'altitude': 7,
+ 'heading': 173,
+ 'speed': 2
+ },
+ 'eCallInfo': {
+ 'eCallNotificationStatus': 'NORMAL',
+ 'auxECallNotificationStatus': 'NORMAL',
+ 'eCallConfirmationStatus': 'NORMAL'
+ },
+ 'airbagStatus': {
+ 'driverAirbagDeployed': 'NO_EVENT',
+ 'driverSideAirbagDeployed': 'NO_EVENT',
+ 'driverCurtainAirbagDeployed': 'NO_EVENT',
+ 'passengerAirbagDeployed': 'NO_EVENT',
+ 'passengerCurtainAirbagDeployed': 'NO_EVENT',
+ 'driverKneeAirbagDeployed': 'NO_EVENT',
+ 'passengerSideAirbagDeployed': 'NO_EVENT',
+ 'passengerKneeAirbagDeployed': 'NO_EVENT'
+ },
+ 'emergencyEvent': {
+ 'emergencyEventType': 'NO_EVENT',
+ 'fuelCutoffStatus': 'NORMAL_OPERATION',
+ 'rolloverEvent': 'NO_EVENT',
+ 'maximumChangeVelocity': 'NO_EVENT',
+ 'multipleEvents': 'NO_EVENT'
+ },
+ 'clusterModeStatus': {
+ 'powerModeActive': false,
+ 'powerModeQualificationStatus': 'POWER_MODE_EVALUATION_IN_PROGRESS',
+ 'carModeStatus': 'FACTORY',
+ 'powerModeStatus': 'KEY_OUT'
+ }
+
+ },
+
+ /**
+ * Method to set selected state of vehicle transmission to vehicleData
+ */
+ onPRNDLSelected: function() {
+
+ if (this.prndlSelectState) {
+ this.set('vehicleData.prndl', this.prndlSelectState);
+ }
+ }.observes('this.prndlSelectState'),
+
+ /**
+ * Method calls GetVehicleType response
+ *
+ * @type {Number}
+ */
+ getVehicleType: function(id) {
+
+ FFW.VehicleInfo.GetVehicleTypeResponse(this.vehicleType, id);
+ },
+
+ /**
+ * SDL VehicleInfo.GetDTCs handler fill data for response about vehicle
+ * errors
+ *
+ * @type {Object} params
+ * @type {Number} id
+ */
+ vehicleInfoGetDTCs: function(params, id) {
+
+ var dtc = [], result = "", ecuHeader = 2;
+
+ for ( var i = 0; i < 3; i++) {
+ dtc.push("line " + i);
+ }
+
+ result = "SUCCESS";
+
+ FFW.VehicleInfo.vehicleInfoGetDTCsResponse(ecuHeader,
+ dtc,
+ result,
+ id);
+
+ },
+
+ /**
+ * SDL VehicleInfo.ReadDID handler send response about vehicle
+ * conditions
+ *
+ * @type {Object} params
+ * @type {Number} id
+ */
+ vehicleInfoReadDID: function(params, id) {
+
+ var didResult = [], resultCode = "";
+ // magic number used because there is no huge database on HMI of
+ // vehicle
+ // data
+ if (this.ecuDIDData[1].data) {
+ resultCode = "SUCCESS";
+ } else {
+ resultCode = "INVALID_DATA";
+ }
+
+ for ( var i = 0; i < params.didLocation.length; i++) {
+ if (i < 10) {
+ didResult[i] = {};
+ didResult[i].resultCode = 'SUCCESS';
+ didResult[i].didLocation = params.didLocation[i];
+ didResult[i].data = '0';
+ } else {
+ didResult[i] = {};
+ didResult[i].resultCode = "VEHICLE_DATA_NOT_AVAILABLE";
+ didResult[i].didLocation = params.didLocation[i];
+ didResult[i].data = '0';
+ }
+ }
+
+ FFW.VehicleInfo.vehicleInfoReadDIDResponse(didResult,
+ resultCode,
+ id);
+ },
+
+ /**
+ * Function returns response message to VehicleInfoRPC
+ *
+ * @type {Object} message
+ */
+ SubscribeVehicleData: function(message) {
+ if (SDL.SDLController.getApplicationModel(message.params.appID)) {
+
+ var subscribeVIData = {};
+ for (var key in message.params) {
+
+ if (key === "clusterModeStatus") {
+ key = "clusterModes";
+ }
+
+ if (key != 'appID' && SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] === true) {
+ subscribeVIData[key] = {
+ dataType: this.eVehicleDataType[key],
+ resultCode: "DATA_ALREADY_SUBSCRIBED"
+ };
+ } else if (key != 'appID' && key in SDL.SDLController.getApplicationModel(message.params.appID).subscribedData) {
+ SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] = true;
+ subscribeVIData[key] = {
+ dataType: this.eVehicleDataType[key],
+ resultCode: "SUCCESS"
+ };
+ } else if (key === "externalTemperature") {
+ subscribeVIData[key] = {
+ dataType: this.eVehicleDataType[key],
+ resultCode: "VEHICLE_DATA_NOT_AVAILABLE"
+ };
+ }
+ }
+ }
+ FFW.VehicleInfo.sendVISubscribeVehicleDataResult(SDL.SDLModel.resultCode["SUCCESS"], message.id, message.method, subscribeVIData);
+ },
+
+ /**
+ * Function returns response message to VehicleInfoRPC
+ *
+ * @type {Object} message
+ */
+ UnsubscribeVehicleData: function(message) {
+ if (SDL.SDLController.getApplicationModel(message.params.appID)) {
+
+ var subscribeVIData = {};
+ for (var key in message.params) {
+
+ if (key === "clusterModeStatus") {
+ key = "clusterModes";
+ }
+
+ if (key != 'appID' && SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] === false) {
+ SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] = false;
+ subscribeVIData[key] = {
+ dataType: this.eVehicleDataType[key],
+ resultCode: "DATA_NOT_SUBSCRIBED"
+ };
+ } else if (key != 'appID' && key in SDL.SDLController.getApplicationModel(message.params.appID).subscribedData) {
+ SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] = false;
+ subscribeVIData[key] = {
+ dataType: this.eVehicleDataType[key],
+ resultCode: "SUCCESS"
+ };
+ } else if (key === "externalTemperature") {
+ subscribeVIData[key] = {
+ dataType: this.eVehicleDataType[key],
+ resultCode: "VEHICLE_DATA_NOT_AVAILABLE"
+ };
+ }
+ }
+ }
+ FFW.VehicleInfo.sendVISubscribeVehicleDataResult(SDL.SDLModel.resultCode["SUCCESS"], message.id, message.method, subscribeVIData);
+ },
+
+ /**
+ * Function returns response message to VehicleInfoRPC
+ *
+ * @type {Object} message
+ */
+ getVehicleData: function(message) {
+
+ var data = {}
+ text = "Params ", result = true;
+
+ for ( var key in message.params) {
+ if (key != "appID") {
+ if (this.vehicleData[key]) {
+ data[key] = this.vehicleData[key];
+ } else {
+ if (!result) {
+
+ text += ", " + key;
+ } else {
+
+ text += key;
+ result = false;
+ }
+ }
+ }
+ }
+
+ text += " are not available";
+
+ if (result) {
+ FFW.VehicleInfo.sendGetVehicleDataResut(SDL.SDLModel.resultCode["SUCCESS"], message.id, message.method, data);
+ } else {
+ FFW.VehicleInfo.sendGetVehicleDataError(SDL.SDLModel.resultCode["DATA_NOT_AVAILABLE"], message.id, message.method, text, data);
+ }
+ },
+
+ /**
+ * Function send all vehicle conditions on FFW.VehicleInfo.OnVehicleData
+ * for notification when data changes
+ */
+ onVehicleDataChanged: function() {
+
+ var appID = null;
+
+ for (var i = 0; i < SDL.SDLModel.registeredApps.length; i++) {
+ appID = SDL.SDLModel.registeredApps[i].appID;
+ if (SDL.SDLController.getApplicationModel(appID).subscribedData["prndl"]) {
+
+ var jsonData = {};
+ jsonData["prndl"] = this.vehicleData["prndl"];
+ FFW.VehicleInfo.OnVehicleData(jsonData);
+ return;
+ }
+ }
+
+ }.observes('this.vehicleData.prndl'),
+
+ /**
+ * Function send all vehicle conditions on FFW.VehicleInfo.OnVehicleData
+ * for notification when data changes
+ */
+ onOdometerDataChanged: function() {
+
+ var jsonData = {};
+
+ jsonData["odometer"] = parseInt(this.odometrInput);
+ FFW.VehicleInfo.OnVehicleData(jsonData);
+
+ }.observes('this.odometrInput')
+ });
diff --git a/src/components/HMI/app/util/Audio.js b/src/components/HMI/app/util/Audio.js
new file mode 100644
index 0000000000..9684d5b4e4
--- /dev/null
+++ b/src/components/HMI/app/util/Audio.js
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.Audio
+ * @desc HTML5 Audio player
+ * @category utils
+ * @filesource app/util/Audio.js
+ * @version 1.0
+ */
+
+SDL.Audio = {
+
+ audio: new Audio(),
+
+ play: function(path) {
+
+ this.audio.src = path;
+ this.audio.play();
+ }
+} \ No newline at end of file
diff --git a/src/components/HMI/app/util/StreamAudio.js b/src/components/HMI/app/util/StreamAudio.js
new file mode 100644
index 0000000000..de78abae7f
--- /dev/null
+++ b/src/components/HMI/app/util/StreamAudio.js
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.StreamAudio
+ * @desc HTML5 Audio player
+ * @category utils
+ * @filesource app/util/StreamAudio.js
+ * @version 1.0
+ */
+
+SDL.StreamAudio = {
+
+ audio: new Audio(),
+
+ play: function(path) {
+
+ this.audio.src = path;
+ this.audio.play();
+ },
+
+ stop: function() {
+
+ this.audio.src = "";
+ this.audio.pause();
+ }
+} \ No newline at end of file
diff --git a/src/components/HMI/app/view/WarningView.js b/src/components/HMI/app/view/WarningView.js
new file mode 100644
index 0000000000..8fa40b4547
--- /dev/null
+++ b/src/components/HMI/app/view/WarningView.js
@@ -0,0 +1,335 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.WarningViewg
+ * @desc Warning representation
+ * @category View
+ * @filesource app/view/WarningView.js
+ * @version 1.0
+ */
+
+SDL.warningView = Em.ContainerView
+ .extend( {
+
+ classNameBindings: [
+ 'fade:fadeAnimation:fadeWarning', 'hide:inactive_state',
+ ],
+
+ elementId: 'warning_view',
+
+ childViews: [
+ 'content', 'button'
+ ],
+
+ content: Em.View
+ .extend( {
+
+ classNames: 'message',
+
+ template: Ember.Handlebars
+ .compile('<div class="warning_text"> {{SDL.locale.label.view_warning}}</div>'
+ + '<div class="text">'
+ + '<br>'
+ + '<p>{{SDL.locale.label.view_warning_paragraph1}} </p><br>'
+ + '<p> {{SDL.locale.label.view_warning_paragraph2}} </p><br>'
+ + '</div>')
+ }),
+
+ button: Em.View.create( {
+
+ elementId: 'warning_ok_button',
+
+ classNameBindings: [
+ 'isReady: visible_display', 'pressed:pressed'
+ ],
+
+ classNames: [
+ 'okbut', 'ffw-button'
+ ],
+ /**
+ * Check for webkit fillmode animation support Android < 4 version
+ * doesnt support webkit animation fillmode
+ */
+ checkForCCS3AnimationSupport: function() {
+
+ if (FFW.isAndroid) {
+ return $('body')[0].style.webkitAnimationFillMode === '';
+ } else {
+ return false;
+ }
+ },
+
+ template: Ember.Handlebars.compile('<span>OK</span>'),
+
+ /* this method is called when the web part is fully loaded */
+ appLoaded: function() {
+
+ var self = this;
+ /** Show OK Button after 2 second delay */
+ setTimeout(function() {
+
+ self.set('isReady', true);
+ }, 2000);
+
+ var components = Em.ContainerView.create({
+
+ classNames: 'components',
+
+ childViews: [
+ 'BasicCommunication',
+ 'Buttons',
+ 'Navigation',
+ 'TTS',
+ 'UI',
+ 'VI',
+ 'VR'
+ ],
+
+ BasicCommunication: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'basicCommunicationCheckBox',
+
+ classNames: 'basicCommunicationCheckBox item',
+
+ checkedBinding: 'FLAGS.BC'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'basicCommunicationText item',
+
+ content: 'BasicCommunication'
+
+ })
+ }),
+
+ Buttons: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'buttonsCheckBox',
+
+ classNames: 'buttonsCheckBox item',
+
+ checkedBinding: 'FLAGS.Buttons'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'buttonsText item',
+
+ content: 'Buttons'
+
+ })
+ }),
+
+ Navigation: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'navigationCheckBox',
+
+ classNames: 'navigationCheckBox item',
+
+ checkedBinding: 'FLAGS.Navi'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'navigationText item',
+
+ content: 'Navigation'
+
+ })
+ }),
+
+ TTS: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'ttsCheckBox',
+
+ classNames: 'ttsCheckBox item',
+
+ checkedBinding: 'FLAGS.TTS'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'ttsText item',
+
+ content: 'TTS'
+
+ })
+ }),
+
+ UI: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'uiCheckBox',
+
+ classNames: 'uiCheckBox item',
+
+ checkedBinding: 'FLAGS.UI'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'uiText item',
+
+ content: 'UI'
+
+ })
+ }),
+
+ VI: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'viCheckBox',
+
+ classNames: 'viCheckBox item',
+
+ checkedBinding: 'FLAGS.VI'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'viText item',
+
+ content: 'VI'
+
+ })
+ }),
+
+ VR: Em.ContainerView.extend({
+
+ classNames: 'component',
+
+ childViews: [
+ 'checkBox',
+ 'text'
+ ],
+
+ checkBox: Em.Checkbox.extend( {
+
+ elementId: 'vrCheckBox',
+
+ classNames: 'vrCheckBox item',
+
+ checkedBinding: 'FLAGS.VR'
+
+ }),
+
+ text: SDL.Label.extend({
+
+ classNames: 'vrText item',
+
+ content: 'VR'
+
+ })
+ })
+
+ });
+
+ components.appendTo('#warning_view');
+
+ }.observes('SDL.appReady'),
+
+ actionDown: function(event) {
+
+ this.set('pressed', true);
+ },
+
+ actionUp: function(event) {
+
+ this.set('pressed', false);
+
+ var self = this;
+
+ this._parentView.set('fade', this
+ .checkForCCS3AnimationSupport());
+
+ setTimeout(function() {
+
+ self._parentView.set('hide', true);
+ }, 1000);
+
+ SDL.RPCController.ConnectToSDL();
+ }
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/climateView.js b/src/components/HMI/app/view/climateView.js
new file mode 100644
index 0000000000..626c2a2353
--- /dev/null
+++ b/src/components/HMI/app/view/climateView.js
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PlayerControllsView
+ * @desc Video player visual representation
+ * @category View
+ * @filesource app/view/player/PlayerView.js
+ * @version 1.0
+ */
+SDL.ClimateView = Em.ContainerView.create( {
+ /** View Id */
+ elementId: 'climateView',
+
+ classNameBindings:
+ [
+ 'SDL.States.climate.active:active_state:inactive_state'
+ ],
+
+ childViews:
+ [
+ 'windowText'
+ ],
+
+
+ windowText: SDL.Label.extend( {
+
+ classNames: 'windowText',
+
+ content: 'Climate'
+ } )
+
+} );
diff --git a/src/components/HMI/app/view/home/bottomControls.js b/src/components/HMI/app/view/home/bottomControls.js
new file mode 100644
index 0000000000..46fcb768cf
--- /dev/null
+++ b/src/components/HMI/app/view/home/bottomControls.js
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.BottomControlls
+ * @desc BottomControlls module visual representation
+ * @category View
+ * @filesource app/view/BottomControls.js
+ * @version 1.0
+ */
+
+SDL.BottomControls = Em.ContainerView.extend( {
+
+ elementId: 'app_bottom_controlls',
+
+ childViews: [
+ 'information', 'home', 'settings'
+ ],
+
+ information: Em.View.extend( {
+ elementId: 'info_but',
+ classNameBindings: [
+ 'SDL.States.info.active:selected'
+ ],
+
+ template: Em.Handlebars.compile('<div id="info_but_click"></div>'),
+
+ actionDown: function(event) {
+
+ if (!SDL.States.info.active) {
+ if (SDL.InfoController.activeState === 'info.nonMedia') {
+ SDL.NonMediaController.activateCurrentApp();
+ } else {
+ SDL.States.goToStates(SDL.InfoController.activeState);
+ }
+ }
+ }
+ }),
+
+ home: Em.View.extend( {
+ elementId: 'home_but',
+ classNameBindings: [
+ 'SDL.States.home.active:selected'
+ ],
+
+ template: Em.Handlebars.compile('<div id="home_but_click"></div>'),
+
+ actionDown: function(event) {
+
+ SDL.States.goToStates('home');
+ }
+ }),
+
+ settings: Em.View.extend( {
+ elementId: 'setting_but',
+
+ classNameBindings: 'SDL.States.settings.active:selected',
+
+ template: Em.Handlebars.compile('<div id="setting_but_click"></div>'),
+
+ actionDown: function(event) {
+
+ if (!SDL.States.settings.active) {
+ SDL.States.goToStates(SDL.SettingsController.activeState);
+ }
+ }
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/controlButtons.js b/src/components/HMI/app/view/home/controlButtons.js
new file mode 100644
index 0000000000..3b32d47368
--- /dev/null
+++ b/src/components/HMI/app/view/home/controlButtons.js
@@ -0,0 +1,579 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.controlButtons
+ * @desc Climate module visual representation
+ * @category View
+ * @filesource app/view/home/controlButtons.js
+ * @version 1.0
+ */
+
+SDL.ControlButtons = Em.ContainerView
+ .create( {
+
+ elementId: 'app_controlButtons',
+
+ childViews: [
+ 'VRButton',
+ 'buttonControls',
+ 'driverDistractionControl',
+ 'infoTable',
+ 'vehicleInfo',
+ 'tbtClientState',
+ 'ExitApp',
+ 'SystemRequest',
+ 'UILanguages',
+ 'TTSVRLanguages',
+ 'UILanguagesLabel',
+ 'TTSVRLanguagesLabel',
+ 'appUILanguagesLabel',
+ 'appTTSVRLanguagesLabel',
+ 'appUILang',
+ 'appTTSVRLang',
+ 'phoneCall'
+ ],
+
+ /**
+ * Button to initiate phone call emulation on HMI
+ */
+ phoneCall: SDL.Button.extend( {
+ elementId: 'phone_call_button',
+
+ classNames: ['phone_call_button', 'button'],
+
+ expand: false,
+
+ classNameBindings: ['this.expand:expand'],
+
+ mouseEnter: function(){
+ this.set('expand', true);
+ },
+
+ mouseLeave: function(){
+ this.set('expand', false);
+ },
+
+ action: 'phoneCall',
+
+ target: 'SDL.SettingsController',
+
+ text: 'Incoming call!'
+ }),
+
+ /*
+ * Label with name of UILanguages select
+ */
+ appUILang: SDL.Label.extend( {
+
+ elementId: 'appUILang',
+
+ classNames: 'appUILang',
+
+ contentBinding: 'SDL.SDLAppController.model.UILanguage'
+ }),
+
+ /*
+ * Label with name of TTSVRLanguages select
+ */
+ appTTSVRLang: SDL.Label.extend( {
+
+ elementId: 'appTTSVRLang',
+
+ classNames: 'appTTSVRLang',
+
+ contentBinding: 'SDL.SDLAppController.model.TTSVRLanguage'
+ }),
+
+ /*
+ * Label with name of UILanguages select
+ */
+ appUILanguagesLabel: SDL.Label.extend( {
+
+ elementId: 'appUILanguagesLabel',
+
+ classNames: 'appUILanguagesLabel',
+
+ content: 'application UI Languages'
+ }),
+
+ /*
+ * Label with name of TTSVRLanguages select
+ */
+ appTTSVRLanguagesLabel: SDL.Label.extend( {
+
+ elementId: 'appTTSVRLanguagesLabel',
+
+ classNames: 'appTTSVRLanguagesLabel',
+
+ content: 'application (TTS + VR) Languages'
+ }),
+
+ /*
+ * Label with name of UILanguages select
+ */
+ UILanguagesLabel: SDL.Label.extend( {
+
+ elementId: 'UILanguagesLabel',
+
+ classNames: 'UILanguagesLabel',
+
+ content: 'UI Languages'
+ }),
+
+ /*
+ * Label with name of TTSVRLanguages select
+ */
+ TTSVRLanguagesLabel: SDL.Label.extend( {
+
+ elementId: 'TTSVRLanguagesLabel',
+
+ classNames: 'TTSVRLanguagesLabel',
+
+ content: 'TTS + VR Languages'
+ }),
+
+ /*
+ * HMI element Select with list of supported UI component languages
+ */
+ UILanguages: Em.Select.extend( {
+
+ elementId: 'UILanguages',
+
+ classNames: 'languageSelect',
+
+ contentBinding: 'SDL.SDLModel.sdlLanguagesList',
+
+ valueBinding: 'SDL.SDLModel.hmiUILanguage'
+ }),
+
+ /*
+ * HMI element Select with list of supported TTS and VR component
+ * languages
+ */
+ TTSVRLanguages: Em.Select.extend( {
+
+ elementId: 'TTSVRLanguages',
+
+ classNames: 'languageSelect',
+
+ contentBinding: 'SDL.SDLModel.sdlLanguagesList',
+
+ valueBinding: 'SDL.SDLModel.hmiTTSVRLanguage'
+ }),
+
+ /**
+ * VehicleInfo button
+ */
+ vehicleInfo: SDL.Button.create( {
+ elementId: 'vehicleInfoButton',
+ classNames: 'vehicleInfoButton btn',
+ text: 'Vehicle Info',
+ action: function() {
+
+ // this._super();
+ SDL.VehicleInfo.toggleActivity();
+ },
+ templateName: 'text'
+ }),
+
+ /**
+ * TBT Client State button
+ */
+ tbtClientState: SDL.Button.create( {
+ elementId: 'tbtClientStateButton',
+ classNames: 'tbtClientStateButton btn',
+ text: 'TBT Client State',
+ action: function() {
+
+ // this._super();
+ SDL.TBTClientStateView.toggleActivity();
+ },
+ templateName: 'text'
+ }),
+
+ /**
+ * Exit Application button opens Exit Application reasons popup
+ */
+ ExitApp: SDL.Button.create( {
+ elementId: 'exitApp',
+ classNames: 'exitApp btn',
+ text: 'Exit Application',
+ action: function() {
+
+ // this._super();
+ SDL.ExitApp.toggleActivity();
+ },
+ templateName: 'text'
+ }),
+
+ /**
+ * Exit Application button opens Exit Application reasons popup
+ */
+ SystemRequest: SDL.Button.create( {
+ elementId: 'systemRequest',
+ classNames: 'systemRequest btn',
+ text: 'System Request',
+ action: function() {
+
+ // this._super();
+ SDL.SystemRequest.toggleActivity();
+ },
+ templateName: 'text'
+ }),
+
+ /**
+ * Voice Recognition button
+ */
+ VRButton: SDL.Button.create( {
+ elementId: 'VRButton',
+ classNames: 'VRButton',
+ action: 'activateVRPopUp',
+ target: 'SDL.SDLController'
+ }),
+
+ infoTable: Em.ContainerView
+ .extend( {
+ elementId: 'infoTable',
+
+ classNames: 'infoTable',
+
+ childViews: [
+ 'globalPropertiesLabel',
+ 'gpHelpData',
+ 'gpTimeoutData',
+ 'gpAUTOCOMPLETE',
+ 'policyURLs'
+ ],
+
+ globalPropertiesLabel: SDL.Label.extend( {
+
+ elementId: 'sdlGPLabel',
+
+ classNames: 'sdlGPLabel',
+
+ content: 'HELP_PROMPT: TIMEOUT_PROMPT: AUTOCOMPLETE_TEXT: POLICY_GetURLS:'
+ }),
+
+ policyURLs: SDL.Label.extend( {
+
+ elementId: 'policyURLs',
+
+ classNames: 'sdlGPData',
+
+ contentBinding: 'this.propertiesData',
+
+ propertiesData: function() {
+
+ var str = '';
+ for (var i = 0; i < SDL.SDLModel.policyURLs.length; i++) {
+ str += SDL.SDLModel.policyURLs[i] + '; ';
+ }
+
+ return str;
+ }.property('SDL.SDLModel.policyURLs')
+ }),
+
+ gpHelpData: SDL.Label.extend( {
+
+ elementId: 'sdlGPHData',
+
+ classNames: 'sdlGPData',
+
+ contentBinding: 'this.propertiesData',
+
+ propertiesData: function() {
+
+ var str = '';
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.helpPrompt) {
+ var i = 0;
+
+ for (i = 0; i < SDL.SDLAppController.model.globalProperties.helpPrompt.length; i++) {
+ str += SDL.SDLAppController.model.globalProperties.helpPrompt[i].text
+ + ' ';
+ }
+ }
+ return str;
+ }.property('SDL.SDLAppController.model.globalProperties.helpPrompt.@each.text')
+ }),
+
+ gpTimeoutData: SDL.Label.extend( {
+
+ elementId: 'sdlGPTData',
+
+ classNames: 'sdlGPData',
+
+ contentBinding: 'this.propertiesData',
+
+ propertiesData: function() {
+
+ var str = '';
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.timeoutPrompt) {
+ var i = 0;
+ for (i = 0; i < SDL.SDLAppController.model.globalProperties.timeoutPrompt.length; i++) {
+ str += SDL.SDLAppController.model.globalProperties.timeoutPrompt[i].text
+ + ' ';
+ }
+ }
+
+ return str;
+ }.property('SDL.SDLAppController.model.globalProperties.timeoutPrompt.@each.text')
+ }),
+
+ gpAUTOCOMPLETE: SDL.Label.extend( {
+
+ elementId: 'sdlGPAUTOCOMPLETE',
+
+ classNames: 'sdlGPData',
+
+ contentBinding: 'SDL.SDLAppController.model.globalProperties.keyboardProperties.autoCompleteText',
+
+ propertiesData: function() {
+
+// var str = '';
+// if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.timeoutPrompt) {
+// var i = 0;
+// for (i = 0; i < SDL.SDLAppController.model.globalProperties.timeoutPrompt.length; i++) {
+// str += SDL.SDLAppController.model.globalProperties.timeoutPrompt[i].text
+// + ' ';
+// }
+// }
+//
+// return str;
+ }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.autoCompleteText.@each')
+ })
+ }),
+
+ driverDistractionControl: Em.ContainerView.extend( {
+ elementId: 'driverDistractionControl',
+
+ classNames: 'driverDistractionControl',
+
+ childViews: [
+ 'driverDistractionLabel', 'driverDistractionCheckBox'
+ ],
+
+ driverDistractionLabel: SDL.Label.extend( {
+
+ elementId: 'driverDistractionControlLabel',
+
+ classNames: 'driverDistractionControlLabel',
+
+ content: 'DD'
+ }),
+
+ driverDistractionCheckBox: Em.Checkbox.extend( {
+
+ elementId: 'driverDistractionControlCheckBox',
+
+ classNames: 'driverDistractionControlCheckBox',
+
+ checkedBinding: 'SDL.SDLModel.driverDistractionState'
+
+ })
+ }),
+
+ buttonControls: Em.ContainerView.extend( {
+ elementId: 'buttonControls',
+
+ classNames: 'buttonControls',
+
+ childViews: [
+ 'ContainerControlls',
+ 'OneBtn',
+ 'TwoBtn',
+ 'ThreeBtn',
+ 'FourBtn',
+ 'FiveBtn',
+ 'SixBtn',
+ 'SevenBtn',
+ 'EightBtn',
+ 'NineBtn',
+ 'ZiroBtn'
+ ],
+
+ ContainerControlls: Em.ContainerView.extend( {
+ elementId: 'ContainerControlls',
+
+ classNames: 'ContainerControlls',
+
+ childViews: [
+ 'UpBtn', 'DownBtn', 'LeftBtn', 'RightBtn', 'OkBtn'
+ ],
+
+ /** Up button */
+ UpBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'TUNEUP',
+ classNames: 'UpBtn',
+ time: 0,
+ presetName: 'TUNEUP'
+ }),
+
+ /** Down button */
+ DownBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'TUNEDOWN',
+ classNames: 'DownBtn',
+ time: 0,
+ presetName: 'TUNEDOWN'
+ }),
+
+ /** Left button */
+ LeftBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'SEEKLEFT',
+ classNames: 'LeftBtn',
+ time: 0,
+ presetName: 'SEEKLEFT'
+ }),
+
+ /** Right button */
+ RightBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'SEEKRIGHT',
+ classNames: 'RightBtn',
+ time: 0,
+ presetName: 'SEEKRIGHT'
+ }),
+
+ /** Ok button */
+ OkBtn: SDL.Button.create( {
+ elementId: 'OK',
+ classNames: 'OkBtn',
+ time: 0,
+ presetName: 'OK',
+ actionDown: function() {
+
+ this._super();
+ SDL.SDLController
+ .onSoftButtonOkActionDown(this.presetName);
+ },
+ actionUp: function() {
+
+ this._super();
+ SDL.SDLController
+ .onSoftButtonOkActionUp(this.presetName);
+ }
+ })
+ }),
+
+ /** One button */
+ OneBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_1',
+ classNames: 'OneBtn btnNotPressed',
+ text: '1',
+ time: 0,
+ presetName: 'PRESET_1',
+ templateName: 'text'
+ }),
+
+ /** Two button */
+ TwoBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_2',
+ classNames: 'TwoBtn btnNotPressed',
+ text: '2',
+ time: 0,
+ presetName: 'PRESET_2',
+ templateName: 'text'
+ }),
+
+ /** Three button */
+ ThreeBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_3',
+ classNames: 'ThreeBtn btnNotPressed',
+ text: '3',
+ time: 0,
+ presetName: 'PRESET_3',
+ templateName: 'text'
+ }),
+
+ /** Four button */
+ FourBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_4',
+ classNames: 'FourBtn btnNotPressed',
+ text: '4',
+ time: 0,
+ presetName: 'PRESET_4',
+ templateName: 'text'
+ }),
+
+ /** Five button */
+ FiveBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_5',
+ classNames: 'FiveBtn btnNotPressed',
+ text: '5',
+ time: 0,
+ presetName: 'PRESET_5',
+ templateName: 'text'
+ }),
+
+ /** One button */
+ SixBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_6',
+ classNames: 'SixBtn btnNotPressed',
+ text: '6',
+ time: 0,
+ presetName: 'PRESET_6',
+ templateName: 'text'
+ }),
+
+ /** One button */
+ SevenBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_7',
+ classNames: 'SevenBtn btnNotPressed',
+ text: '7',
+ time: 0,
+ presetName: 'PRESET_7',
+ templateName: 'text'
+ }),
+
+ /** One button */
+ EightBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_8',
+ classNames: 'EightBtn btnNotPressed',
+ text: '8',
+ time: 0,
+ presetName: 'PRESET_8',
+ templateName: 'text'
+ }),
+
+ /** One button */
+ NineBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_9',
+ classNames: 'NineBtn btnNotPressed',
+ text: '9',
+ time: 0,
+ presetName: 'PRESET_9',
+ templateName: 'text'
+ }),
+
+ /** One button */
+ ZiroBtn: SDL.Button.create(SDL.PresetEvents, {
+ elementId: 'PRESET_0',
+ classNames: 'ZiroBtn btnNotPressed',
+ text: '0',
+ time: 0,
+ presetName: 'PRESET_0',
+ templateName: 'text'
+ })
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusClimateView.js b/src/components/HMI/app/view/home/statusClimateView.js
new file mode 100644
index 0000000000..01b6dc636b
--- /dev/null
+++ b/src/components/HMI/app/view/home/statusClimateView.js
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.StatusClimateView
+ * @desc Climate statusbar visual representation
+ * @category View
+ * @filesource app/view/climate/StatusClimateView.js
+ * @version 1.0
+ */
+
+SDL.StatusClimateView = Em.ContainerView.extend( {
+
+ elementId: 'status_climate',
+
+ classNames: [
+ 'status_bar'
+ ],
+
+ /** Climate components */
+ childViews: [
+ 'statusHome'
+ ],
+
+ /** Label for Home screen */
+ statusHome: SDL.Label.create( {
+ elementId: 'status_climate_label',
+
+ classNames: [
+ 'visible'
+ ],
+
+ content: 'Climate'
+ }),
+
+ /**
+ * Select phone state should be called when user press phone statusbar
+ */
+ actionUp: function(event) {
+
+ SDL.States.goToStates('climate');
+ }
+
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusInfoView.js b/src/components/HMI/app/view/home/statusInfoView.js
new file mode 100644
index 0000000000..1241d87c39
--- /dev/null
+++ b/src/components/HMI/app/view/home/statusInfoView.js
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.StatusInfoView
+ * @desc Component for Information Status bar
+ * @category view
+ * @filesource app/view/home/statusNavigationView.js
+ * @version 1.0
+ */
+SDL.StatusInfoView = Em.ContainerView.extend( {
+ /** View Id */
+ elementId: 'status_info',
+
+ classNames: [
+ 'status_bar', 'hidden'
+ ],
+
+ classNameBindings: [
+ 'SDL.States.info.active:selected'
+ ],
+
+ /** Navigation components */
+ childViews: [
+ 'statusHome'
+ ],
+
+ /** Label for Home screen */
+ statusHome: SDL.Label.create( {
+ elementId: 'status_info_label',
+ content: 'Information'
+ }),
+
+ actionUp: function(event) {
+
+ SDL.States.goToStates(SDL.InfoController.activeState);
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusMediaView.js b/src/components/HMI/app/view/home/statusMediaView.js
new file mode 100644
index 0000000000..bc94c9e22f
--- /dev/null
+++ b/src/components/HMI/app/view/home/statusMediaView.js
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.StatusMediaView
+ * @desc Component for Media Status bar
+ * @category view
+ * @filesource app/view/media/StatusMediaView.js
+ * @version 1.0
+ */
+SDL.StatusMediaView = Em.ContainerView
+ .extend( {
+
+ elementId: 'media_status',
+
+ classNameBindings: [
+ 'SDL.States.media.active:selected'
+ ],
+
+ /** Climate components */
+ childViews: [
+ 'statusHome', 'statusInfo'
+ ],
+
+ /** Label for Home screen */
+ statusHome: SDL.Label.extend( {
+ elementId: 'media_status_homestatus',
+ classNameBindings: [
+ 'SDL.States.home.active:visible'
+ ],
+ contentBinding: Ember.Binding
+ .oneWay('SDL.locale.label.view_mediaStatus_entertainment')
+ }),
+
+ statusInfo: Em.ContainerView
+ .extend( {
+ elementId: 'media_status_radio_container',
+
+ childViews: [
+ 'info'
+ ],
+
+ info: Em.View
+ .extend( {
+ elementId: 'media_status_radio_info',
+ controlerBinding: 'SDL.MediaController',
+ /** Bind class for visual representation */
+ classNameBindings: [
+ 'SDL.States.home.active:hidden_display:visible_display'
+ ],
+ /** Define module layout */
+ template: Em.Handlebars
+ .compile('<div class="statusInfo">'
+ + '<div class="station">'
+ + '<span {{bindAttr class="SDL.CDModel.active:visible_display"}}>{{SDL.CDModel.statusBar}}</span>'
+ + // title
+ '<span {{bindAttr class="SDL.SDLModel.limitedExist:visible_display"}}>{{SDL.SDLModel.applicationStatusBar}}</span>'
+ + // SDL
+ '</div>'
+ + '<div class="icon cdIco"'
+ + '{{bindAttr class="SDL.CDModel.active:cdIco"}}'
+ + // CD
+ // icon
+ '{{bindAttr class="SDL.SDLModel.limitedExist:appIco"}}>'
+ + // SDL
+ '</div>' + '</div>')
+ })
+ }),
+ actionUp: function(event) {
+
+ if (SDL.MediaController.activeState.indexOf('media.sdlmedia') >= 0) {
+ SDL.SDLMediaController.activateCurrentApp();
+ } else {
+ SDL.States.goToStates(SDL.MediaController.activeState);
+ }
+ }
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusNavigationView.js b/src/components/HMI/app/view/home/statusNavigationView.js
new file mode 100644
index 0000000000..e1d5bac3df
--- /dev/null
+++ b/src/components/HMI/app/view/home/statusNavigationView.js
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.StatusNavigationView
+ * @desc Component for Navigation Status bar
+ * @category view
+ * @filesource app/view/home/statusNavigationView.js
+ * @version 1.0
+ */
+SDL.StatusNavigationView = Em.ContainerView.extend( {
+ /** View Id */
+ elementId: 'status_nav',
+
+ classNames: 'status_bar',
+
+ /** Navigation components */
+ childViews: [
+ 'statusHome'
+ ],
+
+ /** Label for Home screen */
+ statusHome: SDL.Label.create( {
+ elementId: 'navigation_status_label',
+ classNames: 'visible',
+ content: 'Navigation'
+ }),
+
+ /**
+ * Select phone state should be called when user press phone statusbar
+ */
+ actionUp: function(event) {
+
+ SDL.States.goToStates('navigation');
+ }
+
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusPhoneView.js b/src/components/HMI/app/view/home/statusPhoneView.js
new file mode 100644
index 0000000000..32fb878608
--- /dev/null
+++ b/src/components/HMI/app/view/home/statusPhoneView.js
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.StatusPhoneView
+ * @desc Phone statusbar visual representation
+ * @category View
+ * @filesource app/view/phone/StatusPhoneView.js
+ * @version 1.0
+ */
+
+SDL.StatusPhoneView = Em.ContainerView.extend( {
+
+ elementId: 'status_phone',
+
+ classNames: [
+ 'status_bar'
+ ],
+
+ /** Bind class for visual representation */
+ classNameBindings: [
+ 'SDL.States.phone.active:selected'
+ ],
+
+ /** Climate components */
+ childViews: [
+ 'statusHome'
+ ],
+
+ /** Label for Home screen */
+ statusHome: SDL.Label.extend( {
+ elementId: 'status_phone_label',
+
+ classNames: 'visible',
+
+ content: 'Phone'
+ }),
+
+ /**
+ * Select phone state should be called when user press phone statusbar
+ */
+ actionUp: function(event) {
+
+ SDL.States.goToStates('phone.dialpad');
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/topControls.js b/src/components/HMI/app/view/home/topControls.js
new file mode 100644
index 0000000000..6eb9323b32
--- /dev/null
+++ b/src/components/HMI/app/view/home/topControls.js
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.TopControls
+ *
+ * @desc Component for Home top controls
+ *
+ * @category view
+ * @filesource app/view/home/topControls.js
+ * @version 1.0
+ */
+
+SDL.TopControls = Em.ContainerView.extend( {
+
+ elementId: 'app_top_menu_cont',
+
+ childViews: [
+ 'controls'
+ ],
+
+ controls: Em.ContainerView.extend( {
+ elementId: 'top_controls',
+
+ childViews: [
+ 'clock'
+ ],
+
+ clock: Em.View.extend( {
+ elementId: 'clock',
+
+ template: Em.Handlebars
+ .compile('<div id="time_num">1:47 86°</div>')
+
+ })
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/homeView.js b/src/components/HMI/app/view/homeView.js
new file mode 100644
index 0000000000..4663996afc
--- /dev/null
+++ b/src/components/HMI/app/view/homeView.js
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.HomeView
+ * @desc Home screen visual representation
+ * @category View
+ * @filesource app/view/home/HomeView.js
+ * @version 1.0
+ */
+
+SDL.HomeView = Em.ContainerView.create( {
+
+ classNameBindings: 'SDL.States.home.active:active_state:inactive_state',
+
+ elementId: 'home'
+} );
diff --git a/src/components/HMI/app/view/info/alertsView.js b/src/components/HMI/app/view/info/alertsView.js
new file mode 100644
index 0000000000..6e4e935f58
--- /dev/null
+++ b/src/components/HMI/app/view/info/alertsView.js
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoAlertsView
+ * @desc Info Alerts module visual representation
+ * @category View
+ * @filesource app/view/sinfo/InfoAlertsView.js
+ * @version 1.0
+ */
+
+SDL.InfoAlertsView = Em.ContainerView.create( {
+ /** Bind class for visual representation */
+ classNameBindings: [
+ 'SDL.States.info.alerts.active:active_state:inactive_state'
+ ],
+
+ elementId: 'info_alerts',
+
+ childViews: [
+ 'listCaption', 'mainlist', 'rightlist'
+ ],
+
+ listCaption: SDL.LabelPlusToggleButton.extend( {
+ elementId: 'info_alerts_listCaption',
+ labelContentBinding: 'SDL.locale.label.view_info_alerts_sort',
+ tButtonValue: 0,
+ tButtonRange: 2,
+ tButtonLabelsBinding: 'SDL.locale.label.view_info_alerts_dateIcon',
+ labelDisabled: true,
+ tButtonDisabled: true
+ }),
+
+ mainlist: SDL.List.extend( {
+
+ elementId: 'info_alerts_list',
+
+ itemsOnPage: 6,
+
+ items: [
+ {
+ type: SDL.Label,
+
+ params: {
+ disabled: true
+ }
+ }, {
+ type: SDL.Button,
+ params: {
+ classNames: [
+ 'ember-view ffw-button notpressed list-item disabled active'
+ ],
+ textBinding: 'SDL.locale.label.view_info_alerts_911Assist',
+ templateName: 'rightIcon',
+ icon: 'images/info/ico_emergcyAndEnvelope.png',
+ righticon: 'images/info/ico_arrowLock.png',
+ disabled: true
+ }
+ }
+ ]
+ }),
+
+ rightlist: SDL.List.extend( {
+
+ elementId: 'info_alerts_rightList',
+
+ itemsOnPage: 5,
+
+ disableScrollbar: true,
+
+ items: [
+ {
+ type: SDL.Button,
+ params: {
+ className: 'button',
+ textBinding: 'SDL.locale.label.view_info_alerts_view',
+ disabled: true
+ }
+ }, {
+ type: SDL.Button,
+ params: {
+ className: 'button',
+ textBinding: 'SDL.locale.label.view_info_alerts_delete',
+ disabled: true
+ }
+ }, {
+ type: SDL.Button,
+ params: {
+ className: 'button',
+ textBinding: 'SDL.locale.label.view_info_alerts_deleteAll',
+ disabled: true
+ }
+ }
+ ]
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/appsView.js b/src/components/HMI/app/view/info/appsView.js
new file mode 100644
index 0000000000..c1d123c0b2
--- /dev/null
+++ b/src/components/HMI/app/view/info/appsView.js
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoAppsview
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/info/AppsView.js
+ * @version 1.0
+ */
+
+SDL.InfoAppsView = Em.ContainerView
+ .create( {
+
+ elementId: 'info_apps',
+
+ classNameBindings: [
+ 'SDL.States.info.apps.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'vehicleHealthReport',
+ 'Asist911',
+ 'installButton',
+ 'findNewApps',
+ 'getDeviceList',
+ 'listOfApplications'
+ ],
+
+ /**
+ * Function to add application to application list
+ */
+ showAppList: function() {
+
+ this.get('listOfApplications.list').removeAllChildren();
+
+ this.listOfApplications.list.refresh();
+
+ var i, apps = SDL.SDLModel.registeredApps, appIndex;
+
+ for (i = 0; i < apps.length; i++) {
+
+ appIndex = SDL.SDLModel.registeredApps.indexOf(apps[i]);
+
+ this.get('listOfApplications.list.childViews')
+ .pushObject(SDL.Button.create( {
+ action: 'onActivateSDLApp',
+ target: 'SDL.SDLController',
+ text: apps[i].appName + " - " + apps[i].deviceName,
+ appName: apps[i].appName,
+ appID: apps[i].appID,
+ classNames: 'list-item button',
+ iconBinding: 'SDL.SDLModel.registeredApps.' + appIndex
+ + '.appIcon'
+ }));
+ }
+
+ },
+
+ vehicleHealthReport: SDL.Button
+ .extend( {
+ goToState: 'vehicle.healthReport',
+ classNames: 'button vehicleHealthReport leftButtons',
+ icon: 'images/info/ico_vehicle.png',
+ textBinding: 'SDL.locale.label.view_info_apps_vehicle_VehicleHealthReport',
+ elementId: 'infoAppsVehicleHealthReport',
+ arrow: true,
+ onDown: false
+ }),
+
+ Asist911: SDL.Button.extend( {
+ goToState: 'help.helpAssist',
+ classNames: 'button Asist911 leftButtons',
+ icon: 'images/info/ico_assist.png',
+ textBinding: 'SDL.locale.label.view_info_apps_911Assist',
+ elementId: 'infoAppsAsist911',
+ arrow: true,
+ onDown: false
+ }),
+
+ installButton: SDL.Button
+ .extend( {
+ goToState: 'settings.system.installApplications',
+ icon: 'images/info/ico_info_install.png',
+ textBinding: 'SDL.locale.label.view_info_apps_vehicle_InstallApplicationsUp',
+ elementId: 'infoAppsInstallButton',
+ classNames: 'button installButton leftButtons',
+ arrow: true,
+ onDown: false
+ }),
+
+ findNewApps: SDL.Button
+ .extend( {
+ goToState: 'settings.system.installApplications',
+ icon: 'images/sdl/new_apps.png',
+ textBinding: 'SDL.locale.label.view_info_apps_vehicle_FindNewApplications',
+ elementId: 'infoAppsFindNewApps',
+ classNames: 'button findNewApps leftButtons',
+ arrow: true,
+ action: 'findNewApps',
+ target: 'SDL.SDLController',
+ onDown: false
+ }),
+
+ getDeviceList: SDL.Button
+ .extend( {
+ icon: 'images/sdl/devices.png',
+ textBinding: 'SDL.locale.label.view_info_apps_vehicle_GetDeviceList',
+ elementId: 'infoAppsGetDeviceList',
+ classNames: 'button getDeviceList leftButtons',
+ arrow: true,
+ action: 'onGetDeviceList',
+ target: 'SDL.SDLController',
+ onDown: false
+ }),
+
+ listOfApplications: SDL.List.extend( {
+
+ elementId: 'info_apps_list',
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: new Array()
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/calendarView.js b/src/components/HMI/app/view/info/calendarView.js
new file mode 100644
index 0000000000..235938a90e
--- /dev/null
+++ b/src/components/HMI/app/view/info/calendarView.js
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoCalendarView
+ * @desc Info Calendar module visual representation
+ * @category View
+ * @filesource app/view/sinfo/CalendarView.js
+ * @version 1.0
+ */
+
+SDL.InfoCalendarView = Em.View
+ .create( {
+ /** Bind class for visual representation */
+ classNameBindings: [
+ 'SDL.States.info.calendar.active:active_state:inactive_state'
+ ],
+
+ elementId: 'info_calendar',
+
+ template: Ember.Handlebars
+ .compile('<div class="inner-wrapper">'
+ + '<div class="label-20 disabled date">{{SDL.locale.label.view_info_calendar_date}}</div>'
+ +
+
+ '{{view SDL.Button '
+ + 'class= "today button" '
+ + 'textBinding="SDL.locale.label.view_info_calendar_today" '
+ + 'disabled=true '
+ + '}}'
+ +
+
+ '<div class="day day-1">{{SDL.locale.label.view_info_calendar_day1}}</div>'
+ + '<div class="day day-2">{{SDL.locale.label.view_info_calendar_day2}}</div>'
+ + '<div class="day day-3">{{SDL.locale.label.view_info_calendar_day3}}</div>'
+ + '<div class="day day-4">{{SDL.locale.label.view_info_calendar_day4}}</div>'
+ + '<div class="day day-5">{{SDL.locale.label.view_info_calendar_day5}}</div>'
+ + '<div class="day day-6">{{SDL.locale.label.view_info_calendar_day6}}</div>'
+ + '<div class="day day-7 active">{{SDL.locale.label.view_info_calendar_day7}}</div>'
+ +
+
+ '<div class="c-btn disabled btn-1">1</div>'
+ + '<div class="c-btn disabled btn-8">8</div>'
+ + '<div class="c-btn disabled btn-15">15</div>'
+ + '<div class="c-btn disabled btn-22">22</div>'
+ + '<div class="c-btn disabled btn-29">29</div>' +
+
+ '<div class="c-btn disabled btn-7">7</div>'
+ + '<div class="c-btn disabled btn-14">14</div>'
+ + '<div class="c-btn disabled btn-21">21</div>'
+ + '<div class="c-btn disabled active btn-28">28</div>' +
+
+ '<div class="c-btn disabled btn-6">6</div>'
+ + '<div class="c-btn disabled btn-13">13</div>'
+ + '<div class="c-btn disabled btn-20">20</div>'
+ + '<div class="c-btn disabled btn-27">27</div>' +
+
+ '<div class="c-btn disabled btn-5">5</div>'
+ + '<div class="c-btn disabled btn-12">12</div>'
+ + '<div class="c-btn disabled btn-19">19</div>'
+ + '<div class="c-btn disabled btn-26">26</div>' +
+
+ '<div class="c-btn disabled btn-4">4</div>'
+ + '<div class="c-btn disabled btn-11">11</div>'
+ + '<div class="c-btn disabled btn-18">18</div>'
+ + '<div class="c-btn disabled btn-25">25</div>' +
+
+ '<div class="c-btn disabled btn-3">3</div>'
+ + '<div class="c-btn disabled btn-10">10</div>'
+ + '<div class="c-btn disabled btn-17">17</div>'
+ + '<div class="c-btn disabled btn-24">24</div>'
+ + '<div class="c-btn disabled btn-31">31</div>' +
+
+ '<div class="c-btn disabled btn-2">2</div>'
+ + '<div class="c-btn disabled btn-9">9</div>'
+ + '<div class="c-btn disabled btn-16">16</div>'
+ + '<div class="c-btn disabled btn-23">23</div>'
+ + '<div class="c-btn disabled btn-30">30</div>' +
+
+ '</div>')
+
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/devicelistView.js b/src/components/HMI/app/view/info/devicelistView.js
new file mode 100644
index 0000000000..5bd6b8e686
--- /dev/null
+++ b/src/components/HMI/app/view/info/devicelistView.js
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceListView
+ * @desc Media App Options module visual representation
+ * @category View
+ * @filesource app/view/media/devicelistView.js
+ * @version 1.0
+ */
+
+SDL.DeviceListView = Em.ContainerView.create( {
+
+ classNames: [
+ 'info_apps_deviceList_view'
+ ],
+
+ classNameBindings: [
+ 'SDL.States.info.devicelist.active:active_state:inactive_state'
+ ],
+
+ /**
+ * View Id
+ */
+ elementId: 'info_apps_deviceList_view',
+
+ /**
+ * View Components
+ */
+ childViews: [
+ 'backButton',
+ 'listOfDevices',
+ 'deviceListLabel',
+ 'progress'
+ ],
+
+ /**
+ * Animation of search devices progress
+ */
+ progress: Em.View.extend( {
+ classNames: [
+ 'progress'
+ ],
+ classNameBindings: ['SDL.SDLModel.deviceSearchProgress:progress']
+ }),
+
+
+ /**
+ * Button to return to previous view
+ */
+ backButton: SDL.Button.extend( {
+ classNames: [
+ 'backButton', 'button'
+ ],
+ action: 'turnChangeDeviceViewBack',
+ target: 'SDL.SDLController',
+ icon: 'images/media/ico_back.png'
+ }),
+
+ /**
+ * Label in title
+ */
+ deviceListLabel: SDL.Label.extend( {
+
+ elementId: 'deviceListLabel',
+
+ classNames: 'deviceListLabel',
+
+ content: 'Change Devices'
+ }),
+
+ /**
+ * Function calls when notification from RPC comes and creates buttons to
+ * choose devices
+ */
+ ShowDeviceList: function(params) {
+
+ this.clearDeviceList();
+
+ var i, len = params.deviceList.length;
+ for (i = 0; i < len; i++) {
+ this.get('listOfDevices.list.childViews').pushObject(SDL.Button
+ .create( {
+ deviceName: params.deviceList[i].name,
+ icon: params.deviceList[i].icon,
+ text: params.deviceList[i].name,
+ classNames: 'ffw-button notpressed list-item',
+ templateName: params.deviceList[i].icon ? 'rightIcon'
+ : 'text',
+ action: 'onDeviceChoosed',
+ target: 'SDL.SDLController',
+ onDown: false,
+ id: params.deviceList[i].id
+ }));
+ }
+ },
+
+ /**
+ * Function calls each time when user enters Change Device menu and clear
+ * all old data about devices
+ */
+ clearDeviceList: function() {
+
+ this.get('listOfDevices.list').removeAllChildren();
+ this.listOfDevices.rerender();
+ },
+
+ /**
+ * List for option on DeviceListView screen
+ */
+ listOfDevices: SDL.List.extend( {
+
+ elementId: 'info_apps_deviceList_list',
+
+ itemsOnPage: 5,
+
+ /** Items array */
+ items: []
+ })
+});
diff --git a/src/components/HMI/app/view/info/nonMediaView.js b/src/components/HMI/app/view/info/nonMediaView.js
new file mode 100644
index 0000000000..12dd8a654e
--- /dev/null
+++ b/src/components/HMI/app/view/info/nonMediaView.js
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoNonMedia
+ * @desc NonMedia application visual representation
+ * @category View
+ * @filesource app/view/info/nonMedia.js
+ * @version 1.0
+ */
+
+SDL.InfoNonMedia = Em.ContainerView
+ .create( {
+
+ elementId: 'info_nonMedia',
+
+ controller: SDL.SDLAppController,
+
+ childViews: [
+ 'content'
+ ],
+
+ classNameBindings: [
+ 'this.activeState:active_state:inactive_state'
+ ],
+
+ activeState: function(){
+ if (SDL.TurnByTurnView.activeTBT) {
+ return false;
+ } else if (SDL.States.info.nonMedia.active) {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('SDL.States.info.nonMedia.active', 'SDL.TurnByTurnView.activeTBT'),
+
+ content: Em.ContainerView
+ .extend( {
+ classNames: [
+ 'inner_content'
+ ],
+
+ childViews: [
+ 'deviceName', 'image', 'fields', 'innerMenu', 'presets'
+ ],
+
+ /**
+ * Deactivate View
+ */
+ deactivate: function() {
+
+ SDL.States.goToStates('info.apps');
+ },
+
+ deviceName: SDL.Label.extend( {
+
+ classNames: [
+ 'app_title'
+ ],
+
+ contentBinding: 'SDL.SDLAppController.model.deviceName'
+ }),
+
+ image: Em.View
+ .extend( {
+
+ classNames: [
+ 'app_image'
+ ],
+
+ template: Ember.Handlebars
+ .compile('<img width="150px" {{bindAttr src="SDL.SDLAppController.model.appInfo.mainImage"}}>')
+ }),
+
+ fields: Em.ContainerView.extend( {
+
+ classNames: [
+ 'app_fields'
+ ],
+
+ childViews: [
+ 'field1', 'field2', 'field3', 'field4'
+ ],
+
+ field1: SDL.Label.extend( {
+ contentBinding: 'controller.model.appInfo.field1',
+ attributeBindings: ["style"],
+ style: function(){
+ if (SDL.SDLAppController.model) {
+ return SDL.SDLAppController.model.appInfo.alignment;
+ } else {
+ return null;
+ }
+ }.property("SDL.SDLAppController.model.appInfo.alignment")
+ }),
+
+ field2: SDL.Label.extend( {
+ contentBinding: 'controller.model.appInfo.field2',
+ attributeBindings: ["style"],
+ style: function(){
+ if (SDL.SDLAppController.model) {
+ return SDL.SDLAppController.model.appInfo.alignment;
+ } else {
+ return null;
+ }
+ }.property("SDL.SDLAppController.model.appInfo.alignment")
+ }),
+
+ field3: SDL.Label.extend( {
+ contentBinding: 'controller.model.appInfo.field3'
+ }),
+
+ field4: SDL.Label.extend( {
+ contentBinding: 'controller.model.appInfo.field4'
+ })
+
+ }),
+
+ innerMenu: SDL.MenuList
+ .extend( {
+
+ refreshItems: function() {
+
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == SDL.NonMediaController.currentAppId) {
+ this
+ .addItems(SDL.SDLAppController.model.softButtons,
+ SDL.SDLAppController.model.appID);
+ }
+ }
+ .observes('SDL.SDLAppController.model.softButtons.@each'),
+
+ groupName: "NonMediaView",
+
+ content: Em.ContainerView.extend( {
+
+ classNames: [
+ 'content'
+ ],
+
+ attributeBindings: [
+ 'parentView.contentPositon:style'
+ ],
+
+ childViews: [
+ 'optionsButton'
+ ],
+
+ optionsButton: SDL.Button.extend( {
+ text: 'Options',
+
+ templateName: 'arrow',
+
+ action: 'openCommandsList',
+ target: 'SDL.SDLAppController'
+ })
+ })
+ }),
+
+ presets: Em.ContainerView
+ .extend( {
+ classNames: [
+ 'presets'
+ ],
+
+ classNameBindings: [
+ 'hidden'
+ ],
+
+ hidden: function() {
+
+ if (SDL.SDLAppController.model) { return !Boolean(SDL.SDLAppController.model
+ .get('appInfo.customPresets').length); }
+
+ }
+ .property('SDL.SDLAppController.model.appInfo.customPresets.@each'),
+
+ childViews: [
+ 'perset1',
+ 'perset2',
+ 'perset3',
+ 'perset4',
+ 'perset5',
+ 'perset6',
+ 'perset7',
+ 'perset8',
+ 'perset9',
+ 'perset10'
+ ],
+
+ perset1: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.0',
+ presetName: 'PRESET_0',
+ templateName: 'text'
+ }),
+ perset2: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.1',
+ presetName: 'PRESET_1',
+ templateName: 'text'
+ }),
+ perset3: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.2',
+ presetName: 'PRESET_2',
+ templateName: 'text'
+ }),
+ perset4: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.3',
+ presetName: 'PRESET_3',
+ templateName: 'text'
+ }),
+ perset5: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.4',
+ presetName: 'PRESET_4',
+ templateName: 'text'
+ }),
+ perset6: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.5',
+ presetName: 'PRESET_5',
+ templateName: 'text'
+ }),
+ perset7: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.6',
+ presetName: 'PRESET_6',
+ templateName: 'text'
+ }),
+ perset8: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.7',
+ presetName: 'PRESET_7',
+ templateName: 'text'
+ }),
+ perset9: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.8',
+ presetName: 'PRESET_8',
+ templateName: 'text'
+ }),
+ perset10: SDL.Button.extend(SDL.PresetEvents, {
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.9',
+ presetName: 'PRESET_9',
+ templateName: 'text'
+ })
+ })
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/servicesView.js b/src/components/HMI/app/view/info/servicesView.js
new file mode 100644
index 0000000000..f4bac6d0ee
--- /dev/null
+++ b/src/components/HMI/app/view/info/servicesView.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.ServicesView
+ * @desc Info Services module visual representation
+ * @category Info
+ * @filesource app/view/ServicesView.js
+ * @version 1.0
+ */
+
+SDL.InfoServicesView = Em.View
+ .create( {
+
+ elementId: 'info_services_view',
+
+ classNameBindings: [
+ 'SDL.States.info.services.active:active_state:inactive_state'
+ ],
+
+ /** Define module template */
+ template: Ember.Handlebars
+ .compile('<div class="inner-content">'
+ + '<div id="info_sync_services" class="info-text">{{SDL.locale.label.view_info_services_syncServices}}</div>'
+ + '<div id="info_traff" class="info-text">{{SDL.locale.label.view_info_services_trafficDirectionsAndInformation}}</div>'
+ + '<div id="info_traffic_report" class="info-text">{{SDL.locale.label.view_info_services_getTheLatestTrafficRreport}}</div>'
+ + '<div id="info_traffic_pts" class="info-text">{{SDL.locale.label.view_info_services_findBusinessesAndDownloadSaved}}<br>{{SDL.locale.label.view_info_services_Pts}}</div>'
+ + '<div id="info_traffic_hear" class="info-text">{{SDL.locale.label.view_info_services_hearPersonalizedInformationMore}}</div>'
+ + '<div id="info_connect" class="info-text">{{SDL.locale.label.view_info_services_connecttoServices}}</div>'
+ + '<div id="info_log" class="info-text">{{SDL.locale.label.view_info_services_toActivate}}</div>'
+ + '</div>')
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/travelLinkView.js b/src/components/HMI/app/view/info/travelLinkView.js
new file mode 100644
index 0000000000..2bf6b90a95
--- /dev/null
+++ b/src/components/HMI/app/view/info/travelLinkView.js
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoTravelLinkView
+ * @desc Info Travel Link Help module visual representation
+ * @category View
+ * @filesource app/view/settings/InfoTravelLinkView.js
+ * @version 1.0
+ */
+
+SDL.InfoTravelLinkView = Em.ContainerView
+ .create( {
+
+ classNameBindings: [
+ 'SDL.States.info.travelLink.active:active_state:inactive_state'
+ ],
+
+ elementId: 'info_travelLink',
+
+ childViews: [
+ 'imageLogo', 'listLeft', 'listRight',
+ ],
+
+ imageLogo: SDL.Label.extend( {
+ elementId: 'info_travelLink_logo',
+ icon: 'images/info/info_travelLink_sirius_logo.png',
+ templateName: 'icon'
+ }),
+
+ listLeft: SDL.List
+ .extend( {
+ elementId: 'info_travelLink_listLeft',
+
+ disableScrollbar: true,
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: [
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_trafficOnRoute',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ },
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_trafficNearby',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ },
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_fuelPrices',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ },
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_movieListings',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ },
+ ]
+ }),
+
+ listRight: SDL.List
+ .extend( {
+ elementId: 'info_travelLink_listRight',
+
+ disableScrollbar: true,
+
+ /** Items */
+ items: [
+ {
+
+ type: SDL.Button,
+
+ params: {
+
+ textBinding: 'SDL.locale.label.view_info_travelLink_subscriptionInfo',
+ disabled: true
+ }
+
+ },
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_weather',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ },
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_sportsInfo',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ },
+ {
+
+ type: SDL.Button,
+
+ params: {
+ textBinding: 'SDL.locale.label.view_info_travelLink_skiConditions',
+ templateName: 'arrow',
+ disabled: true
+ }
+
+ }
+ ]
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/infoView.js b/src/components/HMI/app/view/infoView.js
new file mode 100644
index 0000000000..397553d9fa
--- /dev/null
+++ b/src/components/HMI/app/view/infoView.js
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InfoView
+ * @desc Info module visual representation
+ * @category Info
+ * @filesource app/view/InfoView.js
+ * @version 1.0
+ */
+
+SDL.InfoView = Em.ContainerView.create( {
+
+ elementId: 'info_view',
+
+ /** Bind class for visual representation */
+ classNameBindings:
+ [
+ 'SDL.States.info.active:active_state:inactive_state'
+ ],
+
+ controllerBinding: Ember.Binding.oneWay( 'SDL.InfoController' ),
+
+ /** Settings components */
+ childViews:
+ [
+ 'leftMenu',
+ SDL.InfoServicesView,
+ SDL.InfoTravelLinkView,
+ SDL.InfoCalendarView,
+ SDL.InfoAppsView,
+ SDL.InfoNonMedia,
+ SDL.DeviceListView
+ ],
+
+ /** Left menu */
+ leftMenu: Em.ContainerView.extend( {
+ elementId: 'info_leftMenu',
+
+ classNameBindings:
+ [
+ 'parentView.controller.hiddenLeftMenu:hidden'
+ ],
+
+ classNames: 'menu-items',
+
+ childViews:
+ [
+ 'border',
+ 'items'
+ ],
+
+ border: Em.View.extend( {
+ classNames: 'ls_border'
+ } ),
+
+ items: Em.ContainerView.extend( {
+ classNames: 'ls-items',
+
+ childViews:
+ [
+ 'servicesButton',
+ 'travelLinkButton',
+ 'calendarButton',
+ 'appsButton',
+ 'sdlButton',
+ 'goToCD'
+ ],
+
+ servicesButton: SDL.Button.extend( {
+ elementId: 'info_leftMenu_services',
+ goToState: 'services',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.info.services.active:info_active'
+ ],
+ textBinding: 'SDL.locale.label.view_info_leftmenu_services',
+ icon: 'images/info/info_leftMenu_services_ico.png',
+ action: 'onState',
+ target: 'SDL.InfoController'
+ } ),
+
+ travelLinkButton: SDL.Button.extend( {
+ elementId: 'info_leftMenu_travelLink',
+ goToState: 'travelLink',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.info.travelLink.active:info_active'
+ ],
+ textBinding: 'SDL.locale.label.view_info_leftmenu_travelLink',
+ icon: 'images/info/info_leftMenu_travelLink_ico.png',
+ action: 'onState',
+ target: 'SDL.InfoController'
+ } ),
+
+ alertsButton: SDL.Button.extend( {
+ elementId: 'info_leftMenu_alerts',
+ goToState: 'alerts',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.info.alerts.active:info_active'
+ ],
+ textBinding: 'SDL.locale.label.view_info_leftmenu_alerts',
+ icon: 'images/info/info_leftMenu_alerts_ico.png',
+ action: 'onState',
+ target: 'SDL.InfoController'
+ } ),
+
+ calendarButton: SDL.Button.extend( {
+ elementId: 'info_leftMenu_calendar',
+ goToState: 'calendar',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.info.calendar.active:info_active'
+ ],
+ textBinding: 'SDL.locale.label.view_info_leftmenu_calendar',
+ icon: 'images/info/info_leftMenu_calendar_ico.png',
+ action: 'onState',
+ target: 'SDL.InfoController'
+ } ),
+
+ appsButton: SDL.Button.extend( {
+ elementId: 'info_leftMenu_apps',
+ goToState: 'apps',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.info.apps.active:info_active'
+ ],
+ textBinding: 'SDL.locale.label.view_info_leftmenu_apps',
+ icon: 'images/info/info_leftMenu_apps_ico.png',
+ action: 'onState',
+ target: 'SDL.InfoController'
+ } ),
+
+ sdlButton: SDL.Button.extend( {
+ elementId: 'info_leftMenu_sdl',
+ goToState: 'nonMedia',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.info.nonMedia.active:info_active'
+ ],
+ hidden: function() {
+ return !SDL.NonMediaController.currentAppId;
+ }.property( 'SDL.NonMediaController.currentAppId' ),
+ textBinding: 'SDL.NonMediaController.currentAppName',
+ iconBinding: 'SDL.NonMediaController.currentAppIcon',
+ action: 'activateCurrentApp',
+ target: 'SDL.NonMediaController'
+ } ),
+
+ goToCD: SDL.Button.extend( {
+ elementId: 'info_leftMenu_goToCD',
+ classNames: 'menu-item lsp1_p',
+ text: 'Go To CD',
+ action: 'turnOnCD',
+ icon: 'images/media/ico_cd.png',
+ target: 'SDL.MediaController'
+ } )
+ } )
+ } )
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/media/common/LeftMenuView.js b/src/components/HMI/app/view/media/common/LeftMenuView.js
new file mode 100644
index 0000000000..ba4495681f
--- /dev/null
+++ b/src/components/HMI/app/view/media/common/LeftMenuView.js
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.LeftMenuView
+ * @desc Media Left Menu module visual representation
+ * @category View
+ * @filesource app/view/media/SiriusView.js
+ * @version 1.0
+ */
+
+SDL.LeftMenuView = Em.ContainerView.extend( {
+ /** View ID */
+ elementId: 'media_leftmenu',
+
+ /** View components */
+ childViews:
+ [
+ 'border',
+ 'cdButton',
+ 'sdlButton'
+ ],
+ /** Border decoration */
+ border: Em.View.extend( {
+ elementId: 'media_left_menu_border',
+ classNames: 'ls_border'
+ } ),
+
+ /** CD Station Button */
+ cdButton: SDL.Button.extend( {
+ classNameBindings:
+ [
+ 'SDL.CDModel.active:active_state'
+ ],
+ elementId: 'media_cdButton',
+ classNames: 'media-ls-item',
+ action: 'turnOnCD',
+ icon: 'images/media/ico_cd.png',
+ target: 'SDL.MediaController',
+ textBinding: Ember.Binding.oneWay( 'SDL.locale.label.view_media_cd' )
+ } ),
+ /** SDL Button */
+ sdlButton: SDL.Button.extend( {
+ classNameBindings:
+ [
+ 'SDL.States.media.sdlmedia.active:active_state'
+ ],
+ elementId: 'media_sdlButton',
+ classNames: 'media-ls-item',
+ hidden: function() {
+ return !SDL.SDLMediaController.currentAppId;
+ }.property( 'SDL.SDLMediaController.currentAppId' ),
+ textBinding: 'SDL.SDLMediaController.currentAppName',
+ iconBinding: 'SDL.SDLMediaController.currentAppIcon',
+ action: 'activateCurrentApp',
+ target: 'SDL.SDLMediaController'
+ } )
+
+} );
diff --git a/src/components/HMI/app/view/media/playerView.js b/src/components/HMI/app/view/media/playerView.js
new file mode 100644
index 0000000000..406a6dba46
--- /dev/null
+++ b/src/components/HMI/app/view/media/playerView.js
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.MediaPlayerView
+ * @desc Media Player module visual representation
+ * @category View
+ * @filesource app/view/media/common/MediaPalyerView.js
+ * @version 1.0
+ */
+SDL.playerView = Em.View.create( {
+
+ elementId: 'media_player_view_container',
+
+ classNameBindings:
+ [
+ 'SDL.States.media.player.active:active_state:inactive_state'
+ ]
+
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/media/sdl/controllsView.js b/src/components/HMI/app/view/media/sdl/controllsView.js
new file mode 100644
index 0000000000..8e73f0ba0e
--- /dev/null
+++ b/src/components/HMI/app/view/media/sdl/controllsView.js
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLMediaControlls
+ * @desc SDLMediaControlls visual representation
+ * @category View
+ * @filesource app/view/media/sdl/controllsView.js
+ * @version 1.0
+ */
+
+SDL.SDLMediaControlls = Em.ContainerView.create( {
+
+ childViews:
+ [
+ 'info',
+ 'Controls',
+ 'tuneButtons'
+ ],
+
+ /**
+ * Verification paramiter
+ */
+ sdlMediaControlls: "V2",
+
+ info: Em.View.extend( {
+
+ elementId: 'app_view_info',
+
+ template: Em.Handlebars
+ .compile('{{#with view}}'
+ + '<div class="track-info">'
+ + '<div class="device">{{SDL.SDLAppController.model.deviceName}}</div>'
+ + '<div class="divider_o"></div>'
+ + '<div class="title textLimit" {{bindAttr style="SDL.SDLAppController.model.appInfo.alignment"}}>{{SDL.SDLAppController.model.appInfo.field1}}</div>'
+ + '<div class="album textLimit" {{bindAttr style="SDL.SDLAppController.model.appInfo.alignment"}}>{{SDL.SDLAppController.model.appInfo.field2}}</div>'
+ + '<div class="artist textLimit"{{bindAttr class="SDL.SDLAppController.model.mediaPreset:hidden"}}>{{SDL.SDLAppController.model.appInfo.field3}}</div>'
+ + '<div class="time"{{bindAttr class="SDL.SDLAppController.model.mediaPreset:timeV2"}}>{{SDL.SDLAppController.model.appInfo.mediaClock}}</div>'
+ + '<img class="cd_logo" {{bindAttr src="SDL.SDLAppController.model.appInfo.trackIcon" class="SDL.SDLAppController.model.mediaPreset:cd_logoV2"}} />'
+ + '</div>' + '{{/with}}')
+ }),
+
+ Controls: Em.ContainerView.create( {
+
+ elementId: 'app_view_controlls',
+
+ /** View components */
+ childViews:
+ [
+ 'PrevTrackButton',
+ 'PlayButton',
+ 'NextTrackButton'
+ ],
+
+ classNames: 'player_controlls',
+
+ classNameBindings: 'SDL.SDLAppController.model.mediaPreset:player_controllsV2',
+
+ PrevTrackButton: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'app_view_controlls_prev_track_button_v2',
+ classNames:
+ [
+ 'bc-item-big',
+ 'prevcd'
+ ],
+ icon: 'images/media/ico_prew.png',
+ presetName: 'SEEKLEFT'
+ } ),
+
+ PlayButton: SDL.Button.extend( {
+ elementId: 'app_view_controlls_play_button_v2',
+ classNames:
+ [
+ 'bc-item-big',
+ 'playcd'
+ ],
+ presetName: 'OK',
+ actionUp: function() {
+ SDL.SDLController.onSoftButtonOkActionUp( this.presetName );
+ },
+ actionDown: function() {
+ SDL.SDLController.onSoftButtonOkActionDown( this.presetName );
+ },
+ /**
+ * Define button
+ * template
+ */
+ template: Ember.Handlebars
+ .compile( '<img class="playIcon" {{bindAttr class="SDL.SDLAppController.model.isPlaying:visible:not-visible"}} src="images/media/ico_pause.png" />'
+ + '<img class="playIcon not-visible" {{bindAttr class="SDL.SDLAppController.model.isPlaying:not-visible:visible"}} src="images/media/ico-play.png" />' )
+ } ),
+ NextTrackButton: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'app_view_controlls_next_track_button_v2',
+ classNames:
+ [
+ 'bc-item-big',
+ 'nextcd'
+ ],
+ icon: 'images/media/ico_next.png',
+ presetName: 'SEEKRIGHT'
+ } )
+ } ),
+
+ tuneButtons: Em.ContainerView.create( {
+
+ elementId: 'sdl_media_presetButtons',
+
+ classNameBindings:
+ [
+ 'SDL.SDLAppController.model.mediaPreset::hidden'
+ ],
+
+ classNames:
+ [
+ 'main-preset-buttons-wraper'
+ ],
+
+ childViews:
+ [
+ 'wrapper'
+ ],
+
+ wrapper: Em.ContainerView.extend( {
+
+ elementId: 'sdl_media_presetButtons_wrapper',
+
+ classNames: 'preset-items',
+
+ childViews:
+ [
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9',
+ '10'
+ ],
+
+ 1: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button1',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.0',
+ templateName: 'text',
+ presetName: 'PRESET_0'
+ } ),
+ 2: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button2',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.1',
+ templateName: 'text',
+ presetName: 'PRESET_1'
+ } ),
+ 3: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button3',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.2',
+ templateName: 'text',
+ presetName: 'PRESET_2'
+ } ),
+ 4: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button4',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.3',
+ templateName: 'text',
+ presetName: 'PRESET_3'
+ } ),
+ 5: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button5',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.4',
+ templateName: 'text',
+ presetName: 'PRESET_4'
+ } ),
+ 6: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button6',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.5',
+ templateName: 'text',
+ presetName: 'PRESET_5'
+ } ),
+ 7: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button7',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.6',
+ templateName: 'text',
+ presetName: 'PRESET_6'
+ } ),
+ 8: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button8',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.7',
+ templateName: 'text',
+ presetName: 'PRESET_7'
+ } ),
+ 9: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button9',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.8',
+ templateName: 'text',
+ presetName: 'PRESET_8'
+ } ),
+ 10: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button10',
+ classNames: 'preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.9',
+ templateName: 'text',
+ presetName: 'PRESET_9'
+ } )
+ } )
+ } )
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/media/sdlmediaView.js b/src/components/HMI/app/view/media/sdlmediaView.js
new file mode 100644
index 0000000000..78371e7ea7
--- /dev/null
+++ b/src/components/HMI/app/view/media/sdlmediaView.js
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.sdlView
+ * @desc SDL Media application module visual representation
+ * @category View
+ * @filesource app/view/media/sdlView.js
+ * @version 1.0
+ */
+SDL.sdlView = Em.ContainerView
+ .create( {
+
+ /**
+ * View Id
+ */
+ elementId: 'sdl_view_container',
+
+ classNameBindings: [
+ 'this.activeState:active_state:inactive_state'
+ ],
+
+ activeState: function(){
+ if (SDL.TurnByTurnView.activeTBT) {
+ return false;
+ } else if (SDL.States.media.sdlmedia.active) {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('SDL.States.media.sdlmedia.active', 'SDL.TurnByTurnView.activeTBT'),
+
+ /**
+ * View Components
+ */
+ childViews: [
+ 'innerMenu',
+ 'controlls'
+ ],
+
+ controlls: SDL.SDLMediaControlls,
+
+ /**
+ * Deactivate View
+ */
+ deactivate: function() {
+
+ SDL.States.goToStates('info.apps');
+ },
+
+ innerMenu: SDL.MenuList
+ .extend( {
+
+ refreshItems: function() {
+
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == SDL.SDLMediaController.currentAppId) {
+ this.addItems(SDL.SDLAppController.model.softButtons,
+ SDL.SDLAppController.model.appID);
+ }
+ }.observes('SDL.SDLAppController.model.softButtons.@each'),
+
+ groupName: "MediaView",
+
+ content: Em.ContainerView.extend( {
+
+ classNames: [
+ 'content'
+ ],
+
+ attributeBindings: [
+ 'parentView.contentPositon:style'
+ ],
+
+ childViews: [
+ 'optionsButton'
+ ],
+
+ optionsButton: SDL.Button.extend( {
+ text: 'Options',
+
+ templateName: 'arrow',
+
+ action: 'openCommandsList',
+ target: 'SDL.SDLAppController'
+ })
+ })
+ })
+ }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/mediaView.js b/src/components/HMI/app/view/mediaView.js
new file mode 100644
index 0000000000..647b593065
--- /dev/null
+++ b/src/components/HMI/app/view/mediaView.js
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.MediaView
+ * @desc Media module visual representation
+ * @category View
+ * @filesource app/view/media/MediaView.js
+ * @version 1.0
+ */
+SDL.MediaView = Em.ContainerView.create( {
+ /** View Id */
+ elementId: 'media',
+
+ classNameBindings: 'SDL.States.media.active:active_state:inactive_state',
+
+ /** Media components */
+ childViews:
+ [
+ 'leftMenu',
+ SDL.playerView,
+ SDL.sdlView
+ ],
+ /** Left Menu view component */
+ leftMenu: SDL.LeftMenuView
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/navigationApp/baseNavigationView.js b/src/components/HMI/app/view/navigationApp/baseNavigationView.js
new file mode 100644
index 0000000000..1b373b615a
--- /dev/null
+++ b/src/components/HMI/app/view/navigationApp/baseNavigationView.js
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.BaseNavigationView
+ * @desc Navigation component base screen
+ * @category View
+ * @filesource app/view/navigationApp/baseNavigationView.js
+ * @version 1.0
+ */
+SDL.BaseNavigationView = Em.ContainerView.create({
+ /** View Id */
+ elementId: 'baseNavigation',
+
+ classNameBindings: [
+ 'SDL.States.navigationApp.baseNavigation.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'mainField1',
+ 'mainField2',
+ 'mainField3',
+ 'mainField4',
+ 'mainField5',
+ 'mainField6',
+ 'optionsBtn'
+ ],
+
+ mainField1: null,
+ mainField2: null,
+ mainField3: null,
+ mainField4: null,
+ mainField5: null,
+ mainField6: null,
+
+ update: function(){
+
+ var naviParams = SDL.SDLModel.constantTBTParams;
+
+ if (naviParams) {
+
+ for ( var i = 0; i < naviParams.navigationTexts.length; i++) {
+ switch (naviParams.navigationTexts[i].fieldName) {
+ case 'navigationText1': {
+ this.set('mainField1',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'navigationText2': {
+ this.set('mainField2',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'ETA': {
+ this.set('mainField4', naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'totalDistance': {
+ this.set('mainField5',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'navigationText': {
+ this.set('mainField6',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'timeToDestination': {
+ this.set('mainField3',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ default :{
+ break;
+ }
+ }
+ }
+
+ if (naviParams.softButtons) {
+ for ( var i = 0; i < naviParams.softButtons.length; i++) {
+ this.get('childViews').pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
+ text: naviParams.softButtons[i].text,
+ icon: naviParams.softButtons[i].image ? naviParams.softButtons[i].image.value : "",
+ templateName: naviParams.softButtons[i].image ? 'rightText' : 'text',
+ groupName: "NaviBase",
+ classNameBindings: ['isHighlighted:isHighlighted'],
+ isHighlighted: naviParams.softButtons[i].isHighlighted ? true : false,
+ softButtonID: naviParams.softButtons[i].softButtonID,
+ systemAction: naviParams.softButtons[i].systemAction,
+ classNames: 'navButton softButton softButton' + (i + 1),
+ appID: SDL.SDLAppController.model.appID
+ }));
+ }
+ }
+ }
+ },
+
+ mainField1: SDL.Label.extend({
+
+ classNames: 'mainField1 mainField',
+
+ contentBinding: 'SDL.SDLAppController.model.appInfo.field1'
+ }),
+
+ mainField2: SDL.Label.extend({
+
+ classNames: 'mainField2 mainField',
+
+ contentBinding: 'SDL.SDLAppController.model.appInfo.field2'
+ }),
+
+ mainField3: SDL.Label.extend({
+
+ classNames: 'mainField3 mainField',
+
+ contentBinding: 'SDL.SDLAppController.model.appInfo.field3'
+ }),
+
+ mainField4: SDL.Label.extend({
+
+ classNames: 'mainField4 mainField',
+
+ contentBinding: 'SDL.SDLAppController.model.appInfo.field4'
+ }),
+
+ mainField5: SDL.Label.extend({
+
+ classNames: 'mainField5 mainField',
+
+ contentBinding: 'parentView.mainField5'
+ }),
+
+ mainField6: SDL.Label.extend({
+
+ classNames: 'mainField6 mainField',
+
+ contentBinding: 'parentView.mainField6'
+ }),
+
+ optionsBtn: SDL.Button.extend({
+ classNames: 'naviOptionsBtn navButton',
+ text : "Options",
+ action: 'openCommandsList',
+ target: 'SDL.SDLAppController'
+ })
+
+});
diff --git a/src/components/HMI/app/view/navigationAppView.js b/src/components/HMI/app/view/navigationAppView.js
new file mode 100644
index 0000000000..29a69e1904
--- /dev/null
+++ b/src/components/HMI/app/view/navigationAppView.js
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.NavigationAppView
+ * @desc Navigation component
+ * @category View
+ * @filesource app/view/navigationAppView.js
+ * @version 1.0
+ */
+SDL.NavigationAppView = Em.ContainerView.create( {
+ /** View Id */
+ elementId: 'NavigationAppView',
+
+ classNameBindings: [
+ 'this.activeState:active_state:inactive_state'
+ ],
+
+ activeState: function(){
+ if (SDL.TurnByTurnView.activeTBT) {
+ return false;
+ } else if (SDL.States.navigationApp.active) {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('SDL.States.navigationApp.active', 'SDL.TurnByTurnView.activeTBT'),
+
+ childViews: [
+ 'videoView',
+ SDL.BaseNavigationView
+ ],
+
+ actionMove:function(event){
+
+ SDL.SDLModel.onTouchEvent(event);
+ },
+
+ actionUp:function(event){
+
+ SDL.SDLModel.onTouchEvent(event);
+ },
+
+ actionDown:function(event){
+
+ SDL.SDLModel.onTouchEvent(event);
+ },
+
+ videoView: Ember.View.create({
+ templateName: "video",
+ template: Ember.Handlebars.compile('<video id="html5Player"></video>')
+ })
+
+});
diff --git a/src/components/HMI/app/view/navigationView.js b/src/components/HMI/app/view/navigationView.js
new file mode 100644
index 0000000000..787da23310
--- /dev/null
+++ b/src/components/HMI/app/view/navigationView.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.NavigationView
+ * @desc Navigation component
+ * @category View
+ * @filesource app/view/navigationView.js
+ * @version 1.0
+ */
+SDL.NavigationView = Em.ContainerView.create( {
+ /** View Id */
+ elementId: 'navigationView',
+
+ classNameBindings: [
+ 'SDL.States.navigation.active:active_state:inactive_state'
+ ],
+
+ childViews:
+ [
+ 'windowText'
+ ],
+
+ windowText: SDL.Label.extend( {
+
+ classNames: 'windowText',
+
+ content: 'Navigation'
+ } )
+
+});
diff --git a/src/components/HMI/app/view/phone/dialpadView.js b/src/components/HMI/app/view/phone/dialpadView.js
new file mode 100644
index 0000000000..0290750d0a
--- /dev/null
+++ b/src/components/HMI/app/view/phone/dialpadView.js
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DialpadPhoneView
+ * @desc Phone Dialpad module visual representation
+ * @category View
+ * @filesource app/view/phone/DialpadView.js
+ * @version 1.0
+ */
+
+SDL.DialpadPhoneView = Em.ContainerView.create( {
+
+ elementId: 'phone_dialpad',
+
+ classNameBindings: 'SDL.States.phone.dialpad.active:active_state:inactive_state',
+
+ childViews:
+ [
+ 'number',
+ 'keypad',
+ 'deleteButton',
+ 'dialButton',
+ 'endButton'
+ ],
+
+ /** Number area */
+ number: SDL.Label.extend( {
+ elementId: 'phone_dialpad_number',
+
+ contentBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.dialpadNumber' )
+ } ),
+
+ /** Keypad block */
+ keypad: Em.ContainerView.extend( {
+ elementId: 'phone_dialpad_keypad',
+
+ childViews:
+ [
+ 'key1',
+ 'key2',
+ 'key3',
+ 'key4',
+ 'key5',
+ 'key6',
+ 'key7',
+ 'key8',
+ 'key9',
+ 'key0',
+ 'keyStar',
+ 'keyDiez'
+ ],
+
+ key1: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key1',
+
+ classNames: 'left',
+
+ text: '1'
+ } ),
+
+ key2: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key2',
+
+ classNames: 'center',
+
+ text: '2'
+ } ),
+
+ key3: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key3',
+
+ classNames: 'right',
+
+ text: '3'
+
+ } ),
+
+ key4: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key4',
+
+ classNames: 'left',
+
+ text: '4'
+ } ),
+
+ key5: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key5',
+
+ classNames: 'center',
+
+ text: '5'
+ } ),
+
+ key6: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key6',
+
+ classNames: 'right',
+
+ text: '6'
+ } ),
+
+ key7: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key7',
+
+ classNames: 'left',
+
+ text: '7'
+ } ),
+
+ key8: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key8',
+
+ classNames: 'center',
+
+ text: '8'
+ } ),
+
+ key9: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key9',
+
+ classNames: 'right',
+
+ text: '9'
+ } ),
+
+ key0: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_key0',
+
+ classNames: 'center',
+
+ text: '0'
+ } ),
+
+ keyStar: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_keyStar',
+
+ classNames: 'left',
+
+ text: '*'
+ } ),
+
+ keyDiez: SDL.Button.extend( {
+ elementId: 'phone_dialpad_keypad_keyDiez',
+
+ classNames: 'right',
+
+ text: '#'
+ } )
+ } ),
+
+ deleteButton: SDL.Button.extend( {
+ elementId: 'phone_dialpad_deleteButton',
+
+ classNameBindings:
+ [
+ 'SDL.PhoneController.model.dialpadNumber.length:show'
+ ],
+
+ icon: 'images/phone/del.png',
+
+ action: 'onDelete',
+ target: 'SDL.PhoneController',
+
+ disabledBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.onCall' )
+ } ),
+
+ dialButton: SDL.Button.extend( {
+ elementId: 'phone_dialpad_dialButton',
+
+ textBinding: Em.Binding.oneWay( 'SDL.locale.label.view_phone_dial' ),
+ icon: 'images/phone/dial.png',
+
+ action: 'onDialCall',
+ target: 'SDL.PhoneController',
+
+ disabledBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.onCall' )
+ } ),
+
+ endButton: SDL.Button.extend( {
+ elementId: 'phone_dialpad_endButton',
+
+ textBinding: Em.Binding.oneWay( 'SDL.locale.label.view_phone_end' ),
+ icon: 'images/phone/end.png',
+
+ action: 'onEndCall',
+ target: 'SDL.PhoneController',
+
+ disabledBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.readyForCall' )
+ } )
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/phoneView.js b/src/components/HMI/app/view/phoneView.js
new file mode 100644
index 0000000000..ec3413eb72
--- /dev/null
+++ b/src/components/HMI/app/view/phoneView.js
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PhoneView
+ * @desc Phone module visual representation
+ * @category View
+ * @filesource app/view/phone/PhoneView.js
+ * @version 1.0
+ */
+
+SDL.PhoneView = Em.ContainerView.create( {
+
+ elementId: 'phone',
+
+ /** Bind class for visual representation */
+ classNameBindings: [
+ 'SDL.States.phone.active:active_state:inactive_state'
+ ],
+
+ /** Initial phone components */
+ childViews: [
+ 'menu', SDL.DialpadPhoneView
+ ],
+
+ /** Left menu */
+ menu: Em.ContainerView.extend( {
+ elementId: 'phone_menu',
+
+ // classNameBindings: ['SDL.PhoneController.hideMenu:hide'],
+
+ childViews: [
+ 'border', 'items'
+ ],
+
+ border: Em.View.extend( {
+ classNames: 'ls_border',
+
+ template: Ember.Handlebars
+ .compile('<img class="bg" src="images/common/ls_border.png">')
+ }),
+
+ items: Em.ContainerView.extend( {
+ classNames: 'ls-items',
+
+ childViews: [
+ 'dialpadButton'
+ ],
+
+ dialpadButton: SDL.Button.extend( {
+ elementId: 'phone_menu_dialpadButton',
+
+ classNames: 'ls-item lsp1_p active_in_helpmode',
+ classNameBindings: [
+ 'SDL.States.phone.dialpad.active:phone_active'
+ ],
+ textBinding: Em.Binding
+ .oneWay('SDL.locale.label.view_phone_phone'),
+ icon: 'images/phone/ico_phone.png',
+ action: 'subState',
+ target: 'SDL.PhoneController',
+
+ stateName: 'dialpad'
+ })
+ })
+ }),
+
+ /** End call message window */
+ endCallMessage: SDL.Label.extend( {
+ elementId: 'phone_endCallMessage',
+
+ contentBinding: Em.Binding
+ .oneWay('SDL.locale.label.view_phone_popUp_callEnded')
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/AlertManeuverPopUp.js b/src/components/HMI/app/view/sdl/AlertManeuverPopUp.js
new file mode 100644
index 0000000000..b675b32cf5
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/AlertManeuverPopUp.js
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.AlertManeuverPopUp
+ * @desc AlertManeuverPopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/AlertManeuverPopUp.js
+ * @version 1.0
+ */
+
+SDL.AlertManeuverPopUp = Em.ContainerView.create( {
+
+ elementId: 'AlertManeuverPopUp',
+
+ classNames: 'AlertManeuverPopUp',
+
+ classNameBindings:
+ ['activate:AlertManeuverActive'
+ ],
+
+ childViews:
+ [
+ 'applicationName',
+ // 'image',
+ // 'message1',
+ // 'message2',
+ // 'message3',
+ 'softbuttons',
+ 'closeButton'
+ ],
+
+ content1: 'Title',
+
+ content2: 'Text',
+
+ activate: false,
+
+ timer: null,
+
+ /**
+ * Wagning image on Alert Maneuver PopUp
+ */
+ image: Em.View.extend( {
+ elementId: 'alertManeuverPopUpImage',
+
+ classNames: 'alertManeuverPopUpImage'
+ } ),
+
+ applicationName: SDL.Label.extend( {
+
+ elementId: 'applicationName',
+
+ classNames: 'applicationName',
+
+ contentBinding: 'parentView.appName'
+ } ),
+
+ message1: SDL.Label.extend( {
+
+ elementId: 'message1',
+
+ classNames: 'message1',
+
+ contentBinding: 'parentView.content1'
+ } ),
+
+ message2: SDL.Label.extend( {
+
+ elementId: 'message2',
+
+ classNames: 'message2',
+
+ contentBinding: 'parentView.content2'
+ } ),
+
+ message3: SDL.Label.extend( {
+
+ elementId: 'message3',
+
+ classNames: 'message3',
+
+ contentBinding: 'parentView.content3'
+ } ),
+
+ /**
+ * Container for softbuttons
+ */
+ softbuttons: Em.ContainerView.extend( {
+ elementId: 'alertManeuverSoftButtons',
+
+ classNames: 'alertManeuverSoftButtons'
+ } ),
+
+ /**
+ * Close button
+ */
+ closeButton: SDL.Button.create( {
+ text: 'Close',
+ classNames: 'closeButton softButton',
+ action: 'closeAlertMeneuverPopUp',
+ target: 'SDL.SDLController',
+ templateName: 'text'
+ } ),
+
+ /**
+ * @desc Function creates Soft Buttons on AlertPoUp
+ * @param {Object} params
+ */
+ addSoftButtons: function( params ) {
+
+ var count = this.get( 'softbuttons' ).removeAllChildren();
+
+ if( params ){
+
+ var softButtonsClass;
+ switch( params.length ){
+ case 1:
+ softButtonsClass = 'one';
+ break;
+ case 2:
+ softButtonsClass = 'two';
+ break;
+ case 3:
+ softButtonsClass = 'three';
+ break;
+ case 4:
+ softButtonsClass = 'four';
+ break;
+ }
+
+ for( var i = 0; i < params.length; i++ ){
+ this.get( 'softbuttons.childViews' ).pushObject( SDL.Button.create( SDL.PresetEventsCustom, {
+ softButtonID: params[i].softButtonID,
+ icon: params[i].image,
+ text: params[i].text,
+ classNames: 'list-item softButton ' + softButtonsClass,
+ elementId: 'softButton' + i,
+ templateName: params[i].image ? 'rightIcon' : 'text',
+ systemAction: params[i].systemAction,
+ appID: params.appID
+ } ) );
+ }
+ }
+ },
+
+ AlertManeuverActive: function( message ) {
+// var self = this;
+//
+// if (message.softButtons) {
+// this.addSoftButtons( message.softButtons );
+// }
+//
+// this.set( 'activate', true );
+//
+// clearTimeout( this.timer );
+// this.timer = setTimeout( function() {
+// self.set( 'activate', false );
+// }, 5000 );
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/AlertPopUp.js b/src/components/HMI/app/view/sdl/AlertPopUp.js
new file mode 100644
index 0000000000..20ba5c4fb1
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/AlertPopUp.js
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.AlertPopUp
+ * @desc AlertPopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/AlertPopUp.js
+ * @version 1.0
+ */
+
+SDL.AlertPopUp = Em.ContainerView.create({
+
+ elementId: 'AlertPopUp',
+
+ classNames: 'AlertPopUp',
+
+ classNameBindings:
+ [
+ 'active:AlertActive'
+ ],
+
+ childViews:
+ [
+ 'applicationName',
+ 'image',
+ 'message1',
+ 'message2',
+ 'message3',
+ 'softbuttons',
+ 'progressIndicatorView'
+ ],
+
+ /**
+ * Id of current request
+ *
+ * @type {Number}
+ */
+ alertRequestId: null,
+
+ content1: '',
+
+ content2: '',
+
+ content3: '',
+
+ active: false,
+
+ timer: null,
+
+ timeout: null,
+
+ progressIndicator: false,
+
+ /**
+ * Wagning image on Alert PopUp
+ */
+ image: Em.View.extend({
+ elementId: 'alertPopUpImage',
+
+ classNames: 'alertPopUpImage'
+ }),
+
+ /**
+ * Wagning image on Alert PopUp
+ */
+ progressIndicatorView: Em.View.extend({
+ elementId: 'progressIndicator',
+
+ classNameBindings: 'this.parentView.progressIndicator:progressIndicator'
+ }),
+
+ applicationName: SDL.Label.extend({
+
+ elementId: 'applicationName',
+
+ classNames: 'applicationName',
+
+ contentBinding: 'parentView.appName'
+ }),
+
+ message1: SDL.Label.extend({
+
+ elementId: 'message1',
+
+ classNames: 'message1',
+
+ contentBinding: 'parentView.content1'
+ }),
+
+ message2: SDL.Label.extend({
+
+ elementId: 'message2',
+
+ classNames: 'message2',
+
+ contentBinding: 'parentView.content2'
+ }),
+
+ message3: SDL.Label.extend({
+
+ elementId: 'message3',
+
+ classNames: 'message3',
+
+ contentBinding: 'parentView.content3'
+ }),
+
+ /**
+ * Deactivate PopUp
+ */
+ deactivate: function(reason) {
+ this.set('active', false);
+ clearTimeout(this.timer);
+
+ this.set('content1', '');
+ this.set('content2', '');
+ this.set('content3', '');
+
+ if (reason == 'timeout' && this.softbuttons.buttons._childViews.length > 0) {
+ SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['ABORTED'], this.alertRequestId);
+ } else {
+ SDL.SDLController.alertResponse(SDL.SDLModel.resultCode['SUCCESS'], this.alertRequestId);
+ }
+
+ SDL.SDLController.onSystemContextChange();
+ },
+
+ /**
+ * Container for softbuttons
+ */
+ softbuttons: Em.ContainerView.extend({
+
+ childViews:
+ [
+ 'buttons'
+ ],
+
+ buttons: Em.ContainerView.extend({
+ elementId: 'alertSoftButtons',
+
+ classNames: 'alertSoftButtons'
+ })
+ }),
+
+ /**
+ * @desc Function creates Soft Buttons on AlertPoUp
+ * @param {Object} params
+ */
+ addSoftButtons: function(params, appID) {
+
+ this.softbuttons.buttons.removeAllChildren();
+ this.softbuttons.buttons.rerender();
+
+ if(params){
+
+ var softButtonsClass;
+ switch(params.length){
+ case 1:
+ softButtonsClass = 'one';
+ break;
+ case 2:
+ softButtonsClass = 'two';
+ break;
+ case 3:
+ softButtonsClass = 'three';
+ break;
+ case 4:
+ softButtonsClass = 'four';
+ break;
+ }
+
+ for(var i = 0; i < params.length; i++){
+ this.get('softbuttons.buttons.childViews')
+ .pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
+ systemAction: params[i].systemAction,
+ groupName: "AlertPopUp",
+ classNameBindings: ['isHighlighted:isHighlighted'],
+ isHighlighted: params[i].isHighlighted ? true : false,
+ softButtonID: params[i].softButtonID,
+ icon: params[i].image ? params[i].image.value : "",
+ text: params[i].text,
+ classNames: 'list-item softButton ' + softButtonsClass,
+ elementId: 'softButton' + i,
+ templateName: params[i].image ? 'rightText' : 'text',
+ appID: appID
+ }));
+ }
+ }
+ },
+
+ AlertActive: function(message, alertRequestId) {
+ var self = this;
+
+ this.set('alertRequestId', alertRequestId);
+
+ this.addSoftButtons(message.softButtons, message.appID);
+
+ this.set('progressIndicator', message.progressIndicator);
+
+ this.set('appName', SDL.SDLController.getApplicationModel(message.appID).appName);
+
+ for (var i = 0; i < message.alertStrings.length; i++) {
+ switch (message.alertStrings[i].fieldName) {
+ case 'alertText1': {
+ this.set('content1', message.alertStrings[i].fieldText);
+ break;
+ }
+ case 'alertText2': {
+ this.set('content2', message.alertStrings[i].fieldText);
+ break;
+ }
+ case 'alertText3': {
+ this.set('content3', message.alertStrings[i].fieldText);
+ break;
+ }
+ }
+ }
+
+ this.set('active', true);
+ this.set('timeout', message.duration ? message.duration : 30000); //default timeout defined for Alert popUp
+
+ clearTimeout(this.timer);
+ this.timer = setTimeout(function() {
+ self.deactivate('timeout');
+ }, this.timeout);
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/AudioPassThruPopUp.js b/src/components/HMI/app/view/sdl/AudioPassThruPopUp.js
new file mode 100644
index 0000000000..849daa2243
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/AudioPassThruPopUp.js
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.AudioPassThruPopUp
+ * @desc AudioPassThruPopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/AudioPassThruPopUp.js
+ * @version 1.0
+ */
+
+SDL.AudioPassThruPopUp = Em.ContainerView.create( {
+
+ elementId: 'AudioPassThruPopUp',
+
+ classNames: 'AudioPassThruPopUp',
+
+ classNameBindings:
+ [
+ 'activate:AudioPassThruActive'
+ ],
+
+ childViews:
+ [
+ 'applicationName',
+ 'image',
+ 'message1',
+ 'message2',
+ 'message3',
+ 'buttonRetry',
+ 'buttonDone',
+ 'buttonCancel'
+ ],
+
+ content1: 'Title',
+
+ content2: 'Text',
+
+ activateBinding: 'SDL.SDLModel.AudioPassThruState',
+
+ timer: null,
+
+ applicationName: SDL.Label.extend( {
+
+ elementId: 'AudioPassThruPopUpApplicationName',
+
+ classNames: 'applicationName',
+
+ contentBinding: 'parentView.appName'
+ } ),
+
+ /**
+ * Wagning image on Alert PopUp
+ */
+ image: Em.View.extend( {
+ elementId: 'audioPassThruImage',
+
+ classNames: 'audioPassThruImage'
+ } ),
+
+ message1: SDL.Label.extend( {
+
+ elementId: 'AudioPassThruPopUpMessage1',
+
+ classNames: 'message1',
+
+ contentBinding: 'parentView.content1'
+ } ),
+
+ message2: SDL.Label.extend( {
+
+ elementId: 'AudioPassThruPopUpMessage2',
+
+ classNames: 'message2',
+
+ contentBinding: 'parentView.content2'
+ } ),
+
+ message3: SDL.Label.extend( {
+
+ elementId: 'AudioPassThruPopUpMessage3',
+
+ classNames: 'message3',
+
+ contentBinding: 'parentView.content3'
+ } ),
+
+ buttonRetry: SDL.Button.create( {
+ elementId: 'AudioPassThruPopUpButtonRetry',
+ classNames: 'buttonRetry softButton',
+ text: 'Retry',
+ responseResult: SDL.SDLModel.resultCode['RETRY'],
+ actionUp: function() {
+ SDL.SDLController.callPerformAudioPassThruPopUpErrorResponse( this );
+ }
+ } ),
+
+ buttonDone: SDL.Button.create( {
+ elementId: 'AudioPassThruPopUpButtonDone',
+ classNames: 'buttonDone softButton',
+ text: 'Done',
+ responseResult: SDL.SDLModel.resultCode['SUCCESS'],
+ actionUp: function() {
+ SDL.SDLController.callPerformAudioPassThruPopUpResponse( this );
+ }
+ } ),
+
+ buttonCancel: SDL.Button.create( {
+ elementId: 'AudioPassThruPopUpButtonCancel',
+ classNames: 'buttonCancel softButton',
+ text: 'Cancel',
+ responseResult: SDL.SDLModel.resultCode['ABORTED'],
+ actionUp: function() {
+ SDL.SDLController.callPerformAudioPassThruPopUpErrorResponse( this );
+ }
+ } ),
+
+ /**
+ * Method to start AudioPassThru timer to deactivate popUp and send response to SDL
+ */
+ StartAudioPassThruTimer: function() {
+ clearTimeout( this.timer );
+ this.timer = setTimeout( function() {
+ SDL.SDLController.performAudioPassThruResponse( SDL.SDLModel.resultCode["SUCCESS"] );
+ }, SDL.SDLModel.AudioPassThruData.maxDuration );
+ },
+
+ /**
+ * Method clears PopUp's timer when activity flag become false, and show
+ * PopUp with data come from SDLCorel when activity flag become true
+ */
+ AudioPassThruActivity: function() {
+
+ if( this.activate ){
+
+ var self = this, data = SDL.SDLModel.AudioPassThruData;
+
+ this.set( 'appName', SDL.SDLController.getApplicationModel( data.appID ).appName );
+
+ for (var i = 0; i < data.audioPassThruDisplayTexts.length; i++) {
+ switch (data.audioPassThruDisplayTexts[i].fieldName) {
+ case 'audioPassThruDisplayText1': {
+ this.set('content1', data.audioPassThruDisplayTexts[i].fieldText);
+ break;
+ }
+ case 'audioPassThruDisplayText2': {
+ this.set('content2', data.audioPassThruDisplayTexts[i].fieldText);
+ break;
+ }
+ }
+ }
+ }else{
+ if( this.timer ){
+ clearTimeout( this.timer );
+ this.timer = null;
+ }
+
+ SDL.SDLController.onSystemContextChange();
+ }
+ }.observes( 'activate' )
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/ExitAppView.js b/src/components/HMI/app/view/sdl/ExitAppView.js
new file mode 100644
index 0000000000..4f423f06af
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/ExitAppView.js
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.ExitApp
+ * @desc Exit All Applications reason select visual representation
+ * @category View
+ * @filesource app/view/sdl/ExitAppView.js
+ * @version 1.0
+ */
+
+SDL.ExitApp = Em.ContainerView.create( {
+
+ elementId: 'exitAppView',
+
+ classNames: 'exitAppView',
+
+ classNameBindings:
+ [
+ 'active'
+ ],
+
+ childViews:
+ [
+ 'exitAppViewLabel',
+ 'exitAppViewTitle',
+ 'exitAppViewSelect'
+ ],
+
+ /**
+ * Title of VehicleInfo PopUp view
+ */
+ exitAppViewLabel: SDL.Label.extend( {
+
+ elementId: 'exitAppViewLabel',
+
+ classNames: 'exitAppViewLabel',
+
+ content: 'Exit Application'
+ } ),
+
+ /**
+ * Property indicates the activity state of TBTClientStateView
+ */
+ active: false,
+
+ /**
+ * Title of tbtClientState group of parameters
+ */
+ exitAppViewTitle: SDL.Label.extend( {
+
+ elementId: 'exitAppViewTitle',
+
+ classNames: 'exitAppViewTitle',
+
+ content: 'Exit Application reason'
+ } ),
+
+ /**
+ * HMI element Select with parameters of TBTClientStates
+ */
+ exitAppViewSelect: Em.Select.extend( {
+
+ elementId: 'exitAppViewSelect',
+
+ classNames: 'exitAppViewSelect',
+
+ contentBinding: 'SDL.SDLModel.exitAppState',
+
+ optionValuePath: 'content.id',
+
+ optionLabelPath: 'content.name',
+
+ /**
+ * Selected data sent on model for further processing
+ */
+ click: function() {
+
+ SDL.SDLController.exitAppViewSelected( this.selection.name );
+
+ }
+ } ),
+
+ /**
+ * Trigger function that activates and deactivates tbtClientStateView
+ */
+ toggleActivity: function() {
+ this.toggleProperty( 'active' );
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/PopUp.js b/src/components/HMI/app/view/sdl/PopUp.js
new file mode 100644
index 0000000000..b4b429df23
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/PopUp.js
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PopUp
+ * @desc PopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/PopUp.js
+ * @version 1.0
+ */
+
+SDL.PopUp = Em.ContainerView.extend({
+
+ classNames: 'PopUp',
+
+ childViews:
+ [
+ 'message',
+ 'buttonOk',
+ 'buttonCancel',
+ 'backButton'
+ ],
+
+ classNameBindings: [
+ 'this.active:active_state:inactive_state'
+ ],
+
+ popUpId: 0,
+
+ /**
+ * Callback function to return result of made action by user
+ */
+ callback: null,
+
+ content: 'Title',
+
+ active: false,
+
+ timer: null,
+
+ backButton: SDL.Button.extend( {
+ classNames: 'button backButton',
+ text: 'X',
+ click: function () {
+ this._parentView.deactivate();
+ },
+ buttonAction: true,
+ onDown: false,
+ disabledBinding: 'parentView.buttons'
+ }),
+
+ buttons: true,
+
+ buttonOk: SDL.Button.extend( {
+ classNames: 'button vehicleHealthReport OkButton',
+ text: 'Ok',
+ action: 'deactivate',
+ target: 'parentView',
+ buttonAction: true,
+ onDown: false,
+ disabledBinding: 'parentView.buttons'
+ }),
+
+ buttonCancel: SDL.Button.extend( {
+ classNames: 'button vehicleHealthReport CancelButton',
+ text: 'Cancel',
+ action: 'deactivate',
+ target: 'parentView',
+ buttonAction: false,
+ onDown: false,
+ disabledBinding: 'parentView.buttons'
+ }),
+
+ message: SDL.Label.extend({
+
+ elementId: 'text',
+
+ classNames: 'text',
+
+ contentBinding: 'parentView.content'
+ }),
+
+ /**
+ * Deactivate PopUp
+ */
+ deactivate: function(event) {
+ this.set('active', false);
+
+ if (this.callback && event) {
+ this.callback(event.buttonAction);
+ }
+
+ this.set('callback', null);
+ this.remove();
+ },
+
+ popupActivate: function(message, callback) {
+ this.set('active', true);
+
+ clearTimeout(this.timer);
+ this.timer = null;
+
+ if (callback) {
+ this.set('callback', callback);
+ this.set('buttons', false);
+ } else {
+ this.set('buttons', true);
+ var self = this;
+ this.timer = setTimeout(function(){
+ self.deactivate();
+ },
+ 5000);
+ }
+
+ this.set('content', message);
+
+ return ++this.popUpId;
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/SystemRequestView.js b/src/components/HMI/app/view/sdl/SystemRequestView.js
new file mode 100644
index 0000000000..0701cd2206
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/SystemRequestView.js
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.systemRequest
+ * @desc Exit All Applications reason select visual representation
+ * @category View
+ * @filesource app/view/sdl/systemRequestView.js
+ * @version 1.0
+ */
+
+SDL.SystemRequest = Em.ContainerView.create( {
+
+ elementId: 'systemRequestView',
+
+ classNames: 'systemRequestView',
+
+ classNameBindings:
+ [
+ 'active'
+ ],
+
+ childViews:
+ [
+ 'systemRequestViewLabel',
+ 'systemRequestViewTitle',
+ 'systemRequestViewSelect'
+ ],
+
+ /**
+ * Title of VehicleInfo PopUp view
+ */
+ systemRequestViewLabel: SDL.Label.extend( {
+
+ elementId: 'systemRequestViewLabel',
+
+ classNames: 'systemRequestViewLabel',
+
+ content: 'System Request'
+ } ),
+
+ /**
+ * Property indicates the activity state of TBTClientStateView
+ */
+ active: false,
+
+ /**
+ * Title of tbtClientState group of parameters
+ */
+ systemRequestViewTitle: SDL.Label.extend( {
+
+ elementId: 'systemRequestViewTitle',
+
+ classNames: 'systemRequestViewTitle',
+
+ content: 'System Request reason'
+ } ),
+
+ /**
+ * HMI element Select with parameters of TBTClientStates
+ */
+ systemRequestViewSelect: Em.Select.extend( {
+
+ elementId: 'systemRequestViewSelect',
+
+ classNames: 'systemRequestViewSelect',
+
+ contentBinding: 'SDL.SDLModel.systemRequestState',
+
+ optionValuePath: 'content.id',
+
+ optionLabelPath: 'content.name',
+
+ /**
+ * Selected data sent on model for further processing
+ */
+ click: function() {
+
+ SDL.SDLController.systemRequestViewSelected( this.selection.name );
+
+ }
+ } ),
+
+ /**
+ * Trigger function that activates and deactivates tbtClientStateView
+ */
+ toggleActivity: function() {
+ this.toggleProperty( 'active' );
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/TTSPopUp.js b/src/components/HMI/app/view/sdl/TTSPopUp.js
new file mode 100644
index 0000000000..3b12b5266c
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/TTSPopUp.js
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.TTSPopUp
+ * @desc TTSPopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/TTSPopUp.js
+ * @version 1.0
+ */
+
+SDL.TTSPopUp = Em.ContainerView.create( {
+
+ elementId: 'TTSPopUp',
+
+ classNames: 'TTSPopUp',
+
+ classNameBindings: [
+ 'active'
+ ],
+
+ childViews: [
+ 'popUp',
+ 'message',
+ 'okButton',
+ 'timerText'
+ ],
+
+ requestId: null,
+
+ content: 'Messaage',
+
+ active: false,
+
+ timer: null,
+
+ appID: null,
+
+ timerSeconds: 10,
+
+ popUp: Ember.TextArea.extend( {
+
+ elementId: 'popUp',
+
+ classNames: 'popUp',
+
+ valueBinding: 'parentView.content'
+ }),
+
+ message: SDL.Label.extend( {
+
+ elementId: 'message',
+
+ classNames: 'message'
+ }),
+
+ okButton: SDL.Button.extend( {
+ classNames: 'button okButton',
+ text: 'Reset Timeout',
+ action: 'resetTimeout',
+ target: 'parentView',
+ buttonAction: true,
+ onDown: false,
+ disabledBinding: 'parentView.buttons'
+ }),
+
+ timerText: SDL.Label.extend({
+
+ elementId: 'timerText',
+
+ classNames: 'timerText',
+
+ contentBinding: 'parentView.timerSeconds'
+ }),
+
+ resetTimeout: function () {
+ this.set('timerSeconds', 10);
+ FFW.TTS.OnResetTimeout(this.appID, "TTS.Speak");
+ this.appID = null;
+ },
+
+ ActivateTTS: function(msg, appID) {
+
+ var self = this;
+
+ this.set('appID', appID);
+ this.set('content', msg);
+ this.set('active', true);
+
+ clearInterval(this.timer);
+ this.timer = setInterval(function() {
+
+ self.set('timerSeconds', self.timerSeconds - 1);
+ }, 1000); // timeout for TTS popUp timer interval in milliseconds
+ FFW.TTS.Started();
+ },
+
+ timerHandler: function () {
+ if (this.timerSeconds === 0) {
+ this.DeactivateTTS();
+ }
+ }.observes('this.timerSeconds'),
+
+ DeactivateTTS: function() {
+ clearInterval(this.timer);
+ this.set('active', false);
+ this.set('timerSeconds', 10);
+ SDL.SDLController.TTSResponseHandler();
+ FFW.TTS.Stopped();
+ },
+
+ /**
+ * This event triggered when component is placed to document DOM structure
+ */
+ didInsertElement: function() {
+
+ this._super();
+ }
+});
diff --git a/src/components/HMI/app/view/sdl/VRHelpListView.js b/src/components/HMI/app/view/sdl/VRHelpListView.js
new file mode 100644
index 0000000000..bf93137fac
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/VRHelpListView.js
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InteractionChoicesView
+ * @desc Interaction Choices visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/interactionChoicesView.js
+ * @version 1.0
+ */
+
+SDL.VRHelpListView = SDL.SDLAbstractView.create( {
+
+ elementId: 'vr_help_list_view',
+
+ childViews: [
+ 'backButton', 'captionText', 'helpList'
+ ],
+
+ helpList: SDL.List.extend( {
+ elementId: 'vr_help_list_view_list',
+ itemsOnPage: 5,
+ items: []
+ }),
+
+ /**
+ * Deactivate window
+ */
+ deactivate: function() {
+
+ this._super();
+
+ if (SDL.SDLAppController.model && SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
+ SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['ABORTED']);
+ }
+
+ SDL.SDLController.VRMove();
+ },
+
+ /**
+ * Clean choices caption and list before new proform
+ */
+ clean: function() {
+
+ this.set('captionText.content', 'vrHelp');
+ this.helpList.items = [];
+ this.helpList.list.refresh();
+ },
+
+ /**
+ * Update choises list with actual set id
+ *
+ * @param data:
+ * Array
+ */
+ showVRHelp: function(vrHelpTitle, vrHelp) {
+
+ this.clean();
+
+ this.set('active', true);
+
+ SDL.SDLController.VRMove();
+
+ if (vrHelpTitle) {
+ this.captionText.set('content', vrHelpTitle);
+ }
+
+ if (vrHelp) {
+ for (i = 0; i < vrHelp.length; i++) {
+ this.helpList.items.push( {
+ type: SDL.Label,
+ params: {
+ content: vrHelp[i].text,
+ icon: vrHelp[i].image
+ ? vrHelp[i].image.value : null,
+ templateName: vrHelp[i].image ? "icon" : null
+ }
+ });
+ }
+ }
+
+ this.helpList.list.refresh();
+ }
+});
diff --git a/src/components/HMI/app/view/sdl/VRPopUp.js b/src/components/HMI/app/view/sdl/VRPopUp.js
new file mode 100644
index 0000000000..5a26a9ee80
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/VRPopUp.js
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.VRPopUp
+ * @desc VRPopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/VRPopUp.js
+ * @version 1.0
+ */
+
+SDL.VRPopUp = Em.ContainerView.create( {
+
+ elementId: 'VRPopUp',
+
+ classNames: 'VRPopUp',
+
+ classNameBindings:
+ [
+ 'SDL.SDLModel.VRActive:active',
+ 'SDL.SDLModel.VRHelpListActivated:move'
+ ],
+
+ childViews:
+ [
+ 'popUp',
+ 'VRLabel',
+ 'VRImage',
+ 'listOfCommands'
+ ],
+
+ VRImage: Em.View.extend( {
+
+ elementId: 'VRImage',
+
+ classNames: 'VRImage'
+ } ),
+
+ VRLabel: SDL.Label.extend( {
+
+ elementId: 'VRLabel',
+
+ classNames: 'VRLabel',
+
+ content: 'Speak the command'
+ } ),
+
+ VRActiveBinding: 'SDL.SDLModel.VRActive',
+
+ popUp: Em.View.extend( {
+
+ elementId: 'popUp',
+
+ classNames: 'popUp'
+ } ),
+
+ AddCommand: function(cmdID, vrCommands, appID, type, grammarID) {
+
+ if (type == "Application") {
+ for( var i = 0; i < vrCommands.length; i++ ){
+ this.get( 'listOfCommands.list.childViews' ).pushObject( SDL.Button.create( {
+ action: 'onActivateSDLApp',
+ target: 'SDL.SDLController',
+ appID: appID,
+ text: vrCommands[i],
+ classNames: 'list-item',
+ templateName: 'text'
+ } ) );
+ }
+ } else {
+ for( var j = 0; j < vrCommands.length; j++ ){
+
+ this.get( 'listOfCommands.list.childViews' ).pushObject( SDL.Button.create( {
+ action: type == 'Command' ? 'onVRCommand' : 'VRPerformAction',
+ target: 'SDL.SDLAppController',
+ appID: appID,
+ grammarID: grammarID,
+ commandID: cmdID,
+ text: vrCommands[j],
+ type: type,
+ hideButtons: function() {
+ if (this.type == "Command" && SDL.SDLModel.performInteractionSession.length == 0) {
+ return false;
+ } else if (SDL.SDLModel.performInteractionSession && SDL.SDLModel.performInteractionSession.indexOf(this.grammarID) >= 0) {
+ return false;
+ } else {
+ return true;
+ }
+ }.property('SDL.SDLModel.performInteractionSession'),
+ classNameBindings: ['this.hideButtons:hide'],
+ classNames: 'list-item',
+ templateName: 'text'
+ } ) );
+ }
+ }
+ },
+
+ updateVR: function(){
+
+ this.listOfCommands.list.removeAllChildren();
+ this.listOfCommands.list.refresh();
+
+ var len = SDL.SDLModel.VRCommands.length;
+ for (var i = 0; i < len; i++) {
+ this.AddCommand(SDL.SDLModel.VRCommands[i].cmdID, SDL.SDLModel.VRCommands[i].vrCommands, SDL.SDLModel.VRCommands[i].appID, SDL.SDLModel.VRCommands[i].type);
+ }
+
+ if (SDL.SDLAppController.model) {
+
+ len = SDL.SDLAppController.model.VRCommands.length;
+ for (var i = 0; i < len; i++) {
+ this.AddCommand(SDL.SDLAppController.model.VRCommands[i].cmdID,
+ SDL.SDLAppController.model.VRCommands[i].vrCommands,
+ SDL.SDLAppController.model.VRCommands[i].appID,
+ SDL.SDLAppController.model.VRCommands[i].type,
+ SDL.SDLAppController.model.VRCommands[i].grammarID);
+ }
+ }
+
+ if (SDL.SDLModel.stateLimited) {
+ len = SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands.length;
+ for (var i = 0; i < len; i++) {
+ this.AddCommand(SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].cmdID,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].vrCommands,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].appID,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].type,
+ SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].grammarID);
+ }
+ }
+
+ }.observes('SDL.SDLAppController.model'),
+
+ DeleteCommand: function(commandID, appID) {
+
+ if (commandID != 0) {
+ var t = this.get('listOfCommands.list.childViews').filterProperty('commandID', commandID);
+ for (var i = 0; i < t.length; i++) {
+ t[i].remove();
+ t[i].destroy();
+ }
+ } else {
+ var t = this.get('listOfCommands.list.childViews').filterProperty('appID', appID);
+ for (var i = 0; i < t.length; i++) {
+ t[i].remove();
+ t[i].destroy();
+ }
+ }
+ },
+
+ DeleteActivateApp: function(appID) {
+
+ var t = this.get('listOfCommands.list.childViews').filterProperty('appID', appID);
+ for (var i = 0; i < t.length; i++) {
+ t[i].remove();
+ t[i].destroy();
+ }
+ },
+
+ /**
+ * List for option on SDLOptionsView screen
+ */
+ listOfCommands: SDL.List.extend( {
+
+ elementId: 'VR_list',
+
+ itemsOnPage: 5,
+
+ /** Items array */
+ items: [
+ {
+ type: SDL.Button,
+ params: {
+ //templateName: template,
+ text: 'Help',
+ target: 'SDL.SDLController',
+ action: 'vrHelpAction',
+ onDown: false
+ }
+ }
+ ]
+ } ),
+
+ // deactivate VR on change application state
+ onStateChange: function() {
+ if (this.VRActive) {
+ FFW.VR.Started();
+ this.set( 'VRActive', false );
+ } else {
+ FFW.VR.Stopped();
+ }
+ }.observes('SDL.TransitionIterator.ready'),
+
+ onActivate: function() {
+ SDL.SDLController.VRMove();
+ if (this.VRActive) {
+
+ FFW.VR.Started();
+ SDL.SDLController.onSystemContextChange();
+ } else {
+
+ FFW.VR.Stopped();
+ SDL.SDLController.onSystemContextChange();
+ }
+ }.observes('this.VRActive'),
+
+ /**
+ * This event triggered when component is placed to
+ * document DOM structure
+ */
+ didInsertElement: function() {
+ this._super();
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/VehicleInfoView.js b/src/components/HMI/app/view/sdl/VehicleInfoView.js
new file mode 100644
index 0000000000..a42efac4d4
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/VehicleInfoView.js
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.VehicleInfo
+ * @desc VehicleInfo module visual representation
+ * @category View
+ * @filesource app/view/sdl/VehicleInfo.js
+ * @version 1.0
+ */
+
+SDL.VehicleInfo = Em.ContainerView.create( {
+
+ elementId: 'VehicleInfo',
+
+ classNames: 'VehicleInfo',
+
+ classNameBindings:
+ [
+ 'active'
+ ],
+
+ childViews:
+ [
+ 'prndl',
+ 'vehicleInfoLabel',
+ 'prndlSelect',
+ 'ecu1Title',
+ 'ecu1',
+ 'ecu2',
+ 'ecu1Data',
+ 'ecu2Data',
+ 'odometrTitle',
+ 'odometrInput'
+ ],
+
+ /**
+ * Title of odometr group of parameters stored data in VehicleInfo model
+ */
+ odometrTitle: SDL.Label.extend( {
+
+ elementId: 'odometrTitle',
+
+ classNames: 'odometrTitle',
+
+ content: 'Odometr'
+ } ),
+
+ /**
+ * Input for odometr value changes
+ */
+ odometrInput: Ember.TextField.extend({
+ elementId: "odometrInput",
+ classNames: "odometrInput",
+ keyUp: function(event, view) {
+ if(event.which == 13){
+ SDL.SDLVehicleInfoModel.set('odometrInput', parseInt(this.value));
+ }
+ }
+ }),
+
+ /**
+ * Label with stored data in VehicleInfo model
+ */
+ ecu2Data: SDL.Label.extend( {
+
+ elementId: 'ecu2Data',
+
+ classNames: 'ecu2Data',
+
+ contentBinding: 'SDL.SDLVehicleInfoModel.ecuDIDData.1.data'
+ } ),
+
+ /**
+ * Label with stored data in VehicleInfo model
+ */
+ ecu1Data: SDL.Label.extend( {
+
+ elementId: 'ecu1Data',
+
+ classNames: 'ecu1Data',
+
+ contentBinding: 'SDL.SDLVehicleInfoModel.ecuDIDData.0.data'
+ } ),
+
+ /**
+ * Label with name of some parameter stored data in VehicleInfo model
+ */
+ ecu2: SDL.Label.extend( {
+
+ elementId: 'ecu2',
+
+ classNames: 'ecu2',
+
+ content: 'ECU 2:'
+ } ),
+
+ /**
+ * Label with name of some parameter stored data in VehicleInfo model
+ */
+ ecu1: SDL.Label.extend( {
+
+ elementId: 'ecu1',
+
+ classNames: 'ecu1',
+
+ content: 'ECU 1:'
+ } ),
+
+ /**
+ * Title of ecu group of parameters stored data in VehicleInfo model
+ */
+ ecu1Title: SDL.Label.extend( {
+
+ elementId: 'ecu1Title',
+
+ classNames: 'ecu1Title',
+
+ content: 'ECU'
+ } ),
+
+ /**
+ * Title of VehicleInfo PopUp view
+ */
+ vehicleInfoLabel: SDL.Label.extend( {
+
+ elementId: 'vehicleInfoLabel',
+
+ classNames: 'vehicleInfoLabel',
+
+ content: 'Vehicle Information'
+ } ),
+
+ /**
+ * Property indicates the activity state of VehicleInfo PopUp
+ */
+ active: false,
+
+ /**
+ * Title of prndl group of parameters stored in VehicleInfo model
+ */
+ prndl: SDL.Label.extend( {
+
+ elementId: 'prndl',
+
+ classNames: 'prndl',
+
+ content: 'PRNDL'
+ } ),
+
+ /**
+ * HMI element Select with parameters of transmission state from VehicleInfo
+ * Model
+ */
+ prndlSelect: Em.Select.extend( {
+
+ elementId: 'prndlSelect',
+
+ classNames: 'prndlSelect',
+
+ contentBinding: 'SDL.SDLVehicleInfoModel.vehicleInfoPRNDL',
+
+ valueBinding: 'SDL.SDLVehicleInfoModel.prndlSelectState'
+ } ),
+
+ /**
+ * Trigger function that activates and deactivates VehicleInfo PopUp
+ */
+ toggleActivity: function() {
+ this.set( 'active', !this.active );
+ },
+
+ /**
+ * This event triggered when component is placed to
+ * document DOM structure
+ */
+ didInsertElement: function() {
+ this._super();
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/driverDistraction.js b/src/components/HMI/app/view/sdl/driverDistraction.js
new file mode 100644
index 0000000000..e2f57105c7
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/driverDistraction.js
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DriverDistraction
+ * @desc DriverDistractionPopUp module visual representation
+ * @category View
+ * @filesource app/view/sdl/driverDistraction.js
+ * @version 1.0
+ */
+
+SDL.DriverDistraction = Em.ContainerView.create( {
+
+ elementId: 'driverDistraction',
+
+ classNames: 'driverDistractionWindow',
+
+ classNameBindings:
+ [
+ 'active'
+ ],
+
+ childViews:
+ [
+ 'driverDistractionPopUp',
+ 'driverDistractionText'
+ ],
+
+ content: 'Not accessible while driving',
+
+ active: false,
+
+ driverDistractionPopUp: Em.View.create( {
+
+ classNames: 'driverDistraction'
+ } ),
+
+ driverDistractionText: SDL.Label.extend( {
+
+ elementId: 'driverDistractionText',
+
+ classNames: 'driverDistractionText',
+
+ contentBinding: 'parentView.content'
+ } ),
+
+ activate: function() {
+ this.set( 'active', true );
+ setTimeout( function() {
+ SDL.DriverDistraction.deactivate();
+ }, 3000 );
+
+ SDL.SDLController.onSystemContextChange();
+ },
+
+ deactivate: function() {
+ this.set( 'active', false );
+
+ SDL.SDLController.onSystemContextChange();
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/shared/AbstractView.js b/src/components/HMI/app/view/sdl/shared/AbstractView.js
new file mode 100644
index 0000000000..0294c17732
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/AbstractView.js
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLAbstractView
+ * @desc SDL application abstract shared view
+ * @category View
+ * @filesource app/view/sdl/shared/AbstractView.js
+ * @version 1.0
+ */
+
+SDL.SDLAbstractView = Em.ContainerView.extend( {
+
+ classNames:
+ [
+ 'sdl-window'
+ ],
+
+ classNameBindings:
+ [
+ 'active:active_state:inactive_state'
+ ],
+
+ active: false,
+
+ caption: 'Caption Text',
+
+ /**
+ * Activate window and set caption text
+ *
+ * @param text: String
+ */
+ activate: function( text ) {
+ if( text ){
+ this.set( 'caption', text );
+ }
+ this.set( 'active', true );
+ },
+
+ /**
+ * Deactivate window
+ */
+ deactivate: function() {
+ this.set( 'active', false );
+ },
+
+ onStateChange: function() {
+ if( this.active ){
+ this.deactivate();
+ }
+ }.observes( 'SDL.TransitionIterator.ready' ),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'back-button'
+ ],
+ target: 'this.parentView',
+ action: 'deactivate',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } ),
+
+ captionText: SDL.Label.extend( {
+ classNames:
+ [
+ 'caption-text'
+ ],
+
+ contentBinding: 'this.parentView.caption'
+ } )
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
new file mode 100644
index 0000000000..d01165dd14
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
@@ -0,0 +1,391 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.InteractionChoicesView
+ * @desc Interaction Choices visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/interactionChoicesView.js
+ * @version 1.0
+ */
+
+SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
+
+ elementId: 'perform_interaction_view',
+
+ childViews: [
+ 'backButton',
+ 'captionText',
+ 'listOfChoices',
+ 'input',
+ 'listWrapper'
+ ],
+
+ didInsertElement: function(){
+
+ SDL.SDLModel.interactionListWrapper = new iScroll('listWrapper', { hideScrollbar:false, hScrollbar: true, vScrollbar: true, hScroll: true, vScroll: true });
+ },
+
+ backButton: SDL.Button.extend({
+ classNames: [
+ 'back-button'
+ ],
+ target: 'SDL.SDLController',
+ action: 'InteractionChoicesDeactivate',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ }),
+
+ input: Ember.TextArea.extend({
+ classNameBindings: ['this.parentView.search::hide'],
+ tagName: 'input',
+ attribute: ['type:text'],
+ attributeBindings: ['disabled'],
+ disabled: false,
+ click: function(){
+ SDL.SDLModel.uiShowKeyboard(this);
+ },
+ search: function(){
+ FFW.UI.OnKeyboardInput(SDL.SDLModel.keyboardInputValue, "ENTRY_SUBMITTED");
+ this.get('parentView').deactivate("SUCCESS");
+ }
+ }),
+
+ listWrapper: Em.ContainerView.extend({
+
+ classNameBindings: ['this.parentView.icon::hide'],
+
+ elementId: 'listWrapper',
+
+ classNames: 'listWrapper',
+
+ childViews: [
+ 'naviChoises'
+ ],
+
+ click: function() {
+ SDL.InteractionChoicesView.timerUpdate();
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ },
+
+ naviChoises: Em.ContainerView.extend({
+ classNames: 'naviChoises',
+ childViews: [
+ 'captionText'
+ ],
+
+ captionText: SDL.Label.extend({
+
+ classNameBindings: ['this.parentView.search:hide'],
+ classNames: ['caption-text'],
+ contentBinding: 'this.parentView.caption'
+ })
+
+ })
+ }),
+
+ captionText: SDL.Label.extend({
+
+ classNameBindings: ['this.parentView.search:hide'],
+ classNames: ['caption-text'],
+ contentBinding: 'this.parentView.caption'
+ }),
+
+ listOfChoices: SDL.List.extend({
+ classNameBindings: ['this.parentView.list::hide'],
+ elementId: 'perform_interaction_view_list',
+ itemsOnPage: 5,
+ items: [],
+ click: function() {
+ SDL.InteractionChoicesView.timerUpdate();
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ }
+ }),
+
+ timer: null,
+
+ timeout: null,
+
+ search: false,
+
+ list: false,
+
+ icon: false,
+
+ /**
+ * Id of app initiated performInteraction request
+ */
+ appID: null,
+
+ /**
+ * Method updates popup timer when data changes through keyboard
+ */
+ timerUpdate: function (){
+ if (this.timeout && this.input.value !== null) {
+ clearTimeout(this.timer);
+ var self = this;
+ this.timer = setTimeout(function () {
+
+ self.deactivate("TIMED_OUT");
+ }, this.timeout);
+ }
+ }.observes('this.input.value'),
+
+ /**
+ * Activate window and set caption text
+ *
+ * @param text: String
+ */
+ activate: function (message) {
+
+ this.clean();
+
+ if (message.params && message.params.initialText) {
+ this.set('caption', message.params.initialText.fieldText);
+ }
+
+ this.appID = message.params.appID;
+
+ if (message.params.interactionLayout) {
+
+ switch (message.params.interactionLayout) {
+ case "ICON_ONLY" : {
+
+ this.preformChoicesNavigation(message.params.choiceSet, message.params.timeout);
+
+
+ this.set('search', false);
+ this.set('list', false);
+ this.set('icon', true);
+ this.set('active', true);
+ break;
+ }
+ case "ICON_WITH_SEARCH" : {
+
+ this.preformChoicesNavigation(message.params.choiceSet, message.params.timeout);
+
+ this.set('icon', true);
+ this.set('search', true);
+ this.set('list', false);
+ this.set('active', true);
+ break;
+ }
+ case "LIST_ONLY" : {
+
+ this.preformChoices(message.params.choiceSet, message.params.timeout);
+
+ this.set('list', true);
+ this.set('icon', false);
+ this.set('search', false);
+ this.set('active', true);
+ break;
+ }
+ case "LIST_WITH_SEARCH" : {
+
+ this.preformChoices(message.params.choiceSet, message.params.timeout);
+
+ this.set('list', true);
+ this.set('search', true);
+ this.set('icon', false);
+ this.set('active', true);
+ break;
+ }
+ case "KEYBOARD" : {
+ this.preformChoices(null, message.params.timeout);
+ SDL.SDLModel.uiShowKeyboard(this.input);
+
+
+ this.set('list', false);
+ this.set('search', false);
+ this.set('icon', false);
+ // this.set('active', true);
+
+ break;
+ }
+ default:
+ {
+ // default action
+ }
+ }
+ } else {
+
+ if (message.params.choiceSet) {
+ this.preformChoices(message.params.choiceSet, message.params.timeout);
+
+ this.set('list', true);
+ this.set('icon', false);
+ this.set('search', false);
+ this.set('active', true);
+ } else {
+
+ this.timer = setTimeout(function () {
+ SDL.InteractionChoicesView.deactivate("TIMED_OUT");
+ }, message.params.timeout);
+ }
+ }
+
+ },
+
+ /**
+ * Deactivate window
+ */
+ deactivate: function (result, choiceID) {
+
+ if (SDL.SDLModel.performInteractionSession.length > 0 && result != "ABORTED") {
+ this.timerUpdate();
+ } else {
+
+ clearTimeout(this.timer);
+ this.timer = null;
+ this.set('active', false);
+ SDL.SDLController.VRMove();
+ SDL.Keyboard.deactivate();
+
+ switch (result) {
+ case "ABORTED":
+ {
+ SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["ABORTED"]);
+ break;
+ }
+ case "TIMED_OUT":
+ {
+ SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["TIMED_OUT"]);
+ break;
+ }
+ case "SUCCESS":
+ {
+ SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["SUCCESS"], choiceID, this.input.value);
+ break;
+ }
+ default:
+ {
+ // default action
+ }
+ }
+
+ this.appID = null;
+
+ SDL.SDLController.onSystemContextChange();
+ }
+ },
+
+ /**
+ * Clean choices caption and list before new proform
+ */
+ clean: function () {
+
+ this.input.set('value', null);
+ this.set('captionText.content', 'Interaction Choices');
+ this.set('timeout', null);
+ this.listOfChoices.items = [];
+ this.listOfChoices.list.refresh();
+ var length = this.get('listWrapper.naviChoises.childViews').length;
+ for (var i=0; i < length; i++) {
+ SDL.InteractionChoicesView.get('listWrapper.naviChoises.childViews').shiftObject();
+ }
+ },
+
+ /**
+ * Update choises list with actual set id
+ *
+ * @param data:
+ * Array
+ */
+ preformChoices: function (data, timeout) {
+
+ this.set('timeout', timeout);
+
+ if (data) {
+
+ // temp for testing
+ for (var i = 0; i < data.length; i++) {
+ this.listOfChoices.items
+ .push({
+ type: SDL.Button,
+ params: {
+ text: data[i].menuName,
+ choiceID: data[i].choiceID,
+ action: 'onChoiceInteraction',
+ onDown: false,
+ target: 'SDL.SDLAppController',
+ templateName: data[i].image ? 'rightIcon' : 'text',
+ icon: data[i].image ? data[i].image.value : null
+ }
+ });
+ }
+
+ this.listOfChoices.list.refresh();
+ }
+
+ var self = this;
+
+ clearTimeout(this.timer);
+ this.timer = setTimeout(function () {
+
+ self.deactivate("TIMED_OUT");
+ }, timeout);
+ },
+
+ /**
+ * Update choises list with actual set id
+ *
+ * @param data:
+ * Array
+ */
+ preformChoicesNavigation: function (data, timeout) {
+
+ this.set('timeout', timeout);
+
+ if (data) {
+
+ // temp for testing
+ for (var i = 0; i < data.length; i++) {
+ this.get('listWrapper.naviChoises.childViews').pushObject(SDL.Button.create({
+ text: data[i].menuName,
+ choiceID: data[i].choiceID,
+ action: 'onChoiceInteraction',
+ onDown: false,
+ target: 'SDL.SDLAppController',
+ templateName: data[i].image ? 'rightIcon' : 'text',
+ icon: data[i].image ? data[i].image.value : null
+ })
+ );
+ }
+
+ }
+
+ var self = this;
+
+ setTimeout(function(){
+
+ SDL.SDLModel.interactionListWrapper.refresh();
+ }, 0);
+
+ clearTimeout(this.timer);
+ this.timer = setTimeout(function () {
+ self.deactivate("TIMED_OUT");
+ }, timeout);
+ }
+});
diff --git a/src/components/HMI/app/view/sdl/shared/keyboard.js b/src/components/HMI/app/view/sdl/shared/keyboard.js
new file mode 100644
index 0000000000..e47cc5956a
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/keyboard.js
@@ -0,0 +1,297 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.Keyboard
+ * @desc Slider visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/keyboard.js
+ * @version 1.0
+ */
+
+SDL.Keyboard = SDL.SDLAbstractView.create({
+
+ elementId: 'keyboard_view',
+
+ childViews: [
+ 'backButton',
+ 'microphone',
+ 'searchBar',
+ 'controlls',
+ 'buttonsAreaQWERTY',
+ 'buttonsAreaQWERTZ',
+ 'buttonsAreaAZERTY'
+ ],
+
+ /**
+ * Activate keyboard method
+ *
+ * @param {Object}
+ */
+ activate: function( element ) {
+ if( element.tagName === 'input' ){
+
+ this.set( 'active', true );
+ this.set('target', element);
+ }
+ },
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'back-button'
+ ],
+ action: function() {
+
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.uiPerformInteraction && !SDL.InteractionChoicesView.active) {
+ FFW.UI.OnKeyboardInput("", "ENTRY_CANCELLED");
+ SDL.InteractionChoicesView.deactivate("ABORTED");
+ }
+ SDL.Keyboard.deactivate();
+ },
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } ),
+
+ /**
+ * Extend deactivate method send SUCCESS response on deactivate with current
+ * slider value
+ */
+ deactivate: function () {
+
+ this._super();
+ this.searchBar.input.set('value', null);
+ this.set('target', null);
+ },
+
+ inputChanges: function (element) {
+
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.uiPerformInteraction) {
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ }
+
+ if (this.searchBar.input.value == null) {
+ this.searchBar.input.set('value', "");
+ }
+
+ switch (element.text) {
+ case "Space": {
+ this.searchBar.input.set('value', this.searchBar.input.value + " ");
+ this.target.set('value', this.searchBar.input.value);
+ break;
+ }
+ case "Search": {
+ if (this.target.value == null) {
+ this.target.set('value', "");
+ }
+ this.target.search();
+ this.deactivate();
+ break;
+ }
+ default:{
+ this.searchBar.input.set('value', this.searchBar.input.value + element.text);
+ this.target.set('value', this.searchBar.input.value);
+ }
+
+ }
+ },
+
+ clearBtn: function (element) {
+ this.searchBar.input.set('value', this.searchBar.input.value.slice(0, -1));
+ this.target.set('value', this.searchBar.input.value);
+ if (this.searchBar.input.value == "") {
+ FFW.UI.OnKeyboardInput("", "ENTRY_CANCELLED");
+ }
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
+ },
+
+ /**
+ * Tearget element that initiated keyboard
+ */
+ target: null,
+
+ microphone: SDL.Button.extend({
+ classNames: 'microphone',
+ text: 'mic'
+ }),
+
+ searchBar: Em.ContainerView.extend({
+
+ classNames: 'searchBar',
+
+ childViews: [
+ 'input',
+ 'clearBtn',
+ 'serchIcon'
+ ],
+
+ clearBtn: SDL.Button.extend({
+ classNames: 'clearBtn',
+ text: 'X',
+ action: 'clearBtn',
+ target: 'parentView.parentView'
+ }),
+
+ serchIcon: Em.View.extend({
+ classNames: 'serchIcon'
+ }),
+
+ input: Ember.TextField.extend({
+ elementId: "keyboardInput",
+ classNames: "keyboardInput",
+ valueBinding: 'SDL.SDLModel.keyboardInputValue'
+ })
+
+ }),
+
+ controlls: Em.ContainerView.extend({
+
+ classNames: 'controlls',
+
+ childViews: [
+ 'numericBtn',
+ 'symbolBtn',
+ 'spaceBtn',
+ 'caseSwitchBtn',
+ 'localisationBtn',
+ 'searchBtn'
+ ],
+
+ numericBtn: SDL.Button.extend({
+ classNames: 'numericBtn controll',
+ text: '123'
+ }),
+
+ symbolBtn: SDL.Button.extend({
+ classNames: 'symbolBtn controll',
+ text: '!@#'
+ }),
+
+ spaceBtn: SDL.Button.extend({
+ classNames: 'spaceBtn controll',
+ text: 'Space',
+ target : 'parentView.parentView',
+ action : 'inputChanges'
+ }),
+
+ caseSwitchBtn: SDL.Button.extend({
+ classNames: 'caseSwitchBtn controll',
+ text: 'ABC'
+ }),
+
+ localisationBtn: SDL.Button.extend({
+ classNames: 'localisationBtn controll',
+ icon: 'images/info/info_leftMenu_apps_ico.png'
+ }),
+
+ searchBtn: SDL.Button.extend(SDL.PresetEvents, {
+ classNames: 'searchBtn controll',
+ text: 'Search',
+ click: function(){
+ this.get('parentView.parentView').inputChanges(this);
+ },
+ presetName: 'SEARCH'
+ })
+ }),
+
+ disableButtons: function(){
+
+ if (SDL.SDLAppController.model) {
+ if (!SDL.SDLAppController.model.globalProperties.keyboardProperties) {
+ return;
+ }
+ var list = SDL.SDLAppController.model.globalProperties.keyboardProperties.limitedCharacterList ? SDL.SDLAppController.model.globalProperties.keyboardProperties.limitedCharacterList : [];
+
+ for (var i = 0; i < list.length; i++) {
+ list[i] = list[i].toLowerCase();
+ }
+
+ if (SDL.SDLAppController.model && list.length){
+
+ for (var i = 0; i < this.buttonsAreaQWERTY._childViews.length; i++) {
+
+ if (list.indexOf(this.buttonsAreaQWERTY._childViews[i].text) < 0) {
+ this.buttonsAreaQWERTY._childViews[i].set('disabled', true);
+ this.buttonsAreaQWERTZ._childViews[i].set('disabled', true);
+ this.buttonsAreaAZERTY._childViews[i].set('disabled', true);
+ } else {
+ this.buttonsAreaQWERTY._childViews[i].set('disabled', false);
+ this.buttonsAreaQWERTZ._childViews[i].set('disabled', false);
+ this.buttonsAreaAZERTY._childViews[i].set('disabled', false);
+ }
+ }
+ } else if (SDL.SDLAppController.model && !list.length) {
+ for (var i = 0; i < this.buttonsAreaQWERTY._childViews.length; i++) {
+ this.buttonsAreaQWERTY._childViews[i].set('disabled', false);
+ }
+ }
+ }
+
+ }.observes('SDL.SDLAppController.model.globalProperties.keyboardProperties.limitedCharacterList.@each'),
+
+ buttonsAreaQWERTY: SDL.QWERTYLayout.create({
+
+ classNameBindings: 'this.pQWERTY::hide',
+
+ pQWERTY: function(){
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout == "QWERTY") {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout')
+
+ }),
+
+ buttonsAreaQWERTZ: SDL.QWERTZLayout.create({
+
+ classNameBindings: 'this.pQWERTZ::hide',
+
+ pQWERTZ: function(){
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout == "QWERTZ") {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout')
+
+ }),
+
+ buttonsAreaAZERTY: SDL.AZERTYLayout.create({
+
+ classNameBindings: 'this.pAZERTY::hide',
+
+ pAZERTY: function(){
+ if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout == "AZERTY") {
+ return true;
+ } else {
+ return false;
+ }
+ }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout')
+
+ })
+
+});
diff --git a/src/components/HMI/app/view/sdl/shared/optionsView.js b/src/components/HMI/app/view/sdl/shared/optionsView.js
new file mode 100644
index 0000000000..a4858255a5
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/optionsView.js
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.OptionsView
+ * @desc Options visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/optionsView.js
+ * @version 1.0
+ */
+
+SDL.OptionsView = SDL.SDLAbstractView.create({
+
+ elementId: 'sdl_options',
+
+ childViews:
+ [
+ 'backButton',
+ 'captionText',
+ 'commands'
+ ],
+
+ // Menu caption text
+ captionBinding: 'SDL.SDLAppController.model.currentSubMenuLabel',
+
+ commands: SDL.List.extend({
+
+ elementId: 'info_nonMedia_options_list',
+
+ itemsOnPage: 5,
+
+ items: [],
+
+ /*
+ * itemsDefault: [ { type: SDL.Button,
+ *
+ * params: { templateName: 'text', text: 'Exit', target:
+ * 'this.parentView.parentView.parentView', action: 'deactivate',
+ * onDown: false } }, { type: SDL.Button,
+ *
+ * params: { templateName: 'arrow', text: 'Device Information', } } ],
+ */
+
+ refreshItems: function() {
+
+ if (SDL.SDLAppController.model) {
+
+ var commands = SDL.SDLAppController.model.get('currentCommandsList'),
+ i,
+ len,
+ template;
+
+ this.items = [];
+
+ len = commands.length;
+
+ for(i = 0; i < len; i++){
+
+ if(commands[i].menuID >= 0){
+ template = 'arrow';
+ }else{
+ template = commands[i].icon ? 'rightText' : 'text';
+ }
+
+ this.items.push({
+ type: SDL.Button,
+ params: {
+ templateName: template,
+ text: commands[i].name,
+ commandID: commands[i].commandID,
+ menuID: commands[i].menuID,
+ icon: commands[i].icon,
+ target: 'SDL.SDLAppController',
+ action: 'onCommand',
+ onDown: false
+ }
+ })
+ }
+
+ this.list.refresh();
+ }
+
+ }.observes('SDL.SDLAppController.model.currentSubMenuId', 'SDL.SDLAppController.model.currentCommandsList.@each')
+ }),
+
+ activate: function(text) {
+ this._super();
+
+ SDL.SDLAppController.buttonsSort('top', SDL.SDLAppController.model.appID);
+ SDL.OptionsView.commands.refreshItems();
+
+ SDL.SDLController.onSystemContextChange();
+ },
+
+ // Extend deactivate window
+ deactivate: function() {
+
+ if (SDL.SDLAppController.model) {
+
+ if (SDL.SDLAppController.model.get('currentSubMenuId') >= 0) {
+ SDL.SDLAppController.onSubMenu('top');
+ }else{
+ this._super();
+ SDL.SDLController.onSystemContextChange();
+ }
+ }
+
+ }
+});
diff --git a/src/components/HMI/app/view/sdl/shared/scrollableMessage.js b/src/components/HMI/app/view/sdl/shared/scrollableMessage.js
new file mode 100644
index 0000000000..3c42378749
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/scrollableMessage.js
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.ScrollableMessage
+ * @desc ScrollableMessage module visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/scrollableMessage.js
+ * @version 1.0
+ */
+
+SDL.ScrollableMessage = SDL.SDLAbstractView.create({
+
+ elementId: 'ScrollableMessage',
+
+ classNames: 'ScrollableMessage',
+
+ classNameBindings: [
+ 'active:active'
+ ],
+
+ /**
+ * Id of current request
+ *
+ * @type {Number}
+ */
+ messageRequestId: null,
+
+ active: false,
+
+ appID: null,
+
+ timer: null,
+
+ timeout: null,
+
+ childViews: [
+ 'backButton', 'captionText', 'softButtons', 'listOfCommands'
+ ],
+
+ /**
+ * Deactivate View
+ *
+ * @param {Object} ABORTED Parameter to indicate status for
+ * UI.ScrollableMessageResponse
+ */
+ deactivate: function (ABORTED) {
+ clearTimeout(this.timer);
+ this.set('active', false);
+ this.softButtons.set('page', 0);
+
+ this.timeout = null;
+
+ SDL.SDLController.scrollableMessageResponse(ABORTED ? SDL.SDLModel.resultCode['ABORTED'] : SDL.SDLModel.resultCode['SUCCESS'], this.messageRequestId);
+
+ SDL.SDLController.onSystemContextChange();
+ },
+
+ activate: function (appName, params, messageRequestId) {
+ if (appName) {
+
+ var self = this;
+
+ if (params.messageText.fieldName == 'scrollableMessageBody') {
+ this.set('listOfCommands.items', params.messageText.fieldText);
+ }
+
+ this.set('messageRequestId', messageRequestId);
+ this.set('captionText.content', appName);
+ this.softButtons.addItems(params.softButtons, params.appID);
+ this.set('active', true);
+ clearTimeout(this.timer);
+ this.timeout = params.timeout;
+ this.timer = setTimeout(function () {
+ self.deactivate();
+ }, params.timeout);
+ }
+ },
+
+ softButtons: SDL.MenuList.extend({
+
+ itemsOnPage: 4,
+
+ groupName: "ScrollableMessage",
+
+ content: Em.ContainerView.extend({
+
+ classNames: [
+ 'content'
+ ],
+
+ attributeBindings: [
+ 'parentView.contentPositon:style'
+ ]
+
+ })
+ }),
+
+ /**
+ * List for option on SDLOptionsView screen
+ */
+ listOfCommands: SDL.ScrollableText.extend({
+
+ elementId: 'scrollable_message_list',
+
+ itemsOnPage: 11,
+
+ /** Items array */
+ items: 'asdasdasd',
+
+ /**
+ * Reset timeout function
+ */
+ click: function(){
+
+ var self = this._parentView;
+
+ clearTimeout(this._parentView.timer);
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.ScrollableMessage");
+ this._parentView.timer = setTimeout(function () {
+ self.deactivate();
+ }, this._parentView.timeout);
+ }
+ })
+});
diff --git a/src/components/HMI/app/view/sdl/shared/sliderView.js b/src/components/HMI/app/view/sdl/shared/sliderView.js
new file mode 100644
index 0000000000..033ab5ab91
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/sliderView.js
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SliderView
+ * @desc Slider visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/sliderView.js
+ * @version 1.0
+ */
+
+SDL.SliderView = SDL.SDLAbstractView.create( {
+
+ elementId: 'slider_view',
+
+ childViews:
+ [
+ 'backButton',
+ 'okButton',
+ 'captionText',
+ 'headerLabel',
+ 'footerLabel',
+ 'adjustControl'
+ ],
+
+ headerLabel: SDL.Label.extend( {
+ classNames: 'slider-header',
+ content: 'Header Label'
+ } ),
+
+ footerLabel: SDL.Label.extend( {
+ classNames: 'slider-footer',
+ content: 'Footer Label',
+ data: []
+ } ),
+
+ /**
+ * Identifier of current request
+ */
+ sliderRequestId: null,
+
+ timer: null,
+
+ timeout: null,
+
+ /**
+ * Extend deactivate method send SUCCESS response on deactivate with current
+ * slider value
+ */
+ deactivate: function(timeout) {
+ this._super();
+ this.timeout = null;
+ clearTimeout(this.timer);
+ this.timer = null;
+
+ if (timeout === true) {
+ FFW.UI.sendSliderResult(SDL.SDLModel.resultCode["TIMED_OUT"], this.get('sliderRequestId'));
+ } else if (timeout === false) {
+ FFW.UI.sendSliderResult(SDL.SDLModel.resultCode["SUCCESS"], this.get('sliderRequestId'), this.get('adjustControl.sliderValue.value'));
+ } else {
+ FFW.UI.sendSliderResult(SDL.SDLModel.resultCode["ABORTED"], this.get('sliderRequestId'), this.get('adjustControl.sliderValue.value'));
+ }
+
+ SDL.SDLController.onSystemContextChange();
+ },
+
+ activate: function(text, timeout) {
+ if( text ){
+ this.set( 'caption', text );
+ }
+
+ this.set( 'active', true );
+
+ this.set('timeout', timeout);
+
+ this.timer = setTimeout(function () {
+ if (SDL.SliderView.active) {
+ SDL.SliderView.deactivate(true);
+ }
+ }, timeout);
+ },
+
+ dataChange: function(){
+ if (this.timeout){
+ var self = this;
+
+ clearTimeout(this.timer);
+ SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.Slider");
+ this.timer = setTimeout(function () {
+ self.deactivate(true);
+ }, this.timeout);
+ }
+ }.observes('this.adjustControl.sliderValue.value'),
+
+ okButton: SDL.Button.extend( {
+ classNames: 'okButton',
+ text: 'Submit',
+ onDown: false,
+ click: function() {
+ SDL.SliderView.deactivate(false);
+ }
+ } ),
+
+ adjustControl: Em.ContainerView.extend( {
+
+ classNames: 'sliderControl',
+
+ childViews:
+ [
+ 'minusBtn',
+ 'led',
+ 'plusBtn'
+ ],
+
+ sliderValue: Em.Object.create( {
+ range: 10,
+ value: 0
+ } ),
+
+ minusBtn: SDL.Button.extend( {
+ classNames: 'control minus',
+ icon: 'images/common/minus-ico.png',
+ actionDown: function() {
+ this._super();
+ if (this._parentView.sliderValue.value > 1) {
+ this.set( 'parentView.sliderValue.value', this._parentView.sliderValue.value - 1 );
+ }
+ }
+ } ),
+
+ led: SDL.Indicator.create( {
+ classNames: 'ledContainer ico',
+ contentBinding: 'parentView.sliderValue',
+ indActiveClass: 'led',
+ indDefaultClass: 'led-inactive'
+ } ),
+
+ plusBtn: SDL.Button.extend( {
+ classNames: 'control plus',
+ icon: 'images/common/plus-ico.png',
+ actionDown: function() {
+ this._super();
+ if (this._parentView.sliderValue.value < this._parentView.sliderValue.range) {
+ this.set( 'parentView.sliderValue.value', this._parentView.sliderValue.value + 1 );
+ }
+ }
+ } )
+ } ),
+
+ loadData: function( message ) {
+
+ var data = message.params;
+
+ this.set( 'sliderRequestId', message.id );
+
+ this.set( 'headerLabel.content', data.sliderHeader );
+ this.get( 'adjustControl.sliderValue' ).set( 'range', data.numTicks );
+ this.get( 'adjustControl.sliderValue' ).set( 'value', data.position );
+
+ setTimeout( function() {
+ SDL.SliderView.adjustControl.rerender();
+ }, 1 );
+
+ if (!data.sliderFooter) {
+ this.set('footerLabel.content', '');
+ return;
+ }
+
+ this.footerLabel.data = data.sliderFooter;
+
+ if (data.sliderFooter.length != data.numTicks) {
+ this.set( 'footerLabel.content', data.sliderFooter[0] );
+ } else {
+ // Magick number is array index correction
+ this.set( 'footerLabel.content', data.sliderFooter[data.position - 1] );
+ }
+ },
+
+ /**
+ * Change footer text depends on current slider position works only for
+ * dynamic footer mode
+ */
+ changeFooterText: function() {
+ if( this.footerLabel.data && this.footerLabel.data.length > 1 ){
+ this.set( 'footerLabel.content', this.footerLabel.data[this.adjustControl.sliderValue.value - 1] );
+ }
+ }.observes( 'adjustControl.sliderValue.value' )
+} );
diff --git a/src/components/HMI/app/view/sdl/shared/tbtTurnList.js b/src/components/HMI/app/view/sdl/shared/tbtTurnList.js
new file mode 100644
index 0000000000..6c5a5588c5
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/tbtTurnList.js
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.TBTTurnList
+ * @desc TBT Turn List visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/tbtTurnList.js
+ * @version 1.0
+ */
+
+SDL.TBTTurnList = SDL.SDLAbstractView.create({
+
+ elementId: 'tbtTurnListView',
+
+ childViews: [
+ 'backButton',
+ 'captionText',
+ 'tbtTurnListList'
+ ],
+
+ /**
+ * Activate window
+ */
+ activate: function (appID) {
+
+ this.set('active', true);
+ this.updateList(appID);
+ },
+
+ /**
+ * Deactivate window if TurnByTurnView window was closed
+ */
+ closeTurnList: function () {
+
+ if (!SDL.TurnByTurnView.get('activeTBT')) {
+ this.set('active', false);
+ }
+ }.observes('SDL.TurnByTurnView.activeTBT'),
+
+ /**
+ * Title Labes of window
+ */
+ captionText: SDL.Label.extend({
+ classNames: 'caption-text',
+
+ content: 'Turn List'
+ }),
+
+ /**
+ * Turn List
+ */
+ tbtTurnListList: SDL.List.extend({
+ elementId : 'tbtTurnListList',
+ itemsOnPage: 5,
+ items : []
+ }),
+
+ /**
+ * Function updates content of Turn List with data from application's
+ * model
+ *
+ * @type {Number}
+ */
+ updateList: function (appID) {
+
+ this.get('tbtTurnListList.list').removeAllChildren();
+
+ this.tbtTurnListList.list.refresh();
+
+ var turnListArray = SDL.SDLController.getApplicationModel(appID).turnList,
+ length = turnListArray.length;
+ for (var i = 0; i < length; i++) {
+ this.get('tbtTurnListList.list.childViews').pushObject(SDL.Label.create({
+ icon : turnListArray[i].turnIcon ? turnListArray[i].turnIcon.value : "",
+ content : turnListArray[i].navigationText ? turnListArray[i].navigationText.fieldText : "",
+ classNames : 'list-item',
+ templateName: turnListArray[i].turnIcon ? 'icon' : ''
+ }));
+ }
+
+ turnListArray = SDL.SDLController.getApplicationModel(appID).turnListSoftButtons;
+ length = turnListArray.length;
+
+ for (var i = 0; i < length; i++) {
+ this.get('tbtTurnListList.list.childViews').pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
+ systemAction : turnListArray[i].systemAction,
+ groupName : "TBTList",
+ classNameBindings: [
+ 'isHighlighted:isHighlighted'
+ ],
+ isHighlighted : turnListArray[i].isHighlighted ? true : false,
+ softButtonID : turnListArray[i].softButtonID,
+ icon : turnListArray[i].image ? turnListArray[i].image.value : "",
+ text : turnListArray[i].text,
+ classNames : 'list-item softButton',
+ elementId : 'softButton' + i,
+ templateName : turnListArray[i].image ? 'rightIcon' : 'text',
+ appID : appID
+ }));
+ }
+ }
+ });
diff --git a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
new file mode 100644
index 0000000000..21d51ca6b1
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.TurnByTurnView
+ * @desc TurnByTurnView module visual representation
+ * @category View
+ * @filesource app/view/sdl/shared/turnByTurnView.js
+ * @version 1.0
+ */
+
+SDL.TurnByTurnView = SDL.SDLAbstractView.create( {
+
+ elementId: 'TurnByTurnView',
+
+ classNames: 'TurnByTurnView',
+
+ classNameBindings: [
+ 'activeTBT:active_state:inactive_state'
+ ],
+
+ active: false,
+
+ activeTBT: false,
+
+ childViews: [
+ 'captionText',
+ 'softButtons',
+ 'totalDistanceLabel',
+ 'etaLabel',
+ 'turnList',
+ 'homeScreen',
+ 'navigationText2',
+ 'turnIconImage',
+ 'nextTurnIconImage',
+ 'distanceToManeuver',
+ 'distanceToManeuverScale',
+ 'timeToDestination'
+ ],
+
+ appID: -1,
+ navigationText2: null,
+ eta: null,
+ totalDistance: null,
+ turnIcon: null,
+ nextturnIcon: null,
+ distanceToManeuver: null,
+ distanceToManeuverScale: null,
+ timeToDestination: null,
+ maneuverComplete: null,
+
+ activate: function(appID) {
+
+ var naviParams = SDL.SDLController.getApplicationModel(appID).constantTBTParams;
+
+ if (naviParams) {
+
+ for ( var i = 0; i < naviParams.navigationTexts.length; i++) {
+ switch (naviParams.navigationTexts[i].fieldName) {
+ case 'navigationText1': {
+ this.set('captionText.content',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'navigationText2': {
+ this.set('navigationText2',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'ETA': {
+ this.set('eta', naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ case 'totalDistance': {
+ this.set('totalDistance',
+ naviParams.navigationTexts[i].fieldText);
+ break;
+ }
+ }
+ }
+
+ this.softButtons.addItems(naviParams.softButtons);
+
+ if (naviParams.maneuverComplete) {
+ this.set('maneuverComplete', naviParams.maneuverComplete);
+ }
+
+ this.set('appID', naviParams.appID);
+
+ if (naviParams.turnIcon) {
+
+ this.set('turnIcon', naviParams.turnIcon.value);
+ }
+
+ if (naviParams.nextTurnIcon) {
+
+ this.set('nextTurnIcon', naviParams.nextTurnIcon.value);
+ }
+ this.set('distanceToManeuver', naviParams.distanceToManeuver);
+ this.set('distanceToManeuverScale', naviParams.distanceToManeuverScale);
+ this.set('timeToDestination', naviParams.timeToDestination);
+
+ this.set('activeTBT', true);
+ }
+ },
+
+ /**
+ * Deactivate View
+ */
+ deactivate: function() {
+
+ this.set('activeTBT', false);
+ },
+
+ totalDistanceLabel: SDL.Label.extend( {
+ classNames: 'totalDistanceLabel',
+ contentBinding: 'parentView.totalDistance'
+ }),
+
+ distanceToManeuverScale: SDL.Label.extend( {
+ classNames: 'distanceToManeuverScale',
+ contentBinding: 'parentView.distanceToManeuverScale'
+ }),
+
+ distanceToManeuver: SDL.Label.extend( {
+ classNames: 'distanceToManeuver',
+ contentBinding: 'parentView.distanceToManeuver'
+ }),
+
+ timeToDestination: SDL.Label.extend( {
+ classNames: 'timeToDestination',
+ contentBinding: 'parentView.timeToDestination'
+ }),
+
+ etaLabel: SDL.Label.extend( {
+ classNames: 'etaLabel',
+ contentBinding: 'parentView.eta'
+ }),
+
+ turnList: SDL.Button.create( {
+ elementID: 'turnList',
+ classNames: 'turnList btn',
+ text: 'Turn List',
+ action: function() {
+
+ SDL.SDLController.tbtTurnList(this._parentView.appID);
+ },
+ target: '',
+ onDown: false,
+ templateName: 'arrow'
+ }),
+
+ turnIconImage: Em.View.create( {
+ classNames: 'turnIcon btn',
+ attributeBindings: [
+ 'style'
+ ],
+ style: function() {
+
+ if (this._parentView.turnIcon) {
+ return 'background-image: URL(' + this._parentView.turnIcon
+ + ');';
+ } else {
+ return '';
+ }
+ }.property('this.parentView.turnIcon')
+ }),
+
+ nextTurnIconImage: Em.View.create( {
+ classNames: 'nextTurnIcon btn',
+ attributeBindings: [
+ 'style'
+ ],
+ style: function() {
+
+ if (this._parentView.nextTurnIcon) {
+ return 'background-image: URL(' + this._parentView.nextTurnIcon
+ + ');';
+ } else {
+ return '';
+ }
+ }.property('this.parentView.nextTurnIcon')
+ }),
+
+ navigationText2: SDL.Label.extend( {
+ classNames: 'navigationText2',
+ contentBinding: 'parentView.navigationText2'
+ }),
+
+ homeScreen: SDL.Button.create( {
+ elementId: 'homeScreen',
+ classNames: 'homeScreen btn',
+ text: 'Home Screen',
+ iconBinding: 'SDL.SDLAppController.model.appIcon',
+ target: 'this.parentView',
+ action: 'deactivate',
+ onDown: false
+ }),
+
+ softButtons: SDL.MenuList.extend( {
+
+ itemsOnPage: 3,
+
+ groupName: "TurnByTurnView",
+
+ content: Em.ContainerView.extend( {
+
+ classNames: [
+ 'content'
+ ]
+
+ })
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/tbtClientStateView.js b/src/components/HMI/app/view/sdl/tbtClientStateView.js
new file mode 100644
index 0000000000..2d2571d372
--- /dev/null
+++ b/src/components/HMI/app/view/sdl/tbtClientStateView.js
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.TBTClientStateView
+ * @desc TBTClientStateView module visual representation
+ * @category View
+ * @filesource app/view/sdl/TBTClientStateView.js
+ * @version 1.0
+ */
+
+SDL.TBTClientStateView = Em.ContainerView.create( {
+
+ elementId: 'tbtClientStateView',
+
+ classNames: 'tbtClientStateView',
+
+ classNameBindings:
+ [
+ 'active'
+ ],
+
+ childViews:
+ [
+ 'tbtClientStateLabel',
+ 'tbtClientState',
+ 'tbtClientStateSelect'
+ ],
+
+ /**
+ * Title of VehicleInfo PopUp view
+ */
+ tbtClientStateLabel: SDL.Label.extend( {
+
+ elementId: 'tbtClientStateLabel',
+
+ classNames: 'tbtClientStateLabel',
+
+ content: 'TBT Client State'
+ } ),
+
+ /**
+ * Property indicates the activity state of TBTClientStateView
+ */
+ active: false,
+
+ /**
+ * Title of tbtClientState group of parameters
+ */
+ tbtClientState: SDL.Label.extend( {
+
+ elementId: 'tbtClientState',
+
+ classNames: 'tbtClientState',
+
+ content: 'Client State'
+ } ),
+
+ /**
+ * HMI element Select with parameters of TBTClientStates
+ */
+ tbtClientStateSelect: Em.Select.extend( {
+
+ elementId: 'tbtClientStateSelect',
+
+ classNames: 'tbtClientStateSelect',
+
+ contentBinding: 'SDL.SDLModel.tbtClientStates',
+
+ optionValuePath: 'content.id',
+
+ optionLabelPath: 'content.name',
+
+ /**
+ * Selected data sent on model for further processing
+ */
+ click: function() {
+
+ SDL.SDLController.tbtClientStateSelected( this.selection.name );
+
+ }
+ } ),
+
+ /**
+ * Trigger function that activates and deactivates tbtClientStateView
+ */
+ toggleActivity: function() {
+ this.toggleProperty( 'active' );
+ }
+} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/appPermissionsListView.js b/src/components/HMI/app/view/settings/policies/appPermissionsListView.js
new file mode 100644
index 0000000000..4fc83ad261
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policies/appPermissionsListView.js
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.AppPermissionsListView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings_appPermissionsList',
+
+ classNames: 'in_settings_separate_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.appPermissionsList.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'backButton',
+ 'appList',
+ 'label'
+ ],
+
+ globalConfigurationValue: false,
+
+ globalConfigurationMessage: function() {
+ if (this.globalConfigurationValue === true) {
+ return "All devices Allowed";
+ } else if (this.globalConfigurationValue === false) {
+ return "All devices Not Allowed";
+ } else {
+ return "All devices manual Configuration";
+ }
+ }.property('this.globalConfigurationValue'),
+
+ /**
+ * Label in title
+ */
+ label: SDL.Label.extend( {
+
+ classNames: 'label',
+
+ content: 'Choose devices to be allowed for SDL functionality:'
+ }),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'backButton'
+ ],
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ goToState: 'policies',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } ),
+
+ /**
+ * Function to add application to application list
+ */
+ showAppList: function() {
+
+ this.get('appList.list').removeAllChildren();
+
+ this.appList.list.refresh();
+
+ var i,
+ appIndex,
+ apps = SDL.SDLModel.registeredApps
+ len = apps.length;
+
+ for (i = 0; i < len; i++) {
+
+ appIndex = SDL.SDLModel.registeredApps.indexOf(apps[i]);
+
+ this.get('appList.list.childViews').pushObject(SDL.Button.create( {
+ action: 'GetListOfPermissions',
+ target: 'SDL.SettingsController',
+ text: apps[i].appName,
+ appID: apps[i].appID,
+ classNames: 'list-item button',
+ iconBinding: 'SDL.SDLModel.registeredApps.' + appIndex
+ + '.appIcon'
+ }));
+ }
+
+ this.appList.list.refresh();
+
+ },
+
+ appList: SDL.List.extend( {
+
+ elementId: 'polocies_app_permissions_list',
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: new Array()
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/appPermissionsView.js b/src/components/HMI/app/view/settings/policies/appPermissionsView.js
new file mode 100644
index 0000000000..165ae90008
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policies/appPermissionsView.js
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.AppPermissionsView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings_appPermissions',
+
+ classNames: 'in_settings_separate_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.appPermissions.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'backButton',
+ 'appList',
+ 'label'
+ ],
+
+ currentAppId: null,
+
+ /**
+ * Label in title
+ */
+ label: SDL.Label.extend( {
+
+ classNames: 'label',
+
+ content: 'Choose devices to be allowed for SDL functionality:'
+ }),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'backButton'
+ ],
+ action: function(element){
+
+ SDL.SettingsController.onState(element);
+
+ var permissions = [];
+
+ for (var i = 0; i < SDL.AppPermissionsView.appList.list._childViews.length; i++) {
+ permissions.push({
+ "name": SDL.AppPermissionsView.appList.list._childViews[i].name,
+ "id": SDL.AppPermissionsView.appList.list._childViews[i].id,
+ "allowed": SDL.AppPermissionsView.appList.list._childViews[i].allowed
+ });
+ }
+
+ FFW.BasicCommunication.OnAppPermissionConsent(permissions, "GUI", SDL.AppPermissionsView.currentAppId);
+
+ SDL.AppPermissionsView.currentAppId = null;
+ },
+ goToState: 'policies',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } ),
+
+ /**
+ * Function to add application to application list
+ */
+ update: function(message, appID) {
+
+ SDL.AppPermissionsView.currentAppId = appID;
+
+ this.appList.items = [];
+
+ for (var i = 0; i < message.length; i++) {
+
+ var text = " - Undefined";
+
+ if (message[i].allowed === true) {
+ text = " - Allowed";
+ } else if (message[i].allowed === false) {
+ text = " - Not allowed";
+ }
+
+ this.appList.items.push({
+ type: SDL.Button,
+ params: {
+ action: 'changeAppPermission',
+ target: 'SDL.SettingsController',
+ text: message[i].name + text,
+ name: message[i].name,
+ allowed: message[i].allowed,
+ id: message[i].id,
+ appID: appID
+ }
+ });
+ }
+
+ this.appList.list.refresh();
+
+ },
+
+ appList: SDL.List.extend( {
+
+ elementId: 'polocies_app_permissions_list',
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: new Array()
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/deviceConfigView.js b/src/components/HMI/app/view/settings/policies/deviceConfigView.js
new file mode 100644
index 0000000000..37cb33d338
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policies/deviceConfigView.js
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.DeviceConfigView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings_deviceConfig',
+
+ classNames: 'in_settings_separate_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.deviceConfig.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'backButton',
+ 'listOfDevices',
+ 'label'
+ ],
+
+ globalConfigurationValue: false,
+
+ globalConfigurationMessage: function() {
+ if (this.globalConfigurationValue === true) {
+ return "All devices Allowed";
+ } else if (this.globalConfigurationValue === false) {
+ return "All devices Not Allowed";
+ } else {
+ return "All devices manual Configuration";
+ }
+ }.property('this.globalConfigurationValue'),
+
+ /**
+ * Label in title
+ */
+ label: SDL.Label.extend( {
+
+ elementId: 'label',
+
+ classNames: 'label',
+
+ content: 'Choose devices to be allowed for SDL functionality:'
+ }),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'backButton'
+ ],
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ goToState: 'policies',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } ),
+
+ /**
+ * Function to add application to application list
+ */
+ showDeviceList: function() {
+
+ this.listOfDevices.items = [];
+
+ this.listOfDevices.items.push({
+ type: SDL.Button,
+ params: {
+ action: 'allDeviceAccess',
+ target: 'SDL.SettingsController',
+ textBinding: 'SDL.DeviceConfigView.globalConfigurationMessage',
+ classNameBinding: 'SDL.DeviceConfigView.globalConfigurationValue:disabled'
+ }
+ });
+
+ var dev = SDL.SDLModel.connectedDevices;
+
+ for (var key in dev) {
+
+ if (dev.hasOwnProperty(key)) {
+
+ this.listOfDevices.items.push({
+ type: SDL.Button,
+ params: {
+ action: 'changeDeviceAccess',
+ target: 'SDL.SettingsController',
+ text: dev[key].allowed ? dev[key].name + " - Allowed" : dev[key].name + " - Not allowed",
+ name: dev[key].name,
+ id: dev[key].id
+ }
+ });
+ }
+ }
+
+ this.listOfDevices.list.refresh();
+
+ },
+
+ listOfDevices: SDL.List.extend( {
+
+ elementId: 'polocies_device_list',
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: new Array()
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js b/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js
new file mode 100644
index 0000000000..44e61066bf
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.DeviceStateChangeView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings_deviceStateChange',
+
+ classNames: 'in_settings_separate_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.deviceStateChange.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'backButton',
+ 'listOfDevices',
+ 'label'
+ ],
+
+ /**
+ * Label in title
+ */
+ label: SDL.Label.extend( {
+
+ elementId: 'label',
+
+ classNames: 'label',
+
+ content: 'Choose devices to be Unpaired:'
+ }),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'backButton'
+ ],
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ goToState: 'policies',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } ),
+
+ /**
+ * Function to add application to application list
+ */
+ showDeviceList: function() {
+
+ this.listOfDevices.items = [];
+
+ var dev = SDL.SDLModel.connectedDevices;
+
+ for (var key in dev) {
+
+ if (dev.hasOwnProperty(key)) {
+
+ this.listOfDevices.items.push({
+ type: SDL.Button,
+ params: {
+ action: 'OnDeviceStateChanged',
+ target: 'FFW.BasicCommunication',
+ text: dev[key].name,
+ deviceName: dev[key].name,
+ deviceID: dev[key].id
+ }
+ });
+ }
+ }
+
+ this.listOfDevices.list.refresh();
+
+ },
+
+ listOfDevices: SDL.List.extend( {
+
+ elementId: 'polocies_device_list',
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: new Array()
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/statisticsInfoView.js b/src/components/HMI/app/view/settings/policies/statisticsInfoView.js
new file mode 100644
index 0000000000..52ae2847b9
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policies/statisticsInfoView.js
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.StatisticsInfoView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings_status_info',
+
+ classNames: 'in_settings_separate_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.statisticsInfo.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'backButton',
+ 'label',
+ 'listSelect'
+ ],
+
+ /**
+ * HMI element Select with parameters of transmission state from VehicleInfo
+ * Model
+ */
+ listSelect: Em.Select.extend( {
+
+ elementId: 'listSelect',
+
+ classNames: 'listSelect',
+
+ contentBinding: 'SDL.SDLModel.settingsInfoList',
+
+ valueBinding: 'SDL.SDLModel.settingsInfoListState'
+ } ),
+
+ /**
+ * Label in title
+ */
+ label: SDL.Label.extend( {
+
+ elementId: 'label',
+
+ classNames: 'label',
+
+ content: 'Choose devices to be allowed for SDL functionality:'
+ }),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'backButton'
+ ],
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ goToState: 'policies',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } )
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/systemErrorView.js b/src/components/HMI/app/view/settings/policies/systemErrorView.js
new file mode 100644
index 0000000000..2ccae596cf
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policies/systemErrorView.js
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.DeviceConfigView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/policies/deviceConfigView.js
+ * @version 1.0
+ */
+
+SDL.SystemErrorView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings_system_error',
+
+ classNames: 'in_settings_separate_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.systemError.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'backButton',
+ 'label',
+ 'listSelect'
+ ],
+
+ /**
+ * HMI element Select with parameters of transmission state from VehicleInfo
+ * Model
+ */
+ listSelect: Em.Select.extend( {
+
+ elementId: 'systemErrorListSelect',
+
+ classNames: 'listSelect',
+
+ contentBinding: 'SDL.SDLModel.systemErrorList',
+
+ valueBinding: 'SDL.SDLModel.systemErrorListState'
+ } ),
+
+ /**
+ * Label in title
+ */
+ label: SDL.Label.extend( {
+
+ elementId: 'label',
+
+ classNames: 'label',
+
+ content: 'Send OnSystemError notification:'
+ }),
+
+ backButton: SDL.Button.extend( {
+ classNames:
+ [
+ 'backButton'
+ ],
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ goToState: 'policies',
+ icon: 'images/media/ico_back.png',
+ onDown: false
+ } )
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policiesView.js b/src/components/HMI/app/view/settings/policiesView.js
new file mode 100644
index 0000000000..cb1b59be30
--- /dev/null
+++ b/src/components/HMI/app/view/settings/policiesView.js
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PoliciesSettingsView
+ * @desc Info Apps visual representation
+ * @category View
+ * @filesource app/view/settings/AppsView.js
+ * @version 1.0
+ */
+
+SDL.PoliciesView = Em.ContainerView.create( {
+
+ elementId: 'policies_settings',
+
+ classNames: 'in_settings_view',
+
+ classNameBindings: [
+ 'SDL.States.settings.policies.active:active_state:inactive_state'
+ ],
+
+ childViews: [
+ 'SettingsList'
+ ],
+
+ SettingsList: SDL.List.extend( {
+
+ elementId: 'policies_settings_list',
+
+ classNames: 'policies_settings_list',
+
+ itemsOnPage: 5,
+
+ /** Items */
+ items: [
+ {
+ type: SDL.Button,
+ params: {
+ goToState: 'policies.deviceConfig',
+ text: 'Allow SDL Functionality',
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ templateName: 'arrow',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'Update SDL',
+ action: 'updateSDL',
+ target: 'SDL.SettingsController',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'Policy table update status',
+ action: 'getStatusUpdate',
+ target: 'SDL.SettingsController',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'Send request GetURLS',
+ action: 'getURLS',
+ target: 'SDL.SettingsController',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'Statistics Info settings',
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ templateName: 'arrow',
+ goToState: 'policies.statisticsInfo',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'App permissions',
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ templateName: 'arrow',
+ goToState: 'policies.appPermissionsList',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'Get list of permissions',
+ click: function () {
+ FFW.BasicCommunication.GetListOfPermissions();
+ },
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'Device state change',
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ templateName: 'arrow',
+ goToState: 'policies.deviceStateChange',
+ onDown: false
+ }
+ },
+ {
+ type: SDL.Button,
+ params: {
+ text: 'System Error',
+ action: 'onState',
+ target: 'SDL.SettingsController',
+ templateName: 'arrow',
+ goToState: 'policies.systemError',
+ onDown: false
+ }
+ }
+ ]
+ })
+}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settingsView.js b/src/components/HMI/app/view/settingsView.js
new file mode 100644
index 0000000000..956f75aaa2
--- /dev/null
+++ b/src/components/HMI/app/view/settingsView.js
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.PlayerControllsView
+ * @desc Video player visual representation
+ * @category View
+ * @filesource app/view/player/PlayerView.js
+ * @version 1.0
+ */
+SDL.SettingsView = Em.ContainerView.create( {
+ /** View Id */
+ elementId: 'settingsView',
+
+ classNameBindings: [
+ 'SDL.States.settings.active:active_state:inactive_state'
+ ],
+
+ /** Settings components */
+ childViews:
+ [
+ 'leftMenu',
+ SDL.DeviceStateChangeView,
+ SDL.PoliciesView,
+ SDL.AppPermissionsListView,
+ SDL.AppPermissionsView,
+ SDL.DeviceConfigView,
+ SDL.StatisticsInfoView,
+ SDL.SystemErrorView
+ ],
+
+ /** Left menu */
+ leftMenu: Em.ContainerView.extend( {
+ elementId: 'settings_leftMenu',
+
+ classNameBindings:
+ [
+ 'parentView.controller.hiddenLeftMenu:hidden'
+ ],
+
+ classNames: 'menu-items',
+
+ childViews:
+ [
+ 'border',
+ 'items'
+ ],
+
+ border: Em.View.extend( {
+ classNames: 'ls_border'
+ } ),
+
+ items: Em.ContainerView.extend( {
+ classNames: 'ls-items',
+
+ childViews:
+ [
+ 'policies'
+ ],
+
+ policies: SDL.Button.extend( {
+ elementId: 'policies_leftMenu',
+ goToState: 'policies',
+ classNames: 'menu-item lsp1_p',
+ classNameBindings:
+ [
+ 'SDL.States.settings.policies.active:info_active'
+ ],
+ text: 'Policies',
+ icon: 'images/settings/ico_settings.png',
+ action: 'onState',
+ target: 'SDL.SettingsController'
+ } )
+ } )
+ } )
+
+});
diff --git a/src/components/HMI/audio/alert.wav b/src/components/HMI/audio/alert.wav
new file mode 100644
index 0000000000..bde18695e2
--- /dev/null
+++ b/src/components/HMI/audio/alert.wav
Binary files differ
diff --git a/src/components/HMI/audio/initial.wav b/src/components/HMI/audio/initial.wav
new file mode 100644
index 0000000000..61a549fbc6
--- /dev/null
+++ b/src/components/HMI/audio/initial.wav
Binary files differ
diff --git a/src/components/HMI/audio/listen.wav b/src/components/HMI/audio/listen.wav
new file mode 100644
index 0000000000..0f087c8d2e
--- /dev/null
+++ b/src/components/HMI/audio/listen.wav
Binary files differ
diff --git a/src/components/HMI/audio/positive.wav b/src/components/HMI/audio/positive.wav
new file mode 100644
index 0000000000..464af1f88c
--- /dev/null
+++ b/src/components/HMI/audio/positive.wav
Binary files differ
diff --git a/src/components/HMI/audio/say.wav b/src/components/HMI/audio/say.wav
new file mode 100644
index 0000000000..0975fe9766
--- /dev/null
+++ b/src/components/HMI/audio/say.wav
Binary files differ
diff --git a/src/components/HMI/css/buttonControls.css b/src/components/HMI/css/buttonControls.css
new file mode 100644
index 0000000000..39ef852853
--- /dev/null
+++ b/src/components/HMI/css/buttonControls.css
@@ -0,0 +1,546 @@
+/**
+ * buttonControls module CSS
+ *
+ * @category Style Sheets
+ * @filesource css/buttonControls.css
+ * @version 2.0
+ */
+#buttonControls.buttonControls {
+ width: 270px;
+ height: 200px;
+ top: 0px;
+ left: 790px;
+}
+
+#driverDistractionControl.driverDistractionControl {
+ width: 302px;
+ height: 20px;
+ top: 423px;
+ left: 810px;
+}
+
+#driverDistractionControl .driverDistractionControlLabel {
+ left: 20px;
+}
+
+#keyboard_view .back-button{
+ top: 58px;
+}
+
+#keyboard_view .controlls{
+ top: 350px;
+ width: 800px;
+ height: 75px;
+}
+
+#keyboard_view .controll{
+ margin: 10px;
+ height: 60px;
+ border: 1px solid #333;
+ text-align: center;
+ line-height: 60px;
+ border-radius: 3px;
+}
+
+#keyboard_view .controlls .leftBtn{
+ width: 130px;
+ left: 0px;
+}
+
+#keyboard_view .controlls .numericBtn{
+ width: 60px;
+ left: 145px;
+}
+
+#keyboard_view .controlls .symbolBtn{
+ width: 60px;
+ left: 220px;
+}
+
+#keyboard_view .controlls .spaceBtn{
+ width: 215px;
+ left: 295px;
+}
+
+#keyboard_view .controlls .caseSwitchBtn{
+ width: 60px;
+ left: 525px;
+}
+
+#keyboard_view .controlls .localisationBtn{
+ width: 60px;
+ left: 600px;
+}
+
+#keyboard_view .controlls .searchBtn{
+ width: 100px;
+ left: 677px;
+}
+
+#keyboard_view .keyboardLayout{
+ width: 750px;
+ height: 185px;
+ top: 170px;
+ left: 25px;
+}
+
+#keyboard_view .keyboardLayout.wide{
+ left: 5px !important;
+}
+
+#keyboard_view .searchBar{
+ top: 58px;
+ width: 666px;
+ height: 49px;
+ left: 120px;
+}
+
+#keyboard_view input{
+ width: 597px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ background: rgba(119, 119, 119, 0.42);
+ cursor: pointer;
+ font-size: 32px;
+ color: #FFF;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+#keyboard_view .microphone{
+ text-align: center;
+ line-height: 49px;
+}
+
+#keyboard_view .clearBtn{
+ right: 0px;
+ top: 0px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ font-size: 32px;
+ text-align: center;
+ line-height: 50px;
+}
+
+#keyboard_view .microphone{
+ left: 63px;
+ top: 58px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+}
+
+#keyboard_view .keyboardLayout .ffw-button{
+ width: 60px;
+ height: 50px;
+ border-radius: 3px;
+ border: 1px solid #333;
+ margin: 5px;
+ font-size: 42px;
+ text-align: center;
+ line-height: 50px;
+}
+#keyboard_view .keyboardLayout .k1{
+ left: 75px;
+}
+#keyboard_view .keyboardLayout .k2{
+ left: 150px;
+}
+#keyboard_view .keyboardLayout .k3{
+ left: 225px;
+}
+#keyboard_view .keyboardLayout .k4{
+ left: 300px;
+}
+#keyboard_view .keyboardLayout .k5{
+ left: 375px;
+}
+#keyboard_view .keyboardLayout .k6{
+ left: 450px;
+}
+#keyboard_view .keyboardLayout .k7{
+ left: 525px;
+}
+#keyboard_view .keyboardLayout .k8{
+ left: 600px;
+}
+#keyboard_view .keyboardLayout .k9{
+ left: 675px;
+}
+#keyboard_view .keyboardLayout .k10{
+ left: 38px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k11{
+ left: 113px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k12{
+ left: 188px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k13{
+ left: 263px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k14{
+ left: 338px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k15{
+ left: 413px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k16{
+ left: 488px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k17{
+ left: 563px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k18{
+ left: 638px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k19{
+ left: 713px;
+ top: 62px;
+}
+#keyboard_view .keyboardLayout .k20{
+ left: 0px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k21{
+ left: 75px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k22{
+ left: 150px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k23{
+ left: 225px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k24{
+ left: 300px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k25{
+ left: 375px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k26{
+ left: 450px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k27{
+ left: 525px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k28{
+ left: 600px;
+ top: 124px;
+}
+#keyboard_view .keyboardLayout .k29{
+ left: 675px;
+ top: 124px;
+}
+#infoTable.infoTable {
+ width: 400px;
+ height: 96px;
+ top: 308px;
+ left: 801px;
+ background-color: #383737;
+ color: white;
+ border: 1px solid gray;
+ overflow: hidden;
+}
+
+#infoTable .sdlGPLabel {
+ width: 190px;
+ border-right: 1px solid #14100F;
+ height: 96px;
+ position: relative;
+ float: left;
+}
+
+#infoTable .sdlGPData {
+ position: relative;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 203px;
+ height: 18px;
+}
+
+#buttonControls .ContainerControlls {
+ left: 34px;
+ background:
+ url(../images/home/controlButtons/backGroundControllButtons.png)
+ no-repeat;
+ width: 200px;
+ height: 200px;
+}
+
+#buttonControls .UpBtn {
+ background: url(../images/home/controlButtons/UpButton.png) no-repeat;
+ background-position: -32px 0;
+ width: 137px;
+ height: 64px;
+ left: 32px;
+ -webkit-transition: 0.2s;
+}
+
+#TUNEUP.pressed {
+ background: url(../images/home/controlButtons/UpButton_pressed.png)
+ !important;
+ background-position: -32px 0 !important;
+ width: 137px !important;
+ height: 69px !important;
+ left: 32px !important;
+}
+
+#buttonControls .DownBtn {
+ background: url(../images/home/controlButtons/DownButton.png) no-repeat;
+ background-position: -32px -132px;
+ width: 137px;
+ height: 65px;
+ top: 132px;
+ left: 32px;
+ -webkit-transition: 0.2s;
+}
+
+#TUNEDOWN.pressed {
+ background: url(../images/home/controlButtons/DownButton_pressed.png)
+ no-repeat;
+ background-position: -32px -132px !important;
+ width: 137px !important;
+ height: 65px !important;
+ top: 132px !important;
+ left: 32px !important;
+}
+
+#buttonControls .LeftBtn {
+ background: url(../images/home/controlButtons/LeftButton.png) no-repeat;
+ width: 63px;
+ height: 138px;
+ background-position: -3px -31px;
+ left: 3px;
+ top: 31px;
+ -webkit-transition: 0.2s;
+}
+
+#SEEKLEFT.pressed {
+ background: url(../images/home/controlButtons/LeftButton_pressed.png)
+ no-repeat;
+ width: 63px !important;
+ height: 138px !important;
+ background-position: -3px -31px !important;
+ left: 3px !important;
+ top: 31px !important;
+}
+
+#buttonControls .RightBtn {
+ background: url(../images/home/controlButtons/RightButton.png) no-repeat;
+ background-position: -131px -31px;
+ width: 68px;
+ height: 139px;
+ left: 131px;
+ top: 31px;
+ -webkit-transition: 0.2s;
+}
+
+#SEEKRIGHT.pressed {
+ background: url(../images/home/controlButtons/RightButton_pressed.png)
+ no-repeat;
+ background-position: -131px -31px !important;
+ width: 68px !important;
+ height: 139px !important;
+ left: 131px !important;
+ top: 31px !important;
+}
+
+#buttonControls .OkBtn {
+ background: url(../images/home/controlButtons/OkButton.png) no-repeat;
+ background-position: -55px -55px;
+ width: 89px;
+ height: 90px;
+ left: 55px;
+ top: 55px;
+ -webkit-transition: 0.2s;
+}
+
+#OK.pressed {
+ background: url(../images/home/controlButtons/OkButton_pressed.png)
+ no-repeat;
+ background-position: -55px -55px !important;
+ width: 89px !important;
+ height: 90px !important;
+ left: 55px !important;
+ top: 55px !important;
+}
+
+#app_controlButtons{
+ z-index: 2;
+}
+#app_controlButtons .systemRequest {
+ top: 252px !important;
+ left: 1059px !important;
+ width: 135px !important;
+ font-size: 16px !important;
+ text-align: center;
+ line-height: 48px;
+}
+
+#app_controlButtons .btnNotPressed {
+ width: 40px;
+ height: 40px;
+ left: 0px;
+ top: 200px;
+ -webkit-transition: 0.2s;
+ border-radius: 8px;
+ background-color: #1D1D1D;
+ border: 1px solid #383737;
+ box-shadow: inset 5px 5px 10px #383737, inset -3px -3px 10px black;
+ -webkit-transition: 0.2s;
+ font-size: 38px;
+ line-height: 42px;
+ text-align: center;
+ position: relative;
+ float: left;
+ margin-left: 10px;
+ margin-top: 10px;
+}
+
+}
+#app_controlButtons .languageSelect {
+ position: absolute;
+ width: 150px;
+ height: 30px;
+ color: white;
+ background: #393939;
+}
+
+#app_controlButtons .languageSelect option {
+ background: #393939;
+}
+
+#UILanguages.languageSelect {
+ top: 110px;
+ left: 1028px;
+}
+
+#TTSVRLanguages.languageSelect {
+ top: 170px;
+ left: 1028px;
+}
+
+#app_controlButtons .UILanguagesLabel {
+ top: 91px;
+ left: 1028px;
+ width: 150px;
+}
+
+#app_controlButtons .TTSVRLanguagesLabel {
+ top: 151px;
+ left: 1028px;
+ width: 160px;
+}
+
+#app_controlButtons .appUILanguagesLabel {
+ top: 91px;
+ left: 1195px;
+ width: 250px;
+}
+
+#app_controlButtons .appTTSVRLanguagesLabel {
+ top: 151px;
+ left: 1195px;
+ width: 250px;
+}
+
+#app_controlButtons .appUILang {
+ top: 117px;
+ left: 1195px;
+ width: 150px;
+}
+
+#app_controlButtons .appTTSVRLang {
+ top: 176px;
+ left: 1195px;
+ width: 150px;
+}
+
+#app_controlButtons .sendDataCheckBox {
+ left: 1158px;
+ position: absolute;
+ top: 275px;
+}
+
+#app_controlButtons .sendDataLabel {
+ top: 275px;
+ left: 1180px;
+ width: 160px;
+}
+
+#buttonControls .btnNotPressed.pressed {
+ box-shadow: inset 5px 5px 10px black, inset -3px -3px 10px #383737;
+ line-height: 45px;
+}
+
+#app_controlButtons .languageSelect {
+ position: absolute;
+ width: 150px;
+ height: 30px;
+ color: white;
+ background: #393939;
+}
+
+#app_controlButtons .languageSelect option {
+ background: #393939;
+}
+
+#UILanguages.languageSelect {
+ top: 110px;
+ left: 1028px;
+}
+
+#TTSVRLanguages.languageSelect {
+ top: 170px;
+ left: 1028px;
+}
+
+#app_controlButtons .UILanguagesLabel {
+ top: 91px;
+ left: 1028px;
+ width: 150px;
+}
+
+#app_controlButtons .TTSVRLanguagesLabel {
+ top: 151px;
+ left: 1028px;
+ width: 160px;
+}
+
+#app_controlButtons .phone_call_button{
+ height: 40px;
+ width: 163px;
+ font-size: 20px;
+ line-height: 41px;
+ border: 1px solid #FFFF30;
+ top: 2px;
+ color: #FFFF30;
+ padding-left: 10px;
+ left: 244px;
+ transition: left 2s;
+}
+
+#app_controlButtons .phone_call_button.expand{
+ left: 156px;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/general.css b/src/components/HMI/css/general.css
new file mode 100644
index 0000000000..a1e581599a
--- /dev/null
+++ b/src/components/HMI/css/general.css
@@ -0,0 +1,1541 @@
+/*GENERAL CSS*/
+* {
+ /*Reset default browser styles*/
+ margin: 0;
+ padding: 0;
+ border: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ -webkit-user-select: none;
+}
+
+html, body {
+ /*GLOBAL HTML and BODE Dimansions*/
+ width: 100%;
+ min-height: 100%;
+}
+
+body {
+ /*FONT FAMILY*/
+ font-family: sans-serif;
+ /*Defaul font size*/
+ font-size: 16px;
+ background-color: #000;
+ color: #fff;
+ overflow: hidden;
+}
+
+/*Default style for all images*/
+img {
+ border-width: 0px;
+ border-style: none;
+ margin: 0px;
+ padding: 0px;
+ z-index: 1000;
+ pointer-events: none;
+}
+
+/*Default style for all DIVs*/
+div {
+ position: absolute;
+ margin: 0;
+ padding: 0;
+}
+
+.ffw-button {
+ cursor: pointer;
+ background: url(../images/common/button.png) repeat-x;
+}
+
+.ffw-button.pressed {
+ background-position: bottom;
+}
+
+.windowText {
+ top: 190px;
+ width: 800px;
+ font-size: 80px;
+ color: white;
+ text-align: center;
+}
+
+/* Home view */
+#home {
+ background: url(../images/home/home_main_image.png) no-repeat;
+ width: 800px;
+ height: 369px;
+ top: 56px;
+}
+
+/* Climate Status */
+#status_climate {
+ bottom: 0px;
+ right: 0px;
+ text-align: right;
+ font-size: 21px;
+ width: 324px;
+ height: 48px;
+ cursor: pointer;
+ background: url(../images/common/climate-status-bg.png) no-repeat;
+ z-index: 1;
+}
+
+#status_climate_label {
+ display: block;
+ width: 100%;
+ visibility: hidden;
+}
+
+#status_climate_label span {
+ padding-right: 11px;
+}
+
+/* Navigation Status */
+#status_nav {
+ top: 0px;
+ right: 0px;
+ text-align: right;
+ font-size: 21px;
+ width: 324px;
+ height: 48px;
+ cursor: pointer;
+ background: url(../images/common/nav-status-bg.png) no-repeat;
+ z-index: 1;
+}
+
+#navigation_status_label {
+ width: 100%;
+ display: block;
+ visibility: hidden;
+}
+
+#navigation_status_label span {
+ padding-right: 11px;
+}
+
+/*FORD CONTAINER DEFAULT DIMANSIONS */
+#app {
+ /*position:relative;*/
+ width: 800px;
+ height: 480px;
+ /*overflow: hidden;
+ Mac font smoothing */
+ -webkit-font-smoothing: antialiased;
+ /*margin: 25px auto;*/
+}
+
+/* TTS popUp*/
+#TTSPopUp.TTSPopUp {
+ opacity: 0;
+ left: 500px;
+ width: 295px;
+ height: 100px;
+ z-index: 1;
+ border-radius: 10 PX;
+ top: 8px;
+ -webkit-transition: opacity 1s ease-in-out;
+ display: none;
+}
+
+#TTSPopUp .popUp {
+ width: 294px;
+ height: 98px;
+ border: 1px solid black;
+ border-radius: 10px;
+ background-color: black;
+ border: #A6A6A6 solid 2px;
+ color: white;
+}
+
+#TTSPopUp .message {
+ top: 10px;
+ right: 10px;
+ width: 278px;
+ height: 81px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#TTSPopUp .timerText {
+ color: #FFD93F;
+ margin-top: 3px;
+ right: 5px;
+ font-size: 30px;
+}
+
+#TTSPopUp .okButton {
+ right: 52px;
+ width: 113px;
+ height: 19px;
+ padding: 10px;
+ border-radius: 4px;
+ border: 1px solid white;
+}
+
+#TTSPopUp.active {
+ opacity: 1;
+ display: block;
+}
+
+/* Diver Distraction PopUp */
+#driverDistraction.driverDistractionWindow {
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 480px;
+ background: rgba(0, 0, 0, 0.7);
+ z-index: 30000;
+ opacity: 0;
+ display: none;
+}
+
+#driverDistraction .driverDistraction {
+ left: 200px;
+ width: 400px;
+ height: 200px;
+ z-index: 2;
+ top: 140px;
+ -webkit-transition: opacity 1s ease-in-out;
+ background-color: black;
+ border: #A6A6A6 solid 2px;
+ border-radius: 6px;
+}
+
+#driverDistraction.active {
+ opacity: 1;
+ display: block;
+}
+
+#driverDistraction .driverDistractionText {
+ top: 224px;
+ left: 210px;
+ width: 374px;
+ height: 20px;
+ text-align: center;
+ font-size: 28px;
+ z-index: 2;
+}
+
+/* UI popUp*/
+/* VR popUp*/
+#VRPopUp.VRPopUp {
+ opacity: 0;
+ left: 50px;
+ width: 700px;
+ height: 340px;
+ background-color: black;
+ z-index: 2;
+ border-radius: 10 PX;
+ top: 70px;
+ -webkit-transition: opacity 1s ease-in-out;
+ display: none;
+}
+
+#VRPopUp span {
+ margin-left: 15px;
+}
+
+#VRPopUp .popUp {
+ width: 698px;
+ height: 338px;
+ border: 1px solid white;
+ border-radius: 10px;
+}
+
+#VRPopUp .message1 {
+ top: 10px;
+ left: 10px;
+ width: 278px;
+ height: 81px;
+}
+
+#VRPopUp .message2 {
+ top: 40px;
+ left: 10px;
+ width: 278px;
+ height: 81px;
+}
+
+#VRPopUp.active {
+ opacity: 1;
+ display: block;
+ transition: all 1s;
+}
+
+#VRPopUp .list {
+ position: absolute;
+ width: 629px;
+ height: 251px;
+ border-radius: 2px;
+ left: 35px;
+ top: 70px;
+}
+
+#VRPopUp .list-content {
+ border: none;
+}
+
+#VRPopUp .list-item {
+ position: relative;
+ width: 100%;
+ height: 48px;
+ font-size: 20px;
+ line-height: 50px;
+ border: 1px solid #393939;
+}
+
+#VRPopUp .list-content {
+ width: 578px;
+}
+
+#VRPopUp .VRLabel {
+ top: 10px;
+ width: 550px;
+ left: 35px;
+ height: 20px;
+ padding: 15px;
+ background: #393939;
+}
+
+#VRPopUp .VRImage {
+ right: 25px;
+ width: 50px;
+ height: 50px;
+ top: 10px;
+ background: url(../images/home/controlButtons/vrImage.png) no-repeat;
+ background-size: contain;
+}
+
+/*WRAPER FOR CONTENT VIEW*/
+#app_active_view {
+ position: absolute;
+ width: 800px;
+ height: 480px;
+}
+
+#html5Player {
+ position: absolute;
+ z-index: 1;
+ width: 800px;
+ height: 480px;
+}
+
+#html5Player.visible {
+ -webkit-transform: translateX(0px) !important;
+}
+
+#mode {
+ position: relative;
+ margin: 150px auto;
+ width: 150px;
+}
+
+/* Image preloader block*/
+#preloader {
+ position: absolute;
+ left: -9999px;
+ top: -9999px;
+}
+
+/*CLOCK*/
+#clock {
+ font-size: 28px;
+ text-align: center;
+ width: 225px;
+ height: 50px;
+ position: relative;
+ float: left;
+ pointer-events: all;
+ cursor: pointer;
+}
+
+#clock.mcs {
+ width: 225px;
+}
+
+#time_num {
+ width: 100%;
+ padding: 10px;
+ margin-left: 5px;
+}
+
+#app_top_menu_cont {
+ z-index: 10000;
+ top: 0px;
+ left: 275px;
+ position: relative;
+ pointer-events: none;
+}
+
+#top_controls {
+ width: 322px;
+ height: 58px;
+ background: url("../images/common/header_bg.png") no-repeat;
+ z-index: 2;
+}
+
+.not-visible {
+ visibility: hidden !important;
+}
+
+/* Universal class to show hidden elements */
+.visible {
+ visibility: visible !important;
+}
+
+/* Universal class to show transparent elements */
+.show {
+ opacity: 1 !important;
+}
+
+.arrow-ico {
+ position: absolute;
+ right: 10px;
+}
+
+.right_text {
+ float: right;
+ margin-right: 5px;
+}
+
+.hidden_display {
+ display: none !important;
+}
+
+.visible_display {
+ display: block !important;
+}
+
+/*STATUS BAR*/
+.status_bar {
+ z-index: 2001;
+ line-height: 50px;
+}
+
+.selected {
+ display: none;
+}
+
+/*BOTTOM Control BUTTONS*/
+#app_bottom_controlls {
+ z-index: 11000;
+ bottom: 0px;
+ left: 275px;
+ width: 252px;
+ height: 59px;
+ /*background: url(../images/common/bottom_cont_bg.png) no-repeat;*/
+ overflow: hidden;
+ pointer-events: none;
+}
+
+#home_active {
+ z-index: 2002;
+ bottom: 0px;
+ left: 275px;
+ width: 250px;
+ height: 58px;
+ background: url("../../images/common/home_active.png") no-repeat;
+}
+
+#home_but {
+ height: 59px;
+ width: 73px;
+ cursor: pointer;
+ z-index: 1000;
+ background: url(../images/home/bottom_controlls_full.png) no-repeat;
+ background-position: -90px -59px;
+ position: relative;
+ float: left;
+ pointer-events: none;
+}
+
+#home_but.large {
+ width: 126px;
+ background-position: 0px -177px;
+}
+
+#home_but.large.selected {
+ width: 126px;
+ background-position: 0px -118px;
+}
+
+#home_but.selected {
+ background-position: -90px 0px;
+ display: block;
+}
+
+#home_but_click {
+ height: 59px;
+ width: 73px;
+ cursor: pointer;
+ z-index: 1001;
+ position: absolute;
+ pointer-events: all;
+}
+
+#home_but_click.large {
+ width: 125px;
+ height: 115px;
+ -webkit-transform: skew(0deg, -42deg);
+}
+
+/*INFO BUTTON*/
+#info_but_click {
+ height: 117px;
+ width: 88px;
+ cursor: pointer;
+ z-index: 1001;
+ position: absolute;
+ pointer-events: all;
+ -webkit-transform: skew(0deg, -52deg);
+}
+
+#info_but {
+ height: 59px;
+ width: 90px;
+ cursor: pointer;
+ background: url(../images/home/bottom_controlls_full.png) no-repeat;
+ background-position: 0px -59px;
+ position: relative;
+ float: left;
+ z-index: 1001;
+ pointer-events: none;
+ -webkit-border-top-left-radius: 10px;
+}
+
+#info_but.selected {
+ background-position: 0px 0px;
+ display: block;
+}
+
+/*SETTINGS BUTTON*/
+#setting_but {
+ width: 89px;
+ height: 59px;
+ cursor: pointer;
+ background: url(../images/home/bottom_controlls_full.png) no-repeat;
+ background-position: -162px -59px;
+ position: relative;
+ float: left;
+ pointer-events: none;
+}
+
+#setting_but.large {
+ width: 126px;
+ background-position: -126px -177px;
+}
+
+#setting_but.large.selected {
+ width: 126px;
+ background-position: -126px -118px;
+}
+
+#setting_but.selected {
+ background-position: -162px 0px;
+ display: block;
+}
+
+#setting_but_click {
+ width: 83px;
+ height: 110px;
+ cursor: pointer;
+ position: absolute;
+ -webkit-transform: skew(0deg, 52deg);
+ left: 1px;
+ top: 4px;
+ z-index: 1000;
+ pointer-events: all;
+}
+
+#setting_but_click.large {
+ width: 158px;
+ height: 155px;
+}
+
+/*HIDDEN FOR CONTENT BLOCKS*/
+.hidden {
+ -webkit-transform: translateX(-2000px);
+ -moz-transform: translateX(-2000px);
+}
+
+/*ACTIVE VISIBLE FOR CONTENT BLOCK*/
+.inactive_state {
+ -webkit-transform: translateX(-2000px);
+ -moz-transform: translateX(-2000px);
+ overflow: hidden;
+}
+
+.active_state {
+ -webkit-transform: translateX(0px) !important;
+ -moz-transform: translateX(0px) !important;
+}
+
+.passive_button_color {
+ color: #999 !important;
+}
+
+/*MEDIA BLOCK CONTAINER*/
+#media {
+ width: 800px;
+ height: 480px;
+ background: url(../images/media/bg.png) no-repeat;
+}
+
+/****************************** FOR MEDIA VIEW************************************************/
+/*#media, #browseUsbHD {
+background: url(../images/media/bg.png) no-repeat;
+}
+
+#media_view {
+width: 800px;
+height: 480px;
+}
+
+#media_view #cntrlMenu {
+position: relative;
+margin-top: 90px;
+}*/
+/*Video Player*/
+/*******Player Controlls View********/
+#video_player_view {
+ top: 85px;
+ left: 93px;
+ z-index: 2002;
+ display: block;
+}
+
+/*Holder for all progressbar elements*/
+#video_player_view .progressline_holder {
+ display: block;
+ width: 537px;
+ height: 10px;
+ cursor: pointer;
+ background: url(../images/player/player_prog_bg.png) no-repeat;
+}
+
+/*Style to fix actual width for progress bar concerning width of progrees bar mark*/
+.progressline_width_fix {
+ width: 537px;
+ position: absolute;
+}
+
+/*Progressbar*/
+#video_player_view .progressbar {
+ display: block;
+ height: 10px;
+ background: url(../images/player/prog_ind.png) no-repeat;
+ position: relative;
+ float: left;
+}
+
+/*Current time*/
+.current_time {
+ width: 33px;
+ height: 15px;
+ top: -4px;
+ left: -55px;
+ font-weight: bold;
+}
+
+/*Total time*/
+.total_time {
+ width: 33px;
+ height: 15px;
+ left: 546px;
+ top: -4px;
+ font-weight: bold;
+}
+
+/*Drag Area*/
+.drag_area {
+ width: 561px;
+ position: relative;
+ float: left;
+ height: 10px;
+}
+
+/*Progress bar mark*/
+#mark {
+ position: relative;
+ float: left;
+ bottom: 19px;
+ left: -20px;
+ background: url(../images/player/player_free_control.png) no-repeat;
+ width: 50px;
+ height: 50px;
+}
+
+#mark.active {
+ background: url(../images/player/player_active_control.png) no-repeat !important;
+ bottom: 20px !important;
+ left: -21px !important;
+ width: 52px !important;
+ height: 52px !important;
+}
+
+/*Back Button*/
+#back {
+ width: 80px;
+ height: 50px;
+ cursor: pointer;
+ top: 60px;
+ left: 140px;
+ border: 1px solid #393939;
+}
+
+#back .ico {
+ top: 13px;
+ left: 20px;
+ position: relative;
+}
+
+/* Forward Button*/
+#frw {
+ width: 79px;
+ height: 49px;
+ cursor: pointer;
+ top: 60px;
+ left: 347px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+}
+
+#frw .ico {
+ top: 13px;
+ left: 24px;
+ position: relative;
+}
+
+/*Play Button*/
+#play {
+ width: 79px;
+ height: 49px;
+ cursor: pointer;
+ top: 60px;
+ left: 244px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+}
+
+#play .play {
+ top: 13px;
+ left: 31px;
+ position: relative;
+}
+
+#play .pause {
+ top: 10px;
+ left: 28px;
+ position: relative;
+}
+
+/*Stop Button*/
+#stop {
+ width: 79px;
+ height: 49px;
+ cursor: pointer;
+ top: -18px;
+ left: 585px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+}
+
+#stop .ico {
+ top: 17px;
+ left: 18px;
+ position: relative;
+}
+
+/********************FOR TEST PURPOSE ONLY********************/
+.centered {
+ position: absolute;
+ width: 300px;
+ height: 200px;
+ border: 2px solid #999;
+ color: white;
+ text-align: center;
+ margin: 100px auto;
+ line-height: 190px;
+ font-size: 24px;
+ left: 240px;
+}
+
+/**************************FOR LIST***************************/
+/* List */
+.list {
+ position: relative;
+ overflow: hidden;
+}
+
+.list-content {
+ border-top: 1px solid #393939;
+ border-left: 1px solid #393939;
+ border-right: 1px solid #393939;
+}
+
+/* List item */
+.list-item {
+ position: relative;
+ width: 100%;
+ height: 49px;
+ font-size: 20px;
+ line-height: 50px;
+ border-bottom: 1px solid #393939;
+}
+
+.list-item .ico {
+ height: 49px;
+ float: left;
+}
+
+.list-item span {
+ /*position: absolute*/
+}
+
+/* List item background */
+.list-item.notpressed {
+ background-image: url(../images/list/list_item_bg.png);
+}
+
+.list-item .highLighted {
+
+}
+
+/*************************FOR SCROLLBAR*************************/
+/*
+.scrollBar{
+ position: relative;
+ width: 48px;
+ background: black;
+ border: 1px solid #393939;
+ border-top-right-radius: 1px;
+ border-top-left-radius: 1px;
+ border-bottom-right-radius: 1px;
+ border-bottom-left-radius: 1px;
+ float: right;
+}
+*/
+.scrollbar {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ width: 48px;
+ background: black;
+ border: 1px solid #393939;
+ border-top-right-radius: 2px;
+ border-top-left-radius: 2px;
+ border-bottom-right-radius: 2px;
+ border-bottom-left-radius: 2px;
+}
+
+.sb-content {
+ width: 48px;
+ background: black;
+ border: 1px solid #393939;
+ border-top-right-radius: 2px;
+ border-top-left-radius: 2px;
+ border-bottom-right-radius: 2px;
+ border-bottom-left-radius: 2px;
+}
+
+/* Top button */
+.sb-top {
+ height: 48px;
+ width: 48px;
+ border-bottom: #393939 1px solid;
+ position: relative;
+ cursor: pointer;
+}
+
+/* Background of scrollbar */
+.sb-body {
+ height: 148px;
+ width: 46px;
+ background-color: #262626;
+ margin: 1px;
+ position: relative;
+}
+
+/* Bar */
+.sb-bar {
+ width: 46px;
+ height: 146px;
+ background: #464646;
+ position: relative;
+ bottom: 10px;
+ -webkit-transition: top 0.2s ease-out;
+}
+
+/* Bottom button */
+.sb-bottom {
+ height: 48px;
+ width: 48px;
+ border-top: #393939 1px solid;
+ position: absolute;
+ cursor: pointer;
+ bottom: 0px;
+}
+
+/* Buttons image position */
+.sb-bottom img, .sb-top img {
+ margin-top: 13px;
+ margin-left: 13px;
+}
+
+/* List item button background */
+.list-item.pressed {
+ background-image: url(../images/list/list_item_pressed.png);
+}
+
+/** Background for pressed button */
+.button.pressed {
+ background-image: url(../images/list/list_item_pressed.png);
+}
+
+/* Hide function */
+.is-disabled {
+ display: none;
+}
+
+.hide {
+ visibility: hidden;
+ display: none;
+}
+
+/* Disabled list items */
+.disabled {
+ color: #999;
+ cursor: default!important;
+}
+
+.disabled .ico, .disabled .right_ico {
+ opacity: .3;
+}
+
+.disabled .arrow-ico {
+ opacity: .3;
+}
+
+#sing {
+ width: 19px;
+ height: 27px;
+ left: 13px;
+ top: 13px;
+}
+
+#sing.white {
+ background: url(../images/help/white_help.png) no-repeat;
+}
+
+#sing.yellow {
+ background: url(../images/help/yellow_help.png) no-repeat;
+}
+
+/******************** FOR FAQ ********************************/
+#faq_btn {
+ cursor: pointer;
+ width: 145px;
+ height: 53px;
+ background: url(../images/help/faq_top_btn.png) no-repeat;
+ top: 0;
+ left: 110px;
+ z-index: 0;
+ pointer-events: none;
+ -webkit-transition: left 0.5s ease-in-out;
+}
+
+.faq-pressed {
+ left: 0px !important;
+}
+
+#faq_btn.pressed {
+ background: url(../images/help/faq_top_btn_pressed.png) no-repeat !important;
+}
+
+#faq_btn .ico {
+ position: absolute;
+ right: 32px;
+ top: 8px;
+}
+
+#faq_btn_c {
+ width: 118px;
+ height: 50px;
+ -webkit-transform: skewX(-43deg);
+ z-index: 1;
+ cursor: pointer;
+ pointer-events: all;
+}
+
+#faq_btn .ind_inact {
+ background: url(../images/help/ind_vert_def.png) no-repeat;
+ position: absolute;
+ right: 32px;
+ top: 8px;
+ width: 19px;
+ height: 32px;
+}
+
+#faq_btn .ind_act {
+ background: url(../images/help/ind_vert_active.png) no-repeat;
+ position: absolute;
+ right: 32px;
+ top: 8px;
+ width: 19px;
+ height: 32px;
+}
+
+.button {
+ background-image: url(../images/list/list_item_bg.png);
+ cursor: pointer;
+}
+
+.button img {
+ float: left;
+}
+
+/* default style */
+* {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ -webkit-user-select: none;
+}
+
+/******************* For FAQ View *******************/
+#fag_view {
+ font-size: 20px;
+ display: block;
+ background: url(../images/help/faq_bg.png) no-repeat;
+ width: 800px;
+ height: 384px;
+ position: absolute;
+ top: 48px;
+}
+
+#faq_view_list {
+ position: relative;
+ margin-left: 115px;
+ margin-top: 34px;
+ height: 251px;
+ width: 630px;
+ float: left;
+}
+
+#faq_view_list .list-content {
+ width: 570px;
+}
+
+#fag_view .list-item {
+ position: relative;
+ width: 570px;
+ height: 49px;
+ font-size: 20px;
+ line-height: 50px;
+ border-bottom: 1px solid #393939;
+ cursor: pointer;
+ float: left;
+}
+
+#fag_view .list-item span {
+ left: 5px;
+ margin-top: 18px;
+ margin-left: 17px;
+}
+
+/* Faq bottom text*/
+#faq_bottom {
+ bottom: 19px;
+ width: 764px;
+ height: 50px;
+ font-size: 18px;
+ float: left;
+ margin-top: 31px;
+ margin-left: 36px;
+}
+
+#faq_bottom div {
+ float: left;
+ width: 764px;
+}
+
+#faq_bottom .second-line {
+ top: 22px;
+}
+
+#settings_view {
+ width: 800px;
+ height: 480px;
+}
+
+.block {
+ display: block !important;
+}
+
+.test_blur {
+ width: 800px;
+ height: 480px;
+ top: -55px;
+ z-index: 1001;
+ opacity: .6;
+ background-color: black;
+ box-shadow: 3px;
+}
+
+.pointer {
+ cursor: pointer !important;
+}
+
+/*CAUTION MESSAGE*/
+#warning_view {
+ width: 800px;
+ height: 480px;
+ z-index: 12001;
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(218, 218, 218)), color-stop(0.3, rgb(0, 0, 0)));
+}
+
+#warning_view.fr .text {
+ font-size: 23px;
+}
+
+#warning_view .message {
+ width: 744px;
+ height: 340px;
+ position: relative;
+ margin: 0 auto;
+ top: 15px;
+}
+
+#warning_view .warning_text {
+ position: relative;
+ margin: 0 auto;
+ width: 216px;
+ font-size: 42px;
+ font-weight: bold;
+ top: 20px;
+ text-shadow: 1px 1px 3px white;
+ color: #CC2A2A;
+}
+
+#warning_view .text {
+ font-size: 25px;
+ position: relative;
+ top: 15px;
+ font-weight: bold;
+}
+
+#warning_view .okbut {
+ width: 130px;
+ height: 51px;
+ position: relative;
+ top: 30px;
+ cursor: pointer;
+ float: right;
+ margin-right: 83px;
+ display: none;
+ font-size: 20px;
+ text-align: center;
+ line-height: 50px;
+}
+
+#warning_view .components{
+ margin-top: 20px;
+ width: 420px;
+}
+
+#warning_view .component{
+ width: 200px;
+ height: 20px;
+ float: right;
+ position: relative;
+}
+
+#warning_view .item{
+ position: relative;
+ float: left;
+ margin-left: 10px;
+}
+
+.hideWarning {
+ width: 0px !important;
+ overflow: hidden;
+ z-index: -1 !important;
+}
+
+.fadeWarning {
+ opacity: 0;
+ transition: opacity 1s;
+ -moz-transition: opacity 1s;
+ -webkit-transition: opacity 1s;
+ -o-transition: opacity 1s;
+}
+
+#warning_view.fadeAnimation {
+ -webkit-animation-name: opacity;
+ -webkit-animation-duration: 1s;
+ -webkit-animation-timing-function: linear;
+ -webkit-animation-fill-mode: forwards;
+}
+
+@
+-webkit-keyframes opacity {
+
+from {
+ opacity: 1;
+
+}
+
+to {
+ opacity: 0;
+}
+
+ }
+
+/* Welcome Orientation View*/
+#app_welcome_orientation_view {
+ width: 800px;
+ height: 480px;
+ z-index: 12000;
+}
+
+#app_welcome_orientation_balck_mask_view {
+ width: 800px;
+ height: 480px;
+ background: #000;
+ opacity: 0.75;
+}
+
+#app_welcome_orientation_popup_text {
+ position: relative;
+ margin: 0px auto;
+ font-size: 30px;
+ text-align: center;
+ width: 410px;
+ margin-top: 18px;
+}
+
+#app_welcome_orientation_denypopup_text {
+ position: relative;
+ margin: 0px auto;
+ font-size: 28px;
+ text-align: center;
+ width: 460px;
+ margin-top: 53px;
+}
+
+#app_welcome_orientation_popup_buttons {
+ width: 266px;
+ height: 53px;
+ border: 1px solid #333;
+ position: relative;
+ margin: 20px auto 0px;
+}
+
+#app_welcome_orientation_popup_lable {
+ position: relative;
+ width: 479px;
+ height: 70px;
+ border: 1px solid #fff;
+ text-align: center;
+ margin: 0px auto;
+ margin-top: 70px;
+ font-size: 25px;
+ font-family: Helvetica;
+}
+
+#app_welcome_orientation_popup_lable span {
+ position: relative;
+ top: 5px;
+ width: 432px;
+}
+
+#app_welcome_orientation_popup_view, #wo_denypopup {
+ width: 546px;
+ height: 346px;
+ background: #000;
+ z-index: 12002;
+ left: 134px;
+ top: 46px;
+ border: 2px solid #A28542;
+ -webkit-border-radius: 4px;
+}
+
+#wo_popup_btn_divider {
+ width: 4px;
+ height: 48px;
+ background: url(../images/common/divider.png) no-repeat;
+ left: 131px;
+ z-index: 1;
+}
+
+#wo_popup_yes_button, #wo_popup_no_button {
+ height: 52px;
+ width: 132px;
+ cursor: pointer;
+ position: relative;
+ float: left;
+ font-size: 20px;
+ text-align: center;
+ line-height: 52px;
+}
+
+#wo_popup_yes_button {
+ border-right: 1px solid #000;
+}
+
+#wo_popup_no_button {
+ border-left: 1px solid #393939;
+}
+
+#wo_popup_denypopup_ok_button {
+ width: 238px;
+ height: 48px;
+ background: url(../images/common/bt_bg.png) repeat-x;
+ cursor: pointer;
+ position: relative;
+ float: left;
+ font-size: 20px;
+ font-weight: bold;
+ text-align: center;
+ line-height: 50px;
+ border: 1px solid #333;
+ left: 155px;
+ top: 80px;
+ -webkit-border-radius: 4px;
+}
+
+#woSkippButton {
+ width: 80px;
+ height: 50px;
+ cursor: pointer;
+ top: 370px;
+ left: 710px;
+ font-size: 21px;
+ text-align: center;
+ line-height: 48px;
+ z-index: 10000;
+ border: 1px solid white;
+ -webkit-border-radius: 3px;
+ background: url(../images/common/skippbuttonbg_pressed.png) no-repeat;
+ opacity: 0.75;
+ display: none;
+}
+
+#woSkippButton .right_text {
+ margin-top: 2px;
+}
+
+#woSkippButton.pressed {
+ background: url(../images/common/skippbuttonbg_pressed.png) no-repeat !important;
+}
+
+#wo_popup_yes_button.pressed, #wo_popup_no_button.pressed, #wo_popup_denypopup_ok_button.pressed {
+ background: url(../images/common/bt_bg_pressed.png) repeat-x !important;
+}
+
+/* END Welcome Orientation View*/
+/* Video Error Popup*/
+#video_error_popup {
+ background: black;
+ border: 1px solid #A03333;
+ -webkit-border-radius: 3px;
+ font-size: 23px;
+ font-weight: bold;
+ left: 308px;
+ text-align: center;
+ top: 170px;
+ z-index: 12100;
+ position: absolute;
+ padding: 10px;
+ display: none;
+}
+
+.mft_indicator {
+ opacity: 0;
+}
+
+/* Lable plus Button*/
+.lablePlusButton .button {
+ float: right;
+ right: 0px;
+ width: 323px;
+ height: 49px;
+ border-left: 1px solid #393939;
+}
+
+.lablePlusButton .lable span, .lablePlusButton .button span {
+ margin-left: 13px;
+}
+
+.lablePlusButton .button.single {
+ width: 148px;
+ height: 28px;
+ border: 1px solid #393939;
+ border-radius: 2px;
+ margin-top: 10px;
+ margin-right: 10px;
+ text-align: center;
+ line-height: 28px;
+ float: right;
+}
+
+.lablePlusButton .button.single span {
+ margin: 0px;
+}
+
+/* ****************Select System Popup *********************** */
+#select_sysytem_view {
+ width: 796px;
+ height: 475px;
+ top: 1px;
+ border: 2px solid #926100;
+ background: #000;
+ z-index: 12002;
+ -webkit-border-radius: 4px;
+}
+
+/* header lable*/
+#select_system_heading_lable {
+ position: relative;
+ font-size: 30px;
+ text-align: center;
+ margin-top: 25px;
+ margin-bottom: 30px;
+}
+
+/* content container*/
+#select_system_container {
+ width: 756px;
+ height: 200px;
+ position: relative;
+ margin: 0px auto;
+ border: 1px solid #393939;
+}
+
+/* vehicle select list*/
+#settings_list {
+ height: 130px;
+ position: relative;
+}
+
+/* vehicle select list container*/
+#select_system_list {
+ width: 545px;
+ position: relative;
+ float: right;
+ margin-top: 15px;
+ margin-right: 20px;
+}
+
+/* vehicle select list buttons*/
+#settings_list .button {
+ position: relative;
+ width: 135px;
+ height: 48px;
+ font-size: 20px;
+ text-align: center;
+ line-height: 48px;
+ float: left;
+ border-right: 1px solid #393939;
+ border-top: 1px solid #393939;
+ border-bottom: 1px solid #393939;
+}
+
+#settings_list .button.left-border {
+ border-left: 1px solid #393939;
+}
+
+#settings_list .button.active {
+ background: url(../images/settings/btn-48h-gray-active.png) repeat-x !important;
+ color: #000;
+}
+
+#settings_list .button.bottom {
+ margin-top: 2px;
+}
+
+/* select climate style lable*/
+#select_system_label {
+ font-size: 20px;
+ width: 135px;
+ position: relative;
+ float: left;
+ margin-left: 10px;
+ margin-top: 15px;
+}
+
+/* Navigation select block*/
+#navsdcard {
+ height: 70px;
+ position: relative;
+ border-bottom: 1px solid #393939;
+}
+
+/* Navigation select block button container*/
+#sdnav_buttons {
+ position: relative;
+ float: right;
+ margin-top: 10px;
+ margin-right: 20px;
+}
+
+/* Navigation select block button*/
+#navsdcard .button {
+ width: 120px;
+ height: 48px;
+ border: 1px solid #393939;
+ text-align: center;
+ font-size: 20px;
+ line-height: 48px;
+ font-weight: bold;
+}
+
+#navsdcard .button.active {
+ background: url(../images/settings/btn-48h-gray-active.png) repeat-x !important;
+ color: #000;
+}
+
+#navsdcard_no_btn {
+ position: relative;
+ float: right;
+}
+
+#navsdcard_yes_btn {
+ position: relative;
+ float: left;
+}
+
+/* navigationApp select lable*/
+#sdnav_label {
+ position: relative;
+ float: left;
+ font-size: 20px;
+ margin-top: 15px;
+ margin-left: 10px;
+}
+
+/* Submit button*/
+#select_system_submit {
+ width: 130px;
+ height: 50px;
+ z-index: 12002;
+ position: relative;
+ border: 1px solid #393939;
+ text-align: center;
+ font-size: 25px;
+ font-weight: bold;
+ line-height: 50px;
+ margin: 50px auto;
+}
+
+/* Info Lable*/
+#select_system_info {
+ position: relative;
+ text-align: center;
+ font-size: 25px;
+ margin-top: 25px;
+}
+
+#select_system_info span {
+ border: 1px solid #fff;
+ padding: 5px 15px 5px 15px;
+}
diff --git a/src/components/HMI/css/info.css b/src/components/HMI/css/info.css
new file mode 100644
index 0000000000..34776e6cbf
--- /dev/null
+++ b/src/components/HMI/css/info.css
@@ -0,0 +1,671 @@
+#status_info {
+ top: 0px;
+ right: 0px;
+ text-align: right;
+ font-size: 21px;
+ width: 324px;
+ height: 48px;
+ cursor: pointer;
+ background: url(../images/common/nav-status-bg.png) no-repeat;
+ z-index: 1;
+}
+
+#status_info_label {
+ width: 100%;
+ display: block;
+}
+
+#status_info_label span {
+ padding-right: 11px;
+}
+
+#info_view {
+ width: 800px;
+ height: 480px;
+}
+
+#info_view.green_bg {
+ background: url(../images/nav/bg.png) no-repeat;
+}
+
+#info_leftMenu {
+ background: #333;
+ width: 150px;
+ height: 300px;
+ top: 90px;
+}
+
+#info_leftMenu .menu-item.info_active {
+ background: url("../images/info/menu_active.png") repeat-x;
+}
+
+#info_leftMenu .menu-item {
+ z-index: 201;
+ position: relative;
+ width: 150px;
+ height: 50px;
+ cursor: pointer;
+}
+
+#info_leftMenu .menu-item span {
+ position: absolute;
+ left: 50px;
+ width: 100px;
+ height: 50px;
+ font-size: 18px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+#info_leftMenu .ico {
+ height: 50px;
+ width: 50px;
+}
+
+#info_leftMenu .settings_active {
+ background: url("../images/settings/menu_active.png") repeat-x;
+}
+
+#info_right_menu {
+ left: 183px;
+ top: 6px;
+}
+
+#info_sync_services {
+ font-size: 32px;
+ width: 280px;
+}
+
+#info_traff {
+ font-size: 20px;
+ width: 410px;
+ top: 36px;
+}
+
+#info_traffic_report {
+ width: 300px;
+ top: 85px;
+ font-size: 20px;
+ color: #a6a6a6;
+}
+
+#info_traffic_pts {
+ width: 400px;
+ top: 120px;
+ font-size: 20px;
+ color: #65cdd9;
+}
+
+#info_traffic_hear {
+ width: 355px;
+ top: 192px;
+ font-size: 20px;
+ color: #a6a6a6;
+}
+
+#info_connect {
+ width: 300px;
+ top: 241px;
+ font-size: 20px;
+ left: 15px;
+}
+
+#info_log {
+ width: 500px;
+ top: 285px;
+ font-size: 20px;
+}
+
+#info_left_menu {
+ top: 6px;
+}
+
+#info_left_menu div {
+ font-size: 20px;
+ left: 49px;
+}
+
+#info_left_services {
+ top: 17px;
+}
+
+#info_left_travel_link {
+ top: 66px;
+ width: 200px;
+}
+
+#info_left_alerts {
+ top: 118px;
+}
+
+#info_left_calendar {
+ top: 166px;
+}
+
+#info_left_apps {
+ top: 216px;
+}
+
+/******************* For Info.Services *******************/
+#info_services_view {
+ top: 48px;
+ left: 153px;
+ background: url(../images/info/info_services_bg.png) no-repeat 0px 39px;
+ height: 384px;
+ width: 647px;
+}
+
+#info_services_view .inner-content {
+ left: 30px;
+ top: 49px;
+}
+
+/******************* For Info.travelLink *******************/
+#info_travelLink {
+ position: absolute;
+ top: 48px;
+ left: 153px;
+ width: 647px;
+ height: 384px;
+ float: left;
+ z-index: 1001;
+}
+
+#info_travelLink_logo {
+ margin-top: 48px;
+ margin-left: 22px;
+}
+
+#info_travelLink .inner-content {
+ top: 71px;
+}
+
+#info_travelLink .block-header-title {
+ top: 21px;
+ left: 75px;
+}
+
+#info_travelLink .list {
+ width: 308px;
+ border-radius: 2px;
+ max-height: 248px;
+ border: 1px solid #393939;
+}
+
+#info_travelLink .list .list-item:last-of-type {
+ height: 50px;
+ border: none;
+}
+
+#info_travelLink .list-content {
+ position: relative;
+ float: left;
+ width: 100%;
+ border: none;
+}
+
+#info_travelLink_listLeft {
+ left: 12px;
+ top: 92px;
+}
+
+#info_travelLink_listRight {
+ position: absolute;
+ top: 43px;
+ right: 5px;
+ width: 310px;
+}
+
+#info_travelLink_listLeft .list-item span,#info_travelLink_listRight .list-item span
+ {
+ margin-left: 44px;
+}
+
+#info_travelLink.fr #info_travelLink_listLeft .list-item span,#info_travelLink.fr #info_travelLink_listRight .list-item span
+ {
+ margin-left: 22px;
+}
+
+#info_travelLink_listRight_item0 span {
+ margin-left: 0px !important;
+}
+
+#info_travelLink_listRight_item0 {
+ text-align: center;
+}
+
+#info_travelLink_listRight .list-item:first-of-type {
+ height: 48px !important;
+}
+
+/******************* For Info.Alerts menu *****************/
+ /******************* For Info.Calendar menu ***************/
+#info_calendar {
+ left: 153px;
+ top: 48px;
+ width: 647px;
+ height: 384px;
+ background-image: url(../images/info/view_info_calendar.png);
+ background-repeat: no-repeat;
+ background-position: 4px 38px;
+}
+
+#info_calendar .inner-wrapper {
+ left: 99px;
+ top: 99px;
+}
+
+#info_calendar .c-btn {
+ width: 90px;
+ height: 34px;
+ background: url(../images/info/callendar-btn.png) no-repeat 0px 0px;
+ text-align: center;
+ line-height: 33px;
+}
+
+#info_calendar .c-btn.active {
+ background: #3b3b3b url(../images/common/btn-28h-gray-active.png)
+ repeat-x 0 5px !important;
+}
+
+#info_calendar .date {
+ white-space: nowrap;
+ font-size: 26px;
+ top: -43px;
+ left: 178px;
+}
+
+#info_calendar .today {
+ white-space: nowrap;
+ top: -58px;
+ left: 414px;
+ height: 48px;
+ width: 130px;
+ font-size: 20px;
+ line-height: 48px;
+ border: 1px #333 solid;
+ text-align: center;
+ border-radius: 2px;
+}
+
+#info_calendar .day {
+ width: 89px;
+ height: 36px;
+ text-align: center;
+ top: 5px;
+ line-height: 25px;
+}
+
+#info_calendar .day.active {
+ background: #f28b06;
+}
+
+#info_calendar .day-1 {
+ left: -86px;
+}
+
+#info_calendar .day-2 {
+ left: 3px;
+}
+
+#info_calendar .day-3 {
+ left: 93px;
+}
+
+#info_calendar .day-4 {
+ left: 183px;
+}
+
+#info_calendar .day-5 {
+ left: 272px;
+}
+
+#info_calendar .day-6 {
+ left: 363px;
+}
+
+#info_calendar .day-7 {
+ left: 453px;
+}
+
+#info_calendar .btn-1 {
+ left: -88px;
+ top: 40px;
+}
+
+#info_calendar .btn-8 {
+ left: -88px;
+ top: 75px;
+}
+
+#info_calendar .btn-15 {
+ left: -87px;
+ top: 108px;
+}
+
+#info_calendar .btn-22 {
+ left: -88px;
+ top: 141px;
+}
+
+#info_calendar .btn-29 {
+ left: -88px;
+ top: 174px;
+}
+
+#info_calendar .btn-7 {
+ left: 452px;
+ top: 40px;
+}
+
+#info_calendar .btn-14 {
+ left: 452px;
+ top: 75px;
+}
+
+#info_calendar .btn-21 {
+ left: 452px;
+ top: 108px;
+}
+
+#info_calendar .btn-28 {
+ left: 452px;
+ top: 141px;
+}
+
+#info_calendar .btn-6 {
+ left: 362px;
+ top: 40px;
+}
+
+#info_calendar .btn-13 {
+ left: 362px;
+ top: 75px;
+}
+
+#info_calendar .btn-20 {
+ left: 362px;
+ top: 108px;
+}
+
+#info_calendar .btn-27 {
+ left: 362px;
+ top: 141px;
+}
+
+#info_calendar .btn-5 {
+ left: 272px;
+ top: 40px;
+}
+
+#info_calendar .btn-12 {
+ left: 272px;
+ top: 75px;
+}
+
+#info_calendar .btn-19 {
+ left: 272px;
+ top: 108px;
+}
+
+#info_calendar .btn-26 {
+ left: 272px;
+ top: 141px;
+}
+
+#info_calendar .btn-4 {
+ left: 182px;
+ top: 40px;
+}
+
+#info_calendar .btn-11 {
+ left: 182px;
+ top: 75px;
+}
+
+#info_calendar .btn-18 {
+ left: 182px;
+ top: 108px;
+}
+
+#info_calendar .btn-25 {
+ left: 182px;
+ top: 141px;
+}
+
+#info_calendar .btn-3 {
+ left: 92px;
+ top: 40px;
+}
+
+#info_calendar .btn-10 {
+ left: 92px;
+ top: 75px;
+}
+
+#info_calendar .btn-17 {
+ left: 92px;
+ top: 108px;
+}
+
+#info_calendar .btn-24 {
+ left: 92px;
+ top: 141px;
+}
+
+#info_calendar .btn-31 {
+ left: 92px;
+ top: 174px;
+}
+
+#info_calendar .btn-2 {
+ left: 2px;
+ top: 40px;
+}
+
+#info_calendar .btn-9 {
+ left: 2px;
+ top: 75px;
+}
+
+#info_calendar .btn-16 {
+ left: 2px;
+ top: 108px;
+}
+
+#info_calendar .btn-23 {
+ left: 2px;
+ top: 141px;
+}
+
+#info_calendar .btn-30 {
+ left: 2px;
+ top: 174px;
+}
+
+/******************* For Info.DeviceList *******************/
+#info_view .info_apps_deviceList_view {
+ background: black;
+ width: 800px;
+ height: 480px;
+ z-index: 201;
+}
+
+#info_apps_deviceList_view .backButton {
+ top: 80px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ left: 5px;
+}
+
+#info_apps_deviceList_view .backButton .ico {
+ margin-top: 13px;
+ margin-left: 8px;
+}
+
+#info_apps_deviceList_view .list {
+ position: absolute;
+ width: 629px;
+ height: 251px;
+ border-radius: 2px;
+ left: 100px;
+ top: 154px;
+}
+
+#info_apps_deviceList_view .list-content {
+ width: 578px;
+ border: none;
+}
+
+#info_apps_deviceList_view .list-item {
+ border: 1px solid #393939 !important;
+}
+
+/******************* For Info.Apps menu*******************/
+#info_apps {
+ position: absolute;
+ top: 48px;
+ left: 153px;
+ width: 647px;
+ height: 384px;
+ float: left;
+ z-index: 1001;
+}
+
+#info_apps .backButton {
+ top: 59px;
+}
+
+#info_apps .block-header-title {
+ top: 67px;
+ left: 73px;
+}
+
+#info_apps_pushToTalk_buttton {
+ top: 80px;
+ right: 5px;
+ height: 48px;
+ width: 48px;
+ border: 1px solid #4bffff;
+ border-radius: 2px;
+}
+
+#info_apps_list {
+ top: 70px;
+ left: 13px;
+}
+
+#info_appst {
+ height: 250px;
+ position: relative;
+ float: left;
+ margin-top: 5px;
+ width: 554px;
+}
+
+#info_apps .list {
+ width: 629px;
+ height: 251px;
+}
+
+#info_apps_list .list-item .ico {
+ width: 50px;
+ height: 50px;
+ position: absolute;
+}
+
+#info_apps_list .list-item span {
+ margin-left: 50px;
+}
+
+#info_apps_list .list-item {
+ height: 48px !important;
+ border: 1px solid #393939;
+}
+
+#info_apps_list .list-content {
+ width: 279px;
+ border: none !important;
+}
+
+#info_apps .leftButtons {
+ width: 278px;
+ float: left;
+ margin-right: 10px;
+ height: 51px;
+ font-size: 20px;
+ line-height: 50px;
+ border: 1px solid #393939;
+ cursor: pointer;
+ left: 10px;
+}
+
+#info_apps .vehicleHealthReport {
+ top: 70px;
+}
+
+#info_apps .Asist911 {
+ top: 122px;
+}
+
+#info_apps .installButton {
+ top: 174px;
+}
+
+#info_apps .findNewApps {
+ top: 226px;
+}
+
+#info_apps .findNewApps img {
+ margin: 9px;
+ width: 32px;
+}
+
+#info_apps .getDeviceList {
+ top: 278px;
+}
+
+#info_apps .getDeviceList img {
+ width: 38px;
+ margin: 6px;
+}
+
+#info_apps .list {
+ float: right;
+ margin-right: 41px;
+ width: 330px
+}
+
+#info_apps_install_Button span {
+ position: absolute;
+}
+
+#info_apps.fr #info_apps_install_Button span {
+ position: absolute;
+ line-height: 20px;
+ width: 170px;
+ top: 3px;
+}
+
+#info_apps .list-item .ico {
+ float: left;
+}
+
+#info_apps .list-item span {
+ height: 23px;
+}
+
+#info_apps .inner-wrapper {
+ left: 100px;
+ top: 71px;
+}
+
+#info_apps_install_Button {
+ border: 1px solid #393939;
+ border-radius: 2px;
+ top: 269px;
+ left: 303px;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/mcs.css b/src/components/HMI/css/mcs.css
new file mode 100644
index 0000000000..304e2ee8d6
--- /dev/null
+++ b/src/components/HMI/css/mcs.css
@@ -0,0 +1,3703 @@
+/*** Multi Contour Seat ** */
+#back-button {
+ background: url(../images/common/page-back-button.png) no-repeat center
+ 12px, url(../images/common/btn-48h.png);
+ width: 48px;
+ z-index: 5000;
+ left: -107px;
+ top: -72px;
+}
+
+#back-button.pressed {
+ background: url(../images/common/page-back-button.png) no-repeat center
+ 12px, url(../images/common/btn-48h-pressed.png);
+}
+
+#MultiContourSeat_customMassage {
+ visibility: hidden;
+ background-color: #000;
+ z-index: 200;
+ width: 800px;
+ height: 345px;
+ position: absolute;
+ top: -60px;
+ left: -112px;
+}
+
+#MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#MultiContourSeat_customMassage_caption2 {
+ top: 35px;
+ width: 350px;
+ text-align: center;
+ left: 225px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .MultiContourSeat_customMassage_previewButton
+ {
+ top: 172px;
+ left: 620px;
+ width: 120px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .MultiContourSeat_customMassage_previewButtonTop
+ {
+ top: 113px;
+ left: 535px;
+ width: 120px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .MultiContourSeat_customMassage_previewButtonBottom
+ {
+ top: 239px;
+ left: 535px;
+ width: 120px;
+ text-align: center;
+}
+
+#MultiContourSeat_customMassage_backButton {
+ top: 220px;
+ left: 535px;
+ width: 120px;
+ text-align: center;
+}
+
+#MultiContourSeat_customMassage_backButtonCenter {
+ bottom: 10px;
+ left: 340px;
+ width: 120px;
+ text-align: center;
+}
+
+#MultiContourSeatContainer .led {
+ width: 12px;
+ height: 40px;
+ background: url("../images/common/seat-act-led.png") no-repeat;
+ position: relative !important;
+ float: left;
+ background-position: -4px 0;
+}
+
+#MultiContourSeatContainer .led-inactive {
+ background: url("../images/common/seat-inact-led.png") no-repeat;
+ background-position: 3px 8px;
+ width: 12px;
+ height: 40px;
+ position: relative !important;
+ float: left;
+}
+
+#MultiContourSeat_customMassage .led {
+ /*background-position: -4px -6px;*/
+
+}
+
+#MultiContourSeat_customMassage .led-inactive {
+ /*background-position: 3px 2px;*/
+
+}
+
+#contentMCS {
+ top: 83px;
+ left: 112px;
+}
+
+#MultiContourSeatContainer {
+ position: absolute;
+ background-color: black;
+ width: 800px;
+ height: 384px;
+ top: -38px;
+ left: -160px;
+ z-index: 1001;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .block-header-title {
+ font-size: 26px;
+ width: 400px;
+ top: -72px;
+ left: -38px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .view_settings_vehicle_MultiContourSeat-left-s
+ {
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat-left-s.png)
+ no-repeat;
+ width: 193px;
+ height: 263px;
+ left: -70px;
+ top: -40px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .view_settings_vehicle_MultiContourSeat-Massage-left-s
+ {
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat-driver_massage_seat.png)
+ no-repeat;
+ width: 193px;
+ height: 263px;
+ left: -70px;
+ top: -40px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .notActiveSeat {
+ opacity: 0.5;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .not_selected .active {
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .driver {
+ width: 158px;
+ left: -54px;
+ top: 226px;
+ text-align: center;
+ line-height: 49px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .btn-48.active {
+ background: url(../images/common/btn-48h-active-gray.png) repeat-x
+ !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .btn-28.active {
+ background: url(../images/settings/btn-28h-gray-active.png) repeat-x
+ !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .adjust {
+ width: 158px;
+ left: -54px;
+ top: 226px;
+ text-align: center;
+ line-height: 49px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .massage {
+ width: 144px;
+ left: 299px;
+ top: -60px;
+ text-align: center;
+ line-height: 49px;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+ -webkit-border-top-right-radius: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ -moz-border-radius-topright: 3px;
+ -moz-border-radius-bottomright: 3px;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .adjust {
+ width: 144px;
+ left: 154px;
+ top: -60px;
+ text-align: center;
+ line-height: 49px;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+ -webkit-border-top-left-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -moz-border-radius-topleft: 3px;
+ -moz-border-radius-bottomleft: 3px;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .passenger {
+ width: 158px;
+ left: 496px;
+ top: 227px;
+ text-align: center;
+ line-height: 49px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .pressed {
+ background: url(../images/common/btn-48h-pressed.png) bottom repeat-x
+ !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-1 {
+ width: 32px;
+ height: 39px;
+ left: 414px;
+ top: 3px;
+ background: url(../images/settings/seats.png) no-repeat;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-2 {
+ width: 32px;
+ height: 39px;
+ left: 414px;
+ top: 61px;
+ background: url(../images/settings/seats.png) no-repeat 0 -61px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-3 {
+ width: 32px;
+ height: 39px;
+ left: 414px;
+ top: 118px;
+ background: url(../images/settings/seats.png) no-repeat 0 -117px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-4 {
+ width: 32px;
+ height: 39px;
+ left: 414px;
+ top: 179px;
+ background: url(../images/settings/seats.png) no-repeat 0 -177px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-5 {
+ width: 32px;
+ height: 39px;
+ left: 414px;
+ top: 236px;
+ background: url(../images/settings/seats.png) no-repeat 0 -233px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-1 {
+ width: 32px;
+ height: 38px;
+ left: 414px;
+ top: 3px;
+ background: url(../images/settings/seats-message.png) no-repeat;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-2 {
+ width: 32px;
+ height: 38px;
+ left: 414px;
+ top: 63px;
+ background: url(../images/settings/seats-message.png) no-repeat 0 -61px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seat-right {
+ width: 193px;
+ height: 263px;
+ left: 480px;
+ top: -40px;
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat-right-s.png)
+ no-repeat;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .massage-seat-right {
+ width: 193px;
+ height: 263px;
+ left: 480px;
+ top: -40px;
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat-Passenger_massage_seat.png)
+ no-repeat;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control {
+ width: 238px;
+ height: 41px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#MultiContourSeat_customMassage .control {
+ width: 213px;
+ /*height: 28px;*/
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .indButtonMCS.active,#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions.active,#view_settings_vehicle_MultiContourSeat_Adjust .control.active
+ {
+ border: 1px solid #ff9900;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control .minus {
+ width: 58px;
+ height: 41px;
+ border-right: 1px solid #393939;
+ -webkit-border-top-right-radius: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ -moz-border-radius-topright: 3px;
+ -moz-border-radius-bottomright: 3px;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+ top: 0;
+ left: 0;
+ background: url(../images/common/btn-48h.png);
+ position: relative;
+ float: left;
+ cursor: pointer;
+}
+
+#MultiContourSeat_customMassage .control .minus { /* height: 28px;*/
+
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .ledContainer {
+ position: relative;
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control .plus {
+ width: 58px;
+ height: 41px;
+ border-left: 1px solid #393939;
+ -webkit-border-top-left-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -moz-border-radius-topleft: 3px;
+ -moz-border-radius-bottomleft: 3px;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+ top: 0px;
+ right: 0;
+ background: url(../images/common/btn-48h.png);
+ cursor: pointer;
+}
+
+#MultiContourSeat_customMassage .control .plus { /* height: 28px;*/
+
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control .minus .ico {
+ top: 19px;
+ left: 20px;
+ position: absolute;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control .plus .ico {
+ top: 12px;
+ left: 20px;
+ position: absolute;
+}
+
+#MultiContourSeat_customMassage .control .minus .ico { /*top: 13px;*/
+
+}
+
+#MultiContourSeat_customMassage .control .plus .ico { /*top: 6px;;*/
+
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control-1 {
+ top: 1px;
+ left: 155px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control-2 {
+ top: 60px;
+ left: 155px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control-3 {
+ top: 119px;
+ left: 155px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control-4 {
+ top: 177px;
+ left: 155px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .control-5 {
+ top: 235px;
+ left: 154px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-1 {
+ left: 60px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-2 {
+ left: 71px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-3 {
+ left: 82px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-4 {
+ left: 93px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-5 {
+ left: 104px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-6 {
+ left: 115px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-7 {
+ left: 126px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-8 {
+ left: 137px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-9 {
+ left: 148px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .led-10 {
+ left: 159px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions {
+ width: 238px;
+ height: 48px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ left: 154px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions-1
+ {
+ top: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions-2
+ {
+ top: 60px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .quality {
+ width: 79px;
+ height: 48px;
+ background: url(../images/common/btn-48h.png);
+ font-size: 20px;
+ text-align: center;
+ line-height: 48px;
+ cursor: pointer;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .delim {
+ width: 4px;
+ height: 48px;
+ background: url(../images/common/delim.png) no-repeat;
+ z-index: 100;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .active.quality {
+ background: url(../images/common/btn-48h-active-gray.png) !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .delim-0 {
+ left: 76px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .delim-1 {
+ left: 158px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .button0 {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .button1 {
+ left: 80px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust .button2 {
+ left: 159px;
+}
+
+#MultiContourSeatContainer .indButtonMCS {
+ width: 84px;
+ height: 49px;
+ cursor: pointer;
+}
+
+#MultiContourSeatContainer .indButtonMCS .ico {
+ top: 1px;
+ left: 26px;
+ position: absolute;
+}
+
+#MultiContourSeatContainer .indButtonMCS div {
+ width: 22px;
+ height: 17px;
+ top: 35px;
+ left: 25px;
+ position: relative;
+ float: left;
+ margin-left: -9px;
+}
+
+#MultiContourSeatContainer .indButtonMCS div.small_ind_def {
+ background: url(../images/climate/small_ind_def.png) no-repeat;
+}
+
+#MultiContourSeatContainer .indButtonMCS div.small_ind_active {
+ background: url(../images/climate/small_ind_active.png) no-repeat;
+}
+
+#MultiContourSeatContainer .indButtonMCS.notpressed {
+ background: url(../images/common/btn-48h.png);
+ background-size: contain;
+ border-radius: 3px;
+ border: 1px solid #393939;
+}
+
+#MultiContourSeatContainer .indButtonMCS.pressed {
+ background: url(../images/climate/left_person_control/rb_bg_pressed.png)
+ no-repeat;
+}
+
+/* BEGIN concept 1.1 */
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions
+ {
+ left: 186px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageTop1
+ {
+ width: 18px;
+ height: 27px;
+ left: 150px;
+ background-image: url(../images/settings/massageTop.png) !important;
+ background-repeat: no-repeat;
+ top: 8px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageTop2
+ {
+ width: 30px;
+ height: 27px;
+ left: 150px;
+ background-image: url(../images/settings/massageBottom.png) !important;
+ background-repeat: no-repeat;
+ top: 52px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageTop3
+ {
+ width: 30px;
+ height: 27px;
+ left: 143px;
+ background-image: url(../images/settings/massageVertical.png) !important;
+ background-repeat: no-repeat;
+ top: 96px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .dividerBlocks
+ {
+ width: 292px;
+ height: 0px;
+ border: 1px solid #525252;
+ left: 154px;
+ top: 139px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageBottom1
+ {
+ width: 29px;
+ height: 21px;
+ left: 143px;
+ background-image: url(../images/settings/MassageCircle.png) !important;
+ background-repeat: no-repeat;
+ top: 162px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageBottom2
+ {
+ width: 29px;
+ height: 30px;
+ left: 144px;
+ background-image: url(../images/settings/massageRound.png) !important;
+ background-repeat: no-repeat;
+ top: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageBottom3
+ {
+ width: 27px;
+ height: 30px;
+ left: 144px;
+ background-image: url(../images/settings/massageHorisontal.png)
+ !important;
+ background-repeat: no-repeat;
+ top: 245px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-1
+ {
+ top: 46px;
+ left: 428px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-2
+ {
+ top: 196px;
+ left: 428px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .quality
+ {
+ width: 56px;
+ height: 38px;
+ line-height: 38px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions
+ {
+ width: 224px;
+ height: 38px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-top2
+ {
+ top: 45px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-top3
+ {
+ top: 90px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-bottom1
+ {
+ top: 150px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-bottom2
+ {
+ top: 195px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-bottom3
+ {
+ top: 240px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim
+ {
+ height: 38px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim-0
+ {
+ left: 54px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim-1
+ {
+ left: 110px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim-2
+ {
+ left: 166px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button0
+ {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button1
+ {
+ left: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button2
+ {
+ left: 112px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button3
+ {
+ left: 168px;
+}
+
+/* END concept 1.1 */ /* BEGIN concept 1.2 */
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions
+ {
+ left: 154px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-1
+ {
+ top: 35px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-2
+ {
+ top: 203px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .quality
+ {
+ width: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .quality img
+ {
+ margin-top: 10px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions
+ {
+ width: 224px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions-top2
+ {
+ top: 60px;
+ left: 210px;
+ width: 168px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions-bottom1
+ {
+ top: 170px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions-bottom2
+ {
+ top: 230px;
+ left: 210px;
+ width: 168px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .delim-0
+ {
+ left: 54px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .delim-1
+ {
+ left: 110px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .delim-2
+ {
+ left: 166px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button0
+ {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button1
+ {
+ left: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button2
+ {
+ left: 112px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button3
+ {
+ left: 168px;
+}
+
+/* END concept 1.2 */ /* BEGIN concept 1.3 */
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .indButtonMCS div.small_ind_active
+ {
+ background: url(../images/climate/small_ind_green.png) no-repeat;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .patternTextIndicator
+ {
+ top: -29px;
+ width: 80px;
+ text-align: center;
+ font-size: 18px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .patternTextTop
+ {
+ left: 280px;
+ width: 150px;
+ text-align: center;
+ font-size: 18px;
+ top: 30px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .patternTextBottom
+ {
+ left: 280px;
+ width: 150px;
+ text-align: center;
+ font-size: 18px;
+ top: 140px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions
+ {
+ left: 154px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-1
+ {
+ top: 35px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-2
+ {
+ top: 203px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .quality
+ {
+ width: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .quality img
+ {
+ margin-top: 10px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions
+ {
+ width: 224px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-top1
+ {
+ left: 159px;
+ top: 60px;
+ width: 78px;
+ height: 20px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-top2
+ {
+ left: 270px;
+ top: 60px;
+ width: 168px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-bottom1
+ {
+ top: 170px;
+ left: 159px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-bottom2
+ {
+ top: 170px;
+ left: 270px;
+ width: 168px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .delim-0
+ {
+ left: 54px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .delim-1
+ {
+ left: 110px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .delim-2
+ {
+ left: 166px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button0
+ {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button1
+ {
+ left: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button2
+ {
+ left: 112px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button3
+ {
+ left: 168px;
+}
+
+/* END concept 1.3 */ /* BEGIN concept 1.4 */
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternText1
+ {
+ width: 78px;
+ height: 20px;
+ top: 65px;
+ left: 270px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .pattern1
+ {
+ background-image: url('../images/settings/massageTop.png');
+ background-repeat: no-repeat;
+ background-position: 53px 0px;
+ background-size: contain;
+ width: 83px;
+ height: 20px;
+ top: 65px;
+ left: 209px;
+ text-align: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .pattern2
+ {
+ background-image: url('../images/settings/massageBottom.png');
+ background-repeat: no-repeat;
+ background-position: 53px 0px;
+ background-size: contain;
+ width: 83px;
+ height: 20px;
+ top: 65px;
+ left: 209px;
+ text-align: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .pattern3
+ {
+ background-image: url('../images/settings/massageVertical.png');
+ background-repeat: no-repeat;
+ background-position: 52px 0px;
+ background-size: contain;
+ width: 83px;
+ height: 20px;
+ top: 65px;
+ left: 202px;
+ text-align: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternbottom1
+ {
+ background-image: url('../images/settings/massageCircle.png');
+ background-repeat: no-repeat;
+ background-position: 53px 0px;
+ background-size: contain;
+ width: 83px;
+ height: 20px;
+ top: 165px;
+ left: 196px;
+ text-align: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternbottom2
+ {
+ background-image: url('../images/settings/massageRound.png');
+ background-repeat: no-repeat;
+ background-position: 55px 0px;
+ background-size: contain;
+ width: 83px;
+ height: 20px;
+ top: 165px;
+ left: 196px;
+ text-align: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternbottom3
+ {
+ background-image: url('../images/settings/massageHorisontal.png');
+ background-repeat: no-repeat;
+ background-position: 55px 0px;
+ background-size: contain;
+ width: 83px;
+ height: 20px;
+ top: 165px;
+ left: 202px;
+ text-align: left;
+}
+
+#seatsMassageView1_4 .seatsMassageView1_4_seatLabel {
+ top: 172px;
+ left: 45px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-2
+ {
+ top: 105px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternText2
+ {
+ width: 78px;
+ height: 20px;
+ top: 165px;
+ left: 271px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .labelTitle
+ {
+ width: 600px;
+ text-align: left;
+ height: 30px;
+ line-height: 30px;
+ font-size: 26px;
+ left: 74px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Settings
+ {
+ top: 200px;
+ left: 197px;
+ width: 138px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Settings span
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Settings .ico
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage
+ {
+ text-align: center;
+ height: 48px;
+ line-height: 48px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage.button0
+ {
+ top: 70px;
+ left: 45px;
+ width: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage.button1
+ {
+ top: 130px;
+ left: 45px;
+ width: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage.button2
+ {
+ top: 190px;
+ left: 45px;
+ width: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Back
+ {
+ top: 280px;
+ left: 45px;
+ width: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5SettingsScreen
+ {
+ top: -60px;
+ left: -112px;
+ width: 800px;
+ height: 345px;
+ background: black;
+ z-index: 100;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .btn-48
+ {
+ line-height: 48px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .show
+ {
+ visibility: visible !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .hide
+ {
+ visibility: hidden;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .quality
+ {
+ width: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .quality img
+ {
+ margin-top: 10px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions-top
+ {
+ left: 355px;
+ top: 120px;
+ width: 168px !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions-bottom
+ {
+ left: 355px;
+ top: 210px;
+ width: 168px !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions
+ {
+ width: 224px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions-2
+ {
+ top: 100px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .delim-0
+ {
+ left: 54px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .delim-1
+ {
+ left: 110px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .delim-2
+ {
+ left: 166px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button0
+ {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button1
+ {
+ left: 56px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button2
+ {
+ left: 112px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button3
+ {
+ left: 168px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 #alternatingMassage .seats-message-1
+ {
+ width: 32px;
+ height: 38px;
+ top: 126px;
+ background: url(../images/settings/seats-message.png) no-repeat;
+ left: 285px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 #alternatingMassage .seats-message-2
+ {
+ width: 32px;
+ height: 38px;
+ top: 216px;
+ left: 285px;
+ background: url(../images/settings/seats-message.png) no-repeat 0 -61px;
+}
+
+/* END concept 1.4 */ /* BEGIN concept 1.5 */
+#seatsMassageView1_5 .seatsMassageView1_5_seatLabel {
+ top: 160px;
+ left: 0px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .labelTitle
+ {
+ width: 600px;
+ text-align: left;
+ height: 30px;
+ line-height: 30px;
+ font-size: 26px;
+ left: 74px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .labelText
+ {
+ top: 97px;
+ width: 672px;
+ text-align: center;
+ left: 140px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Settings
+ {
+ top: 120px;
+ left: 205px;
+ width: 138px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Settings span
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Settings .ico
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage
+ {
+ text-align: center;
+ height: 48px;
+ line-height: 48px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage.button0
+ {
+ top: 147px;
+ left: 240px;
+ width: 150px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage.button1
+ {
+ top: 147px;
+ left: 400px;
+ width: 150px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage.button2
+ {
+ top: 147px;
+ left: 560px;
+ width: 150px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Back
+ {
+ top: 280px;
+ left: 45px;
+ width: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5SettingsScreen
+ {
+ top: -60px;
+ left: -112px;
+ width: 800px;
+ height: 345px;
+ background: black;
+ z-index: 100;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings .ico
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .btn-48
+ {
+ line-height: 48px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .show
+ {
+ visibility: visible !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .hide
+ {
+ visibility: hidden;
+}
+
+/* END concept 1.5 */ /* BEGIN HMI concept 2.1 */
+#seatsMassageView2_1 .seatsMassageView2_1_seatLabel {
+ top: 160px;
+ left: 0px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView2_1 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView2_1 .control {
+ width: 237px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .quality
+ {
+ width: 50px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .seats-message-actions
+ {
+ width: 250px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .delim-0
+ {
+ left: 48px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .delim-1
+ {
+ left: 98px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .delim-2
+ {
+ left: 148px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button0
+ {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button1
+ {
+ left: 50px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button2
+ {
+ left: 100px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button3
+ {
+ left: 150px;
+ width: 100px;
+}
+
+#seatsMassageView2_1_settingsButton {
+ width: 210px;
+ left: 175px;
+ top: 130px;
+ line-height: 49px;
+}
+
+#seatsMassageView2_1_settingsButton .ico {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-11
+ {
+ top: 60px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-12
+ {
+ top: 105px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-13
+ {
+ top: 150px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-14
+ {
+ top: 210px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-15
+ {
+ top: 255px;
+ left: 370px;
+}
+
+#seatsMassageView2_1 #MultiContourSeat_customMassage .seats-message-1 {
+ left: 150px;
+ top: 107px;
+}
+
+#seatsMassageView2_1 #MultiContourSeat_customMassage .seats-message-2 {
+ left: 150px;
+ top: 234px;
+}
+
+#seatsMassageView2_1_upperLabel {
+ top: 73px;
+ left: 645px;
+}
+
+#seatsMassageView2_1_middleLabel {
+ top: 117px;
+ left: 645px;
+}
+
+#seatsMassageView2_1_lowerLabel {
+ top: 162px;
+ left: 645px;
+}
+
+#seatsMassageView2_1_frontLabel {
+ top: 223px;
+ left: 645px;
+}
+
+#seatsMassageView2_1_rearLabel {
+ top: 266px;
+ left: 645px;
+}
+
+/* END HMI concept 2.1 */ /* BEGIN HMI concept 2.2 */
+#seatsMassageView2_2 .MultiContourSeat_customMassage_previewButtonTop {
+ top: 134px;
+ left: 625px;
+ width: 120px;
+ text-align: center;
+}
+
+#seatsMassageView2_2 .MultiContourSeat_customMassage_previewButtonBottom
+ {
+ top: 282px;
+ left: 625px;
+ width: 120px;
+ text-align: center;
+}
+
+#seatsMassageView2_2 .control {
+ width: 240px;
+ /*height: 28px;*/
+}
+
+#seatsMassageView2_2 .seatsMassageView2_2_seatLabel {
+ top: 172px;
+ left: 0px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .quality
+ {
+ width: 100px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .seats-message-actions
+ {
+ width: 200px;
+ left: 198px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .delim-0
+ {
+ left: 98px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .button0
+ {
+ left: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .button1
+ {
+ left: 100px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-11
+ {
+ top: 80px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-12
+ {
+ top: 125px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-13
+ {
+ top: 170px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-14
+ {
+ top: 253px;
+ left: 370px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-15
+ {
+ top: 298px;
+ left: 370px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-1 {
+ left: 230px;
+ top: 128px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-2 {
+ left: 720px;
+ top: 275px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-actions-3
+ {
+ top: 45px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-actions-4
+ {
+ top: 218px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-actions
+ {
+ left: 358px;
+ width: 265px;
+ height: 28px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .quality {
+ width: 50px;
+ height: 28px;
+ line-height: 29px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .delim {
+ height: 28px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .delim-0 {
+ left: 48px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .delim-1 {
+ left: 98px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .delim-2 {
+ left: 148px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .button0 {
+ left: 0;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .button1 {
+ left: 50px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .button2 {
+ left: 100px;
+}
+
+#seatsMassageView2_2 #MultiContourSeat_customMassage .button3 {
+ left: 150px;
+ width: 115px;
+}
+
+#seatsMassageView2_2_upperLabel {
+ top: 93px;
+ left: 645px;
+}
+
+#seatsMassageView2_2_middleLabel {
+ top: 138px;
+ left: 645px;
+}
+
+#seatsMassageView2_2_lowerLabel {
+ top: 182px;
+ left: 645px;
+}
+
+#seatsMassageView2_2_frontLabel {
+ top: 266px;
+ left: 645px;
+}
+
+#seatsMassageView2_2_rearLabel {
+ top: 310px;
+ left: 645px;
+}
+
+#seatsMassageView2_2_settingsButton {
+ width: 210px;
+ left: 192px;
+ top: 130px;
+ line-height: 49px;
+}
+
+#seatsMassageView2_2_settingsButton .ico {
+ float: left;
+}
+
+/* END HMI concept 2.2 */ /* BEGIN HMI concept 4.1 */
+#seatsMassageView4_1 .seatsMassageView4_1_seatLabel {
+ top: 172px;
+ left: 45px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView4_1_settingsButton {
+ width: 140px;
+ left: 200px;
+ top: 130px;
+ line-height: 49px;
+}
+
+#seatsMassageView4_1_settingsButton .ico {
+ float: left;
+}
+
+#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-actions
+ {
+ left: 280px;
+}
+
+#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-actions-3
+ {
+ top: 115px;
+}
+
+#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-actions-4
+ {
+ top: 205px;
+}
+
+#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-3 {
+ right: 220px;
+ top: 120px;
+ width: 32px;
+ height: 38px;
+ background: url(../images/settings/seats-message.png) no-repeat;
+}
+
+#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-4 {
+ right: 220px;
+ top: 210px;
+ width: 32px;
+ height: 38px;
+ background: url(../images/settings/seats-message.png) no-repeat 0 -61px;
+}
+
+/* END HMI concept 4.1 */ /* BEGIN HMI concept 5.1 */
+#seatsMassageView5_1 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView5_1 .seatsMassageView5_1_seatLabel {
+ top: 187px;
+ left: 0px;
+ font-size: 24px;
+ width: 140px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 #MultiContourSeat_customMassage_backButtonCenter
+ {
+ bottom: 0px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .lableToggleButton
+ {
+ height: 48px;
+ border: 1px solid gray;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .lableToggleButton .btn-48
+ {
+ height: 46px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .lableToggleButton .lableToggle
+ {
+ line-height: 30px;
+ margin-left: 10px;
+ margin-top: 10px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer
+ {
+ width: 100px;
+ margin: 0px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer .toggles
+ {
+ position: absolute;
+ float: left;
+ width: 50px;
+ height: 28px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .seatsMassageView_settingsButton
+ {
+ width: 140px;
+ left: 200px;
+ top: 130px;
+ line-height: 49px;
+ text-align: left !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .seatsMassageView_settingsButton span
+ {
+ position: absolute;
+ line-height: 50px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer span
+ {
+ position: absolute;
+ width: 50px;
+ margin-top: 0px;
+ text-align: center;
+ line-height: 28px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .seats-message-actions-3
+ {
+ left: 247px;
+ margin-top: 10px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings
+ {
+ top: 200px;
+ left: 197px;
+ width: 138px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings span
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings .ico
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Massage
+ {
+ text-align: center;
+ height: 48px;
+ line-height: 48px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist {
+ top: 76px;
+ left: 139px;
+ height: 251px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-content {
+ width: 674px;
+ border-right: none;
+ border-top: none;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item:first-child,#seatsMassageView5_1 .MCSSettingslist .soundButton:first-child
+ {
+ border-top: 1px solid #393939;
+ height: 48px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item {
+ position: relative;
+ width: 577px;
+ float: left;
+ height: 49px;
+ border-bottom: 1px solid #393939;
+ border-right: 1px solid #393939;
+ line-height: 50px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item.soundButton {
+ width: 48px;
+ border-left: 1px solid #393939;
+ margin-left: 10px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item.soundButton .ico {
+ border: none;
+ margin-top: 12px;
+ margin-right: 11px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item.pressed {
+ background: url(../images/phone/phone_button_bg_active.png) repeat-x
+ !important;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item>span {
+ margin-left: 13px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item .ico {
+ float: right;
+ border: 1px solid #393939;
+ border-radius: 2px;
+ margin-top: 9px;
+ margin-right: 9px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .list-item.big-ico img {
+ float: right;
+ border: none;
+ margin-top: 4px;
+ margin-right: 9px;
+}
+
+#seatsMassageView5_1 .MCSSettingslist .toggles,#seatsMassageView5_1 .MCSSettingslist .toggles span
+ {
+ width: 148px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .MCSSettingslist .button1
+ {
+ left: 148px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .MCSSettingslist .delim
+ {
+ height: 29px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .MCSSettingslist .delim-0
+ {
+ left: 147px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer .button1
+ {
+ left: 50px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer .delim-0
+ {
+ left: 48px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Back
+ {
+ top: 280px;
+ left: 45px;
+ width: 200px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5SettingsScreen
+ {
+ top: -60px;
+ left: 154px;
+ width: 291px;
+ height: 345px;
+ background: black;
+ z-index: 100;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .btn-48
+ {
+ line-height: 48px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .show
+ {
+ visibility: visible !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .hide
+ {
+ visibility: hidden;
+}
+
+/* END HMI concept 5.1 */ /* BEGIN HMI concept 5.2 */
+#seatsMassageView5_2_settingsButton {
+ width: 140px;
+ left: 200px;
+ top: 130px;
+ line-height: 49px;
+}
+
+#seatsMassageView5_2 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView5_2 .seatsMassageView5_2_seatLabel {
+ top: 160px;
+ left: 0px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView5_2_settingsButton .ico {
+ float: left;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions
+ {
+ left: 275px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions-3
+ {
+ top: 90px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions-4
+ {
+ top: 190px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .quality {
+ width: 50px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions
+ {
+ width: 250px;
+}
+
+#MultiContourSeat_customMassage_5_2_topLabel {
+ top: 65px;
+ left: 275px;
+ width: 250px;
+ text-align: center;
+}
+
+#MultiContourSeat_customMassage_5_2_bottomLabel {
+ top: 165px;
+ left: 275px;
+ width: 250px;
+ text-align: center;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-0 {
+ left: 48px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-1 {
+ left: 98px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-2 {
+ left: 148px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-3 {
+ left: 198px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .button0 {
+ left: 0;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .button1 {
+ left: 50px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .button2 {
+ left: 100px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .button3 {
+ left: 150px;
+}
+
+#seatsMassageView5_2 #MultiContourSeat_customMassage .button4 {
+ left: 200px;
+}
+
+/* END HMI concept 5.2 */ /* BEGIN HMI concept 6.1 */
+#seatsMassageView6_1 #settingsScreen .seatsMassageView6_1_seatLabel {
+ top: 13px;
+ left: 600px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView6_1 .mySettingsPopUpTitle {
+ width: 143px;
+ height: 25px;
+ position: absolute;
+ top: 163px;
+ left: 216px !important;
+ background: gray;
+ text-align: center;
+ line-height: 25px;
+ font-size: 16px !important;
+ font-weight: bold;
+}
+
+#seatsMassageView6_1 .mySettingsLabel {
+ z-index: 100;
+ left: 102px;
+}
+
+#seatsMassageView6_1 .MultiContourSeat_customMassage .btn-28.active {
+ background: url(../images/common/btn-48h-active-gray.png) repeat-x
+ !important;
+}
+
+#seatsMassageView6_1 #settingsScreen .durationButtons .quality,#seatsMassageView6_1 #settingsScreen .pauseButtons .quality
+ {
+ width: 60px;
+}
+
+#seatsMassageView6_1 #settingsScreen .quality {
+ height: 35px;
+ width: 130px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#seatsMassageView6_1 #settingsScreen .btn-28 {
+ text-align: center;
+ line-height: 34px;
+}
+
+#seatsMassageView6_1 .settingsScreen {
+ width: 800px;
+ height: 368px;
+ top: -15px;
+ background: black;
+ visibility: hidden;
+}
+
+#seatsMassageView6_1 .settingsScreen2 {
+ width: 800px;
+ height: 368px;
+ top: -15px;
+ background: black;
+ visibility: hidden;
+}
+
+#seatsMassageView6_1 #settingsScreen .seats-message-actions {
+ height: 39px;
+ border: none;
+}
+
+#seatsMassageView6_1 #settingsScreen .button0 {
+ left: 0;
+}
+
+#seatsMassageView6_1 #settingsScreen .button1 {
+ left: 140px;
+}
+
+#seatsMassageView6_1 #settingsScreen .button2 {
+ left: 280px;
+}
+
+#seatsMassageView6_1 #settingsScreen .button3 {
+ left: 420px;
+}
+
+#seatsMassageView6_1 #settingsScreen .durationButtons .button0,#seatsMassageView6_1 #settingsScreen .pauseButtons .button0
+ {
+ left: 0;
+}
+
+#seatsMassageView6_1 #settingsScreen .durationButtons .button1,#seatsMassageView6_1 #settingsScreen .pauseButtons .button1
+ {
+ left: 70px;
+}
+
+#seatsMassageView6_1 #settingsScreen .durationButtons .button2,#seatsMassageView6_1 #settingsScreen .pauseButtons .button2
+ {
+ left: 140px;
+}
+
+#seatsMassageView6_1 #settingsScreen .durationButtons .button3,#seatsMassageView6_1 #settingsScreen .pauseButtons .button3
+ {
+ left: 210px;
+}
+
+#seatsMassageView6_1 #settingsScreen .durationButtons .button4,#seatsMassageView6_1 #settingsScreen .pauseButtons .button4
+ {
+ left: 280px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-11
+ {
+ top: 60px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-12
+ {
+ top: 105px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-13
+ {
+ top: 150px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-14
+ {
+ top: 230px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-15
+ {
+ top: 275px;
+ left: 350px;
+}
+
+#seatsMassageView6_1 #settingsScreen2 .seats-message-1 {
+ left: 280px;
+ top: 110px;
+}
+
+#seatsMassageView6_1 #settingsScreen2 .seats-message-2 {
+ left: 280px;
+ top: 252px;
+}
+
+#seatsMassageView6_1 .seatsMassageView6_1_seatLabel {
+ top: 172px;
+ left: 45px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView6_1 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView6_1 .seatsMassageView6_1_upperLabel {
+ top: 73px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_1 .seatsMassageView6_1_middleLabel {
+ top: 118px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_1 .seatsMassageView6_1_lowerLabel {
+ top: 163px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_1 .seatsMassageView6_1_frontLabel {
+ top: 243px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_1 .seatsMassageView6_1_rearLabel {
+ top: 287px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_1 .label {
+ font-size: 26px;
+ left: 20px;
+}
+
+#seatsMassageView6_1 .massageLabel {
+ top: 51px;
+}
+
+#seatsMassageView6_1 .pattern {
+ top: 91px;
+}
+
+#seatsMassageView6_1 .intensity {
+ top: 131px;
+}
+
+#seatsMassageView6_1 .speed {
+ top: 211px;
+}
+
+#seatsMassageView6_1 .duration {
+ top: 251px;
+}
+
+#seatsMassageView6_1 .pause {
+ top: 291px;
+}
+
+#seatsMassageView6_1 .editMenu {
+ left: 70px;
+ width: 240px;
+ top: 12px;
+ text-align: center;
+}
+
+#seatsMassageView6_1 .massageButtons {
+ top: 50px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_1 .massageButtons img {
+ height: 34px;
+}
+
+#seatsMassageView6_1 .patternButtons {
+ top: 90px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_1 .intensityButtons {
+ top: 130px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_1 .intensityEditCustom {
+ top: 170px;
+ left: 520px;
+ width: 270px;
+ height: 34px;
+}
+
+#seatsMassageView6_1 .speedButtons {
+ top: 210px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_1 .durationButtons {
+ top: 250px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_1 .pauseButtons {
+ top: 290px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_1 .preview {
+ top: 330px;
+ left: 289px;
+ width: 214px;
+ height: 34px;
+}
+
+#seatsMassageView6_1 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView6_1 .settingsScreen2 .MultiContourSeat_customMassage_caption
+ {
+ top: 14px;
+}
+
+#seatsMassageView6_1 .SettingsBlocks {
+ margin-left: auto;
+ margin-right: auto;
+ width: 315px;
+ height: 50px;
+ position: relative;
+ -webkit-transition: width 1s;
+}
+
+#seatsMassageView6_1 .MultiContourSeat_customMassage {
+ visibility: hidden;
+ background-color: #000;
+ z-index: 200;
+ width: 800px;
+ height: 345px;
+ position: absolute;
+ top: -60px;
+ left: -112px;
+ background-image: url('../images/settings/mcsBlockBackArrow6_1.png');
+ background-position: 339px 39px;
+ background-repeat: no-repeat;
+}
+
+#seatsMassageView6_1 .btn-48 {
+ line-height: 48px;
+ text-align: center;
+}
+
+#seatsMassageView6_1 .show {
+ visibility: visible !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonUp
+ {
+ width: 200px;
+ left: 560px;
+ top: 101px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonDown
+ {
+ width: 200px;
+ left: 560px;
+ bottom: 143px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonEdit
+ {
+ width: 250px;
+ left: 275px;
+ bottom: 40px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonNew
+ {
+ width: 100px;
+ left: 275px;
+ bottom: 0px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonTrash
+ {
+ width: 140px;
+ left: 385px;
+ bottom: 0px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsBlock
+ {
+ width: 220px;
+ top: 130px;
+ text-align: center !important;
+ transition: 1s;
+ -webkit-transition: top 1s; /* Safari and Chrome */
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButton
+ {
+ width: 159px;
+ left: 154px;
+ top: 205px;
+ line-height: 49px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButton2
+ {
+ width: 50px;
+ left: 365px;
+ top: 205px;
+ line-height: 49px;
+ text-align: left !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButton3
+ {
+ width: 50px;
+ left: 403px;
+ top: 130px;
+ line-height: 49px;
+ text-align: left !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .hide
+ {
+ visibility: hidden;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .captionMySettings
+ {
+ top: 157px;
+ left: 138px;
+ width: 300px;
+ height: 90px;
+ border: 1px solid;
+ padding: 8px 13px 13px 13px;
+ font-size: 26px;
+}
+
+/* END HMI concept 6.1 */ /* BEGIN HMI concept 6.2 */
+#seatsMassageView6_2 #settingsScreen .seatsMassageView6_2_seatLabel {
+ top: 13px;
+ left: 600px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView6_2 .MultiContourSeat_customMassage .seatsMassageView6_2_seatLabel_custom
+ {
+ top: 60px;
+ left: 300px !important;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButton
+ {
+ width: 159px;
+ left: 154px;
+ top: 205px;
+ line-height: 49px;
+ z-index: 1;
+}
+
+#seatsMassageView6_2 .mySettingsPopUpTitle {
+ width: 143px;
+ height: 25px;
+ position: absolute;
+ top: 163px;
+ left: 216px !important;
+ background: gray;
+ text-align: center;
+ line-height: 25px;
+ font-size: 16px !important;
+ font-weight: bold;
+}
+
+#seatsMassageView6_2 .mySettingsLabel {
+ z-index: 100;
+ left: 102px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .captionMySettings
+ {
+ top: 157px;
+ left: 138px;
+ width: 300px;
+ height: 90px;
+ border: 1px solid;
+ padding: 8px 13px 13px 13px;
+ font-size: 26px;
+}
+
+#seatsMassageView6_2 #settingsScreen .durationButtons .quality,#seatsMassageView6_2 #settingsScreen .pauseButtons .quality
+ {
+ width: 60px;
+}
+
+#seatsMassageView6_2 #settingsScreen .quality {
+ height: 35px;
+ width: 130px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#seatsMassageView6_2 #settingsScreen .btn-28 {
+ text-align: center;
+ line-height: 34px;
+}
+
+#seatsMassageView6_2 .settingsScreen {
+ width: 800px;
+ height: 368px;
+ top: -15px;
+ background: black;
+ visibility: hidden;
+}
+
+#seatsMassageView6_2 .settingsScreen2 {
+ width: 800px;
+ height: 368px;
+ top: -15px;
+ background: black;
+ visibility: hidden;
+}
+
+#seatsMassageView6_2 #settingsScreen .seats-message-actions {
+ height: 39px;
+ border: none;
+}
+
+#seatsMassageView6_2 #settingsScreen .button0 {
+ left: 0;
+}
+
+#seatsMassageView6_2 #settingsScreen .button1 {
+ left: 140px;
+}
+
+#seatsMassageView6_2 #settingsScreen .button2 {
+ left: 280px;
+}
+
+#seatsMassageView6_2 #settingsScreen .button3 {
+ left: 420px;
+}
+
+#seatsMassageView6_2 #settingsScreen .durationButtons .button0,#seatsMassageView6_2 #settingsScreen .pauseButtons .button0
+ {
+ left: 0;
+}
+
+#seatsMassageView6_2 #settingsScreen .durationButtons .button1,#seatsMassageView6_2 #settingsScreen .pauseButtons .button1
+ {
+ left: 70px;
+}
+
+#seatsMassageView6_2 #settingsScreen .durationButtons .button2,#seatsMassageView6_2 #settingsScreen .pauseButtons .button2
+ {
+ left: 140px;
+}
+
+#seatsMassageView6_2 #settingsScreen .durationButtons .button3,#seatsMassageView6_2 #settingsScreen .pauseButtons .button3
+ {
+ left: 210px;
+}
+
+#seatsMassageView6_2 #settingsScreen .durationButtons .button4,#seatsMassageView6_2 #settingsScreen .pauseButtons .button4
+ {
+ left: 280px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-11
+ {
+ top: 60px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-12
+ {
+ top: 105px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-13
+ {
+ top: 150px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-14
+ {
+ top: 230px;
+ left: 350px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-15
+ {
+ top: 275px;
+ left: 350px;
+}
+
+#seatsMassageView6_2 #settingsScreen2 .seats-message-1 {
+ left: 280px;
+ top: 110px;
+}
+
+#seatsMassageView6_2 #settingsScreen2 .seats-message-2 {
+ left: 280px;
+ top: 252px;
+}
+
+#seatsMassageView6_2 .seatsMassageView6_2_seatLabel {
+ top: 172px;
+ left: 45px;
+ font-size: 24px;
+ width: 199px;
+ text-align: center;
+}
+
+#seatsMassageView6_2 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView6_2 .seatsMassageView6_2_upperLabel {
+ top: 73px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_2 .seatsMassageView6_2_middleLabel {
+ top: 118px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_2 .seatsMassageView6_2_lowerLabel {
+ top: 163px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_2 .seatsMassageView6_2_frontLabel {
+ top: 243px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_2 .seatsMassageView6_2_rearLabel {
+ top: 287px;
+ left: 615px !important;
+ font-size: 18px !important;
+}
+
+#seatsMassageView6_2 .label {
+ font-size: 26px;
+ left: 20px;
+}
+
+#seatsMassageView6_2 .massageLabel {
+ top: 51px;
+}
+
+#seatsMassageView6_2 .pattern {
+ top: 91px;
+}
+
+#seatsMassageView6_2 .intensity {
+ top: 131px;
+}
+
+#seatsMassageView6_2 .speed {
+ top: 211px;
+}
+
+#seatsMassageView6_2 .duration {
+ top: 251px;
+}
+
+#seatsMassageView6_2 .pause {
+ top: 291px;
+}
+
+#seatsMassageView6_2 .editMenu {
+ width: 240px;
+ top: 12px;
+ text-align: center;
+ left: 70px;
+}
+
+#seatsMassageView6_2 .massageButtons {
+ top: 50px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_2 .massageButtons img {
+ height: 34px;
+}
+
+#seatsMassageView6_2 .patternButtons {
+ top: 90px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_2 .intensityButtons {
+ top: 130px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_2 .intensityEditCustom {
+ top: 170px;
+ left: 520px;
+ width: 270px;
+ height: 34px;
+}
+
+#seatsMassageView6_2 .speedButtons {
+ top: 210px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_2 .durationButtons {
+ top: 250px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_2 .pauseButtons {
+ top: 290px;
+ left: 240px;
+ width: 560px;
+}
+
+#seatsMassageView6_2 .preview {
+ top: 330px;
+ left: 289px;
+ width: 214px;
+ height: 34px;
+}
+
+#seatsMassageView6_2 .settingsScreen2 .MultiContourSeat_customMassage_caption
+ {
+ top: 14px;
+}
+
+#seatsMassageView6_2 .MultiContourSeat_customMassage_caption {
+ width: 600px;
+ height: 28px;
+ line-height: 29px;
+ left: 74px;
+ font-size: 26px;
+}
+
+#seatsMassageView6_2 .SettingsBlocks {
+ margin-left: auto;
+ margin-right: auto;
+ width: 315px;
+ height: 50px;
+ position: relative;
+ -webkit-transition: width 1s;
+}
+
+#seatsMassageView6_2 .MultiContourSeat_customMassage {
+ visibility: hidden;
+ background-color: #000;
+ z-index: 200;
+ width: 800px;
+ height: 345px;
+ position: absolute;
+ top: -60px;
+ left: -112px;
+ background-image: url('../images/settings/mcsBlockBackArrow6_2.png');
+ background-position: 39px 145px;
+ background-repeat: no-repeat;
+}
+
+#seatsMassageView6_2 .btn-48 {
+ line-height: 48px;
+ text-align: center;
+}
+
+#seatsMassageView6_2 .show {
+ visibility: visible !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButtonNew
+ {
+ width: 100px;
+ left: 270px;
+ bottom: 20px;
+ line-height: 49px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButtonTrash
+ {
+ width: 71px;
+ left: 446px;
+ bottom: 5px;
+ line-height: 49px;
+ height: 78px;
+ background-image: url("../images/settings/trash.png");
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButtonSave
+ {
+ width: 100px;
+ left: 480px;
+ bottom: 20px;
+ line-height: 49px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsBlock
+ {
+ width: 100px;
+ top: 130px;
+ line-height: 49px;
+ text-align: center !important;
+ transition: left 1s;
+ -webkit-transition: left 1s; /* Safari and Chrome */
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButton2
+ {
+ width: 50px;
+ left: 365px;
+ top: 205px;
+ line-height: 49px;
+ text-align: left !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButton3
+ {
+ width: 50px;
+ left: 403px;
+ top: 130px;
+ line-height: 49px;
+ text-align: left !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .hide
+ {
+ visibility: hidden;
+}
+
+/* END HMI concept 6.2 */ /* BEGIN HMI concept 7.1 */
+#seatsMassageView7_1_appendix .localBack {
+ background: url(../images/common/page-back-button.png) no-repeat center
+ 12px, url(../images/common/btn-48h.png);
+ width: 48px;
+ z-index: 5000;
+ left: 5px;
+ top: 59px;
+ visibility: hidden;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .seatsMassageView_settingsButton2
+ {
+ width: 50px;
+ left: 365px;
+ top: 205px;
+ line-height: 49px;
+ text-align: left !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .seatsMassageView_settingsButton
+ {
+ width: 159px;
+ left: 154px;
+ top: 205px;
+ line-height: 49px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .captionMySettings
+ {
+ top: 157px;
+ left: 138px;
+ width: 300px;
+ height: 90px;
+ border: 1px solid;
+ padding: 8px 13px 13px 13px;
+ font-size: 26px;
+}
+
+#seatsMassageView7_1 .mySettingsPopUpTitle {
+ width: 143px;
+ height: 25px;
+ position: absolute;
+ top: 163px;
+ left: 216px !important;
+ background: gray;
+ text-align: center;
+ line-height: 25px;
+ font-size: 16px !important;
+ font-weight: bold;
+}
+
+#seatsMassageView7_1 .mySettingsLabel {
+ z-index: 100;
+ left: 102px;
+}
+
+#seatsMassageView7_1_appendix .btn-48 {
+ line-height: 48px;
+ text-align: center;
+}
+
+#seatsMassageView7_1_appendix .seats-message-actions-3 {
+ top: 165px;
+ left: 59px;
+}
+
+#seatsMassageView7_1_appendix .show {
+ visibility: visible !important;
+}
+
+#seatsMassageView7_1_appendix {
+ z-index: 2003;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView {
+ visibility: hidden;
+ background-color: whiteSmoke;
+ width: 350px;
+ height: 368px;
+ position: absolute;
+ top: 56px;
+ left: 305px !important;
+ background: black;
+ border: #A6A6A6 solid 2px;
+ border-radius: 6px;
+ font-size: 18px;
+ font-family: Arial;
+}
+
+#seatsMassageView7_1_appendix .titleQuestion {
+ font-size: 21px;
+ font-family: Arial;
+ width: 350px;
+ text-align: center;
+ top: 25px;
+}
+
+#seatsMassageView7_1_appendix .question {
+ font-size: 18px;
+ font-family: Arial;
+ width: 350px;
+ text-align: center;
+ top: 65px;
+}
+
+#seatsMassageView7_1_appendix .titleAnswer {
+ font-size: 21px;
+ font-family: Arial;
+ width: 350px;
+ text-align: center;
+ top: 103px;
+}
+
+#seatsMassageView7_1_appendix .View1 .seats-message-actions-3 {
+ top: 194px;
+ left: 7px;
+}
+
+#seatsMassageView7_1_appendix .View1 .titleQuestion {
+ left: 0px;
+ width: 500px;
+ top: 40px;
+}
+
+#seatsMassageView7_1_appendix .View1 .question {
+ left: 0px;
+ top: 90px;
+ text-align: center;
+ width: 500px;
+}
+
+#seatsMassageView7_1_appendix .View1 .titleAnswer {
+ left: 0px;
+ width: 500px;
+ top: 134px;
+}
+
+#seatsMassageView7_1_appendix .View1 .button0 {
+ left: 0;
+ top: 0 !important;
+}
+
+#seatsMassageView7_1_appendix .View1 .button1 {
+ left: 0;
+ top: 45px !important;
+}
+
+#seatsMassageView7_1_appendix .View1 .button2 {
+ left: 0;
+ top: 90px !important;
+}
+
+#seatsMassageView7_1_appendix .View1 .button3 {
+ left: 258px !important;
+ top: 0px !important;
+}
+
+#seatsMassageView7_1_appendix .View1 .button4 {
+ left: 258px !important;
+ top: 45px !important;
+}
+
+#seatsMassageView7_1_appendix .View1 .button5 {
+ left: 258px !important;
+ top: 90px !important;
+}
+
+#seatsMassageView7_1_appendix .View1 .btn-48 {
+ height: 35px !important;
+ line-height: 35px !important;
+}
+
+#seatsMassageView7_1_appendix .seatsMassageDialogView4 {
+ visibility: hidden;
+ font-size: 26px !important;
+ font-family: Arial;
+ font-size: 18px;
+ font-family: Arial;
+ left: 300px;
+ top: 140px;
+ width: 232px;
+ height: 127px;
+ background: white;
+ border-radius: 6px;
+ border: 1px solid gray;
+ color: black;
+ text-align: center;
+ padding: 10px;
+}
+
+#seatsMassageView7_1_appendix .seatsMassageDialogView5 {
+ visibility: hidden;
+ font-size: 26px !important;
+ font-family: Arial;
+ font-size: 18px;
+ font-family: Arial;
+ left: 300px;
+ top: 132px;
+ width: 326px;
+ height: 165px;
+ background: white;
+ border-radius: 6px;
+ border: 1px solid gray;
+ color: black;
+ text-align: center;
+ padding: 10px;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView.View1 {
+ visibility: hidden;
+ background-color: whiteSmoke;
+ width: 520px;
+ height: 368px;
+ position: absolute;
+ top: 56px;
+ left: 265px !important;
+ background: black;
+ border: #A6A6A6 solid 2px;
+ border-radius: 6px;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView .button0 {
+ left: 0;
+ top: 0;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView .button1 {
+ left: 0;
+ top: 60px;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView .button2 {
+ left: 0;
+ top: 120px;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView .button3 {
+ left: 0;
+ top: 180px;
+}
+
+#seatsMassageView7_1_appendix .SeatsMassageDialogView .button {
+ width: 245px;
+ border-radius: 3px;
+ border: 1px solid #393939;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Settings
+ {
+ top: 200px;
+ left: 197px;
+ width: 138px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Settings span
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Settings .ico
+ {
+ float: left;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Massage
+ {
+ text-align: center;
+ height: 48px;
+ line-height: 48px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .toogleButtonContainer .button1
+ {
+ left: 50px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .toogleButtonContainer .delim-0
+ {
+ left: 48px;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5SettingsScreen
+ {
+ top: -60px;
+ left: 154px;
+ width: 291px;
+ height: 345px;
+ background: black;
+ z-index: 100;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .btn-48
+ {
+ line-height: 48px;
+ text-align: center;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .show
+ {
+ visibility: visible !important;
+}
+
+#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .hide
+ {
+ visibility: hidden;
+}
+
+/* END HMI concept 7.1 */ /* lumbars */ /* driver */
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion1 .active {
+ background: url(../images/settings/TopLumbar_WhiteOutline_driver.png)
+ no-repeat;
+ width: 38px;
+ height: 29px;
+ top: 70px;
+ left: 22px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion2 .active {
+ background: url(../images/settings/MiddleLumbar_WhiteOutline_driver.png)
+ no-repeat;
+ width: 34px;
+ height: 30px;
+ top: 84px;
+ left: 18px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion3 .active {
+ background: url(../images/settings/LowerLumbar_WhiteOutline_driver.png)
+ no-repeat;
+ width: 33px;
+ height: 36px;
+ top: 99px;
+ left: 14px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion4 .active {
+ background: url(../images/settings/lumbar_cushion_top-active.png)
+ no-repeat;
+ width: 70px;
+ height: 70px;
+ top: 71px;
+ left: -2px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion5 .active {
+ background: url(../images/settings/lumbar_cushion_bot-active.png)
+ no-repeat;
+ width: 91px;
+ height: 59px;
+ top: 112px;
+ left: -37px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion6 .active {
+ background: url(../images/settings/whiteOutline_driver-lumbar-all.png)
+ no-repeat;
+ width: 47px;
+ height: 68px;
+ top: 70px;
+ left: 16px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion7 .active {
+ background: url(../images/settings/Cushion_WhiteOutline_driver.png)
+ no-repeat;
+ width: 74px;
+ height: 36px;
+ top: 119px;
+ left: -32px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion1 .lumbar {
+ background: url(../images/settings/driver-lumbar-top.png) no-repeat;
+ width: 36px;
+ height: 31px;
+ top: 69px;
+ left: 22px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion2 .lumbar {
+ background: url(../images/settings/driver-lumbar-mid.png) no-repeat;
+ width: 34px;
+ height: 31px;
+ top: 84px;
+ left: 17px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion3 .lumbar {
+ background: url(../images/settings/driver-lumbar-low.png) no-repeat;
+ width: 31px;
+ height: 35px;
+ top: 99px;
+ left: 15px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion4 .lumbar {
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat_adj1.png)
+ no-repeat;
+ width: 70px;
+ height: 70px;
+ top: 68px;
+ left: -4px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion5 .lumbar {
+ background: url(../images/settings/lumbar_cushion.png) no-repeat;
+ width: 91px;
+ height: 59px;
+ top: 111px;
+ left: -36px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion6 .lumbar {
+ background: url(../images/settings/driver-lumbar-all.png) no-repeat;
+ width: 47px;
+ height: 68px;
+ top: 68px;
+ left: 12px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_driverSeat_cushion7 .lumbar {
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat_adj2.png)
+ no-repeat;
+ width: 73px;
+ height: 37px;
+ top: 119px;
+ left: -30px;
+ opacity: 0;
+}
+
+/* passenger */
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion1 .active {
+ background: url(../images/settings/TopLumbar_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 38px;
+ height: 29px;
+ top: 70px;
+ left: 541px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion2 .active {
+ background:
+ url(../images/settings/MiddleLumbar_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 34px;
+ height: 30px;
+ top: 84px;
+ left: 549px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion3 .active {
+ background:
+ url(../images/settings/LowerLumbar_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 33px;
+ height: 36px;
+ top: 99px;
+ left: 555px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion4 .active {
+ background:
+ url(../images/settings/lumbar_cushion_top_passenger-active.png)
+ no-repeat;
+ width: 70px;
+ height: 70px;
+ top: 71px;
+ left: 535px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion5 .active {
+ background:
+ url(../images/settings/lumbar_cushion_bot_passanger-active.png)
+ no-repeat;
+ width: 91px;
+ height: 59px;
+ top: 112px;
+ left: 546px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion6 .active {
+ background:
+ url(../images/settings/WhiteOutline_passenger-lumbar-all.png)
+ no-repeat;
+ width: 47px;
+ height: 68px;
+ top: 70px;
+ left: 544px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion7 .active {
+ background: url(../images/settings/Cushion_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 74px;
+ height: 36px;
+ top: 120px;
+ left: 558px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion1 .lumbar {
+ background: url(../images/settings/passenger-lumbar-top.png) no-repeat;
+ width: 37px;
+ height: 31px;
+ top: 68px;
+ left: 542px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion2 .lumbar {
+ background: url(../images/settings/passenger-lumbar-mid.png) no-repeat;
+ width: 34px;
+ height: 31px;
+ top: 84px;
+ left: 550px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion3 .lumbar {
+ background: url(../images/settings/passenger-lumbar-low.png) no-repeat;
+ width: 32px;
+ height: 35px;
+ top: 99px;
+ left: 555px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion4 .lumbar {
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat_adj1_passenger.png)
+ no-repeat;
+ width: 69px;
+ height: 69px;
+ top: 70px;
+ left: 535px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion5 .lumbar {
+ background: url(../images/settings/passenger_lumbar_cushion.png)
+ no-repeat;
+ width: 91px;
+ height: 59px;
+ top: 111px;
+ left: 546px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion6 .lumbar {
+ background: url(../images/settings/passenger-lumbar-all.png) no-repeat;
+ width: 47px;
+ height: 68px;
+ top: 68px;
+ left: 540px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion7 .lumbar {
+ background:
+ url(../images/settings/view_settings_vehicle_MultiContourSeat_adj2_passenger.png)
+ no-repeat;
+ width: 72px;
+ height: 37px;
+ top: 119px;
+ left: 559px;
+ opacity: 0;
+}
+
+/* CUSTOM MASSAGE */ /* Driver cushions */
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion6 .active
+ {
+ background: url(../images/settings/TopLumbar_WhiteOutline_driver.png)
+ no-repeat;
+ width: 38px;
+ height: 29px;
+ top: 70px;
+ left: 22px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion7 .active
+ {
+ background: url(../images/settings/MiddleLumbar_WhiteOutline_driver.png)
+ no-repeat;
+ width: 34px;
+ height: 30px;
+ top: 84px;
+ left: 18px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion8 .active
+ {
+ background: url(../images/settings/LowerLumbar_WhiteOutline_driver.png)
+ no-repeat;
+ width: 33px;
+ height: 36px;
+ top: 99px;
+ left: 14px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion9 .active
+ {
+ background: url(../images/settings/driver-lumbar-m-top-selected.png)
+ no-repeat;
+ width: 77px;
+ height: 41px;
+ top: 119px;
+ left: -30px;
+ z-index: 1;
+ opacity: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion10 .active
+ {
+ background: url(../images/settings/driver-lumbar-m-bottom-selected.png)
+ no-repeat;
+ width: 77px;
+ height: 41px;
+ top: 119px;
+ left: -30px;
+ z-index: 1;
+ opacity: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion6 .lumbar
+ {
+ background: url(../images/settings/driver-lumbar-top.png) no-repeat;
+ width: 36px;
+ height: 31px;
+ top: 69px;
+ left: 22px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion7 .lumbar
+ {
+ background: url(../images/settings/driver-lumbar-mid.png) no-repeat;
+ width: 34px;
+ height: 31px;
+ top: 84px;
+ left: 17px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion8 .lumbar
+ {
+ background: url(../images/settings/driver-lumbar-low.png) no-repeat;
+ width: 31px;
+ height: 35px;
+ top: 99px;
+ left: 15px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion9 .lumbar
+ {
+ background: url(../images/settings/driver-lumbar-m-top.png) no-repeat;
+ width: 73px;
+ height: 37px;
+ top: 119px;
+ left: -30px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion10 .lumbar
+ {
+ background: url(../images/settings/driver-lumbar-m-bottom.png) no-repeat;
+ width: 73px;
+ height: 37px;
+ top: 119px;
+ left: -30px;
+ opacity: 0;
+}
+
+/* Passenger cushions */
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion6 .active
+ {
+ background: url(../images/settings/TopLumbar_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 38px;
+ height: 29px;
+ top: 70px;
+ left: 541px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion7 .active
+ {
+ background:
+ url(../images/settings/MiddleLumbar_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 34px;
+ height: 30px;
+ top: 84px;
+ left: 549px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion8 .active
+ {
+ background:
+ url(../images/settings/LowerLumbar_WhiteOutline_passenger.png)
+ no-repeat;
+ width: 33px;
+ height: 36px;
+ top: 99px;
+ left: 555px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion9 .active
+ {
+ background: url(../images/settings/passenger-lumbar-m-top-selected.png)
+ no-repeat;
+ width: 77px;
+ height: 41px;
+ top: 120px;
+ left: 558px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion10 .active
+ {
+ background:
+ url(../images/settings/passenger-lumbar-m-bottom-selected.png)
+ no-repeat;
+ width: 77px;
+ height: 41px;
+ top: 120px;
+ left: 558px;
+ z-index: 1;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion6 .lumbar
+ {
+ background: url(../images/settings/passenger-lumbar-top.png) no-repeat;
+ width: 36px;
+ height: 31px;
+ top: 70px;
+ left: 541px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion7 .lumbar
+ {
+ background: url(../images/settings/passenger-lumbar-mid.png) no-repeat;
+ width: 34px;
+ height: 31px;
+ top: 84px;
+ left: 549px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion8 .lumbar
+ {
+ background: url(../images/settings/passenger-lumbar-low.png) no-repeat;
+ width: 31px;
+ height: 35px;
+ top: 99px;
+ left: 555px;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion9 .lumbar
+ {
+ background: url(../images/settings/passenger-lumbar-m-top.png) no-repeat;
+ width: 77px;
+ height: 41px;
+ top: 120px;
+ left: 558px;;
+ opacity: 0;
+}
+
+#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion10 .lumbar
+ {
+ background: url(../images/settings/passenger-lumbar-m-bottom.png)
+ no-repeat;
+ width: 77px;
+ height: 41px;
+ top: 120px;
+ left: 558px;
+ opacity: 0;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/media.css b/src/components/HMI/css/media.css
new file mode 100644
index 0000000000..85688d5e6b
--- /dev/null
+++ b/src/components/HMI/css/media.css
@@ -0,0 +1,528 @@
+#media_leftmenu {
+ z-index: 301;
+ position: absolute;
+ top: 90px;
+ left: 0px;
+ width: 150px;
+ height: 300px;
+ background: #333;
+}
+
+#media_cdButton {
+ font-size: 18px;
+ padding-left: 48px;
+ line-height: 48px;
+}
+
+#media_sdlButton {
+ font-size: 18px;
+ line-height: 48px;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#media_sdlButton span {
+ margin-left: 50px;
+}
+
+#media_status {
+ bottom: 0px;
+ left: 0px;
+ font-size: 21px;
+ width: 324px;
+ height: 48px;
+ cursor: pointer;
+ background: url(../images/common/media-status-bg.png) no-repeat;
+ z-index: 1;
+}
+
+#media_status_homestatus {
+ position: absolute;
+ visibility: hidden;
+ width: 100%;
+ line-height: 50px;
+}
+
+#media_status_homestatus span {
+ padding-left: 11px;
+}
+
+.ls_border {
+ z-index: 201;
+ position: absolute;
+ top: -3px;
+ left: 0px;
+ width: 153px;
+ height: 306px;
+ background: url(../images/common/ls_border.png) no-repeat;
+}
+
+.media-ls-items {
+ position: relative;
+ width: 150px;
+ height: 300px;
+}
+
+.media-ls-item {
+ z-index: 201;
+ position: relative;
+ height: 50px;
+ cursor: pointer;
+ background: url(../images/media/ls-item_bg.png) no-repeat;
+}
+
+.media-ls-item.active_state {
+ background: url(../images/media/ls-item_bg_act.png) no-repeat !important;
+}
+
+.media-ls-item>.bg {
+ z-index: 201;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 150px;
+ height: 50px;
+}
+
+.media-ls-item>.ico {
+ z-index: 299;
+ position: absolute;
+ left: 0px;
+ width: 50px;
+ height: 50px;
+}
+
+.media-ls-item>.ico.more {
+ left: 50px;
+}
+
+.media-ls-item>p {
+ z-index: 298;
+ position: absolute;
+ left: 48px;
+ width: 86px;
+ height: 50px;
+ font-size: 18px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.media-ls-item>.led {
+ z-index: 299;
+ position: absolute;
+ top: 0px;
+ right: 8px;
+ width: 24px;
+ height: 50px;
+}
+
+.media-ls-item.empty {
+ background: #333333;
+}
+
+.main-preset-buttons-wraper {
+ position: relative;
+ width: 468px;
+ height: 100px;
+ float: left;
+ left: 165px;
+ top: 290px;
+ z-index: 503;
+}
+
+.main-preset-buttons-wraper .preset-items {
+ position: relative;
+ width: 467px;
+ height: 99px;
+ border: 1px solid #393939;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ z-index: 1;
+}
+
+.main-preset-buttons-wraper .preset-item {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ border-right: 1px solid #393939;
+ border-bottom: 1px solid #393939;
+ width: 92.6px;
+ height: 49px;
+ cursor: pointer;
+}
+
+.main-preset-buttons-wraper .preset-item.a0 {
+ background: url(../images/media/bcs-item_bgL.png) no-repeat;
+ border-right: 1px solid #393939;
+ border-bottom: 1px solid #393939;
+}
+
+.main-preset-buttons-wraper .preset-item.a0.pressed {
+ background: url(../images/media/bcs-item_bgL_pressed.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a0.active {
+ background: url(../images/media/bcs-item_bg_act.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a1 {
+ background: url(../images/media/bcs-item_bgS.png) no-repeat;
+ border-right: 1px solid #393939;
+ border-bottom: 1px solid #393939;
+ width: 157px;
+}
+
+.main-preset-buttons-wraper .preset-item.a1.pressed {
+ background: url(../images/media/bcs-item_bgS_pressed.png) no-repeat;
+ width: 157px;
+}
+
+.main-preset-buttons-wraper .preset-item.a1.active {
+ background: url(../images/media/bcs-item_bg_act.png) repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a2 {
+ background: url(../images/media/bcs-item_bgR.png) no-repeat;
+ border-bottom: 1px solid #393939;
+ width: 153px;
+}
+
+.main-preset-buttons-wraper .preset-item.a2.pressed {
+ background: url(../images/media/bcs-item_bgR_pressed.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a2.active {
+ background: url(../images/media/bcs-item_bg_act.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a3 {
+ background: url(../images/media/bcs-item_bgL.png) no-repeat;
+ border-right: 1px solid #393939;
+}
+
+.main-preset-buttons-wraper .preset-item.a3.pressed {
+ background: url(../images/media/bcs-item_bgL_pressed.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a3.active {
+ background: url(../images/media/bcs-item_bg_act.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a4 {
+ background: url(../images/media/bcs-item_bgS.png) no-repeat;
+ border-right: 1px solid #393939;
+ width: 157px;
+}
+
+.main-preset-buttons-wraper .preset-item.a4.pressed {
+ background: url(../images/media/bcs-item_bgS_pressed.png) no-repeat;
+ width: 157px;
+}
+
+.main-preset-buttons-wraper .preset-item.a4.active {
+ background: url(../images/media/bcs-item_bg_act.png) repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a5 {
+ background: url(../images/media/bcs-item_bgR.png) no-repeat;
+ width: 153px;
+}
+
+.main-preset-buttons-wraper .preset-item.a5.pressed {
+ background: url(../images/media/bcs-item_bgR_pressed.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item.a5.active {
+ background: url(../images/media/bcs-item_bg_act.png) no-repeat;
+}
+
+.main-preset-buttons-wraper .preset-item>.bg {
+ z-index: 201;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 155px;
+ height: 49px;
+}
+
+.main-preset-buttons-wraper .preset-item>span {
+ z-index: 202;
+ display: block;
+ position: absolute;
+ left: 10px;
+ width: 30px;
+ height: 50px;
+ font-size: 32px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+ color: #999;
+}
+
+.main-preset-buttons-wraper .preset-item>p {
+ z-index: 202;
+ position: absolute;
+ left: 40px;
+ width: 100px;
+ height: 50px;
+ font-size: 18px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.home-preset-buttons-wraper {
+ top: 82px;
+ left: 34px;
+ z-index: 50;
+}
+
+.home-preset-buttons-wraper .preset-items {
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ border: 1px solid #393939;
+ width: 328px;
+ height: 79px;
+}
+
+.bc-item2>p {
+ z-index: 202;
+ position: absolute;
+ left: 40px;
+ width: 100px;
+ height: 50px;
+ font-size: 18px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.bc-item-big {
+ position: relative;
+ float: left;
+ width: 156px;
+ height: 100px;
+ line-height: 100px;
+ text-align: center;
+ font-size: 20px;
+}
+
+.bc-item-big.prevcd,.bc-item-big.prevusb,.bc-item-big.prevsd,.bc-item-big.prevblue
+ {
+ width: 155px;
+ height: 98px;
+ border-right: 1px solid #393939;
+ cursor: pointer;
+ background: url(../images/media/cd-prev-btn.png) no-repeat;
+}
+
+.bc-item-big.prevcd.pressed,.bc-item-big.prevusb.pressed,.bc-item-big.prevsd.pressed,.bc-item-big.prevblue.pressed
+ {
+ background: url(../images/media/cd-prev-btn_pressed.png) no-repeat;
+}
+
+.bc-item-big.playcd {
+ width: 157px;
+ height: 98px;
+ border-right: 1px solid #393939;
+ cursor: pointer;
+ background: url(../images/media/cd_play_btn.png) no-repeat;
+}
+
+.playIcon {
+ position: absolute;
+ left: 66px;
+}
+
+.playIcon.hideicon {
+ visibility: hidden;
+}
+
+.playIcon.showicon {
+ visibility: visible;
+}
+
+.bc-item-big.playcd.pressed,.bc-item-big.playusb.pressed,.bc-item-big.playsd.pressed,.bc-item-big.playblue.pressed
+ {
+ background: url(../images/media/cd_play_btn_pressed.png) no-repeat;
+}
+
+.bc-item-big.nextcd,.bc-item-big.nextusb,.bc-item-big.nextsd,.bc-item-big.nextblue
+ {
+ width: 154px;
+ height: 98px;
+ cursor: pointer;
+ background: url(../images/media/cd-next-btn.png) no-repeat;
+}
+
+.bc-item-big.nextcd.pressed,.bc-item-big.nextusb.pressed,.bc-item-big.nextsd.pressed,.bc-item-big.nextblue.pressed
+ {
+ background: url(../images/media/cd-next-btn_pressed.png) no-repeat;
+}
+
+#bt-bg {
+ position: relative;
+ float: left;
+ margin-left: 10px;
+ margin-top: -8px;
+}
+
+#bt-dis-controls {
+ background: url(../images/media/disabled_player_controls.png) no-repeat;
+ width: 470px;
+ height: 100px;
+ position: relative;
+ bottom: 17px;
+ float: left;
+ margin-left: 13px;
+}
+
+#avin-line {
+ z-index: 200;
+ position: relative;
+ width: 151px;
+ height: 297px;
+ margin-top: 100px;
+ margin-left: 171px;
+}
+
+.player_controlls {
+ z-index: 199;
+ position: absolute;
+ top: 237px;
+ left: 13px;
+ width: 468px;
+ height: 99px;
+ background: url("../images/media/btn_bg.png") repeat;
+ border: 1px solid #393939;
+ -webkit-border-radius: 3px;
+}
+
+#sdl_view_container .track-info {
+ left: 165px;
+ top: 55px;
+}
+
+#sdl_view_container .list-content {
+ border: none;
+}
+
+#sdl_view_container .list-item {
+ position: relative;
+ width: 100%;
+ height: 48px;
+ font-size: 20px;
+ line-height: 50px;
+ border: 1px solid #393939;
+}
+
+.track-info {
+ z-index: 199;
+ position: absolute;
+ left: 13px;
+ width: 470px;
+ overflow: hidden;
+ height: 237px;
+}
+
+.track-info>.total {
+ position: absolute;
+ top: 30px;
+ left: 10px;
+ width: 300px;
+ text-align: left;
+ font-size: 20px;
+ color: #999999;
+}
+
+.track-info>.title {
+ top: 110px;
+ font-size: 38px;
+ left: 7px;
+}
+
+.track-info>.track-number {
+ top: 153px;
+ font-size: 26px;
+ left: 10px;
+}
+
+.track-info>.time {
+ top: 190px;
+ font-size: 26px;
+ left: 10px;
+}
+
+.track-info>.divider_o {
+ top: 65px;
+}
+
+.track-info>.device {
+ position: absolute;
+ top: 30px;
+ left: 10px;
+ width: 300px;
+ text-align: left;
+ font-size: 20px;
+ color: #999999;
+}
+
+.divider_o {
+ position: absolute;
+ top: 120px;
+ left: 0px;
+ width: 470px;
+ height: 1px;
+ background: url("../images/media/divider_o.png") no-repeat;
+}
+
+.statusInfo {
+ width: 275px;
+ height: 48px;
+}
+
+.statusInfo .station {
+ top: 12px;
+ left: 11px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ height: 21px;
+ width: 220px;
+}
+
+.statusInfo .station span {
+ display: none;
+}
+
+.statusInfo .icon {
+ width: 50px;
+ height: 50px;
+ left: 224px;
+}
+
+.cdIco {
+ background: url(../images/media/ico_cd.png) no-repeat !important
+}
+
+.appIco {
+ background: url(../images/info/info_leftMenu_apps_ico.png) no-repeat
+ !important
+}
+
+#media_player_view_container {
+ background: url(../images/media/player_view.png) no-repeat;
+ width: 635px;
+ height: 323px;
+ top: 70px;
+ left: 161px;
+ z-index: 501;
+}
+
+#sdl_view_container .ffw_list_menu {
+ top: 90px;
+ left: 650px;
+ width: 140px;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/navigation.css b/src/components/HMI/css/navigation.css
new file mode 100644
index 0000000000..55cab5b140
--- /dev/null
+++ b/src/components/HMI/css/navigation.css
@@ -0,0 +1,102 @@
+/*NAVIGATION CSS*/
+#baseNavigation{
+ z-index: 2;
+ position: absolute;
+ top: 48px;
+ width: 800px;
+ height: 384px;
+}
+#baseNavigation .mainField{
+ position: absolute;
+ background: rgba(124, 124, 124, 0.3);
+ border: 1px solid;
+ border-color: rgba(90, 90, 90, 0.31);
+ border-radius: 3px;
+ box-shadow: inset 2px 2px 10px 0px rgba(112, 112, 112, 0.3), inset -2px -2px 10px 0px rgba(112, 112, 112, 0.3);
+ padding-top: 10px;
+ padding-left: 10px;
+ font-size: 18px;
+}
+#baseNavigation .softButton{
+ position: absolute;
+ border-radius: 3px;
+ border: 1px solid #393939;
+}
+#baseNavigation .mainField1{
+ top: 0;
+ height: 30px;
+ width: 190px;
+ left: 0;
+}
+#baseNavigation .mainField2{
+ top: 0;
+ height: 40px;
+ width: 380px;
+ left: 204px;
+}
+#baseNavigation .mainField3{
+ top: 0;
+ height: 30px;
+ width: 190px;
+ right: 0;
+}
+#baseNavigation .mainField4{
+ top: 50px;
+ height: 30px;
+ width: 90px;
+ right: 0;
+ overflow: hidden;
+ white-space: nowrap;
+}
+#baseNavigation .mainField5{
+ top: 100px;
+ height: 30px;
+ width: 90px;
+ right: 0;
+}
+#baseNavigation .mainField6{
+ bottom: 0;
+ height: 40px;
+ width: 280px;
+ left: 254px;
+}
+#baseNavigation .softButton1{
+ width: 250px;
+ bottom: 0;
+ left: 0;
+ position: absolute!important;
+ margin: 0px!important;
+ height: 49px!important;
+ font-size: 32px;
+ line-height: 50px!important;
+}
+#baseNavigation .softButton2{
+ width: 250px;
+ bottom: 0px;
+ right: 0px;
+ position: absolute!important;
+ margin: 0px!important;
+ height: 49px!important;
+ font-size: 32px;
+ line-height: 50px!important;
+}
+#baseNavigation .softButton3{
+ width: 100px;
+ top: 100px;
+ left: 0;
+ position: absolute!important;
+ margin: 0px!important;
+ height: 49px!important;
+ font-size: 32px;
+ line-height: 50px!important;
+}
+#baseNavigation .softButton4{
+ width: 100px;
+ top: 150px;
+ left: 0;
+ position: absolute!important;
+ margin: 0px!important;
+ height: 49px!important;
+ font-size: 32px;
+ line-height: 50px!important;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/phone.css b/src/components/HMI/css/phone.css
new file mode 100644
index 0000000000..d8e6855d7a
--- /dev/null
+++ b/src/components/HMI/css/phone.css
@@ -0,0 +1,300 @@
+/**
+ * Phone module CSS
+ *
+ * @category Style Sheets
+ * @filesource css/phone.css
+ * @version 2.0
+ */
+#phone {
+ width: 800px;
+ height: 480px;
+ background: url(../images/phone/bg.png) no-repeat;
+ background-position: top;
+} /*
+
+
+ Backgrpund for active toogleButton
+#phone .toogleButtonContainer .active {
+ background: url(../images/phone/bcs-item_bg_act.png);
+}
+
+#phone .delim {
+ position: relative;
+ float: left;
+ border: #393939 1px solid;
+ height: 26px;
+ width: 0px;
+}
+
+ LEFT MENU
+*/
+#phone_menu {
+ position: absolute;
+ top: 90px;
+ left: 0px;
+ width: 150px;
+ height: 300px;
+ background: #333;
+}
+
+.ls_border {
+ z-index: 201;
+ position: absolute;
+ top: -3px;
+ left: 0px;
+ width: 153px;
+ height: 306px;
+}
+
+.ls-items {
+ position: relative;
+ width: 150px;
+ height: 300px;
+}
+
+.ls-item {
+ z-index: 201;
+ position: relative;
+ width: 150px;
+}
+
+/*.ls-item > .bg{z-index:201;position:absolute;top:0px;left:0px;width:150px;height:50px;}
+ */
+.ls-item>.ico {
+ z-index: 299;
+ position: absolute;
+ left: 10px;
+ width: 30px;
+ height: 30px;
+ top: 10px;
+} /*
+ .ls-item > .ico.more {left:50px;}
+ */
+.ls-item span {
+ z-index: 298;
+ position: absolute;
+ left: 50px;
+ width: 100px;
+ height: 50px;
+ font-size: 18px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+/*.ls-item > .led{z-index:299;position:absolute;top:0px;right:8px;width:24px;height:50px;}
+ .ls-item.empty{background:#333333;}
+ .firts_item{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;}
+ .last_item{-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;}
+ */
+.lsp1_p {
+ background: url("../images/phone/menu_bg.png") repeat-x bottom;
+}
+
+.phone_active {
+ background: url("../images/phone/menu_active.png") repeat-x bottom
+ !important;
+ border-top: 1px solid #3e3115;
+ border-bottom: 1px solid #4a3a17
+}
+
+#phone_menu .ls-item {
+ height: 48px;
+ border-bottom: 1px solid #656565;
+ border-top: 1px solid #393939;
+} /*
+ .navigationApp {width:26px;height:25px;background:url("../images/phone/ico_navigation.png") no-repeat;left:60px;top:10px;}
+
+#phone_menu.hide {
+ left: -170px;
+}
+
+#phone_menu_quickdialButton,
+#phone_menu_messagingButton,
+#phone_menu_settingsButton {
+ z-index: 203;
+}
+
+#phone .list-item.active {
+ background: url(../images/phone/phone_button_bg_active.png) repeat-x;
+}
+ PHONE STATUS BAR
+*/
+#status_phone {
+ top: 0px;
+ left: 0px;
+ font-size: 21px;
+ cursor: pointer;
+ width: 324px;
+ height: 48px;
+ background: url(../images/common/phone-statusbar-bg.png) no-repeat;
+ z-index: 1;
+}
+
+#status_phone_label {
+ width: 100%;
+ display: block;
+ visibility: hidden;
+}
+
+#status_phone_label span {
+ padding-left: 11px;
+}
+#phone_dialpad_number {
+ width: 283px;
+ height: 30px;
+ position: absolute;
+ left: 258px;
+ top: 87px;
+ text-align: center;
+ font-size: 22px;
+ padding: 10px 0 0 0;
+ background: black;
+ border: 1px solid #393939;
+ border-radius: 3px;
+}
+
+#phone_dialpad_keypad {
+ width: 282px;
+ height: 200px;
+ position: absolute;
+ left: 259px;
+ top: 141px;
+}
+
+#phone_dialpad_keypad div {
+ font-size: 26px;
+ text-align: center;
+ line-height: 32px;
+}
+#phone_dialpad_keypad .left {
+ left: 0px;
+ width: 93px;
+ height: 49px;
+ border-left: 1px solid #393939;
+ border-right: 1px solid #000;
+ border-top: 1px solid #393939;
+}
+
+#phone_dialpad_keypad .center {
+ left: 95px;
+ width: 93px;
+ height: 49px;
+ border-top: 1px solid #393939;
+ border-left: 1px solid #393939;
+ border-right: 1px solid #000;
+}
+
+#phone_dialpad_keypad .right {
+ left: 190px;
+ width: 93px;
+ height: 49px;
+ border-left: 1px solid #393939;
+ border-right: 1px solid #393939;
+ border-top: 1px solid #393939;
+}
+
+#phone_dialpad_keypad_key4,#phone_dialpad_keypad_key5,#phone_dialpad_keypad_key6
+ {
+ top: 50px;
+}
+
+#phone_dialpad_keypad_key7,#phone_dialpad_keypad_key8,#phone_dialpad_keypad_key9
+ {
+ top: 100px;
+}
+
+#phone_dialpad_keypad_key0,#phone_dialpad_keypad_keyDiez,#phone_dialpad_keypad_keyStar
+ {
+ top: 150px;
+ border-bottom: 1px solid #393939;
+}
+
+#phone_dialpad_keypad_key1 {
+ -webkit-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+}
+
+#phone_dialpad_keypad_key3 {
+ -webkit-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+
+#phone_dialpad_keypad_keyStar {
+ -webkit-border-bottom-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#phone_dialpad_keypad_keyDiez {
+ -webkit-border-bottom-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+#phone_dialpad_deleteButton {
+ opacity: 0;
+ cursor: pointer;
+ width: 93px;
+ height: 49px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ left: 554px;
+ top: 291px;
+ border: 1px solid #393939;
+}
+
+#phone_dialpad_deleteButton .ico {
+ position: absolute;
+ left: 34px;
+ top: 15px;
+}
+
+#phone_dialpad_dialButton {
+ cursor: pointer;
+ border: 1px solid #393939;
+ left: 661px;
+ top: 241px;
+ width: 128px;
+ height: 49px;
+ -webkit-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+
+#phone_dialpad_dialButton span {
+ font-size: 18px;
+ position: absolute;
+ left: 14px;
+ top: 14px;
+}
+
+#phone_dialpad_dialButton .ico {
+ position: absolute;
+ right: 14px;
+ top: 11px;
+}
+
+#phone_dialpad_endButton {
+ cursor: pointer;
+ border: 1px solid #393939;
+ left: 661px;
+ top: 291px;
+ width: 128px;
+ height: 49px;
+ -webkit-border-bottom-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+
+#phone_dialpad_endButton span {
+ font-size: 18px;
+ position: absolute;
+ left: 14px;
+ top: 14px;
+}
+
+#phone_dialpad_endButton .ico {
+ position: absolute;
+ right: 9px;
+ top: 16px;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/sdl.css b/src/components/HMI/css/sdl.css
new file mode 100644
index 0000000000..cf5994491e
--- /dev/null
+++ b/src/components/HMI/css/sdl.css
@@ -0,0 +1,1219 @@
+/**
+ * CSS for sdl aplications
+ */
+.ffw_list_menu {
+ left: 440px;
+ width: 158px;
+ border: 1px solid #393939;
+ overflow: hidden;
+}
+
+.ffw_list_menu .control {
+ z-index: 2000;
+ text-align: center;
+}
+
+.ffw_list_menu .ffw-button {
+ position: relative;
+ height: 49px;
+ border-bottom: 1px solid #393939;
+ line-height: 50px;
+ display: -webkit-flex;
+ display: -moz-flex;
+ display: flex;
+}
+
+.ffw_list_menu .ffw-button span {
+ height: 50px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding-left: 10px;
+}
+
+.ffw_list_menu .content {
+ position: relative;
+}
+
+.ffw_list_menu .ffw-button.hidden {
+ display: none;
+}
+
+.sdl-window {
+ width: 800px;
+ height: 480px;
+ background-color: #000;
+ z-index: 1;
+}
+
+/**
+ * Important Class for SoftButtons Highlightening
+ */
+.isHighlighted{
+ color: gold;
+}
+
+.isHighlighted .ico{
+ border-style: solid;
+ border-color: #FFA300 #F7DA9C;
+ border-width: 1px;
+}
+
+.softButton .ico{
+ width: 50px;
+ height: 49px;
+ -webkit-flex: 0 0 50px;
+ float: left;
+}
+
+.softButton .right_text{
+ padding-left: 5px !important;
+}
+
+.sdl-window .back-button {
+ top: 80px;
+ left: 5px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+}
+
+.sdl-window .back-button .ico {
+ margin-top: 13px;
+ margin-left: 8px;
+}
+
+#info_apps_deviceList_view .deviceListLabel,.sdl-window .caption-text {
+ top: 80px;
+ left: 75px;
+ width: 620px;
+ background: #393939;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ line-height: 50px;
+ height: 50px;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+
+#info_apps_deviceList_view .progress{
+ top: 175px;
+ left: 254px;
+ background: URL('../images/sdl/progress.gif') no-repeat;
+ width: 300px;
+ height: 200px;
+}
+
+#info_nonMedia {
+ z-index: 1001;
+}
+
+#info_nonMedia .backButton {
+ top: 80px;
+ left: 20px;
+}
+
+#info_nonMedia .inner_content {
+ left: 180px;
+ top: 90px;
+ width: 600px;
+ height: 300px;
+ overflow: hidden;
+}
+
+#info_nonMedia .app_title {
+ width: 390px;
+ padding: 15px;
+ top: 1px;
+ background-color: #393939;
+}
+
+#info_nonMedia .app_image {
+ top: 60px;
+}
+
+#info_nonMedia .app_fields {
+ left: 160px;
+ top: 60px;
+ width: 260px;
+}
+
+#info_nonMedia .app_fields .label {
+ position: relative;
+ border: 1px solid #393939;
+ padding: 7px;
+ margin-bottom: 5px;
+}
+
+#info_nonMedia .presets {
+ top: 220px;
+ width: 420px;
+ height: 80px;
+}
+
+#info_nonMedia .presets .ffw-button {
+ width: 82px;
+ height: 38px;
+ position: relative;
+ float: left;
+ line-height: 40px;
+ border-bottom: 1px solid #393939;
+ border-right: 1px solid #393939;
+ border-top: 1px solid #222;
+ border-left: 1px solid #222;
+ text-align: center;
+}
+
+#info_nonMedia .presets .ffw-button .text{
+ margin-left: 5px;
+ width: 77px;
+ position: absolute;
+ left: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-align: left;
+}
+
+#info_nonMedia .app_image img {
+ border: 1px solid #393939;
+}
+
+#sdl_options .list {
+ width: 650px;
+ height: 251px;
+ border-radius: 2px;
+ left: 75px;
+ top: 150px;
+}
+
+/*#sdl_view_container .list-content,*/
+#sdl_options .list-content {
+ width: 590px;
+}
+
+#VRPopUp.move{
+ left: 800px;
+}
+
+#VRPopUp span,#info_apps_deviceList_list .list-content span,#sdl_view_container .list-content span,#sdl_options .list-content span
+ {
+ margin-left: 15px;
+ position: relative;
+ text-overflow: ellipsis;
+ width: 521px;
+ overflow: hidden;
+ float: left;
+}
+
+#sdl_options .list-content .ico {
+ height: 49px;
+ width: 49px;
+ float: left;
+ position: relative;
+}
+
+#info_nonMedia_options_submenu {
+ z-index: 11000;
+ width: 800px;
+ height: 480px;
+ background-color: black;
+ top: 0px;
+ left: 0px;
+}
+
+#sdl_media_presetButtons .preset-item>span {
+ z-index: 202;
+ display: block;
+ position: absolute;
+ left: 10px;
+ width: 84px;
+ height: 50px;
+ font-size: 20px;
+ line-height: 50px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ color: white;
+}
+
+#sdl_view_container .preset-items {
+ width: 468px;
+}
+
+#sdl_view_container .main-preset-buttons-wraper .preset-item.a3,#sdl_view_container .main-preset-buttons-wraper .preset-item.a6
+ {
+ width: 155px;
+}
+
+#sdl_view_container .player_controllsV2 {
+ top: 241px !important;
+ height: 48px;
+}
+
+#sdl_view_container .player_controllsV2 .ffw-button {
+ height: 48px;
+}
+
+#sdl_view_container .player_controllsV2 img {
+ margin-top: -26px;
+}
+
+/* ScrollableMessage */
+#ScrollableMessage.ScrollableMessage {
+ left: 0;
+ top: 0;
+ width: 800px;
+ height: 480px;
+ /*z-index: 1000;*/
+ background: url(../images/media/bg.png) no-repeat;
+}
+
+#ScrollableMessage.active {
+ opacity: 1;
+ display: block;
+}
+
+#ScrollableMessage .backButton {
+ top: 80px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+}
+
+#ScrollableMessage .titleText {
+ top: 80px;
+ left: 75px;
+ width: 620px;
+ height: 20px;
+ background: #393939;
+ padding: 15px;
+}
+
+#ScrollableMessage .scrollableText {
+ position: absolute;
+ width: 525px;
+ height: 251px;
+ border-radius: 2px;
+ left: 200px;
+ top: 154px;
+ overflow: hidden;
+}
+
+#ScrollableMessage .scrollableText-content {
+ border: none;
+ width: 474px;
+}
+
+#ScrollableMessage .scrollableText-item {
+ position: relative;
+ width: 100%;
+ height: 48px;
+ font-size: 20px;
+ line-height: 50px;
+ border: 1px solid #393939;
+}
+
+#ScrollableMessage .ffw_list_menu {
+ top: 154px !important;
+ left: 25px !important;
+}
+
+#ScrollableMessage .scrollableTextArea {
+ margin: 0px;
+ /*height: 251px;*/
+ width: 469px;
+ font-family: sans-serif;
+ font-size: 16px;
+ color: white;
+ background-color: transparent;
+ resize: none;
+ line-height: 23px;
+ position: absolute;
+}
+
+/* SDL Slider */
+.slider-header {
+ top: 167px;
+ left: 145px;
+ width: 480px;
+ background: #393939;
+ line-height: 50px;
+ height: 50px;
+ padding-left: 15px;
+ padding-right: 15px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.slider-footer {
+ top: 325px;
+ left: 145px;
+ width: 480px;
+ background: #393939;
+ line-height: 50px;
+ height: 50px;
+ padding-left: 15px;
+ padding-right: 15px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#slider_view .okButton{
+ top: 379px;
+ left: 364px;
+ width: 54px;
+ height: 17px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ padding: 10px;
+}
+
+#slider_view .sliderControl {
+ width: 600px;
+ left: 100px;
+ top: 250px;
+ text-align: center;
+}
+
+#slider_view .control {
+ width: 58px;
+ height: 38px;
+ border: 1px solid #393939;
+ position: relative;
+ display: inline-block;
+}
+
+#slider_view .ledContainer {
+ position: relative;
+ display: inline-block;
+ border: 1px solid #393939;
+ height: 38px;
+}
+
+#slider_view .control.minus .ico {
+ top: 19px;
+ left: 20px;
+ position: absolute;
+}
+
+#slider_view .control.plus .ico {
+ top: 12px;
+ left: 20px;
+ position: absolute;
+}
+
+#slider_view .led {
+ width: 12px;
+ height: 40px;
+ background: url("../images/common/seat-act-led.png") no-repeat;
+ position: relative !important;
+ background-position: -4px 0;
+ display: inline-block;
+}
+
+#slider_view .led-inactive {
+ background: url("../images/common/seat-inact-led.png") no-repeat;
+ background-position: 3px 8px;
+ width: 12px;
+ height: 40px;
+ position: relative !important;
+ display: inline-block;
+}
+
+/* SDL Perform Interaction Choise,
+ SDL TBT Turn List */
+#tbtTurnListView .list,
+#perform_interaction_view .list,
+#vr_help_list_view .list {
+ position: absolute;
+ width: 650px;
+ height: 251px;
+ border-radius: 2px;
+ left: 75px;
+ top: 154px;
+}
+
+#tbtTurnListView .list span,
+#perform_interaction_view .list span,
+#vr_help_list_view .list span{
+ margin-left: 15px;
+}
+
+#tbtTurnListView .list-content,
+#perform_interaction_view .list-content,
+#vr_help_list_view .list-content {
+ width: 578px;
+}
+
+#perform_interaction_view input{
+ width: 720px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ background: rgba(119, 119, 119, 0.42);
+ cursor: pointer;
+ font-size: 32px;
+ color: #FFF;
+ top: 80px;
+ left: 65px;
+ position: absolute;
+}
+#perform_interaction_view .listWrapper{
+ top: 140px;
+ width: 750px;
+ height: 275px;
+ left: 25px;
+}
+
+#perform_interaction_view .naviChoises .ffw-button{
+ width: 110px;
+ height: 110px;
+ margin: 20px;
+ float: left;
+ position: relative;
+ border: 1px solid #333;
+ border-radius: 2px;
+ background-repeat: repeat;
+}
+
+#sdl_view_container .cd_logo {
+ position: absolute;
+ top: 90px;
+ right: 10px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 2px;
+ width: 109px;
+ height: 109px;
+}
+
+#sdl_view_container .cd_logoV2 {
+ position: absolute;
+ top: 70px;
+ right: 10px;
+ border: 1px solid #393939;
+ -webkit-border-radius: 2px;
+ width: 109px;
+ height: 109px;
+}
+
+#sdl_view_container .timeV2 {
+ top: 155px;
+}
+
+#sdl_view_container .textLimit {
+ width: 460px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+#VRButton.VRButton {
+ background: url(../images/home/controlButtons/vr.png) no-repeat;
+ width: 89px;
+ height: 90px;
+ left: 1024px;;
+ top: 2px;
+ -webkit-transition: 0.2s;
+}
+
+#VRButton.pressed {
+ background: url(../images/home/controlButtons/vr_pressed.png) no-repeat;
+}
+
+#vehicleInfoButton.vehicleInfoButton {
+ width: 117px;
+ height: 48px;
+ left: 1059px;
+ top: 206px;
+ text-align: center;
+ line-height: 48px;
+}
+
+#tbtClientStateButton.tbtClientStateButton {
+ width: 158px;
+ height: 48px;
+ left: 865px;
+ top: 418px;
+ text-align: center;
+ line-height: 48px;
+}
+
+#exitApp.exitApp {
+ width: 135px;
+ height: 48px;
+ left: 1043px;
+ top: 418px;
+ text-align: center;
+ line-height: 48px;
+}
+
+#exitAppView,#tbtClientStateView,#VehicleInfo,#systemRequestView {
+ opacity: 0;
+ left: 50px;
+ width: 700px;
+ height: 340px;
+ background-color: black;
+ z-index: 2;
+ border-radius: 10PX;
+ top: 70px;
+ -webkit-transition: opacity 1s ease-in-out;
+ display: none;
+ border: 1px solid white;
+}
+
+#exitAppView .exitAppViewLabel,#systemRequestView .systemRequestViewLabel, #tbtClientStateView .tbtClientStateLabel,#VehicleInfo .vehicleInfoLabel
+ {
+ top: 10px;
+ width: 600px;
+ left: 35px;
+ height: 20px;
+ padding: 15px;
+ background: #393939;
+}
+
+#exitAppView.active,#systemRequestView.active,#tbtClientStateView.active,#VehicleInfo.active {
+ opacity: 1;
+ display: block;
+}
+
+#exitAppView .exitAppViewTitle, #systemRequestView .systemRequestViewTitle, #tbtClientStateView .tbtClientState,#VehicleInfo .prndl
+ {
+ top: 70px;
+ width: 600px;
+ left: 40px;
+ height: 20px;
+ padding: 10px;
+ background: #535353;
+}
+
+#exitAppView .exitAppViewSelect, #systemRequestView .systemRequestViewSelect, #tbtClientStateView .tbtClientStateSelect,#VehicleInfo .prndlSelect
+ {
+ top: 125px;
+ position: absolute;
+ width: 150px;
+ left: 275px;
+ height: 40px;
+ color: white;
+ background: #393939;
+}
+
+#exitAppView .exitAppViewSelect option,#tbtClientStateView .tbtClientStateSelect option,#VehicleInfo .prndlSelect option
+ {
+ background: #393939;
+}
+
+#VehicleInfo .odometrTitle{
+ top: 180px;
+ width: 290px;
+ left: 360px;
+ height: 20px;
+ padding: 10px;
+ background: #535353;
+}
+
+#VehicleInfo .odometrInput{
+ width: 265px;
+ position: absolute;
+ top: 242px;
+ left: 373px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ background: rgba(119, 119, 119, 0.42);
+ cursor: pointer;
+ font-size: 32px;
+ color: #FFF;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+#VehicleInfo .ecu1Title {
+ top: 180px;
+ width: 290px;
+ left: 30px;
+ height: 20px;
+ padding: 10px;
+ background: #535353;
+}
+
+#VehicleInfo .ecu1 {
+ top: 233px;
+ width: 80px;
+ left: 65px;
+ height: 20px;
+ padding: 10px;
+}
+
+#VehicleInfo .ecu2 {
+ top: 265px;
+ width: 80px;
+ left: 65px;
+ height: 20px;
+ padding: 10px;
+}
+
+#VehicleInfo .ecu1Data {
+ top: 233px;
+ width: 155px;
+ left: 155px;
+ height: 20px;
+ padding: 10px;
+}
+
+#VehicleInfo .ecu2Data {
+ top: 265px;
+ width: 155px;
+ left: 155px;
+ height: 20px;
+ padding: 10px;
+}
+.PopUp{
+ left: 200px;
+ width: 400px;
+ height: 245px;
+ z-index: 2;
+ top: 110px;
+ -webkit-transition: opacity 1s ease-in-out;
+ background-color: black;
+ border: #A6A6A6 solid 2px;
+ border-radius: 6px;
+}
+
+.PopUp .text{
+ top: 41px;
+ left: 5px;
+ width: 390px;
+ height: 120px;
+ line-height: 20px;
+ position: absolute;
+ overflow: hidden;
+ text-align: center;
+ text-overflow: ellipsis;
+}
+
+.PopUp .OkButton{
+ top: 190px;
+ left: 5px;
+ width: 190px;
+ border: 1px solid #393939;
+}
+
+.PopUp .OkButton span{
+ font-size: 20px;
+ line-height: 50px;
+ cursor: pointer;
+ margin-left: 82px;
+}
+
+.PopUp .CancelButton{
+ top: 190px;
+ left: 205px;
+ width: 190px;
+ border: 1px solid #393939;
+}
+
+.PopUp .CancelButton span{
+ font-size: 20px;
+ line-height: 50px;
+ cursor: pointer;
+ margin-left: 65px;
+}
+
+/* Alert, AudioPassThruPopUp popup*/
+#AlertManeuverPopUp.AlertManeuverPopUp,#AudioPassThruPopUp.AudioPassThruPopUp,#AlertPopUp.AlertPopUp
+ {
+ opacity: 0;
+ left: 200px;
+ width: 400px;
+ height: 245px;
+ z-index: 2;
+ top: 110px;
+ -webkit-transition: opacity 1s ease-in-out;
+ background-color: black;
+ border: #A6A6A6 solid 2px;
+ border-radius: 6px;
+ display: none;
+}
+
+#AlertManeuverPopUp .applicationName,#AudioPassThruPopUp .applicationName,#AlertPopUp .applicationName
+ {
+ width: 380px;
+ left: 10px;
+ text-align: center;
+ font-size: 25px;
+ line-height: 30px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#AlertPopUp .alertPopUpImage {
+ width: 83px;
+ height: 74px;
+ background: url(../images/sdl/Warning.png) no-repeat;
+ top: 45px;
+ left: 10px;
+}
+
+#AlertPopUp .progressIndicator {
+ width: 50px;
+ height: 50px;
+ background: url(../images/sdl/progressindicator.gif) no-repeat;
+ top: 0px;
+ background-size: contain;
+ left: 0px;
+}
+
+#AudioPassThruPopUp .audioPassThruImage {
+ width: 83px;
+ height: 74px;
+ background: url(../images/home/controlButtons/vrImage.png) no-repeat;
+ top: 45px;
+ left: 25px;
+}
+
+#AudioPassThruPopUp .message1,#AlertPopUp .message1 {
+ top: 37px;
+ left: 105px;
+ width: 285px;
+ height: 30px;
+ text-align: center;
+ font-size: 23px;
+ line-height: 30px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#AudioPassThruPopUp .message2,#AlertPopUp .message2 {
+ top: 70px;
+ left: 105px;
+ width: 285px;
+ height: 28px;
+ text-align: center;
+ font-size: 23px;
+ line-height: 30px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#AudioPassThruPopUp .message3,#AlertPopUp .message3 {
+ top: 100px;
+ left: 105px;
+ width: 285px;
+ height: 28px;
+ text-align: center;
+ font-size: 23px;
+ line-height: 30px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#AlertManeuverPopUp.AlertManeuverActive,#AudioPassThruPopUp.AudioPassThruActive,#AlertPopUp.AlertActive
+ {
+ opacity: 1;
+ display: block;
+}
+
+#baseNavigation .softButton,#AlertManeuverPopUp .softButton,#AudioPassThruPopUp .softButton,#AlertPopUp .softButton
+ {
+ border: 1px solid #393939;
+ border-radius: 3px;
+ height: 42px;
+ line-height: 42px;
+ text-align: center;
+ float: left;
+ margin: 10px;
+ position: relative;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+#baseNavigation .naviOptionsBtn{
+ border: 1px solid #393939;
+ border-radius: 3px;
+ height: 42px;
+ line-height: 42px;
+ text-align: center;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ top: 283px;
+ right: 6px;
+ width: 105px;
+ position: absolute;
+}
+
+#AlertManeuverPopUp .closeButton {
+ width: 170px;
+ top: 180px;
+ left: 110px;
+}
+
+#AlertPopUp .alertSoftButtons {
+ margin-left: 8px;
+ top: 120px;
+ width: 386px;
+}
+
+#AlertManeuverPopUp .one,#softButton0.one {
+ margin-top: 42px;
+ width: 362px;
+}
+
+#softButton0.two {
+ margin-top: 42px;
+ width: 170px;
+}
+
+#softButton1.two {
+ margin-top: 42px;
+ width: 170px;
+}
+
+#softButton0.three {
+ width: 170px;
+}
+
+#AudioPassThruPopUp .buttonDone,#softButton1.three {
+ width: 170px;
+}
+
+#AudioPassThruPopUp .buttonCancel,#softButton2.three {
+ width: 362px;
+}
+
+#softButton0.four {
+ width: 170px;
+}
+
+#softButton1.four {
+ width: 170px;
+}
+
+#softButton2.four {
+ width: 170px;
+}
+
+#softButton3.four {
+ width: 170px;
+}
+
+#AudioPassThruPopUp .buttonRetry {
+ top: 120px;
+ width: 175px;
+}
+
+#AudioPassThruPopUp .buttonDone {
+ top: 120px;
+ width: 175px;
+}
+
+#AudioPassThruPopUp .buttonCancel {
+ top: 120px;
+ width: 372px;
+}
+
+#info_leftMenu_sdl {
+ font-size: 18px;
+ line-height: 48px;
+}
+
+#info_leftMenu_sdl img {
+ float: left;
+}
+
+#info_leftMenu_sdl span {
+ float: left;
+ position: relative;
+ width: 100px;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ left: 0;
+}
+
+/* TurnByTurnView */
+#TurnByTurnView.TurnByTurnView {
+ top: 48px;
+ height: 384px;
+ left: 153px;
+ width: 647px;
+ background: none;
+}
+
+#TurnByTurnView .caption-text {
+ left: 5px;
+ width: 607px;
+ top: 15px;
+}
+
+#TurnByTurnView .label {
+ overflow: hidden;
+}
+
+#TurnByTurnView .totalDistanceLabel {
+ height: 20px;
+ background: #393939;
+ padding: 15px;
+ left: 5px;
+ top: 80px;
+ width: 170px;
+}
+
+#TurnByTurnView .etaLabel {
+ height: 20px;
+ background: #393939;
+ padding: 15px;
+ left: 206px;
+ top: 80px;
+ width: 170px;
+}
+
+#TurnByTurnView .turnList {
+ left: 5px;
+ top: 145px;
+ width: 379px;
+ padding: 10px;
+ text-align: center;
+}
+
+#TurnByTurnView .ffw_list_menu {
+ height: 198px;
+ top: 200px;
+ left: 5px;
+ width: 401px;
+ border: none;
+}
+
+#TurnByTurnView .ffw-button {
+ border-radius: 3px;
+ border: 1px solid #393939;
+ margin-bottom: 5px;
+ text-align: center;
+ font-size: 20px;
+}
+
+
+#TurnByTurnView .ffw-button .text {
+ margin: auto;
+}
+
+#TurnByTurnView .turnList .arrow-ico {
+ margin-top: -13px;
+}
+
+#turnList img {
+ margin-top: -10px;
+}
+
+#TurnByTurnView .homeScreen {
+ left: 440px;
+ top: 312px;
+ padding: 0 0 0 5px;
+ width: 195px;
+}
+
+#TurnByTurnView .homeScreen span {
+ width: 140px;
+}
+
+#TurnByTurnView .homeScreen>img {
+ float: left;
+ width: 50px;
+ height: 50px;
+}
+
+#TurnByTurnView .homeScreen>span {
+ float: left;
+ line-height: 50px;
+ padding-left: 5px;
+}
+
+#TurnByTurnView .navigationText2 {
+ left: 440px;
+ top: 268px;
+ width: 182px;
+ padding: 10px;
+ height: 20px;
+ background: #393939;
+}
+
+#TurnByTurnView .turnIcon,
+#TurnByTurnView .nextTurnIcon {
+ border: 1px solid #222;
+ left: 540px;
+ width: 100px;
+ height: 100px;
+ background-size: contain;
+ background-repeat: no-repeat;
+}
+
+#TurnByTurnView .distanceToManeuver{
+ top: 80px;
+ left: 419px;
+ background: #393939;
+ padding: 15px;
+}
+
+#TurnByTurnView .distanceToManeuverScale{
+ top: 144px;
+ left: 419px;
+ background: #393939;
+ padding: 15px;
+}
+
+#TurnByTurnView .timeToDestination{
+ top: 207px;
+ left: 419px;
+ background: #393939;
+ padding: 15px;
+}
+
+#TurnByTurnView .turnIcon {
+ top: 65px;
+}
+
+#TurnByTurnView .nextTurnIcon {
+ top: 166px;
+}
+
+#tbtTurnListList .list-content .label>img {
+ width: 50px;
+ height: 50px;
+ float: left;
+}
+
+#info_apps_list .ffw-button {
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#sdl_view_container {
+ z-index: 501;
+}
+
+#sdl_view_container .title {
+ top: 79px;
+ font-size: 38px;
+ left: 7px;
+ width: 340px;
+ height: 44px;
+}
+
+#sdl_view_container .album {
+ top: 123px;
+ font-size: 26px;
+ left: 10px;
+ width: 330px;
+ height: 32px;
+}
+
+#sdl_view_container .artist {
+ top: 155px;
+ font-size: 26px;
+ left: 10px;
+ width: 330px;
+ height: 32px;
+}
+
+#sdl_view_container .player_controlls {
+ top: 292px;
+ left: 165px;
+}
+
+/* SDL Slider*/
+#media_sdl_slider_view {
+ width: 800px;
+ height: 480px;
+ z-index: 1000;
+ background: url(../images/media/bg.png) no-repeat;
+}
+
+#media_sdl_slider_view .backButton {
+ top: 80px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+}
+
+#media_sdl_slider_view .initialText {
+ top: 80px;
+ left: 75px;
+ width: 620px;
+ height: 20px;
+ background: #393939;
+ padding: 15px;
+}
+
+/* SDL Perform Interaction Choise */
+#media_app_perform_interaction_view {
+ width: 800px;
+ height: 480px;
+ z-index: 1000;
+ background: url(../images/media/bg.png) no-repeat;
+}
+
+#media_app_perform_interaction_view .backButton {
+ top: 80px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+}
+
+#media_app_perform_interaction_view .list {
+ position: absolute;
+ width: 629px;
+ height: 251px;
+ border-radius: 2px;
+ left: 100px;
+ top: 154px;
+}
+
+#media_app_perform_interaction_view .initialText {
+ top: 80px;
+ left: 75px;
+ width: 620px;
+ height: 20px;
+ background: #393939;
+ padding: 15px;
+}
+
+#media_app_perform_interaction_view .list-content {
+ width: 578px;
+}
+
+/* SDL Media Options */
+#media_app_options_view {
+ width: 800px;
+ height: 480px;
+ z-index: 2002;
+ background: url(../images/media/bg.png) no-repeat;
+}
+
+#media_app_options_view .backButton {
+ top: 80px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+}
+
+#media_app_options_view .list {
+ position: absolute;
+ width: 650px;
+ height: 251px;
+ border-radius: 2px;
+ left: 75px;
+ top: 154px;
+}
+
+#media_app_options_view .optionsLabel {
+ top: 80px;
+ left: 75px;
+ width: 620px;
+ height: 20px;
+ background: #393939;
+ padding: 15px;
+}
+
+#media_app_options_view .list-content {
+ width: 578px;
+} \ No newline at end of file
diff --git a/src/components/HMI/css/settings.css b/src/components/HMI/css/settings.css
new file mode 100644
index 0000000000..b8142924bb
--- /dev/null
+++ b/src/components/HMI/css/settings.css
@@ -0,0 +1,129 @@
+#settingsView .in_settings_separate_view{
+ top: 48px;
+ width: 800px;
+ height: 382px;
+ background: black;
+ z-index: 5000;
+}
+
+#settingsView .in_settings_separate_view .backButton {
+ top: 35px;
+ width: 48px;
+ height: 48px;
+ border: 1px solid #333;
+ border-radius: 2px;
+ left: 25px;
+}
+#settingsView .in_settings_separate_view .list{
+ height: 251px;
+ width: 700px;
+ top: 106px;
+ left: 50px;
+}
+#settingsView .in_settings_separate_view .list-item{
+ width: 639px;
+ padding-left: 10px;
+}
+
+#settingsView .in_settings_separate_view .label{
+ top: 35px;
+ left: 100px;
+ width: 620px;
+ background: #393939;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ line-height: 50px;
+ height: 50px;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+
+#settingsView .backButton .ico {
+ margin-top: 13px;
+ margin-left: 8px;
+}
+
+#settings_leftMenu {
+ background: #333;
+ width: 150px;
+ height: 300px;
+ top: 90px;
+}
+
+#settings_leftMenu .menu-item.info_active {
+ background: url("../images/info/menu_active.png") repeat-x;
+}
+
+#settings_leftMenu .menu-item {
+ z-index: 201;
+ position: relative;
+ width: 150px;
+ height: 50px;
+ cursor: pointer;
+}
+
+#settings_leftMenu .menu-item span {
+ position: absolute;
+ left: 50px;
+ width: 100px;
+ height: 50px;
+ font-size: 18px;
+ line-height: 50px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+#settings_leftMenu .ico {
+ height: 50px;
+ width: 50px;
+}
+
+#settings_leftMenu .settings_active {
+ background: url("../images/info/menu_active.png") repeat-x;
+}
+
+#settingsView .in_settings_view{
+ position: absolute;
+ top: 48px;
+ left: 153px;
+ width: 647px;
+ height: 384px;
+ float: left;
+ z-index: 1001;
+ margin-top: 70px;
+}
+
+#settingsView .policies_settings_list{
+ height: 251px;
+ width: 598px;
+ left: 10px;
+}
+
+#policies_settings_list .list-content .ffw-button{
+ width: 537px;
+ padding-left: 10px;
+}
+
+#settingsView .settingsButton{
+ float: left;
+ width: 536px;
+ margin-right: 10px;
+ height: 48px;
+ font-size: 20px;
+ line-height: 50px;
+ border: 1px solid #393939;
+ cursor: pointer;
+ padding-left: 10px;
+ position: relative;
+}
+
+#policies_settings_system_error .listSelect,
+#policies_settings_status_info .listSelect{
+ top: 125px;
+ position: absolute;
+ width: 150px;
+ left: 320px;
+ height: 40px;
+ color: white;
+ background: #393939;
+} \ No newline at end of file
diff --git a/src/components/HMI/ffw/BasicCommunicationRPC.js b/src/components/HMI/ffw/BasicCommunicationRPC.js
new file mode 100644
index 0000000000..9614c125c4
--- /dev/null
+++ b/src/components/HMI/ffw/BasicCommunicationRPC.js
@@ -0,0 +1,1194 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * Reference implementation of BasicCommunication component. Interface to get or
+ * set some essential information from OS. BasicCommunication responsible for
+ * handling the basic commands of non-graphical part such as the registration of
+ * mobile apps, geting the list of devices and applications and data transfer.
+ */
+
+FFW.BasicCommunication = FFW.RPCObserver
+ .create( {
+
+ /**
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create( {
+ componentName: "BasicCommunication"
+ }),
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+
+ //OnPutFile
+
+
+ onPutFileSubscribeRequestID: -1,
+ onStatusUpdateSubscribeRequestID: -1,
+ onAppPermissionChangedSubscribeRequestID: -1,
+ onSDLPersistenceCompleteSubscribeRequestID: -1,
+ onFileRemovedSubscribeRequestID: -1,
+ onAppRegisteredSubscribeRequestID: -1,
+ onAppUnregisteredSubscribeRequestID: -1,
+ onPlayToneSubscribeRequestID: -1,
+ onSDLCloseSubscribeRequestID: -1,
+ onSDLConsentNeededSubscribeRequestID: -1,
+ onResumeAudioSourceSubscribeRequestID: -1,
+
+ onPutFileUnsubscribeRequestID: -1,
+ onStatusUpdateUnsubscribeRequestID: -1,
+ onAppPermissionChangedUnsubscribeRequestID: -1,
+ onSDLPersistenceCompleteUnsubscribeRequestID: -1,
+ onFileRemovedUnsubscribeRequestID: -1,
+ onAppRegisteredUnsubscribeRequestID: -1,
+ onAppUnregisteredUnsubscribeRequestID: -1,
+ onPlayToneUnsubscribeRequestID: -1,
+ onSDLCloseUnsubscribeRequestID: -1,
+ onSDLConsentNeededUnsubscribeRequestID: -1,
+ onResumeAudioSourceUnsubscribeRequestID: -1,
+
+ // const
+ onStatusUpdateNotification: "SDL.OnStatusUpdate",
+ onAppPermissionChangedNotification: "SDL.OnAppPermissionChanged",
+ onSDLPersistenceCompleteNotification: "BasicCommunication.OnSDLPersistenceComplete",
+ onPutFileNotification: "BasicCommunication.OnPutFile",
+ onFileRemovedNotification: "BasicCommunication.OnFileRemoved",
+ onAppRegisteredNotification: "BasicCommunication.OnAppRegistered",
+ onAppUnregisteredNotification: "BasicCommunication.OnAppUnregistered",
+ onPlayToneNotification: "BasicCommunication.PlayTone",
+ onSDLCloseNotification: "BasicCommunication.OnSDLClose",
+ onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
+ onResumeAudioSourceNotification: "BasicCommunication.OnResumeAudioSource",
+
+
+ /**
+ * init object
+ */
+ init: function() {
+
+ },
+
+ /**
+ * connect to RPC bus
+ */
+ connect: function() {
+
+ this.client.connect(this, 600); // Magic number is unique identifier
+ // for component
+ },
+
+ /**
+ * disconnect from RPC bus
+ */
+ disconnect: function() {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /**
+ * Client is registered - we can send request starting from this point
+ * of time
+ */
+ onRPCRegistered: function() {
+
+ Em.Logger.log("FFW.BasicCommunicationRPC.onRPCRegistered");
+ this._super();
+
+ // subscribe to notifications
+ this.onPutFileSubscribeRequestID = this.client
+ .subscribeToNotification(this.onPutFileNotification);
+ this.onStatusUpdateSubscribeRequestID = this.client
+ .subscribeToNotification(this.onStatusUpdateNotification);
+ this.onAppPermissionChangedSubscribeRequestID = this.client
+ .subscribeToNotification(this.onAppPermissionChangedNotification);
+ this.onSDLPersistenceCompleteSubscribeRequestID = this.client
+ .subscribeToNotification(this.onSDLPersistenceCompleteNotification);
+ this.onFileRemovedSubscribeRequestID = this.client
+ .subscribeToNotification(this.onFileRemovedNotification);
+ this.onAppRegisteredSubscribeRequestID = this.client
+ .subscribeToNotification(this.onAppRegisteredNotification);
+ this.onAppUnregisteredSubscribeRequestID = this.client
+ .subscribeToNotification(this.onAppUnregisteredNotification);
+ this.onPlayToneSubscribeRequestID = this.client
+ .subscribeToNotification(this.onPlayToneNotification);
+ this.onSDLCloseSubscribeRequestID = this.client
+ .subscribeToNotification(this.onSDLCloseNotification);
+ this.onSDLConsentNeededSubscribeRequestID = this.client
+ .subscribeToNotification(this.onSDLConsentNeededNotification);
+ this.onResumeAudioSourceSubscribeRequestID = this.client
+ .subscribeToNotification(this.onResumeAudioSourceNotification);
+ },
+
+ /**
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.BasicCommunicationRPC.onRPCUnregistered");
+ this._super();
+
+ // unsubscribe from notifications
+
+ this.onPutFileUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onPutFileNotification);
+ this.onStatusUpdateUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onStatusUpdateNotification);
+ this.onAppPermissionChangedUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onAppPermissionChangedNotification);
+ this.onSDLPersistenceCompleteUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onSDLPersistenceCompleteNotification);
+ this.onFileRemovedUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onFileRemovedNotification);
+ this.onAppRegisteredUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onAppRegisteredNotification);
+ this.onAppUnregisteredUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onAppUnregisteredNotification);
+ this.onPlayToneUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onPlayToneNotification);
+ this.onSDLCloseUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onSDLCloseNotification);
+ this.onSDLConsentNeededUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onSDLConsentNeededNotification);
+ this.onResumeAudioSourceUnsubscribeRequestID = this.client
+ .unsubscribeFromNotification(this.onResumeAudioSourceNotification);
+ },
+
+ /**
+ * Client disconnected.
+ */
+ onRPCDisconnected: function() {
+
+ if (SDL.SDLAppController) {
+ SDL.SDLAppController.onSDLDisconected();
+ }
+ },
+
+ /**
+ * when result is received from RPC component this function is called It
+ * is the propriate place to check results of reuqest execution Please
+ * use previously store reuqestID to determine to which request repsonse
+ * belongs to
+ */
+ onRPCResult: function(response) {
+
+ Em.Logger.log("FFW.BasicCommunicationRPC.onRPCResult");
+ this._super();
+
+ if (response.result.method == "SDL.GetUserFriendlyMessage") {
+
+ Em.Logger.log("SDL.GetUserFriendlyMessage: Response from SDL!");
+
+ if (response.id in SDL.SDLModel.userFriendlyMessagePull) {
+ var callbackObj = SDL.SDLModel.userFriendlyMessagePull[response.id];
+ callbackObj.callbackFunc(response.result.messages, callbackObj.appID);
+ delete SDL.SDLModel.userFriendlyMessagePull[response.id];
+ }
+ }
+
+ if (response.result.method == "SDL.ActivateApp") {
+
+ Em.Logger.log("SDL.ActivateApp: Response from SDL!");
+
+ if (response.id in SDL.SDLModel.activateAppRequestsList) {
+
+ var appID = SDL.SDLModel.activateAppRequestsList[response.id];
+
+ if (!response.result.isSDLAllowed) {
+
+ SDL.SettingsController.currentDeviceAllowance = response.result.device;
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.AllowSDLFunctionality, appID, ["DataConsent"]);
+ }
+
+ if (response.result.isPermissionsConsentNeeded) {
+
+ this.GetListOfPermissions(appID);
+ }
+
+ if (response.result.isAppPermissionsRevoked) {
+
+ SDL.SDLModel.setAppPermissions(appID, response.result.appRevokedPermissions);
+ }
+
+ if (response.result.isAppRevoked) {
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appID, ["AppUnsupported"]);
+ } else {
+
+ SDL.SDLController.getApplicationModel(appID).deviceID = response.result.device ? response.result.device.id : null;
+
+ if ( SDL.SDLAppController.model && SDL.SDLAppController.model.appID != appID) {
+ SDL.States.goToStates('info.apps');
+ }
+
+ if (SDL.SDLModel.stateLimited == appID) {
+ SDL.SDLModel.stateLimited = null;
+ SDL.SDLModel.set('limitedExist', false);
+ }
+
+ if (response.result.isSDLAllowed) {
+ SDL.SDLController.getApplicationModel(appID).turnOnSDL(appID);
+ }
+ }
+
+ delete SDL.SDLModel.activateAppRequestsList[response.id];
+ }
+ }
+
+ if (response.result.method == "SDL.GetListOfPermissions") {
+
+ Em.Logger.log("SDL.GetListOfPermissions: Response from SDL!");
+
+ SDL.SettingsController.GetListOfPermissionsResponse(response);
+ }
+
+ if (response.result.method == "SDL.GetStatusUpdate") {
+
+ Em.Logger.log("SDL.GetStatusUpdate: Response from SDL!");
+
+ SDL.PopUp.create().appendTo('body').popupActivate(response.result);
+ }
+
+ if (response.result.method == "SDL.GetURLS") {
+
+ SDL.SDLModel.set('policyURLs', response.result.urls);
+
+ if (response.result.urls.length) {
+ this.OnSystemRequest("PROPRIETARY", response.result.urls[0].policyAppId, SDL.SettingsController.policyUpdateFile, response.result.urls[0].url);
+ } else {
+ this.OnSystemRequest("PROPRIETARY");
+ }
+
+ SDL.SettingsController.policyUpdateRetry();
+
+ }
+ },
+
+ /**
+ * handle RPC erros here
+ */
+ onRPCError: function(error) {
+
+ Em.Logger.log("FFW.BasicCommunicationRPC.onRPCError");
+ this._super();
+ },
+
+ /**
+ * handle RPC notifications here
+ */
+ onRPCNotification: function(notification) {
+
+ Em.Logger.log("FFW.BasicCommunicationRPC.onRPCNotification");
+ this._super();
+
+ if (notification.method == this.onFileRemovedNotification) {
+ SDL.SDLModel.onFileRemoved(notification.params);
+ }
+
+ if (notification.method == this.onStatusUpdateNotification) {
+
+ SDL.TTSPopUp.ActivateTTS(notification.params.status);
+
+ var messageCode = '';
+ switch(notification.params.status){
+ case "UP_TO_DATE":{
+ messageCode = "StatusUpToDate";
+ break;
+ }
+ case "UPDATING":{
+ messageCode = "StatusPending";
+ break;
+ }
+ case "UPDATE_NEEDED":{
+ messageCode = "StatusNeeded";
+ break;
+ }
+ }
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, SDL.SDLAppController.model?SDL.SDLAppController.model.appID:null, [messageCode]);
+ }
+
+ if (notification.method == this.onAppPermissionChangedNotification) {
+
+ if (notification.params.appPermissionsConsentNeeded) {
+
+ this.GetListOfPermissions(notification.params.appID);
+ }
+
+ if (notification.params.isAppPermissionsRevoked) {
+
+ SDL.SDLModel.setAppPermissions(notification.params.appID, response.result.appRevokedPermissions);
+ }
+
+ if (notification.params.appRevoked) {
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, notification.params.appID, ["AppUnsupported"]);
+ }
+
+ if (notification.params.appUnauthorized) {
+
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, notification.params.appID, ["AppUnauthorized"]);
+ }
+ }
+
+ if (notification.method == this.onAppRegisteredNotification) {
+ SDL.SDLModel.onAppRegistered(notification.params);
+ this.OnFindApplications();
+ }
+
+ if (notification.method == this.onAppUnregisteredNotification) {
+ // remove app from list
+ SDL.SDLModel.onAppUnregistered(notification.params);
+ }
+
+ if (notification.method == this.onPlayToneNotification) {
+ SDL.SDLModel.onPlayTone();
+ }
+
+ if (notification.method == this.onSDLCloseNotification) {
+ //notification handler method
+ }
+ if (notification.method == this.onSDLConsentNeededNotification) {
+
+ SDL.SettingsController.currentDeviceAllowance = notification.params.device;
+ FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.AllowSDLFunctionality, null, ["DataConsent"]);
+ }
+ if (notification.method == this.onResumeAudioSourceNotification) {
+
+ SDL.SDLModel.stateLimited = notification.params.device;
+ SDL.VRPopUp.updateVR();
+ }
+ },
+
+ /**
+ * handle RPC requests here
+ */
+ onRPCRequest: function(request) {
+
+ Em.Logger.log("FFW.BasicCommunicationRPC.onRPCRequest");
+ this._super();
+
+ if (this.validationCheck(request)) {
+
+ if (request.method == "BasicCommunication.MixingAudioSupported") {
+ this.MixingAudioSupported(request.id, true);
+ }
+ if (request.method == "BasicCommunication.AllowAllApps") {
+ this.AllowAllApps(true);
+ }
+ if (request.method == "BasicCommunication.AllowApp") {
+ this.AllowApp(request);
+ }
+ if (request.method == "BasicCommunication.AllowDeviceToConnect") {
+ this.AllowDeviceToConnect(request.id, request.method, allow);
+ }
+ if (request.method == "BasicCommunication.UpdateDeviceList") {
+ SDL.SDLModel.onGetDeviceList(request.params);
+ this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+ }
+ if (request.method == "BasicCommunication.UpdateAppList") {
+
+ var message = "Was found " + request.params.applications.length + " apps";
+
+ SDL.PopUp.create().appendTo('body').popupActivate(message);
+
+ this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+ }
+ if (request.method == "BasicCommunication.SystemRequest") {
+
+ SDL.SettingsController.policyUpdateRetry("ABORT");
+
+ this.OnReceivedPolicyUpdate(request.params.fileName);
+
+ SDL.SettingsController.policyUpdateFile = null;
+
+ this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+ }
+ if (request.method == "BasicCommunication.ActivateApp") {
+
+ if (!request.params.level || request.params.level == "FULL") {
+ if ((SDL.SDLAppController.model && SDL.SDLAppController.model.appID != request.params.appID) || (request.params.level == "NONE" || request.params.level == "BACKGROUND")) {
+ SDL.States.goToStates('info.apps');
+ }
+
+ if (SDL.SDLModel.stateLimited == request.params.appID) {
+ SDL.SDLModel.stateLimited = null;
+ SDL.SDLModel.set('limitedExist', false);
+ }
+
+ SDL.SDLController.getApplicationModel(request.params.appID).turnOnSDL(request.params.appID);
+ }
+ this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ }
+ if (request.method == "BasicCommunication.GetSystemInfo") {
+
+ Em.Logger.log("BasicCommunication.GetSystemInfo Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum) from SDL protocol
+ "method": request.method,
+ "ccpu_version": "ccpu_version",
+ "language": SDL.SDLModel.hmiUILanguage,
+ "wersCountryCode": "wersCountryCode"
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ if (request.method == "BasicCommunication.PolicyUpdate") {
+ SDL.SettingsController.policyUpdateFile = request.params.file;
+
+ SDL.SDLModel.policyUpdateRetry.timeout = request.params.timeout;
+ SDL.SDLModel.policyUpdateRetry.retry = request.params.retry;
+ SDL.SDLModel.policyUpdateRetry.try = 0;
+
+ this.GetURLS(7); //Service type for policies
+
+ this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+ }
+ }
+ },
+
+ /********************* Requests *********************/
+
+
+ /**
+ * Send request if application was activated
+ *
+ * @param {Number} appID
+ */
+ ActivateApp: function(appID) {
+
+ var itemIndex = this.client.generateId();
+
+ SDL.SDLModel.activateAppRequestsList[itemIndex] = appID;
+
+ Em.Logger.log("FFW.SDL.OnAppActivated: Request from HMI!");
+
+ // send notification
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": itemIndex,
+ "method": "SDL.ActivateApp",
+ "params": {
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Send request if application was activated
+ *
+ * @param {Number} type
+ */
+ GetURLS: function(type) {
+
+ Em.Logger.log("FFW.SDL.GetURLS: Request from HMI!");
+
+ // send notification
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": this.client.generateId(),
+ "method": "SDL.GetURLS",
+ "params": {
+ "service": type
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Request from HMI to find out Policy Table status
+ */
+ GetStatusUpdate: function() {
+
+ Em.Logger.log("SDL.GetStatusUpdate: Request from HMI!");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": this.client.generateId(),
+ "method": "SDL.GetStatusUpdate",
+ "params": {}
+ };
+ this.client.send(JSONMessage);
+ },
+
+ UpdateSDL: function() {
+
+ Em.Logger.log("SDL.UpdateSDL: Request from HMI!");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": this.client.generateId(),
+ "method": "SDL.UpdateSDL",
+ "params": {}
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Request to SDLCore to get user friendly message
+ * callback function uses text message came in response from SDLCore
+ *
+ * @callback callbackFunc
+ */
+ GetUserFriendlyMessage: function(callbackFunc, appID, messageCodes) {
+
+ var itemIndex = this.client.generateId();
+
+ SDL.SDLModel.userFriendlyMessagePull[itemIndex] = {"callbackFunc": callbackFunc, "appID": appID};
+
+ Em.Logger.log("SDL.GetUserFriendlyMessage: Request from HMI!");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": itemIndex,
+ "method": "SDL.GetUserFriendlyMessage",
+ "params": {
+ "language": SDL.SDLModel.hmiUILanguage,
+ "messageCodes": messageCodes
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Request to SDLCore to get user friendly message
+ * callback function uses text message came in response from SDLCore
+ *
+ * @param {Number} appID
+ */
+ GetListOfPermissions: function(appID) {
+
+ var itemIndex = this.client.generateId();
+
+ SDL.SDLModel.getListOfPermissionsPull[itemIndex] = appID;
+
+ Em.Logger.log("SDL.GetListOfPermissions: Request from HMI!");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": itemIndex,
+ "method": "SDL.GetListOfPermissions",
+ "params": {
+ }
+ };
+
+ if (appID) {
+ JSONMessage.params.appID = appID;
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+ /********************* Responses *********************/
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendBCResult: function(resultCode, id, method) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": method
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Notifies if functionality was changed
+ *
+ * @param {Boolean}
+ * allowed
+ * @param {String}
+ * source
+ * @param {String}
+ * device
+ */
+ OnAllowSDLFunctionality: function(allowed, source) {
+
+ Em.Logger.log("FFW.SDL.OnAllowSDLFunctionality");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "SDL.OnAllowSDLFunctionality",
+ "params": {
+ "allowed": allowed,
+ "source": source
+ }
+ };
+
+ if (SDL.SettingsController.currentDeviceAllowance) {
+ JSONMessage.params.device = SDL.SettingsController.currentDeviceAllowance;
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+
+ /**
+ * Notifies if language was changed
+ *
+ * @param {String} lang
+ */
+ OnSystemInfoChanged: function(lang) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnSystemInfoChanged");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnSystemInfoChanged",
+ "params": {
+ "language": lang
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+
+ /**
+ * Notification of decrypted policy table available
+ *
+ * @param {String} policyfile
+ */
+ OnReceivedPolicyUpdate: function(policyfile) {
+
+ Em.Logger.log("FFW.SDL.OnReceivedPolicyUpdate");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "SDL.OnReceivedPolicyUpdate",
+ "params": {
+ "policyfile": policyfile
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notifies if functionality was changed
+ *
+ * @param {Boolean}
+ * allowed
+ * @param {String}
+ * source
+ * @param {String}
+ * device
+ */
+ OnAppPermissionConsent: function(consentedFunctions, source, appID) {
+
+ Em.Logger.log("FFW.SDL.OnAppPermissionConsent");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "SDL.OnAppPermissionConsent",
+ "params": {
+ "consentedFunctions": consentedFunctions,
+ "source": source
+ }
+ };
+
+ if (appID) {
+ JSONMessage.params.appID = appID;
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ * @param {Boolean}
+ * allow
+ */
+ AllowDeviceToConnect: function(id, method, allow) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
+ // from SDL
+ // protocol
+ "method": method,
+ "allow": true
+ }
+ };
+ this.client.send(JSONMessage);
+
+ },
+
+ /**
+ * notification that UI is ready BasicCommunication should be sunscribed
+ * to this notification
+ */
+ onReady: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.onReady");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnReady"
+ };
+ this.client.send(JSONMessage);
+ },
+
+/**
+ * Sent notification to SDL when HMI closes
+ */
+ OnIgnitionCycleOver: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.OnIgnitionCycleOver");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnIgnitionCycleOver"
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Send request if application was activated
+ *
+ * @param {number} appID
+ */
+ OnAppActivated: function(appID) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnAppActivated");
+
+ // send notification
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnAppActivated",
+ "params": {
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Send request if device was unpaired from HMI
+ *
+ * @param {number} appID
+ */
+ OnDeviceStateChanged: function(elemet) {
+
+ Em.Logger.log("FFW.SDL.OnDeviceStateChanged");
+
+ // send notification
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "SDL.OnDeviceStateChanged",
+ "params": {
+ "deviceState": "UNPAIRED",
+ "deviceInternalId": "",
+ "deviceId": {
+ "name": elemet.deviceName,
+ "id": elemet.deviceID
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * This methos is request to get list of registered apps.
+ */
+ OnFindApplications: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.OnFindApplications");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnFindApplications"
+ };
+
+ if (SDL.SDLModel.CurrDeviceInfo.name
+ || SDL.SDLModel.CurrDeviceInfo.id) {
+
+ JSONMessage.params = {
+ "deviceInfo": SDL.SDLModel.CurrDeviceInfo
+ };
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Send notification to SDL Core about system errors
+ */
+ OnSystemError: function(error) {
+
+ Em.Logger.log("FFW.SDL.OnSystemError");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "SDL.OnSystemError",
+ "params": {
+ "error": error
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * This methos is request to get list of registered apps.
+ */
+ AddStatisticsInfo: function(statisticType) {
+
+ Em.Logger.log("FFW.SDL.AddStatisticsInfo");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "SDL.AddStatisticsInfo",
+ "params": {
+ "statisticType": statisticType
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Request for list of avaliable devices
+ */
+ getDeviceList: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.GetDeviceList");
+
+ this.getDeviceListRequestID = this.client.generateID();
+
+ var JSONMessage = {
+ "id": this.getDeviceListRequestID,
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.GetDeviceList"
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Invoked by UI component when user switches to any functionality which
+ * is not other mobile application.
+ *
+ * @params {String}
+ * @params {Number}
+ */
+ OnAppDeactivated: function(reason, appID) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnAppDeactivated");
+
+ // send request
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnAppDeactivated",
+ "params": {
+ "appID": appID,
+ "reason": reason
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Initiated by HMI user. In response optional list of found devices -
+ * if not provided, not were found.
+ */
+ OnStartDeviceDiscovery: function() {
+
+ Em.Logger.log("FFW.BasicCommunication.OnStartDeviceDiscovery");
+
+ // send request
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnStartDeviceDiscovery"
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Used by HMI when User chooses to exit application.
+ *
+ * @params {Number}
+ */
+ ExitApplication: function(appID, reason) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnExitApplication");
+
+ // send request
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnExitApplication",
+ "params": {
+ "reason": reason,
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Sent by HMI to SDL to close all registered applications.
+ *
+ * @params {String}
+ */
+ ExitAllApplications: function(reason) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnExitAllApplications");
+
+ // send request
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnExitAllApplications",
+ "params": {
+ "reason": reason
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Response with params of the last one supports mixing audio (ie
+ * recording TTS command and playing audio).
+ *
+ * @params {Number}
+ */
+ MixingAudioSupported: function(requestid, attenuatedSupported) {
+
+ Em.Logger.log("FFW.BasicCommunication.MixingAudioSupportedResponse");
+
+ // send request
+
+ var JSONMessage = {
+ "id": requestid,
+ "jsonrpc": "2.0",
+ "result": {
+ "code": 0,
+ "attenuatedSupported": attenuatedSupported,
+ "method": "BasicCommunication.MixingAudioSupported"
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Response with Results by user/HMI allowing SDL functionality or
+ * disallowing access to all mobile apps.
+ *
+ * @params {Number}
+ */
+ AllowAllApps: function(allowed) {
+
+ Em.Logger.log("FFW.BasicCommunication.AllowAllAppsResponse");
+
+ // send request
+
+ var JSONMessage = {
+ "id": this.client.idStart,
+ "jsonrpc": "2.0",
+ "result": {
+ "code": 0,
+ "method": "BasicCommunication.AllowAllApps",
+ "allowed": allowed
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Response with result of allowed application
+ *
+ * @params {Number}
+ */
+ AllowApp: function(request) {
+
+ Em.Logger.log("FFW.BasicCommunication.AllowAppResponse");
+
+ var allowedFunctions = [];
+ request.params.appPermissions.forEach(function(entry) {
+ allowedFunctions.push(
+ {
+ name: entry,
+ allowed: true
+ }
+ )
+ }
+ );
+
+ // send request
+
+ var JSONMessage = {
+ "id": request.id,
+ "jsonrpc": "2.0",
+ "result": {
+ "code": 0,
+ "method": "BasicCommunication.AllowApp",
+ "allowedFunctions": allowedFunctions
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notifies if device was choosed
+ *
+ * @param {String}
+ * deviceName
+ * @param {Number}
+ * appID
+ */
+ OnDeviceChosen: function(deviceName, appID) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnDeviceChosen");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnDeviceChosen",
+ "params": {
+ "deviceInfo": {
+ "name": deviceName,
+ "id": appID
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function(resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Initiated by HMI.
+ */
+ OnSystemRequest: function(type, appID, fileName, url) {
+
+ Em.Logger.log("FFW.BasicCommunication.OnSystemRequest");
+
+ // send request
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "BasicCommunication.OnSystemRequest",
+ "params":{
+ "requestType": type,
+ "url": url,
+ "fileType": "JSON",
+ "offset": 1000,
+ "length": 10000,
+ "timeout": 500,
+ "fileName": fileName ? fileName : document.location.pathname.replace("index.html", "IVSU/PROPRIETARY_REQUEST"),
+ "appID": appID ? appID : "default"
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+
+ })
diff --git a/src/components/HMI/ffw/ButtonsRPC.js b/src/components/HMI/ffw/ButtonsRPC.js
new file mode 100644
index 0000000000..d4dc198ce2
--- /dev/null
+++ b/src/components/HMI/ffw/ButtonsRPC.js
@@ -0,0 +1,347 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Reference implementation of Buttons component.
+ *
+ * Buttons sends to SDLCore press and hold events of soft buttons, presets and
+ * some hard keys.
+ */
+
+FFW.Buttons = FFW.RPCObserver.create( {
+
+ /*
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create( {
+ componentName: "Buttons"
+ }),
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+ /*
+ * connect to RPC bus
+ */
+ connect: function() {
+
+ this.client.connect(this, 200); // Magic number is unique identifier for
+ // component
+ },
+
+ /*
+ * disconnect from RPC bus
+ */
+ disconnect: function() {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /*
+ * Client is registered - we can send request starting from this point of
+ * time
+ */
+ onRPCRegistered: function() {
+
+ Em.Logger.log("FFW.Buttons.onRPCRegistered");
+ this._super();
+ },
+
+ /*
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.Buttons.onRPCUnregistered");
+ this._super();
+ },
+
+ /*
+ * Client disconnected.
+ */
+ onRPCDisconnected: function() {
+
+ },
+
+ /*
+ * when result is received from RPC component this function is called It is
+ * the propriate place to check results of reuqest execution Please use
+ * previously store reuqestID to determine to which request repsonse belongs
+ * to
+ */
+ onRPCResult: function(response) {
+
+ Em.Logger.log("FFW.Buttons.onRPCResult");
+ this._super();
+ },
+
+ /*
+ * handle RPC erros here
+ */
+ onRPCError: function(error) {
+
+ Em.Logger.log("FFW.Buttons.onRPCError");
+ this._super();
+ },
+
+ /*
+ * handle RPC notifications here
+ */
+ onRPCNotification: function(notification) {
+
+ Em.Logger.log("FFW.Buttons.onRPCNotification");
+ this._super();
+ },
+
+ /*
+ * handle RPC requests here
+ */
+ onRPCRequest: function(request) {
+
+ Em.Logger.log("FFW.Buttons.onRPCRequest");
+ this._super();
+
+ if (request.method == "Buttons.GetCapabilities") {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "capabilities": [
+ {
+ "name": "PRESET_0",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_1",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_2",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_3",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_4",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_5",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_6",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_7",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_8",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_9",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "OK",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "SEEKLEFT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "SEEKRIGHT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "TUNEUP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "TUNEDOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }
+ ],
+ "presetBankCapabilities": {
+ "onScreenPresetsAvailable": true
+ },
+ "code": 0,
+ "method": "Buttons.GetCapabilities"
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function(resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /*
+ * Notifies the ButtonsRPC that the web is all set. Should be called twice:
+ * when the RPC link is up or failed to connect and all the views are
+ * rendered.
+ */
+ buttonPressed: function(id, type) {
+
+ Em.Logger.log("FFW.Buttons.buttonPressed " + type);
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "Buttons.OnButtonPress",
+ "params": {
+ "name": id,
+ "mode": type
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /*
+ * Notifies the ButtonsRPC that the web is all set. Should be called twice:
+ * when the RPC link is up or failed to connect and all the views are
+ * rendered.
+ */
+ buttonEvent: function(id, type) {
+
+ Em.Logger.log("FFW.Buttons.OnButtonEvent " + type);
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "Buttons.OnButtonEvent",
+ "params": {
+ "name": id,
+ "mode": type
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ },
+
+ /*
+ * Notifies the ButtonsRPC that the web is all set. Should be called twice:
+ * when the RPC link is up or failed to connect and all the views are
+ * rendered.
+ */
+ buttonPressedCustom: function(name, type, softButtonID, appID) {
+
+ Em.Logger.log("FFW.Buttons.OnButtonPress " + type);
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "Buttons.OnButtonPress",
+ "params": {
+ "name": name,
+ "mode": type,
+ "customButtonID": softButtonID,
+ "appID": appID
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /*
+ * Notifies the ButtonsRPC that the web is all set. Should be called twice:
+ * when the RPC link is up or failed to connect and all the views are
+ * rendered.
+ */
+ buttonEventCustom: function(name, type, softButtonID, appID) {
+
+ Em.Logger.log("FFW.Buttons.OnButtonEvent " + type);
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "Buttons.OnButtonEvent",
+ "params": {
+ "name": name,
+ "mode": type,
+ "customButtonID": softButtonID,
+ "appID": appID
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ }
+});
diff --git a/src/components/HMI/ffw/Framework.js b/src/components/HMI/ffw/Framework.js
new file mode 100644
index 0000000000..4ab772528f
--- /dev/null
+++ b/src/components/HMI/ffw/Framework.js
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name FFW
+ * @desc Setup framework namespace and settings
+ * @category Framework
+ * @filesource app/Framework.js
+ * @version 1.0
+ */
+
+FFW = Em.Object.create( {
+
+ init: function() {
+
+ Em.Logger.log('FFW: Framework init');
+ }
+}); \ No newline at end of file
diff --git a/src/components/HMI/ffw/NavigationRPC.js b/src/components/HMI/ffw/NavigationRPC.js
new file mode 100644
index 0000000000..5f594079a1
--- /dev/null
+++ b/src/components/HMI/ffw/NavigationRPC.js
@@ -0,0 +1,334 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Reference implementation of Navigation component.
+ *
+ * Interface to get or set some essential information sent from SDLCore.
+ * Navigation is responsible for the navigationApp functionality provided by the
+ * application: display graphics and multimedia components, is responsible for
+ * the transfer of managed manipulations, generated by the user to the server.
+ *
+ */
+
+FFW.Navigation = FFW.RPCObserver.create( {
+
+ /**
+ * If true then Navigation is present and ready to communicate with SDL.
+ *
+ * @type {Boolean}
+ */
+ isReady: true,
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+ /**
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create( {
+ componentName: "Navigation"
+ }),
+
+ // temp var for debug
+ appID: 1,
+
+ /**
+ * connect to RPC bus
+ */
+ connect: function() {
+
+ this.client.connect(this, 800); // Magic number is unique identifier for
+ // component
+ },
+
+ /**
+ * disconnect from RPC bus
+ */
+ disconnect: function() {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /**
+ * Client is registered - we can send request starting from this point of
+ * time
+ */
+ onRPCRegistered: function() {
+
+ Em.Logger.log("FFW.Navigation.onRPCRegistered");
+ this._super();
+
+ // subscribe to notifications
+ },
+
+ /**
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.Navigation.onRPCUnregistered");
+ this._super();
+
+ // unsubscribe from notifications
+ },
+
+ /**
+ * Client disconnected.
+ */
+ onRPCDisconnected: function() {
+
+ },
+
+ /**
+ * when result is received from RPC component this function is called It is
+ * the propriate place to check results of request execution Please use
+ * previously store reuqestID to determine to which request repsonse belongs
+ * to
+ */
+ onRPCResult: function(response) {
+
+ Em.Logger.log("FFW.Navigation.onRPCResult");
+ this._super();
+ },
+
+ /**
+ * handle RPC erros here
+ */
+ onRPCError: function(error) {
+
+ Em.Logger.log("FFW.Navigation.onRPCError");
+ this._super();
+ },
+
+ /**
+ * handle RPC notifications here
+ */
+ onRPCNotification: function(notification) {
+
+ Em.Logger.log("FFW.Navigation.onRPCNotification");
+ this._super();
+
+ if (notification.method == this.onStopStreamNotification) {
+ SDL.SDLModel.onStopStream(notification.params.appID);
+ }
+ },
+
+ /**
+ * handle RPC requests here
+ */
+ onRPCRequest: function(request) {
+
+ Em.Logger.log("FFW.Navigation.onRPCRequest");
+ if (this.validationCheck(request)) {
+
+ var resultCode = null;
+
+ switch (request.method) {
+ case "Navigation.IsReady": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "available": this.get('isReady'),
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "Navigation.IsReady"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "Navigation.AlertManeuver": {
+
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.ShowConstantTBT": {
+
+ SDL.SDLModel.tbtActivate(request.params);
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.UpdateTurnList": {
+
+ SDL.SDLModel.tbtTurnListUpdate(request.params);
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.StartAudioStream": {
+
+ SDL.SDLModel.startAudioStream(request.params);
+
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.StopAudioStream": {
+
+ SDL.SDLModel.stoptAudioStream(request.params.appID);
+
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.StartStream": {
+
+ SDL.SDLModel.startStream(request.params);
+
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.StopStream": {
+
+ SDL.SDLModel.stopStream(request.params.appID);
+
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "Navigation.SendLocation": {
+
+ this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ }
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function(resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendNavigationResult: function(resultCode, id, method) {
+
+ Em.Logger.log("FFW.UI." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": method
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Notifies if TBTClientState was activated
+ *
+ * @param {String}
+ * state
+ * @param {Number}
+ * appID
+ */
+ onTBTClientState: function(state, appID) {
+
+ Em.Logger.log("FFW.Navigation.OnTBTClientState");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "Navigation.OnTBTClientState",
+ "params": {
+ "state": state
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js
new file mode 100644
index 0000000000..954dfbe17e
--- /dev/null
+++ b/src/components/HMI/ffw/RPCClient.js
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Base class for RPC client
+ *
+ * Class provides access to basic functionality of RPC components Message Broker
+ * as: registerComponent unregisterComponent subscription to notifications logic
+ * to calculate request id
+ */
+
+FFW.RPCClient = Em.Object
+ .extend( {
+
+ /*
+ * transport layer for messages exchange
+ */
+ socket: null, // instance of websocket
+
+ /*
+ * url for message broker
+ */
+ url: FLAGS.WEBSOCKET_URL,
+
+ /*
+ * Component name in RPC system It is unique.
+ */
+ componentName: null,
+
+ /*
+ * observer of RPC states
+ */
+ observer: null,
+
+ /*
+ * these variables are used to have unique request ids for different
+ * components in RPC bus idStart is received as a response for
+ * registerRPCComponent messages. space for ids for specific RPC
+ * component is allocated by message broker
+ */
+ idStart: -1,
+ idRange: 1000,
+ requestId: -1,
+
+ registerRequestId: -1,
+ unregisterRequestId: -1,
+
+ /*
+ * Open WebSocket and initialize handlers
+ */
+ connect: function(observer, startId) {
+
+ this.observer = observer;
+ this.idStart = startId;
+
+ this.socket = new WebSocket(this.url);
+
+ var self = this;
+
+ this.socket.onopen = function(evt) {
+
+ self.onWSOpen(evt)
+ };
+ this.socket.onclose = function(evt) {
+
+ self.onWSClose(evt)
+ };
+ this.socket.onmessage = function(evt) {
+
+ self.onWSMessage(evt)
+ };
+ this.socket.onerror = function(evt) {
+
+ self.onWSError(evt)
+ };
+
+ },
+
+ /*
+ * Close WebSocket connection Please make sure that component was
+ * unregistered in advance
+ */
+ disconnect: function() {
+
+ this.unregisterRPCComponent();
+ SDL.SDLController.unregisterComponentStatus(this.observer.client.componentName);
+ },
+
+ /*
+ * WebSocket connection is ready Now RPC component can be registered in
+ * message broker
+ */
+ onWSOpen: function(evt) {
+
+ Em.Logger.log("RPCCLient.onWSOpen");
+
+ this.registerRPCComponent();
+ },
+
+ /*
+ * when result is received from RPC component this function is called It
+ * is the propriate place to check results of reuqest execution Please
+ * use previously store reuqestID to determine to which request repsonse
+ * belongs to
+ */
+ onWSMessage: function(evt) {
+
+ Em.Logger.log("Message received: " + evt.data);
+
+ var jsonObj = JSON.parse(evt.data);
+
+ JSON.parse(evt.data, SDL.RPCController.capabilitiesCheck);
+
+ if (jsonObj.method == 'UI.Show' && SDL.RPCController.capabilityCheckResult == 'UNSUPPORTED_RESOURCE' && Object.size(jsonObj.params) != 3 && jsonObj.params.showStrings.length != 0) {
+
+ this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["WARNINGS"];
+
+ Em.Logger.error('Image of STATIC type is not supported on HMI. Other information was successfully displayed');
+
+ SDL.RPCController.capabilityCheckResult = null;
+ } else {
+
+ switch (SDL.RPCController.capabilityCheckResult) {
+ case 'UNSUPPORTED_RESOURCE': {
+
+ this.observer.errorResponsePull[jsonObj.id] = SDL.SDLModel.resultCode["UNSUPPORTED_RESOURCE"];
+
+ Em.Logger.error('Unsupported incoming resource! In method ' + jsonObj.method);
+
+ SDL.RPCController.capabilityCheckResult = null;
+
+ break;
+ }
+ }
+ }
+
+
+ // handle component registration
+ if (jsonObj.id == this.registerRequestId && jsonObj.method == null && typeof jsonObj.result == 'number') {
+ if (jsonObj.error == null) {
+ this.requestId = this.idStart = jsonObj.result;
+ this.observer.onRPCRegistered();
+ }
+ // handle component unregistration
+ } else if (jsonObj.id == this.unregisterRequestId) {
+ if (jsonObj.error == null) {
+ this.socket.close();
+ this.observer.onRPCUnregistered();
+ }
+ // handle result, error, notification, requests
+ } else {
+ if (jsonObj.id == null) {
+ this.observer.onRPCNotification(jsonObj);
+ } else {
+ if (jsonObj.result != null)
+ this.observer.onRPCResult(jsonObj);
+ else if (jsonObj.error != null)
+ this.observer.onRPCError(jsonObj);
+ else
+ this.observer.onRPCRequest(jsonObj);
+ }
+ }
+ },
+
+ /*
+ * WebSocket connection is closed Please make sure that RPCComponent was
+ * dunregistered in advance
+ */
+ onWSClose: function(evt) {
+
+ Em.Logger.log("RPCClient: Connection is closed");
+
+ SDL.SDLController.unregisterComponentStatus(this.observer.client.componentName);
+
+ var self = this;
+ setTimeout(function(){
+ self.connect(self.observer, self.idStart);
+ }, 5000);
+ this.observer.onRPCDisconnected();
+ },
+
+ /*
+ * WebSocket connection errors handling
+ */
+ onWSError: function(evt) {
+
+ // Em.Logger.log("ERROR: " + evt.data);
+ Em.Logger.log("ERROR: ");
+ },
+
+ /*
+ * register component is RPC bus
+ */
+ registerRPCComponent: function() {
+
+ this.registerRequestId = this.idStart;
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": this.registerRequestId,
+ "method": "MB.registerComponent",
+ "params": {
+ "componentName": this.componentName
+ }
+ };
+ this.send(JSONMessage);
+ },
+
+ /*
+ * unregister component is RPC bus
+ */
+ unregisterRPCComponent: function() {
+
+ this.unregisterRequestId = this.generateId();
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": this.unregisterRequestId,
+ "method": "MB.unregisterComponent",
+ "params": {
+ "componentName": this.componentName
+ }
+ };
+ this.send(JSONMessage);
+ },
+
+ /*
+ * Subscribes to notification. Returns the request's id.
+ */
+ subscribeToNotification: function(notification) {
+
+ var msgId = this.generateId();
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": msgId,
+ "method": "MB.subscribeTo",
+ "params": {
+ "propertyName": notification
+ }
+ };
+ this.send(JSONMessage);
+ return msgId;
+ },
+
+ /*
+ * Unsubscribes from notification. Returns the request's id.
+ */
+ unsubscribeFromNotification: function(notification) {
+
+ var msgId = this.generateId();
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": msgId,
+ "method": "MB.unsubscribeFrom",
+ "params": {
+ "propertyName": notification
+ }
+ };
+ this.send(JSONMessage);
+ return msgId;
+ },
+
+ /*
+ * stringify object and send via socket connection
+ */
+ send: function(obj) {
+
+ if (this.socket.readyState == this.socket.OPEN) {
+
+ if (this.observer.errorResponsePull[obj.id] && this.observer.errorResponsePull[obj.id] !== 0 && obj.result) {
+ var method = obj.result.method;
+
+ delete obj.result;
+
+ obj.error = {
+ "code": this.observer.errorResponsePull[obj.id],
+ "message": this.observer.errorResponsePull[obj.id] == 21 ? "Image of STATIC type is not supported on HMI. Other information was successfully displayed" : "Unsupported incoming resource!",
+ "data": {
+ "method": method
+ }
+ }
+
+ delete this.observer.errorResponsePull[obj.id];
+ }
+
+ var strJson = JSON.stringify(obj);
+ Em.Logger.log(strJson);
+
+ var logTime = new Date();
+ console.log(logTime.getHours() + ":" + logTime.getMinutes() + ":" + logTime.getSeconds() + ":" + logTime.getMilliseconds());
+
+ this.socket.send(strJson);
+ } else {
+ Em.Logger
+ .error("RPCClient: Can't send message since socket is not ready");
+ }
+ },
+
+ /*
+ * Generate id for new request to RPC component Function has to be used
+ * as private
+ */
+ generateId: function() {
+
+ this.requestId++;
+ if (this.requestId >= this.idStart + this.idRange)
+ this.requestId = this.idStart;
+ return this.requestId;
+ }
+
+ })
diff --git a/src/components/HMI/ffw/RPCObserver.js b/src/components/HMI/ffw/RPCObserver.js
new file mode 100644
index 0000000000..6f598cbeb0
--- /dev/null
+++ b/src/components/HMI/ffw/RPCObserver.js
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @desc Observer of RPCClient
+ */
+
+FFW.RPCObserver = Em.Object
+ .extend( {
+
+ onRPCRegistered: function() {
+
+ // request necessary parameters from Backend
+ SDL.SDLController.registeredComponentStatus(this.client.componentName);
+ },
+
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.RPCObserver.onUnregistered");
+ },
+
+ onRPCDisconnected: function() {
+
+ Em.Logger.log("FFW.RPCObserver.onRPCDisconnected");
+ },
+
+ /*
+ * when result is received from RPC component this function is called It
+ * is the propriate place to check results of reuqest execution Please
+ * use previously store reuqestID to determine to which request repsonse
+ * belongs to
+ */
+ onRPCResult: function(result) {
+
+ // parse JSON string and set necessary properties
+ },
+
+ /*
+ */
+ onRPCError: function(error) {
+
+ // parse JSON string and set necessary properties
+ },
+
+ /*
+ */
+ onRPCNotification: function(notification) {
+
+ // parse JSON string and set necessary properties
+ },
+
+ onRPCRequest: function(request) {
+
+ // parse JSON string and send back necessary data
+ },
+
+ validationCheck: function(request) {
+
+ if (request && request.method) {
+ var parsedMethod = request.method.split(/[.]/), validateFunc, result;
+
+ //if (request.params && "appID" in request.params && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length > 0) {
+
+ if (request.params && "appID" in request.params && typeof(request.params.appID) == "number" && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length <= 0) {
+ Em.Logger.error('No application registered with current appID!');
+ return false;
+ }
+
+ if (SDL.RPCController[parsedMethod[0]][parsedMethod[1]]) {
+ validateFunc = SDL.RPCController[parsedMethod[0]][parsedMethod[1]];
+ result = validateFunc(request.params);
+
+ if (result.resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+ this.sendError(result.resultCode,
+ request.id,
+ request.method,
+ result.resultMessage);
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ this.sendError(SDL.SDLModel.resultCode["UNSUPPORTED_REQUEST"],
+ request.id,
+ request.method,
+ 'Unsupported incoming request! ' + parsedMethod[0]
+ + '.' + parsedMethod[1]);
+ Em.Logger.error('No method "' + parsedMethod[0] + '.'
+ + parsedMethod[1] + '"');
+ return false;
+ }
+ }
+ }
+ });
diff --git a/src/components/HMI/ffw/TTSRPC.js b/src/components/HMI/ffw/TTSRPC.js
new file mode 100644
index 0000000000..6939aa4938
--- /dev/null
+++ b/src/components/HMI/ffw/TTSRPC.js
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Reference implementation of TTS component.
+ *
+ * TTS is responsible for playing sound data sent from SDLCore to notify user
+ * about some events happened.
+ */
+
+FFW.TTS = FFW.RPCObserver.create( {
+
+ /**
+ * If true then TTS is present and ready to communicate with SDL.
+ *
+ * @type {Boolean}
+ */
+ isReady: true,
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+ /**
+ * Request id of current running Speak request
+ *
+ * @type {Boolean}
+ */
+ requestId: null,
+
+ /**
+ * Flag to determine if Speak request was aborted
+ *
+ * @type {Boolean}
+ */
+ aborted: false,
+
+ /*
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create( {
+ componentName: "TTS"
+ }),
+
+ /*
+ * connect to RPC bus
+ */
+ connect: function() {
+
+ this.client.connect(this, 300); // Magic number is unique identifier for
+ // component
+ },
+
+ /*
+ * disconnect from RPC bus
+ */
+ disconnect: function() {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /*
+ * Client is registered - we can send request starting from this point of
+ * time
+ */
+ onRPCRegistered: function() {
+
+ Em.Logger.log("FFW.TTS.onRPCRegistered");
+ this._super();
+ },
+
+ /*
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.TTS.onRPCUnregistered");
+ this._super();
+ },
+
+ /*
+ * Client disconnected.
+ */
+ onRPCDisconnected: function() {
+
+ },
+
+ /*
+ * when result is received from RPC component this function is called It is
+ * the propriate place to check results of reuqest execution Please use
+ * previously store reuqestID to determine to which request repsonse belongs
+ * to
+ */
+ onRPCResult: function(response) {
+
+ Em.Logger.log("FFW.TTS.onRPCResult");
+ this._super();
+ },
+
+ /*
+ * handle RPC erros here
+ */
+ onRPCError: function(error) {
+
+ Em.Logger.log("FFW.TTS.onRPCError");
+ this._super();
+ },
+
+ /*
+ * handle RPC notifications here
+ */
+ onRPCNotification: function(notification) {
+
+ Em.Logger.log("FFW.TTS.onRPCNotification");
+ this._super();
+ },
+
+ /*
+ * handle RPC requests here
+ */
+ onRPCRequest: function(request) {
+
+ Em.Logger.log("FFW.TTS.onRPCRequest");
+ this._super();
+
+ switch (request.method) {
+ case "TTS.Speak": {
+
+ if (SDL.TTSPopUp.active) {
+ FFW.TTS.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, "TTS.Speak", "TTS in progress. Rejected.");
+ } else {
+ this.requestId = request.id;
+ SDL.SDLModel.onPrompt(request.params.ttsChunks, request.params.appID);
+ }
+
+ break;
+ }
+ case "TTS.SetGlobalProperties": {
+
+ SDL.SDLModel.setProperties(request.params);
+
+ this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "TTS.StopSpeaking": {
+
+ SDL.SDLModel.TTSStopSpeaking();
+
+ this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "TTS.GetCapabilities": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "speechCapabilities": [
+ "TEXT",
+ "PRE_RECORDED"
+ ],
+ "prerecordedSpeechCapabilities": [
+ "HELP_JINGLE",
+ "INITIAL_JINGLE",
+ "LISTEN_JINGLE",
+ "POSITIVE_JINGLE",
+ "NEGATIVE_JINGLE"
+ ],
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
+ // from SDL
+ // protocol
+ "method": "TTS.GetCapabilities"
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "TTS.GetSupportedLanguages": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
+ // from SDL
+ "method": "TTS.GetSupportedLanguages",
+ "languages": SDL.SDLModel.sdlLanguagesList
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "TTS.GetLanguage": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
+ // from SDL
+ "method": "TTS.GetLanguage",
+ "language": SDL.SDLModel.hmiTTSVRLanguage
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "TTS.ChangeRegistration": {
+
+ SDL.SDLModel.changeRegistrationTTSVR(request.params.language, request.params.appID);
+
+ this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+
+ case "TTS.IsReady": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "available": this.get('isReady'),
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "TTS.IsReady"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+
+ default: {
+ // statements_def
+ break;
+ }
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function(resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendTTSResult: function(resultCode, id, method) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": method
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /*
+ * Notifies if sdl TTS components language was changed
+ */
+ OnLanguageChange: function(lang) {
+
+ Em.Logger.log("FFW.TTS.OnLanguageChange");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "TTS.OnLanguageChange",
+ "params": {
+ "language": lang
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Initiated by TTS module to let SDL know that TTS session has started.
+ */
+ Started: function() {
+
+ Em.Logger.log("FFW.TTS.Started");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "TTS.Started"
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Sent OnResetTimeout notification to SDLCore to inform when
+ * HMI pronounces text longer than 10 seconds
+ */
+ OnResetTimeout: function(appID, methodName) {
+
+ Em.Logger.log("FFW.TTS.OnResetTimeout");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "TTS.OnResetTimeout",
+ "params": {
+ "appID": appID,
+ "methodName": methodName
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Initiated by TTS module to let SDL know that TTS session has stopped.
+ */
+ Stopped: function() {
+
+ Em.Logger.log("FFW.TTS.Stopped");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "TTS.Stopped"
+ };
+ this.client.send(JSONMessage);
+ }
+}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/UIRPC.js b/src/components/HMI/ffw/UIRPC.js
new file mode 100644
index 0000000000..43ee73a850
--- /dev/null
+++ b/src/components/HMI/ffw/UIRPC.js
@@ -0,0 +1,1658 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Reference implementation of UI component.
+ *
+ * Interface to get or set some essential information sent from SDLCore. UI is
+ * responsible for the functionality provided by the application: display
+ * graphics and multimedia components, is responsible for the transfer of
+ * managed manipulations, generated by the user to the server.
+ *
+ */
+
+FFW.UI = FFW.RPCObserver.create({
+
+ /**
+ * If true then UI is present and ready to communicate with SDL.
+ *
+ * @type {Boolean}
+ */
+ isReady: true,
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+ /**
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create({
+ componentName: "UI"
+ }),
+
+ // temp var for debug
+ appID: 1,
+
+ onRecordStartSubscribeRequestID: -1,
+
+ onRecordStartUnsubscribeRequestID: -1,
+
+ // const
+ onRecordStartNotification: "UI.OnRecordStart",
+
+ /**
+ * ids for requests AudioPassThru
+ */
+ performAudioPassThruRequestID: -1,
+ endAudioPassThruRequestID: -1,
+
+ /**
+ * connect to RPC bus
+ */
+ connect: function () {
+
+ this.client.connect(this, 400); // Magic number is unique identifier
+ // for component
+ },
+
+ /**
+ * disconnect from RPC bus
+ */
+ disconnect: function () {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /**
+ * Client is registered - we can send request starting from this point
+ * of time
+ */
+ onRPCRegistered: function () {
+
+ Em.Logger.log("FFW.UI.onRPCRegistered");
+ this._super();
+
+ // subscribe to notifications
+ this.onRecordStartSubscribeRequestID = this.client.subscribeToNotification(this.onRecordStartNotification);
+ },
+
+ /**
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function () {
+
+ Em.Logger.log("FFW.UI.onRPCUnregistered");
+ this._super();
+
+ // unsubscribe from notifications
+ this.onRecordStartUnsubscribeRequestID = this.client.unsubscribeFromNotification(this.onRecordStartNotification);
+ },
+
+ /**
+ * Client disconnected.
+ */
+ onRPCDisconnected: function () {
+
+ },
+
+ /**
+ * when result is received from RPC component this function is called It
+ * is the propriate place to check results of request execution Please
+ * use previously store reuqestID to determine to which request repsonse
+ * belongs to
+ */
+ onRPCResult: function (response) {
+
+ Em.Logger.log("FFW.UI.onRPCResult");
+ this._super();
+ },
+
+ /**
+ * handle RPC erros here
+ */
+ onRPCError: function (error) {
+
+ Em.Logger.log("FFW.UI.onRPCError");
+ this._super();
+ },
+
+ /**
+ * handle RPC notifications here
+ */
+ onRPCNotification: function (notification) {
+
+ Em.Logger.log("FFW.UI.onRPCNotification");
+ this._super();
+
+ if (notification.method == this.onRecordStartNotification) {
+ SDL.AudioPassThruPopUp.StartAudioPassThruTimer();
+ }
+ },
+
+ /**
+ * handle RPC requests here
+ */
+ onRPCRequest: function (request) {
+
+ Em.Logger.log("FFW.UI.onRPCRequest");
+
+ if (this.validationCheck(request)) {
+
+ switch (request.method) {
+ case "UI.Alert":
+ {
+
+ if (SDL.SDLModel.onUIAlert(request.params, request.id)) {
+ SDL.SDLController.onSystemContextChange(request.params.appID);
+ }
+
+ break;
+ }
+ case "UI.Show":
+ {
+
+ SDL.TurnByTurnView.deactivate();
+ SDL.SDLController.getApplicationModel(request.params.appID).onSDLUIShow(request.params);
+ this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+
+ break;
+ }
+ case "UI.SetGlobalProperties":
+ {
+ SDL.SDLModel.setProperties(request.params);
+
+ this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+
+ break;
+ }
+ case "UI.ResetGlobalProperties":
+ {
+
+ this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+
+ break;
+ }
+ case "UI.AddCommand":
+ {
+
+ SDL.SDLController.getApplicationModel(request.params.appID).addCommand(request);
+
+ break;
+ }
+ case "UI.DeleteCommand":
+ {
+
+ SDL.SDLController.getApplicationModel(request.params.appID).deleteCommand(request.params.cmdID, request.id);
+
+ break;
+ }
+ case "UI.AddSubMenu":
+ {
+
+ SDL.SDLController.getApplicationModel(request.params.appID).addSubMenu(request);
+
+ break;
+ }
+ case "UI.DeleteSubMenu":
+ {
+
+ var resultCode = SDL.SDLController.getApplicationModel(request.params.appID).deleteSubMenu(request.params.menuID);
+ this.sendUIResult(resultCode, request.id, request.method);
+
+ break;
+ }
+ case "UI.PerformInteraction":
+ {
+
+ if (SDL.SDLModel.uiPerformInteraction(request)) {
+ SDL.SDLController.onSystemContextChange();
+ }
+
+ break;
+ }
+ case "UI.SetMediaClockTimer":
+ {
+
+ var resultCode = SDL.SDLController.getApplicationModel(request.params.appID).sdlSetMediaClockTimer(request.params);
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ this.sendUIResult(resultCode, request.id, request.method);
+ } else {
+ this.sendError(resultCode, request.id, request.method, 'Request is ignored, because the intended result is already in effect.');
+ }
+
+ break;
+ }
+ case "UI.Slider":
+ {
+
+ if (SDL.SDLModel.uiSlider(request)) {
+ SDL.SDLController.onSystemContextChange();
+ }
+
+ break;
+ }
+ case "UI.ScrollableMessage":
+ {
+
+ if (SDL.SDLModel.onSDLScrolableMessage(request, request.id)) {
+ SDL.SDLController.onSystemContextChange();
+ }
+
+ break;
+ }
+ case "UI.ChangeRegistration":
+ {
+
+ if (request.params.appName) {
+ SDL.SDLController.getApplicationModel(request.params.appID).set('appName', request.params.appName);
+ }
+
+ SDL.SDLModel.changeRegistrationUI(request.params.language, request.params.appID);
+ this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+
+ break;
+ }
+ case "UI.SetDisplayLayout":
+ {
+
+ var senResponseFlag = false;
+
+ switch (request.params.displayLayout){
+ case "MEDIA": {
+ senResponseFlag = true;
+ break;
+ }
+ case "NON-MEDIA": {
+ senResponseFlag = true;
+ break;
+ }
+ case "DEFAULT": {
+ senResponseFlag = true;
+ break;
+ }
+ case "ONSCREEN_PRESETS": {
+ senResponseFlag = true;
+ break;
+ }
+ case "NAV_FULLSCREEN_MAP": {
+ senResponseFlag = true;
+ break;
+ }
+ case "NAV_KEYBOARD": {
+ senResponseFlag = true;
+ break;
+ }
+ case "NAV_LIST": {
+ senResponseFlag = true;
+ break;
+ }
+ }
+
+ if (senResponseFlag) {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "displayCapabilities": {
+ "displayType": "GEN2_8_DMA",
+ "textFields": [{
+ "name": "mainField1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField4",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "statusBar",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaClock",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaTrack",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "scrollableMessageBody",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "initialInteractionText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "ETA",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "totalDistance",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderHeader",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderFooter",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "notificationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "secondaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "tertiaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "timeToDestination",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "turnText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuTitle",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ }
+ ],
+ "imageFields": [
+ {
+ "name": "softButtonImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "choiceImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "choiceSecondaryImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "vrHelpItem",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "turnIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "menuIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "cmdIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "graphic",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "showConstantTBTIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "showConstantTBTNextTurnIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "showConstantTBTNextTurnIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ }
+ ],
+ "mediaClockFormats": [
+ "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4"
+ ],
+ "graphicSupported": true,
+ "imageCapabilities": ["DYNAMIC", "STATIC"],
+ "templatesAvailable": [request.params.displayLayout],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 480
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": true,
+ "doublePressAvailable": false
+ }
+ },
+ "numCustomPresetsAvailable": 10
+ },
+ "buttonCapabilities": [
+ {
+ "name": "PRESET_0",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_1",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_2",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_3",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_4",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_5",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_6",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_7",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_8",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "PRESET_9",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "OK",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "SEEKLEFT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "SEEKRIGHT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "TUNEUP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }, {
+ "name": "TUNEDOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
+ }
+ ],
+ "softButtonCapabilities": [{
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ }],
+ "presetBankCapabilities": {
+ "onScreenPresetsAvailable": true
+ },
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "UI.SetDisplayLayout"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ } else {
+ this.sendError(SDL.SDLModel.resultCode["UNSUPPORTED_RESOURCE"], request.id, request.method, "Unsupported display layout!")
+ }
+
+ break;
+ }
+ case "UI.SetAppIcon":
+ {
+
+ SDL.SDLModel.onSDLSetAppIcon(request.params, request.id, request.method);
+
+ break;
+ }
+ case "UI.PerformAudioPassThru":
+ {
+
+ if (this.performAudioPassThruRequestID > 0) {
+ this.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'PerformAudioPassThru request aborted!');
+ } else {
+
+ this.performAudioPassThruRequestID = request.id;
+ SDL.SDLModel.UIPerformAudioPassThru(request.params);
+
+ SDL.SDLController.onSystemContextChange();
+ }
+
+ break;
+ }
+ case "UI.EndAudioPassThru":
+ {
+
+ this.endAudioPassThruRequestID = request.id;
+
+ SDL.SDLModel.UIEndAudioPassThru();
+
+ break;
+ }
+ case "UI.GetSupportedLanguages":
+ {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "id": request.id,
+ "jsonrpc": "2.0",
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type
+ // (enum)
+ // from
+ // SDL
+ "method": "UI.GetSupportedLanguages",
+ "languages": SDL.SDLModel.sdlLanguagesList
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "UI.GetLanguage":
+ {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type
+ // (enum)
+ // from
+ // SDL
+ "method": "UI.GetLanguage",
+ "language": SDL.SDLModel.hmiUILanguage
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "UI.GetCapabilities":
+ {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "displayCapabilities": {
+ "displayType": "GEN2_8_DMA",
+ "textFields": [{
+ "name": "mainField1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField4",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "statusBar",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaClock",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaTrack",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "scrollableMessageBody",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "initialInteractionText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "ETA",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "totalDistance",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderHeader",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderFooter",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "notificationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "secondaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "tertiaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "timeToDestination",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "turnText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuTitle",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ }
+ ],
+ "imageFields": [
+ {
+ "name": "softButtonImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "choiceImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "choiceSecondaryImage",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "vrHelpItem",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "turnIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "menuIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "cmdIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "graphic",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "showConstantTBTIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "showConstantTBTNextTurnIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ },
+ {
+ "name": "showConstantTBTNextTurnIcon",
+ "imageTypeSupported":
+ [
+ "GRAPHIC_BMP",
+ "GRAPHIC_JPEG",
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution":
+ {
+ "resolutionWidth": 64,
+ "resolutionHeight": 64
+ }
+ }
+ ],
+ "mediaClockFormats": [
+ "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4"
+ ],
+ "graphicSupported": true,
+ "imageCapabilities": ["DYNAMIC", "STATIC"],
+ "templatesAvailable": ["TEMPLATE"],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 480
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": true,
+ "doublePressAvailable": false
+ }
+ },
+ "numCustomPresetsAvailable": 10
+ },
+ "audioPassThruCapabilities": {
+ "samplingRate": "44KHZ",
+ "bitsPerSample": "8_BIT",
+ "audioType": "PCM"
+ },
+ "hmiZoneCapabilities": "FRONT",
+ "softButtonCapabilities": {
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ },
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "UI.GetCapabilities"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "UI.IsReady":
+ {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "available": this.get('isReady'),
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "UI.IsReady"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "UI.ClosePopUp":
+ {
+
+ SDL.SDLController.closePopUp(request.params.methodName);
+
+
+ Em.Logger.log("FFW." + request.method + "Response");
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "UI.ClosePopUp"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "UI.ShowVrHelp":
+ {
+
+ //SDL.SDLModel.ShowVrHelp(request.params);
+
+ this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
+
+ break;
+ }
+ default:
+ {
+ // statements_def
+ break;
+ }
+ }
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function (resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode !== 0) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendUIResult: function (resultCode, id, method) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": method
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ */
+ alertResponse: function (resultCode, id) {
+
+ Em.Logger.log("FFW.UI.AlertResponse");
+
+ switch (resultCode) {
+ case SDL.SDLModel.resultCode["SUCCESS"]: {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": 'UI.Alert'
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case SDL.SDLModel.resultCode["ABORTED"]: {
+
+ this.sendError(resultCode, id, "UI.Alert", 'Alert request aborted.');
+ break;
+ }
+ case SDL.SDLModel.resultCode["REJECTED"]: {
+
+ this.sendError(resultCode, id, "UI.Alert", 'Another Alert is active.');
+ break;
+ }
+ }
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * sliderRequestID
+ * @param {Number}
+ * sliderPosition
+ */
+ sendSliderResult: function (resultCode, sliderRequestID, sliderPosition) {
+
+
+ Em.Logger.log("FFW.UI.SliderResponse");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": sliderRequestID,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": 'UI.Slider'
+ }
+ };
+
+ if (sliderPosition) {
+ JSONMessage.result.sliderPosition = sliderPosition;
+ }
+ } else {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": sliderRequestID,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": 'Slider request ABORTED or TIMED OUT.',
+ "data": {
+ "method": 'UI.Slider'
+ }
+ }
+ };
+
+ if (sliderPosition) {
+ JSONMessage.error.data.sliderPosition = sliderPosition;
+ }
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notification method to send touch event data to SDLCore
+ *
+ * @param {Number} appID
+ * @param {String} methodName
+ */
+ onResetTimeout: function (appID, methodName) {
+
+ Em.Logger.log("FFW.UI.OnResetTimeout");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnResetTimeout",
+ "params": {
+ "methodName": methodName,
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send notification when command was triggered
+ *
+ * @param {Number}
+ * commandID
+ * @param {Number}
+ * appID
+ */
+ onCommand: function (commandID, appID) {
+
+ Em.Logger.log("FFW.UI.onCommand");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnCommand",
+ "params": {
+ "cmdID": commandID,
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notification method to send touch event data to SDLCore
+ *
+ * @param {String} type
+ * @param {Object} touchLists
+ * @param {Object} info
+ */
+ onTouchEvent: function (type, event) {
+
+ Em.Logger.log("FFW.UI.OnTouchEvent");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnTouchEvent",
+ "params": {
+ "type": type,
+ "event": event
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send notification when command was triggered
+ *
+ * @param {Number}
+ * softButtonID
+ * @param {Number}
+ * appID
+ */
+ onCommandSoftButton: function (softButtonID, appID) {
+
+ Em.Logger.log("FFW.UI.onCommand");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnCommand",
+ "params": {
+ "commandID": softButtonID,
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send notification when command was triggered
+ *
+ * @param {Number} requestID
+ * @param {Number} resultCode
+ * @param {Number} commandID
+ * @param {String} manualTextEntry
+ */
+ interactionResponse: function (requestID, resultCode, commandID, manualTextEntry) {
+
+ Em.Logger.log("FFW.UI.PerformInteractionResponse");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "result": {
+ "code": resultCode,
+ "method": "UI.PerformInteraction"
+ }
+ };
+
+ if (commandID) {
+ JSONMessage.result.choiceID = commandID;
+ }
+
+ if (manualTextEntry != null) {
+ JSONMessage.result.manualTextEntry = manualTextEntry;
+ }
+ } else {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": "Perform Interaction error response.",
+ "data": {
+ "method": "UI.PerformInteraction"
+ }
+ }
+ };
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send notification when DriverDistraction PopUp is visible
+ *
+ * @param {String}
+ * driverDistractionState
+ */
+ onDriverDistraction: function (driverDistractionState) {
+
+ Em.Logger.log("FFW.UI.DriverDistraction");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnDriverDistraction",
+ "params": {
+ "state": driverDistractionState
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notifies if system context is changed
+ *
+ * @param {String}
+ * systemContextValue
+ */
+ OnSystemContext: function (systemContextValue, appID) {
+
+ Em.Logger.log("FFW.UI.OnSystemContext");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnSystemContext",
+ "params": {
+ "systemContext": systemContextValue
+ }
+ };
+
+ if (appID) {
+ JSONMessage.params.appID = appID;
+ }
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notifies if sdl UI components language was changed
+ *
+ * @param {String}
+ * lang
+ */
+ OnLanguageChange: function (lang) {
+
+ Em.Logger.log("FFW.UI.OnLanguageChange");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnLanguageChange",
+ "params": {
+ "language": lang
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Sends notification on SDL Core display keyboard value
+ *
+ * @param {String}
+ *
+ */
+ OnKeyboardInput: function (value, event) {
+
+ Em.Logger.log("FFW.UI.OnKeyboardInput");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "UI.OnKeyboardInput",
+ "params": {
+ "data": value,
+ "event": event
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+})
diff --git a/src/components/HMI/ffw/VRRPC.js b/src/components/HMI/ffw/VRRPC.js
new file mode 100644
index 0000000000..680c9a87dc
--- /dev/null
+++ b/src/components/HMI/ffw/VRRPC.js
@@ -0,0 +1,467 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Reference implementation of VR component.
+ *
+ * Interface to get or set some essential information sent from SDLCore. VR is
+ * responsible for receiving voice commands choosed by user and sending
+ * notification of chosen commands to SDLCore.
+ *
+ */
+
+FFW.VR = FFW.RPCObserver.create( {
+
+ /**
+ * If true then VR is present and ready to communicate with SDL.
+ *
+ * @type {Boolean}
+ */
+ isReady: true,
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+ /*
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create( {
+ componentName: "VR"
+ }),
+
+ /*
+ * connect to RPC bus
+ */
+ connect: function() {
+
+ this.client.connect(this, 500); // Magic number is unique identifier for
+ // component
+ },
+
+ /*
+ * disconnect from RPC bus
+ */
+ disconnect: function() {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /*
+ * Client is registered - we can send request starting from this point of
+ * time
+ */
+ onRPCRegistered: function() {
+
+ Em.Logger.log("FFW.VR.onRPCRegistered");
+ this._super();
+ },
+
+ /*
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.VR.onRPCUnregistered");
+ this._super();
+ },
+
+ /*
+ * Client disconnected.
+ */
+ onRPCDisconnected: function() {
+
+ },
+
+ /*
+ * when result is received from RPC component this function is called It is
+ * the propriate place to check results of reuqest execution Please use
+ * previously store reuqestID to determine to which request repsonse belongs
+ * to
+ */
+ onRPCResult: function(response) {
+
+ Em.Logger.log("FFW.VR.onRPCResult");
+ this._super();
+ },
+
+ /*
+ * handle RPC erros here
+ */
+ onRPCError: function(error) {
+
+ Em.Logger.log("FFW.VR.onRPCError");
+ this._super();
+ },
+
+ /*
+ * handle RPC notifications here
+ */
+ onRPCNotification: function(notification) {
+
+ Em.Logger.log("FFW.VR.onRPCNotification");
+ this._super();
+ },
+
+ /*
+ * send notification when command was triggered
+ */
+ onCommand: function(element) {
+
+ Em.Logger.log("FFW.VR.onCommand");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VR.OnCommand",
+ "params": {
+ "commandID": element.commandID
+ }
+ };
+ this.client.send(JSONMessage);
+
+ SDL.VRPopUp.set('VRActive', false);
+ },
+
+ /*
+ * handle RPC requests here
+ */
+ onRPCRequest: function(request) {
+
+ Em.Logger.log("FFW.VR.onRPCRequest");
+ if (this.validationCheck(request)) {
+
+ switch (request.method) {
+ case "VR.AddCommand": {
+
+ SDL.SDLModel.addCommandVR(request.params);
+
+ this.sendVRResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "VR.DeleteCommand": {
+
+ SDL.SDLModel.deleteCommandVR(request);
+
+ break;
+ }
+ case "VR.GetSupportedLanguages": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type
+ // (enum)
+ // from SDL
+ "method": "VR.GetSupportedLanguages",
+ "languages": SDL.SDLModel.sdlLanguagesList
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "VR.GetLanguage": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"], // type
+ // (enum)
+ // from SDL
+ "method": "VR.GetLanguage",
+ "language": SDL.SDLModel.hmiTTSVRLanguage
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "VR.ChangeRegistration": {
+
+ SDL.SDLModel.changeRegistrationTTSVR(request.params.language, request.params.appID);
+
+ if (request.params.vrSynonyms) {
+ SDL.VRPopUp.DeleteCommand(0, request.params.appID);
+ SDL.VRPopUp.AddCommand(0, request.params.vrSynonyms, request.params.appID, "Application");
+ }
+
+ this.sendVRResult(SDL.SDLModel.resultCode["SUCCESS"],
+ request.id,
+ request.method);
+
+ break;
+ }
+ case "VR.IsReady": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "available": this.get('isReady'),
+ "code": 0,
+ "method": "VR.IsReady"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+ case "VR.PerformInteraction":
+ {
+
+ SDL.SDLModel.vrPerformInteraction(request);
+
+ break;
+ }
+ case "VR.GetCapabilities": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "VR.GetCapabilities",
+ "vrCapabilities": ["TEXT"]
+ }
+ };
+ this.client.send(JSONMessage);
+
+ break;
+ }
+
+ default: {
+ // statements_def
+ break;
+ }
+ }
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function(resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * send notification when command was triggered
+ *
+ * @param {Number} requestID
+ * @param {Number} resultCode
+ * @param {Number} commandID
+ */
+ interactionResponse: function (requestID, resultCode, commandID) {
+
+ Em.Logger.log("FFW.VR.PerformInteractionResponse");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "result": {
+ "code": resultCode,
+ "method": "VR.PerformInteraction"
+ }
+ };
+
+ if (commandID) {
+ JSONMessage.result.choiceID = commandID;
+ }
+ } else {
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": requestID,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": "Perform Interaction error response.",
+ "data": {
+ "method": "VR.PerformInteraction"
+ }
+ }
+ };
+ }
+
+ SDL.SDLModel.set('performInteractionSession', []);
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendVRResult: function(resultCode, id, method) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "method": method
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /*
+ * send notification when command was triggered from VR
+ */
+ onChoise: function(commandID) {
+
+ Em.Logger.log("FFW.VR.PerformInteraction");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VR.OnChoise",
+ "params": {
+ "choiceID": commandID
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Initiated by VR module to let SDL know that VR session has started.
+ */
+ Started: function() {
+
+ Em.Logger.log("FFW.VR.Started");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VR.Started"
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Initiated by VR module to let SDL know that VR session has stopped.
+ */
+ Stopped: function() {
+
+ Em.Logger.log("FFW.VR.Stopped");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VR.Stopped"
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * send notification when command was triggered
+ */
+ onCommand: function(commandID, appID) {
+
+ Em.Logger.log("FFW.VR.onCommand");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VR.OnCommand",
+ "params": {
+ "cmdID": commandID,
+ "appID": appID
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notifies if sdl VR components language was changed
+ */
+ OnLanguageChange: function(lang) {
+
+ Em.Logger.log("FFW.VR.OnLanguageChange");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VR.OnLanguageChange",
+ "params": {
+ "language": lang
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/VehicleInfoRPC.js b/src/components/HMI/ffw/VehicleInfoRPC.js
new file mode 100644
index 0000000000..8ba6c7e2c7
--- /dev/null
+++ b/src/components/HMI/ffw/VehicleInfoRPC.js
@@ -0,0 +1,481 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Reference implementation of VehicleInfo component.
+ *
+ * Interface to get or set some essential information sent from SDLCore.
+ * VehicleInfo is responsible for sending a data about the condition of the
+ * vehicle between SDLCore and CAN network. Instead CAN network used
+ * VehicleInfoModel.
+ *
+ */
+
+FFW.VehicleInfo = FFW.RPCObserver.create( {
+
+ /**
+ * If true then VehicleInfo is present and ready to communicate with SDL.
+ *
+ * @type {Boolean}
+ */
+ isReady: true,
+
+ /**
+ * Contains response codes for request that should be processed but there were some kind of errors
+ * Error codes will be injected into response.
+ */
+ errorResponsePull: {},
+
+ /**
+ * access to basic RPC functionality
+ */
+ client: FFW.RPCClient.create( {
+ componentName: "VehicleInfo"
+ }),
+
+ /**
+ * connect to RPC bus
+ */
+ connect: function() {
+
+ this.client.connect(this, 700); // Magic number is unique identifier for
+ // component
+ },
+
+ /**
+ * disconnect from RPC bus
+ */
+ disconnect: function() {
+
+ this.onRPCUnregistered();
+ this.client.disconnect();
+ },
+
+ /**
+ * Client is registered - we can send request starting from this point of
+ * time
+ */
+ onRPCRegistered: function() {
+
+ Em.Logger.log("FFW.VehicleInfo.onRPCRegistered");
+ this._super();
+ },
+
+ /**
+ * Client is unregistered - no more requests
+ */
+ onRPCUnregistered: function() {
+
+ Em.Logger.log("FFW.VehicleInfo.onRPCUnregistered");
+ this._super();
+ },
+
+ /**
+ * Client disconnected.
+ */
+ onRPCDisconnected: function() {
+
+ },
+
+ /**
+ * when result is received from RPC component this function is called It is
+ * the propriate place to check results of reuqest execution Please use
+ * previously store reuqestID to determine to which request repsonse belongs
+ * to
+ */
+ onRPCResult: function(response) {
+
+ Em.Logger.log("FFW.VehicleInfo.onRPCResult");
+ this._super();
+ },
+
+ /**
+ * handle RPC erros here
+ */
+ onRPCError: function(error) {
+
+ Em.Logger.log("FFW.VehicleInfo.onRPCError");
+ this._super();
+ },
+
+ /**
+ * handle RPC notifications here
+ */
+ onRPCNotification: function(notification) {
+
+ Em.Logger.log("FFW.VehicleInfo.onRPCNotification");
+ this._super();
+ },
+
+ /**
+ * handle RPC requests here
+ *
+ * @type {Object} request
+ */
+ onRPCRequest: function(request) {
+
+ Em.Logger.log("FFW.VehicleInfo.onRPCRequest");
+ if (this.validationCheck(request)) {
+
+ switch (request.method) {
+ case "VehicleInfo.GetVehicleData": {
+
+ SDL.SDLVehicleInfoModel.getVehicleData(request);
+
+ break;
+ }
+
+ case "VehicleInfo.ReadDID": {
+
+ SDL.SDLVehicleInfoModel.vehicleInfoReadDID(request.params,
+ request.id);
+
+ break;
+ }
+
+ case "VehicleInfo.GetDTCs": {
+
+ SDL.SDLVehicleInfoModel.vehicleInfoGetDTCs(request.params,
+ request.id);
+
+ break;
+ }
+
+ case "VehicleInfo.DiagnosticMessage": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "messageDataResult": [200],
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "VehicleInfo.DiagnosticMessage"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+
+ break;
+ }
+
+ case "VehicleInfo.SubscribeVehicleData": {
+
+ SDL.SDLVehicleInfoModel.SubscribeVehicleData(request);
+
+ break;
+ }
+
+ case "VehicleInfo.UnsubscribeVehicleData": {
+
+ SDL.SDLVehicleInfoModel.UnsubscribeVehicleData(request);
+
+ break;
+ }
+
+ case "VehicleInfo.GetVehicleType": {
+
+ SDL.SDLVehicleInfoModel.getVehicleType(request.id);
+
+ break;
+ }
+
+ case "VehicleInfo.IsReady": {
+
+ Em.Logger.log("FFW." + request.method + "Response");
+
+ // send response
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": request.id,
+ "result": {
+ "available": this.get('isReady'),
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "VehicleInfo.IsReady"
+ }
+ };
+
+ this.client.send(JSONMessage);
+
+ break;
+ }
+
+ default: {
+ // statements_def
+ break;
+ }
+ }
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendError: function(resultCode, id, method, message) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": {
+ "method": method
+ }
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Send response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendVIResult: function(resultCode, id, method) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": resultCode,
+ "method": method
+ }
+ };
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Send response from onRPCRequest
+ *
+ * @param {Number} resultCode
+ * @param {Number} id
+ * @param {String} method
+ * @param {Object} data
+ */
+ sendVISubscribeVehicleDataResult: function(resultCode, id, method, data) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": data
+ };
+
+ JSONMessage.result.code = resultCode;
+ JSONMessage.result.method = method;
+
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendGetVehicleDataError: function(resultCode, id, method, message, data) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "error": {
+ "code": resultCode, // type (enum) from SDL protocol
+ "message": message,
+ "data": data
+ }
+ };
+
+ JSONMessage.error.data.method = method;
+ this.client.send(JSONMessage);
+ }
+ },
+
+ /**
+ * Send error response from onRPCRequest
+ *
+ * @param {Number}
+ * resultCode
+ * @param {Number}
+ * id
+ * @param {String}
+ * method
+ */
+ sendGetVehicleDataResut: function(resultCode, id, method, data) {
+
+ Em.Logger.log("FFW." + method + "Response");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": data
+ };
+ JSONMessage.result.code = resultCode;
+ JSONMessage.result.method = method;
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * Notifies if data was changed
+ *
+ * @type {Object} params
+ */
+ OnVehicleData: function(params) {
+
+ Em.Logger.log("FFW.VehicleInfo.OnVehicleData");
+
+ // send repsonse
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "method": "VehicleInfo.OnVehicleData",
+ "params": params
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * GetVehicleType Response
+ *
+ * @type {string} vehicleType
+ * @type {int} id
+ */
+ GetVehicleTypeResponse: function(vehicleType, id) {
+
+ Em.Logger.log("FFW.VehicleInfo.GetVehicleTypeResponse");
+
+ var JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": SDL.SDLModel.resultCode["SUCCESS"],
+ "method": "VehicleInfo.GetVehicleType",
+ "vehicleType": vehicleType
+ }
+ };
+
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * ReadDID Response
+ *
+ * @type {array} dataResult
+ * @type {array} data
+ * @type {string} info
+ * @type {string} result
+ * @type {int} id
+ */
+ vehicleInfoReadDIDResponse: function(didResult, resultCode, id) {
+
+ Em.Logger.log("FFW.VehicleInfo.ReadDIDResponse");
+
+ var JSONMessage;
+ // send repsonse
+ JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": SDL.SDLModel.resultCode[resultCode], // type (enum)
+ // from SDL
+ // protocol
+ "method": "VehicleInfo.ReadDID",
+ "didResult": didResult
+ }
+ };
+ this.client.send(JSONMessage);
+ },
+
+ /**
+ * GetDTCs Response
+ *
+ * @type {Number} ecuHeader
+ * @type {Array} dtc
+ * @type {String} result
+ * @type {Number} id
+ */
+ vehicleInfoGetDTCsResponse: function(ecuHeader, dtc, result, id) {
+
+ Em.Logger.log("FFW.VehicleInfo.GetDTCsResponse");
+
+ var JSONMessage;
+ // send repsonse
+ JSONMessage = {
+ "jsonrpc": "2.0",
+ "id": id,
+ "result": {
+ "code": SDL.SDLModel.resultCode[result], // type (enum) from
+ // SDL protocol
+ "method": "VehicleInfo.GetDTCs",
+ "ecuHeader": ecuHeader,
+ "dtc": dtc
+ }
+ };
+
+ this.client.send(JSONMessage);
+ }
+}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/WebSocket.js b/src/components/HMI/ffw/WebSocket.js
new file mode 100644
index 0000000000..7b508b406a
--- /dev/null
+++ b/src/components/HMI/ffw/WebSocket.js
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * WebSocket interface mockup
+ *
+ * Android WebView and browser don't support WebSocket This class provides
+ * interface mockup to have seamless code for different platforms
+ * JavaScriptFacade is used instead of real WebSocket connection
+ *
+ */
+
+FFW.WebSocket = Em.Object.extend( {
+
+ readyState: 1,
+
+ /*
+ * add observer of messages from Android
+ */
+ init: function() {
+
+ FFW.WebSocketSimulator.addClient(this);
+ },
+
+ /*
+ * remove observer of Android messages on connection close
+ */
+ close: function() {
+
+ FFW.WebSocketSimulator.removeClient(this);
+ // simulate connection is closed
+ this.onclose(null);
+ },
+
+ /*
+ * send message to Android native code Java Script facade is used instead of
+ * real WebSocket connection
+ */
+ send: function(jsonMessage) {
+
+ FFW.WebSocketSimulator.send(this.clientName, jsonMessage);
+ },
+
+ // handlers for web socket events
+ onclose: null,
+ onerror: null,
+ onmessage: null,
+ onopen: null,
+
+ /*
+ * used for identification of sender and receiver of particular message
+ * from/to Android
+ */
+ clientName: ''
+});
diff --git a/src/components/HMI/images/common/arr-r-disable.png b/src/components/HMI/images/common/arr-r-disable.png
new file mode 100644
index 0000000000..acdfb56f92
--- /dev/null
+++ b/src/components/HMI/images/common/arr-r-disable.png
Binary files differ
diff --git a/src/components/HMI/images/common/arr-r.png b/src/components/HMI/images/common/arr-r.png
new file mode 100644
index 0000000000..05d8e97972
--- /dev/null
+++ b/src/components/HMI/images/common/arr-r.png
Binary files differ
diff --git a/src/components/HMI/images/common/arrow_ico.png b/src/components/HMI/images/common/arrow_ico.png
new file mode 100644
index 0000000000..97126966d7
--- /dev/null
+++ b/src/components/HMI/images/common/arrow_ico.png
Binary files differ
diff --git a/src/components/HMI/images/common/bt_bg.png b/src/components/HMI/images/common/bt_bg.png
new file mode 100644
index 0000000000..b69267e44b
--- /dev/null
+++ b/src/components/HMI/images/common/bt_bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/bt_bg_pressed.png b/src/components/HMI/images/common/bt_bg_pressed.png
new file mode 100644
index 0000000000..acd4acbac5
--- /dev/null
+++ b/src/components/HMI/images/common/bt_bg_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-28h-gray-active.png b/src/components/HMI/images/common/btn-28h-gray-active.png
new file mode 100644
index 0000000000..2b4b2ee0af
--- /dev/null
+++ b/src/components/HMI/images/common/btn-28h-gray-active.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-28h.png b/src/components/HMI/images/common/btn-28h.png
new file mode 100644
index 0000000000..034c061bec
--- /dev/null
+++ b/src/components/HMI/images/common/btn-28h.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h-active-gray.png b/src/components/HMI/images/common/btn-48h-active-gray.png
new file mode 100644
index 0000000000..3faeff3d7a
--- /dev/null
+++ b/src/components/HMI/images/common/btn-48h-active-gray.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h-active.png b/src/components/HMI/images/common/btn-48h-active.png
new file mode 100644
index 0000000000..9515a2172d
--- /dev/null
+++ b/src/components/HMI/images/common/btn-48h-active.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h-pressed.png b/src/components/HMI/images/common/btn-48h-pressed.png
new file mode 100644
index 0000000000..8f62dd0871
--- /dev/null
+++ b/src/components/HMI/images/common/btn-48h-pressed.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h.png b/src/components/HMI/images/common/btn-48h.png
new file mode 100644
index 0000000000..89fe73bf38
--- /dev/null
+++ b/src/components/HMI/images/common/btn-48h.png
Binary files differ
diff --git a/src/components/HMI/images/common/btn-98h.png b/src/components/HMI/images/common/btn-98h.png
new file mode 100644
index 0000000000..be25c0c45b
--- /dev/null
+++ b/src/components/HMI/images/common/btn-98h.png
Binary files differ
diff --git a/src/components/HMI/images/common/button.png b/src/components/HMI/images/common/button.png
new file mode 100644
index 0000000000..04144a6d6e
--- /dev/null
+++ b/src/components/HMI/images/common/button.png
Binary files differ
diff --git a/src/components/HMI/images/common/button_active_blue.png b/src/components/HMI/images/common/button_active_blue.png
new file mode 100644
index 0000000000..e8f6619039
--- /dev/null
+++ b/src/components/HMI/images/common/button_active_blue.png
Binary files differ
diff --git a/src/components/HMI/images/common/button_large.png b/src/components/HMI/images/common/button_large.png
new file mode 100644
index 0000000000..737f962622
--- /dev/null
+++ b/src/components/HMI/images/common/button_large.png
Binary files differ
diff --git a/src/components/HMI/images/common/button_small.png b/src/components/HMI/images/common/button_small.png
new file mode 100644
index 0000000000..3f8ec34483
--- /dev/null
+++ b/src/components/HMI/images/common/button_small.png
Binary files differ
diff --git a/src/components/HMI/images/common/center-button-150.png b/src/components/HMI/images/common/center-button-150.png
new file mode 100644
index 0000000000..a696c3ca65
--- /dev/null
+++ b/src/components/HMI/images/common/center-button-150.png
Binary files differ
diff --git a/src/components/HMI/images/common/center-button.png b/src/components/HMI/images/common/center-button.png
new file mode 100644
index 0000000000..fd407b735e
--- /dev/null
+++ b/src/components/HMI/images/common/center-button.png
Binary files differ
diff --git a/src/components/HMI/images/common/climate-status-bg.png b/src/components/HMI/images/common/climate-status-bg.png
new file mode 100644
index 0000000000..dbdddddd5e
--- /dev/null
+++ b/src/components/HMI/images/common/climate-status-bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/defaultButtonImage.png b/src/components/HMI/images/common/defaultButtonImage.png
new file mode 100644
index 0000000000..9474142fe0
--- /dev/null
+++ b/src/components/HMI/images/common/defaultButtonImage.png
Binary files differ
diff --git a/src/components/HMI/images/common/delim.png b/src/components/HMI/images/common/delim.png
new file mode 100644
index 0000000000..98e6516663
--- /dev/null
+++ b/src/components/HMI/images/common/delim.png
Binary files differ
diff --git a/src/components/HMI/images/common/divider.png b/src/components/HMI/images/common/divider.png
new file mode 100644
index 0000000000..c567e5ef21
--- /dev/null
+++ b/src/components/HMI/images/common/divider.png
Binary files differ
diff --git a/src/components/HMI/images/common/header_bg.png b/src/components/HMI/images/common/header_bg.png
new file mode 100644
index 0000000000..f2752149f0
--- /dev/null
+++ b/src/components/HMI/images/common/header_bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/ico_back.png b/src/components/HMI/images/common/ico_back.png
new file mode 100644
index 0000000000..f2cdf410e7
--- /dev/null
+++ b/src/components/HMI/images/common/ico_back.png
Binary files differ
diff --git a/src/components/HMI/images/common/ind_vert_active.png b/src/components/HMI/images/common/ind_vert_active.png
new file mode 100644
index 0000000000..526fc27467
--- /dev/null
+++ b/src/components/HMI/images/common/ind_vert_active.png
Binary files differ
diff --git a/src/components/HMI/images/common/ind_vert_def.png b/src/components/HMI/images/common/ind_vert_def.png
new file mode 100644
index 0000000000..594852cd13
--- /dev/null
+++ b/src/components/HMI/images/common/ind_vert_def.png
Binary files differ
diff --git a/src/components/HMI/images/common/ls_border.png b/src/components/HMI/images/common/ls_border.png
new file mode 100644
index 0000000000..d59d3afbb7
--- /dev/null
+++ b/src/components/HMI/images/common/ls_border.png
Binary files differ
diff --git a/src/components/HMI/images/common/media-status-bg.png b/src/components/HMI/images/common/media-status-bg.png
new file mode 100644
index 0000000000..b48786c048
--- /dev/null
+++ b/src/components/HMI/images/common/media-status-bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/minus-ico.png b/src/components/HMI/images/common/minus-ico.png
new file mode 100644
index 0000000000..a5fd7585a7
--- /dev/null
+++ b/src/components/HMI/images/common/minus-ico.png
Binary files differ
diff --git a/src/components/HMI/images/common/nav-status-bg.png b/src/components/HMI/images/common/nav-status-bg.png
new file mode 100644
index 0000000000..afe2168ca9
--- /dev/null
+++ b/src/components/HMI/images/common/nav-status-bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/okbut.png b/src/components/HMI/images/common/okbut.png
new file mode 100644
index 0000000000..7762204aa4
--- /dev/null
+++ b/src/components/HMI/images/common/okbut.png
Binary files differ
diff --git a/src/components/HMI/images/common/okbut_pressed.png b/src/components/HMI/images/common/okbut_pressed.png
new file mode 100644
index 0000000000..7f3262f2d9
--- /dev/null
+++ b/src/components/HMI/images/common/okbut_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/common/page-back-button.png b/src/components/HMI/images/common/page-back-button.png
new file mode 100644
index 0000000000..8cc6ad971b
--- /dev/null
+++ b/src/components/HMI/images/common/page-back-button.png
Binary files differ
diff --git a/src/components/HMI/images/common/phone-statusbar-bg.png b/src/components/HMI/images/common/phone-statusbar-bg.png
new file mode 100644
index 0000000000..1d63f4898f
--- /dev/null
+++ b/src/components/HMI/images/common/phone-statusbar-bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/plus-ico.png b/src/components/HMI/images/common/plus-ico.png
new file mode 100644
index 0000000000..3a3aa21815
--- /dev/null
+++ b/src/components/HMI/images/common/plus-ico.png
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_down.png b/src/components/HMI/images/common/scroll_down.png
new file mode 100644
index 0000000000..d160605315
--- /dev/null
+++ b/src/components/HMI/images/common/scroll_down.png
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_down_active.png b/src/components/HMI/images/common/scroll_down_active.png
new file mode 100644
index 0000000000..f609ecae65
--- /dev/null
+++ b/src/components/HMI/images/common/scroll_down_active.png
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_down_inactive.png b/src/components/HMI/images/common/scroll_down_inactive.png
new file mode 100644
index 0000000000..418379f0b2
--- /dev/null
+++ b/src/components/HMI/images/common/scroll_down_inactive.png
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_up.png b/src/components/HMI/images/common/scroll_up.png
new file mode 100644
index 0000000000..6ae4d68368
--- /dev/null
+++ b/src/components/HMI/images/common/scroll_up.png
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_up_inactive.png b/src/components/HMI/images/common/scroll_up_inactive.png
new file mode 100644
index 0000000000..328ed7a3a0
--- /dev/null
+++ b/src/components/HMI/images/common/scroll_up_inactive.png
Binary files differ
diff --git a/src/components/HMI/images/common/seat-act-led.png b/src/components/HMI/images/common/seat-act-led.png
new file mode 100644
index 0000000000..7acb61359f
--- /dev/null
+++ b/src/components/HMI/images/common/seat-act-led.png
Binary files differ
diff --git a/src/components/HMI/images/common/seat-inact-led.png b/src/components/HMI/images/common/seat-inact-led.png
new file mode 100644
index 0000000000..40a57e2cc3
--- /dev/null
+++ b/src/components/HMI/images/common/seat-inact-led.png
Binary files differ
diff --git a/src/components/HMI/images/common/skipbuttonbg.png b/src/components/HMI/images/common/skipbuttonbg.png
new file mode 100644
index 0000000000..9e3b4e97a4
--- /dev/null
+++ b/src/components/HMI/images/common/skipbuttonbg.png
Binary files differ
diff --git a/src/components/HMI/images/common/skippbuttonbg_pressed.png b/src/components/HMI/images/common/skippbuttonbg_pressed.png
new file mode 100644
index 0000000000..27c2a52ced
--- /dev/null
+++ b/src/components/HMI/images/common/skippbuttonbg_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/common/system_settings_btn_bg.png b/src/components/HMI/images/common/system_settings_btn_bg.png
new file mode 100644
index 0000000000..ca8a268dda
--- /dev/null
+++ b/src/components/HMI/images/common/system_settings_btn_bg.png
Binary files differ
diff --git a/src/components/HMI/images/common/system_settings_btn_bg_active.png b/src/components/HMI/images/common/system_settings_btn_bg_active.png
new file mode 100644
index 0000000000..b53bd11e84
--- /dev/null
+++ b/src/components/HMI/images/common/system_settings_btn_bg_active.png
Binary files differ
diff --git a/src/components/HMI/images/common/system_settings_btn_h54.png b/src/components/HMI/images/common/system_settings_btn_h54.png
new file mode 100644
index 0000000000..1da6324507
--- /dev/null
+++ b/src/components/HMI/images/common/system_settings_btn_h54.png
Binary files differ
diff --git a/src/components/HMI/images/common/toggle.png b/src/components/HMI/images/common/toggle.png
new file mode 100644
index 0000000000..7162ad36bb
--- /dev/null
+++ b/src/components/HMI/images/common/toggle.png
Binary files differ
diff --git a/src/components/HMI/images/home/bottom_controlls_full.png b/src/components/HMI/images/home/bottom_controlls_full.png
new file mode 100644
index 0000000000..3fc22b56f1
--- /dev/null
+++ b/src/components/HMI/images/home/bottom_controlls_full.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/DownButton.png b/src/components/HMI/images/home/controlButtons/DownButton.png
new file mode 100644
index 0000000000..66e3cc5a7a
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/DownButton.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/DownButton_pressed.png b/src/components/HMI/images/home/controlButtons/DownButton_pressed.png
new file mode 100644
index 0000000000..b23b077802
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/DownButton_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/LeftButton.png b/src/components/HMI/images/home/controlButtons/LeftButton.png
new file mode 100644
index 0000000000..a33a09f942
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/LeftButton.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/LeftButton_pressed.png b/src/components/HMI/images/home/controlButtons/LeftButton_pressed.png
new file mode 100644
index 0000000000..fbc15a5847
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/LeftButton_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/OkButton.png b/src/components/HMI/images/home/controlButtons/OkButton.png
new file mode 100644
index 0000000000..809f719de6
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/OkButton.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/OkButton_pressed.png b/src/components/HMI/images/home/controlButtons/OkButton_pressed.png
new file mode 100644
index 0000000000..2902de6a34
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/OkButton_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/RightButton.png b/src/components/HMI/images/home/controlButtons/RightButton.png
new file mode 100644
index 0000000000..35da46f266
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/RightButton.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/RightButton_pressed.png b/src/components/HMI/images/home/controlButtons/RightButton_pressed.png
new file mode 100644
index 0000000000..3a3d247ffa
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/RightButton_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/UpButton.png b/src/components/HMI/images/home/controlButtons/UpButton.png
new file mode 100644
index 0000000000..58407ce9ed
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/UpButton.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/UpButton_pressed.png b/src/components/HMI/images/home/controlButtons/UpButton_pressed.png
new file mode 100644
index 0000000000..7b853cb2a5
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/UpButton_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/backGroundControllButtons.png b/src/components/HMI/images/home/controlButtons/backGroundControllButtons.png
new file mode 100644
index 0000000000..041d49e7e9
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/backGroundControllButtons.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/vr.png b/src/components/HMI/images/home/controlButtons/vr.png
new file mode 100644
index 0000000000..af09282dff
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/vr.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/vrImage.png b/src/components/HMI/images/home/controlButtons/vrImage.png
new file mode 100644
index 0000000000..2f6bac2d9f
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/vrImage.png
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/vr_pressed.png b/src/components/HMI/images/home/controlButtons/vr_pressed.png
new file mode 100644
index 0000000000..9206e42a95
--- /dev/null
+++ b/src/components/HMI/images/home/controlButtons/vr_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/home/home_main_image.png b/src/components/HMI/images/home/home_main_image.png
new file mode 100644
index 0000000000..e1b830fbea
--- /dev/null
+++ b/src/components/HMI/images/home/home_main_image.png
Binary files differ
diff --git a/src/components/HMI/images/home/home_phone.png b/src/components/HMI/images/home/home_phone.png
new file mode 100644
index 0000000000..dfdd0a577c
--- /dev/null
+++ b/src/components/HMI/images/home/home_phone.png
Binary files differ
diff --git a/src/components/HMI/images/info/callendar-btn.png b/src/components/HMI/images/info/callendar-btn.png
new file mode 100644
index 0000000000..c193f0f21c
--- /dev/null
+++ b/src/components/HMI/images/info/callendar-btn.png
Binary files differ
diff --git a/src/components/HMI/images/info/ico_assist.png b/src/components/HMI/images/info/ico_assist.png
new file mode 100644
index 0000000000..1abb26dc1c
--- /dev/null
+++ b/src/components/HMI/images/info/ico_assist.png
Binary files differ
diff --git a/src/components/HMI/images/info/ico_info_install.png b/src/components/HMI/images/info/ico_info_install.png
new file mode 100644
index 0000000000..5c9d93ad28
--- /dev/null
+++ b/src/components/HMI/images/info/ico_info_install.png
Binary files differ
diff --git a/src/components/HMI/images/info/ico_vehicle.png b/src/components/HMI/images/info/ico_vehicle.png
new file mode 100644
index 0000000000..c4ca30f96c
--- /dev/null
+++ b/src/components/HMI/images/info/ico_vehicle.png
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_apps_ico.png b/src/components/HMI/images/info/info_leftMenu_apps_ico.png
new file mode 100644
index 0000000000..7f648c9a01
--- /dev/null
+++ b/src/components/HMI/images/info/info_leftMenu_apps_ico.png
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_calendar_ico.png b/src/components/HMI/images/info/info_leftMenu_calendar_ico.png
new file mode 100644
index 0000000000..6fb5aec3e0
--- /dev/null
+++ b/src/components/HMI/images/info/info_leftMenu_calendar_ico.png
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_services_ico.png b/src/components/HMI/images/info/info_leftMenu_services_ico.png
new file mode 100644
index 0000000000..de36255aa8
--- /dev/null
+++ b/src/components/HMI/images/info/info_leftMenu_services_ico.png
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_travelLink_ico.png b/src/components/HMI/images/info/info_leftMenu_travelLink_ico.png
new file mode 100644
index 0000000000..4235c92d07
--- /dev/null
+++ b/src/components/HMI/images/info/info_leftMenu_travelLink_ico.png
Binary files differ
diff --git a/src/components/HMI/images/info/info_services_bg.png b/src/components/HMI/images/info/info_services_bg.png
new file mode 100644
index 0000000000..ef082c739e
--- /dev/null
+++ b/src/components/HMI/images/info/info_services_bg.png
Binary files differ
diff --git a/src/components/HMI/images/info/info_travelLink_sirius_logo.png b/src/components/HMI/images/info/info_travelLink_sirius_logo.png
new file mode 100644
index 0000000000..0eb328c9c7
--- /dev/null
+++ b/src/components/HMI/images/info/info_travelLink_sirius_logo.png
Binary files differ
diff --git a/src/components/HMI/images/info/menu_active.png b/src/components/HMI/images/info/menu_active.png
new file mode 100644
index 0000000000..b4cf7277a4
--- /dev/null
+++ b/src/components/HMI/images/info/menu_active.png
Binary files differ
diff --git a/src/components/HMI/images/info/view_info_calendar.png b/src/components/HMI/images/info/view_info_calendar.png
new file mode 100644
index 0000000000..9e09ae9d62
--- /dev/null
+++ b/src/components/HMI/images/info/view_info_calendar.png
Binary files differ
diff --git a/src/components/HMI/images/list/list_item_bg.png b/src/components/HMI/images/list/list_item_bg.png
new file mode 100644
index 0000000000..f5cdcbe343
--- /dev/null
+++ b/src/components/HMI/images/list/list_item_bg.png
Binary files differ
diff --git a/src/components/HMI/images/list/list_item_pressed.png b/src/components/HMI/images/list/list_item_pressed.png
new file mode 100644
index 0000000000..593d697a0e
--- /dev/null
+++ b/src/components/HMI/images/list/list_item_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/list/scrollbar/button-down-active.png b/src/components/HMI/images/list/scrollbar/button-down-active.png
new file mode 100644
index 0000000000..bcd52150b6
--- /dev/null
+++ b/src/components/HMI/images/list/scrollbar/button-down-active.png
Binary files differ
diff --git a/src/components/HMI/images/list/scrollbar/button-up-active.png b/src/components/HMI/images/list/scrollbar/button-up-active.png
new file mode 100644
index 0000000000..5d1bb3f079
--- /dev/null
+++ b/src/components/HMI/images/list/scrollbar/button-up-active.png
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgL.png b/src/components/HMI/images/media/bcs-item_bgL.png
new file mode 100644
index 0000000000..cbb8dc44b6
--- /dev/null
+++ b/src/components/HMI/images/media/bcs-item_bgL.png
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgL_pressed.png b/src/components/HMI/images/media/bcs-item_bgL_pressed.png
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/components/HMI/images/media/bcs-item_bgL_pressed.png
diff --git a/src/components/HMI/images/media/bcs-item_bgR.png b/src/components/HMI/images/media/bcs-item_bgR.png
new file mode 100644
index 0000000000..e9aef90896
--- /dev/null
+++ b/src/components/HMI/images/media/bcs-item_bgR.png
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgR_pressed.png b/src/components/HMI/images/media/bcs-item_bgR_pressed.png
new file mode 100644
index 0000000000..d7c3f961cb
--- /dev/null
+++ b/src/components/HMI/images/media/bcs-item_bgR_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgS.png b/src/components/HMI/images/media/bcs-item_bgS.png
new file mode 100644
index 0000000000..54d70b7f08
--- /dev/null
+++ b/src/components/HMI/images/media/bcs-item_bgS.png
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgS_pressed.png b/src/components/HMI/images/media/bcs-item_bgS_pressed.png
new file mode 100644
index 0000000000..8c1563af9b
--- /dev/null
+++ b/src/components/HMI/images/media/bcs-item_bgS_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/media/bg.png b/src/components/HMI/images/media/bg.png
new file mode 100644
index 0000000000..b0c24355f6
--- /dev/null
+++ b/src/components/HMI/images/media/bg.png
Binary files differ
diff --git a/src/components/HMI/images/media/btn_bg.png b/src/components/HMI/images/media/btn_bg.png
new file mode 100644
index 0000000000..9713aab1e9
--- /dev/null
+++ b/src/components/HMI/images/media/btn_bg.png
Binary files differ
diff --git a/src/components/HMI/images/media/cd-next-btn.png b/src/components/HMI/images/media/cd-next-btn.png
new file mode 100644
index 0000000000..1973292d42
--- /dev/null
+++ b/src/components/HMI/images/media/cd-next-btn.png
Binary files differ
diff --git a/src/components/HMI/images/media/cd-next-btn_pressed.png b/src/components/HMI/images/media/cd-next-btn_pressed.png
new file mode 100644
index 0000000000..8cb1391b8a
--- /dev/null
+++ b/src/components/HMI/images/media/cd-next-btn_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/media/cd-prev-btn.png b/src/components/HMI/images/media/cd-prev-btn.png
new file mode 100644
index 0000000000..8bdd67d8f5
--- /dev/null
+++ b/src/components/HMI/images/media/cd-prev-btn.png
Binary files differ
diff --git a/src/components/HMI/images/media/cd-prev-btn_pressed.png b/src/components/HMI/images/media/cd-prev-btn_pressed.png
new file mode 100644
index 0000000000..3dbdbb9c8e
--- /dev/null
+++ b/src/components/HMI/images/media/cd-prev-btn_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/media/cd_play_btn.png b/src/components/HMI/images/media/cd_play_btn.png
new file mode 100644
index 0000000000..d183119f29
--- /dev/null
+++ b/src/components/HMI/images/media/cd_play_btn.png
Binary files differ
diff --git a/src/components/HMI/images/media/divider_o.png b/src/components/HMI/images/media/divider_o.png
new file mode 100644
index 0000000000..38cb6bc8e3
--- /dev/null
+++ b/src/components/HMI/images/media/divider_o.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico-play.png b/src/components/HMI/images/media/ico-play.png
new file mode 100644
index 0000000000..5e746174c7
--- /dev/null
+++ b/src/components/HMI/images/media/ico-play.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_arrow_down.png b/src/components/HMI/images/media/ico_arrow_down.png
new file mode 100644
index 0000000000..609e4a16c5
--- /dev/null
+++ b/src/components/HMI/images/media/ico_arrow_down.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_arrow_up.png b/src/components/HMI/images/media/ico_arrow_up.png
new file mode 100644
index 0000000000..09b9610f2f
--- /dev/null
+++ b/src/components/HMI/images/media/ico_arrow_up.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_back.png b/src/components/HMI/images/media/ico_back.png
new file mode 100644
index 0000000000..f2cdf410e7
--- /dev/null
+++ b/src/components/HMI/images/media/ico_back.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_cd.png b/src/components/HMI/images/media/ico_cd.png
new file mode 100644
index 0000000000..b482408f2d
--- /dev/null
+++ b/src/components/HMI/images/media/ico_cd.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_next.png b/src/components/HMI/images/media/ico_next.png
new file mode 100644
index 0000000000..24c19d2bfe
--- /dev/null
+++ b/src/components/HMI/images/media/ico_next.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_pause.png b/src/components/HMI/images/media/ico_pause.png
new file mode 100644
index 0000000000..d885c12039
--- /dev/null
+++ b/src/components/HMI/images/media/ico_pause.png
Binary files differ
diff --git a/src/components/HMI/images/media/ico_prew.png b/src/components/HMI/images/media/ico_prew.png
new file mode 100644
index 0000000000..a079f6705b
--- /dev/null
+++ b/src/components/HMI/images/media/ico_prew.png
Binary files differ
diff --git a/src/components/HMI/images/media/ls-item_bg.png b/src/components/HMI/images/media/ls-item_bg.png
new file mode 100644
index 0000000000..3863e15c76
--- /dev/null
+++ b/src/components/HMI/images/media/ls-item_bg.png
Binary files differ
diff --git a/src/components/HMI/images/media/ls-item_bg_act.png b/src/components/HMI/images/media/ls-item_bg_act.png
new file mode 100644
index 0000000000..7b52318a4c
--- /dev/null
+++ b/src/components/HMI/images/media/ls-item_bg_act.png
Binary files differ
diff --git a/src/components/HMI/images/media/player_view.png b/src/components/HMI/images/media/player_view.png
new file mode 100644
index 0000000000..fec0f31939
--- /dev/null
+++ b/src/components/HMI/images/media/player_view.png
Binary files differ
diff --git a/src/components/HMI/images/phone/bg.png b/src/components/HMI/images/phone/bg.png
new file mode 100644
index 0000000000..ffcf3e6675
--- /dev/null
+++ b/src/components/HMI/images/phone/bg.png
Binary files differ
diff --git a/src/components/HMI/images/phone/del.png b/src/components/HMI/images/phone/del.png
new file mode 100644
index 0000000000..714b1edb62
--- /dev/null
+++ b/src/components/HMI/images/phone/del.png
Binary files differ
diff --git a/src/components/HMI/images/phone/dial.png b/src/components/HMI/images/phone/dial.png
new file mode 100644
index 0000000000..56b95bfdbf
--- /dev/null
+++ b/src/components/HMI/images/phone/dial.png
Binary files differ
diff --git a/src/components/HMI/images/phone/end.png b/src/components/HMI/images/phone/end.png
new file mode 100644
index 0000000000..2d622bcc70
--- /dev/null
+++ b/src/components/HMI/images/phone/end.png
Binary files differ
diff --git a/src/components/HMI/images/phone/ico_phone.png b/src/components/HMI/images/phone/ico_phone.png
new file mode 100644
index 0000000000..68bcf408db
--- /dev/null
+++ b/src/components/HMI/images/phone/ico_phone.png
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/center_btn.png b/src/components/HMI/images/phone/keypad/center_btn.png
new file mode 100644
index 0000000000..9661ecd18d
--- /dev/null
+++ b/src/components/HMI/images/phone/keypad/center_btn.png
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/center_btn_pressed.png b/src/components/HMI/images/phone/keypad/center_btn_pressed.png
new file mode 100644
index 0000000000..42ac69bb29
--- /dev/null
+++ b/src/components/HMI/images/phone/keypad/center_btn_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/left_btn.png b/src/components/HMI/images/phone/keypad/left_btn.png
new file mode 100644
index 0000000000..d043b42555
--- /dev/null
+++ b/src/components/HMI/images/phone/keypad/left_btn.png
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/left_btn_pressed.png b/src/components/HMI/images/phone/keypad/left_btn_pressed.png
new file mode 100644
index 0000000000..287c1eabad
--- /dev/null
+++ b/src/components/HMI/images/phone/keypad/left_btn_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/right_btn.png b/src/components/HMI/images/phone/keypad/right_btn.png
new file mode 100644
index 0000000000..30f7ec9a95
--- /dev/null
+++ b/src/components/HMI/images/phone/keypad/right_btn.png
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/right_btn_pressed.png b/src/components/HMI/images/phone/keypad/right_btn_pressed.png
new file mode 100644
index 0000000000..9f67dd0012
--- /dev/null
+++ b/src/components/HMI/images/phone/keypad/right_btn_pressed.png
Binary files differ
diff --git a/src/components/HMI/images/phone/menu_active.png b/src/components/HMI/images/phone/menu_active.png
new file mode 100644
index 0000000000..776e857b50
--- /dev/null
+++ b/src/components/HMI/images/phone/menu_active.png
Binary files differ
diff --git a/src/components/HMI/images/phone/menu_bg.png b/src/components/HMI/images/phone/menu_bg.png
new file mode 100644
index 0000000000..7de8abeb7f
--- /dev/null
+++ b/src/components/HMI/images/phone/menu_bg.png
Binary files differ
diff --git a/src/components/HMI/images/sdl/Warning.png b/src/components/HMI/images/sdl/Warning.png
new file mode 100644
index 0000000000..c91cd31d34
--- /dev/null
+++ b/src/components/HMI/images/sdl/Warning.png
Binary files differ
diff --git a/src/components/HMI/images/sdl/audio_icon.jpg b/src/components/HMI/images/sdl/audio_icon.jpg
new file mode 100644
index 0000000000..22efcfa9df
--- /dev/null
+++ b/src/components/HMI/images/sdl/audio_icon.jpg
Binary files differ
diff --git a/src/components/HMI/images/sdl/devices.png b/src/components/HMI/images/sdl/devices.png
new file mode 100644
index 0000000000..91979c58ed
--- /dev/null
+++ b/src/components/HMI/images/sdl/devices.png
Binary files differ
diff --git a/src/components/HMI/images/sdl/new_apps.png b/src/components/HMI/images/sdl/new_apps.png
new file mode 100644
index 0000000000..85a75c2639
--- /dev/null
+++ b/src/components/HMI/images/sdl/new_apps.png
Binary files differ
diff --git a/src/components/HMI/images/sdl/progress.gif b/src/components/HMI/images/sdl/progress.gif
new file mode 100644
index 0000000000..37690fa5b7
--- /dev/null
+++ b/src/components/HMI/images/sdl/progress.gif
Binary files differ
diff --git a/src/components/HMI/images/sdl/progressindicator.gif b/src/components/HMI/images/sdl/progressindicator.gif
new file mode 100644
index 0000000000..77d358cae6
--- /dev/null
+++ b/src/components/HMI/images/sdl/progressindicator.gif
Binary files differ
diff --git a/src/components/HMI/images/settings/ico_settings.png b/src/components/HMI/images/settings/ico_settings.png
new file mode 100644
index 0000000000..d65777ee01
--- /dev/null
+++ b/src/components/HMI/images/settings/ico_settings.png
Binary files differ
diff --git a/src/components/HMI/index.html b/src/components/HMI/index.html
new file mode 100644
index 0000000000..d73412d439
--- /dev/null
+++ b/src/components/HMI/index.html
@@ -0,0 +1,189 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" ontouchmove="event.preventDefault();"><html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Ford Smart Device HMI</title>
+ <!--Styles-->
+ <link rel="stylesheet" type="text/css" href="css/buttonControls.css" />
+ <link rel="stylesheet" type="text/css" href="css/general.css" />
+ <link rel="stylesheet" type="text/css" href="css/navigation.css" />
+ <link rel="stylesheet" type="text/css" href="css/phone.css" />
+ <link rel="stylesheet" type="text/css" href="css/info.css" />
+ <link rel="stylesheet" type="text/css" href="css/settings.css" />
+ <link rel="stylesheet" type="text/css" href="css/media.css" />
+ <link rel="stylesheet" type="text/css" href="css/sdl.css" />
+
+ <!--Libs-->
+
+ <script type="text/javascript" src="lib/handlebars-1.0.0.beta.6.js"></script>
+
+ <!-- RELEASE's min versions -->
+
+ <script type="text/javascript" src="lib/jquery-1.7.2.min.js"></script>
+ <script type="text/javascript" src="lib/ember-1.0.pre.min.js"></script>
+ <script type="text/javascript" src="lib/iscroll-lite.js"></script>
+
+
+ </head>
+ <body ontouchmove="event.preventDefault();">
+
+
+ <script type="text/javascript" src="app/Flags.js"></script>
+
+ <!-- Framework -->
+ <script type="text/javascript" src="ffw/Framework.js"></script>
+ <script type="text/javascript" src="ffw/WebSocket.js"></script>
+ <script type="text/javascript" src="ffw/RPCObserver.js"></script>
+ <script type="text/javascript" src="ffw/RPCClient.js"></script>
+ <script type="text/javascript" src="ffw/ButtonsRPC.js"></script>
+ <script type="text/javascript" src="ffw/UIRPC.js"></script>
+ <script type="text/javascript" src="ffw/NavigationRPC.js"></script>
+ <script type="text/javascript" src="ffw/TTSRPC.js"></script>
+ <script type="text/javascript" src="ffw/VRRPC.js"></script>
+ <script type="text/javascript" src="ffw/VehicleInfoRPC.js"></script>
+ <script type="text/javascript" src="ffw/BasicCommunicationRPC.js"></script>
+
+ <!-- APP -->
+ <script type="text/javascript" src="app/SDLApp.js"></script>
+ <!-- locales -->
+ <script type="text/javascript" src="locale/eng.js"></script>
+ <script type="text/javascript" src="locale/locale.js"></script>
+ <script type="text/javascript" src="app/view/WarningView.js"></script>
+
+ <script type="text/x-handlebars">
+ {{view SDL.warningView}}
+ </script>
+
+ <!-- UI controlls -->
+ <script type="text/javascript" src="app/controlls/Button.js"></script>
+ <script type="text/javascript" src="app/controlls/Label.js"></script>
+ <script type="text/javascript" src="app/controlls/ScrollBar.js"></script>
+ <script type="text/javascript" src="app/controlls/List.js"></script>
+ <script type="text/javascript" src="app/controlls/Indicator.js"></script>
+ <script type="text/javascript" src="app/controlls/QWERTYLayout.js"></script>
+ <script type="text/javascript" src="app/controlls/QWERTZLayout.js"></script>
+ <script type="text/javascript" src="app/controlls/AZERTYLayout.js"></script>
+ <script type="text/javascript" src="app/controlls/MenuList.js"></script>
+ <script type="text/javascript" src="app/controlls/ScrollableText.js"></script>
+
+ <!-- utils -->
+ <script type="text/javascript" src="app/util/Audio.js"></script>
+ <script type="text/javascript" src="app/util/StreamAudio.js"></script>
+
+ <!-- Models -->
+
+ <script type="text/javascript" src="app/model/media/CDModel.js"></script>
+
+ <script type="text/javascript" src="app/model/PhoneModel.js"></script>
+
+ <!-- SDL models -->
+ <script type="text/javascript" src="app/model/sdl/VehicleInfoModel.js"></script>
+ <script type="text/javascript" src="app/model/sdl/AppModel.js"></script>
+ <script type="text/javascript" src="app/model/sdl/NonMediaModel.js"></script>
+ <script type="text/javascript" src="app/model/sdl/MediaModel.js"></script>
+ <script type="text/javascript" src="app/model/sdl/Model.js"></script>
+ <!-- SDL models END -->
+
+ <!-- Controllers -->
+ <!--script type="text/javascript" src="app/controller/AppController.js"></script-->
+ <script type="text/javascript" src="app/controller/MediaController.js"></script>
+ <script type="text/javascript" src="app/controller/PhoneController.js"></script>
+ <script type="text/javascript" src="app/controller/InfoController.js"></script>
+ <script type="text/javascript" src="app/controller/SettingsController.js"></script>
+
+ <script type="text/javascript" src="app/controller/sdl/Controller.js"></script>
+ <script type="text/javascript" src="app/controller/sdl/RPCController.js"></script>
+ <script type="text/javascript" src="app/controller/sdl/AppController.js"></script>
+ <script type="text/javascript" src="app/controller/sdl/NonMediaController.js"></script>
+ <script type="text/javascript" src="app/controller/sdl/MediaController.js"></script>
+
+ <!-- Mixins -->
+ <script type="text/javascript" src="app/mixins/PresetEvents.js"></script>
+ <script type="text/javascript" src="app/mixins/PresetEventCustom.js"></script>
+
+ <!-- Views -->
+
+ <!-- phone views -->
+ <script type="text/javascript" src="app/view/phone/dialpadView.js"></script>
+
+ <!-- media views -->
+ <script type="text/javascript" src="app/view/media/sdl/controllsView.js"></script>
+ <script type="text/javascript" src="app/view/media/common/LeftMenuView.js"></script>
+ <script type="text/javascript" src="app/view/media/playerView.js"></script>
+ <script type="text/javascript" src="app/view/media/sdlmediaView.js"></script>
+
+ <!-- info views -->
+ <script type="text/javascript" src="app/view/info/servicesView.js"></script>
+ <script type="text/javascript" src="app/view/info/travelLinkView.js"></script>
+ <script type="text/javascript" src="app/view/info/calendarView.js"></script>
+ <script type="text/javascript" src="app/view/info/appsView.js"></script>
+ <script type="text/javascript" src="app/view/info/devicelistView.js"></script>
+ <script type="text/javascript" src="app/view/info/nonMediaView.js"></script>
+
+ <!-- settings views -->
+
+ <script type="text/javascript" src="app/view/settings/policies/appPermissionsListView.js"></script>
+ <script type="text/javascript" src="app/view/settings/policies/appPermissionsView.js"></script>
+ <script type="text/javascript" src="app/view/settings/policies/deviceConfigView.js"></script>
+ <script type="text/javascript" src="app/view/settings/policies/deviceStateChangeView.js"></script>
+ <script type="text/javascript" src="app/view/settings/policies/statisticsInfoView.js"></script>
+ <script type="text/javascript" src="app/view/settings/policies/systemErrorView.js"></script>
+ <script type="text/javascript" src="app/view/settings/policiesView.js"></script>
+
+ <script type="text/javascript" src="app/view/homeView.js"></script>
+ <script type="text/javascript" src="app/view/mediaView.js"></script>
+ <script type="text/javascript" src="app/view/infoView.js"></script>
+ <script type="text/javascript" src="app/view/climateView.js"></script>
+ <script type="text/javascript" src="app/view/phoneView.js"></script>
+ <script type="text/javascript" src="app/view/navigationView.js"></script>
+ <script type="text/javascript" src="app/view/settingsView.js"></script>
+ <script type="text/javascript" src="app/view/navigationApp/baseNavigationView.js"></script>
+ <script type="text/javascript" src="app/view/navigationAppView.js"></script>
+
+ <!-- home views -->
+ <script type="text/javascript" src="app/view/home/controlButtons.js"></script>
+
+ <script type="text/javascript" src="app/view/home/topControls.js"></script>
+ <script type="text/javascript" src="app/view/home/bottomControls.js"></script>
+ <script type="text/javascript" src="app/view/home/statusMediaView.js"></script>
+ <script type="text/javascript" src="app/view/home/statusPhoneView.js"></script>
+ <script type="text/javascript" src="app/view/home/statusInfoView.js"></script>
+ <script type="text/javascript" src="app/view/home/statusNavigationView.js"></script>
+ <script type="text/javascript" src="app/view/home/statusClimateView.js"></script>
+ <!-- SDL views -->
+ <script type="text/javascript" src="app/view/sdl/shared/AbstractView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/interactionChoicesView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/sliderView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/optionsView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/scrollableMessage.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/turnByTurnView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/tbtTurnList.js"></script>
+ <script type="text/javascript" src="app/view/sdl/shared/keyboard.js"></script>
+ <script type="text/javascript" src="app/view/sdl/TTSPopUp.js"></script>
+ <script type="text/javascript" src="app/view/sdl/AlertPopUp.js"></script>
+ <script type="text/javascript" src="app/view/sdl/PopUp.js"></script>
+ <script type="text/javascript" src="app/view/sdl/AlertManeuverPopUp.js"></script>
+ <script type="text/javascript" src="app/view/sdl/AudioPassThruPopUp.js"></script>
+ <script type="text/javascript" src="app/view/sdl/VRPopUp.js"></script>
+ <script type="text/javascript" src="app/view/sdl/VehicleInfoView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/VRHelpListView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/tbtClientStateView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/driverDistraction.js"></script>
+ <script type="text/javascript" src="app/view/sdl/ExitAppView.js"></script>
+ <script type="text/javascript" src="app/view/sdl/SystemRequestView.js"></script>
+
+
+
+ <script type="text/javascript" src="app/StateManager.js"></script>
+
+ <!-- STATE MACHINE -->
+ <script type="text/javascript" src="app/AppViews.js"></script>
+
+
+ <!-- Big Images Preloader block -->
+ <div id="preloader">
+ </div>
+
+
+ </body>
+</html> \ No newline at end of file
diff --git a/src/components/HMI/lib/ember-1.0.pre.js b/src/components/HMI/lib/ember-1.0.pre.js
new file mode 100644
index 0000000000..dc2cb84479
--- /dev/null
+++ b/src/components/HMI/lib/ember-1.0.pre.js
@@ -0,0 +1,20709 @@
+// Version: v1.0.pre
+// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
+
+
+(function() {
+/*global __fail__*/
+
+if ('undefined' === typeof Ember) {
+ Ember = {};
+
+ if ('undefined' !== typeof window) {
+ window.Em = window.Ember = Em = Ember;
+ }
+}
+
+Ember.ENV = 'undefined' === typeof ENV ? {} : ENV;
+
+if (!('MANDATORY_SETTER' in Ember.ENV)) {
+ Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist
+}
+
+/**
+ Define an assertion that will throw an exception if the condition is not
+ met. Ember build tools will remove any calls to Ember.assert() when
+ doing a production build. Example:
+
+ // Test for truthiness
+ Ember.assert('Must pass a valid object', obj);
+ // Fail unconditionally
+ Ember.assert('This code path should never be run')
+
+ @static
+ @function
+ @param {String} desc
+ A description of the assertion. This will become the text of the Error
+ thrown if the assertion fails.
+
+ @param {Boolean} test
+ Must be truthy for the assertion to pass. If falsy, an exception will be
+ thrown.
+*/
+Ember.assert = function(desc, test) {
+ if (!test) throw new Error("assertion failed: "+desc);
+};
+
+
+/**
+ Display a warning with the provided message. Ember build tools will
+ remove any calls to Ember.warn() when doing a production build.
+
+ @static
+ @function
+ @param {String} message
+ A warning to display.
+
+ @param {Boolean} test
+ An optional boolean. If falsy, the warning will be displayed.
+*/
+Ember.warn = function(message, test) {
+ if (!test) {
+ Ember.Logger.warn("WARNING: "+message);
+ if ('trace' in Ember.Logger) Ember.Logger.trace();
+ }
+};
+
+/**
+ Display a deprecation warning with the provided message and a stack trace
+ (Chrome and Firefox only). Ember build tools will remove any calls to
+ Ember.deprecate() when doing a production build.
+
+ @static
+ @function
+ @param {String} message
+ A description of the deprecation.
+
+ @param {Boolean} test
+ An optional boolean. If falsy, the deprecation will be displayed.
+*/
+Ember.deprecate = function(message, test) {
+ if (Ember && Ember.TESTING_DEPRECATION) { return; }
+
+ if (arguments.length === 1) { test = false; }
+ if (test) { return; }
+
+ if (Ember && Ember.ENV.RAISE_ON_DEPRECATION) { throw new Error(message); }
+
+ var error;
+
+ // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome
+ try { __fail__.fail(); } catch (e) { error = e; }
+
+ if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {
+ var stack, stackStr = '';
+ if (error['arguments']) {
+ // Chrome
+ stack = error.stack.replace(/^\s+at\s+/gm, '').
+ replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').
+ replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
+ stack.shift();
+ } else {
+ // Firefox
+ stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').
+ replace(/^\(/gm, '{anonymous}(').split('\n');
+ }
+
+ stackStr = "\n " + stack.slice(2).join("\n ");
+ message = message + stackStr;
+ }
+
+ Ember.Logger.warn("DEPRECATION: "+message);
+};
+
+
+
+/**
+ Display a deprecation warning with the provided message and a stack trace
+ (Chrome and Firefox only) when the wrapped method is called.
+
+ Ember build tools will not remove calls to Ember.deprecateFunc(), though
+ no warnings will be shown in production.
+
+ @static
+ @function
+ @param {String} message
+ A description of the deprecation.
+
+ @param {Function} func
+ The function to be deprecated.
+*/
+Ember.deprecateFunc = function(message, func) {
+ return function() {
+ Ember.deprecate(message);
+ return func.apply(this, arguments);
+ };
+};
+
+
+window.ember_assert = Ember.deprecateFunc("ember_assert is deprecated. Please use Ember.assert instead.", Ember.assert);
+window.ember_warn = Ember.deprecateFunc("ember_warn is deprecated. Please use Ember.warn instead.", Ember.warn);
+window.ember_deprecate = Ember.deprecateFunc("ember_deprecate is deprecated. Please use Ember.deprecate instead.", Ember.deprecate);
+window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprecated. Please use Ember.deprecateFunc instead.", Ember.deprecateFunc);
+
+})();
+
+// Version: v1.0.pre
+// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Em:true ENV */
+
+if ('undefined' === typeof Ember) {
+ // Create core object. Make it act like an instance of Ember.Namespace so that
+ // objects assigned to it are given a sane string representation.
+ Ember = {};
+}
+
+/**
+ @namespace
+ @name Ember
+ @version 1.0.pre
+
+ All Ember methods and functions are defined inside of this namespace.
+ You generally should not add new properties to this namespace as it may be
+ overwritten by future versions of Ember.
+
+ You can also use the shorthand "Em" instead of "Ember".
+
+ Ember-Runtime is a framework that provides core functions for
+ Ember including cross-platform functions, support for property
+ observing and objects. Its focus is on small size and performance. You can
+ use this in place of or along-side other cross-platform libraries such as
+ jQuery.
+
+ The core Runtime framework is based on the jQuery API with a number of
+ performance optimizations.
+*/
+
+// aliases needed to keep minifiers from removing the global context
+if ('undefined' !== typeof window) {
+ window.Em = window.Ember = Em = Ember;
+}
+
+// Make sure these are set whether Ember was already defined or not
+
+Ember.isNamespace = true;
+
+Ember.toString = function() { return "Ember"; };
+
+
+/**
+ @static
+ @type String
+ @default '1.0.pre'
+ @constant
+*/
+Ember.VERSION = '1.0.pre';
+
+/**
+ @static
+ @type Hash
+ @constant
+
+ Standard environmental variables. You can define these in a global `ENV`
+ variable before loading Ember to control various configuration
+ settings.
+*/
+Ember.ENV = Ember.ENV || ('undefined' === typeof ENV ? {} : ENV);
+
+Ember.config = Ember.config || {};
+
+// ..........................................................
+// BOOTSTRAP
+//
+
+/**
+ @static
+ @type Boolean
+ @default true
+ @constant
+
+ Determines whether Ember should enhances some built-in object
+ prototypes to provide a more friendly API. If enabled, a few methods
+ will be added to Function, String, and Array. Object.prototype will not be
+ enhanced, which is the one that causes most troubles for people.
+
+ In general we recommend leaving this option set to true since it rarely
+ conflicts with other code. If you need to turn it off however, you can
+ define an ENV.EXTEND_PROTOTYPES config to disable it.
+*/
+Ember.EXTEND_PROTOTYPES = (Ember.ENV.EXTEND_PROTOTYPES !== false);
+
+/**
+ @static
+ @type Boolean
+ @default true
+ @constant
+
+ Determines whether Ember logs a full stack trace during deprecation warnings
+*/
+Ember.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);
+
+/**
+ @static
+ @type Boolean
+ @default Ember.EXTEND_PROTOTYPES
+ @constant
+
+ Determines whether Ember should add ECMAScript 5 shims to older browsers.
+*/
+Ember.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;
+
+
+/**
+ @static
+ @type Boolean
+ @default true
+ @constant
+
+ Determines whether computed properties are cacheable by default.
+ This option will be removed for the 1.1 release.
+
+ When caching is enabled by default, you can use `volatile()` to disable
+ caching on individual computed properties.
+*/
+Ember.CP_DEFAULT_CACHEABLE = (Ember.ENV.CP_DEFAULT_CACHEABLE !== false);
+
+/**
+ @static
+ @type Boolean
+ @default true
+ @constant
+
+ Determines whether views render their templates using themselves
+ as the context, or whether it is inherited from the parent. This option
+ will be removed in the 1.1 release.
+
+ If you need to update your application to use the new context rules, simply
+ prefix property access with `view.`:
+
+ // Before:
+ {{#each App.photosController}}
+ Photo Title: {{title}}
+ {{#view App.InfoView contentBinding="this"}}
+ {{content.date}}
+ {{content.cameraType}}
+ {{otherViewProperty}}
+ {{/view}}
+ {{/each}}
+
+ // After:
+ {{#each App.photosController}}
+ Photo Title: {{title}}
+ {{#view App.InfoView}}
+ {{date}}
+ {{cameraType}}
+ {{view.otherViewProperty}}
+ {{/view}}
+ {{/each}}
+*/
+Ember.VIEW_PRESERVES_CONTEXT = (Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);
+
+/**
+ Empty function. Useful for some operations.
+
+ @returns {Object}
+ @private
+*/
+Ember.K = function() { return this; };
+
+/**
+ @namespace
+ @name window
+ @description The global window object
+*/
+
+
+// Stub out the methods defined by the ember-debug package in case it's not loaded
+
+if ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }
+if ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }
+if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }
+if ('undefined' === typeof Ember.deprecateFunc) {
+ Ember.deprecateFunc = function(_, func) { return func; };
+}
+
+// These are deprecated but still supported
+
+if ('undefined' === typeof ember_assert) { window.ember_assert = Ember.K; }
+if ('undefined' === typeof ember_warn) { window.ember_warn = Ember.K; }
+if ('undefined' === typeof ember_deprecate) { window.ember_deprecate = Ember.K; }
+if ('undefined' === typeof ember_deprecateFunc) {
+ /** @private */
+ window.ember_deprecateFunc = function(_, func) { return func; };
+}
+
+
+// ..........................................................
+// LOGGER
+//
+
+/**
+ @class
+
+ Inside Ember-Metal, simply uses the window.console object.
+ Override this to provide more robust logging functionality.
+*/
+Ember.Logger = window.console || { log: Ember.K, warn: Ember.K, error: Ember.K, info: Ember.K, debug: Ember.K };
+
+})();
+
+
+
+(function() {
+/*jshint newcap:false*/
+
+// NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`
+// as being ok unless both `newcap:false` and not `use strict`.
+// https://github.com/jshint/jshint/issues/392
+
+// Testing this is not ideal, but we want to use native functions
+// if available, but not to use versions created by libraries like Prototype
+/** @private */
+var isNativeFunc = function(func) {
+ // This should probably work in all browsers likely to have ES5 array methods
+ return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;
+};
+
+// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map
+/** @private */
+var arrayMap = isNativeFunc(Array.prototype.map) ? Array.prototype.map : function(fun /*, thisp */) {
+ //"use strict";
+
+ if (this === void 0 || this === null) {
+ throw new TypeError();
+ }
+
+ var t = Object(this);
+ var len = t.length >>> 0;
+ if (typeof fun !== "function") {
+ throw new TypeError();
+ }
+
+ var res = new Array(len);
+ var thisp = arguments[1];
+ for (var i = 0; i < len; i++) {
+ if (i in t) {
+ res[i] = fun.call(thisp, t[i], i, t);
+ }
+ }
+
+ return res;
+};
+
+// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach
+/** @private */
+var arrayForEach = isNativeFunc(Array.prototype.forEach) ? Array.prototype.forEach : function(fun /*, thisp */) {
+ //"use strict";
+
+ if (this === void 0 || this === null) {
+ throw new TypeError();
+ }
+
+ var t = Object(this);
+ var len = t.length >>> 0;
+ if (typeof fun !== "function") {
+ throw new TypeError();
+ }
+
+ var thisp = arguments[1];
+ for (var i = 0; i < len; i++) {
+ if (i in t) {
+ fun.call(thisp, t[i], i, t);
+ }
+ }
+};
+
+/** @private */
+var arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.indexOf : function (obj, fromIndex) {
+ if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }
+ else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }
+ for (var i = fromIndex, j = this.length; i < j; i++) {
+ if (this[i] === obj) { return i; }
+ }
+ return -1;
+};
+
+Ember.ArrayPolyfills = {
+ map: arrayMap,
+ forEach: arrayForEach,
+ indexOf: arrayIndexOf
+};
+
+var utils = Ember.EnumerableUtils = {
+ map: function(obj, callback, thisArg) {
+ return obj.map ? obj.map.call(obj, callback, thisArg) : arrayMap.call(obj, callback, thisArg);
+ },
+
+ forEach: function(obj, callback, thisArg) {
+ return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : arrayForEach.call(obj, callback, thisArg);
+ },
+
+ indexOf: function(obj, element, index) {
+ return obj.indexOf ? obj.indexOf.call(obj, element, index) : arrayIndexOf.call(obj, element, index);
+ },
+
+ indexesOf: function(obj, elements) {
+ return elements === undefined ? [] : utils.map(elements, function(item) {
+ return utils.indexOf(obj, item);
+ });
+ },
+
+ removeObject: function(array, item) {
+ var index = utils.indexOf(array, item);
+ if (index !== -1) { array.splice(index, 1); }
+ }
+};
+
+
+if (Ember.SHIM_ES5) {
+ if (!Array.prototype.map) {
+ /** @private */
+ Array.prototype.map = arrayMap;
+ }
+
+ if (!Array.prototype.forEach) {
+ /** @private */
+ Array.prototype.forEach = arrayForEach;
+ }
+
+ if (!Array.prototype.indexOf) {
+ /** @private */
+ Array.prototype.indexOf = arrayIndexOf;
+ }
+}
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Node */
+/**
+ @class
+
+ Platform specific methods and feature detectors needed by the framework.
+
+ @name Ember.platform
+*/
+var platform = Ember.platform = {};
+
+/**
+ Identical to Object.create(). Implements if not available natively.
+ @memberOf Ember.platform
+ @name create
+*/
+Ember.create = Object.create;
+
+if (!Ember.create) {
+ /** @private */
+ var K = function() {};
+
+ Ember.create = function(obj, props) {
+ K.prototype = obj;
+ obj = new K();
+ if (props) {
+ K.prototype = obj;
+ for (var prop in props) {
+ K.prototype[prop] = props[prop].value;
+ }
+ obj = new K();
+ }
+ K.prototype = null;
+
+ return obj;
+ };
+
+ Ember.create.isSimulated = true;
+}
+
+/** @private */
+var defineProperty = Object.defineProperty;
+var canRedefineProperties, canDefinePropertyOnDOM;
+
+// Catch IE8 where Object.defineProperty exists but only works on DOM elements
+if (defineProperty) {
+ try {
+ defineProperty({}, 'a',{get:function(){}});
+ } catch (e) {
+ /** @private */
+ defineProperty = null;
+ }
+}
+
+if (defineProperty) {
+ // Detects a bug in Android <3.2 where you cannot redefine a property using
+ // Object.defineProperty once accessors have already been set.
+ /** @private */
+ canRedefineProperties = (function() {
+ var obj = {};
+
+ defineProperty(obj, 'a', {
+ configurable: true,
+ enumerable: true,
+ get: function() { },
+ set: function() { }
+ });
+
+ defineProperty(obj, 'a', {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: true
+ });
+
+ return obj.a === true;
+ })();
+
+ // This is for Safari 5.0, which supports Object.defineProperty, but not
+ // on DOM nodes.
+ /** @private */
+ canDefinePropertyOnDOM = (function(){
+ try {
+ defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});
+ return true;
+ } catch(e) { }
+
+ return false;
+ })();
+
+ if (!canRedefineProperties) {
+ /** @private */
+ defineProperty = null;
+ } else if (!canDefinePropertyOnDOM) {
+ /** @private */
+ defineProperty = function(obj, keyName, desc){
+ var isNode;
+
+ if (typeof Node === "object") {
+ isNode = obj instanceof Node;
+ } else {
+ isNode = typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string";
+ }
+
+ if (isNode) {
+ // TODO: Should we have a warning here?
+ return (obj[keyName] = desc.value);
+ } else {
+ return Object.defineProperty(obj, keyName, desc);
+ }
+ };
+ }
+}
+
+/**
+ Identical to Object.defineProperty(). Implements as much functionality
+ as possible if not available natively.
+
+ @memberOf Ember.platform
+ @name defineProperty
+ @param {Object} obj The object to modify
+ @param {String} keyName property name to modify
+ @param {Object} desc descriptor hash
+ @returns {void}
+*/
+platform.defineProperty = defineProperty;
+
+/**
+ Set to true if the platform supports native getters and setters.
+
+ @memberOf Ember.platform
+ @name hasPropertyAccessors
+*/
+platform.hasPropertyAccessors = true;
+
+if (!platform.defineProperty) {
+ platform.hasPropertyAccessors = false;
+
+ platform.defineProperty = function(obj, keyName, desc) {
+ if (!desc.get) { obj[keyName] = desc.value; }
+ };
+
+ platform.defineProperty.isSimulated = true;
+}
+
+if (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {
+ Ember.ENV.MANDATORY_SETTER = false;
+}
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var o_defineProperty = Ember.platform.defineProperty,
+ o_create = Ember.create,
+ // Used for guid generation...
+ GUID_KEY = '__ember'+ (+ new Date()),
+ uuid = 0,
+ numberCache = [],
+ stringCache = {};
+
+var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
+
+/**
+ @private
+ @static
+ @type String
+ @constant
+
+ A unique key used to assign guids and other private metadata to objects.
+ If you inspect an object in your browser debugger you will often see these.
+ They can be safely ignored.
+
+ On browsers that support it, these properties are added with enumeration
+ disabled so they won't show up when you iterate over your properties.
+*/
+Ember.GUID_KEY = GUID_KEY;
+
+var GUID_DESC = {
+ writable: false,
+ configurable: false,
+ enumerable: false,
+ value: null
+};
+
+/**
+ @private
+
+ Generates a new guid, optionally saving the guid to the object that you
+ pass in. You will rarely need to use this method. Instead you should
+ call Ember.guidFor(obj), which return an existing guid if available.
+
+ @param {Object} obj
+ Optional object the guid will be used for. If passed in, the guid will
+ be saved on the object and reused whenever you pass the same object
+ again.
+
+ If no object is passed, just generate a new guid.
+
+ @param {String} prefix
+ Optional prefix to place in front of the guid. Useful when you want to
+ separate the guid into separate namespaces.
+
+ @returns {String} the guid
+*/
+Ember.generateGuid = function generateGuid(obj, prefix) {
+ if (!prefix) prefix = 'ember';
+ var ret = (prefix + (uuid++));
+ if (obj) {
+ GUID_DESC.value = ret;
+ o_defineProperty(obj, GUID_KEY, GUID_DESC);
+ }
+ return ret ;
+};
+
+/**
+ @private
+
+ Returns a unique id for the object. If the object does not yet have
+ a guid, one will be assigned to it. You can call this on any object,
+ Ember.Object-based or not, but be aware that it will add a _guid property.
+
+ You can also use this method on DOM Element objects.
+
+ @method
+ @param obj {Object} any object, string, number, Element, or primitive
+ @returns {String} the unique guid for this instance.
+*/
+Ember.guidFor = function guidFor(obj) {
+
+ // special cases where we don't want to add a key to object
+ if (obj === undefined) return "(undefined)";
+ if (obj === null) return "(null)";
+
+ var cache, ret;
+ var type = typeof obj;
+
+ // Don't allow prototype changes to String etc. to change the guidFor
+ switch(type) {
+ case 'number':
+ ret = numberCache[obj];
+ if (!ret) ret = numberCache[obj] = 'nu'+obj;
+ return ret;
+
+ case 'string':
+ ret = stringCache[obj];
+ if (!ret) ret = stringCache[obj] = 'st'+(uuid++);
+ return ret;
+
+ case 'boolean':
+ return obj ? '(true)' : '(false)';
+
+ default:
+ if (obj[GUID_KEY]) return obj[GUID_KEY];
+ if (obj === Object) return '(Object)';
+ if (obj === Array) return '(Array)';
+ ret = 'ember'+(uuid++);
+ GUID_DESC.value = ret;
+ o_defineProperty(obj, GUID_KEY, GUID_DESC);
+ return ret;
+ }
+};
+
+// ..........................................................
+// META
+//
+
+var META_DESC = {
+ writable: true,
+ configurable: false,
+ enumerable: false,
+ value: null
+};
+
+var META_KEY = Ember.GUID_KEY+'_meta';
+
+/**
+ The key used to store meta information on object for property observing.
+
+ @static
+ @type String
+*/
+Ember.META_KEY = META_KEY;
+
+// Placeholder for non-writable metas.
+var EMPTY_META = {
+ descs: {},
+ watching: {}
+};
+
+if (MANDATORY_SETTER) { EMPTY_META.values = {}; }
+
+Ember.EMPTY_META = EMPTY_META;
+
+if (Object.freeze) Object.freeze(EMPTY_META);
+
+var isDefinePropertySimulated = Ember.platform.defineProperty.isSimulated;
+
+function Meta(obj) {
+ this.descs = {};
+ this.watching = {};
+ this.cache = {};
+ this.source = obj;
+}
+
+if (isDefinePropertySimulated) {
+ // on platforms that don't support enumerable false
+ // make meta fail jQuery.isPlainObject() to hide from
+ // jQuery.extend() by having a property that fails
+ // hasOwnProperty check.
+ Meta.prototype.__preventPlainObject__ = true;
+}
+
+/**
+ @private
+ @function
+
+ Retrieves the meta hash for an object. If 'writable' is true ensures the
+ hash is writable for this object as well.
+
+ The meta object contains information about computed property descriptors as
+ well as any watched properties and other information. You generally will
+ not access this information directly but instead work with higher level
+ methods that manipulate this hash indirectly.
+
+ @param {Object} obj
+ The object to retrieve meta for
+
+ @param {Boolean} writable
+ Pass false if you do not intend to modify the meta hash, allowing the
+ method to avoid making an unnecessary copy.
+
+ @returns {Hash}
+*/
+Ember.meta = function meta(obj, writable) {
+
+ var ret = obj[META_KEY];
+ if (writable===false) return ret || EMPTY_META;
+
+ if (!ret) {
+ if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);
+
+ ret = new Meta(obj);
+
+ if (MANDATORY_SETTER) { ret.values = {}; }
+
+ obj[META_KEY] = ret;
+
+ // make sure we don't accidentally try to create constructor like desc
+ ret.descs.constructor = null;
+
+ } else if (ret.source !== obj) {
+ if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);
+
+ ret = o_create(ret);
+ ret.descs = o_create(ret.descs);
+ ret.watching = o_create(ret.watching);
+ ret.cache = {};
+ ret.source = obj;
+
+ if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }
+
+ obj[META_KEY] = ret;
+ }
+ return ret;
+};
+
+Ember.getMeta = function getMeta(obj, property) {
+ var meta = Ember.meta(obj, false);
+ return meta[property];
+};
+
+Ember.setMeta = function setMeta(obj, property, value) {
+ var meta = Ember.meta(obj, true);
+ meta[property] = value;
+ return value;
+};
+
+/**
+ @private
+
+ In order to store defaults for a class, a prototype may need to create
+ a default meta object, which will be inherited by any objects instantiated
+ from the class's constructor.
+
+ However, the properties of that meta object are only shallow-cloned,
+ so if a property is a hash (like the event system's `listeners` hash),
+ it will by default be shared across all instances of that class.
+
+ This method allows extensions to deeply clone a series of nested hashes or
+ other complex objects. For instance, the event system might pass
+ ['listeners', 'foo:change', 'ember157'] to `prepareMetaPath`, which will
+ walk down the keys provided.
+
+ For each key, if the key does not exist, it is created. If it already
+ exists and it was inherited from its constructor, the constructor's
+ key is cloned.
+
+ You can also pass false for `writable`, which will simply return
+ undefined if `prepareMetaPath` discovers any part of the path that
+ shared or undefined.
+
+ @param {Object} obj The object whose meta we are examining
+ @param {Array} path An array of keys to walk down
+ @param {Boolean} writable whether or not to create a new meta
+ (or meta property) if one does not already exist or if it's
+ shared with its constructor
+*/
+Ember.metaPath = function metaPath(obj, path, writable) {
+ var meta = Ember.meta(obj, writable), keyName, value;
+
+ for (var i=0, l=path.length; i<l; i++) {
+ keyName = path[i];
+ value = meta[keyName];
+
+ if (!value) {
+ if (!writable) { return undefined; }
+ value = meta[keyName] = { __ember_source__: obj };
+ } else if (value.__ember_source__ !== obj) {
+ if (!writable) { return undefined; }
+ value = meta[keyName] = o_create(value);
+ value.__ember_source__ = obj;
+ }
+
+ meta = value;
+ }
+
+ return value;
+};
+
+/**
+ @private
+
+ Wraps the passed function so that `this._super` will point to the superFunc
+ when the function is invoked. This is the primitive we use to implement
+ calls to super.
+
+ @param {Function} func
+ The function to call
+
+ @param {Function} superFunc
+ The super function.
+
+ @returns {Function} wrapped function.
+*/
+Ember.wrap = function(func, superFunc) {
+
+ function K() {}
+
+ var newFunc = function() {
+ var ret, sup = this._super;
+ this._super = superFunc || K;
+ ret = func.apply(this, arguments);
+ this._super = sup;
+ return ret;
+ };
+
+ newFunc.base = func;
+ return newFunc;
+};
+
+/**
+ Returns true if the passed object is an array or Array-like.
+
+ Ember Array Protocol:
+
+ - the object has an objectAt property
+ - the object is a native Array
+ - the object is an Object, and has a length property
+
+ Unlike Ember.typeOf this method returns true even if the passed object is
+ not formally array but appears to be array-like (i.e. implements Ember.Array)
+
+ Ember.isArray(); // false
+ Ember.isArray([]); // true
+ Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true
+
+ @param {Object} obj The object to test
+ @returns {Boolean}
+*/
+Ember.isArray = function(obj) {
+ if (!obj || obj.setInterval) { return false; }
+ if (Array.isArray && Array.isArray(obj)) { return true; }
+ if (Ember.Array && Ember.Array.detect(obj)) { return true; }
+ if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }
+ return false;
+};
+
+/**
+ Forces the passed object to be part of an array. If the object is already
+ an array or array-like, returns the object. Otherwise adds the object to
+ an array. If obj is null or undefined, returns an empty array.
+
+ Ember.makeArray(); => []
+ Ember.makeArray(null); => []
+ Ember.makeArray(undefined); => []
+ Ember.makeArray('lindsay'); => ['lindsay']
+ Ember.makeArray([1,2,42]); => [1,2,42]
+
+ var controller = Ember.ArrayProxy.create({ content: [] });
+ Ember.makeArray(controller) === controller; => true
+
+ @param {Object} obj the object
+ @returns {Array}
+*/
+Ember.makeArray = function(obj) {
+ if (obj === null || obj === undefined) { return []; }
+ return Ember.isArray(obj) ? obj : [obj];
+};
+
+function canInvoke(obj, methodName) {
+ return !!(obj && typeof obj[methodName] === 'function');
+}
+
+/**
+ Checks to see if the `methodName` exists on the `obj`.
+
+ @function
+
+ @param {Object} obj The object to check for the method
+ @param {String} methodName The method name to check for
+*/
+Ember.canInvoke = canInvoke;
+
+/**
+ Checks to see if the `methodName` exists on the `obj`,
+ and if it does, invokes it with the arguments passed.
+
+ @function
+
+ @param {Object} obj The object to check for the method
+ @param {String} methodName The method name to check for
+ @param {Array} args The arguments to pass to the method
+
+ @returns {Boolean} true if the method does not return false
+ @returns {Boolean} false otherwise
+*/
+Ember.tryInvoke = function(obj, methodName, args) {
+ if (canInvoke(obj, methodName)) {
+ return obj[methodName].apply(obj, args);
+ }
+};
+
+})();
+
+
+
+(function() {
+/**
+ JavaScript (before ES6) does not have a Map implementation. Objects,
+ which are often used as dictionaries, may only have Strings as keys.
+
+ Because Ember has a way to get a unique identifier for every object
+ via `Ember.guidFor`, we can implement a performant Map with arbitrary
+ keys. Because it is commonly used in low-level bookkeeping, Map is
+ implemented as a pure JavaScript object for performance.
+
+ This implementation follows the current iteration of the ES6 proposal
+ for maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),
+ with two exceptions. First, because we need our implementation to be
+ pleasant on older browsers, we do not use the `delete` name (using
+ `remove` instead). Second, as we do not have the luxury of in-VM
+ iteration, we implement a forEach method for iteration.
+
+ Map is mocked out to look like an Ember object, so you can do
+ `Ember.Map.create()` for symmetry with other Ember classes.
+*/
+/** @private */
+var guidFor = Ember.guidFor,
+ indexOf = Ember.ArrayPolyfills.indexOf;
+
+var copy = function(obj) {
+ var output = {};
+
+ for (var prop in obj) {
+ if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }
+ }
+
+ return output;
+};
+
+var copyMap = function(original, newObject) {
+ var keys = original.keys.copy(),
+ values = copy(original.values);
+
+ newObject.keys = keys;
+ newObject.values = values;
+
+ return newObject;
+};
+
+// This class is used internally by Ember.js and Ember Data.
+// Please do not use it at this time. We plan to clean it up
+// and add many tests soon.
+var OrderedSet = Ember.OrderedSet = function() {
+ this.clear();
+};
+
+OrderedSet.create = function() {
+ return new OrderedSet();
+};
+
+OrderedSet.prototype = {
+ clear: function() {
+ this.presenceSet = {};
+ this.list = [];
+ },
+
+ add: function(obj) {
+ var guid = guidFor(obj),
+ presenceSet = this.presenceSet,
+ list = this.list;
+
+ if (guid in presenceSet) { return; }
+
+ presenceSet[guid] = true;
+ list.push(obj);
+ },
+
+ remove: function(obj) {
+ var guid = guidFor(obj),
+ presenceSet = this.presenceSet,
+ list = this.list;
+
+ delete presenceSet[guid];
+
+ var index = indexOf.call(list, obj);
+ if (index > -1) {
+ list.splice(index, 1);
+ }
+ },
+
+ isEmpty: function() {
+ return this.list.length === 0;
+ },
+
+ forEach: function(fn, self) {
+ // allow mutation during iteration
+ var list = this.list.slice();
+
+ for (var i = 0, j = list.length; i < j; i++) {
+ fn.call(self, list[i]);
+ }
+ },
+
+ toArray: function() {
+ return this.list.slice();
+ },
+
+ copy: function() {
+ var set = new OrderedSet();
+
+ set.presenceSet = copy(this.presenceSet);
+ set.list = this.list.slice();
+
+ return set;
+ }
+};
+
+/**
+ A Map stores values indexed by keys. Unlike JavaScript's
+ default Objects, the keys of a Map can be any JavaScript
+ object.
+
+ Internally, a Map has two data structures:
+
+ `keys`: an OrderedSet of all of the existing keys
+ `values`: a JavaScript Object indexed by the
+ Ember.guidFor(key)
+
+ When a key/value pair is added for the first time, we
+ add the key to the `keys` OrderedSet, and create or
+ replace an entry in `values`. When an entry is deleted,
+ we delete its entry in `keys` and `values`.
+*/
+
+/** @private */
+var Map = Ember.Map = function() {
+ this.keys = Ember.OrderedSet.create();
+ this.values = {};
+};
+
+Map.create = function() {
+ return new Map();
+};
+
+Map.prototype = {
+ /**
+ Retrieve the value associated with a given key.
+
+ @param {anything} key
+ @return {anything} the value associated with the key, or undefined
+ */
+ get: function(key) {
+ var values = this.values,
+ guid = guidFor(key);
+
+ return values[guid];
+ },
+
+ /**
+ Adds a value to the map. If a value for the given key has already been
+ provided, the new value will replace the old value.
+
+ @param {anything} key
+ @param {anything} value
+ */
+ set: function(key, value) {
+ var keys = this.keys,
+ values = this.values,
+ guid = guidFor(key);
+
+ keys.add(key);
+ values[guid] = value;
+ },
+
+ /**
+ Removes a value from the map for an associated key.
+
+ @param {anything} key
+ @returns {Boolean} true if an item was removed, false otherwise
+ */
+ remove: function(key) {
+ // don't use ES6 "delete" because it will be annoying
+ // to use in browsers that are not ES6 friendly;
+ var keys = this.keys,
+ values = this.values,
+ guid = guidFor(key),
+ value;
+
+ if (values.hasOwnProperty(guid)) {
+ keys.remove(key);
+ value = values[guid];
+ delete values[guid];
+ return true;
+ } else {
+ return false;
+ }
+ },
+
+ /**
+ Check whether a key is present.
+
+ @param {anything} key
+ @returns {Boolean} true if the item was present, false otherwise
+ */
+ has: function(key) {
+ var values = this.values,
+ guid = guidFor(key);
+
+ return values.hasOwnProperty(guid);
+ },
+
+ /**
+ Iterate over all the keys and values. Calls the function once
+ for each key, passing in the key and value, in that order.
+
+ The keys are guaranteed to be iterated over in insertion order.
+
+ @param {Function} callback
+ @param {anything} self if passed, the `this` value inside the
+ callback. By default, `this` is the map.
+ */
+ forEach: function(callback, self) {
+ var keys = this.keys,
+ values = this.values;
+
+ keys.forEach(function(key) {
+ var guid = guidFor(key);
+ callback.call(self, key, values[guid]);
+ });
+ },
+
+ copy: function() {
+ return copyMap(this, new Map());
+ }
+};
+
+var MapWithDefault = Ember.MapWithDefault = function(options) {
+ Map.call(this);
+ this.defaultValue = options.defaultValue;
+};
+
+MapWithDefault.create = function(options) {
+ if (options) {
+ return new MapWithDefault(options);
+ } else {
+ return new Map();
+ }
+};
+
+MapWithDefault.prototype = Ember.create(Map.prototype);
+
+MapWithDefault.prototype.get = function(key) {
+ var hasValue = this.has(key);
+
+ if (hasValue) {
+ return Map.prototype.get.call(this, key);
+ } else {
+ var defaultValue = this.defaultValue(key);
+ this.set(key, defaultValue);
+ return defaultValue;
+ }
+};
+
+MapWithDefault.prototype.copy = function() {
+ return copyMap(this, new MapWithDefault({
+ defaultValue: this.defaultValue
+ }));
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var META_KEY = Ember.META_KEY, get, set;
+
+var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
+
+/** @private */
+var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;
+var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\.\*]/;
+var HAS_THIS = /^this[\.\*]/;
+var FIRST_KEY = /^([^\.\*]+)/;
+
+// ..........................................................
+// GET AND SET
+//
+// If we are on a platform that supports accessors we can get use those.
+// Otherwise simulate accessors by looking up the property directly on the
+// object.
+
+/** @private */
+get = function get(obj, keyName) {
+ // Helpers that operate with 'this' within an #each
+ if (keyName === '') {
+ return obj;
+ }
+
+ if (!keyName && 'string'===typeof obj) {
+ keyName = obj;
+ obj = null;
+ }
+
+ if (!obj || keyName.indexOf('.') !== -1) {
+ return getPath(obj, keyName);
+ }
+
+ Ember.assert("You need to provide an object and key to `get`.", !!obj && keyName);
+
+ var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;
+ if (desc) {
+ return desc.get(obj, keyName);
+ } else {
+ if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {
+ ret = meta.values[keyName];
+ } else {
+ ret = obj[keyName];
+ }
+
+ if (ret === undefined &&
+ 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {
+ return obj.unknownProperty(keyName);
+ }
+
+ return ret;
+ }
+};
+
+/** @private */
+set = function set(obj, keyName, value, tolerant) {
+ if (typeof obj === 'string') {
+ Ember.assert("Path '" + obj + "' must be global if no obj is given.", IS_GLOBAL.test(obj));
+ value = keyName;
+ keyName = obj;
+ obj = null;
+ }
+
+ if (!obj || keyName.indexOf('.') !== -1) {
+ return setPath(obj, keyName, value, tolerant);
+ }
+
+ Ember.assert("You need to provide an object and key to `set`.", !!obj && keyName !== undefined);
+ Ember.assert('calling set on destroyed object', !obj.isDestroyed);
+
+ var meta = obj[META_KEY], desc = meta && meta.descs[keyName],
+ isUnknown, currentValue;
+ if (desc) {
+ desc.set(obj, keyName, value);
+ }
+ else {
+ isUnknown = 'object' === typeof obj && !(keyName in obj);
+
+ // setUnknownProperty is called if `obj` is an object,
+ // the property does not already exist, and the
+ // `setUnknownProperty` method exists on the object
+ if (isUnknown && 'function' === typeof obj.setUnknownProperty) {
+ obj.setUnknownProperty(keyName, value);
+ } else if (meta && meta.watching[keyName] > 0) {
+ if (MANDATORY_SETTER) {
+ currentValue = meta.values[keyName];
+ } else {
+ currentValue = obj[keyName];
+ }
+ // only trigger a change if the value has changed
+ if (value !== currentValue) {
+ Ember.propertyWillChange(obj, keyName);
+ if (MANDATORY_SETTER) {
+ if (currentValue === undefined && !(keyName in obj)) {
+ Ember.defineProperty(obj, keyName, null, value); // setup mandatory setter
+ } else {
+ meta.values[keyName] = value;
+ }
+ } else {
+ obj[keyName] = value;
+ }
+ Ember.propertyDidChange(obj, keyName);
+ }
+ } else {
+ obj[keyName] = value;
+ }
+ }
+ return value;
+};
+
+/** @private */
+function firstKey(path) {
+ return path.match(FIRST_KEY)[0];
+}
+
+// assumes path is already normalized
+/** @private */
+function normalizeTuple(target, path) {
+ var hasThis = HAS_THIS.test(path),
+ isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),
+ key;
+
+ if (!target || isGlobal) target = window;
+ if (hasThis) path = path.slice(5);
+
+ if (target === window) {
+ key = firstKey(path);
+ target = get(target, key);
+ path = path.slice(key.length+1);
+ }
+
+ // must return some kind of path to be valid else other things will break.
+ if (!path || path.length===0) throw new Error('Invalid Path');
+
+ return [ target, path ];
+}
+
+/** @private */
+function getPath(root, path) {
+ var hasThis, parts, tuple, idx, len;
+
+ // If there is no root and path is a key name, return that
+ // property from the global object.
+ // E.g. get('Ember') -> Ember
+ if (root === null && path.indexOf('.') === -1) { return get(window, path); }
+
+ // detect complicated paths and normalize them
+ hasThis = HAS_THIS.test(path);
+
+ if (!root || hasThis) {
+ tuple = normalizeTuple(root, path);
+ root = tuple[0];
+ path = tuple[1];
+ tuple.length = 0;
+ }
+
+ parts = path.split(".");
+ len = parts.length;
+ for (idx=0; root && idx<len; idx++) {
+ root = get(root, parts[idx], true);
+ if (root && root.isDestroyed) { return undefined; }
+ }
+ return root;
+}
+
+/** @private */
+function setPath(root, path, value, tolerant) {
+ var keyName;
+
+ // get the last part of the path
+ keyName = path.slice(path.lastIndexOf('.') + 1);
+
+ // get the first part of the part
+ path = path.slice(0, path.length-(keyName.length+1));
+
+ // unless the path is this, look up the first part to
+ // get the root
+ if (path !== 'this') {
+ root = getPath(root, path);
+ }
+
+ if (!keyName || keyName.length === 0) {
+ throw new Error('You passed an empty path');
+ }
+
+ if (!root) {
+ if (tolerant) { return; }
+ else { throw new Error('Object in path '+path+' could not be found or was destroyed.'); }
+ }
+
+ return set(root, keyName, value);
+}
+
+/**
+ @private
+
+ Normalizes a target/path pair to reflect that actual target/path that should
+ be observed, etc. This takes into account passing in global property
+ paths (i.e. a path beginning with a captial letter not defined on the
+ target) and * separators.
+
+ @param {Object} target
+ The current target. May be null.
+
+ @param {String} path
+ A path on the target or a global property path.
+
+ @returns {Array} a temporary array with the normalized target/path pair.
+*/
+Ember.normalizeTuple = function(target, path) {
+ return normalizeTuple(target, path);
+};
+
+Ember.getWithDefault = function(root, key, defaultValue) {
+ var value = get(root, key);
+
+ if (value === undefined) { return defaultValue; }
+ return value;
+};
+
+
+/**
+ @function
+
+ Gets the value of a property on an object. If the property is computed,
+ the function will be invoked. If the property is not defined but the
+ object implements the unknownProperty() method then that will be invoked.
+
+ If you plan to run on IE8 and older browsers then you should use this
+ method anytime you want to retrieve a property on an object that you don't
+ know for sure is private. (My convention only properties beginning with
+ an underscore '_' are considered private.)
+
+ On all newer browsers, you only need to use this method to retrieve
+ properties if the property might not be defined on the object and you want
+ to respect the unknownProperty() handler. Otherwise you can ignore this
+ method.
+
+ Note that if the obj itself is null, this method will simply return
+ undefined.
+
+ @param {Object} obj
+ The object to retrieve from.
+
+ @param {String} keyName
+ The property key to retrieve
+
+ @returns {Object} the property value or null.
+*/
+Ember.get = get;
+Ember.getPath = Ember.deprecateFunc('getPath is deprecated since get now supports paths', Ember.get);
+
+/**
+ @function
+
+ Sets the value of a property on an object, respecting computed properties
+ and notifying observers and other listeners of the change. If the
+ property is not defined but the object implements the unknownProperty()
+ method then that will be invoked as well.
+
+ If you plan to run on IE8 and older browsers then you should use this
+ method anytime you want to set a property on an object that you don't
+ know for sure is private. (My convention only properties beginning with
+ an underscore '_' are considered private.)
+
+ On all newer browsers, you only need to use this method to set
+ properties if the property might not be defined on the object and you want
+ to respect the unknownProperty() handler. Otherwise you can ignore this
+ method.
+
+ @param {Object} obj
+ The object to modify.
+
+ @param {String} keyName
+ The property key to set
+
+ @param {Object} value
+ The value to set
+
+ @returns {Object} the passed value.
+*/
+Ember.set = set;
+Ember.setPath = Ember.deprecateFunc('setPath is deprecated since set now supports paths', Ember.set);
+
+/**
+ Error-tolerant form of Ember.set. Will not blow up if any part of the
+ chain is undefined, null, or destroyed.
+
+ This is primarily used when syncing bindings, which may try to update after
+ an object has been destroyed.
+*/
+Ember.trySet = function(root, path, value) {
+ return set(root, path, value, true);
+};
+Ember.trySetPath = Ember.deprecateFunc('trySetPath has been renamed to trySet', Ember.trySet);
+
+/**
+ Returns true if the provided path is global (e.g., "MyApp.fooController.bar")
+ instead of local ("foo.bar.baz").
+
+ @param {String} path
+ @returns Boolean
+*/
+Ember.isGlobalPath = function(path) {
+ return IS_GLOBAL.test(path);
+};
+
+
+
+if (Ember.config.overrideAccessors) {
+ Ember.config.overrideAccessors();
+ get = Ember.get;
+ set = Ember.set;
+}
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var GUID_KEY = Ember.GUID_KEY,
+ META_KEY = Ember.META_KEY,
+ EMPTY_META = Ember.EMPTY_META,
+ metaFor = Ember.meta,
+ o_create = Ember.create,
+ objectDefineProperty = Ember.platform.defineProperty;
+
+var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
+
+// ..........................................................
+// DESCRIPTOR
+//
+
+/**
+ @private
+ @constructor
+
+ Objects of this type can implement an interface to responds requests to
+ get and set. The default implementation handles simple properties.
+
+ You generally won't need to create or subclass this directly.
+*/
+var Descriptor = Ember.Descriptor = function() {};
+
+// ..........................................................
+// DEFINING PROPERTIES API
+//
+
+/**
+ @private
+
+ NOTE: This is a low-level method used by other parts of the API. You almost
+ never want to call this method directly. Instead you should use Ember.mixin()
+ to define new properties.
+
+ Defines a property on an object. This method works much like the ES5
+ Object.defineProperty() method except that it can also accept computed
+ properties and other special descriptors.
+
+ Normally this method takes only three parameters. However if you pass an
+ instance of Ember.Descriptor as the third param then you can pass an optional
+ value as the fourth parameter. This is often more efficient than creating
+ new descriptor hashes for each property.
+
+ ## Examples
+
+ // ES5 compatible mode
+ Ember.defineProperty(contact, 'firstName', {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: 'Charles'
+ });
+
+ // define a simple property
+ Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');
+
+ // define a computed property
+ Ember.defineProperty(contact, 'fullName', Ember.computed(function() {
+ return this.firstName+' '+this.lastName;
+ }).property('firstName', 'lastName').cacheable());
+*/
+Ember.defineProperty = function(obj, keyName, desc, data, meta) {
+ // The first two parameters to defineProperty are mandatory:
+ //
+ // * obj: the object to define this property on. This may be
+ // a prototype.
+ // * keyName: the name of the property
+ //
+ // One and only one of the following two parameters must be
+ // provided:
+ //
+ // * desc: an instance of Ember.Descriptor (typically a
+ // computed property) or an ES5 descriptor.
+ // * data: something other than a descriptor, that will
+ // become the explicit value of this property.
+
+ var descs, existingDesc, watching, value;
+
+ if (!meta) meta = metaFor(obj);
+ descs = meta.descs;
+ existingDesc = meta.descs[keyName];
+ watching = meta.watching[keyName] > 0;
+
+ if (existingDesc instanceof Ember.Descriptor) {
+ existingDesc.teardown(obj, keyName);
+ }
+
+ if (desc instanceof Ember.Descriptor) {
+ value = desc;
+
+ descs[keyName] = desc;
+ if (MANDATORY_SETTER && watching) {
+ objectDefineProperty(obj, keyName, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: undefined // make enumerable
+ });
+ } else {
+ obj[keyName] = undefined; // make enumerable
+ }
+ desc.setup(obj, keyName);
+ } else {
+ descs[keyName] = undefined; // shadow descriptor in proto
+ if (desc == null) {
+ value = data;
+
+ if (MANDATORY_SETTER && watching) {
+ meta.values[keyName] = data;
+ objectDefineProperty(obj, keyName, {
+ configurable: true,
+ enumerable: true,
+ set: function() {
+ Ember.assert('Must use Ember.set() to access this property', false);
+ },
+ get: function() {
+ var meta = this[META_KEY];
+ return meta && meta.values[keyName];
+ }
+ });
+ } else {
+ obj[keyName] = data;
+ }
+ } else {
+ value = desc;
+
+ // compatibility with ES5
+ objectDefineProperty(obj, keyName, desc);
+ }
+ }
+
+ // if key is being watched, override chains that
+ // were initialized with the prototype
+ if (watching) { Ember.overrideChains(obj, keyName, meta); }
+
+ // The `value` passed to the `didDefineProperty` hook is
+ // either the descriptor or data, whichever was passed.
+ if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }
+
+ return this;
+};
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var AFTER_OBSERVERS = ':change';
+var BEFORE_OBSERVERS = ':before';
+var guidFor = Ember.guidFor;
+
+var deferred = 0;
+var array_Slice = [].slice;
+
+/** @private */
+var ObserverSet = function () {
+ this.targetSet = {};
+};
+ObserverSet.prototype.add = function (target, path) {
+ var targetSet = this.targetSet,
+ targetGuid = Ember.guidFor(target),
+ pathSet = targetSet[targetGuid];
+ if (!pathSet) {
+ targetSet[targetGuid] = pathSet = {};
+ }
+ if (pathSet[path]) {
+ return false;
+ } else {
+ return pathSet[path] = true;
+ }
+};
+ObserverSet.prototype.clear = function () {
+ this.targetSet = {};
+};
+
+/** @private */
+var DeferredEventQueue = function() {
+ this.targetSet = {};
+ this.queue = [];
+};
+
+DeferredEventQueue.prototype.push = function(target, eventName, keyName) {
+ var targetSet = this.targetSet,
+ queue = this.queue,
+ targetGuid = Ember.guidFor(target),
+ eventNameSet = targetSet[targetGuid],
+ index;
+
+ if (!eventNameSet) {
+ targetSet[targetGuid] = eventNameSet = {};
+ }
+ index = eventNameSet[eventName];
+ if (index === undefined) {
+ eventNameSet[eventName] = queue.push(Ember.deferEvent(target, eventName, [target, keyName])) - 1;
+ } else {
+ queue[index] = Ember.deferEvent(target, eventName, [target, keyName]);
+ }
+};
+
+DeferredEventQueue.prototype.flush = function() {
+ var queue = this.queue;
+ this.queue = [];
+ this.targetSet = {};
+ for (var i=0, len=queue.length; i < len; ++i) {
+ queue[i]();
+ }
+};
+
+var queue = new DeferredEventQueue(), beforeObserverSet = new ObserverSet();
+
+/** @private */
+function notifyObservers(obj, eventName, keyName, forceNotification) {
+ if (deferred && !forceNotification) {
+ queue.push(obj, eventName, keyName);
+ } else {
+ Ember.sendEvent(obj, eventName, [obj, keyName]);
+ }
+}
+
+/** @private */
+function flushObserverQueue() {
+ beforeObserverSet.clear();
+
+ queue.flush();
+}
+
+Ember.beginPropertyChanges = function() {
+ deferred++;
+ return this;
+};
+
+Ember.endPropertyChanges = function() {
+ deferred--;
+ if (deferred<=0) flushObserverQueue();
+};
+
+/**
+ Make a series of property changes together in an
+ exception-safe way.
+
+ Ember.changeProperties(function() {
+ obj1.set('foo', mayBlowUpWhenSet);
+ obj2.set('bar', baz);
+ });
+*/
+Ember.changeProperties = function(cb, binding){
+ Ember.beginPropertyChanges();
+ try {
+ cb.call(binding);
+ } finally {
+ Ember.endPropertyChanges();
+ }
+};
+
+/**
+ Set a list of properties on an object. These properties are set inside
+ a single `beginPropertyChanges` and `endPropertyChanges` batch, so
+ observers will be buffered.
+*/
+Ember.setProperties = function(self, hash) {
+ Ember.changeProperties(function(){
+ for(var prop in hash) {
+ if (hash.hasOwnProperty(prop)) Ember.set(self, prop, hash[prop]);
+ }
+ });
+ return self;
+};
+
+
+/** @private */
+function changeEvent(keyName) {
+ return keyName+AFTER_OBSERVERS;
+}
+
+/** @private */
+function beforeEvent(keyName) {
+ return keyName+BEFORE_OBSERVERS;
+}
+
+Ember.addObserver = function(obj, path, target, method) {
+ Ember.addListener(obj, changeEvent(path), target, method);
+ Ember.watch(obj, path);
+ return this;
+};
+
+/** @private */
+Ember.observersFor = function(obj, path) {
+ return Ember.listenersFor(obj, changeEvent(path));
+};
+
+Ember.removeObserver = function(obj, path, target, method) {
+ Ember.unwatch(obj, path);
+ Ember.removeListener(obj, changeEvent(path), target, method);
+ return this;
+};
+
+Ember.addBeforeObserver = function(obj, path, target, method) {
+ Ember.addListener(obj, beforeEvent(path), target, method);
+ Ember.watch(obj, path);
+ return this;
+};
+
+// Suspend observer during callback.
+//
+// This should only be used by the target of the observer
+// while it is setting the observed path.
+/** @private */
+Ember._suspendBeforeObserver = function(obj, path, target, method, callback) {
+ return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);
+};
+
+Ember._suspendObserver = function(obj, path, target, method, callback) {
+ return Ember._suspendListener(obj, changeEvent(path), target, method, callback);
+};
+
+/** @private */
+Ember.beforeObserversFor = function(obj, path) {
+ return Ember.listenersFor(obj, beforeEvent(path));
+};
+
+Ember.removeBeforeObserver = function(obj, path, target, method) {
+ Ember.unwatch(obj, path);
+ Ember.removeListener(obj, beforeEvent(path), target, method);
+ return this;
+};
+
+/** @private */
+Ember.notifyObservers = function(obj, keyName) {
+ if (obj.isDestroying) { return; }
+
+ notifyObservers(obj, changeEvent(keyName), keyName);
+};
+
+/** @private */
+Ember.notifyBeforeObservers = function(obj, keyName) {
+ if (obj.isDestroying) { return; }
+
+ var guid, set, forceNotification = false;
+
+ if (deferred) {
+ if (beforeObserverSet.add(obj, keyName)) {
+ forceNotification = true;
+ } else {
+ return;
+ }
+ }
+
+ notifyObservers(obj, beforeEvent(keyName), keyName, forceNotification);
+};
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var guidFor = Ember.guidFor, // utils.js
+ metaFor = Ember.meta, // utils.js
+ get = Ember.get, // accessors.js
+ set = Ember.set, // accessors.js
+ normalizeTuple = Ember.normalizeTuple, // accessors.js
+ GUID_KEY = Ember.GUID_KEY, // utils.js
+ META_KEY = Ember.META_KEY, // utils.js
+ // circular reference observer depends on Ember.watch
+ // we should move change events to this file or its own property_events.js
+ notifyObservers = Ember.notifyObservers, // observer.js
+ forEach = Ember.ArrayPolyfills.forEach, // array.js
+ FIRST_KEY = /^([^\.\*]+)/,
+ IS_PATH = /[\.\*]/;
+
+var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,
+o_defineProperty = Ember.platform.defineProperty;
+
+/** @private */
+function firstKey(path) {
+ return path.match(FIRST_KEY)[0];
+}
+
+// returns true if the passed path is just a keyName
+/** @private */
+function isKeyName(path) {
+ return path==='*' || !IS_PATH.test(path);
+}
+
+// ..........................................................
+// DEPENDENT KEYS
+//
+
+var DEP_SKIP = { __emberproto__: true }; // skip some keys and toString
+
+/** @private */
+function iterDeps(method, obj, depKey, seen, meta) {
+
+ var guid = guidFor(obj);
+ if (!seen[guid]) seen[guid] = {};
+ if (seen[guid][depKey]) return;
+ seen[guid][depKey] = true;
+
+ var deps = meta.deps;
+ deps = deps && deps[depKey];
+ if (deps) {
+ for(var key in deps) {
+ if (DEP_SKIP[key]) continue;
+ method(obj, key);
+ }
+ }
+}
+
+
+var WILL_SEEN, DID_SEEN;
+
+// called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)
+/** @private */
+function dependentKeysWillChange(obj, depKey, meta) {
+ if (obj.isDestroying) { return; }
+
+ var seen = WILL_SEEN, top = !seen;
+ if (top) { seen = WILL_SEEN = {}; }
+ iterDeps(propertyWillChange, obj, depKey, seen, meta);
+ if (top) { WILL_SEEN = null; }
+}
+
+// called whenever a property has just changed to update dependent keys
+/** @private */
+function dependentKeysDidChange(obj, depKey, meta) {
+ if (obj.isDestroying) { return; }
+
+ var seen = DID_SEEN, top = !seen;
+ if (top) { seen = DID_SEEN = {}; }
+ iterDeps(propertyDidChange, obj, depKey, seen, meta);
+ if (top) { DID_SEEN = null; }
+}
+
+// ..........................................................
+// CHAIN
+//
+
+/** @private */
+function addChainWatcher(obj, keyName, node) {
+ if (!obj || ('object' !== typeof obj)) return; // nothing to do
+ var m = metaFor(obj);
+ var nodes = m.chainWatchers;
+ if (!nodes || nodes.__emberproto__ !== obj) {
+ nodes = m.chainWatchers = { __emberproto__: obj };
+ }
+
+ if (!nodes[keyName]) { nodes[keyName] = {}; }
+ nodes[keyName][guidFor(node)] = node;
+ Ember.watch(obj, keyName);
+}
+
+/** @private */
+function removeChainWatcher(obj, keyName, node) {
+ if (!obj || 'object' !== typeof obj) { return; } // nothing to do
+ var m = metaFor(obj, false),
+ nodes = m.chainWatchers;
+ if (!nodes || nodes.__emberproto__ !== obj) { return; } //nothing to do
+ if (nodes[keyName]) { delete nodes[keyName][guidFor(node)]; }
+ Ember.unwatch(obj, keyName);
+}
+
+var pendingQueue = [];
+
+// attempts to add the pendingQueue chains again. If some of them end up
+// back in the queue and reschedule is true, schedules a timeout to try
+// again.
+/** @private */
+function flushPendingChains() {
+ if (pendingQueue.length === 0) { return; } // nothing to do
+
+ var queue = pendingQueue;
+ pendingQueue = [];
+
+ forEach.call(queue, function(q) { q[0].add(q[1]); });
+
+ Ember.warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);
+}
+
+/** @private */
+function isProto(pvalue) {
+ return metaFor(pvalue, false).proto === pvalue;
+}
+
+// A ChainNode watches a single key on an object. If you provide a starting
+// value for the key then the node won't actually watch it. For a root node
+// pass null for parent and key and object for value.
+/** @private */
+var ChainNode = function(parent, key, value, separator) {
+ var obj;
+ this._parent = parent;
+ this._key = key;
+
+ // _watching is true when calling get(this._parent, this._key) will
+ // return the value of this node.
+ //
+ // It is false for the root of a chain (because we have no parent)
+ // and for global paths (because the parent node is the object with
+ // the observer on it)
+ this._watching = value===undefined;
+
+ this._value = value;
+ this._separator = separator || '.';
+ this._paths = {};
+ if (this._watching) {
+ this._object = parent.value();
+ if (this._object) { addChainWatcher(this._object, this._key, this); }
+ }
+
+ // Special-case: the EachProxy relies on immediate evaluation to
+ // establish its observers.
+ //
+ // TODO: Replace this with an efficient callback that the EachProxy
+ // can implement.
+ if (this._parent && this._parent._key === '@each') {
+ this.value();
+ }
+};
+
+var ChainNodePrototype = ChainNode.prototype;
+
+ChainNodePrototype.value = function() {
+ if (this._value === undefined && this._watching) {
+ var obj = this._parent.value();
+ this._value = (obj && !isProto(obj)) ? get(obj, this._key) : undefined;
+ }
+ return this._value;
+};
+
+ChainNodePrototype.destroy = function() {
+ if (this._watching) {
+ var obj = this._object;
+ if (obj) { removeChainWatcher(obj, this._key, this); }
+ this._watching = false; // so future calls do nothing
+ }
+};
+
+// copies a top level object only
+ChainNodePrototype.copy = function(obj) {
+ var ret = new ChainNode(null, null, obj, this._separator),
+ paths = this._paths, path;
+ for (path in paths) {
+ if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.
+ ret.add(path);
+ }
+ return ret;
+};
+
+// called on the root node of a chain to setup watchers on the specified
+// path.
+ChainNodePrototype.add = function(path) {
+ var obj, tuple, key, src, separator, paths;
+
+ paths = this._paths;
+ paths[path] = (paths[path] || 0) + 1;
+
+ obj = this.value();
+ tuple = normalizeTuple(obj, path);
+
+ // the path was a local path
+ if (tuple[0] && tuple[0] === obj) {
+ path = tuple[1];
+ key = firstKey(path);
+ path = path.slice(key.length+1);
+
+ // global path, but object does not exist yet.
+ // put into a queue and try to connect later.
+ } else if (!tuple[0]) {
+ pendingQueue.push([this, path]);
+ tuple.length = 0;
+ return;
+
+ // global path, and object already exists
+ } else {
+ src = tuple[0];
+ key = path.slice(0, 0-(tuple[1].length+1));
+ separator = path.slice(key.length, key.length+1);
+ path = tuple[1];
+ }
+
+ tuple.length = 0;
+ this.chain(key, path, src, separator);
+};
+
+// called on the root node of a chain to teardown watcher on the specified
+// path
+ChainNodePrototype.remove = function(path) {
+ var obj, tuple, key, src, paths;
+
+ paths = this._paths;
+ if (paths[path] > 0) { paths[path]--; }
+
+ obj = this.value();
+ tuple = normalizeTuple(obj, path);
+ if (tuple[0] === obj) {
+ path = tuple[1];
+ key = firstKey(path);
+ path = path.slice(key.length+1);
+ } else {
+ src = tuple[0];
+ key = path.slice(0, 0-(tuple[1].length+1));
+ path = tuple[1];
+ }
+
+ tuple.length = 0;
+ this.unchain(key, path);
+};
+
+ChainNodePrototype.count = 0;
+
+ChainNodePrototype.chain = function(key, path, src, separator) {
+ var chains = this._chains, node;
+ if (!chains) { chains = this._chains = {}; }
+
+ node = chains[key];
+ if (!node) { node = chains[key] = new ChainNode(this, key, src, separator); }
+ node.count++; // count chains...
+
+ // chain rest of path if there is one
+ if (path && path.length>0) {
+ key = firstKey(path);
+ path = path.slice(key.length+1);
+ node.chain(key, path); // NOTE: no src means it will observe changes...
+ }
+};
+
+ChainNodePrototype.unchain = function(key, path) {
+ var chains = this._chains, node = chains[key];
+
+ // unchain rest of path first...
+ if (path && path.length>1) {
+ key = firstKey(path);
+ path = path.slice(key.length+1);
+ node.unchain(key, path);
+ }
+
+ // delete node if needed.
+ node.count--;
+ if (node.count<=0) {
+ delete chains[node._key];
+ node.destroy();
+ }
+
+};
+
+ChainNodePrototype.willChange = function() {
+ var chains = this._chains;
+ if (chains) {
+ for(var key in chains) {
+ if (!chains.hasOwnProperty(key)) { continue; }
+ chains[key].willChange();
+ }
+ }
+
+ if (this._parent) { this._parent.chainWillChange(this, this._key, 1); }
+};
+
+ChainNodePrototype.chainWillChange = function(chain, path, depth) {
+ if (this._key) { path = this._key + this._separator + path; }
+
+ if (this._parent) {
+ this._parent.chainWillChange(this, path, depth+1);
+ } else {
+ if (depth > 1) { Ember.propertyWillChange(this.value(), path); }
+ path = 'this.' + path;
+ if (this._paths[path] > 0) { Ember.propertyWillChange(this.value(), path); }
+ }
+};
+
+ChainNodePrototype.chainDidChange = function(chain, path, depth) {
+ if (this._key) { path = this._key + this._separator + path; }
+ if (this._parent) {
+ this._parent.chainDidChange(this, path, depth+1);
+ } else {
+ if (depth > 1) { Ember.propertyDidChange(this.value(), path); }
+ path = 'this.' + path;
+ if (this._paths[path] > 0) { Ember.propertyDidChange(this.value(), path); }
+ }
+};
+
+ChainNodePrototype.didChange = function(suppressEvent) {
+ // invalidate my own value first.
+ if (this._watching) {
+ var obj = this._parent.value();
+ if (obj !== this._object) {
+ removeChainWatcher(this._object, this._key, this);
+ this._object = obj;
+ addChainWatcher(obj, this._key, this);
+ }
+ this._value = undefined;
+
+ // Special-case: the EachProxy relies on immediate evaluation to
+ // establish its observers.
+ if (this._parent && this._parent._key === '@each')
+ this.value();
+ }
+
+ // then notify chains...
+ var chains = this._chains;
+ if (chains) {
+ for(var key in chains) {
+ if (!chains.hasOwnProperty(key)) { continue; }
+ chains[key].didChange(suppressEvent);
+ }
+ }
+
+ if (suppressEvent) { return; }
+
+ // and finally tell parent about my path changing...
+ if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }
+};
+
+// get the chains for the current object. If the current object has
+// chains inherited from the proto they will be cloned and reconfigured for
+// the current object.
+/** @private */
+function chainsFor(obj) {
+ var m = metaFor(obj), ret = m.chains;
+ if (!ret) {
+ ret = m.chains = new ChainNode(null, null, obj);
+ } else if (ret.value() !== obj) {
+ ret = m.chains = ret.copy(obj);
+ }
+ return ret;
+}
+
+/** @private */
+function notifyChains(obj, m, keyName, methodName, arg) {
+ var nodes = m.chainWatchers;
+
+ if (!nodes || nodes.__emberproto__ !== obj) { return; } // nothing to do
+
+ nodes = nodes[keyName];
+ if (!nodes) { return; }
+
+ for(var key in nodes) {
+ if (!nodes.hasOwnProperty(key)) { continue; }
+ nodes[key][methodName](arg);
+ }
+}
+
+Ember.overrideChains = function(obj, keyName, m) {
+ notifyChains(obj, m, keyName, 'didChange', true);
+};
+
+/** @private */
+function chainsWillChange(obj, keyName, m) {
+ notifyChains(obj, m, keyName, 'willChange');
+}
+
+/** @private */
+function chainsDidChange(obj, keyName, m) {
+ notifyChains(obj, m, keyName, 'didChange');
+}
+
+// ..........................................................
+// WATCH
+//
+
+/**
+ @private
+
+ Starts watching a property on an object. Whenever the property changes,
+ invokes Ember.propertyWillChange and Ember.propertyDidChange. This is the
+ primitive used by observers and dependent keys; usually you will never call
+ this method directly but instead use higher level methods like
+ Ember.addObserver().
+*/
+Ember.watch = function(obj, keyName) {
+ // can't watch length on Array - it is special...
+ if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }
+
+ var m = metaFor(obj), watching = m.watching, desc;
+
+ // activate watching first time
+ if (!watching[keyName]) {
+ watching[keyName] = 1;
+ if (isKeyName(keyName)) {
+ desc = m.descs[keyName];
+ if (desc && desc.willWatch) { desc.willWatch(obj, keyName); }
+
+ if ('function' === typeof obj.willWatchProperty) {
+ obj.willWatchProperty(keyName);
+ }
+
+ if (MANDATORY_SETTER && keyName in obj) {
+ m.values[keyName] = obj[keyName];
+ o_defineProperty(obj, keyName, {
+ configurable: true,
+ enumerable: true,
+ set: function() {
+ Ember.assert('Must use Ember.set() to access this property', false);
+ },
+ get: function() {
+ var meta = this[META_KEY];
+ return meta && meta.values[keyName];
+ }
+ });
+ }
+ } else {
+ chainsFor(obj).add(keyName);
+ }
+
+ } else {
+ watching[keyName] = (watching[keyName] || 0) + 1;
+ }
+ return this;
+};
+
+Ember.isWatching = function isWatching(obj, key) {
+ var meta = obj[META_KEY];
+ return (meta && meta.watching[key]) > 0;
+};
+
+Ember.watch.flushPending = flushPendingChains;
+
+/** @private */
+Ember.unwatch = function(obj, keyName) {
+ // can't watch length on Array - it is special...
+ if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }
+
+ var m = metaFor(obj), watching = m.watching, desc;
+
+ if (watching[keyName] === 1) {
+ watching[keyName] = 0;
+
+ if (isKeyName(keyName)) {
+ desc = m.descs[keyName];
+ if (desc && desc.didUnwatch) { desc.didUnwatch(obj, keyName); }
+
+ if ('function' === typeof obj.didUnwatchProperty) {
+ obj.didUnwatchProperty(keyName);
+ }
+
+ if (MANDATORY_SETTER && keyName in obj) {
+ o_defineProperty(obj, keyName, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: m.values[keyName]
+ });
+ delete m.values[keyName];
+ }
+ } else {
+ chainsFor(obj).remove(keyName);
+ }
+
+ } else if (watching[keyName]>1) {
+ watching[keyName]--;
+ }
+
+ return this;
+};
+
+/**
+ @private
+
+ Call on an object when you first beget it from another object. This will
+ setup any chained watchers on the object instance as needed. This method is
+ safe to call multiple times.
+*/
+Ember.rewatch = function(obj) {
+ var m = metaFor(obj, false), chains = m.chains;
+
+ // make sure the object has its own guid.
+ if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {
+ Ember.generateGuid(obj, 'ember');
+ }
+
+ // make sure any chained watchers update.
+ if (chains && chains.value() !== obj) {
+ m.chains = chains.copy(obj);
+ }
+
+ return this;
+};
+
+Ember.finishChains = function(obj) {
+ var m = metaFor(obj, false), chains = m.chains;
+ if (chains) {
+ if (chains.value() !== obj) {
+ m.chains = chains = chains.copy(obj);
+ }
+ chains.didChange(true);
+ }
+};
+
+// ..........................................................
+// PROPERTY CHANGES
+//
+
+/**
+ This function is called just before an object property is about to change.
+ It will notify any before observers and prepare caches among other things.
+
+ Normally you will not need to call this method directly but if for some
+ reason you can't directly watch a property you can invoke this method
+ manually along with `Ember.propertyDidChange()` which you should call just
+ after the property value changes.
+
+ @memberOf Ember
+
+ @param {Object} obj
+ The object with the property that will change
+
+ @param {String} keyName
+ The property key (or path) that will change.
+
+ @returns {void}
+*/
+function propertyWillChange(obj, keyName, value) {
+ var m = metaFor(obj, false),
+ watching = m.watching[keyName] > 0 || keyName === 'length',
+ proto = m.proto,
+ desc = m.descs[keyName];
+
+ if (!watching) { return; }
+ if (proto === obj) { return; }
+ if (desc && desc.willChange) { desc.willChange(obj, keyName); }
+ dependentKeysWillChange(obj, keyName, m);
+ chainsWillChange(obj, keyName, m);
+ Ember.notifyBeforeObservers(obj, keyName);
+}
+
+Ember.propertyWillChange = propertyWillChange;
+
+/**
+ This function is called just after an object property has changed.
+ It will notify any observers and clear caches among other things.
+
+ Normally you will not need to call this method directly but if for some
+ reason you can't directly watch a property you can invoke this method
+ manually along with `Ember.propertyWilLChange()` which you should call just
+ before the property value changes.
+
+ @memberOf Ember
+
+ @param {Object} obj
+ The object with the property that will change
+
+ @param {String} keyName
+ The property key (or path) that will change.
+
+ @returns {void}
+*/
+function propertyDidChange(obj, keyName) {
+ var m = metaFor(obj, false),
+ watching = m.watching[keyName] > 0 || keyName === 'length',
+ proto = m.proto,
+ desc = m.descs[keyName];
+
+ if (proto === obj) { return; }
+
+ // shouldn't this mean that we're watching this key?
+ if (desc && desc.didChange) { desc.didChange(obj, keyName); }
+ if (!watching && keyName !== 'length') { return; }
+
+ dependentKeysDidChange(obj, keyName, m);
+ chainsDidChange(obj, keyName, m);
+ Ember.notifyObservers(obj, keyName);
+}
+
+Ember.propertyDidChange = propertyDidChange;
+
+var NODE_STACK = [];
+
+/**
+ Tears down the meta on an object so that it can be garbage collected.
+ Multiple calls will have no effect.
+
+ @param {Object} obj the object to destroy
+ @returns {void}
+*/
+Ember.destroy = function (obj) {
+ var meta = obj[META_KEY], node, nodes, key, nodeObject;
+ if (meta) {
+ obj[META_KEY] = null;
+ // remove chainWatchers to remove circular references that would prevent GC
+ node = meta.chains;
+ if (node) {
+ NODE_STACK.push(node);
+ // process tree
+ while (NODE_STACK.length > 0) {
+ node = NODE_STACK.pop();
+ // push children
+ nodes = node._chains;
+ if (nodes) {
+ for (key in nodes) {
+ if (nodes.hasOwnProperty(key)) {
+ NODE_STACK.push(nodes[key]);
+ }
+ }
+ }
+ // remove chainWatcher in node object
+ if (node._watching) {
+ nodeObject = node._object;
+ if (nodeObject) {
+ removeChainWatcher(nodeObject, node._key, node);
+ }
+ }
+ }
+ }
+ }
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+Ember.warn("Computed properties will soon be cacheable by default. To enable this in your app, set `ENV.CP_DEFAULT_CACHEABLE = true`.", Ember.CP_DEFAULT_CACHEABLE);
+
+
+var get = Ember.get,
+ metaFor = Ember.meta,
+ guidFor = Ember.guidFor,
+ a_slice = [].slice,
+ o_create = Ember.create,
+ META_KEY = Ember.META_KEY,
+ watch = Ember.watch,
+ unwatch = Ember.unwatch;
+
+// ..........................................................
+// DEPENDENT KEYS
+//
+
+// data structure:
+// meta.deps = {
+// 'depKey': {
+// 'keyName': count,
+// __emberproto__: SRC_OBJ [to detect clones]
+// },
+// __emberproto__: SRC_OBJ
+// }
+
+/**
+ @private
+
+ This function returns a map of unique dependencies for a
+ given object and key.
+*/
+function keysForDep(obj, depsMeta, depKey) {
+ var keys = depsMeta[depKey];
+ if (!keys) {
+ // if there are no dependencies yet for a the given key
+ // create a new empty list of dependencies for the key
+ keys = depsMeta[depKey] = { __emberproto__: obj };
+ } else if (keys.__emberproto__ !== obj) {
+ // otherwise if the dependency list is inherited from
+ // a superclass, clone the hash
+ keys = depsMeta[depKey] = o_create(keys);
+ keys.__emberproto__ = obj;
+ }
+ return keys;
+}
+
+/**
+ @private
+
+ return obj[META_KEY].deps
+ */
+function metaForDeps(obj, meta) {
+ var deps = meta.deps;
+ // If the current object has no dependencies...
+ if (!deps) {
+ // initialize the dependencies with a pointer back to
+ // the current object
+ deps = meta.deps = { __emberproto__: obj };
+ } else if (deps.__emberproto__ !== obj) {
+ // otherwise if the dependencies are inherited from the
+ // object's superclass, clone the deps
+ deps = meta.deps = o_create(deps);
+ deps.__emberproto__ = obj;
+ }
+ return deps;
+}
+
+/** @private */
+function addDependentKeys(desc, obj, keyName, meta) {
+ // the descriptor has a list of dependent keys, so
+ // add all of its dependent keys.
+ var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;
+ if (!depKeys) return;
+
+ depsMeta = metaForDeps(obj, meta);
+
+ for(idx = 0, len = depKeys.length; idx < len; idx++) {
+ depKey = depKeys[idx];
+ // Lookup keys meta for depKey
+ keys = keysForDep(obj, depsMeta, depKey);
+ // Increment the number of times depKey depends on keyName.
+ keys[keyName] = (keys[keyName] || 0) + 1;
+ // Watch the depKey
+ watch(obj, depKey);
+ }
+}
+
+/** @private */
+function removeDependentKeys(desc, obj, keyName, meta) {
+ // the descriptor has a list of dependent keys, so
+ // add all of its dependent keys.
+ var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;
+ if (!depKeys) return;
+
+ depsMeta = metaForDeps(obj, meta);
+
+ for(idx = 0, len = depKeys.length; idx < len; idx++) {
+ depKey = depKeys[idx];
+ // Lookup keys meta for depKey
+ keys = keysForDep(obj, depsMeta, depKey);
+ // Increment the number of times depKey depends on keyName.
+ keys[keyName] = (keys[keyName] || 0) - 1;
+ // Watch the depKey
+ unwatch(obj, depKey);
+ }
+}
+
+// ..........................................................
+// COMPUTED PROPERTY
+//
+
+/** @private */
+function ComputedProperty(func, opts) {
+ this.func = func;
+ this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : Ember.CP_DEFAULT_CACHEABLE;
+ this._dependentKeys = opts && opts.dependentKeys;
+}
+
+/**
+ @constructor
+*/
+Ember.ComputedProperty = ComputedProperty;
+ComputedProperty.prototype = new Ember.Descriptor();
+
+/**
+ @extends Ember.ComputedProperty
+ @private
+*/
+var ComputedPropertyPrototype = ComputedProperty.prototype;
+
+/**
+ Call on a computed property to set it into cacheable mode. When in this
+ mode the computed property will automatically cache the return value of
+ your function until one of the dependent keys changes.
+
+ MyApp.president = Ember.Object.create({
+ fullName: function() {
+ return this.get('firstName') + ' ' + this.get('lastName');
+
+ // After calculating the value of this function, Ember.js will
+ // return that value without re-executing this function until
+ // one of the dependent properties change.
+ }.property('firstName', 'lastName').cacheable()
+ });
+
+ Properties are cacheable by default.
+
+ @memberOf Ember.ComputedProperty.prototype
+ @name cacheable
+ @function
+ @param {Boolean} aFlag optional set to false to disable caching
+ @returns {Ember.ComputedProperty} receiver
+*/
+ComputedPropertyPrototype.cacheable = function(aFlag) {
+ this._cacheable = aFlag !== false;
+ return this;
+};
+
+/**
+ Call on a computed property to set it into non-cached mode. When in this
+ mode the computed property will not automatically cache the return value.
+
+ MyApp.outsideService = Ember.Object.create({
+ value: function() {
+ return OutsideService.getValue();
+ }.property().volatile()
+ });
+
+ @memberOf Ember.ComputedProperty.prototype
+ @name volatile
+ @function
+ @returns {Ember.ComputedProperty} receiver
+*/
+ComputedPropertyPrototype.volatile = function() {
+ return this.cacheable(false);
+};
+
+/**
+ Sets the dependent keys on this computed property. Pass any number of
+ arguments containing key paths that this computed property depends on.
+
+ MyApp.president = Ember.Object.create({
+ fullName: Ember.computed(function() {
+ return this.get('firstName') + ' ' + this.get('lastName');
+
+ // Tell Ember.js that this computed property depends on firstName
+ // and lastName
+ }).property('firstName', 'lastName')
+ });
+
+ @memberOf Ember.ComputedProperty.prototype
+ @name property
+ @function
+ @param {String} path... zero or more property paths
+ @returns {Ember.ComputedProperty} receiver
+*/
+ComputedPropertyPrototype.property = function() {
+ var args = [];
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ args.push(arguments[i]);
+ }
+ this._dependentKeys = args;
+ return this;
+};
+
+/**
+ In some cases, you may want to annotate computed properties with additional
+ metadata about how they function or what values they operate on. For example,
+ computed property functions may close over variables that are then no longer
+ available for introspection.
+
+ You can pass a hash of these values to a computed property like this:
+
+ person: function() {
+ var personId = this.get('personId');
+ return App.Person.create({ id: personId });
+ }.property().meta({ type: App.Person })
+
+ The hash that you pass to the `meta()` function will be saved on the
+ computed property descriptor under the `_meta` key. Ember runtime
+ exposes a public API for retrieving these values from classes,
+ via the `metaForProperty()` function.
+
+ @memberOf Ember.ComputedProperty.prototype
+ @name meta
+ @function
+ @param {Hash} meta
+ @returns {Ember.ComputedProperty} property descriptor instance
+*/
+
+ComputedPropertyPrototype.meta = function(meta) {
+ if (arguments.length === 0) {
+ return this._meta || {};
+ } else {
+ this._meta = meta;
+ return this;
+ }
+};
+
+/** @private - impl descriptor API */
+ComputedPropertyPrototype.willWatch = function(obj, keyName) {
+ // watch already creates meta for this instance
+ var meta = obj[META_KEY];
+ Ember.assert('watch should have setup meta to be writable', meta.source === obj);
+ if (!(keyName in meta.cache)) {
+ addDependentKeys(this, obj, keyName, meta);
+ }
+};
+
+ComputedPropertyPrototype.didUnwatch = function(obj, keyName) {
+ var meta = obj[META_KEY];
+ Ember.assert('unwatch should have setup meta to be writable', meta.source === obj);
+ if (!(keyName in meta.cache)) {
+ // unwatch already creates meta for this instance
+ removeDependentKeys(this, obj, keyName, meta);
+ }
+};
+
+/** @private - impl descriptor API */
+ComputedPropertyPrototype.didChange = function(obj, keyName) {
+ // _suspended is set via a CP.set to ensure we don't clear
+ // the cached value set by the setter
+ if (this._cacheable && this._suspended !== obj) {
+ var meta = metaFor(obj);
+ if (keyName in meta.cache) {
+ delete meta.cache[keyName];
+ if (!meta.watching[keyName]) {
+ removeDependentKeys(this, obj, keyName, meta);
+ }
+ }
+ }
+};
+
+/** @private - impl descriptor API */
+ComputedPropertyPrototype.get = function(obj, keyName) {
+ var ret, cache, meta;
+ if (this._cacheable) {
+ meta = metaFor(obj);
+ cache = meta.cache;
+ if (keyName in cache) { return cache[keyName]; }
+ ret = cache[keyName] = this.func.call(obj, keyName);
+ if (!meta.watching[keyName]) {
+ addDependentKeys(this, obj, keyName, meta);
+ }
+ } else {
+ ret = this.func.call(obj, keyName);
+ }
+ return ret;
+};
+
+/** @private - impl descriptor API */
+ComputedPropertyPrototype.set = function(obj, keyName, value) {
+ var cacheable = this._cacheable,
+ meta = metaFor(obj, cacheable),
+ watched = meta.watching[keyName],
+ oldSuspended = this._suspended,
+ hadCachedValue,
+ ret;
+
+ this._suspended = obj;
+
+ if (watched) { Ember.propertyWillChange(obj, keyName); }
+ if (cacheable) {
+ if (keyName in meta.cache) {
+ delete meta.cache[keyName];
+ hadCachedValue = true;
+ }
+ }
+ ret = this.func.call(obj, keyName, value);
+ if (cacheable) {
+ if (!watched && !hadCachedValue) {
+ addDependentKeys(this, obj, keyName, meta);
+ }
+ meta.cache[keyName] = ret;
+ }
+ if (watched) { Ember.propertyDidChange(obj, keyName); }
+ this._suspended = oldSuspended;
+ return ret;
+};
+
+/** @private - called when property is defined */
+ComputedPropertyPrototype.setup = function(obj, keyName) {
+ var meta = obj[META_KEY];
+ if (meta && meta.watching[keyName]) {
+ addDependentKeys(this, obj, keyName, metaFor(obj));
+ }
+};
+
+/** @private - called before property is overridden */
+ComputedPropertyPrototype.teardown = function(obj, keyName) {
+ var meta = metaFor(obj);
+
+ if (meta.watching[keyName] || keyName in meta.cache) {
+ removeDependentKeys(this, obj, keyName, meta);
+ }
+
+ if (this._cacheable) { delete meta.cache[keyName]; }
+
+ return null; // no value to restore
+};
+
+/**
+ This helper returns a new property descriptor that wraps the passed
+ computed property function. You can use this helper to define properties
+ with mixins or via Ember.defineProperty().
+
+ The function you pass will be used to both get and set property values.
+ The function should accept two parameters, key and value. If value is not
+ undefined you should set the value first. In either case return the
+ current value of the property.
+
+ @param {Function} func
+ The computed property function.
+
+ @returns {Ember.ComputedProperty} property descriptor instance
+*/
+Ember.computed = function(func) {
+ var args;
+
+ if (arguments.length > 1) {
+ args = a_slice.call(arguments, 0, -1);
+ func = a_slice.call(arguments, -1)[0];
+ }
+
+ var cp = new ComputedProperty(func);
+
+ if (args) {
+ cp.property.apply(cp, args);
+ }
+
+ return cp;
+};
+
+/**
+ Returns the cached value for a property, if one exists.
+ This can be useful for peeking at the value of a computed
+ property that is generated lazily, without accidentally causing
+ it to be created.
+
+ @param {Object} obj the object whose property you want to check
+ @param {String} key the name of the property whose cached value you want
+ to return
+
+*/
+Ember.cacheFor = function cacheFor(obj, key) {
+ var cache = metaFor(obj, false).cache;
+
+ if (cache && key in cache) {
+ return cache[key];
+ }
+};
+
+Ember.computed.not = function(dependentKey) {
+ return Ember.computed(dependentKey, function(key) {
+ return !get(this, dependentKey);
+ }).cacheable();
+};
+
+Ember.computed.empty = function(dependentKey) {
+ return Ember.computed(dependentKey, function(key) {
+ var val = get(this, dependentKey);
+ return val === undefined || val === null || val === '' || (Ember.isArray(val) && get(val, 'length') === 0);
+ }).cacheable();
+};
+
+Ember.computed.bool = function(dependentKey) {
+ return Ember.computed(dependentKey, function(key) {
+ return !!get(this, dependentKey);
+ }).cacheable();
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var o_create = Ember.create,
+ meta = Ember.meta,
+ metaPath = Ember.metaPath,
+ guidFor = Ember.guidFor,
+ a_slice = [].slice;
+
+/**
+ The event system uses a series of nested hashes to store listeners on an
+ object. When a listener is registered, or when an event arrives, these
+ hashes are consulted to determine which target and action pair to invoke.
+
+ The hashes are stored in the object's meta hash, and look like this:
+
+ // Object's meta hash
+ {
+ listeners: { // variable name: `listenerSet`
+ "foo:changed": { // variable name: `targetSet`
+ [targetGuid]: { // variable name: `actionSet`
+ [methodGuid]: { // variable name: `action`
+ target: [Object object],
+ method: [Function function]
+ }
+ }
+ }
+ }
+ }
+
+*/
+
+// Gets the set of all actions, keyed on the guid of each action's
+// method property.
+/** @private */
+function actionSetFor(obj, eventName, target, writable) {
+ return metaPath(obj, ['listeners', eventName, guidFor(target)], writable);
+}
+
+// Gets the set of all targets, keyed on the guid of each action's
+// target property.
+/** @private */
+function targetSetFor(obj, eventName) {
+ var listenerSet = meta(obj, false).listeners;
+ if (!listenerSet) { return false; }
+
+ return listenerSet[eventName] || false;
+}
+
+// TODO: This knowledge should really be a part of the
+// meta system.
+var SKIP_PROPERTIES = { __ember_source__: true };
+
+/** @private */
+function iterateSet(obj, eventName, callback, params) {
+ var targetSet = targetSetFor(obj, eventName);
+ if (!targetSet) { return false; }
+ // Iterate through all elements of the target set
+ for(var targetGuid in targetSet) {
+ if (SKIP_PROPERTIES[targetGuid]) { continue; }
+
+ var actionSet = targetSet[targetGuid];
+ if (actionSet) {
+ // Iterate through the elements of the action set
+ for(var methodGuid in actionSet) {
+ if (SKIP_PROPERTIES[methodGuid]) { continue; }
+
+ var action = actionSet[methodGuid];
+ if (action) {
+ if (callback(action, params, obj) === true) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
+
+/** @private */
+function invokeAction(action, params, sender) {
+ var method = action.method, target = action.target;
+ // If there is no target, the target is the object
+ // on which the event was fired.
+ if (!target) { target = sender; }
+ if ('string' === typeof method) { method = target[method]; }
+ if (params) {
+ method.apply(target, params);
+ } else {
+ method.apply(target);
+ }
+}
+
+/**
+ The sendEvent arguments > 2 are passed to an event listener.
+
+ @memberOf Ember
+*/
+function addListener(obj, eventName, target, method) {
+ Ember.assert("You must pass at least an object and event name to Ember.addListener", !!obj && !!eventName);
+
+ if (!method && 'function' === typeof target) {
+ method = target;
+ target = null;
+ }
+
+ var actionSet = actionSetFor(obj, eventName, target, true),
+ methodGuid = guidFor(method);
+
+ if (!actionSet[methodGuid]) {
+ actionSet[methodGuid] = { target: target, method: method };
+ }
+
+ if ('function' === typeof obj.didAddListener) {
+ obj.didAddListener(eventName, target, method);
+ }
+}
+
+/** @memberOf Ember */
+function removeListener(obj, eventName, target, method) {
+ Ember.assert("You must pass at least an object and event name to Ember.removeListener", !!obj && !!eventName);
+
+ if (!method && 'function' === typeof target) {
+ method = target;
+ target = null;
+ }
+
+ var actionSet = actionSetFor(obj, eventName, target, true),
+ methodGuid = guidFor(method);
+
+ // we can't simply delete this parameter, because if we do, we might
+ // re-expose the property from the prototype chain.
+ if (actionSet && actionSet[methodGuid]) { actionSet[methodGuid] = null; }
+
+ if ('function' === typeof obj.didRemoveListener) {
+ obj.didRemoveListener(eventName, target, method);
+ }
+}
+
+// Suspend listener during callback.
+//
+// This should only be used by the target of the event listener
+// when it is taking an action that would cause the event, e.g.
+// an object might suspend its property change listener while it is
+// setting that property.
+/** @private */
+function suspendListener(obj, eventName, target, method, callback) {
+ if (!method && 'function' === typeof target) {
+ method = target;
+ target = null;
+ }
+
+ var actionSet = actionSetFor(obj, eventName, target, true),
+ methodGuid = guidFor(method),
+ action = actionSet && actionSet[methodGuid];
+
+ actionSet[methodGuid] = null;
+ try {
+ return callback.call(target);
+ } finally {
+ actionSet[methodGuid] = action;
+ }
+}
+
+// returns a list of currently watched events
+/** @memberOf Ember */
+function watchedEvents(obj) {
+ var listeners = meta(obj, false).listeners, ret = [];
+
+ if (listeners) {
+ for(var eventName in listeners) {
+ if (!SKIP_PROPERTIES[eventName] && listeners[eventName]) {
+ ret.push(eventName);
+ }
+ }
+ }
+ return ret;
+}
+
+/** @memberOf Ember */
+function sendEvent(obj, eventName, params) {
+ // first give object a chance to handle it
+ if (obj !== Ember && 'function' === typeof obj.sendEvent) {
+ obj.sendEvent(eventName, params);
+ }
+
+ iterateSet(obj, eventName, invokeAction, params);
+ return true;
+}
+
+/** @memberOf Ember */
+function deferEvent(obj, eventName, params) {
+ var actions = [];
+ iterateSet(obj, eventName, function (action) {
+ actions.push(action);
+ });
+
+ return function() {
+ if (obj.isDestroyed) { return; }
+
+ if (obj !== Ember && 'function' === typeof obj.sendEvent) {
+ obj.sendEvent(eventName, params);
+ }
+
+ for (var i=0, len=actions.length; i < len; ++i) {
+ invokeAction(actions[i], params, obj);
+ }
+ };
+}
+
+/** @memberOf Ember */
+function hasListeners(obj, eventName) {
+ if (iterateSet(obj, eventName, function() { return true; })) {
+ return true;
+ }
+
+ // no listeners! might as well clean this up so it is faster later.
+ var set = metaPath(obj, ['listeners'], true);
+ set[eventName] = null;
+
+ return false;
+}
+
+/** @memberOf Ember */
+function listenersFor(obj, eventName) {
+ var ret = [];
+ iterateSet(obj, eventName, function (action) {
+ ret.push([action.target, action.method]);
+ });
+ return ret;
+}
+
+Ember.addListener = addListener;
+Ember.removeListener = removeListener;
+Ember._suspendListener = suspendListener;
+Ember.sendEvent = sendEvent;
+Ember.hasListeners = hasListeners;
+Ember.watchedEvents = watchedEvents;
+Ember.listenersFor = listenersFor;
+Ember.deferEvent = deferEvent;
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2010 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+// Ember.Logger
+// Ember.watch.flushPending
+// Ember.beginPropertyChanges, Ember.endPropertyChanges
+// Ember.guidFor
+
+// ..........................................................
+// HELPERS
+//
+
+var slice = [].slice,
+ forEach = Ember.ArrayPolyfills.forEach;
+
+// invokes passed params - normalizing so you can pass target/func,
+// target/string or just func
+/** @private */
+function invoke(target, method, args, ignore) {
+
+ if (method === undefined) {
+ method = target;
+ target = undefined;
+ }
+
+ if ('string' === typeof method) { method = target[method]; }
+ if (args && ignore > 0) {
+ args = args.length > ignore ? slice.call(args, ignore) : null;
+ }
+
+ // Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,
+ // so in the event that we don't have an `onerror` handler we don't wrap in a try/catch
+ if ('function' === typeof Ember.onerror) {
+ try {
+ // IE8's Function.prototype.apply doesn't accept undefined/null arguments.
+ return method.apply(target || this, args || []);
+ } catch (error) {
+ Ember.onerror(error);
+ }
+ } else {
+ // IE8's Function.prototype.apply doesn't accept undefined/null arguments.
+ return method.apply(target || this, args || []);
+ }
+}
+
+
+// ..........................................................
+// RUNLOOP
+//
+
+var timerMark; // used by timers...
+
+/** @private */
+var RunLoop = function(prev) {
+ this._prev = prev || null;
+ this.onceTimers = {};
+};
+
+RunLoop.prototype = {
+ end: function() {
+ this.flush();
+ },
+
+ prev: function() {
+ return this._prev;
+ },
+
+ // ..........................................................
+ // Delayed Actions
+ //
+
+ schedule: function(queueName, target, method) {
+ var queues = this._queues, queue;
+ if (!queues) { queues = this._queues = {}; }
+ queue = queues[queueName];
+ if (!queue) { queue = queues[queueName] = []; }
+
+ var args = arguments.length > 3 ? slice.call(arguments, 3) : null;
+ queue.push({ target: target, method: method, args: args });
+ return this;
+ },
+
+ flush: function(queueName) {
+ var queueNames, idx, len, queue, log;
+
+ if (!this._queues) { return this; } // nothing to do
+
+ function iter(item) {
+ invoke(item.target, item.method, item.args);
+ }
+
+ Ember.watch.flushPending(); // make sure all chained watchers are setup
+
+ if (queueName) {
+ while (this._queues && (queue = this._queues[queueName])) {
+ this._queues[queueName] = null;
+
+ // the sync phase is to allow property changes to propagate. don't
+ // invoke observers until that is finished.
+ if (queueName === 'sync') {
+ log = Ember.LOG_BINDINGS;
+ if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }
+
+ Ember.beginPropertyChanges();
+ try {
+ forEach.call(queue, iter);
+ } finally {
+ Ember.endPropertyChanges();
+ }
+
+ if (log) { Ember.Logger.log('End: Flush Sync Queue'); }
+
+ } else {
+ forEach.call(queue, iter);
+ }
+ }
+
+ } else {
+ queueNames = Ember.run.queues;
+ len = queueNames.length;
+ idx = 0;
+
+ outerloop:
+ while (idx < len) {
+ queueName = queueNames[idx];
+ queue = this._queues && this._queues[queueName];
+ delete this._queues[queueName];
+
+ if (queue) {
+ // the sync phase is to allow property changes to propagate. don't
+ // invoke observers until that is finished.
+ if (queueName === 'sync') {
+ log = Ember.LOG_BINDINGS;
+ if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }
+
+ Ember.beginPropertyChanges();
+ try {
+ forEach.call(queue, iter);
+ } finally {
+ Ember.endPropertyChanges();
+ }
+
+ if (log) { Ember.Logger.log('End: Flush Sync Queue'); }
+ } else {
+ forEach.call(queue, iter);
+ }
+ }
+
+ // Loop through prior queues
+ for (var i = 0; i <= idx; i++) {
+ if (this._queues && this._queues[queueNames[i]]) {
+ // Start over at the first queue with contents
+ idx = i;
+ continue outerloop;
+ }
+ }
+
+ idx++;
+ }
+ }
+
+ timerMark = null;
+
+ return this;
+ }
+
+};
+
+Ember.RunLoop = RunLoop;
+
+// ..........................................................
+// Ember.run - this is ideally the only public API the dev sees
+//
+/**
+* @namespace Ember.run is both a function and a namespace for
+* RunLoop-related functions.
+* @name Ember.run
+*/
+
+/**
+ Runs the passed target and method inside of a RunLoop, ensuring any
+ deferred actions including bindings and views updates are flushed at the
+ end.
+
+ Normally you should not need to invoke this method yourself. However if
+ you are implementing raw event handlers when interfacing with other
+ libraries or plugins, you should probably wrap all of your code inside this
+ call.
+
+ Ember.run(function(){
+ // code to be execute within a RunLoop
+ });
+
+ @name run
+ @methodOf Ember.run
+ @param {Object} target
+ (Optional) target of method to call
+
+ @param {Function|String} method
+ Method to invoke. May be a function or a string. If you pass a string
+ then it will be looked up on the passed target.
+
+ @param {Object...} args
+ Any additional arguments you wish to pass to the method.
+
+ @returns {Object} return value from invoking the passed function.
+*/
+Ember.run = function(target, method) {
+ var ret, loop;
+ run.begin();
+ try {
+ if (target || method) { ret = invoke(target, method, arguments, 2); }
+ } finally {
+ run.end();
+ }
+ return ret;
+};
+
+/** @private */
+var run = Ember.run;
+
+
+/**
+ Begins a new RunLoop. Any deferred actions invoked after the begin will
+ be buffered until you invoke a matching call to Ember.run.end(). This is
+ an lower-level way to use a RunLoop instead of using Ember.run().
+
+ Ember.run.begin();
+ // code to be execute within a RunLoop
+ Ember.run.end();
+
+
+ @returns {void}
+*/
+Ember.run.begin = function() {
+ run.currentRunLoop = new RunLoop(run.currentRunLoop);
+};
+
+/**
+ Ends a RunLoop. This must be called sometime after you call Ember.run.begin()
+ to flush any deferred actions. This is a lower-level way to use a RunLoop
+ instead of using Ember.run().
+
+ Ember.run.begin();
+ // code to be execute within a RunLoop
+ Ember.run.end();
+
+ @returns {void}
+*/
+Ember.run.end = function() {
+ Ember.assert('must have a current run loop', run.currentRunLoop);
+ try {
+ run.currentRunLoop.end();
+ }
+ finally {
+ run.currentRunLoop = run.currentRunLoop.prev();
+ }
+};
+
+/**
+ Array of named queues. This array determines the order in which queues
+ are flushed at the end of the RunLoop. You can define your own queues by
+ simply adding the queue name to this array. Normally you should not need
+ to inspect or modify this property.
+
+ @type Array
+ @default ['sync', 'actions', 'destroy', 'timers']
+*/
+Ember.run.queues = ['sync', 'actions', 'destroy', 'timers'];
+
+/**
+ Adds the passed target/method and any optional arguments to the named
+ queue to be executed at the end of the RunLoop. If you have not already
+ started a RunLoop when calling this method one will be started for you
+ automatically.
+
+ At the end of a RunLoop, any methods scheduled in this way will be invoked.
+ Methods will be invoked in an order matching the named queues defined in
+ the run.queues property.
+
+ Ember.run.schedule('timers', this, function(){
+ // this will be executed at the end of the RunLoop, when timers are run
+ console.log("scheduled on timers queue");
+ });
+ Ember.run.schedule('sync', this, function(){
+ // this will be executed at the end of the RunLoop, when bindings are synced
+ console.log("scheduled on sync queue");
+ });
+ // Note the functions will be run in order based on the run queues order. Output would be:
+ // scheduled on sync queue
+ // scheduled on timers queue
+
+ @param {String} queue
+ The name of the queue to schedule against. Default queues are 'sync' and
+ 'actions'
+
+ @param {Object} target
+ (Optional) target object to use as the context when invoking a method.
+
+ @param {String|Function} method
+ The method to invoke. If you pass a string it will be resolved on the
+ target object at the time the scheduled item is invoked allowing you to
+ change the target function.
+
+ @param {Object} arguments...
+ Optional arguments to be passed to the queued method.
+
+ @returns {void}
+*/
+Ember.run.schedule = function(queue, target, method) {
+ var loop = run.autorun();
+ loop.schedule.apply(loop, arguments);
+};
+
+var scheduledAutorun;
+/** @private */
+function autorun() {
+ scheduledAutorun = null;
+ if (run.currentRunLoop) { run.end(); }
+}
+
+// Used by global test teardown
+/** @private */
+Ember.run.hasScheduledTimers = function() {
+ return !!(scheduledAutorun || scheduledLater || scheduledNext);
+};
+
+// Used by global test teardown
+/** @private */
+Ember.run.cancelTimers = function () {
+ if (scheduledAutorun) {
+ clearTimeout(scheduledAutorun);
+ scheduledAutorun = null;
+ }
+ if (scheduledLater) {
+ clearTimeout(scheduledLater);
+ scheduledLater = null;
+ }
+ if (scheduledNext) {
+ clearTimeout(scheduledNext);
+ scheduledNext = null;
+ }
+ timers = {};
+};
+
+/**
+ Begins a new RunLoop if necessary and schedules a timer to flush the
+ RunLoop at a later time. This method is used by parts of Ember to
+ ensure the RunLoop always finishes. You normally do not need to call this
+ method directly. Instead use Ember.run().
+
+ Ember.run.autorun();
+
+ @returns {Ember.RunLoop} the new current RunLoop
+*/
+Ember.run.autorun = function() {
+ if (!run.currentRunLoop) {
+ Ember.assert("You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run", !Ember.testing);
+
+ run.begin();
+
+ if (!scheduledAutorun) {
+ scheduledAutorun = setTimeout(autorun, 1);
+ }
+ }
+
+ return run.currentRunLoop;
+};
+
+/**
+ Immediately flushes any events scheduled in the 'sync' queue. Bindings
+ use this queue so this method is a useful way to immediately force all
+ bindings in the application to sync.
+
+ You should call this method anytime you need any changed state to propagate
+ throughout the app immediately without repainting the UI.
+
+ Ember.run.sync();
+
+ @returns {void}
+*/
+Ember.run.sync = function() {
+ run.autorun();
+ run.currentRunLoop.flush('sync');
+};
+
+// ..........................................................
+// TIMERS
+//
+
+var timers = {}; // active timers...
+
+var scheduledLater;
+/** @private */
+function invokeLaterTimers() {
+ scheduledLater = null;
+ var now = (+ new Date()), earliest = -1;
+ for (var key in timers) {
+ if (!timers.hasOwnProperty(key)) { continue; }
+ var timer = timers[key];
+ if (timer && timer.expires) {
+ if (now >= timer.expires) {
+ delete timers[key];
+ invoke(timer.target, timer.method, timer.args, 2);
+ } else {
+ if (earliest<0 || (timer.expires < earliest)) earliest=timer.expires;
+ }
+ }
+ }
+
+ // schedule next timeout to fire...
+ if (earliest > 0) { scheduledLater = setTimeout(invokeLaterTimers, earliest-(+ new Date())); }
+}
+
+/**
+ Invokes the passed target/method and optional arguments after a specified
+ period if time. The last parameter of this method must always be a number
+ of milliseconds.
+
+ You should use this method whenever you need to run some action after a
+ period of time instead of using setTimeout(). This method will ensure that
+ items that expire during the same script execution cycle all execute
+ together, which is often more efficient than using a real setTimeout.
+
+ Ember.run.later(myContext, function(){
+ // code here will execute within a RunLoop in about 500ms with this == myContext
+ }, 500);
+
+ @param {Object} target
+ (optional) target of method to invoke
+
+ @param {Function|String} method
+ The method to invoke. If you pass a string it will be resolved on the
+ target at the time the method is invoked.
+
+ @param {Object...} args
+ Optional arguments to pass to the timeout.
+
+ @param {Number} wait
+ Number of milliseconds to wait.
+
+ @returns {String} a string you can use to cancel the timer in Ember.run.cancel() later.
+*/
+Ember.run.later = function(target, method) {
+ var args, expires, timer, guid, wait;
+
+ // setTimeout compatibility...
+ if (arguments.length===2 && 'function' === typeof target) {
+ wait = method;
+ method = target;
+ target = undefined;
+ args = [target, method];
+ } else {
+ args = slice.call(arguments);
+ wait = args.pop();
+ }
+
+ expires = (+ new Date()) + wait;
+ timer = { target: target, method: method, expires: expires, args: args };
+ guid = Ember.guidFor(timer);
+ timers[guid] = timer;
+ run.once(timers, invokeLaterTimers);
+ return guid;
+};
+
+/** @private */
+function invokeOnceTimer(guid, onceTimers) {
+ if (onceTimers[this.tguid]) { delete onceTimers[this.tguid][this.mguid]; }
+ if (timers[guid]) { invoke(this.target, this.method, this.args, 2); }
+ delete timers[guid];
+}
+
+/**
+ Schedules an item to run one time during the current RunLoop. Calling
+ this method with the same target/method combination will have no effect.
+
+ Note that although you can pass optional arguments these will not be
+ considered when looking for duplicates. New arguments will replace previous
+ calls.
+
+ Ember.run(function(){
+ var doFoo = function() { foo(); }
+ Ember.run.once(myContext, doFoo);
+ Ember.run.once(myContext, doFoo);
+ // doFoo will only be executed once at the end of the RunLoop
+ });
+
+ @param {Object} target
+ (optional) target of method to invoke
+
+ @param {Function|String} method
+ The method to invoke. If you pass a string it will be resolved on the
+ target at the time the method is invoked.
+
+ @param {Object...} args
+ Optional arguments to pass to the timeout.
+
+
+ @returns {Object} timer
+*/
+Ember.run.once = function(target, method) {
+ var tguid = Ember.guidFor(target),
+ mguid = Ember.guidFor(method),
+ onceTimers = run.autorun().onceTimers,
+ guid = onceTimers[tguid] && onceTimers[tguid][mguid],
+ timer;
+
+ if (guid && timers[guid]) {
+ timers[guid].args = slice.call(arguments); // replace args
+ } else {
+ timer = {
+ target: target,
+ method: method,
+ args: slice.call(arguments),
+ tguid: tguid,
+ mguid: mguid
+ };
+
+ guid = Ember.guidFor(timer);
+ timers[guid] = timer;
+ if (!onceTimers[tguid]) { onceTimers[tguid] = {}; }
+ onceTimers[tguid][mguid] = guid; // so it isn't scheduled more than once
+
+ run.schedule('actions', timer, invokeOnceTimer, guid, onceTimers);
+ }
+
+ return guid;
+};
+
+var scheduledNext;
+/** @private */
+function invokeNextTimers() {
+ scheduledNext = null;
+ for(var key in timers) {
+ if (!timers.hasOwnProperty(key)) { continue; }
+ var timer = timers[key];
+ if (timer.next) {
+ delete timers[key];
+ invoke(timer.target, timer.method, timer.args, 2);
+ }
+ }
+}
+
+/**
+ Schedules an item to run after control has been returned to the system.
+ This is often equivalent to calling setTimeout(function...,1).
+
+ Ember.run.next(myContext, function(){
+ // code to be executed in the next RunLoop, which will be scheduled after the current one
+ });
+
+ @param {Object} target
+ (optional) target of method to invoke
+
+ @param {Function|String} method
+ The method to invoke. If you pass a string it will be resolved on the
+ target at the time the method is invoked.
+
+ @param {Object...} args
+ Optional arguments to pass to the timeout.
+
+ @returns {Object} timer
+*/
+Ember.run.next = function(target, method) {
+ var guid,
+ timer = {
+ target: target,
+ method: method,
+ args: slice.call(arguments),
+ next: true
+ };
+
+ guid = Ember.guidFor(timer);
+ timers[guid] = timer;
+
+ if (!scheduledNext) { scheduledNext = setTimeout(invokeNextTimers, 1); }
+ return guid;
+};
+
+/**
+ Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,
+ `Ember.run.once()`, or `Ember.run.next()`.
+
+ var runNext = Ember.run.next(myContext, function(){
+ // will not be executed
+ });
+ Ember.run.cancel(runNext);
+
+ var runLater = Ember.run.later(myContext, function(){
+ // will not be executed
+ }, 500);
+ Ember.run.cancel(runLater);
+
+ var runOnce = Ember.run.once(myContext, function(){
+ // will not be executed
+ });
+ Ember.run.cancel(runOnce);
+
+ @param {Object} timer
+ Timer object to cancel
+
+ @returns {void}
+*/
+Ember.run.cancel = function(timer) {
+ delete timers[timer];
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+// Ember.Logger
+// get, set, trySet
+// guidFor, isArray, meta
+// addObserver, removeObserver
+// Ember.run.schedule
+// ..........................................................
+// CONSTANTS
+//
+
+/**
+ @static
+
+ Debug parameter you can turn on. This will log all bindings that fire to
+ the console. This should be disabled in production code. Note that you
+ can also enable this from the console or temporarily.
+
+ @type Boolean
+ @default false
+*/
+Ember.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;
+
+var get = Ember.get,
+ set = Ember.set,
+ guidFor = Ember.guidFor,
+ isGlobalPath = Ember.isGlobalPath;
+
+
+/** @private */
+function getWithGlobals(obj, path) {
+ return get(isGlobalPath(path) ? window : obj, path);
+}
+
+// ..........................................................
+// BINDING
+//
+
+/** @private */
+var Binding = function(toPath, fromPath) {
+ this._direction = 'fwd';
+ this._from = fromPath;
+ this._to = toPath;
+ this._directionMap = Ember.Map.create();
+};
+
+Binding.prototype = /** @scope Ember.Binding.prototype */ {
+ /**
+ This copies the Binding so it can be connected to another object.
+ @returns {Ember.Binding}
+ */
+ copy: function () {
+ var copy = new Binding(this._to, this._from);
+ if (this._oneWay) { copy._oneWay = true; }
+ return copy;
+ },
+
+ // ..........................................................
+ // CONFIG
+ //
+
+ /**
+ This will set "from" property path to the specified value. It will not
+ attempt to resolve this property path to an actual object until you
+ connect the binding.
+
+ The binding will search for the property path starting at the root object
+ you pass when you connect() the binding. It follows the same rules as
+ `get()` - see that method for more information.
+
+ @param {String} propertyPath the property path to connect to
+ @returns {Ember.Binding} receiver
+ */
+ from: function(path) {
+ this._from = path;
+ return this;
+ },
+
+ /**
+ This will set the "to" property path to the specified value. It will not
+ attempt to resolve this property path to an actual object until you
+ connect the binding.
+
+ The binding will search for the property path starting at the root object
+ you pass when you connect() the binding. It follows the same rules as
+ `get()` - see that method for more information.
+
+ @param {String|Tuple} propertyPath A property path or tuple
+ @returns {Ember.Binding} this
+ */
+ to: function(path) {
+ this._to = path;
+ return this;
+ },
+
+ /**
+ Configures the binding as one way. A one-way binding will relay changes
+ on the "from" side to the "to" side, but not the other way around. This
+ means that if you change the "to" side directly, the "from" side may have
+ a different value.
+
+ @returns {Ember.Binding} receiver
+ */
+ oneWay: function() {
+ this._oneWay = true;
+ return this;
+ },
+
+ /** @private */
+ toString: function() {
+ var oneWay = this._oneWay ? '[oneWay]' : '';
+ return "Ember.Binding<" + guidFor(this) + ">(" + this._from + " -> " + this._to + ")" + oneWay;
+ },
+
+ // ..........................................................
+ // CONNECT AND SYNC
+ //
+
+ /**
+ Attempts to connect this binding instance so that it can receive and relay
+ changes. This method will raise an exception if you have not set the
+ from/to properties yet.
+
+ @param {Object} obj The root object for this binding.
+ @returns {Ember.Binding} this
+ */
+ connect: function(obj) {
+ Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
+
+ var fromPath = this._from, toPath = this._to;
+ Ember.trySet(obj, toPath, getWithGlobals(obj, fromPath));
+
+ // add an observer on the object to be notified when the binding should be updated
+ Ember.addObserver(obj, fromPath, this, this.fromDidChange);
+
+ // if the binding is a two-way binding, also set up an observer on the target
+ if (!this._oneWay) { Ember.addObserver(obj, toPath, this, this.toDidChange); }
+
+ this._readyToSync = true;
+
+ return this;
+ },
+
+ /**
+ Disconnects the binding instance. Changes will no longer be relayed. You
+ will not usually need to call this method.
+
+ @param {Object} obj
+ The root object you passed when connecting the binding.
+
+ @returns {Ember.Binding} this
+ */
+ disconnect: function(obj) {
+ Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);
+
+ var twoWay = !this._oneWay;
+
+ // remove an observer on the object so we're no longer notified of
+ // changes that should update bindings.
+ Ember.removeObserver(obj, this._from, this, this.fromDidChange);
+
+ // if the binding is two-way, remove the observer from the target as well
+ if (twoWay) { Ember.removeObserver(obj, this._to, this, this.toDidChange); }
+
+ this._readyToSync = false; // disable scheduled syncs...
+ return this;
+ },
+
+ // ..........................................................
+ // PRIVATE
+ //
+
+ /** @private - called when the from side changes */
+ fromDidChange: function(target) {
+ this._scheduleSync(target, 'fwd');
+ },
+
+ /** @private - called when the to side changes */
+ toDidChange: function(target) {
+ this._scheduleSync(target, 'back');
+ },
+
+ /** @private */
+ _scheduleSync: function(obj, dir) {
+ var directionMap = this._directionMap;
+ var existingDir = directionMap.get(obj);
+
+ // if we haven't scheduled the binding yet, schedule it
+ if (!existingDir) {
+ Ember.run.schedule('sync', this, this._sync, obj);
+ directionMap.set(obj, dir);
+ }
+
+ // If both a 'back' and 'fwd' sync have been scheduled on the same object,
+ // default to a 'fwd' sync so that it remains deterministic.
+ if (existingDir === 'back' && dir === 'fwd') {
+ directionMap.set(obj, 'fwd');
+ }
+ },
+
+ /** @private */
+ _sync: function(obj) {
+ var log = Ember.LOG_BINDINGS;
+
+ // don't synchronize destroyed objects or disconnected bindings
+ if (obj.isDestroyed || !this._readyToSync) { return; }
+
+ // get the direction of the binding for the object we are
+ // synchronizing from
+ var directionMap = this._directionMap;
+ var direction = directionMap.get(obj);
+
+ var fromPath = this._from, toPath = this._to;
+
+ directionMap.remove(obj);
+
+ // if we're synchronizing from the remote object...
+ if (direction === 'fwd') {
+ var fromValue = getWithGlobals(obj, this._from);
+ if (log) {
+ Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);
+ }
+ if (this._oneWay) {
+ Ember.trySet(obj, toPath, fromValue);
+ } else {
+ Ember._suspendObserver(obj, toPath, this, this.toDidChange, function () {
+ Ember.trySet(obj, toPath, fromValue);
+ });
+ }
+ // if we're synchronizing *to* the remote object
+ } else if (direction === 'back') {
+ var toValue = get(obj, this._to);
+ if (log) {
+ Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);
+ }
+ Ember._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {
+ Ember.trySet(Ember.isGlobalPath(fromPath) ? window : obj, fromPath, toValue);
+ });
+ }
+ }
+
+};
+
+/** @private */
+function mixinProperties(to, from) {
+ for (var key in from) {
+ if (from.hasOwnProperty(key)) {
+ to[key] = from[key];
+ }
+ }
+}
+
+mixinProperties(Binding,
+/** @scope Ember.Binding */ {
+
+ /**
+ @see Ember.Binding.prototype.from
+ */
+ from: function() {
+ var C = this, binding = new C();
+ return binding.from.apply(binding, arguments);
+ },
+
+ /**
+ @see Ember.Binding.prototype.to
+ */
+ to: function() {
+ var C = this, binding = new C();
+ return binding.to.apply(binding, arguments);
+ },
+
+ /**
+ Creates a new Binding instance and makes it apply in a single direction.
+ A one-way binding will relay changes on the "from" side object (supplies
+ as the `from` argument) the "to" side, but not the other way around.
+ This means that if you change the "to" side directly, the "from" side may have
+ a different value.
+
+ @param {String} from from path.
+ @param {Boolean} [flag] (Optional) passing nothing here will make the binding oneWay. You can
+ instead pass false to disable oneWay, making the binding two way again.
+
+ @see Ember.Binding.prototype.oneWay
+ */
+ oneWay: function(from, flag) {
+ var C = this, binding = new C(null, from);
+ return binding.oneWay(flag);
+ }
+
+});
+
+/**
+ @class
+
+ An Ember.Binding connects the properties of two objects so that whenever the
+ value of one property changes, the other property will be changed also.
+
+ ## Automatic Creation of Bindings with `/^*Binding/`-named Properties
+ You do not usually create Binding objects directly but instead describe
+ bindings in your class or object definition using automatic binding detection.
+
+ Properties ending in a `Binding` suffix will be converted to Ember.Binding instances.
+ The value of this property should be a string representing a path to another object or
+ a custom binding instanced created using Binding helpers (see "Customizing Your Bindings"):
+
+ valueBinding: "MyApp.someController.title"
+
+ This will create a binding from `MyApp.someController.title` to the `value`
+ property of your object instance automatically. Now the two values will be
+ kept in sync.
+
+ ## One Way Bindings
+
+ One especially useful binding customization you can use is the `oneWay()`
+ helper. This helper tells Ember that you are only interested in
+ receiving changes on the object you are binding from. For example, if you
+ are binding to a preference and you want to be notified if the preference
+ has changed, but your object will not be changing the preference itself, you
+ could do:
+
+ bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles")
+
+ This way if the value of MyApp.preferencesController.bigTitles changes the
+ "bigTitles" property of your object will change also. However, if you
+ change the value of your "bigTitles" property, it will not update the
+ preferencesController.
+
+ One way bindings are almost twice as fast to setup and twice as fast to
+ execute because the binding only has to worry about changes to one side.
+
+ You should consider using one way bindings anytime you have an object that
+ may be created frequently and you do not intend to change a property; only
+ to monitor it for changes. (such as in the example above).
+
+ ## Adding Bindings Manually
+
+ All of the examples above show you how to configure a custom binding, but
+ the result of these customizations will be a binding template, not a fully
+ active Binding instance. The binding will actually become active only when you
+ instantiate the object the binding belongs to. It is useful however, to
+ understand what actually happens when the binding is activated.
+
+ For a binding to function it must have at least a "from" property and a "to"
+ property. The from property path points to the object/key that you want to
+ bind from while the to path points to the object/key you want to bind to.
+
+ When you define a custom binding, you are usually describing the property
+ you want to bind from (such as "MyApp.someController.value" in the examples
+ above). When your object is created, it will automatically assign the value
+ you want to bind "to" based on the name of your binding key. In the
+ examples above, during init, Ember objects will effectively call
+ something like this on your binding:
+
+ binding = Ember.Binding.from(this.valueBinding).to("value");
+
+ This creates a new binding instance based on the template you provide, and
+ sets the to path to the "value" property of the new object. Now that the
+ binding is fully configured with a "from" and a "to", it simply needs to be
+ connected to become active. This is done through the connect() method:
+
+ binding.connect(this);
+
+ Note that when you connect a binding you pass the object you want it to be
+ connected to. This object will be used as the root for both the from and
+ to side of the binding when inspecting relative paths. This allows the
+ binding to be automatically inherited by subclassed objects as well.
+
+ Now that the binding is connected, it will observe both the from and to side
+ and relay changes.
+
+ If you ever needed to do so (you almost never will, but it is useful to
+ understand this anyway), you could manually create an active binding by
+ using the Ember.bind() helper method. (This is the same method used by
+ to setup your bindings on objects):
+
+ Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value");
+
+ Both of these code fragments have the same effect as doing the most friendly
+ form of binding creation like so:
+
+ MyApp.anotherObject = Ember.Object.create({
+ valueBinding: "MyApp.someController.value",
+
+ // OTHER CODE FOR THIS OBJECT...
+
+ });
+
+ Ember's built in binding creation method makes it easy to automatically
+ create bindings for you. You should always use the highest-level APIs
+ available, even if you understand how it works underneath.
+
+ @since Ember 0.9
+*/
+Ember.Binding = Binding;
+
+/**
+ Global helper method to create a new binding. Just pass the root object
+ along with a to and from path to create and connect the binding.
+
+ @param {Object} obj
+ The root object of the transform.
+
+ @param {String} to
+ The path to the 'to' side of the binding. Must be relative to obj.
+
+ @param {String} from
+ The path to the 'from' side of the binding. Must be relative to obj or
+ a global path.
+
+ @returns {Ember.Binding} binding instance
+*/
+Ember.bind = function(obj, to, from) {
+ return new Ember.Binding(to, from).connect(obj);
+};
+
+Ember.oneWay = function(obj, to, from) {
+ return new Ember.Binding(to, from).oneWay().connect(obj);
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var Mixin, REQUIRED, Alias,
+ classToString, superClassString,
+ a_map = Ember.ArrayPolyfills.map,
+ a_indexOf = Ember.ArrayPolyfills.indexOf,
+ a_forEach = Ember.ArrayPolyfills.forEach,
+ a_slice = [].slice,
+ EMPTY_META = {}, // dummy for non-writable meta
+ META_SKIP = { __emberproto__: true, __ember_count__: true },
+ o_create = Ember.create,
+ defineProperty = Ember.defineProperty,
+ guidFor = Ember.guidFor;
+
+/** @private */
+function mixinsMeta(obj) {
+ var m = Ember.meta(obj, true), ret = m.mixins;
+ if (!ret) {
+ ret = m.mixins = { __emberproto__: obj };
+ } else if (ret.__emberproto__ !== obj) {
+ ret = m.mixins = o_create(ret);
+ ret.__emberproto__ = obj;
+ }
+ return ret;
+}
+
+/** @private */
+function initMixin(mixin, args) {
+ if (args && args.length > 0) {
+ mixin.mixins = a_map.call(args, function(x) {
+ if (x instanceof Mixin) { return x; }
+
+ // Note: Manually setup a primitive mixin here. This is the only
+ // way to actually get a primitive mixin. This way normal creation
+ // of mixins will give you combined mixins...
+ var mixin = new Mixin();
+ mixin.properties = x;
+ return mixin;
+ });
+ }
+ return mixin;
+}
+
+/** @private */
+function isMethod(obj) {
+ return 'function' === typeof obj &&
+ obj.isMethod !== false &&
+ obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;
+}
+
+/** @private */
+function mergeMixins(mixins, m, descs, values, base) {
+ var len = mixins.length, idx, mixin, guid, props, value, key, ovalue, concats;
+
+ /** @private */
+ function removeKeys(keyName) {
+ delete descs[keyName];
+ delete values[keyName];
+ }
+
+ for(idx=0; idx < len; idx++) {
+ mixin = mixins[idx];
+ Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');
+
+ if (mixin instanceof Mixin) {
+ guid = guidFor(mixin);
+ if (m[guid]) { continue; }
+ m[guid] = mixin;
+ props = mixin.properties;
+ } else {
+ props = mixin; // apply anonymous mixin properties
+ }
+
+ if (props) {
+ // reset before adding each new mixin to pickup concats from previous
+ concats = values.concatenatedProperties || base.concatenatedProperties;
+ if (props.concatenatedProperties) {
+ concats = concats ? concats.concat(props.concatenatedProperties) : props.concatenatedProperties;
+ }
+
+ for (key in props) {
+ if (!props.hasOwnProperty(key)) { continue; }
+ value = props[key];
+ if (value instanceof Ember.Descriptor) {
+ if (value === REQUIRED && descs[key]) { continue; }
+
+ descs[key] = value;
+ values[key] = undefined;
+ } else {
+ // impl super if needed...
+ if (isMethod(value)) {
+ ovalue = descs[key] === undefined && values[key];
+ if (!ovalue) { ovalue = base[key]; }
+ if ('function' !== typeof ovalue) { ovalue = null; }
+ if (ovalue) {
+ var o = value.__ember_observes__, ob = value.__ember_observesBefore__;
+ value = Ember.wrap(value, ovalue);
+ value.__ember_observes__ = o;
+ value.__ember_observesBefore__ = ob;
+ }
+ } else if ((concats && a_indexOf.call(concats, key) >= 0) || key === 'concatenatedProperties') {
+ var baseValue = values[key] || base[key];
+ value = baseValue ? baseValue.concat(value) : Ember.makeArray(value);
+ }
+
+ descs[key] = undefined;
+ values[key] = value;
+ }
+ }
+
+ // manually copy toString() because some JS engines do not enumerate it
+ if (props.hasOwnProperty('toString')) {
+ base.toString = props.toString;
+ }
+
+ } else if (mixin.mixins) {
+ mergeMixins(mixin.mixins, m, descs, values, base);
+ if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }
+ }
+ }
+}
+
+/** @private */
+function writableReq(obj) {
+ var m = Ember.meta(obj), req = m.required;
+ if (!req || req.__emberproto__ !== obj) {
+ req = m.required = req ? o_create(req) : { __ember_count__: 0 };
+ req.__emberproto__ = obj;
+ }
+ return req;
+}
+
+var IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;
+
+/** @private */
+function detectBinding(obj, key, value, m) {
+ if (IS_BINDING.test(key)) {
+ var bindings = m.bindings;
+ if (!bindings) {
+ bindings = m.bindings = { __emberproto__: obj };
+ } else if (bindings.__emberproto__ !== obj) {
+ bindings = m.bindings = o_create(m.bindings);
+ bindings.__emberproto__ = obj;
+ }
+ bindings[key] = value;
+ }
+}
+
+/** @private */
+function connectBindings(obj, m) {
+ // TODO Mixin.apply(instance) should disconnect binding if exists
+ var bindings = m.bindings, key, binding, to;
+ if (bindings) {
+ for (key in bindings) {
+ binding = key !== '__emberproto__' && bindings[key];
+ if (binding) {
+ to = key.slice(0, -7); // strip Binding off end
+ if (binding instanceof Ember.Binding) {
+ binding = binding.copy(); // copy prototypes' instance
+ binding.to(to);
+ } else { // binding is string path
+ binding = new Ember.Binding(to, binding);
+ }
+ binding.connect(obj);
+ obj[key] = binding;
+ }
+ }
+ // mark as applied
+ m.bindings = { __emberproto__: obj };
+ }
+}
+
+function finishPartial(obj, m) {
+ connectBindings(obj, m || Ember.meta(obj));
+ return obj;
+}
+
+/** @private */
+function applyMixin(obj, mixins, partial) {
+ var descs = {}, values = {}, m = Ember.meta(obj), req = m.required,
+ key, value, desc, prevValue, paths, len, idx;
+
+ // Go through all mixins and hashes passed in, and:
+ //
+ // * Handle concatenated properties
+ // * Set up _super wrapping if necessary
+ // * Set up computed property descriptors
+ // * Copying `toString` in broken browsers
+ mergeMixins(mixins, mixinsMeta(obj), descs, values, obj);
+
+ for(key in values) {
+ if (key === 'contructor') { continue; }
+ if (!values.hasOwnProperty(key)) { continue; }
+
+ desc = descs[key];
+ value = values[key];
+
+ if (desc === REQUIRED) {
+ if (!(key in obj)) {
+ Ember.assert('Required property not defined: '+key, !!partial);
+
+ // for partial applies add to hash of required keys
+ req = writableReq(obj);
+ req.__ember_count__++;
+ req[key] = true;
+ }
+ } else {
+ while (desc && desc instanceof Alias) {
+ var altKey = desc.methodName;
+ if (descs[altKey] || values[altKey]) {
+ value = values[altKey];
+ desc = descs[altKey];
+ } else if (m.descs[altKey]) {
+ desc = m.descs[altKey];
+ value = undefined;
+ } else {
+ desc = undefined;
+ value = obj[altKey];
+ }
+ }
+
+ if (desc === undefined && value === undefined) { continue; }
+
+ prevValue = obj[key];
+
+ if ('function' === typeof prevValue) {
+ if ((paths = prevValue.__ember_observesBefore__)) {
+ len = paths.length;
+ for (idx=0; idx < len; idx++) {
+ Ember.removeBeforeObserver(obj, paths[idx], null, key);
+ }
+ } else if ((paths = prevValue.__ember_observes__)) {
+ len = paths.length;
+ for (idx=0; idx < len; idx++) {
+ Ember.removeObserver(obj, paths[idx], null, key);
+ }
+ }
+ }
+
+ detectBinding(obj, key, value, m);
+
+ defineProperty(obj, key, desc, value, m);
+
+ if ('function' === typeof value) {
+ if (paths = value.__ember_observesBefore__) {
+ len = paths.length;
+ for (idx=0; idx < len; idx++) {
+ Ember.addBeforeObserver(obj, paths[idx], null, key);
+ }
+ } else if (paths = value.__ember_observes__) {
+ len = paths.length;
+ for (idx=0; idx < len; idx++) {
+ Ember.addObserver(obj, paths[idx], null, key);
+ }
+ }
+ }
+
+ if (req && req[key]) {
+ req = writableReq(obj);
+ req.__ember_count__--;
+ req[key] = false;
+ }
+ }
+ }
+
+ if (!partial) { // don't apply to prototype
+ finishPartial(obj, m);
+ }
+
+ // Make sure no required attrs remain
+ if (!partial && req && req.__ember_count__>0) {
+ var keys = [];
+ for (key in req) {
+ if (META_SKIP[key]) { continue; }
+ keys.push(key);
+ }
+ // TODO: Remove surrounding if clause from production build
+ Ember.assert('Required properties not defined: '+keys.join(','));
+ }
+ return obj;
+}
+
+Ember.mixin = function(obj) {
+ var args = a_slice.call(arguments, 1);
+ applyMixin(obj, args, false);
+ return obj;
+};
+
+/**
+ @class
+
+ The `Ember.Mixin` class allows you to create mixins, whose properties can be
+ added to other classes. For instance,
+
+ App.Editable = Ember.Mixin.create({
+ edit: function() {
+ console.log('starting to edit');
+ this.set('isEditing', true);
+ },
+ isEditing: false
+ });
+
+ // Mix mixins into classes by passing them as the first arguments to
+ // .extend or .create.
+ App.CommentView = Ember.View.extend(App.Editable, {
+ template: Ember.Handlebars.compile('{{#if isEditing}}...{{else}}...{{/if}}')
+ });
+
+ commentView = App.CommentView.create();
+ commentView.edit(); // => outputs 'starting to edit'
+
+ Note that Mixins are created with `Ember.Mixin.create`, not
+ `Ember.Mixin.extend`.
+*/
+Ember.Mixin = function() { return initMixin(this, arguments); };
+
+/** @private */
+Mixin = Ember.Mixin;
+
+/** @private */
+Mixin._apply = applyMixin;
+
+Mixin.applyPartial = function(obj) {
+ var args = a_slice.call(arguments, 1);
+ return applyMixin(obj, args, true);
+};
+
+Mixin.finishPartial = finishPartial;
+
+Mixin.create = function() {
+ classToString.processed = false;
+ var M = this;
+ return initMixin(new M(), arguments);
+};
+
+var MixinPrototype = Mixin.prototype;
+
+MixinPrototype.reopen = function() {
+ var mixin, tmp;
+
+ if (this.properties) {
+ mixin = Mixin.create();
+ mixin.properties = this.properties;
+ delete this.properties;
+ this.mixins = [mixin];
+ } else if (!this.mixins) {
+ this.mixins = [];
+ }
+
+ var len = arguments.length, mixins = this.mixins, idx;
+
+ for(idx=0; idx < len; idx++) {
+ mixin = arguments[idx];
+ Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');
+
+ if (mixin instanceof Mixin) {
+ mixins.push(mixin);
+ } else {
+ tmp = Mixin.create();
+ tmp.properties = mixin;
+ mixins.push(tmp);
+ }
+ }
+
+ return this;
+};
+
+MixinPrototype.apply = function(obj) {
+ return applyMixin(obj, [this], false);
+};
+
+MixinPrototype.applyPartial = function(obj) {
+ return applyMixin(obj, [this], true);
+};
+
+/** @private */
+function _detect(curMixin, targetMixin, seen) {
+ var guid = guidFor(curMixin);
+
+ if (seen[guid]) { return false; }
+ seen[guid] = true;
+
+ if (curMixin === targetMixin) { return true; }
+ var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;
+ while (--loc >= 0) {
+ if (_detect(mixins[loc], targetMixin, seen)) { return true; }
+ }
+ return false;
+}
+
+MixinPrototype.detect = function(obj) {
+ if (!obj) { return false; }
+ if (obj instanceof Mixin) { return _detect(obj, this, {}); }
+ var mixins = Ember.meta(obj, false).mixins;
+ if (mixins) {
+ return !!mixins[guidFor(this)];
+ }
+ return false;
+};
+
+MixinPrototype.without = function() {
+ var ret = new Mixin(this);
+ ret._without = a_slice.call(arguments);
+ return ret;
+};
+
+/** @private */
+function _keys(ret, mixin, seen) {
+ if (seen[guidFor(mixin)]) { return; }
+ seen[guidFor(mixin)] = true;
+
+ if (mixin.properties) {
+ var props = mixin.properties;
+ for (var key in props) {
+ if (props.hasOwnProperty(key)) { ret[key] = true; }
+ }
+ } else if (mixin.mixins) {
+ a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });
+ }
+}
+
+MixinPrototype.keys = function() {
+ var keys = {}, seen = {}, ret = [];
+ _keys(keys, this, seen);
+ for(var key in keys) {
+ if (keys.hasOwnProperty(key)) { ret.push(key); }
+ }
+ return ret;
+};
+
+/** @private - make Mixin's have nice displayNames */
+
+var NAME_KEY = Ember.GUID_KEY+'_name';
+var get = Ember.get;
+
+/** @private */
+function processNames(paths, root, seen) {
+ var idx = paths.length;
+ for(var key in root) {
+ if (!root.hasOwnProperty || !root.hasOwnProperty(key)) { continue; }
+ var obj = root[key];
+ paths[idx] = key;
+
+ if (obj && obj.toString === classToString) {
+ obj[NAME_KEY] = paths.join('.');
+ } else if (obj && get(obj, 'isNamespace')) {
+ if (seen[guidFor(obj)]) { continue; }
+ seen[guidFor(obj)] = true;
+ processNames(paths, obj, seen);
+ }
+ }
+ paths.length = idx; // cut out last item
+}
+
+/** @private */
+function findNamespaces() {
+ var Namespace = Ember.Namespace, obj, isNamespace;
+
+ if (Namespace.PROCESSED) { return; }
+
+ for (var prop in window) {
+ // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.
+ // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage
+ if (prop === "globalStorage" && window.StorageList && window.globalStorage instanceof window.StorageList) { continue; }
+ // Unfortunately, some versions of IE don't support window.hasOwnProperty
+ if (window.hasOwnProperty && !window.hasOwnProperty(prop)) { continue; }
+
+ // At times we are not allowed to access certain properties for security reasons.
+ // There are also times where even if we can access them, we are not allowed to access their properties.
+ try {
+ obj = window[prop];
+ isNamespace = obj && get(obj, 'isNamespace');
+ } catch (e) {
+ continue;
+ }
+
+ if (isNamespace) {
+ Ember.deprecate("Namespaces should not begin with lowercase.", /^[A-Z]/.test(prop));
+ obj[NAME_KEY] = prop;
+ }
+ }
+}
+
+Ember.identifyNamespaces = findNamespaces;
+
+/** @private */
+superClassString = function(mixin) {
+ var superclass = mixin.superclass;
+ if (superclass) {
+ if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }
+ else { return superClassString(superclass); }
+ } else {
+ return;
+ }
+};
+
+/** @private */
+classToString = function() {
+ var Namespace = Ember.Namespace, namespace;
+
+ // TODO: Namespace should really be in Metal
+ if (Namespace) {
+ if (!this[NAME_KEY] && !classToString.processed) {
+ if (!Namespace.PROCESSED) {
+ findNamespaces();
+ Namespace.PROCESSED = true;
+ }
+
+ classToString.processed = true;
+
+ var namespaces = Namespace.NAMESPACES;
+ for (var i=0, l=namespaces.length; i<l; i++) {
+ namespace = namespaces[i];
+ processNames([namespace.toString()], namespace, {});
+ }
+ }
+ }
+
+ if (this[NAME_KEY]) {
+ return this[NAME_KEY];
+ } else {
+ var str = superClassString(this);
+ if (str) {
+ return "(subclass of " + str + ")";
+ } else {
+ return "(unknown mixin)";
+ }
+ }
+};
+
+MixinPrototype.toString = classToString;
+
+// returns the mixins currently applied to the specified object
+// TODO: Make Ember.mixin
+Mixin.mixins = function(obj) {
+ var ret = [], mixins = Ember.meta(obj, false).mixins, key, mixin;
+ if (mixins) {
+ for(key in mixins) {
+ if (META_SKIP[key]) { continue; }
+ mixin = mixins[key];
+
+ // skip primitive mixins since these are always anonymous
+ if (!mixin.properties) { ret.push(mixins[key]); }
+ }
+ }
+ return ret;
+};
+
+REQUIRED = new Ember.Descriptor();
+REQUIRED.toString = function() { return '(Required Property)'; };
+
+Ember.required = function() {
+ return REQUIRED;
+};
+
+/** @private */
+Alias = function(methodName) {
+ this.methodName = methodName;
+};
+Alias.prototype = new Ember.Descriptor();
+
+Ember.alias = function(methodName) {
+ return new Alias(methodName);
+};
+
+// ..........................................................
+// OBSERVER HELPER
+//
+
+Ember.observer = function(func) {
+ var paths = a_slice.call(arguments, 1);
+ func.__ember_observes__ = paths;
+ return func;
+};
+
+// If observers ever become asynchronous, Ember.immediateObserver
+// must remain synchronous.
+Ember.immediateObserver = function() {
+ for (var i=0, l=arguments.length; i<l; i++) {
+ var arg = arguments[i];
+ Ember.assert("Immediate observers must observe internal properties only, not properties on other objects.", typeof arg !== "string" || arg.indexOf('.') === -1);
+ }
+
+ return Ember.observer.apply(this, arguments);
+};
+
+Ember.beforeObserver = function(func) {
+ var paths = a_slice.call(arguments, 1);
+ func.__ember_observesBefore__ = paths;
+ return func;
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Metal
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+(function() {
+/**
+ * @license
+ * ==========================================================================
+ * Ember
+ * Copyright ©2006-2011, Strobe Inc. and contributors.
+ * Portions copyright ©2008-2011 Apple Inc. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * For more information about Ember, visit http://www.emberjs.com
+ *
+ * ==========================================================================
+ */
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals ENV */
+var indexOf = Ember.EnumerableUtils.indexOf;
+
+// ........................................
+// TYPING & ARRAY MESSAGING
+//
+
+var TYPE_MAP = {};
+var t = "Boolean Number String Function Array Date RegExp Object".split(" ");
+Ember.ArrayPolyfills.forEach.call(t, function(name) {
+ TYPE_MAP[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+var toString = Object.prototype.toString;
+
+/**
+ Returns a consistent type for the passed item.
+
+ Use this instead of the built-in Ember.typeOf() to get the type of an item.
+ It will return the same result across all browsers and includes a bit
+ more detail. Here is what will be returned:
+
+ | Return Value | Meaning |
+ |---------------|------------------------------------------------------|
+ | 'string' | String primitive |
+ | 'number' | Number primitive |
+ | 'boolean' | Boolean primitive |
+ | 'null' | Null value |
+ | 'undefined' | Undefined value |
+ | 'function' | A function |
+ | 'array' | An instance of Array |
+ | 'class' | A Ember class (created using Ember.Object.extend()) |
+ | 'instance' | A Ember object instance |
+ | 'error' | An instance of the Error object |
+ | 'object' | A JavaScript object not inheriting from Ember.Object |
+
+ Examples:
+
+ Ember.typeOf(); => 'undefined'
+ Ember.typeOf(null); => 'null'
+ Ember.typeOf(undefined); => 'undefined'
+ Ember.typeOf('michael'); => 'string'
+ Ember.typeOf(101); => 'number'
+ Ember.typeOf(true); => 'boolean'
+ Ember.typeOf(Ember.makeArray); => 'function'
+ Ember.typeOf([1,2,90]); => 'array'
+ Ember.typeOf(Ember.Object.extend()); => 'class'
+ Ember.typeOf(Ember.Object.create()); => 'instance'
+ Ember.typeOf(new Error('teamocil')); => 'error'
+
+ // "normal" JavaScript object
+ Ember.typeOf({a: 'b'}); => 'object'
+
+ @param item {Object} the item to check
+ @returns {String} the type
+*/
+Ember.typeOf = function(item) {
+ var ret;
+
+ ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';
+
+ if (ret === 'function') {
+ if (Ember.Object && Ember.Object.detect(item)) ret = 'class';
+ } else if (ret === 'object') {
+ if (item instanceof Error) ret = 'error';
+ else if (Ember.Object && item instanceof Ember.Object) ret = 'instance';
+ else ret = 'object';
+ }
+
+ return ret;
+};
+
+/**
+ Returns true if the passed value is null or undefined. This avoids errors
+ from JSLint complaining about use of ==, which can be technically
+ confusing.
+
+ Ember.none(); => true
+ Ember.none(null); => true
+ Ember.none(undefined); => true
+ Ember.none(''); => false
+ Ember.none([]); => false
+ Ember.none(function(){}); => false
+
+ @param {Object} obj Value to test
+ @returns {Boolean}
+*/
+Ember.none = function(obj) {
+ return obj === null || obj === undefined;
+};
+
+/**
+ Verifies that a value is null or an empty string | array | function.
+
+ Constrains the rules on `Ember.none` by returning false for empty
+ string and empty arrays.
+
+ Ember.empty(); => true
+ Ember.empty(null); => true
+ Ember.empty(undefined); => true
+ Ember.empty(''); => true
+ Ember.empty([]); => true
+ Ember.empty('tobias fünke'); => false
+ Ember.empty([0,1,2]); => false
+
+ @param {Object} obj Value to test
+ @returns {Boolean}
+*/
+Ember.empty = function(obj) {
+ return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function');
+};
+
+/**
+ This will compare two javascript values of possibly different types.
+ It will tell you which one is greater than the other by returning:
+
+ - -1 if the first is smaller than the second,
+ - 0 if both are equal,
+ - 1 if the first is greater than the second.
+
+ The order is calculated based on Ember.ORDER_DEFINITION, if types are different.
+ In case they have the same type an appropriate comparison for this type is made.
+
+ Ember.compare('hello', 'hello'); => 0
+ Ember.compare('abc', 'dfg'); => -1
+ Ember.compare(2, 1); => 1
+
+ @param {Object} v First value to compare
+ @param {Object} w Second value to compare
+ @returns {Number} -1 if v < w, 0 if v = w and 1 if v > w.
+*/
+Ember.compare = function compare(v, w) {
+ if (v === w) { return 0; }
+
+ var type1 = Ember.typeOf(v);
+ var type2 = Ember.typeOf(w);
+
+ var Comparable = Ember.Comparable;
+ if (Comparable) {
+ if (type1==='instance' && Comparable.detect(v.constructor)) {
+ return v.constructor.compare(v, w);
+ }
+
+ if (type2 === 'instance' && Comparable.detect(w.constructor)) {
+ return 1-w.constructor.compare(w, v);
+ }
+ }
+
+ // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,
+ // do so now.
+ var mapping = Ember.ORDER_DEFINITION_MAPPING;
+ if (!mapping) {
+ var order = Ember.ORDER_DEFINITION;
+ mapping = Ember.ORDER_DEFINITION_MAPPING = {};
+ var idx, len;
+ for (idx = 0, len = order.length; idx < len; ++idx) {
+ mapping[order[idx]] = idx;
+ }
+
+ // We no longer need Ember.ORDER_DEFINITION.
+ delete Ember.ORDER_DEFINITION;
+ }
+
+ var type1Index = mapping[type1];
+ var type2Index = mapping[type2];
+
+ if (type1Index < type2Index) { return -1; }
+ if (type1Index > type2Index) { return 1; }
+
+ // types are equal - so we have to check values now
+ switch (type1) {
+ case 'boolean':
+ case 'number':
+ if (v < w) { return -1; }
+ if (v > w) { return 1; }
+ return 0;
+
+ case 'string':
+ var comp = v.localeCompare(w);
+ if (comp < 0) { return -1; }
+ if (comp > 0) { return 1; }
+ return 0;
+
+ case 'array':
+ var vLen = v.length;
+ var wLen = w.length;
+ var l = Math.min(vLen, wLen);
+ var r = 0;
+ var i = 0;
+ while (r === 0 && i < l) {
+ r = compare(v[i],w[i]);
+ i++;
+ }
+ if (r !== 0) { return r; }
+
+ // all elements are equal now
+ // shorter array should be ordered first
+ if (vLen < wLen) { return -1; }
+ if (vLen > wLen) { return 1; }
+ // arrays are equal now
+ return 0;
+
+ case 'instance':
+ if (Ember.Comparable && Ember.Comparable.detect(v)) {
+ return v.compare(v, w);
+ }
+ return 0;
+
+ case 'date':
+ var vNum = v.getTime();
+ var wNum = w.getTime();
+ if (vNum < wNum) { return -1; }
+ if (vNum > wNum) { return 1; }
+ return 0;
+
+ default:
+ return 0;
+ }
+};
+
+/** @private */
+function _copy(obj, deep, seen, copies) {
+ var ret, loc, key;
+
+ // primitive data types are immutable, just return them.
+ if ('object' !== typeof obj || obj===null) return obj;
+
+ // avoid cyclical loops
+ if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];
+
+ Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));
+
+ // IMPORTANT: this specific test will detect a native array only. Any other
+ // object will need to implement Copyable.
+ if (Ember.typeOf(obj) === 'array') {
+ ret = obj.slice();
+ if (deep) {
+ loc = ret.length;
+ while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);
+ }
+ } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {
+ ret = obj.copy(deep, seen, copies);
+ } else {
+ ret = {};
+ for(key in obj) {
+ if (!obj.hasOwnProperty(key)) continue;
+ ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];
+ }
+ }
+
+ if (deep) {
+ seen.push(obj);
+ copies.push(ret);
+ }
+
+ return ret;
+}
+
+/**
+ Creates a clone of the passed object. This function can take just about
+ any type of object and create a clone of it, including primitive values
+ (which are not actually cloned because they are immutable).
+
+ If the passed object implements the clone() method, then this function
+ will simply call that method and return the result.
+
+ @param {Object} object The object to clone
+ @param {Boolean} deep If true, a deep copy of the object is made
+ @returns {Object} The cloned object
+*/
+Ember.copy = function(obj, deep) {
+ // fast paths
+ if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives
+ if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);
+ return _copy(obj, deep, deep ? [] : null, deep ? [] : null);
+};
+
+/**
+ Convenience method to inspect an object. This method will attempt to
+ convert the object into a useful string description.
+
+ @param {Object} obj The object you want to inspect.
+ @returns {String} A description of the object
+*/
+Ember.inspect = function(obj) {
+ var v, ret = [];
+ for(var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ v = obj[key];
+ if (v === 'toString') { continue; } // ignore useless items
+ if (Ember.typeOf(v) === 'function') { v = "function() { ... }"; }
+ ret.push(key + ": " + v);
+ }
+ }
+ return "{" + ret.join(" , ") + "}";
+};
+
+/**
+ Compares two objects, returning true if they are logically equal. This is
+ a deeper comparison than a simple triple equal. For sets it will compare the
+ internal objects. For any other object that implements `isEqual()` it will
+ respect that method.
+
+ Ember.isEqual('hello', 'hello'); => true
+ Ember.isEqual(1, 2); => false
+ Ember.isEqual([4,2], [4,2]); => false
+
+ @param {Object} a first object to compare
+ @param {Object} b second object to compare
+ @returns {Boolean}
+*/
+Ember.isEqual = function(a, b) {
+ if (a && 'function'===typeof a.isEqual) return a.isEqual(b);
+ return a === b;
+};
+
+/**
+ @private
+ Used by Ember.compare
+*/
+Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [
+ 'undefined',
+ 'null',
+ 'boolean',
+ 'number',
+ 'string',
+ 'array',
+ 'object',
+ 'instance',
+ 'function',
+ 'class',
+ 'date'
+];
+
+/**
+ Returns all of the keys defined on an object or hash. This is useful
+ when inspecting objects for debugging. On browsers that support it, this
+ uses the native Object.keys implementation.
+
+ @function
+ @param {Object} obj
+ @returns {Array} Array containing keys of obj
+*/
+Ember.keys = Object.keys;
+
+if (!Ember.keys) {
+ Ember.keys = function(obj) {
+ var ret = [];
+ for(var key in obj) {
+ if (obj.hasOwnProperty(key)) { ret.push(key); }
+ }
+ return ret;
+ };
+}
+
+// ..........................................................
+// ERROR
+//
+
+/**
+ @class
+
+ A subclass of the JavaScript Error object for use in Ember.
+*/
+Ember.Error = function() {
+ var tmp = Error.prototype.constructor.apply(this, arguments);
+
+ for (var p in tmp) {
+ if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
+ }
+ this.message = tmp.message;
+};
+
+Ember.Error.prototype = Ember.create(Error.prototype);
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+/** @private **/
+var STRING_DASHERIZE_REGEXP = (/[ _]/g);
+var STRING_DASHERIZE_CACHE = {};
+var STRING_DECAMELIZE_REGEXP = (/([a-z])([A-Z])/g);
+var STRING_CAMELIZE_REGEXP = (/(\-|_|\s)+(.)?/g);
+var STRING_UNDERSCORE_REGEXP_1 = (/([a-z\d])([A-Z]+)/g);
+var STRING_UNDERSCORE_REGEXP_2 = (/\-|\s+/g);
+
+/**
+ Defines the hash of localized strings for the current language. Used by
+ the `Ember.String.loc()` helper. To localize, add string values to this
+ hash.
+
+ @type Hash
+*/
+Ember.STRINGS = {};
+
+/**
+ Defines string helper methods including string formatting and localization.
+ Unless Ember.EXTEND_PROTOTYPES = false these methods will also be added to the
+ String.prototype as well.
+
+ @namespace
+*/
+Ember.String = {
+
+ /**
+ Apply formatting options to the string. This will look for occurrences
+ of %@ in your string and substitute them with the arguments you pass into
+ this method. If you want to control the specific order of replacement,
+ you can add a number after the key as well to indicate which argument
+ you want to insert.
+
+ Ordered insertions are most useful when building loc strings where values
+ you need to insert may appear in different orders.
+
+ "Hello %@ %@".fmt('John', 'Doe') => "Hello John Doe"
+ "Hello %@2, %@1".fmt('John', 'Doe') => "Hello Doe, John"
+
+ @param {Object...} [args]
+ @returns {String} formatted string
+ */
+ fmt: function(str, formats) {
+ // first, replace any ORDERED replacements.
+ var idx = 0; // the current index for non-numerical replacements
+ return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {
+ argIndex = (argIndex) ? parseInt(argIndex,0) - 1 : idx++ ;
+ s = formats[argIndex];
+ return ((s === null) ? '(null)' : (s === undefined) ? '' : s).toString();
+ }) ;
+ },
+
+ /**
+ Formats the passed string, but first looks up the string in the localized
+ strings hash. This is a convenient way to localize text. See
+ `Ember.String.fmt()` for more information on formatting.
+
+ Note that it is traditional but not required to prefix localized string
+ keys with an underscore or other character so you can easily identify
+ localized strings.
+
+ Ember.STRINGS = {
+ '_Hello World': 'Bonjour le monde',
+ '_Hello %@ %@': 'Bonjour %@ %@'
+ };
+
+ Ember.String.loc("_Hello World");
+ => 'Bonjour le monde';
+
+ Ember.String.loc("_Hello %@ %@", ["John", "Smith"]);
+ => "Bonjour John Smith";
+
+ @param {String} str
+ The string to format
+
+ @param {Array} formats
+ Optional array of parameters to interpolate into string.
+
+ @returns {String} formatted string
+ */
+ loc: function(str, formats) {
+ str = Ember.STRINGS[str] || str;
+ return Ember.String.fmt(str, formats) ;
+ },
+
+ /**
+ Splits a string into separate units separated by spaces, eliminating any
+ empty strings in the process. This is a convenience method for split that
+ is mostly useful when applied to the String.prototype.
+
+ Ember.String.w("alpha beta gamma").forEach(function(key) {
+ console.log(key);
+ });
+ > alpha
+ > beta
+ > gamma
+
+ @param {String} str
+ The string to split
+
+ @returns {String} split string
+ */
+ w: function(str) { return str.split(/\s+/); },
+
+ /**
+ Converts a camelized string into all lower case separated by underscores.
+
+ 'innerHTML'.decamelize() => 'inner_html'
+ 'action_name'.decamelize() => 'action_name'
+ 'css-class-name'.decamelize() => 'css-class-name'
+ 'my favorite items'.decamelize() => 'my favorite items'
+
+ @param {String} str
+ The string to decamelize.
+
+ @returns {String} the decamelized string.
+ */
+ decamelize: function(str) {
+ return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();
+ },
+
+ /**
+ Replaces underscores or spaces with dashes.
+
+ 'innerHTML'.dasherize() => 'inner-html'
+ 'action_name'.dasherize() => 'action-name'
+ 'css-class-name'.dasherize() => 'css-class-name'
+ 'my favorite items'.dasherize() => 'my-favorite-items'
+
+ @param {String} str
+ The string to dasherize.
+
+ @returns {String} the dasherized string.
+ */
+ dasherize: function(str) {
+ var cache = STRING_DASHERIZE_CACHE,
+ ret = cache[str];
+
+ if (ret) {
+ return ret;
+ } else {
+ ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');
+ cache[str] = ret;
+ }
+
+ return ret;
+ },
+
+ /**
+ Returns the lowerCaseCamel form of a string.
+
+ 'innerHTML'.camelize() => 'innerHTML'
+ 'action_name'.camelize() => 'actionName'
+ 'css-class-name'.camelize() => 'cssClassName'
+ 'my favorite items'.camelize() => 'myFavoriteItems'
+
+ @param {String} str
+ The string to camelize.
+
+ @returns {String} the camelized string.
+ */
+ camelize: function(str) {
+ return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {
+ return chr ? chr.toUpperCase() : '';
+ });
+ },
+
+ /**
+ Returns the UpperCamelCase form of a string.
+
+ 'innerHTML'.classify() => 'InnerHTML'
+ 'action_name'.classify() => 'ActionName'
+ 'css-class-name'.classify() => 'CssClassName'
+ 'my favorite items'.classift() => 'MyFavoriteItems'
+ */
+ classify: function(str) {
+ var camelized = Ember.String.camelize(str);
+ return camelized.charAt(0).toUpperCase() + camelized.substr(1);
+ },
+
+ /**
+ More general than decamelize. Returns the lower_case_and_underscored
+ form of a string.
+
+ 'innerHTML'.underscore() => 'inner_html'
+ 'action_name'.underscore() => 'action_name'
+ 'css-class-name'.underscore() => 'css_class_name'
+ 'my favorite items'.underscore() => 'my_favorite_items'
+
+ @param {String} str
+ The string to underscore.
+
+ @returns {String} the underscored string.
+ */
+ underscore: function(str) {
+ return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').
+ replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();
+ }
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var fmt = Ember.String.fmt,
+ w = Ember.String.w,
+ loc = Ember.String.loc,
+ camelize = Ember.String.camelize,
+ decamelize = Ember.String.decamelize,
+ dasherize = Ember.String.dasherize,
+ underscore = Ember.String.underscore;
+
+if (Ember.EXTEND_PROTOTYPES) {
+
+ /**
+ @see Ember.String.fmt
+ */
+ String.prototype.fmt = function() {
+ return fmt(this, arguments);
+ };
+
+ /**
+ @see Ember.String.w
+ */
+ String.prototype.w = function() {
+ return w(this);
+ };
+
+ /**
+ @see Ember.String.loc
+ */
+ String.prototype.loc = function() {
+ return loc(this, arguments);
+ };
+
+ /**
+ @see Ember.String.camelize
+ */
+ String.prototype.camelize = function() {
+ return camelize(this);
+ };
+
+ /**
+ @see Ember.String.decamelize
+ */
+ String.prototype.decamelize = function() {
+ return decamelize(this);
+ };
+
+ /**
+ @see Ember.String.dasherize
+ */
+ String.prototype.dasherize = function() {
+ return dasherize(this);
+ };
+
+ /**
+ @see Ember.String.underscore
+ */
+ String.prototype.underscore = function() {
+ return underscore(this);
+ };
+
+}
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var a_slice = Array.prototype.slice;
+
+if (Ember.EXTEND_PROTOTYPES) {
+
+ /**
+ The `property` extension of Javascript's Function prototype is available
+ when Ember.EXTEND_PROTOTYPES is true, which is the default.
+
+ Computed properties allow you to treat a function like a property:
+
+ MyApp.president = Ember.Object.create({
+ firstName: "Barack",
+ lastName: "Obama",
+
+ fullName: function() {
+ return this.get('firstName') + ' ' + this.get('lastName');
+
+ // Call this flag to mark the function as a property
+ }.property()
+ });
+
+ MyApp.president.get('fullName'); => "Barack Obama"
+
+ Treating a function like a property is useful because they can work with
+ bindings, just like any other property.
+
+ Many computed properties have dependencies on other properties. For
+ example, in the above example, the `fullName` property depends on
+ `firstName` and `lastName` to determine its value. You can tell Ember.js
+ about these dependencies like this:
+
+ MyApp.president = Ember.Object.create({
+ firstName: "Barack",
+ lastName: "Obama",
+
+ fullName: function() {
+ return this.get('firstName') + ' ' + this.get('lastName');
+
+ // Tell Ember.js that this computed property depends on firstName
+ // and lastName
+ }.property('firstName', 'lastName')
+ });
+
+ Make sure you list these dependencies so Ember.js knows when to update
+ bindings that connect to a computed property. Changing a dependency
+ will not immediately trigger an update of the computed property, but
+ will instead clear the cache so that it is updated when the next `get`
+ is called on the property.
+
+ Note: you will usually want to use `property(...)` with `cacheable()`.
+
+ @see Ember.ComputedProperty
+ @see Ember.computed
+ */
+ Function.prototype.property = function() {
+ var ret = Ember.computed(this);
+ return ret.property.apply(ret, arguments);
+ };
+
+ /**
+ The `observes` extension of Javascript's Function prototype is available
+ when Ember.EXTEND_PROTOTYPES is true, which is the default.
+
+ You can observe property changes simply by adding the `observes`
+ call to the end of your method declarations in classes that you write.
+ For example:
+
+ Ember.Object.create({
+ valueObserver: function() {
+ // Executes whenever the "value" property changes
+ }.observes('value')
+ });
+
+ @see Ember.Observable
+ */
+ Function.prototype.observes = function() {
+ this.__ember_observes__ = a_slice.call(arguments);
+ return this;
+ };
+
+ /**
+ The `observesBefore` extension of Javascript's Function prototype is
+ available when Ember.EXTEND_PROTOTYPES is true, which is the default.
+
+ You can get notified when a property changes is about to happen by
+ by adding the `observesBefore` call to the end of your method
+ declarations in classes that you write. For example:
+
+ Ember.Object.create({
+ valueObserver: function() {
+ // Executes whenever the "value" property is about to change
+ }.observesBefore('value')
+ });
+
+ @see Ember.Observable
+ */
+ Function.prototype.observesBefore = function() {
+ this.__ember_observesBefore__ = a_slice.call(arguments);
+ return this;
+ };
+
+}
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+
+
+
+
+// ..........................................................
+// HELPERS
+//
+
+var get = Ember.get, set = Ember.set;
+var a_slice = Array.prototype.slice;
+var a_indexOf = Ember.EnumerableUtils.indexOf;
+
+var contexts = [];
+/** @private */
+function popCtx() {
+ return contexts.length===0 ? {} : contexts.pop();
+}
+
+/** @private */
+function pushCtx(ctx) {
+ contexts.push(ctx);
+ return null;
+}
+
+/** @private */
+function iter(key, value) {
+ var valueProvided = arguments.length === 2;
+
+ function i(item) {
+ var cur = get(item, key);
+ return valueProvided ? value===cur : !!cur;
+ }
+ return i ;
+}
+
+/**
+ @class
+
+ This mixin defines the common interface implemented by enumerable objects
+ in Ember. Most of these methods follow the standard Array iteration
+ API defined up to JavaScript 1.8 (excluding language-specific features that
+ cannot be emulated in older versions of JavaScript).
+
+ This mixin is applied automatically to the Array class on page load, so you
+ can use any of these methods on simple arrays. If Array already implements
+ one of these methods, the mixin will not override them.
+
+ h3. Writing Your Own Enumerable
+
+ To make your own custom class enumerable, you need two items:
+
+ 1. You must have a length property. This property should change whenever
+ the number of items in your enumerable object changes. If you using this
+ with an Ember.Object subclass, you should be sure to change the length
+ property using set().
+
+ 2. If you must implement nextObject(). See documentation.
+
+ Once you have these two methods implement, apply the Ember.Enumerable mixin
+ to your class and you will be able to enumerate the contents of your object
+ like any other collection.
+
+ h3. Using Ember Enumeration with Other Libraries
+
+ Many other libraries provide some kind of iterator or enumeration like
+ facility. This is often where the most common API conflicts occur.
+ Ember's API is designed to be as friendly as possible with other
+ libraries by implementing only methods that mostly correspond to the
+ JavaScript 1.8 API.
+
+ @extends Ember.Mixin
+ @since Ember 0.9
+*/
+Ember.Enumerable = Ember.Mixin.create(
+ /** @scope Ember.Enumerable.prototype */ {
+
+ /** @private - compatibility */
+ isEnumerable: true,
+
+ /**
+ Implement this method to make your class enumerable.
+
+ This method will be call repeatedly during enumeration. The index value
+ will always begin with 0 and increment monotonically. You don't have to
+ rely on the index value to determine what object to return, but you should
+ always check the value and start from the beginning when you see the
+ requested index is 0.
+
+ The previousObject is the object that was returned from the last call
+ to nextObject for the current iteration. This is a useful way to
+ manage iteration if you are tracing a linked list, for example.
+
+ Finally the context parameter will always contain a hash you can use as
+ a "scratchpad" to maintain any other state you need in order to iterate
+ properly. The context object is reused and is not reset between
+ iterations so make sure you setup the context with a fresh state whenever
+ the index parameter is 0.
+
+ Generally iterators will continue to call nextObject until the index
+ reaches the your current length-1. If you run out of data before this
+ time for some reason, you should simply return undefined.
+
+ The default implementation of this method simply looks up the index.
+ This works great on any Array-like objects.
+
+ @param {Number} index the current index of the iteration
+ @param {Object} previousObject the value returned by the last call to nextObject.
+ @param {Object} context a context object you can use to maintain state.
+ @returns {Object} the next object in the iteration or undefined
+ */
+ nextObject: Ember.required(Function),
+
+ /**
+ Helper method returns the first object from a collection. This is usually
+ used by bindings and other parts of the framework to extract a single
+ object if the enumerable contains only one item.
+
+ If you override this method, you should implement it so that it will
+ always return the same value each time it is called. If your enumerable
+ contains only one object, this method should always return that object.
+ If your enumerable is empty, this method should return undefined.
+
+ var arr = ["a", "b", "c"];
+ arr.firstObject(); => "a"
+
+ var arr = [];
+ arr.firstObject(); => undefined
+
+ @returns {Object} the object or undefined
+ */
+ firstObject: Ember.computed(function() {
+ if (get(this, 'length')===0) return undefined ;
+
+ // handle generic enumerables
+ var context = popCtx(), ret;
+ ret = this.nextObject(0, null, context);
+ pushCtx(context);
+ return ret ;
+ }).property('[]').cacheable(),
+
+ /**
+ Helper method returns the last object from a collection. If your enumerable
+ contains only one object, this method should always return that object.
+ If your enumerable is empty, this method should return undefined.
+
+ var arr = ["a", "b", "c"];
+ arr.lastObject(); => "c"
+
+ var arr = [];
+ arr.lastObject(); => undefined
+
+ @returns {Object} the last object or undefined
+ */
+ lastObject: Ember.computed(function() {
+ var len = get(this, 'length');
+ if (len===0) return undefined ;
+ var context = popCtx(), idx=0, cur, last = null;
+ do {
+ last = cur;
+ cur = this.nextObject(idx++, last, context);
+ } while (cur !== undefined);
+ pushCtx(context);
+ return last;
+ }).property('[]').cacheable(),
+
+ /**
+ Returns true if the passed object can be found in the receiver. The
+ default version will iterate through the enumerable until the object
+ is found. You may want to override this with a more efficient version.
+
+ var arr = ["a", "b", "c"];
+ arr.contains("a"); => true
+ arr.contains("z"); => false
+
+ @param {Object} obj
+ The object to search for.
+
+ @returns {Boolean} true if object is found in enumerable.
+ */
+ contains: function(obj) {
+ return this.find(function(item) { return item===obj; }) !== undefined;
+ },
+
+ /**
+ Iterates through the enumerable, calling the passed function on each
+ item. This method corresponds to the forEach() method defined in
+ JavaScript 1.6.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(item, index, enumerable);
+
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ Note that in addition to a callback, you can also pass an optional target
+ object that will be set as "this" on the context. This is a good way
+ to give your iterator function access to the current object.
+
+ @param {Function} callback The callback to execute
+ @param {Object} [target] The target object to use
+ @returns {Object} receiver
+ */
+ forEach: function(callback, target) {
+ if (typeof callback !== "function") throw new TypeError() ;
+ var len = get(this, 'length'), last = null, context = popCtx();
+
+ if (target === undefined) target = null;
+
+ for(var idx=0;idx<len;idx++) {
+ var next = this.nextObject(idx, last, context) ;
+ callback.call(target, next, idx, this);
+ last = next ;
+ }
+ last = null ;
+ context = pushCtx(context);
+ return this ;
+ },
+
+ /**
+ Alias for mapProperty
+
+ @param {String} key name of the property
+ @returns {Array} The mapped array.
+ */
+ getEach: function(key) {
+ return this.mapProperty(key);
+ },
+
+ /**
+ Sets the value on the named property for each member. This is more
+ efficient than using other methods defined on this helper. If the object
+ implements Ember.Observable, the value will be changed to set(), otherwise
+ it will be set directly. null objects are skipped.
+
+ @param {String} key The key to set
+ @param {Object} value The object to set
+ @returns {Object} receiver
+ */
+ setEach: function(key, value) {
+ return this.forEach(function(item) {
+ set(item, key, value);
+ });
+ },
+
+ /**
+ Maps all of the items in the enumeration to another value, returning
+ a new array. This method corresponds to map() defined in JavaScript 1.6.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(item, index, enumerable);
+
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ It should return the mapped value.
+
+ Note that in addition to a callback, you can also pass an optional target
+ object that will be set as "this" on the context. This is a good way
+ to give your iterator function access to the current object.
+
+ @param {Function} callback The callback to execute
+ @param {Object} [target] The target object to use
+ @returns {Array} The mapped array.
+ */
+ map: function(callback, target) {
+ var ret = [];
+ this.forEach(function(x, idx, i) {
+ ret[idx] = callback.call(target, x, idx,i);
+ });
+ return ret ;
+ },
+
+ /**
+ Similar to map, this specialized function returns the value of the named
+ property on all items in the enumeration.
+
+ @param {String} key name of the property
+ @returns {Array} The mapped array.
+ */
+ mapProperty: function(key) {
+ return this.map(function(next) {
+ return get(next, key);
+ });
+ },
+
+ /**
+ Returns an array with all of the items in the enumeration that the passed
+ function returns true for. This method corresponds to filter() defined in
+ JavaScript 1.6.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(item, index, enumerable);
+
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ It should return the true to include the item in the results, false otherwise.
+
+ Note that in addition to a callback, you can also pass an optional target
+ object that will be set as "this" on the context. This is a good way
+ to give your iterator function access to the current object.
+
+ @param {Function} callback The callback to execute
+ @param {Object} [target] The target object to use
+ @returns {Array} A filtered array.
+ */
+ filter: function(callback, target) {
+ var ret = [];
+ this.forEach(function(x, idx, i) {
+ if (callback.call(target, x, idx, i)) ret.push(x);
+ });
+ return ret ;
+ },
+
+ /**
+ Returns an array with just the items with the matched property. You
+ can pass an optional second argument with the target value. Otherwise
+ this will match any property that evaluates to true.
+
+ @param {String} key the property to test
+ @param {String} [value] optional value to test against.
+ @returns {Array} filtered array
+ */
+ filterProperty: function(key, value) {
+ return this.filter(iter.apply(this, arguments));
+ },
+
+ /**
+ Returns the first item in the array for which the callback returns true.
+ This method works similar to the filter() method defined in JavaScript 1.6
+ except that it will stop working on the array once a match is found.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(item, index, enumerable);
+
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ It should return the true to include the item in the results, false otherwise.
+
+ Note that in addition to a callback, you can also pass an optional target
+ object that will be set as "this" on the context. This is a good way
+ to give your iterator function access to the current object.
+
+ @param {Function} callback The callback to execute
+ @param {Object} [target] The target object to use
+ @returns {Object} Found item or null.
+ */
+ find: function(callback, target) {
+ var len = get(this, 'length') ;
+ if (target === undefined) target = null;
+
+ var last = null, next, found = false, ret ;
+ var context = popCtx();
+ for(var idx=0;idx<len && !found;idx++) {
+ next = this.nextObject(idx, last, context) ;
+ if (found = callback.call(target, next, idx, this)) ret = next ;
+ last = next ;
+ }
+ next = last = null ;
+ context = pushCtx(context);
+ return ret ;
+ },
+
+ /**
+ Returns the first item with a property matching the passed value. You
+ can pass an optional second argument with the target value. Otherwise
+ this will match any property that evaluates to true.
+
+ This method works much like the more generic find() method.
+
+ @param {String} key the property to test
+ @param {String} [value] optional value to test against.
+ @returns {Object} found item or null
+ */
+ findProperty: function(key, value) {
+ return this.find(iter.apply(this, arguments));
+ },
+
+ /**
+ Returns true if the passed function returns true for every item in the
+ enumeration. This corresponds with the every() method in JavaScript 1.6.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(item, index, enumerable);
+
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ It should return the true or false.
+
+ Note that in addition to a callback, you can also pass an optional target
+ object that will be set as "this" on the context. This is a good way
+ to give your iterator function access to the current object.
+
+ Example Usage:
+
+ if (people.every(isEngineer)) { Paychecks.addBigBonus(); }
+
+ @param {Function} callback The callback to execute
+ @param {Object} [target] The target object to use
+ @returns {Boolean}
+ */
+ every: function(callback, target) {
+ return !this.find(function(x, idx, i) {
+ return !callback.call(target, x, idx, i);
+ });
+ },
+
+ /**
+ Returns true if the passed property resolves to true for all items in the
+ enumerable. This method is often simpler/faster than using a callback.
+
+ @param {String} key the property to test
+ @param {String} [value] optional value to test against.
+ @returns {Array} filtered array
+ */
+ everyProperty: function(key, value) {
+ return this.every(iter.apply(this, arguments));
+ },
+
+
+ /**
+ Returns true if the passed function returns true for any item in the
+ enumeration. This corresponds with the every() method in JavaScript 1.6.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(item, index, enumerable);
+
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ It should return the true to include the item in the results, false otherwise.
+
+ Note that in addition to a callback, you can also pass an optional target
+ object that will be set as "this" on the context. This is a good way
+ to give your iterator function access to the current object.
+
+ Usage Example:
+
+ if (people.some(isManager)) { Paychecks.addBiggerBonus(); }
+
+ @param {Function} callback The callback to execute
+ @param {Object} [target] The target object to use
+ @returns {Array} A filtered array.
+ */
+ some: function(callback, target) {
+ return !!this.find(function(x, idx, i) {
+ return !!callback.call(target, x, idx, i);
+ });
+ },
+
+ /**
+ Returns true if the passed property resolves to true for any item in the
+ enumerable. This method is often simpler/faster than using a callback.
+
+ @param {String} key the property to test
+ @param {String} [value] optional value to test against.
+ @returns {Boolean} true
+ */
+ someProperty: function(key, value) {
+ return this.some(iter.apply(this, arguments));
+ },
+
+ /**
+ This will combine the values of the enumerator into a single value. It
+ is a useful way to collect a summary value from an enumeration. This
+ corresponds to the reduce() method defined in JavaScript 1.8.
+
+ The callback method you provide should have the following signature (all
+ parameters are optional):
+
+ function(previousValue, item, index, enumerable);
+
+ - *previousValue* is the value returned by the last call to the iterator.
+ - *item* is the current item in the iteration.
+ - *index* is the current index in the iteration
+ - *enumerable* is the enumerable object itself.
+
+ Return the new cumulative value.
+
+ In addition to the callback you can also pass an initialValue. An error
+ will be raised if you do not pass an initial value and the enumerator is
+ empty.
+
+ Note that unlike the other methods, this method does not allow you to
+ pass a target object to set as this for the callback. It's part of the
+ spec. Sorry.
+
+ @param {Function} callback The callback to execute
+ @param {Object} initialValue Initial value for the reduce
+ @param {String} reducerProperty internal use only.
+ @returns {Object} The reduced value.
+ */
+ reduce: function(callback, initialValue, reducerProperty) {
+ if (typeof callback !== "function") { throw new TypeError(); }
+
+ var ret = initialValue;
+
+ this.forEach(function(item, i) {
+ ret = callback.call(null, ret, item, i, this, reducerProperty);
+ }, this);
+
+ return ret;
+ },
+
+ /**
+ Invokes the named method on every object in the receiver that
+ implements it. This method corresponds to the implementation in
+ Prototype 1.6.
+
+ @param {String} methodName the name of the method
+ @param {Object...} args optional arguments to pass as well.
+ @returns {Array} return values from calling invoke.
+ */
+ invoke: function(methodName) {
+ var args, ret = [];
+ if (arguments.length>1) args = a_slice.call(arguments, 1);
+
+ this.forEach(function(x, idx) {
+ var method = x && x[methodName];
+ if ('function' === typeof method) {
+ ret[idx] = args ? method.apply(x, args) : method.call(x);
+ }
+ }, this);
+
+ return ret;
+ },
+
+ /**
+ Simply converts the enumerable into a genuine array. The order is not
+ guaranteed. Corresponds to the method implemented by Prototype.
+
+ @returns {Array} the enumerable as an array.
+ */
+ toArray: function() {
+ var ret = [];
+ this.forEach(function(o, idx) { ret[idx] = o; });
+ return ret ;
+ },
+
+ /**
+ Returns a copy of the array with all null elements removed.
+
+ var arr = ["a", null, "c", null];
+ arr.compact(); => ["a", "c"]
+
+ @returns {Array} the array without null elements.
+ */
+ compact: function() { return this.without(null); },
+
+ /**
+ Returns a new enumerable that excludes the passed value. The default
+ implementation returns an array regardless of the receiver type unless
+ the receiver does not contain the value.
+
+ var arr = ["a", "b", "a", "c"];
+ arr.without("a"); => ["b", "c"]
+
+ @param {Object} value
+ @returns {Ember.Enumerable}
+ */
+ without: function(value) {
+ if (!this.contains(value)) return this; // nothing to do
+ var ret = [] ;
+ this.forEach(function(k) {
+ if (k !== value) ret[ret.length] = k;
+ }) ;
+ return ret ;
+ },
+
+ /**
+ Returns a new enumerable that contains only unique values. The default
+ implementation returns an array regardless of the receiver type.
+
+ var arr = ["a", "a", "b", "b"];
+ arr.uniq(); => ["a", "b"]
+
+ @returns {Ember.Enumerable}
+ */
+ uniq: function() {
+ var ret = [];
+ this.forEach(function(k){
+ if (a_indexOf(ret, k)<0) ret.push(k);
+ });
+ return ret;
+ },
+
+ /**
+ This property will trigger anytime the enumerable's content changes.
+ You can observe this property to be notified of changes to the enumerables
+ content.
+
+ For plain enumerables, this property is read only. Ember.Array overrides
+ this method.
+
+ @type Ember.Array
+ */
+ '[]': Ember.computed(function(key, value) {
+ return this;
+ }).property().cacheable(),
+
+ // ..........................................................
+ // ENUMERABLE OBSERVERS
+ //
+
+ /**
+ Registers an enumerable observer. Must implement Ember.EnumerableObserver
+ mixin.
+ */
+ addEnumerableObserver: function(target, opts) {
+ var willChange = (opts && opts.willChange) || 'enumerableWillChange',
+ didChange = (opts && opts.didChange) || 'enumerableDidChange';
+
+ var hasObservers = get(this, 'hasEnumerableObservers');
+ if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');
+ Ember.addListener(this, '@enumerable:before', target, willChange);
+ Ember.addListener(this, '@enumerable:change', target, didChange);
+ if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');
+ return this;
+ },
+
+ /**
+ Removes a registered enumerable observer.
+ */
+ removeEnumerableObserver: function(target, opts) {
+ var willChange = (opts && opts.willChange) || 'enumerableWillChange',
+ didChange = (opts && opts.didChange) || 'enumerableDidChange';
+
+ var hasObservers = get(this, 'hasEnumerableObservers');
+ if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');
+ Ember.removeListener(this, '@enumerable:before', target, willChange);
+ Ember.removeListener(this, '@enumerable:change', target, didChange);
+ if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');
+ return this;
+ },
+
+ /**
+ Becomes true whenever the array currently has observers watching changes
+ on the array.
+
+ @type Boolean
+ */
+ hasEnumerableObservers: Ember.computed(function() {
+ return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');
+ }).property().cacheable(),
+
+
+ /**
+ Invoke this method just before the contents of your enumerable will
+ change. You can either omit the parameters completely or pass the objects
+ to be removed or added if available or just a count.
+
+ @param {Ember.Enumerable|Number} removing
+ An enumerable of the objects to be removed or the number of items to
+ be removed.
+
+ @param {Ember.Enumerable|Number} adding
+ An enumerable of the objects to be added or the number of items to be
+ added.
+
+ @returns {Ember.Enumerable} receiver
+ */
+ enumerableContentWillChange: function(removing, adding) {
+
+ var removeCnt, addCnt, hasDelta;
+
+ if ('number' === typeof removing) removeCnt = removing;
+ else if (removing) removeCnt = get(removing, 'length');
+ else removeCnt = removing = -1;
+
+ if ('number' === typeof adding) addCnt = adding;
+ else if (adding) addCnt = get(adding,'length');
+ else addCnt = adding = -1;
+
+ hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;
+
+ if (removing === -1) removing = null;
+ if (adding === -1) adding = null;
+
+ Ember.propertyWillChange(this, '[]');
+ if (hasDelta) Ember.propertyWillChange(this, 'length');
+ Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);
+
+ return this;
+ },
+
+ /**
+ Invoke this method when the contents of your enumerable has changed.
+ This will notify any observers watching for content changes. If your are
+ implementing an ordered enumerable (such as an array), also pass the
+ start and end values where the content changed so that it can be used to
+ notify range observers.
+
+ @param {Number} start
+ optional start offset for the content change. For unordered
+ enumerables, you should always pass -1.
+
+ @param {Ember.Enumerable|Number} removing
+ An enumerable of the objects to be removed or the number of items to
+ be removed.
+
+ @param {Ember.Enumerable|Number} adding
+ An enumerable of the objects to be added or the number of items to be
+ added.
+
+ @returns {Object} receiver
+ */
+ enumerableContentDidChange: function(removing, adding) {
+ var notify = this.propertyDidChange, removeCnt, addCnt, hasDelta;
+
+ if ('number' === typeof removing) removeCnt = removing;
+ else if (removing) removeCnt = get(removing, 'length');
+ else removeCnt = removing = -1;
+
+ if ('number' === typeof adding) addCnt = adding;
+ else if (adding) addCnt = get(adding, 'length');
+ else addCnt = adding = -1;
+
+ hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;
+
+ if (removing === -1) removing = null;
+ if (adding === -1) adding = null;
+
+ Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);
+ if (hasDelta) Ember.propertyDidChange(this, 'length');
+ Ember.propertyDidChange(this, '[]');
+
+ return this ;
+ }
+
+}) ;
+
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+// ..........................................................
+// HELPERS
+//
+
+var get = Ember.get, set = Ember.set, meta = Ember.meta, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
+
+/** @private */
+function none(obj) { return obj===null || obj===undefined; }
+
+// ..........................................................
+// ARRAY
+//
+/**
+ @namespace
+
+ This module implements Observer-friendly Array-like behavior. This mixin is
+ picked up by the Array class as well as other controllers, etc. that want to
+ appear to be arrays.
+
+ Unlike Ember.Enumerable, this mixin defines methods specifically for
+ collections that provide index-ordered access to their contents. When you
+ are designing code that needs to accept any kind of Array-like object, you
+ should use these methods instead of Array primitives because these will
+ properly notify observers of changes to the array.
+
+ Although these methods are efficient, they do add a layer of indirection to
+ your application so it is a good idea to use them only when you need the
+ flexibility of using both true JavaScript arrays and "virtual" arrays such
+ as controllers and collections.
+
+ You can use the methods defined in this module to access and modify array
+ contents in a KVO-friendly way. You can also be notified whenever the
+ membership if an array changes by changing the syntax of the property to
+ .observes('*myProperty.[]') .
+
+ To support Ember.Array in your own class, you must override two
+ primitives to use it: replace() and objectAt().
+
+ Note that the Ember.Array mixin also incorporates the Ember.Enumerable mixin. All
+ Ember.Array-like objects are also enumerable.
+
+ @extends Ember.Enumerable
+ @since Ember 0.9.0
+*/
+Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {
+
+ /** @private - compatibility */
+ isSCArray: true,
+
+ /**
+ @field {Number} length
+
+ Your array must support the length property. Your replace methods should
+ set this property whenever it changes.
+ */
+ length: Ember.required(),
+
+ /**
+ Returns the object at the given index. If the given index is negative or
+ is greater or equal than the array length, returns `undefined`.
+
+ This is one of the primitives you must implement to support `Ember.Array`.
+ If your object supports retrieving the value of an array item using `get()`
+ (i.e. `myArray.get(0)`), then you do not need to implement this method
+ yourself.
+
+ var arr = ['a', 'b', 'c', 'd'];
+ arr.objectAt(0); => "a"
+ arr.objectAt(3); => "d"
+ arr.objectAt(-1); => undefined
+ arr.objectAt(4); => undefined
+ arr.objectAt(5); => undefined
+
+ @param {Number} idx
+ The index of the item to return.
+ */
+ objectAt: function(idx) {
+ if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;
+ return get(this, idx);
+ },
+
+ /**
+ This returns the objects at the specified indexes, using `objectAt`.
+
+ var arr = ['a', 'b', 'c', 'd'];
+ arr.objectsAt([0, 1, 2]) => ["a", "b", "c"]
+ arr.objectsAt([2, 3, 4]) => ["c", "d", undefined]
+
+ @param {Array} indexes
+ An array of indexes of items to return.
+ */
+ objectsAt: function(indexes) {
+ var self = this;
+ return map(indexes, function(idx){ return self.objectAt(idx); });
+ },
+
+ /** @private (nodoc) - overrides Ember.Enumerable version */
+ nextObject: function(idx) {
+ return this.objectAt(idx);
+ },
+
+ /**
+ @field []
+
+ This is the handler for the special array content property. If you get
+ this property, it will return this. If you set this property it a new
+ array, it will replace the current content.
+
+ This property overrides the default property defined in Ember.Enumerable.
+ */
+ '[]': Ember.computed(function(key, value) {
+ if (value !== undefined) this.replace(0, get(this, 'length'), value) ;
+ return this ;
+ }).property().cacheable(),
+
+ firstObject: Ember.computed(function() {
+ return this.objectAt(0);
+ }).property().cacheable(),
+
+ lastObject: Ember.computed(function() {
+ return this.objectAt(get(this, 'length')-1);
+ }).property().cacheable(),
+
+ /** @private (nodoc) - optimized version from Enumerable */
+ contains: function(obj){
+ return this.indexOf(obj) >= 0;
+ },
+
+ // Add any extra methods to Ember.Array that are native to the built-in Array.
+ /**
+ Returns a new array that is a slice of the receiver. This implementation
+ uses the observable array methods to retrieve the objects for the new
+ slice.
+
+ var arr = ['red', 'green', 'blue'];
+ arr.slice(0); => ['red', 'green', 'blue']
+ arr.slice(0, 2); => ['red', 'green']
+ arr.slice(1, 100); => ['green', 'blue']
+
+ @param beginIndex {Integer} (Optional) index to begin slicing from.
+ @param endIndex {Integer} (Optional) index to end the slice at.
+ @returns {Array} New array with specified slice
+ */
+ slice: function(beginIndex, endIndex) {
+ var ret = [];
+ var length = get(this, 'length') ;
+ if (none(beginIndex)) beginIndex = 0 ;
+ if (none(endIndex) || (endIndex > length)) endIndex = length ;
+ while(beginIndex < endIndex) {
+ ret[ret.length] = this.objectAt(beginIndex++) ;
+ }
+ return ret ;
+ },
+
+ /**
+ Returns the index of the given object's first occurrence.
+ If no startAt argument is given, the starting location to
+ search is 0. If it's negative, will count backward from
+ the end of the array. Returns -1 if no match is found.
+
+ var arr = ["a", "b", "c", "d", "a"];
+ arr.indexOf("a"); => 0
+ arr.indexOf("z"); => -1
+ arr.indexOf("a", 2); => 4
+ arr.indexOf("a", -1); => 4
+ arr.indexOf("b", 3); => -1
+ arr.indexOf("a", 100); => -1
+
+ @param {Object} object the item to search for
+ @param {Number} startAt optional starting location to search, default 0
+ @returns {Number} index or -1 if not found
+ */
+ indexOf: function(object, startAt) {
+ var idx, len = get(this, 'length');
+
+ if (startAt === undefined) startAt = 0;
+ if (startAt < 0) startAt += len;
+
+ for(idx=startAt;idx<len;idx++) {
+ if (this.objectAt(idx, true) === object) return idx ;
+ }
+ return -1;
+ },
+
+ /**
+ Returns the index of the given object's last occurrence.
+ If no startAt argument is given, the search starts from
+ the last position. If it's negative, will count backward
+ from the end of the array. Returns -1 if no match is found.
+
+ var arr = ["a", "b", "c", "d", "a"];
+ arr.lastIndexOf("a"); => 4
+ arr.lastIndexOf("z"); => -1
+ arr.lastIndexOf("a", 2); => 0
+ arr.lastIndexOf("a", -1); => 4
+ arr.lastIndexOf("b", 3); => 1
+ arr.lastIndexOf("a", 100); => 4
+
+ @param {Object} object the item to search for
+ @param {Number} startAt optional starting location to search, default 0
+ @returns {Number} index or -1 if not found
+ */
+ lastIndexOf: function(object, startAt) {
+ var idx, len = get(this, 'length');
+
+ if (startAt === undefined || startAt >= len) startAt = len-1;
+ if (startAt < 0) startAt += len;
+
+ for(idx=startAt;idx>=0;idx--) {
+ if (this.objectAt(idx) === object) return idx ;
+ }
+ return -1;
+ },
+
+ // ..........................................................
+ // ARRAY OBSERVERS
+ //
+
+ /**
+ Adds an array observer to the receiving array. The array observer object
+ normally must implement two methods:
+
+ * `arrayWillChange(start, removeCount, addCount)` - This method will be
+ called just before the array is modified.
+ * `arrayDidChange(start, removeCount, addCount)` - This method will be
+ called just after the array is modified.
+
+ Both callbacks will be passed the starting index of the change as well a
+ a count of the items to be removed and added. You can use these callbacks
+ to optionally inspect the array during the change, clear caches, or do
+ any other bookkeeping necessary.
+
+ In addition to passing a target, you can also include an options hash
+ which you can use to override the method names that will be invoked on the
+ target.
+
+ @param {Object} target
+ The observer object.
+
+ @param {Hash} opts
+ Optional hash of configuration options including willChange, didChange,
+ and a context option.
+
+ @returns {Ember.Array} receiver
+ */
+ addArrayObserver: function(target, opts) {
+ var willChange = (opts && opts.willChange) || 'arrayWillChange',
+ didChange = (opts && opts.didChange) || 'arrayDidChange';
+
+ var hasObservers = get(this, 'hasArrayObservers');
+ if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');
+ Ember.addListener(this, '@array:before', target, willChange);
+ Ember.addListener(this, '@array:change', target, didChange);
+ if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');
+ return this;
+ },
+
+ /**
+ Removes an array observer from the object if the observer is current
+ registered. Calling this method multiple times with the same object will
+ have no effect.
+
+ @param {Object} target
+ The object observing the array.
+
+ @returns {Ember.Array} receiver
+ */
+ removeArrayObserver: function(target, opts) {
+ var willChange = (opts && opts.willChange) || 'arrayWillChange',
+ didChange = (opts && opts.didChange) || 'arrayDidChange';
+
+ var hasObservers = get(this, 'hasArrayObservers');
+ if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');
+ Ember.removeListener(this, '@array:before', target, willChange);
+ Ember.removeListener(this, '@array:change', target, didChange);
+ if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');
+ return this;
+ },
+
+ /**
+ Becomes true whenever the array currently has observers watching changes
+ on the array.
+
+ @type Boolean
+ */
+ hasArrayObservers: Ember.computed(function() {
+ return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');
+ }).property().cacheable(),
+
+ /**
+ If you are implementing an object that supports Ember.Array, call this
+ method just before the array content changes to notify any observers and
+ invalidate any related properties. Pass the starting index of the change
+ as well as a delta of the amounts to change.
+
+ @param {Number} startIdx
+ The starting index in the array that will change.
+
+ @param {Number} removeAmt
+ The number of items that will be removed. If you pass null assumes 0
+
+ @param {Number} addAmt
+ The number of items that will be added. If you pass null assumes 0.
+
+ @returns {Ember.Array} receiver
+ */
+ arrayContentWillChange: function(startIdx, removeAmt, addAmt) {
+
+ // if no args are passed assume everything changes
+ if (startIdx===undefined) {
+ startIdx = 0;
+ removeAmt = addAmt = -1;
+ } else {
+ if (removeAmt === undefined) removeAmt=-1;
+ if (addAmt === undefined) addAmt=-1;
+ }
+
+ // Make sure the @each proxy is set up if anyone is observing @each
+ if (Ember.isWatching(this, '@each')) { get(this, '@each'); }
+
+ Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);
+
+ var removing, lim;
+ if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {
+ removing = [];
+ lim = startIdx+removeAmt;
+ for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));
+ } else {
+ removing = removeAmt;
+ }
+
+ this.enumerableContentWillChange(removing, addAmt);
+
+ return this;
+ },
+
+ arrayContentDidChange: function(startIdx, removeAmt, addAmt) {
+
+ // if no args are passed assume everything changes
+ if (startIdx===undefined) {
+ startIdx = 0;
+ removeAmt = addAmt = -1;
+ } else {
+ if (removeAmt === undefined) removeAmt=-1;
+ if (addAmt === undefined) addAmt=-1;
+ }
+
+ var adding, lim;
+ if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {
+ adding = [];
+ lim = startIdx+addAmt;
+ for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));
+ } else {
+ adding = addAmt;
+ }
+
+ this.enumerableContentDidChange(removeAmt, adding);
+ Ember.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);
+
+ var length = get(this, 'length'),
+ cachedFirst = cacheFor(this, 'firstObject'),
+ cachedLast = cacheFor(this, 'lastObject');
+ if (this.objectAt(0) !== cachedFirst) {
+ Ember.propertyWillChange(this, 'firstObject');
+ Ember.propertyDidChange(this, 'firstObject');
+ }
+ if (this.objectAt(length-1) !== cachedLast) {
+ Ember.propertyWillChange(this, 'lastObject');
+ Ember.propertyDidChange(this, 'lastObject');
+ }
+
+ return this;
+ },
+
+ // ..........................................................
+ // ENUMERATED PROPERTIES
+ //
+
+ /**
+ Returns a special object that can be used to observe individual properties
+ on the array. Just get an equivalent property on this object and it will
+ return an enumerable that maps automatically to the named key on the
+ member objects.
+ */
+ '@each': Ember.computed(function() {
+ if (!this.__each) this.__each = new Ember.EachProxy(this);
+ return this.__each;
+ }).property().cacheable()
+
+}) ;
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/**
+ @namespace
+
+ Implements some standard methods for comparing objects. Add this mixin to
+ any class you create that can compare its instances.
+
+ You should implement the compare() method.
+
+ @extends Ember.Mixin
+ @since Ember 0.9
+*/
+Ember.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{
+
+ /**
+ walk like a duck. Indicates that the object can be compared.
+
+ @type Boolean
+ @default true
+ @constant
+ */
+ isComparable: true,
+
+ /**
+ Override to return the result of the comparison of the two parameters. The
+ compare method should return:
+
+ - `-1` if `a < b`
+ - `0` if `a == b`
+ - `1` if `a > b`
+
+ Default implementation raises an exception.
+
+ @param a {Object} the first object to compare
+ @param b {Object} the second object to compare
+ @returns {Integer} the result of the comparison
+ */
+ compare: Ember.required(Function)
+
+});
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2010 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+/**
+ @namespace
+
+ Implements some standard methods for copying an object. Add this mixin to
+ any object you create that can create a copy of itself. This mixin is
+ added automatically to the built-in array.
+
+ You should generally implement the copy() method to return a copy of the
+ receiver.
+
+ Note that frozenCopy() will only work if you also implement Ember.Freezable.
+
+ @extends Ember.Mixin
+ @since Ember 0.9
+*/
+Ember.Copyable = Ember.Mixin.create(
+/** @scope Ember.Copyable.prototype */ {
+
+ /**
+ Override to return a copy of the receiver. Default implementation raises
+ an exception.
+
+ @function
+ @param deep {Boolean} if true, a deep copy of the object should be made
+ @returns {Object} copy of receiver
+ */
+ copy: Ember.required(Function),
+
+ /**
+ If the object implements Ember.Freezable, then this will return a new copy
+ if the object is not frozen and the receiver if the object is frozen.
+
+ Raises an exception if you try to call this method on a object that does
+ not support freezing.
+
+ You should use this method whenever you want a copy of a freezable object
+ since a freezable object can simply return itself without actually
+ consuming more memory.
+
+ @returns {Object} copy of receiver or receiver
+ */
+ frozenCopy: function() {
+ if (Ember.Freezable && Ember.Freezable.detect(this)) {
+ return get(this, 'isFrozen') ? this : this.copy().freeze();
+ } else {
+ throw new Error(Ember.String.fmt("%@ does not support freezing", [this]));
+ }
+ }
+});
+
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2010 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+
+
+
+
+var get = Ember.get, set = Ember.set;
+
+/**
+ @namespace
+
+ The Ember.Freezable mixin implements some basic methods for marking an object
+ as frozen. Once an object is frozen it should be read only. No changes
+ may be made the internal state of the object.
+
+ ## Enforcement
+
+ To fully support freezing in your subclass, you must include this mixin and
+ override any method that might alter any property on the object to instead
+ raise an exception. You can check the state of an object by checking the
+ isFrozen property.
+
+ Although future versions of JavaScript may support language-level freezing
+ object objects, that is not the case today. Even if an object is freezable,
+ it is still technically possible to modify the object, even though it could
+ break other parts of your application that do not expect a frozen object to
+ change. It is, therefore, very important that you always respect the
+ isFrozen property on all freezable objects.
+
+ ## Example Usage
+
+ The example below shows a simple object that implement the Ember.Freezable
+ protocol.
+
+ Contact = Ember.Object.extend(Ember.Freezable, {
+
+ firstName: null,
+
+ lastName: null,
+
+ // swaps the names
+ swapNames: function() {
+ if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;
+ var tmp = this.get('firstName');
+ this.set('firstName', this.get('lastName'));
+ this.set('lastName', tmp);
+ return this;
+ }
+
+ });
+
+ c = Context.create({ firstName: "John", lastName: "Doe" });
+ c.swapNames(); => returns c
+ c.freeze();
+ c.swapNames(); => EXCEPTION
+
+ ## Copying
+
+ Usually the Ember.Freezable protocol is implemented in cooperation with the
+ Ember.Copyable protocol, which defines a frozenCopy() method that will return
+ a frozen object, if the object implements this method as well.
+
+ @extends Ember.Mixin
+ @since Ember 0.9
+*/
+Ember.Freezable = Ember.Mixin.create(
+/** @scope Ember.Freezable.prototype */ {
+
+ /**
+ Set to true when the object is frozen. Use this property to detect whether
+ your object is frozen or not.
+
+ @type Boolean
+ */
+ isFrozen: false,
+
+ /**
+ Freezes the object. Once this method has been called the object should
+ no longer allow any properties to be edited.
+
+ @returns {Object} receiver
+ */
+ freeze: function() {
+ if (get(this, 'isFrozen')) return this;
+ set(this, 'isFrozen', true);
+ return this;
+ }
+
+});
+
+Ember.FROZEN_ERROR = "Frozen object cannot be modified.";
+
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var forEach = Ember.EnumerableUtils.forEach;
+
+/**
+ @class
+
+ This mixin defines the API for modifying generic enumerables. These methods
+ can be applied to an object regardless of whether it is ordered or
+ unordered.
+
+ Note that an Enumerable can change even if it does not implement this mixin.
+ For example, a MappedEnumerable cannot be directly modified but if its
+ underlying enumerable changes, it will change also.
+
+ ## Adding Objects
+
+ To add an object to an enumerable, use the addObject() method. This
+ method will only add the object to the enumerable if the object is not
+ already present and the object if of a type supported by the enumerable.
+
+ set.addObject(contact);
+
+ ## Removing Objects
+
+ To remove an object form an enumerable, use the removeObject() method. This
+ will only remove the object if it is already in the enumerable, otherwise
+ this method has no effect.
+
+ set.removeObject(contact);
+
+ ## Implementing In Your Own Code
+
+ If you are implementing an object and want to support this API, just include
+ this mixin in your class and implement the required methods. In your unit
+ tests, be sure to apply the Ember.MutableEnumerableTests to your object.
+
+ @extends Ember.Mixin
+ @extends Ember.Enumerable
+*/
+Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable,
+ /** @scope Ember.MutableEnumerable.prototype */ {
+
+ /**
+ __Required.__ You must implement this method to apply this mixin.
+
+ Attempts to add the passed object to the receiver if the object is not
+ already present in the collection. If the object is present, this method
+ has no effect.
+
+ If the passed object is of a type not supported by the receiver
+ then this method should raise an exception.
+
+ @function
+
+ @param {Object} object
+ The object to add to the enumerable.
+
+ @returns {Object} the passed object
+ */
+ addObject: Ember.required(Function),
+
+ /**
+ Adds each object in the passed enumerable to the receiver.
+
+ @param {Ember.Enumerable} objects the objects to add.
+ @returns {Object} receiver
+ */
+ addObjects: function(objects) {
+ Ember.beginPropertyChanges(this);
+ forEach(objects, function(obj) { this.addObject(obj); }, this);
+ Ember.endPropertyChanges(this);
+ return this;
+ },
+
+ /**
+ __Required.__ You must implement this method to apply this mixin.
+
+ Attempts to remove the passed object from the receiver collection if the
+ object is in present in the collection. If the object is not present,
+ this method has no effect.
+
+ If the passed object is of a type not supported by the receiver
+ then this method should raise an exception.
+
+ @function
+
+ @param {Object} object
+ The object to remove from the enumerable.
+
+ @returns {Object} the passed object
+ */
+ removeObject: Ember.required(Function),
+
+
+ /**
+ Removes each objects in the passed enumerable from the receiver.
+
+ @param {Ember.Enumerable} objects the objects to remove
+ @returns {Object} receiver
+ */
+ removeObjects: function(objects) {
+ Ember.beginPropertyChanges(this);
+ forEach(objects, function(obj) { this.removeObject(obj); }, this);
+ Ember.endPropertyChanges(this);
+ return this;
+ }
+
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+// ..........................................................
+// CONSTANTS
+//
+
+var OUT_OF_RANGE_EXCEPTION = "Index out of range" ;
+var EMPTY = [];
+
+// ..........................................................
+// HELPERS
+//
+
+var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;
+
+/**
+ @class
+
+ This mixin defines the API for modifying array-like objects. These methods
+ can be applied only to a collection that keeps its items in an ordered set.
+
+ Note that an Array can change even if it does not implement this mixin.
+ For example, one might implement a SparseArray that cannot be directly
+ modified, but if its underlying enumerable changes, it will change also.
+
+ @extends Ember.Mixin
+ @extends Ember.Array
+ @extends Ember.MutableEnumerable
+*/
+Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
+ /** @scope Ember.MutableArray.prototype */ {
+
+ /**
+ __Required.__ You must implement this method to apply this mixin.
+
+ This is one of the primitives you must implement to support Ember.Array. You
+ should replace amt objects started at idx with the objects in the passed
+ array. You should also call this.enumerableContentDidChange() ;
+
+ @function
+
+ @param {Number} idx
+ Starting index in the array to replace. If idx >= length, then append
+ to the end of the array.
+
+ @param {Number} amt
+ Number of elements that should be removed from the array, starting at
+ *idx*.
+
+ @param {Array} objects
+ An array of zero or more objects that should be inserted into the array
+ at *idx*
+ */
+ replace: Ember.required(),
+
+ /**
+ Remove all elements from self. This is useful if you
+ want to reuse an existing array without having to recreate it.
+
+ var colors = ["red", "green", "blue"];
+ color.length(); => 3
+ colors.clear(); => []
+ colors.length(); => 0
+
+ @returns {Ember.Array} An empty Array.
+ */
+ clear: function () {
+ var len = get(this, 'length');
+ if (len === 0) return this;
+ this.replace(0, len, EMPTY);
+ return this;
+ },
+
+ /**
+ This will use the primitive replace() method to insert an object at the
+ specified index.
+
+ var colors = ["red", "green", "blue"];
+ colors.insertAt(2, "yellow"); => ["red", "green", "yellow", "blue"]
+ colors.insertAt(5, "orange"); => Error: Index out of range
+
+ @param {Number} idx index of insert the object at.
+ @param {Object} object object to insert
+ */
+ insertAt: function(idx, object) {
+ if (idx > get(this, 'length')) throw new Error(OUT_OF_RANGE_EXCEPTION) ;
+ this.replace(idx, 0, [object]) ;
+ return this ;
+ },
+
+ /**
+ Remove an object at the specified index using the replace() primitive
+ method. You can pass either a single index, or a start and a length.
+
+ If you pass a start and length that is beyond the
+ length this method will throw an Ember.OUT_OF_RANGE_EXCEPTION
+
+ var colors = ["red", "green", "blue", "yellow", "orange"];
+ colors.removeAt(0); => ["green", "blue", "yellow", "orange"]
+ colors.removeAt(2, 2); => ["green", "blue"]
+ colors.removeAt(4, 2); => Error: Index out of range
+
+ @param {Number} start index, start of range
+ @param {Number} len length of passing range
+ @returns {Object} receiver
+ */
+ removeAt: function(start, len) {
+
+ var delta = 0;
+
+ if ('number' === typeof start) {
+
+ if ((start < 0) || (start >= get(this, 'length'))) {
+ throw new Error(OUT_OF_RANGE_EXCEPTION);
+ }
+
+ // fast case
+ if (len === undefined) len = 1;
+ this.replace(start, len, EMPTY);
+ }
+
+ return this ;
+ },
+
+ /**
+ Push the object onto the end of the array. Works just like push() but it
+ is KVO-compliant.
+
+ var colors = ["red", "green", "blue"];
+ colors.pushObject("black"); => ["red", "green", "blue", "black"]
+ colors.pushObject(["yellow", "orange"]); => ["red", "green", "blue", "black", ["yellow", "orange"]]
+
+ */
+ pushObject: function(obj) {
+ this.insertAt(get(this, 'length'), obj) ;
+ return obj ;
+ },
+
+ /**
+ Add the objects in the passed numerable to the end of the array. Defers
+ notifying observers of the change until all objects are added.
+
+ var colors = ["red", "green", "blue"];
+ colors.pushObjects("black"); => ["red", "green", "blue", "black"]
+ colors.pushObjects(["yellow", "orange"]); => ["red", "green", "blue", "black", "yellow", "orange"]
+
+ @param {Ember.Enumerable} objects the objects to add
+ @returns {Ember.Array} receiver
+ */
+ pushObjects: function(objects) {
+ this.replace(get(this, 'length'), 0, objects);
+ return this;
+ },
+
+ /**
+ Pop object from array or nil if none are left. Works just like pop() but
+ it is KVO-compliant.
+
+ var colors = ["red", "green", "blue"];
+ colors.popObject(); => "blue"
+ console.log(colors); => ["red", "green"]
+
+ */
+ popObject: function() {
+ var len = get(this, 'length') ;
+ if (len === 0) return null ;
+
+ var ret = this.objectAt(len-1) ;
+ this.removeAt(len-1, 1) ;
+ return ret ;
+ },
+
+ /**
+ Shift an object from start of array or nil if none are left. Works just
+ like shift() but it is KVO-compliant.
+
+ var colors = ["red", "green", "blue"];
+ colors.shiftObject(); => "red"
+ console.log(colors); => ["green", "blue"]
+
+ */
+ shiftObject: function() {
+ if (get(this, 'length') === 0) return null ;
+ var ret = this.objectAt(0) ;
+ this.removeAt(0) ;
+ return ret ;
+ },
+
+ /**
+ Unshift an object to start of array. Works just like unshift() but it is
+ KVO-compliant.
+
+ var colors = ["red", "green", "blue"];
+ colors.unshiftObject("yellow"); => ["yellow", "red", "green", "blue"]
+ colors.unshiftObject(["black", "white"]); => [["black", "white"], "yellow", "red", "green", "blue"]
+
+ */
+ unshiftObject: function(obj) {
+ this.insertAt(0, obj) ;
+ return obj ;
+ },
+
+ /**
+ Adds the named objects to the beginning of the array. Defers notifying
+ observers until all objects have been added.
+
+ var colors = ["red", "green", "blue"];
+ colors.unshiftObjects(["black", "white"]); => ["black", "white", "red", "green", "blue"]
+ colors.unshiftObjects("yellow"); => Type Error: 'undefined' is not a function
+
+ @param {Ember.Enumerable} objects the objects to add
+ @returns {Ember.Array} receiver
+ */
+ unshiftObjects: function(objects) {
+ this.replace(0, 0, objects);
+ return this;
+ },
+
+ /**
+ Reverse objects in the array. Works just like reverse() but it is
+ KVO-compliant.
+
+ @return {Ember.Array} receiver
+ */
+ reverseObjects: function() {
+ var len = get(this, 'length');
+ if (len === 0) return this;
+ var objects = this.toArray().reverse();
+ this.replace(0, len, objects);
+ return this;
+ },
+
+ // ..........................................................
+ // IMPLEMENT Ember.MutableEnumerable
+ //
+
+ /** @private (nodoc) */
+ removeObject: function(obj) {
+ var loc = get(this, 'length') || 0;
+ while(--loc >= 0) {
+ var curObject = this.objectAt(loc) ;
+ if (curObject === obj) this.removeAt(loc) ;
+ }
+ return this ;
+ },
+
+ /** @private (nodoc) */
+ addObject: function(obj) {
+ if (!this.contains(obj)) this.pushObject(obj);
+ return this ;
+ }
+
+});
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
+
+/**
+ @class
+
+ ## Overview
+
+ This mixin provides properties and property observing functionality, core
+ features of the Ember object model.
+
+ Properties and observers allow one object to observe changes to a
+ property on another object. This is one of the fundamental ways that
+ models, controllers and views communicate with each other in an Ember
+ application.
+
+ Any object that has this mixin applied can be used in observer
+ operations. That includes Ember.Object and most objects you will
+ interact with as you write your Ember application.
+
+ Note that you will not generally apply this mixin to classes yourself,
+ but you will use the features provided by this module frequently, so it
+ is important to understand how to use it.
+
+ ## Using get() and set()
+
+ Because of Ember's support for bindings and observers, you will always
+ access properties using the get method, and set properties using the
+ set method. This allows the observing objects to be notified and
+ computed properties to be handled properly.
+
+ More documentation about `get` and `set` are below.
+
+ ## Observing Property Changes
+
+ You typically observe property changes simply by adding the `observes`
+ call to the end of your method declarations in classes that you write.
+ For example:
+
+ Ember.Object.create({
+ valueObserver: function() {
+ // Executes whenever the "value" property changes
+ }.observes('value')
+ });
+
+ Although this is the most common way to add an observer, this capability
+ is actually built into the Ember.Object class on top of two methods
+ defined in this mixin: `addObserver` and `removeObserver`. You can use
+ these two methods to add and remove observers yourself if you need to
+ do so at runtime.
+
+ To add an observer for a property, call:
+
+ object.addObserver('propertyKey', targetObject, targetAction)
+
+ This will call the `targetAction` method on the `targetObject` to be called
+ whenever the value of the `propertyKey` changes.
+
+ Note that if `propertyKey` is a computed property, the observer will be
+ called when any of the property dependencies are changed, even if the
+ resulting value of the computed property is unchanged. This is necessary
+ because computed properties are not computed until `get` is called.
+
+ @extends Ember.Mixin
+*/
+Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
+
+ /** @private - compatibility */
+ isObserverable: true,
+
+ /**
+ Retrieves the value of a property from the object.
+
+ This method is usually similar to using object[keyName] or object.keyName,
+ however it supports both computed properties and the unknownProperty
+ handler.
+
+ Because `get` unifies the syntax for accessing all these kinds
+ of properties, it can make many refactorings easier, such as replacing a
+ simple property with a computed property, or vice versa.
+
+ ### Computed Properties
+
+ Computed properties are methods defined with the `property` modifier
+ declared at the end, such as:
+
+ fullName: function() {
+ return this.getEach('firstName', 'lastName').compact().join(' ');
+ }.property('firstName', 'lastName')
+
+ When you call `get` on a computed property, the function will be
+ called and the return value will be returned instead of the function
+ itself.
+
+ ### Unknown Properties
+
+ Likewise, if you try to call `get` on a property whose value is
+ undefined, the unknownProperty() method will be called on the object.
+ If this method returns any value other than undefined, it will be returned
+ instead. This allows you to implement "virtual" properties that are
+ not defined upfront.
+
+ @param {String} key The property to retrieve
+ @returns {Object} The property value or undefined.
+ */
+ get: function(keyName) {
+ return get(this, keyName);
+ },
+
+ /**
+ To get multiple properties at once, call getProperties
+ with a list of strings or an array:
+
+ record.getProperties('firstName', 'lastName', 'zipCode'); // => { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
+
+ is equivalent to:
+
+ record.getProperties(['firstName', 'lastName', 'zipCode']); // => { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
+
+ @param {String...|Array} list of keys to get
+ @returns {Hash}
+ */
+ getProperties: function() {
+ var ret = {};
+ var propertyNames = arguments;
+ if (arguments.length === 1 && Ember.typeOf(arguments[0]) === 'array') {
+ propertyNames = arguments[0];
+ }
+ for(var i = 0; i < propertyNames.length; i++) {
+ ret[propertyNames[i]] = get(this, propertyNames[i]);
+ }
+ return ret;
+ },
+
+ /**
+ Sets the provided key or path to the value.
+
+ This method is generally very similar to calling object[key] = value or
+ object.key = value, except that it provides support for computed
+ properties, the unknownProperty() method and property observers.
+
+ ### Computed Properties
+
+ If you try to set a value on a key that has a computed property handler
+ defined (see the get() method for an example), then set() will call
+ that method, passing both the value and key instead of simply changing
+ the value itself. This is useful for those times when you need to
+ implement a property that is composed of one or more member
+ properties.
+
+ ### Unknown Properties
+
+ If you try to set a value on a key that is undefined in the target
+ object, then the unknownProperty() handler will be called instead. This
+ gives you an opportunity to implement complex "virtual" properties that
+ are not predefined on the object. If unknownProperty() returns
+ undefined, then set() will simply set the value on the object.
+
+ ### Property Observers
+
+ In addition to changing the property, set() will also register a
+ property change with the object. Unless you have placed this call
+ inside of a beginPropertyChanges() and endPropertyChanges(), any "local"
+ observers (i.e. observer methods declared on the same object), will be
+ called immediately. Any "remote" observers (i.e. observer methods
+ declared on another object) will be placed in a queue and called at a
+ later time in a coalesced manner.
+
+ ### Chaining
+
+ In addition to property changes, set() returns the value of the object
+ itself so you can do chaining like this:
+
+ record.set('firstName', 'Charles').set('lastName', 'Jolley');
+
+ @param {String} key The property to set
+ @param {Object} value The value to set or null.
+ @returns {Ember.Observable}
+ */
+ set: function(keyName, value) {
+ set(this, keyName, value);
+ return this;
+ },
+
+ /**
+ To set multiple properties at once, call setProperties
+ with a Hash:
+
+ record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
+
+ @param {Hash} hash the hash of keys and values to set
+ @returns {Ember.Observable}
+ */
+ setProperties: function(hash) {
+ return Ember.setProperties(this, hash);
+ },
+
+ /**
+ Begins a grouping of property changes.
+
+ You can use this method to group property changes so that notifications
+ will not be sent until the changes are finished. If you plan to make a
+ large number of changes to an object at one time, you should call this
+ method at the beginning of the changes to begin deferring change
+ notifications. When you are done making changes, call endPropertyChanges()
+ to deliver the deferred change notifications and end deferring.
+
+ @returns {Ember.Observable}
+ */
+ beginPropertyChanges: function() {
+ Ember.beginPropertyChanges();
+ return this;
+ },
+
+ /**
+ Ends a grouping of property changes.
+
+ You can use this method to group property changes so that notifications
+ will not be sent until the changes are finished. If you plan to make a
+ large number of changes to an object at one time, you should call
+ beginPropertyChanges() at the beginning of the changes to defer change
+ notifications. When you are done making changes, call this method to
+ deliver the deferred change notifications and end deferring.
+
+ @returns {Ember.Observable}
+ */
+ endPropertyChanges: function() {
+ Ember.endPropertyChanges();
+ return this;
+ },
+
+ /**
+ Notify the observer system that a property is about to change.
+
+ Sometimes you need to change a value directly or indirectly without
+ actually calling get() or set() on it. In this case, you can use this
+ method and propertyDidChange() instead. Calling these two methods
+ together will notify all observers that the property has potentially
+ changed value.
+
+ Note that you must always call propertyWillChange and propertyDidChange as
+ a pair. If you do not, it may get the property change groups out of order
+ and cause notifications to be delivered more often than you would like.
+
+ @param {String} key The property key that is about to change.
+ @returns {Ember.Observable}
+ */
+ propertyWillChange: function(keyName){
+ Ember.propertyWillChange(this, keyName);
+ return this;
+ },
+
+ /**
+ Notify the observer system that a property has just changed.
+
+ Sometimes you need to change a value directly or indirectly without
+ actually calling get() or set() on it. In this case, you can use this
+ method and propertyWillChange() instead. Calling these two methods
+ together will notify all observers that the property has potentially
+ changed value.
+
+ Note that you must always call propertyWillChange and propertyDidChange as
+ a pair. If you do not, it may get the property change groups out of order
+ and cause notifications to be delivered more often than you would like.
+
+ @param {String} keyName The property key that has just changed.
+ @returns {Ember.Observable}
+ */
+ propertyDidChange: function(keyName) {
+ Ember.propertyDidChange(this, keyName);
+ return this;
+ },
+
+ /**
+ Convenience method to call `propertyWillChange` and `propertyDidChange` in
+ succession.
+
+ @param {String} keyName The property key to be notified about.
+ @returns {Ember.Observable}
+ */
+ notifyPropertyChange: function(keyName) {
+ this.propertyWillChange(keyName);
+ this.propertyDidChange(keyName);
+ return this;
+ },
+
+ addBeforeObserver: function(key, target, method) {
+ Ember.addBeforeObserver(this, key, target, method);
+ },
+
+ /**
+ Adds an observer on a property.
+
+ This is the core method used to register an observer for a property.
+
+ Once you call this method, anytime the key's value is set, your observer
+ will be notified. Note that the observers are triggered anytime the
+ value is set, regardless of whether it has actually changed. Your
+ observer should be prepared to handle that.
+
+ You can also pass an optional context parameter to this method. The
+ context will be passed to your observer method whenever it is triggered.
+ Note that if you add the same target/method pair on a key multiple times
+ with different context parameters, your observer will only be called once
+ with the last context you passed.
+
+ ### Observer Methods
+
+ Observer methods you pass should generally have the following signature if
+ you do not pass a "context" parameter:
+
+ fooDidChange: function(sender, key, value, rev);
+
+ The sender is the object that changed. The key is the property that
+ changes. The value property is currently reserved and unused. The rev
+ is the last property revision of the object when it changed, which you can
+ use to detect if the key value has really changed or not.
+
+ If you pass a "context" parameter, the context will be passed before the
+ revision like so:
+
+ fooDidChange: function(sender, key, value, context, rev);
+
+ Usually you will not need the value, context or revision parameters at
+ the end. In this case, it is common to write observer methods that take
+ only a sender and key value as parameters or, if you aren't interested in
+ any of these values, to write an observer that has no parameters at all.
+
+ @param {String} key The key to observer
+ @param {Object} target The target object to invoke
+ @param {String|Function} method The method to invoke.
+ @returns {Ember.Object} self
+ */
+ addObserver: function(key, target, method) {
+ Ember.addObserver(this, key, target, method);
+ },
+
+ /**
+ Remove an observer you have previously registered on this object. Pass
+ the same key, target, and method you passed to addObserver() and your
+ target will no longer receive notifications.
+
+ @param {String} key The key to observer
+ @param {Object} target The target object to invoke
+ @param {String|Function} method The method to invoke.
+ @returns {Ember.Observable} receiver
+ */
+ removeObserver: function(key, target, method) {
+ Ember.removeObserver(this, key, target, method);
+ },
+
+ /**
+ Returns true if the object currently has observers registered for a
+ particular key. You can use this method to potentially defer performing
+ an expensive action until someone begins observing a particular property
+ on the object.
+
+ @param {String} key Key to check
+ @returns {Boolean}
+ */
+ hasObserverFor: function(key) {
+ return Ember.hasListeners(this, key+':change');
+ },
+
+ /**
+ This method will be called when a client attempts to get the value of a
+ property that has not been defined in one of the typical ways. Override
+ this method to create "virtual" properties.
+
+ @param {String} key The name of the unknown property that was requested.
+ @returns {Object} The property value or undefined. Default is undefined.
+ */
+ unknownProperty: function(key) {
+ return undefined;
+ },
+
+ /**
+ This method will be called when a client attempts to set the value of a
+ property that has not been defined in one of the typical ways. Override
+ this method to create "virtual" properties.
+
+ @param {String} key The name of the unknown property to be set.
+ @param {Object} value The value the unknown property is to be set to.
+ */
+ setUnknownProperty: function(key, value) {
+ defineProperty(this, key);
+ set(this, key, value);
+ },
+
+ /**
+ @deprecated
+ @param {String} path The property path to retrieve
+ @returns {Object} The property value or undefined.
+ */
+ getPath: function(path) {
+ Ember.deprecate("getPath is deprecated since get now supports paths");
+ return this.get(path);
+ },
+
+ /**
+ @deprecated
+ @param {String} path The path to the property that will be set
+ @param {Object} value The value to set or null.
+ @returns {Ember.Observable}
+ */
+ setPath: function(path, value) {
+ Ember.deprecate("setPath is deprecated since set now supports paths");
+ return this.set(path, value);
+ },
+
+ /**
+ Retrieves the value of a property, or a default value in the case that the property
+ returns undefined.
+
+ person.getWithDefault('lastName', 'Doe');
+
+ @param {String} keyName The name of the property to retrieve
+ @param {Object} defaultValue The value to return if the property value is undefined
+ @returns {Object} The property value or the defaultValue.
+ */
+ getWithDefault: function(keyName, defaultValue) {
+ return Ember.getWithDefault(this, keyName, defaultValue);
+ },
+
+ /**
+ Set the value of a property to the current value plus some amount.
+
+ person.incrementProperty('age');
+ team.incrementProperty('score', 2);
+
+ @param {String} keyName The name of the property to increment
+ @param {Object} increment The amount to increment by. Defaults to 1
+ @returns {Object} The new property value
+ */
+ incrementProperty: function(keyName, increment) {
+ if (!increment) { increment = 1; }
+ set(this, keyName, (get(this, keyName) || 0)+increment);
+ return get(this, keyName);
+ },
+
+ /**
+ Set the value of a property to the current value minus some amount.
+
+ player.decrementProperty('lives');
+ orc.decrementProperty('health', 5);
+
+ @param {String} keyName The name of the property to decrement
+ @param {Object} increment The amount to decrement by. Defaults to 1
+ @returns {Object} The new property value
+ */
+ decrementProperty: function(keyName, increment) {
+ if (!increment) { increment = 1; }
+ set(this, keyName, (get(this, keyName) || 0)-increment);
+ return get(this, keyName);
+ },
+
+ /**
+ Set the value of a boolean property to the opposite of it's
+ current value.
+
+ starship.toggleProperty('warpDriveEnaged');
+
+ @param {String} keyName The name of the property to toggle
+ @returns {Object} The new property value
+ */
+ toggleProperty: function(keyName) {
+ set(this, keyName, !get(this, keyName));
+ return get(this, keyName);
+ },
+
+ /**
+ Returns the cached value of a computed property, if it exists.
+ This allows you to inspect the value of a computed property
+ without accidentally invoking it if it is intended to be
+ generated lazily.
+
+ @param {String} keyName
+ @returns {Object} The cached value of the computed property, if any
+ */
+ cacheFor: function(keyName) {
+ return Ember.cacheFor(this, keyName);
+ },
+
+ /** @private - intended for debugging purposes */
+ observersForKey: function(keyName) {
+ return Ember.observersFor(this, keyName);
+ }
+});
+
+
+
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+Ember.TargetActionSupport = Ember.Mixin.create({
+ target: null,
+ action: null,
+
+ targetObject: Ember.computed(function() {
+ var target = get(this, 'target');
+
+ if (Ember.typeOf(target) === "string") {
+ var value = get(this, target);
+ if (value === undefined) { value = get(window, target); }
+ return value;
+ } else {
+ return target;
+ }
+ }).property('target').cacheable(),
+
+ triggerAction: function() {
+ var action = get(this, 'action'),
+ target = get(this, 'targetObject');
+
+ if (target && action) {
+ var ret;
+
+ if (typeof target.send === 'function') {
+ ret = target.send(action, this);
+ } else {
+ if (typeof action === 'string') {
+ action = target[action];
+ }
+ ret = action.call(target, this);
+ }
+ if (ret !== false) ret = true;
+
+ return ret;
+ } else {
+ return false;
+ }
+ }
+});
+
+})();
+
+
+
+(function() {
+/**
+ @class
+
+ @extends Ember.Mixin
+ */
+Ember.Evented = Ember.Mixin.create(
+ /** @scope Ember.Evented.prototype */ {
+ on: function(name, target, method) {
+ Ember.addListener(this, name, target, method);
+ },
+
+ one: function(name, target, method) {
+ if (!method) {
+ method = target;
+ target = null;
+ }
+
+ var self = this;
+ var wrapped = function() {
+ Ember.removeListener(self, name, target, wrapped);
+
+ if ('string' === typeof method) { method = this[method]; }
+
+ // Internally, a `null` target means that the target is
+ // the first parameter to addListener. That means that
+ // the `this` passed into this function is the target
+ // determined by the event system.
+ method.apply(this, arguments);
+ };
+
+ this.on(name, target, wrapped);
+ },
+
+ trigger: function(name) {
+ var args = [], i, l;
+ for (i = 1, l = arguments.length; i < l; i++) {
+ args.push(arguments[i]);
+ }
+ Ember.sendEvent(this, name, args);
+ },
+
+ fire: function(name) {
+ Ember.deprecate("Ember.Evented#fire() has been deprecated in favor of trigger() for compatibility with jQuery. It will be removed in 1.0. Please update your code to call trigger() instead.");
+ this.trigger.apply(this, arguments);
+ },
+
+ off: function(name, target, method) {
+ Ember.removeListener(this, name, target, method);
+ },
+
+ has: function(name) {
+ return Ember.hasListeners(this, name);
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+
+
+// NOTE: this object should never be included directly. Instead use Ember.
+// Ember.Object. We only define this separately so that Ember.Set can depend on it
+
+
+
+var classToString = Ember.Mixin.prototype.toString;
+var set = Ember.set, get = Ember.get;
+var o_create = Ember.create,
+ o_defineProperty = Ember.platform.defineProperty,
+ a_slice = Array.prototype.slice,
+ meta = Ember.meta,
+ rewatch = Ember.rewatch,
+ finishChains = Ember.finishChains,
+ finishPartial = Ember.Mixin.finishPartial,
+ reopen = Ember.Mixin.prototype.reopen;
+
+var undefinedDescriptor = {
+ configurable: true,
+ writable: true,
+ enumerable: false,
+ value: undefined
+};
+
+/** @private */
+function makeCtor() {
+
+ // Note: avoid accessing any properties on the object since it makes the
+ // method a lot faster. This is glue code so we want it to be as fast as
+ // possible.
+
+ var wasApplied = false, initMixins;
+
+ var Class = function() {
+ if (!wasApplied) {
+ Class.proto(); // prepare prototype...
+ }
+ var m = Ember.meta(this);
+ m.proto = this;
+ if (initMixins) {
+ this.reopen.apply(this, initMixins);
+ initMixins = null;
+ }
+ o_defineProperty(this, Ember.GUID_KEY, undefinedDescriptor);
+ o_defineProperty(this, '_super', undefinedDescriptor);
+ finishPartial(this, m);
+ delete m.proto;
+ finishChains(this);
+ this.init.apply(this, arguments);
+ };
+
+ Class.toString = classToString;
+ Class.willReopen = function() {
+ if (wasApplied) {
+ Class.PrototypeMixin = Ember.Mixin.create(Class.PrototypeMixin);
+ }
+
+ wasApplied = false;
+ };
+ Class._initMixins = function(args) { initMixins = args; };
+
+ Class.proto = function() {
+ var superclass = Class.superclass;
+ if (superclass) { superclass.proto(); }
+
+ if (!wasApplied) {
+ wasApplied = true;
+ Class.PrototypeMixin.applyPartial(Class.prototype);
+ rewatch(Class.prototype);
+ }
+
+ return this.prototype;
+ };
+
+ return Class;
+
+}
+
+var CoreObject = makeCtor();
+
+CoreObject.PrototypeMixin = Ember.Mixin.create(
+/** @scope Ember.CoreObject.prototype */ {
+
+ reopen: function() {
+ Ember.Mixin._apply(this, arguments, true);
+ return this;
+ },
+
+ isInstance: true,
+
+ /** @private */
+ init: function() {},
+
+ /** @field */
+ isDestroyed: false,
+
+ /** @field */
+ isDestroying: false,
+
+ /**
+ Destroys an object by setting the isDestroyed flag and removing its
+ metadata, which effectively destroys observers and bindings.
+
+ If you try to set a property on a destroyed object, an exception will be
+ raised.
+
+ Note that destruction is scheduled for the end of the run loop and does not
+ happen immediately.
+
+ @returns {Ember.Object} receiver
+ */
+ destroy: function() {
+ if (this.isDestroying) { return; }
+
+ this.isDestroying = true;
+
+ if (this.willDestroy) { this.willDestroy(); }
+
+ set(this, 'isDestroyed', true);
+ Ember.run.schedule('destroy', this, this._scheduledDestroy);
+ return this;
+ },
+
+ /**
+ Invoked by the run loop to actually destroy the object. This is
+ scheduled for execution by the `destroy` method.
+
+ @private
+ */
+ _scheduledDestroy: function() {
+ Ember.destroy(this);
+ if (this.didDestroy) { this.didDestroy(); }
+ },
+
+ bind: function(to, from) {
+ if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }
+ from.to(to).connect(this);
+ return from;
+ },
+
+ toString: function() {
+ return '<'+this.constructor.toString()+':'+Ember.guidFor(this)+'>';
+ }
+});
+
+if (Ember.config.overridePrototypeMixin) {
+ Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);
+}
+
+CoreObject.__super__ = null;
+
+var ClassMixin = Ember.Mixin.create(
+/** @scope Ember.ClassMixin.prototype */ {
+
+ ClassMixin: Ember.required(),
+
+ PrototypeMixin: Ember.required(),
+
+ isClass: true,
+
+ isMethod: false,
+
+ extend: function() {
+ var Class = makeCtor(), proto;
+ Class.ClassMixin = Ember.Mixin.create(this.ClassMixin);
+ Class.PrototypeMixin = Ember.Mixin.create(this.PrototypeMixin);
+
+ Class.ClassMixin.ownerConstructor = Class;
+ Class.PrototypeMixin.ownerConstructor = Class;
+
+ reopen.apply(Class.PrototypeMixin, arguments);
+
+ Class.superclass = this;
+ Class.__super__ = this.prototype;
+
+ proto = Class.prototype = o_create(this.prototype);
+ proto.constructor = Class;
+ Ember.generateGuid(proto, 'ember');
+ meta(proto).proto = proto; // this will disable observers on prototype
+
+ Class.ClassMixin.apply(Class);
+ return Class;
+ },
+
+ create: function() {
+ var C = this;
+ if (arguments.length>0) { this._initMixins(arguments); }
+ return new C();
+ },
+
+ reopen: function() {
+ this.willReopen();
+ reopen.apply(this.PrototypeMixin, arguments);
+ return this;
+ },
+
+ reopenClass: function() {
+ reopen.apply(this.ClassMixin, arguments);
+ Ember.Mixin._apply(this, arguments, false);
+ return this;
+ },
+
+ detect: function(obj) {
+ if ('function' !== typeof obj) { return false; }
+ while(obj) {
+ if (obj===this) { return true; }
+ obj = obj.superclass;
+ }
+ return false;
+ },
+
+ detectInstance: function(obj) {
+ return obj instanceof this;
+ },
+
+ /**
+ In some cases, you may want to annotate computed properties with additional
+ metadata about how they function or what values they operate on. For example,
+ computed property functions may close over variables that are then no longer
+ available for introspection.
+
+ You can pass a hash of these values to a computed property like this:
+
+ person: function() {
+ var personId = this.get('personId');
+ return App.Person.create({ id: personId });
+ }.property().meta({ type: App.Person })
+
+ Once you've done this, you can retrieve the values saved to the computed
+ property from your class like this:
+
+ MyClass.metaForProperty('person');
+
+ This will return the original hash that was passed to `meta()`.
+ */
+ metaForProperty: function(key) {
+ var desc = meta(this.proto(), false).descs[key];
+
+ Ember.assert("metaForProperty() could not find a computed property with key '"+key+"'.", !!desc && desc instanceof Ember.ComputedProperty);
+ return desc._meta || {};
+ },
+
+ /**
+ Iterate over each computed property for the class, passing its name
+ and any associated metadata (see `metaForProperty`) to the callback.
+ */
+ eachComputedProperty: function(callback, binding) {
+ var proto = this.proto(),
+ descs = meta(proto).descs,
+ empty = {},
+ property;
+
+ for (var name in descs) {
+ property = descs[name];
+
+ if (property instanceof Ember.ComputedProperty) {
+ callback.call(binding || this, name, property._meta || empty);
+ }
+ }
+ }
+
+});
+
+if (Ember.config.overrideClassMixin) {
+ Ember.config.overrideClassMixin(ClassMixin);
+}
+
+CoreObject.ClassMixin = ClassMixin;
+ClassMixin.apply(CoreObject);
+
+/**
+ @class
+*/
+Ember.CoreObject = CoreObject;
+
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.none;
+
+/**
+ @class
+
+ An unordered collection of objects.
+
+ A Set works a bit like an array except that its items are not ordered.
+ You can create a set to efficiently test for membership for an object. You
+ can also iterate through a set just like an array, even accessing objects
+ by index, however there is no guarantee as to their order.
+
+ All Sets are observable via the Enumerable Observer API - which works
+ on any enumerable object including both Sets and Arrays.
+
+ ## Creating a Set
+
+ You can create a set like you would most objects using
+ `new Ember.Set()`. Most new sets you create will be empty, but you can
+ also initialize the set with some content by passing an array or other
+ enumerable of objects to the constructor.
+
+ Finally, you can pass in an existing set and the set will be copied. You
+ can also create a copy of a set by calling `Ember.Set#copy()`.
+
+ #js
+ // creates a new empty set
+ var foundNames = new Ember.Set();
+
+ // creates a set with four names in it.
+ var names = new Ember.Set(["Charles", "Tom", "Juan", "Alex"]); // :P
+
+ // creates a copy of the names set.
+ var namesCopy = new Ember.Set(names);
+
+ // same as above.
+ var anotherNamesCopy = names.copy();
+
+ ## Adding/Removing Objects
+
+ You generally add or remove objects from a set using `add()` or
+ `remove()`. You can add any type of object including primitives such as
+ numbers, strings, and booleans.
+
+ Unlike arrays, objects can only exist one time in a set. If you call `add()`
+ on a set with the same object multiple times, the object will only be added
+ once. Likewise, calling `remove()` with the same object multiple times will
+ remove the object the first time and have no effect on future calls until
+ you add the object to the set again.
+
+ NOTE: You cannot add/remove null or undefined to a set. Any attempt to do so
+ will be ignored.
+
+ In addition to add/remove you can also call `push()`/`pop()`. Push behaves
+ just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary
+ object, remove it and return it. This is a good way to use a set as a job
+ queue when you don't care which order the jobs are executed in.
+
+ ## Testing for an Object
+
+ To test for an object's presence in a set you simply call
+ `Ember.Set#contains()`.
+
+ ## Observing changes
+
+ When using `Ember.Set`, you can observe the `"[]"` property to be
+ alerted whenever the content changes. You can also add an enumerable
+ observer to the set to be notified of specific objects that are added and
+ removed from the set. See `Ember.Enumerable` for more information on
+ enumerables.
+
+ This is often unhelpful. If you are filtering sets of objects, for instance,
+ it is very inefficient to re-filter all of the items each time the set
+ changes. It would be better if you could just adjust the filtered set based
+ on what was changed on the original set. The same issue applies to merging
+ sets, as well.
+
+ ## Other Methods
+
+ `Ember.Set` primary implements other mixin APIs. For a complete reference
+ on the methods you will use with `Ember.Set`, please consult these mixins.
+ The most useful ones will be `Ember.Enumerable` and
+ `Ember.MutableEnumerable` which implement most of the common iterator
+ methods you are used to on Array.
+
+ Note that you can also use the `Ember.Copyable` and `Ember.Freezable`
+ APIs on `Ember.Set` as well. Once a set is frozen it can no longer be
+ modified. The benefit of this is that when you call frozenCopy() on it,
+ Ember will avoid making copies of the set. This allows you to write
+ code that can know with certainty when the underlying set data will or
+ will not be modified.
+
+ @extends Ember.Enumerable
+ @extends Ember.MutableEnumerable
+ @extends Ember.Copyable
+ @extends Ember.Freezable
+
+ @since Ember 0.9
+*/
+Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,
+ /** @scope Ember.Set.prototype */ {
+
+ // ..........................................................
+ // IMPLEMENT ENUMERABLE APIS
+ //
+
+ /**
+ This property will change as the number of objects in the set changes.
+
+ @type number
+ @default 0
+ */
+ length: 0,
+
+ /**
+ Clears the set. This is useful if you want to reuse an existing set
+ without having to recreate it.
+
+ var colors = new Ember.Set(["red", "green", "blue"]);
+ colors.length; => 3
+ colors.clear();
+ colors.length; => 0
+
+ @returns {Ember.Set} An empty Set
+ */
+ clear: function() {
+ if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }
+
+ var len = get(this, 'length');
+ if (len === 0) { return this; }
+
+ var guid;
+
+ this.enumerableContentWillChange(len, 0);
+ Ember.propertyWillChange(this, 'firstObject');
+ Ember.propertyWillChange(this, 'lastObject');
+
+ for (var i=0; i < len; i++){
+ guid = guidFor(this[i]);
+ delete this[guid];
+ delete this[i];
+ }
+
+ set(this, 'length', 0);
+
+ Ember.propertyDidChange(this, 'firstObject');
+ Ember.propertyDidChange(this, 'lastObject');
+ this.enumerableContentDidChange(len, 0);
+
+ return this;
+ },
+
+ /**
+ Returns true if the passed object is also an enumerable that contains the
+ same objects as the receiver.
+
+ var colors = ["red", "green", "blue"],
+ same_colors = new Ember.Set(colors);
+ same_colors.isEqual(colors); => true
+ same_colors.isEqual(["purple", "brown"]); => false
+
+ @param {Ember.Set} obj the other object.
+ @returns {Boolean}
+ */
+ isEqual: function(obj) {
+ // fail fast
+ if (!Ember.Enumerable.detect(obj)) return false;
+
+ var loc = get(this, 'length');
+ if (get(obj, 'length') !== loc) return false;
+
+ while(--loc >= 0) {
+ if (!obj.contains(this[loc])) return false;
+ }
+
+ return true;
+ },
+
+ /**
+ Adds an object to the set. Only non-null objects can be added to a set
+ and those can only be added once. If the object is already in the set or
+ the passed value is null this method will have no effect.
+
+ This is an alias for `Ember.MutableEnumerable.addObject()`.
+
+ var colors = new Ember.Set();
+ colors.add("blue"); => ["blue"]
+ colors.add("blue"); => ["blue"]
+ colors.add("red"); => ["blue", "red"]
+ colors.add(null); => ["blue", "red"]
+ colors.add(undefined); => ["blue", "red"]
+
+ @function
+ @param {Object} obj The object to add.
+ @returns {Ember.Set} The set itself.
+ */
+ add: Ember.alias('addObject'),
+
+ /**
+ Removes the object from the set if it is found. If you pass a null value
+ or an object that is already not in the set, this method will have no
+ effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.
+
+ var colors = new Ember.Set(["red", "green", "blue"]);
+ colors.remove("red"); => ["blue", "green"]
+ colors.remove("purple"); => ["blue", "green"]
+ colors.remove(null); => ["blue", "green"]
+
+ @function
+ @param {Object} obj The object to remove
+ @returns {Ember.Set} The set itself.
+ */
+ remove: Ember.alias('removeObject'),
+
+ /**
+ Removes the last element from the set and returns it, or null if it's empty.
+
+ var colors = new Ember.Set(["green", "blue"]);
+ colors.pop(); => "blue"
+ colors.pop(); => "green"
+ colors.pop(); => null
+
+ @returns {Object} The removed object from the set or null.
+ */
+ pop: function() {
+ if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
+ var obj = this.length > 0 ? this[this.length-1] : null;
+ this.remove(obj);
+ return obj;
+ },
+
+ /**
+ Inserts the given object on to the end of the set. It returns
+ the set itself.
+
+ This is an alias for `Ember.MutableEnumerable.addObject()`.
+
+ var colors = new Ember.Set();
+ colors.push("red"); => ["red"]
+ colors.push("green"); => ["red", "green"]
+ colors.push("blue"); => ["red", "green", "blue"]
+
+ @function
+ @returns {Ember.Set} The set itself.
+ */
+ push: Ember.alias('addObject'),
+
+ /**
+ Removes the last element from the set and returns it, or null if it's empty.
+
+ This is an alias for `Ember.Set.pop()`.
+
+ var colors = new Ember.Set(["green", "blue"]);
+ colors.shift(); => "blue"
+ colors.shift(); => "green"
+ colors.shift(); => null
+
+ @function
+ @returns {Object} The removed object from the set or null.
+ */
+ shift: Ember.alias('pop'),
+
+ /**
+ Inserts the given object on to the end of the set. It returns
+ the set itself.
+
+ This is an alias of `Ember.Set.push()`
+
+ var colors = new Ember.Set();
+ colors.unshift("red"); => ["red"]
+ colors.unshift("green"); => ["red", "green"]
+ colors.unshift("blue"); => ["red", "green", "blue"]
+
+ @function
+ @returns {Ember.Set} The set itself.
+ */
+ unshift: Ember.alias('push'),
+
+ /**
+ Adds each object in the passed enumerable to the set.
+
+ This is an alias of `Ember.MutableEnumerable.addObjects()`
+
+ var colors = new Ember.Set();
+ colors.addEach(["red", "green", "blue"]); => ["red", "green", "blue"]
+
+ @function
+ @param {Ember.Enumerable} objects the objects to add.
+ @returns {Ember.Set} The set itself.
+ */
+ addEach: Ember.alias('addObjects'),
+
+ /**
+ Removes each object in the passed enumerable to the set.
+
+ This is an alias of `Ember.MutableEnumerable.removeObjects()`
+
+ var colors = new Ember.Set(["red", "green", "blue"]);
+ colors.removeEach(["red", "blue"]); => ["green"]
+
+ @function
+ @param {Ember.Enumerable} objects the objects to remove.
+ @returns {Ember.Set} The set itself.
+ */
+ removeEach: Ember.alias('removeObjects'),
+
+ // ..........................................................
+ // PRIVATE ENUMERABLE SUPPORT
+ //
+
+ /** @private */
+ init: function(items) {
+ this._super();
+ if (items) this.addObjects(items);
+ },
+
+ /** @private (nodoc) - implement Ember.Enumerable */
+ nextObject: function(idx) {
+ return this[idx];
+ },
+
+ /** @private - more optimized version */
+ firstObject: Ember.computed(function() {
+ return this.length > 0 ? this[0] : undefined;
+ }).property().cacheable(),
+
+ /** @private - more optimized version */
+ lastObject: Ember.computed(function() {
+ return this.length > 0 ? this[this.length-1] : undefined;
+ }).property().cacheable(),
+
+ /** @private (nodoc) - implements Ember.MutableEnumerable */
+ addObject: function(obj) {
+ if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
+ if (none(obj)) return this; // nothing to do
+
+ var guid = guidFor(obj),
+ idx = this[guid],
+ len = get(this, 'length'),
+ added ;
+
+ if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added
+
+ added = [obj];
+
+ this.enumerableContentWillChange(null, added);
+ Ember.propertyWillChange(this, 'lastObject');
+
+ len = get(this, 'length');
+ this[guid] = len;
+ this[len] = obj;
+ set(this, 'length', len+1);
+
+ Ember.propertyDidChange(this, 'lastObject');
+ this.enumerableContentDidChange(null, added);
+
+ return this;
+ },
+
+ /** @private (nodoc) - implements Ember.MutableEnumerable */
+ removeObject: function(obj) {
+ if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
+ if (none(obj)) return this; // nothing to do
+
+ var guid = guidFor(obj),
+ idx = this[guid],
+ len = get(this, 'length'),
+ isFirst = idx === 0,
+ isLast = idx === len-1,
+ last, removed;
+
+
+ if (idx>=0 && idx<len && (this[idx] === obj)) {
+ removed = [obj];
+
+ this.enumerableContentWillChange(removed, null);
+ if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }
+ if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
+
+ // swap items - basically move the item to the end so it can be removed
+ if (idx < len-1) {
+ last = this[len-1];
+ this[idx] = last;
+ this[guidFor(last)] = idx;
+ }
+
+ delete this[guid];
+ delete this[len-1];
+ set(this, 'length', len-1);
+
+ if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }
+ if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }
+ this.enumerableContentDidChange(removed, null);
+ }
+
+ return this;
+ },
+
+ /** @private (nodoc) - optimized version */
+ contains: function(obj) {
+ return this[guidFor(obj)]>=0;
+ },
+
+ /** @private (nodoc) */
+ copy: function() {
+ var C = this.constructor, ret = new C(), loc = get(this, 'length');
+ set(ret, 'length', loc);
+ while(--loc>=0) {
+ ret[loc] = this[loc];
+ ret[guidFor(this[loc])] = loc;
+ }
+ return ret;
+ },
+
+ /** @private */
+ toString: function() {
+ var len = this.length, idx, array = [];
+ for(idx = 0; idx < len; idx++) {
+ array[idx] = this[idx];
+ }
+ return "Ember.Set<%@>".fmt(array.join(','));
+ }
+
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/**
+ @class
+
+ `Ember.Object` is the main base class for all Ember objects. It is a subclass
+ of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,
+ see the documentation for each of these.
+
+ @extends Ember.CoreObject
+ @extends Ember.Observable
+*/
+Ember.Object = Ember.CoreObject.extend(Ember.Observable);
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var indexOf = Ember.ArrayPolyfills.indexOf;
+
+/**
+ @private
+ A Namespace is an object usually used to contain other objects or methods
+ such as an application or framework. Create a namespace anytime you want
+ to define one of these new containers.
+
+ # Example Usage
+
+ MyFramework = Ember.Namespace.create({
+ VERSION: '1.0.0'
+ });
+
+*/
+Ember.Namespace = Ember.Object.extend({
+ isNamespace: true,
+
+ init: function() {
+ Ember.Namespace.NAMESPACES.push(this);
+ Ember.Namespace.PROCESSED = false;
+ },
+
+ toString: function() {
+ Ember.identifyNamespaces();
+ return this[Ember.GUID_KEY+'_name'];
+ },
+
+ destroy: function() {
+ var namespaces = Ember.Namespace.NAMESPACES;
+ window[this.toString()] = undefined;
+ namespaces.splice(indexOf.call(namespaces, this), 1);
+ this._super();
+ }
+});
+
+Ember.Namespace.NAMESPACES = [Ember];
+Ember.Namespace.PROCESSED = false;
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/**
+ @private
+
+ Defines a namespace that will contain an executable application. This is
+ very similar to a normal namespace except that it is expected to include at
+ least a 'ready' function which can be run to initialize the application.
+
+ Currently Ember.Application is very similar to Ember.Namespace. However, this
+ class may be augmented by additional frameworks so it is important to use
+ this instance when building new applications.
+
+ # Example Usage
+
+ MyApp = Ember.Application.create({
+ VERSION: '1.0.0',
+ store: Ember.Store.create().from(Ember.fixtures)
+ });
+
+ MyApp.ready = function() {
+ //..init code goes here...
+ }
+
+*/
+Ember.Application = Ember.Namespace.extend();
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ An ArrayProxy wraps any other object that implements Ember.Array and/or
+ Ember.MutableArray, forwarding all requests. This makes it very useful for
+ a number of binding use cases or other cases where being able to swap
+ out the underlying array is useful.
+
+ A simple example of usage:
+
+ var pets = ['dog', 'cat', 'fish'];
+ var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });
+ ap.get('firstObject'); // => 'dog'
+ ap.set('content', ['amoeba', 'paramecium']);
+ ap.get('firstObject'); // => 'amoeba'
+
+ This class can also be useful as a layer to transform the contents of
+ an array, as they are accessed. This can be done by overriding
+ `objectAtContent`:
+
+ var pets = ['dog', 'cat', 'fish'];
+ var ap = Ember.ArrayProxy.create({
+ content: Ember.A(pets),
+ objectAtContent: function(idx) {
+ return this.get('content').objectAt(idx).toUpperCase();
+ }
+ });
+ ap.get('firstObject'); // => 'DOG'
+
+
+ @extends Ember.Object
+ @extends Ember.Array
+ @extends Ember.MutableArray
+*/
+Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
+/** @scope Ember.ArrayProxy.prototype */ {
+
+ /**
+ The content array. Must be an object that implements Ember.Array and/or
+ Ember.MutableArray.
+
+ @type Ember.Array
+ */
+ content: null,
+
+ /**
+ The array that the proxy pretends to be. In the default `ArrayProxy`
+ implementation, this and `content` are the same. Subclasses of `ArrayProxy`
+ can override this property to provide things like sorting and filtering.
+ */
+ arrangedContent: Ember.computed('content', function() {
+ return get(this, 'content');
+ }).cacheable(),
+
+ /**
+ Should actually retrieve the object at the specified index from the
+ content. You can override this method in subclasses to transform the
+ content item to something new.
+
+ This method will only be called if content is non-null.
+
+ @param {Number} idx
+ The index to retrieve.
+
+ @returns {Object} the value or undefined if none found
+ */
+ objectAtContent: function(idx) {
+ return get(this, 'arrangedContent').objectAt(idx);
+ },
+
+ /**
+ Should actually replace the specified objects on the content array.
+ You can override this method in subclasses to transform the content item
+ into something new.
+
+ This method will only be called if content is non-null.
+
+ @param {Number} idx
+ The starting index
+
+ @param {Number} amt
+ The number of items to remove from the content.
+
+ @param {Array} objects
+ Optional array of objects to insert or null if no objects.
+
+ @returns {void}
+ */
+ replaceContent: function(idx, amt, objects) {
+ get(this, 'arrangedContent').replace(idx, amt, objects);
+ },
+
+ /**
+ Invoked when the content property is about to change. Notifies observers that the
+ entire array content will change.
+ */
+ _contentWillChange: Ember.beforeObserver(function() {
+ var content = get(this, 'content');
+
+ if (content) {
+ content.removeArrayObserver(this, {
+ willChange: 'contentArrayWillChange',
+ didChange: 'contentArrayDidChange'
+ });
+ }
+ }, 'content'),
+
+
+ contentArrayWillChange: Ember.K,
+ contentArrayDidChange: Ember.K,
+
+ /**
+ Invoked when the content property changes. Notifies observers that the
+ entire array content has changed.
+ */
+ _contentDidChange: Ember.observer(function() {
+ var content = get(this, 'content'),
+ len = content ? get(content, 'length') : 0;
+
+ Ember.assert("Can't set ArrayProxy's content to itself", content !== this);
+
+ if (content) {
+ content.addArrayObserver(this, {
+ willChange: 'contentArrayWillChange',
+ didChange: 'contentArrayDidChange'
+ });
+ }
+ }, 'content'),
+
+ _arrangedContentWillChange: Ember.beforeObserver(function() {
+ var arrangedContent = get(this, 'arrangedContent'),
+ len = arrangedContent ? get(arrangedContent, 'length') : 0;
+
+ this.arrangedContentArrayWillChange(this, 0, len, undefined);
+
+ if (arrangedContent) {
+ arrangedContent.removeArrayObserver(this, {
+ willChange: 'arrangedContentArrayWillChange',
+ didChange: 'arrangedContentArrayDidChange'
+ });
+ }
+ }, 'arrangedContent'),
+
+ _arrangedContentDidChange: Ember.observer(function() {
+ var arrangedContent = get(this, 'arrangedContent'),
+ len = arrangedContent ? get(arrangedContent, 'length') : 0;
+
+ Ember.assert("Can't set ArrayProxy's content to itself", arrangedContent !== this);
+
+ if (arrangedContent) {
+ arrangedContent.addArrayObserver(this, {
+ willChange: 'arrangedContentArrayWillChange',
+ didChange: 'arrangedContentArrayDidChange'
+ });
+ }
+
+ this.arrangedContentArrayDidChange(this, 0, undefined, len);
+ }, 'arrangedContent'),
+
+ /** @private (nodoc) */
+ objectAt: function(idx) {
+ return get(this, 'content') && this.objectAtContent(idx);
+ },
+
+ /** @private (nodoc) */
+ length: Ember.computed(function() {
+ var arrangedContent = get(this, 'arrangedContent');
+ return arrangedContent ? get(arrangedContent, 'length') : 0;
+ // No dependencies since Enumerable notifies length of change
+ }).property().cacheable(),
+
+ /** @private (nodoc) */
+ replace: function(idx, amt, objects) {
+ if (get(this, 'content')) this.replaceContent(idx, amt, objects);
+ return this;
+ },
+
+ /** @private (nodoc) */
+ arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
+ this.arrayContentWillChange(idx, removedCnt, addedCnt);
+ },
+
+ /** @private (nodoc) */
+ arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {
+ this.arrayContentDidChange(idx, removedCnt, addedCnt);
+ },
+
+ /** @private (nodoc) */
+ init: function() {
+ this._super();
+ this._contentWillChange();
+ this._contentDidChange();
+ this._arrangedContentWillChange();
+ this._arrangedContentDidChange();
+ }
+
+});
+
+
+
+
+})();
+
+
+
+(function() {
+var get = Ember.get,
+ set = Ember.set,
+ fmt = Ember.String.fmt,
+ addBeforeObserver = Ember.addBeforeObserver,
+ addObserver = Ember.addObserver,
+ removeBeforeObserver = Ember.removeBeforeObserver,
+ removeObserver = Ember.removeObserver,
+ propertyWillChange = Ember.propertyWillChange,
+ propertyDidChange = Ember.propertyDidChange;
+
+function contentPropertyWillChange(content, contentKey) {
+ var key = contentKey.slice(8); // remove "content."
+ if (key in this) { return; } // if shadowed in proxy
+ propertyWillChange(this, key);
+}
+
+function contentPropertyDidChange(content, contentKey) {
+ var key = contentKey.slice(8); // remove "content."
+ if (key in this) { return; } // if shadowed in proxy
+ propertyDidChange(this, key);
+}
+
+/**
+ @class
+
+ `Ember.ObjectProxy` forwards all properties not defined by the proxy itself
+ to a proxied `content` object.
+
+ object = Ember.Object.create({
+ name: 'Foo'
+ });
+ proxy = Ember.ObjectProxy.create({
+ content: object
+ });
+
+ // Access and change existing properties
+ proxy.get('name') // => 'Foo'
+ proxy.set('name', 'Bar');
+ object.get('name') // => 'Bar'
+
+ // Create new 'description' property on `object`
+ proxy.set('description', 'Foo is a whizboo baz');
+ object.get('description') // => 'Foo is a whizboo baz'
+
+ While `content` is unset, setting a property to be delegated will throw an Error.
+
+ proxy = Ember.ObjectProxy.create({
+ content: null,
+ flag: null
+ });
+ proxy.set('flag', true);
+ proxy.get('flag'); // => true
+ proxy.get('foo'); // => undefined
+ proxy.set('foo', 'data'); // throws Error
+
+ Delegated properties can be bound to and will change when content is updated.
+
+ Computed properties on the proxy itself can depend on delegated properties.
+
+ ProxyWithComputedProperty = Ember.ObjectProxy.extend({
+ fullName: function () {
+ var firstName = this.get('firstName'),
+ lastName = this.get('lastName');
+ if (firstName && lastName) {
+ return firstName + ' ' + lastName;
+ }
+ return firstName || lastName;
+ }.property('firstName', 'lastName')
+ });
+ proxy = ProxyWithComputedProperty.create();
+ proxy.get('fullName'); => undefined
+ proxy.set('content', {
+ firstName: 'Tom', lastName: 'Dale'
+ }); // triggers property change for fullName on proxy
+ proxy.get('fullName'); => 'Tom Dale'
+*/
+Ember.ObjectProxy = Ember.Object.extend(
+/** @scope Ember.ObjectProxy.prototype */ {
+ /**
+ The object whose properties will be forwarded.
+
+ @type Ember.Object
+ @default null
+ */
+ content: null,
+ _contentDidChange: Ember.observer(function() {
+ Ember.assert("Can't set ObjectProxy's content to itself", this.get('content') !== this);
+ }, 'content'),
+ /** @private */
+ willWatchProperty: function (key) {
+ var contentKey = 'content.' + key;
+ addBeforeObserver(this, contentKey, null, contentPropertyWillChange);
+ addObserver(this, contentKey, null, contentPropertyDidChange);
+ },
+ /** @private */
+ didUnwatchProperty: function (key) {
+ var contentKey = 'content.' + key;
+ removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
+ removeObserver(this, contentKey, null, contentPropertyDidChange);
+ },
+ /** @private */
+ unknownProperty: function (key) {
+ var content = get(this, 'content');
+ if (content) {
+ return get(content, key);
+ }
+ },
+ /** @private */
+ setUnknownProperty: function (key, value) {
+ var content = get(this, 'content');
+ Ember.assert(fmt("Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.", [key, value, this]), content);
+ return set(content, key, value);
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;
+var forEach = Ember.EnumerableUtils.forEach;
+
+var EachArray = Ember.Object.extend(Ember.Array, {
+
+ init: function(content, keyName, owner) {
+ this._super();
+ this._keyName = keyName;
+ this._owner = owner;
+ this._content = content;
+ },
+
+ objectAt: function(idx) {
+ var item = this._content.objectAt(idx);
+ return item && get(item, this._keyName);
+ },
+
+ length: Ember.computed(function() {
+ var content = this._content;
+ return content ? get(content, 'length') : 0;
+ }).property().cacheable()
+
+});
+
+var IS_OBSERVER = /^.+:(before|change)$/;
+
+/** @private */
+function addObserverForContentKey(content, keyName, proxy, idx, loc) {
+ var objects = proxy._objects, guid;
+ if (!objects) objects = proxy._objects = {};
+
+ while(--loc>=idx) {
+ var item = content.objectAt(loc);
+ if (item) {
+ Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
+ Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');
+
+ // keep track of the indicies each item was found at so we can map
+ // it back when the obj changes.
+ guid = guidFor(item);
+ if (!objects[guid]) objects[guid] = [];
+ objects[guid].push(loc);
+ }
+ }
+}
+
+/** @private */
+function removeObserverForContentKey(content, keyName, proxy, idx, loc) {
+ var objects = proxy._objects;
+ if (!objects) objects = proxy._objects = {};
+ var indicies, guid;
+
+ while(--loc>=idx) {
+ var item = content.objectAt(loc);
+ if (item) {
+ Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
+ Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');
+
+ guid = guidFor(item);
+ indicies = objects[guid];
+ indicies[indicies.indexOf(loc)] = null;
+ }
+ }
+}
+
+/**
+ @private
+ @class
+
+ This is the object instance returned when you get the @each property on an
+ array. It uses the unknownProperty handler to automatically create
+ EachArray instances for property names.
+
+ @extends Ember.Object
+*/
+Ember.EachProxy = Ember.Object.extend({
+
+ init: function(content) {
+ this._super();
+ this._content = content;
+ content.addArrayObserver(this);
+
+ // in case someone is already observing some keys make sure they are
+ // added
+ forEach(Ember.watchedEvents(this), function(eventName) {
+ this.didAddListener(eventName);
+ }, this);
+ },
+
+ /**
+ You can directly access mapped properties by simply requesting them.
+ The unknownProperty handler will generate an EachArray of each item.
+ */
+ unknownProperty: function(keyName, value) {
+ var ret;
+ ret = new EachArray(this._content, keyName, this);
+ Ember.defineProperty(this, keyName, null, ret);
+ this.beginObservingContentKey(keyName);
+ return ret;
+ },
+
+ // ..........................................................
+ // ARRAY CHANGES
+ // Invokes whenever the content array itself changes.
+
+ arrayWillChange: function(content, idx, removedCnt, addedCnt) {
+ var keys = this._keys, key, array, lim;
+
+ lim = removedCnt>0 ? idx+removedCnt : -1;
+ Ember.beginPropertyChanges(this);
+
+ for(key in keys) {
+ if (!keys.hasOwnProperty(key)) { continue; }
+
+ if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);
+
+ Ember.propertyWillChange(this, key);
+ }
+
+ Ember.propertyWillChange(this._content, '@each');
+ Ember.endPropertyChanges(this);
+ },
+
+ arrayDidChange: function(content, idx, removedCnt, addedCnt) {
+ var keys = this._keys, key, array, lim;
+
+ lim = addedCnt>0 ? idx+addedCnt : -1;
+ Ember.beginPropertyChanges(this);
+
+ for(key in keys) {
+ if (!keys.hasOwnProperty(key)) { continue; }
+
+ if (lim>0) addObserverForContentKey(content, key, this, idx, lim);
+
+ Ember.propertyDidChange(this, key);
+ }
+
+ Ember.propertyDidChange(this._content, '@each');
+ Ember.endPropertyChanges(this);
+ },
+
+ // ..........................................................
+ // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS
+ // Start monitoring keys based on who is listening...
+
+ didAddListener: function(eventName) {
+ if (IS_OBSERVER.test(eventName)) {
+ this.beginObservingContentKey(eventName.slice(0, -7));
+ }
+ },
+
+ didRemoveListener: function(eventName) {
+ if (IS_OBSERVER.test(eventName)) {
+ this.stopObservingContentKey(eventName.slice(0, -7));
+ }
+ },
+
+ // ..........................................................
+ // CONTENT KEY OBSERVING
+ // Actual watch keys on the source content.
+
+ beginObservingContentKey: function(keyName) {
+ var keys = this._keys;
+ if (!keys) keys = this._keys = {};
+ if (!keys[keyName]) {
+ keys[keyName] = 1;
+ var content = this._content,
+ len = get(content, 'length');
+ addObserverForContentKey(content, keyName, this, 0, len);
+ } else {
+ keys[keyName]++;
+ }
+ },
+
+ stopObservingContentKey: function(keyName) {
+ var keys = this._keys;
+ if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {
+ var content = this._content,
+ len = get(content, 'length');
+ removeObserverForContentKey(content, keyName, this, 0, len);
+ }
+ },
+
+ contentKeyWillChange: function(obj, keyName) {
+ Ember.propertyWillChange(this, keyName);
+ },
+
+ contentKeyDidChange: function(obj, keyName) {
+ Ember.propertyDidChange(this, keyName);
+ }
+
+});
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+// Add Ember.Array to Array.prototype. Remove methods with native
+// implementations and supply some more optimized versions of generic methods
+// because they are so common.
+var NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {
+
+ // because length is a built-in property we need to know to just get the
+ // original property.
+ get: function(key) {
+ if (key==='length') return this.length;
+ else if ('number' === typeof key) return this[key];
+ else return this._super(key);
+ },
+
+ objectAt: function(idx) {
+ return this[idx];
+ },
+
+ // primitive for array support.
+ replace: function(idx, amt, objects) {
+
+ if (this.isFrozen) throw Ember.FROZEN_ERROR ;
+
+ // if we replaced exactly the same number of items, then pass only the
+ // replaced range. Otherwise, pass the full remaining array length
+ // since everything has shifted
+ var len = objects ? get(objects, 'length') : 0;
+ this.arrayContentWillChange(idx, amt, len);
+
+ if (!objects || objects.length === 0) {
+ this.splice(idx, amt) ;
+ } else {
+ var args = [idx, amt].concat(objects) ;
+ this.splice.apply(this,args) ;
+ }
+
+ this.arrayContentDidChange(idx, amt, len);
+ return this ;
+ },
+
+ // If you ask for an unknown property, then try to collect the value
+ // from member items.
+ unknownProperty: function(key, value) {
+ var ret;// = this.reducedProperty(key, value) ;
+ if ((value !== undefined) && ret === undefined) {
+ ret = this[key] = value;
+ }
+ return ret ;
+ },
+
+ // If browser did not implement indexOf natively, then override with
+ // specialized version
+ indexOf: function(object, startAt) {
+ var idx, len = this.length;
+
+ if (startAt === undefined) startAt = 0;
+ else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
+ if (startAt < 0) startAt += len;
+
+ for(idx=startAt;idx<len;idx++) {
+ if (this[idx] === object) return idx ;
+ }
+ return -1;
+ },
+
+ lastIndexOf: function(object, startAt) {
+ var idx, len = this.length;
+
+ if (startAt === undefined) startAt = len-1;
+ else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
+ if (startAt < 0) startAt += len;
+
+ for(idx=startAt;idx>=0;idx--) {
+ if (this[idx] === object) return idx ;
+ }
+ return -1;
+ },
+
+ copy: function() {
+ return this.slice();
+ }
+});
+
+// Remove any methods implemented natively so we don't override them
+var ignore = ['length'];
+Ember.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {
+ if (Array.prototype[methodName]) ignore.push(methodName);
+});
+
+if (ignore.length>0) {
+ NativeArray = NativeArray.without.apply(NativeArray, ignore);
+}
+
+/**
+ The NativeArray mixin contains the properties needed to to make the native
+ Array support Ember.MutableArray and all of its dependent APIs. Unless you
+ have Ember.EXTEND_PROTOTYPES set to false, this will be applied automatically.
+ Otherwise you can apply the mixin at anytime by calling
+ `Ember.NativeArray.activate`.
+
+ @namespace
+ @extends Ember.MutableArray
+ @extends Ember.Array
+ @extends Ember.Enumerable
+ @extends Ember.MutableEnumerable
+ @extends Ember.Copyable
+ @extends Ember.Freezable
+*/
+Ember.NativeArray = NativeArray;
+
+/**
+ Creates an Ember.NativeArray from an Array like object.
+ Does not modify the original object.
+
+ @returns {Ember.NativeArray}
+*/
+Ember.A = function(arr){
+ if (arr === undefined) { arr = []; }
+ return Ember.NativeArray.apply(arr);
+};
+
+/**
+ Activates the mixin on the Array.prototype if not already applied. Calling
+ this method more than once is safe.
+
+ @returns {void}
+*/
+Ember.NativeArray.activate = function() {
+ NativeArray.apply(Array.prototype);
+
+ Ember.A = function(arr) { return arr || []; };
+};
+
+if (Ember.EXTEND_PROTOTYPES) Ember.NativeArray.activate();
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+Ember._PromiseChain = Ember.Object.extend({
+ promises: null,
+ failureCallback: Ember.K,
+ successCallback: Ember.K,
+ abortCallback: Ember.K,
+ promiseSuccessCallback: Ember.K,
+
+ /**
+ @private
+ */
+ runNextPromise: function() {
+ if (get(this, 'isDestroyed')) { return; }
+
+ var item = get(this, 'promises').shiftObject();
+ if (item) {
+ var promise = get(item, 'promise') || item;
+ Ember.assert("Cannot find promise to invoke", Ember.canInvoke(promise, 'then'));
+
+ var self = this;
+
+ var successCallback = function() {
+ self.promiseSuccessCallback.call(this, item, arguments);
+ self.runNextPromise();
+ };
+
+ var failureCallback = get(self, 'failureCallback');
+
+ promise.then(successCallback, failureCallback);
+ } else {
+ this.successCallback();
+ }
+ },
+
+ start: function() {
+ this.runNextPromise();
+ return this;
+ },
+
+ abort: function() {
+ this.abortCallback();
+ this.destroy();
+ },
+
+ init: function() {
+ set(this, 'promises', Ember.A(get(this, 'promises')));
+ this._super();
+ }
+});
+
+
+})();
+
+
+
+(function() {
+var loadHooks = {};
+var loaded = {};
+
+Ember.onLoad = function(name, callback) {
+ var object;
+
+ loadHooks[name] = loadHooks[name] || Ember.A();
+ loadHooks[name].pushObject(callback);
+
+ if (object = loaded[name]) {
+ callback(object);
+ }
+};
+
+Ember.runLoadHooks = function(name, object) {
+ var hooks;
+
+ loaded[name] = object;
+
+ if (hooks = loadHooks[name]) {
+ loadHooks[name].forEach(function(callback) {
+ callback(object);
+ });
+ }
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+Ember.ControllerMixin = Ember.Mixin.create({
+ /**
+ The object to which events from the view should be sent.
+
+ For example, when a Handlebars template uses the `{{action}}` helper,
+ it will attempt to send the event to the view's controller's `target`.
+
+ By default, a controller's `target` is set to the router after it is
+ instantiated by `Ember.Application#initialize`.
+ */
+ target: null,
+ store: null
+});
+
+Ember.Controller = Ember.Object.extend(Ember.ControllerMixin);
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;
+
+/**
+ @class
+
+ @extends Ember.Mixin
+ @extends Ember.MutableEnumerable
+*/
+Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable,
+ /** @scope Ember.Observable.prototype */ {
+ sortProperties: null,
+ sortAscending: true,
+
+ addObject: function(obj) {
+ var content = get(this, 'content');
+ content.pushObject(obj);
+ },
+
+ removeObject: function(obj) {
+ var content = get(this, 'content');
+ content.removeObject(obj);
+ },
+
+ orderBy: function(item1, item2) {
+ var result = 0,
+ sortProperties = get(this, 'sortProperties'),
+ sortAscending = get(this, 'sortAscending');
+
+ Ember.assert("you need to define `sortProperties`", !!sortProperties);
+
+ forEach(sortProperties, function(propertyName) {
+ if (result === 0) {
+ result = Ember.compare(get(item1, propertyName), get(item2, propertyName));
+ if ((result !== 0) && !sortAscending) {
+ result = (-1) * result;
+ }
+ }
+ });
+
+ return result;
+ },
+
+ destroy: function() {
+ var content = get(this, 'content'),
+ sortProperties = get(this, 'sortProperties');
+
+ if (content && sortProperties) {
+ forEach(content, function(item) {
+ forEach(sortProperties, function(sortProperty) {
+ Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
+ }, this);
+ }, this);
+ }
+
+ return this._super();
+ },
+
+ isSorted: Ember.computed('sortProperties', function() {
+ return !!get(this, 'sortProperties');
+ }),
+
+ arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {
+ var content = get(this, 'content'),
+ isSorted = get(this, 'isSorted'),
+ sortProperties = get(this, 'sortProperties'),
+ self = this;
+
+ if (content && isSorted) {
+ content = content.slice();
+ content.sort(function(item1, item2) {
+ return self.orderBy(item1, item2);
+ });
+ forEach(content, function(item) {
+ forEach(sortProperties, function(sortProperty) {
+ Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
+ }, this);
+ }, this);
+ return Ember.A(content);
+ }
+
+ return content;
+ }).cacheable(),
+
+ _contentWillChange: Ember.beforeObserver(function() {
+ var content = get(this, 'content'),
+ sortProperties = get(this, 'sortProperties');
+
+ if (content && sortProperties) {
+ forEach(content, function(item) {
+ forEach(sortProperties, function(sortProperty) {
+ Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
+ }, this);
+ }, this);
+ }
+
+ this._super();
+ }, 'content'),
+
+ sortAscendingWillChange: Ember.beforeObserver(function() {
+ this._lastSortAscending = get(this, 'sortAscending');
+ }, 'sortAscending'),
+
+ sortAscendingDidChange: Ember.observer(function() {
+ if (get(this, 'sortAscending') !== this._lastSortAscending) {
+ var arrangedContent = get(this, 'arrangedContent');
+ arrangedContent.reverseObjects();
+ }
+ }, 'sortAscending'),
+
+ contentArrayWillChange: function(array, idx, removedCount, addedCount) {
+ var isSorted = get(this, 'isSorted');
+
+ if (isSorted) {
+ var arrangedContent = get(this, 'arrangedContent');
+ var removedObjects = array.slice(idx, idx+removedCount);
+ var sortProperties = get(this, 'sortProperties');
+
+ forEach(removedObjects, function(item) {
+ arrangedContent.removeObject(item);
+
+ forEach(sortProperties, function(sortProperty) {
+ Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
+ }, this);
+ });
+ }
+
+ return this._super(array, idx, removedCount, addedCount);
+ },
+
+ contentArrayDidChange: function(array, idx, removedCount, addedCount) {
+ var isSorted = get(this, 'isSorted'),
+ sortProperties = get(this, 'sortProperties');
+
+ if (isSorted) {
+ var addedObjects = array.slice(idx, idx+addedCount);
+ var arrangedContent = get(this, 'arrangedContent');
+
+ forEach(addedObjects, function(item) {
+ this.insertItemSorted(item);
+
+ forEach(sortProperties, function(sortProperty) {
+ Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
+ }, this);
+ }, this);
+ }
+
+ return this._super(array, idx, removedCount, addedCount);
+ },
+
+ insertItemSorted: function(item) {
+ var arrangedContent = get(this, 'arrangedContent');
+ var length = get(arrangedContent, 'length');
+
+ var idx = this._binarySearch(item, 0, length);
+ arrangedContent.insertAt(idx, item);
+ },
+
+ contentItemSortPropertyDidChange: function(item) {
+ var arrangedContent = get(this, 'arrangedContent'),
+ index = arrangedContent.indexOf(item);
+
+ arrangedContent.removeObject(item);
+ this.insertItemSorted(item);
+ },
+
+ _binarySearch: function(item, low, high) {
+ var mid, midItem, res, arrangedContent;
+
+ if (low === high) {
+ return low;
+ }
+
+ arrangedContent = get(this, 'arrangedContent');
+
+ mid = low + Math.floor((high - low) / 2);
+ midItem = arrangedContent.objectAt(mid);
+
+ res = this.orderBy(midItem, item);
+
+ if (res < 0) {
+ return this._binarySearch(item, mid+1, high);
+ } else if (res > 0) {
+ return this._binarySearch(item, low, mid);
+ }
+
+ return mid;
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ Ember.ArrayController provides a way for you to publish a collection of objects
+ so that you can easily bind to the collection from a Handlebars #each helper,
+ an Ember.CollectionView, or other controllers.
+
+ The advantage of using an ArrayController is that you only have to set up
+ your view bindings once; to change what's displayed, simply swap out the
+ `content` property on the controller.
+
+ For example, imagine you wanted to display a list of items fetched via an XHR
+ request. Create an Ember.ArrayController and set its `content` property:
+
+ MyApp.listController = Ember.ArrayController.create();
+
+ $.get('people.json', function(data) {
+ MyApp.listController.set('content', data);
+ });
+
+ Then, create a view that binds to your new controller:
+
+ {{#each MyApp.listController}}
+ {{firstName}} {{lastName}}
+ {{/each}}
+
+ Although you are binding to the controller, the behavior of this controller
+ is to pass through any methods or properties to the underlying array. This
+ capability comes from `Ember.ArrayProxy`, which this class inherits from.
+
+ Note: As of this writing, `ArrayController` does not add any functionality
+ to its superclass, `ArrayProxy`. The Ember team plans to add additional
+ controller-specific functionality in the future, e.g. single or multiple
+ selection support. If you are creating something that is conceptually a
+ controller, use this class.
+
+ @extends Ember.ArrayProxy
+*/
+
+Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,
+ Ember.SortableMixin);
+
+})();
+
+
+
+(function() {
+Ember.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);
+
+})();
+
+
+
+(function() {
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Runtime
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ An Ember.Application instance serves as the namespace in which you define your
+ application's classes. You can also override the configuration of your
+ application.
+
+ By default, Ember.Application will begin listening for events on the document.
+ If your application is embedded inside a page, instead of controlling the
+ entire document, you can specify which DOM element to attach to by setting
+ the `rootElement` property:
+
+ MyApp = Ember.Application.create({
+ rootElement: $('#my-app')
+ });
+
+ The root of an Ember.Application must not be removed during the course of the
+ page's lifetime. If you have only a single conceptual application for the
+ entire page, and are not embedding any third-party Ember applications
+ in your page, use the default document root for your application.
+
+ You only need to specify the root if your page contains multiple instances
+ of Ember.Application.
+
+ @extends Ember.Object
+*/
+Ember.Application = Ember.Namespace.extend(
+/** @scope Ember.Application.prototype */{
+
+ /**
+ The root DOM element of the Application.
+
+ Can be specified as DOMElement or a selector string.
+
+ @type DOMElement
+ @default 'body'
+ */
+ rootElement: 'body',
+
+ /**
+ @type Ember.EventDispatcher
+ @default null
+ */
+ eventDispatcher: null,
+
+ /**
+ @type Object
+ @default null
+ */
+ customEvents: null,
+
+ /** @private */
+ init: function() {
+ var eventDispatcher,
+ rootElement = get(this, 'rootElement');
+ this._super();
+
+ eventDispatcher = Ember.EventDispatcher.create({
+ rootElement: rootElement
+ });
+
+ set(this, 'eventDispatcher', eventDispatcher);
+
+ // jQuery 1.7 doesn't call the ready callback if already ready
+ if (Ember.$.isReady) {
+ Ember.run.once(this, this.didBecomeReady);
+ } else {
+ var self = this;
+ Ember.$(document).ready(function() {
+ Ember.run.once(self, self.didBecomeReady);
+ });
+ }
+ },
+
+ /**
+ Instantiate all controllers currently available on the namespace
+ and inject them onto a router.
+
+ Example:
+
+ App.PostsController = Ember.ArrayController.extend();
+ App.CommentsController = Ember.ArrayController.extend();
+
+ var router = Ember.Router.create({
+ ...
+ });
+
+ App.initialize(router);
+
+ router.get('postsController') // <App.PostsController:ember1234>
+ router.get('commentsController') // <App.CommentsController:ember1235>
+
+ router.get('postsController.router') // router
+ */
+ initialize: function(router) {
+ var properties = Ember.A(Ember.keys(this)),
+ injections = get(this.constructor, 'injections'),
+ namespace = this, controller, name;
+
+ if (!router && Ember.Router.detect(namespace['Router'])) {
+ router = namespace['Router'].create();
+ this._createdRouter = router;
+ }
+
+ if (router) {
+ set(this, 'router', router);
+
+ // By default, the router's namespace is the current application.
+ //
+ // This allows it to find model classes when a state has a
+ // route like `/posts/:post_id`. In that case, it would first
+ // convert `post_id` into `Post`, and then look it up on its
+ // namespace.
+ set(router, 'namespace', this);
+ }
+
+ Ember.runLoadHooks('application', this);
+
+ injections.forEach(function(injection) {
+ properties.forEach(function(property) {
+ injection[1](namespace, router, property);
+ });
+ });
+
+ if (router && router instanceof Ember.Router) {
+ this.startRouting(router);
+ }
+ },
+
+ /** @private */
+ didBecomeReady: function() {
+ var eventDispatcher = get(this, 'eventDispatcher'),
+ customEvents = get(this, 'customEvents');
+
+ eventDispatcher.setup(customEvents);
+
+ this.ready();
+ },
+
+ /**
+ @private
+
+ If the application has a router, use it to route to the current URL, and
+ trigger a new call to `route` whenever the URL changes.
+ */
+ startRouting: function(router) {
+ var location = get(router, 'location'),
+ rootElement = get(this, 'rootElement'),
+ applicationController = get(router, 'applicationController');
+
+ Ember.assert("ApplicationView and ApplicationController must be defined on your application", (this.ApplicationView && applicationController) );
+
+ var applicationView = this.ApplicationView.create({
+ controller: applicationController
+ });
+ this._createdApplicationView = applicationView;
+
+ applicationView.appendTo(rootElement);
+
+ router.route(location.getURL());
+ location.onUpdateURL(function(url) {
+ router.route(url);
+ });
+ },
+
+ /**
+ Called when the Application has become ready.
+ The call will be delayed until the DOM has become ready.
+ */
+ ready: Ember.K,
+
+ /** @private */
+ willDestroy: function() {
+ get(this, 'eventDispatcher').destroy();
+ if (this._createdRouter) { this._createdRouter.destroy(); }
+ if (this._createdApplicationView) { this._createdApplicationView.destroy(); }
+ },
+
+ registerInjection: function(options) {
+ this.constructor.registerInjection(options);
+ }
+});
+
+Ember.Application.reopenClass({
+ concatenatedProperties: ['injections'],
+ injections: Ember.A(),
+ registerInjection: function(options) {
+ var injections = get(this, 'injections'),
+ before = options.before,
+ name = options.name,
+ injection = options.injection,
+ location;
+
+ if (before) {
+ location = injections.find(function(item) {
+ if (item[0] === before) { return true; }
+ });
+ location = injections.indexOf(location);
+ } else {
+ location = get(injections, 'length');
+ }
+
+ injections.splice(location, 0, [name, injection]);
+ }
+});
+
+Ember.Application.registerInjection({
+ name: 'controllers',
+ injection: function(app, router, property) {
+ if (!/^[A-Z].*Controller$/.test(property)) { return; }
+
+ var name = property.charAt(0).toLowerCase() + property.substr(1),
+ controller = app[property].create();
+
+ router.set(name, controller);
+
+ controller.setProperties({
+ target: router,
+ controllers: router,
+ namespace: app
+ });
+ }
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+/**
+ This file implements the `location` API used by Ember's router.
+
+ That API is:
+
+ getURL: returns the current URL
+ setURL(path): sets the current URL
+ onUpdateURL(callback): triggers the callback when the URL changes
+ formatURL(url): formats `url` to be placed into `href` attribute
+
+ Calling setURL will not trigger onUpdateURL callbacks.
+
+ TODO: This, as well as the Ember.Location documentation below, should
+ perhaps be moved so that it's visible in the JsDoc output.
+*/
+/**
+ @class
+
+ Ember.Location returns an instance of the correct implementation of
+ the `location` API.
+
+ You can pass it a `implementation` ('hash', 'history', 'none') to force a
+ particular implementation.
+*/
+Ember.Location = {
+ create: function(options) {
+ var implementation = options && options.implementation;
+ Ember.assert("Ember.Location.create: you must specify a 'implementation' option", !!implementation);
+
+ var implementationClass = this.implementations[implementation];
+ Ember.assert("Ember.Location.create: " + implementation + " is not a valid implementation", !!implementationClass);
+
+ return implementationClass.create.apply(implementationClass, arguments);
+ },
+
+ registerImplementation: function(name, implementation) {
+ this.implementations[name] = implementation;
+ },
+
+ implementations: {}
+};
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ Ember.HashLocation implements the location API using the browser's
+ hash. At present, it relies on a hashchange event existing in the
+ browser.
+
+ @extends Ember.Object
+*/
+Ember.HashLocation = Ember.Object.extend(
+/** @scope Ember.HashLocation.prototype */ {
+
+ /** @private */
+ init: function() {
+ set(this, 'location', get(this, 'location') || window.location);
+ },
+
+ /**
+ @private
+
+ Returns the current `location.hash`, minus the '#' at the front.
+ */
+ getURL: function() {
+ return get(this, 'location').hash.substr(1);
+ },
+
+ /**
+ @private
+
+ Set the `location.hash` and remembers what was set. This prevents
+ `onUpdateURL` callbacks from triggering when the hash was set by
+ `HashLocation`.
+ */
+ setURL: function(path) {
+ get(this, 'location').hash = path;
+ set(this, 'lastSetURL', path);
+ },
+
+ /**
+ @private
+
+ Register a callback to be invoked when the hash changes. These
+ callbacks will execute when the user presses the back or forward
+ button, but not after `setURL` is invoked.
+ */
+ onUpdateURL: function(callback) {
+ var self = this;
+ var guid = Ember.guidFor(this);
+
+ Ember.$(window).bind('hashchange.ember-location-'+guid, function() {
+ var path = location.hash.substr(1);
+ if (get(self, 'lastSetURL') === path) { return; }
+
+ set(self, 'lastSetURL', null);
+
+ callback(location.hash.substr(1));
+ });
+ },
+
+ /**
+ @private
+
+ Given a URL, formats it to be placed into the page as part
+ of an element's `href` attribute.
+
+ This is used, for example, when using the {{action}} helper
+ to generate a URL based on an event.
+ */
+ formatURL: function(url) {
+ return '#'+url;
+ },
+
+ /** @private */
+ willDestroy: function() {
+ var guid = Ember.guidFor(this);
+
+ Ember.$(window).unbind('hashchange.ember-location-'+guid);
+ }
+});
+
+Ember.Location.registerImplementation('hash', Ember.HashLocation);
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ Ember.HistoryLocation implements the location API using the browser's
+ history.pushState API.
+
+ @extends Ember.Object
+*/
+Ember.HistoryLocation = Ember.Object.extend(
+/** @scope Ember.HistoryLocation.prototype */ {
+
+ /** @private */
+ init: function() {
+ set(this, 'location', get(this, 'location') || window.location);
+ set(this, '_initialURL', get(this, 'location').pathname);
+ },
+
+ /**
+ Will be pre-pended to path upon state change
+ */
+ rootURL: '/',
+
+ /**
+ @private
+
+ Used to give history a starting reference
+ */
+ _initialURL: null,
+
+ /**
+ @private
+
+ Returns the current `location.pathname`.
+ */
+ getURL: function() {
+ return get(this, 'location').pathname;
+ },
+
+ /**
+ @private
+
+ Uses `history.pushState` to update the url without a page reload.
+ */
+ setURL: function(path) {
+ var state = window.history.state,
+ initialURL = get(this, '_initialURL');
+
+ path = this.formatPath(path);
+
+ if ((initialURL !== path && !state) || (state && state.path !== path)) {
+ window.history.pushState({ path: path }, null, path);
+ }
+ },
+
+ /**
+ @private
+
+ Register a callback to be invoked whenever the browser
+ history changes, including using forward and back buttons.
+ */
+ onUpdateURL: function(callback) {
+ var guid = Ember.guidFor(this);
+
+ Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {
+ callback(location.pathname);
+ });
+ },
+
+ /**
+ @private
+
+ returns the given path appended to rootURL
+ */
+ formatPath: function(path) {
+ var rootURL = get(this, 'rootURL');
+
+ if (path !== '') {
+ rootURL = rootURL.replace(/\/$/, '');
+ }
+
+ return rootURL + path;
+ },
+
+ /**
+ @private
+
+ Used when using {{action}} helper. Since no formatting
+ is required we just return the url given.
+ */
+ formatURL: function(url) {
+ return url;
+ },
+
+ /** @private */
+ willDestroy: function() {
+ var guid = Ember.guidFor(this);
+
+ Ember.$(window).unbind('popstate.ember-location-'+guid);
+ }
+});
+
+Ember.Location.registerImplementation('history', Ember.HistoryLocation);
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ Ember.NoneLocation does not interact with the browser. It is useful for
+ testing, or when you need to manage state with your Router, but temporarily
+ don't want it to muck with the URL (for example when you embed your
+ application in a larger page).
+
+ @extends Ember.Object
+*/
+Ember.NoneLocation = Ember.Object.extend(
+/** @scope Ember.NoneLocation.prototype */ {
+ path: '',
+
+ getURL: function() {
+ return get(this, 'path');
+ },
+
+ setURL: function(path) {
+ set(this, 'path', path);
+ },
+
+ onUpdateURL: function(callback) {
+ // We are not wired up to the browser, so we'll never trigger the callback.
+ },
+
+ formatURL: function(url) {
+ // The return value is not overly meaningful, but we do not want to throw
+ // errors when test code renders templates containing {{action href=true}}
+ // helpers.
+ return url;
+ }
+});
+
+Ember.Location.registerImplementation('none', Ember.NoneLocation);
+
+})();
+
+
+
+(function() {
+
+})();
+
+
+
+(function() {
+
+})();
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+Ember.assert("Ember Views require jQuery 1.7", window.jQuery && (window.jQuery().jquery.match(/^1\.7(\.\d+)?(pre|rc\d?)?/) || Ember.ENV.FORCE_JQUERY));
+Ember.$ = window.jQuery;
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents
+var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');
+
+// Copies the `dataTransfer` property from a browser event object onto the
+// jQuery event object for the specified events
+Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {
+ Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+var get = Ember.get, set = Ember.set;
+var indexOf = Ember.ArrayPolyfills.indexOf;
+
+/** @private */
+var ClassSet = function() {
+ this.seen = {};
+ this.list = [];
+};
+
+ClassSet.prototype = {
+ add: function(string) {
+ if (string in this.seen) { return; }
+ this.seen[string] = true;
+
+ this.list.push(string);
+ },
+
+ toDOM: function() {
+ return this.list.join(" ");
+ }
+};
+
+/**
+ @class
+
+ Ember.RenderBuffer gathers information regarding the a view and generates the
+ final representation. Ember.RenderBuffer will generate HTML which can be pushed
+ to the DOM.
+
+ @extends Ember.Object
+*/
+Ember.RenderBuffer = function(tagName) {
+ return new Ember._RenderBuffer(tagName);
+};
+
+Ember._RenderBuffer = function(tagName) {
+ this.elementTag = tagName;
+ this.childBuffers = [];
+};
+
+Ember._RenderBuffer.prototype =
+/** @scope Ember.RenderBuffer.prototype */ {
+
+ /**
+ Array of class-names which will be applied in the class="" attribute
+
+ You should not maintain this array yourself, rather, you should use
+ the addClass() method of Ember.RenderBuffer.
+
+ @type Array
+ @default []
+ */
+ elementClasses: null,
+
+ /**
+ The id in of the element, to be applied in the id="" attribute
+
+ You should not set this property yourself, rather, you should use
+ the id() method of Ember.RenderBuffer.
+
+ @type String
+ @default null
+ */
+ elementId: null,
+
+ /**
+ A hash keyed on the name of the attribute and whose value will be
+ applied to that attribute. For example, if you wanted to apply a
+ data-view="Foo.bar" property to an element, you would set the
+ elementAttributes hash to {'data-view':'Foo.bar'}
+
+ You should not maintain this hash yourself, rather, you should use
+ the attr() method of Ember.RenderBuffer.
+
+ @type Hash
+ @default {}
+ */
+ elementAttributes: null,
+
+ /**
+ The tagname of the element an instance of Ember.RenderBuffer represents.
+
+ Usually, this gets set as the first parameter to Ember.RenderBuffer. For
+ example, if you wanted to create a `p` tag, then you would call
+
+ Ember.RenderBuffer('p')
+
+ @type String
+ @default null
+ */
+ elementTag: null,
+
+ /**
+ A hash keyed on the name of the style attribute and whose value will
+ be applied to that attribute. For example, if you wanted to apply a
+ background-color:black;" style to an element, you would set the
+ elementStyle hash to {'background-color':'black'}
+
+ You should not maintain this hash yourself, rather, you should use
+ the style() method of Ember.RenderBuffer.
+
+ @type Hash
+ @default {}
+ */
+ elementStyle: null,
+
+ /**
+ Nested RenderBuffers will set this to their parent RenderBuffer
+ instance.
+
+ @type Ember._RenderBuffer
+ */
+ parentBuffer: null,
+
+ /**
+ Adds a string of HTML to the RenderBuffer.
+
+ @param {String} string HTML to push into the buffer
+ @returns {Ember.RenderBuffer} this
+ */
+ push: function(string) {
+ this.childBuffers.push(String(string));
+ return this;
+ },
+
+ /**
+ Adds a class to the buffer, which will be rendered to the class attribute.
+
+ @param {String} className Class name to add to the buffer
+ @returns {Ember.RenderBuffer} this
+ */
+ addClass: function(className) {
+ // lazily create elementClasses
+ var elementClasses = this.elementClasses = (this.elementClasses || new ClassSet());
+ this.elementClasses.add(className);
+
+ return this;
+ },
+
+ /**
+ Sets the elementID to be used for the element.
+
+ @param {String} id
+ @returns {Ember.RenderBuffer} this
+ */
+ id: function(id) {
+ this.elementId = id;
+ return this;
+ },
+
+ // duck type attribute functionality like jQuery so a render buffer
+ // can be used like a jQuery object in attribute binding scenarios.
+
+ /**
+ Adds an attribute which will be rendered to the element.
+
+ @param {String} name The name of the attribute
+ @param {String} value The value to add to the attribute
+ @returns {Ember.RenderBuffer|String} this or the current attribute value
+ */
+ attr: function(name, value) {
+ var attributes = this.elementAttributes = (this.elementAttributes || {});
+
+ if (arguments.length === 1) {
+ return attributes[name];
+ } else {
+ attributes[name] = value;
+ }
+
+ return this;
+ },
+
+ /**
+ Remove an attribute from the list of attributes to render.
+
+ @param {String} name The name of the attribute
+ @returns {Ember.RenderBuffer} this
+ */
+ removeAttr: function(name) {
+ var attributes = this.elementAttributes;
+ if (attributes) { delete attributes[name]; }
+
+ return this;
+ },
+
+ /**
+ Adds a style to the style attribute which will be rendered to the element.
+
+ @param {String} name Name of the style
+ @param {String} value
+ @returns {Ember.RenderBuffer} this
+ */
+ style: function(name, value) {
+ var style = this.elementStyle = (this.elementStyle || {});
+
+ this.elementStyle[name] = value;
+ return this;
+ },
+
+ /**
+ Create a new child render buffer from a parent buffer. Optionally set
+ additional properties on the buffer. Optionally invoke a callback
+ with the newly created buffer.
+
+ This is a primitive method used by other public methods: `begin`,
+ `prepend`, `replaceWith`, `insertAfter`.
+
+ @private
+ @param {String} tagName Tag name to use for the child buffer's element
+ @param {Ember._RenderBuffer} parent The parent render buffer that this
+ buffer should be appended to.
+ @param {Function} fn A callback to invoke with the newly created buffer.
+ @param {Object} other Additional properties to add to the newly created
+ buffer.
+ */
+ newBuffer: function(tagName, parent, fn, other) {
+ var buffer = new Ember._RenderBuffer(tagName);
+ buffer.parentBuffer = parent;
+
+ if (other) { Ember.$.extend(buffer, other); }
+ if (fn) { fn.call(this, buffer); }
+
+ return buffer;
+ },
+
+ /**
+ Replace the current buffer with a new buffer. This is a primitive
+ used by `remove`, which passes `null` for `newBuffer`, and `replaceWith`,
+ which passes the new buffer it created.
+
+ @private
+ @param {Ember._RenderBuffer} buffer The buffer to insert in place of
+ the existing buffer.
+ */
+ replaceWithBuffer: function(newBuffer) {
+ var parent = this.parentBuffer;
+ if (!parent) { return; }
+
+ var childBuffers = parent.childBuffers;
+
+ var index = indexOf.call(childBuffers, this);
+
+ if (newBuffer) {
+ childBuffers.splice(index, 1, newBuffer);
+ } else {
+ childBuffers.splice(index, 1);
+ }
+ },
+
+ /**
+ Creates a new Ember.RenderBuffer object with the provided tagName as
+ the element tag and with its parentBuffer property set to the current
+ Ember.RenderBuffer.
+
+ @param {String} tagName Tag name to use for the child buffer's element
+ @returns {Ember.RenderBuffer} A new RenderBuffer object
+ */
+ begin: function(tagName) {
+ return this.newBuffer(tagName, this, function(buffer) {
+ this.childBuffers.push(buffer);
+ });
+ },
+
+ /**
+ Prepend a new child buffer to the current render buffer.
+
+ @param {String} tagName Tag name to use for the child buffer's element
+ */
+ prepend: function(tagName) {
+ return this.newBuffer(tagName, this, function(buffer) {
+ this.childBuffers.splice(0, 0, buffer);
+ });
+ },
+
+ /**
+ Replace the current buffer with a new render buffer.
+
+ @param {String} tagName Tag name to use for the new buffer's element
+ */
+ replaceWith: function(tagName) {
+ var parentBuffer = this.parentBuffer;
+
+ return this.newBuffer(tagName, parentBuffer, function(buffer) {
+ this.replaceWithBuffer(buffer);
+ });
+ },
+
+ /**
+ Insert a new render buffer after the current render buffer.
+
+ @param {String} tagName Tag name to use for the new buffer's element
+ */
+ insertAfter: function(tagName) {
+ var parentBuffer = get(this, 'parentBuffer');
+
+ return this.newBuffer(tagName, parentBuffer, function(buffer) {
+ var siblings = parentBuffer.childBuffers;
+ var index = indexOf.call(siblings, this);
+ siblings.splice(index + 1, 0, buffer);
+ });
+ },
+
+ /**
+ Closes the current buffer and adds its content to the parentBuffer.
+
+ @returns {Ember.RenderBuffer} The parentBuffer, if one exists. Otherwise, this
+ */
+ end: function() {
+ var parent = this.parentBuffer;
+ return parent || this;
+ },
+
+ remove: function() {
+ this.replaceWithBuffer(null);
+ },
+
+ /**
+ @returns {DOMElement} The element corresponding to the generated HTML
+ of this buffer
+ */
+ element: function() {
+ return Ember.$(this.string())[0];
+ },
+
+ /**
+ Generates the HTML content for this buffer.
+
+ @returns {String} The generated HTMl
+ */
+ string: function() {
+ var content = '', tag = this.elementTag, openTag;
+
+ if (tag) {
+ var id = this.elementId,
+ classes = this.elementClasses,
+ attrs = this.elementAttributes,
+ style = this.elementStyle,
+ styleBuffer = '', prop;
+
+ openTag = ["<" + tag];
+
+ if (id) { openTag.push('id="' + this._escapeAttribute(id) + '"'); }
+ if (classes) { openTag.push('class="' + this._escapeAttribute(classes.toDOM()) + '"'); }
+
+ if (style) {
+ for (prop in style) {
+ if (style.hasOwnProperty(prop)) {
+ styleBuffer += (prop + ':' + this._escapeAttribute(style[prop]) + ';');
+ }
+ }
+
+ openTag.push('style="' + styleBuffer + '"');
+ }
+
+ if (attrs) {
+ for (prop in attrs) {
+ if (attrs.hasOwnProperty(prop)) {
+ openTag.push(prop + '="' + this._escapeAttribute(attrs[prop]) + '"');
+ }
+ }
+ }
+
+ openTag = openTag.join(" ") + '>';
+ }
+
+ var childBuffers = this.childBuffers;
+
+ Ember.ArrayPolyfills.forEach.call(childBuffers, function(buffer) {
+ var stringy = typeof buffer === 'string';
+ content += (stringy ? buffer : buffer.string());
+ });
+
+ if (tag) {
+ return openTag + content + "</" + tag + ">";
+ } else {
+ return content;
+ }
+ },
+
+ _escapeAttribute: function(value) {
+ // Stolen shamelessly from Handlebars
+
+ var escape = {
+ "<": "&lt;",
+ ">": "&gt;",
+ '"': "&quot;",
+ "'": "&#x27;",
+ "`": "&#x60;"
+ };
+
+ var badChars = /&(?!\w+;)|[<>"'`]/g;
+ var possible = /[&<>"'`]/;
+
+ var escapeChar = function(chr) {
+ return escape[chr] || "&amp;";
+ };
+
+ var string = value.toString();
+
+ if(!possible.test(string)) { return string; }
+ return string.replace(badChars, escapeChar);
+ }
+
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
+
+/**
+ @ignore
+
+ Ember.EventDispatcher handles delegating browser events to their corresponding
+ Ember.Views. For example, when you click on a view, Ember.EventDispatcher ensures
+ that that view's `mouseDown` method gets called.
+*/
+Ember.EventDispatcher = Ember.Object.extend(
+/** @scope Ember.EventDispatcher.prototype */{
+
+ /**
+ @private
+
+ The root DOM element to which event listeners should be attached. Event
+ listeners will be attached to the document unless this is overridden.
+
+ Can be specified as a DOMElement or a selector string.
+
+ The default body is a string since this may be evaluated before document.body
+ exists in the DOM.
+
+ @type DOMElement
+ @default 'body'
+ */
+ rootElement: 'body',
+
+ /**
+ @private
+
+ Sets up event listeners for standard browser events.
+
+ This will be called after the browser sends a DOMContentReady event. By
+ default, it will set up all of the listeners on the document body. If you
+ would like to register the listeners on a different element, set the event
+ dispatcher's `root` property.
+ */
+ setup: function(addedEvents) {
+ var event, events = {
+ touchstart : 'touchStart',
+ touchmove : 'touchMove',
+ touchend : 'touchEnd',
+ touchcancel : 'touchCancel',
+ keydown : 'keyDown',
+ keyup : 'keyUp',
+ keypress : 'keyPress',
+ mousedown : 'mouseDown',
+ mouseup : 'mouseUp',
+ contextmenu : 'contextMenu',
+ click : 'click',
+ dblclick : 'doubleClick',
+ mousemove : 'mouseMove',
+ focusin : 'focusIn',
+ focusout : 'focusOut',
+ mouseenter : 'mouseEnter',
+ mouseleave : 'mouseLeave',
+ submit : 'submit',
+ input : 'input',
+ change : 'change',
+ dragstart : 'dragStart',
+ drag : 'drag',
+ dragenter : 'dragEnter',
+ dragleave : 'dragLeave',
+ dragover : 'dragOver',
+ drop : 'drop',
+ dragend : 'dragEnd'
+ };
+
+ Ember.$.extend(events, addedEvents || {});
+
+ var rootElement = Ember.$(get(this, 'rootElement'));
+
+ Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));
+ Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);
+ Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);
+
+ rootElement.addClass('ember-application');
+
+ Ember.assert('Unable to add "ember-application" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));
+
+ for (event in events) {
+ if (events.hasOwnProperty(event)) {
+ this.setupHandler(rootElement, event, events[event]);
+ }
+ }
+ },
+
+ /**
+ @private
+
+ Registers an event listener on the document. If the given event is
+ triggered, the provided event handler will be triggered on the target
+ view.
+
+ If the target view does not implement the event handler, or if the handler
+ returns false, the parent view will be called. The event will continue to
+ bubble to each successive parent view until it reaches the top.
+
+ For example, to have the `mouseDown` method called on the target view when
+ a `mousedown` event is received from the browser, do the following:
+
+ setupHandler('mousedown', 'mouseDown');
+
+ @param {String} event the browser-originated event to listen to
+ @param {String} eventName the name of the method to call on the view
+ */
+ setupHandler: function(rootElement, event, eventName) {
+ var self = this;
+
+ rootElement.delegate('.ember-view', event + '.ember', function(evt, triggeringManager) {
+
+ var view = Ember.View.views[this.id],
+ result = true, manager = null;
+
+ manager = self._findNearestEventManager(view,eventName);
+
+ if (manager && manager !== triggeringManager) {
+ result = self._dispatchEvent(manager, evt, eventName, view);
+ } else if (view) {
+ result = self._bubbleEvent(view,evt,eventName);
+ } else {
+ evt.stopPropagation();
+ }
+
+ return result;
+ });
+
+ rootElement.delegate('[data-ember-action]', event + '.ember', function(evt) {
+ var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),
+ action = Ember.Handlebars.ActionHelper.registeredActions[actionId],
+ handler = action.handler;
+
+ if (action.eventName === eventName) {
+ return handler(evt);
+ }
+ });
+ },
+
+ /** @private */
+ _findNearestEventManager: function(view, eventName) {
+ var manager = null;
+
+ while (view) {
+ manager = get(view, 'eventManager');
+ if (manager && manager[eventName]) { break; }
+
+ view = get(view, 'parentView');
+ }
+
+ return manager;
+ },
+
+ /** @private */
+ _dispatchEvent: function(object, evt, eventName, view) {
+ var result = true;
+
+ var handler = object[eventName];
+ if (Ember.typeOf(handler) === 'function') {
+ result = handler.call(object, evt, view);
+ // Do not preventDefault in eventManagers.
+ evt.stopPropagation();
+ }
+ else {
+ result = this._bubbleEvent(view, evt, eventName);
+ }
+
+ return result;
+ },
+
+ /** @private */
+ _bubbleEvent: function(view, evt, eventName) {
+ return Ember.run(function() {
+ return view.handleEvent(eventName, evt);
+ });
+ },
+
+ /** @private */
+ destroy: function() {
+ var rootElement = get(this, 'rootElement');
+ Ember.$(rootElement).undelegate('.ember').removeClass('ember-application');
+ return this._super();
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+// Add a new named queue for rendering views that happens
+// after bindings have synced.
+var queues = Ember.run.queues;
+queues.splice(Ember.$.inArray('actions', queues)+1, 0, 'render');
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+Ember.ControllerMixin.reopen({
+
+ target: null,
+ controllers: null,
+ namespace: null,
+ view: null,
+
+ /**
+ `connectOutlet` creates a new instance of a provided view
+ class, wires it up to its associated controller, and
+ assigns the new view to a property on the current controller.
+
+ The purpose of this method is to enable views that use
+ outlets to quickly assign new views for a given outlet.
+
+ For example, an application view's template may look like
+ this:
+
+ <h1>My Blog</h1>
+ {{outlet}}
+
+ The view for this outlet is specified by assigning a
+ `view` property to the application's controller. The
+ following code will assign a new `App.PostsView` to
+ that outlet:
+
+ applicationController.connectOutlet('posts');
+
+ In general, you will also want to assign a controller
+ to the newly created view. By convention, a controller
+ named `postsController` will be assigned as the view's
+ controller.
+
+ In an application initialized using `app.initialize(router)`,
+ `connectOutlet` will look for `postsController` on the
+ router. The initialization process will automatically
+ create an instance of `App.PostsController` called
+ `postsController`, so you don't need to do anything
+ beyond `connectOutlet` to assign your view and wire it
+ up to its associated controller.
+
+ You can supply a `content` for the controller by supplying
+ a final argument after the view class:
+
+ applicationController.connectOutlet('posts', App.Post.find());
+
+ You can specify a particular outlet to use. For example, if your main
+ template looks like:
+
+ <h1>My Blog</h1>
+ {{outlet master}}
+ {{outlet detail}}
+
+ You can assign an `App.PostsView` to the master outlet:
+
+ applicationController.connectOutlet({
+ name: 'posts',
+ outletName: 'master',
+ context: App.Post.find()
+ });
+
+ You can write this as:
+
+ applicationController.connectOutlet('master', 'posts', App.Post.find());
+
+ @param {String} outletName a name for the outlet to set
+ @param {String} name a view/controller pair name
+ @param {Object} context a context object to assign to the
+ controller's `content` property, if a controller can be
+ found (optional)
+ */
+ connectOutlet: function(name, context) {
+ // Normalize arguments. Supported arguments:
+ //
+ // name
+ // name, context
+ // outletName, name
+ // outletName, name, context
+ // options
+ //
+ // The options hash has the following keys:
+ //
+ // name: the name of the controller and view
+ // to use. If this is passed, the name
+ // determines the view and controller.
+ // outletName: the name of the outlet to
+ // fill in. default: 'view'
+ // viewClass: the class of the view to instantiate
+ // controller: the controller instance to pass
+ // to the view
+ // context: an object that should become the
+ // controller's `content` and thus the
+ // template's context.
+
+ var outletName, viewClass, view, controller, options;
+
+ if (Ember.typeOf(context) === 'string') {
+ outletName = name;
+ name = context;
+ context = arguments[2];
+ }
+
+ if (arguments.length === 1) {
+ if (Ember.typeOf(name) === 'object') {
+ options = name;
+ outletName = options.outletName;
+ name = options.name;
+ viewClass = options.viewClass;
+ controller = options.controller;
+ context = options.context;
+ }
+ } else {
+ options = {};
+ }
+
+ outletName = outletName || 'view';
+
+ Ember.assert("You must supply a name or a view class to connectOutlets, but not both", (!!name && !viewClass && !controller) || (!name && !!viewClass));
+
+ if (name) {
+ var namespace = get(this, 'namespace'),
+ controllers = get(this, 'controllers');
+
+ var viewClassName = name.charAt(0).toUpperCase() + name.substr(1) + "View";
+ viewClass = get(namespace, viewClassName);
+ controller = get(controllers, name + 'Controller');
+
+ Ember.assert("The name you supplied " + name + " did not resolve to a view " + viewClassName, !!viewClass);
+ Ember.assert("The name you supplied " + name + " did not resolve to a controller " + name + 'Controller', (!!controller && !!context) || !context);
+ }
+
+ if (controller && context) { controller.set('content', context); }
+ view = viewClass.create();
+ if (controller) { set(view, 'controller', controller); }
+ set(this, outletName, view);
+
+ return view;
+ },
+
+ /**
+ Convenience method to connect controllers. This method makes other controllers
+ available on the controller the method was invoked on.
+
+ For example, to make the `personController` and the `postController` available
+ on the `overviewController`, you would call:
+
+ overviewController.connectControllers('person', 'post');
+
+ @param {String...} controllerNames the controllers to make available
+ */
+ connectControllers: function() {
+ var controllers = get(this, 'controllers'),
+ controllerNames = Array.prototype.slice.apply(arguments),
+ controllerName;
+
+ for (var i=0, l=controllerNames.length; i<l; i++) {
+ controllerName = controllerNames[i] + 'Controller';
+ set(this, controllerName, get(controllers, controllerName));
+ }
+ }
+});
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, addObserver = Ember.addObserver;
+var meta = Ember.meta, fmt = Ember.String.fmt;
+var a_slice = [].slice;
+var a_forEach = Ember.EnumerableUtils.forEach;
+
+var childViewsProperty = Ember.computed(function() {
+ var childViews = this._childViews;
+
+ var ret = Ember.A();
+
+ a_forEach(childViews, function(view) {
+ if (view.isVirtual) {
+ ret.pushObjects(get(view, 'childViews'));
+ } else {
+ ret.push(view);
+ }
+ });
+
+ return ret;
+}).property().cacheable();
+
+var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
+Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);
+
+/**
+ @static
+
+ Global hash of shared templates. This will automatically be populated
+ by the build tools so that you can store your Handlebars templates in
+ separate files that get loaded into JavaScript at buildtime.
+
+ @type Hash
+*/
+Ember.TEMPLATES = {};
+
+var invokeForState = {
+ preRender: {},
+ inBuffer: {},
+ hasElement: {},
+ inDOM: {},
+ destroyed: {}
+};
+
+/**
+ @class
+
+ `Ember.View` is the class in Ember responsible for encapsulating templates of HTML
+ content, combining templates with data to render as sections of a page's DOM, and
+ registering and responding to user-initiated events.
+
+ ## HTML Tag
+ The default HTML tag name used for a view's DOM representation is `div`. This can be
+ customized by setting the `tagName` property. The following view class:
+
+ ParagraphView = Ember.View.extend({
+ tagName: 'em'
+ })
+
+ Would result in instances with the following HTML:
+
+ <em id="ember1" class="ember-view"></em>
+
+ ## HTML `class` Attribute
+ The HTML `class` attribute of a view's tag can be set by providing a `classNames` property
+ that is set to an array of strings:
+
+ MyView = Ember.View.extend({
+ classNames: ['my-class', 'my-other-class']
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view my-class my-other-class"></div>
+
+ `class` attribute values can also be set by providing a `classNameBindings` property
+ set to an array of properties names for the view. The return value of these properties
+ will be added as part of the value for the view's `class` attribute. These properties
+ can be computed properties:
+
+ MyView = Ember.View.extend({
+ classNameBindings: ['propertyA', 'propertyB'],
+ propertyA: 'from-a',
+ propertyB: function(){
+ if(someLogic){ return 'from-b'; }
+ }.property()
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view from-a from-b"></div>
+
+ If the value of a class name binding returns a boolean the property name itself
+ will be used as the class name if the property is true. The class name will
+ not be added if the value is `false` or `undefined`.
+
+ MyView = Ember.View.extend({
+ classNameBindings: ['hovered'],
+ hovered: true
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view hovered"></div>
+
+ When using boolean class name bindings you can supply a string value other than the
+ property name for use as the `class` HTML attribute by appending the preferred value after
+ a ":" character when defining the binding:
+
+ MyView = Ember.View.extend({
+ classNameBindings: ['awesome:so-very-cool'],
+ awesome: true
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view so-very-cool"></div>
+
+
+ Boolean value class name bindings whose property names are in a camelCase-style
+ format will be converted to a dasherized format:
+
+ MyView = Ember.View.extend({
+ classNameBindings: ['isUrgent'],
+ isUrgent: true
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view is-urgent"></div>
+
+
+ Class name bindings can also refer to object values that are found by
+ traversing a path relative to the view itself:
+
+ MyView = Ember.View.extend({
+ classNameBindings: ['messages.empty']
+ messages: Ember.Object.create({
+ empty: true
+ })
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view empty"></div>
+
+
+ If you want to add a class name for a property which evaluates to true and
+ and a different class name if it evaluates to false, you can pass a binding
+ like this:
+
+ // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false
+ Ember.View.create({
+ classNameBindings: ['isEnabled:enabled:disabled']
+ isEnabled: true
+ });
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view enabled"></div>
+
+ When isEnabled is `false`, the resulting HTML reprensentation looks like this:
+
+ <div id="ember1" class="ember-view disabled"></div>
+
+ This syntax offers the convenience to add a class if a property is `false`:
+
+ // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false
+ Ember.View.create({
+ classNameBindings: ['isEnabled::disabled']
+ isEnabled: true
+ });
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view"></div>
+
+ When the `isEnabled` property on the view is set to `false`, it will result
+ in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view disabled"></div>
+
+
+ Updates to the the value of a class name binding will result in automatic update
+ of the HTML `class` attribute in the view's rendered HTML representation.
+ If the value becomes `false` or `undefined` the class name will be removed.
+
+ Both `classNames` and `classNameBindings` are concatenated properties.
+ See `Ember.Object` documentation for more information about concatenated properties.
+
+ ## HTML Attributes
+ The HTML attribute section of a view's tag can be set by providing an `attributeBindings`
+ property set to an array of property names on the view. The return value of these properties
+ will be used as the value of the view's HTML associated attribute:
+
+ AnchorView = Ember.View.extend({
+ tagName: 'a',
+ attributeBindings: ['href'],
+ href: 'http://google.com'
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <a id="ember1" class="ember-view" href="http://google.com"></a>
+
+ If the return value of an `attributeBindings` monitored property is a boolean
+ the property will follow HTML's pattern of repeating the attribute's name as
+ its value:
+
+ MyTextInput = Ember.View.extend({
+ tagName: 'input',
+ attributeBindings: ['disabled'],
+ disabled: true
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <input id="ember1" class="ember-view" disabled="disabled" />
+
+ `attributeBindings` can refer to computed properties:
+
+ MyTextInput = Ember.View.extend({
+ tagName: 'input',
+ attributeBindings: ['disabled'],
+ disabled: function(){
+ if (someLogic) {
+ return true;
+ } else {
+ return false;
+ }
+ }.property()
+ })
+
+ Updates to the the property of an attribute binding will result in automatic update
+ of the HTML attribute in the view's rendered HTML representation.
+
+ `attributeBindings` is a concatenated property. See `Ember.Object` documentation
+ for more information about concatenated properties.
+
+ ## Templates
+ The HTML contents of a view's rendered representation are determined by its template.
+ Templates can be any function that accepts an optional context parameter and returns
+ a string of HTML that will be inserted within the view's tag. Most
+ typically in Ember this function will be a compiled Ember.Handlebars template.
+
+ AView = Ember.View.extend({
+ template: Ember.Handlebars.compile('I am the template')
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view">I am the template</div>
+
+ The default context of the compiled template will be the view instance itself:
+
+ AView = Ember.View.extend({
+ template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')
+ })
+
+ aView = AView.create({
+ content: Ember.Object.create({
+ firstName: 'Barry'
+ })
+ excitedGreeting: function(){
+ return this.get("content.firstName") + "!!!"
+ }
+ })
+
+ Will result in an HTML representation of:
+
+ <div id="ember1" class="ember-view">Hello Barry!!!</div>
+
+ Within an Ember application is more common to define a Handlebars templates as
+ part of a page:
+
+ <script type='text/x-handlebars' data-template-name='some-template'>
+ Hello
+ </script>
+
+ And associate it by name using a view's `templateName` property:
+
+ AView = Ember.View.extend({
+ templateName: 'some-template'
+ })
+
+ Using a value for `templateName` that does not have a Handlebars template with a
+ matching `data-template-name` attribute will throw an error.
+
+ Assigning a value to both `template` and `templateName` properties will throw an error.
+
+ For views classes that may have a template later defined (e.g. as the block portion of a `{{view}}`
+ Handlebars helper call in another template or in a subclass), you can provide a `defaultTemplate`
+ property set to compiled template function. If a template is not later provided for the view
+ instance the `defaultTemplate` value will be used:
+
+ AView = Ember.View.extend({
+ defaultTemplate: Ember.Handlebars.compile('I was the default'),
+ template: null,
+ templateName: null
+ })
+
+ Will result in instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view">I was the default</div>
+
+ If a `template` or `templateName` is provided it will take precedence over `defaultTemplate`:
+
+ AView = Ember.View.extend({
+ defaultTemplate: Ember.Handlebars.compile('I was the default')
+ })
+
+ aView = AView.create({
+ template: Ember.Handlebars.compile('I was the template, not default')
+ })
+
+ Will result in the following HTML representation when rendered:
+
+ <div id="ember1" class="ember-view">I was the template, not default</div>
+
+ ## Layouts
+ Views can have a secondary template that wraps their main template. Like
+ primary templates, layouts can be any function that accepts an optional context
+ parameter and returns a string of HTML that will be inserted inside view's tag. Views whose HTML
+ element is self closing (e.g. `<input />`) cannot have a layout and this property will be ignored.
+
+ Most typically in Ember a layout will be a compiled Ember.Handlebars template.
+
+ A view's layout can be set directly with the `layout` property or reference an
+ existing Handlebars template by name with the `layoutName` property.
+
+ A template used as a layout must contain a single use of the Handlebars `{{yield}}`
+ helper. The HTML contents of a view's rendered `template` will be inserted at this location:
+
+ AViewWithLayout = Ember.View.extend({
+ layout: Ember.Handlebars.compile("<div class='my-decorative-class'>{{yield}}</div>")
+ template: Ember.Handlebars.compile("I got wrapped"),
+ })
+
+ Will result in view instances with an HTML representation of:
+
+ <div id="ember1" class="ember-view">
+ <div class="my-decorative-class">
+ I got wrapped
+ </div>
+ </div>
+
+ See `Handlebars.helpers.yield` for more information.
+
+ ## Responding to Browser Events
+ Views can respond to user-initiated events in one of three ways: method implementation,
+ through an event manager, and through `{{action}}` helper use in their template or layout.
+
+ ### Method Implementation
+ Views can respond to user-initiated events by implementing a method that matches the
+ event name. A `jQuery.Event` object will be passed as the argument to this method.
+
+ AView = Ember.View.extend({
+ click: function(event){
+ // will be called when when an instance's
+ // rendered element is clicked
+ }
+ })
+
+ ### Event Managers
+ Views can define an object as their `eventManager` property. This object can then
+ implement methods that match the desired event names. Matching events that occur
+ on the view's rendered HTML or the rendered HTML of any of its DOM descendants
+ will trigger this method. A `jQuery.Event` object will be passed as the first
+ argument to the method and an `Ember.View` object as the second. The `Ember.View`
+ will be the view whose rendered HTML was interacted with. This may be the view with
+ the `eventManager` property or one of its descendent views.
+
+ AView = Ember.View.extend({
+ eventManager: Ember.Object.create({
+ doubleClick: function(event, view){
+ // will be called when when an instance's
+ // rendered element or any rendering
+ // of this views's descendent
+ // elements is clicked
+ }
+ })
+ })
+
+
+ An event defined for an event manager takes precedence over events of the same
+ name handled through methods on the view.
+
+
+ AView = Ember.View.extend({
+ mouseEnter: function(event){
+ // will never trigger.
+ },
+ eventManager: Ember.Object.create({
+ mouseEnter: function(event, view){
+ // takes presedence over AView#mouseEnter
+ }
+ })
+ })
+
+ Similarly a view's event manager will take precedence for events of any views
+ rendered as a descendent. A method name that matches an event name will not be called
+ if the view instance was rendered inside the HTML representation of a view that has
+ an `eventManager` property defined that handles events of the name. Events not handled
+ by the event manager will still trigger method calls on the descendent.
+
+ OuterView = Ember.View.extend({
+ template: Ember.Handlebars.compile("outer {{#view InnerView}}inner{{/view}} outer"),
+ eventManager: Ember.Object.create({
+ mouseEnter: function(event, view){
+ // view might be instance of either
+ // OutsideView or InnerView depending on
+ // where on the page the user interaction occured
+ }
+ })
+ })
+
+ InnerView = Ember.View.extend({
+ click: function(event){
+ // will be called if rendered inside
+ // an OuterView because OuterView's
+ // eventManager doesn't handle click events
+ },
+ mouseEnter: function(event){
+ // will never be called if rendered inside
+ // an OuterView.
+ }
+ })
+
+ ### Handlebars `{{action}}` Helper
+ See `Handlebars.helpers.action`.
+
+ ### Event Names
+ Possible events names for any of the responding approaches described above are:
+
+ Touch events: 'touchStart', 'touchMove', 'touchEnd', 'touchCancel'
+
+ Keyboard events: 'keyDown', 'keyUp', 'keyPress'
+
+ Mouse events: 'mouseDown', 'mouseUp', 'contextMenu', 'click', 'doubleClick', 'mouseMove',
+ 'focusIn', 'focusOut', 'mouseEnter', 'mouseLeave'
+
+ Form events: 'submit', 'change', 'focusIn', 'focusOut', 'input'
+
+ HTML5 drag and drop events: 'dragStart', 'drag', 'dragEnter', 'dragLeave', 'drop', 'dragEnd'
+
+ ## Handlebars `{{view}}` Helper
+ Other `Ember.View` instances can be included as part of a view's template by using the `{{view}}`
+ Handlebars helper. See `Handlebars.helpers.view` for additional information.
+
+ @extends Ember.Object
+ @extends Ember.Evented
+*/
+Ember.View = Ember.Object.extend(Ember.Evented,
+/** @scope Ember.View.prototype */ {
+
+ /** @private */
+ concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],
+
+ /**
+ @type Boolean
+ @default true
+ @constant
+ */
+ isView: true,
+
+ // ..........................................................
+ // TEMPLATE SUPPORT
+ //
+
+ /**
+ The name of the template to lookup if no template is provided.
+
+ Ember.View will look for a template with this name in this view's
+ `templates` object. By default, this will be a global object
+ shared in `Ember.TEMPLATES`.
+
+ @type String
+ @default null
+ */
+ templateName: null,
+
+ /**
+ The name of the layout to lookup if no layout is provided.
+
+ Ember.View will look for a template with this name in this view's
+ `templates` object. By default, this will be a global object
+ shared in `Ember.TEMPLATES`.
+
+ @type String
+ @default null
+ */
+ layoutName: null,
+
+ /**
+ The hash in which to look for `templateName`.
+
+ @type Ember.Object
+ @default Ember.TEMPLATES
+ */
+ templates: Ember.TEMPLATES,
+
+ /**
+ The template used to render the view. This should be a function that
+ accepts an optional context parameter and returns a string of HTML that
+ will be inserted into the DOM relative to its parent view.
+
+ In general, you should set the `templateName` property instead of setting
+ the template yourself.
+
+ @field
+ @type Function
+ */
+ template: Ember.computed(function(key, value) {
+ if (value !== undefined) { return value; }
+
+ var templateName = get(this, 'templateName'),
+ template = this.templateForName(templateName, 'template');
+
+ return template || get(this, 'defaultTemplate');
+ }).property('templateName').cacheable(),
+
+ /**
+ The controller managing this view. If this property is set, it will be
+ made available for use by the template.
+
+ @type Object
+ */
+ controller: Ember.computed(function(key, value) {
+ var parentView;
+
+ if (arguments.length === 2) {
+ return value;
+ } else {
+ parentView = get(this, 'parentView');
+ return parentView ? get(parentView, 'controller') : null;
+ }
+ }).property().cacheable(),
+
+ /**
+ A view may contain a layout. A layout is a regular template but
+ supersedes the `template` property during rendering. It is the
+ responsibility of the layout template to retrieve the `template`
+ property from the view (or alternatively, call `Handlebars.helpers.yield`,
+ `{{yield}}`) to render it in the correct location.
+
+ This is useful for a view that has a shared wrapper, but which delegates
+ the rendering of the contents of the wrapper to the `template` property
+ on a subclass.
+
+ @field
+ @type Function
+ */
+ layout: Ember.computed(function(key, value) {
+ if (arguments.length === 2) { return value; }
+
+ var layoutName = get(this, 'layoutName'),
+ layout = this.templateForName(layoutName, 'layout');
+
+ return layout || get(this, 'defaultLayout');
+ }).property('layoutName').cacheable(),
+
+ templateForName: function(name, type) {
+ if (!name) { return; }
+
+ var templates = get(this, 'templates'),
+ template = get(templates, name);
+
+ if (!template) {
+ throw new Ember.Error(fmt('%@ - Unable to find %@ "%@".', [this, type, name]));
+ }
+
+ return template;
+ },
+
+ /**
+ The object from which templates should access properties.
+
+ This object will be passed to the template function each time the render
+ method is called, but it is up to the individual function to decide what
+ to do with it.
+
+ By default, this will be the view itself.
+
+ @type Object
+ */
+ context: Ember.computed(function(key, value) {
+ if (arguments.length === 2) {
+ set(this, '_context', value);
+ return value;
+ } else {
+ return get(this, '_context');
+ }
+ }).cacheable(),
+
+ /**
+ @private
+
+ Private copy of the view's template context. This can be set directly
+ by Handlebars without triggering the observer that causes the view
+ to be re-rendered.
+
+ The context of a view is looked up as follows:
+
+ 1. Specified controller
+ 2. Supplied context (usually by Handlebars)
+ 3. `parentView`'s context (for a child of a ContainerView)
+
+ The code in Handlebars that overrides the `_context` property first
+ checks to see whether the view has a specified controller. This is
+ something of a hack and should be revisited.
+ */
+ _context: Ember.computed(function(key, value) {
+ var parentView, controller, context;
+
+ if (arguments.length === 2) {
+ return value;
+ }
+
+ if (VIEW_PRESERVES_CONTEXT) {
+ if (controller = get(this, 'controller')) {
+ return controller;
+ }
+
+ parentView = get(this, '_parentView');
+ if (parentView) {
+ return get(parentView, '_context');
+ }
+ }
+
+ return this;
+ }).cacheable(),
+
+ /**
+ If a value that affects template rendering changes, the view should be
+ re-rendered to reflect the new value.
+
+ @private
+ */
+ _displayPropertyDidChange: Ember.observer(function() {
+ this.rerender();
+ }, 'context', 'controller'),
+
+ /**
+ If the view is currently inserted into the DOM of a parent view, this
+ property will point to the parent of the view.
+
+ @type Ember.View
+ @default null
+ */
+ parentView: Ember.computed(function() {
+ var parent = get(this, '_parentView');
+
+ if (parent && parent.isVirtual) {
+ return get(parent, 'parentView');
+ } else {
+ return parent;
+ }
+ }).property('_parentView').volatile(),
+
+ _parentView: null,
+
+ // return the current view, not including virtual views
+ concreteView: Ember.computed(function() {
+ if (!this.isVirtual) { return this; }
+ else { return get(this, 'parentView'); }
+ }).property('_parentView').volatile(),
+
+ /**
+ If false, the view will appear hidden in DOM.
+
+ @type Boolean
+ @default null
+ */
+ isVisible: true,
+
+ /**
+ Array of child views. You should never edit this array directly.
+ Instead, use appendChild and removeFromParent.
+
+ @private
+ @type Array
+ @default []
+ */
+ childViews: childViewsProperty,
+
+ _childViews: [],
+
+ /**
+ When it's a virtual view, we need to notify the parent that their
+ childViews will change.
+ */
+ _childViewsWillChange: Ember.beforeObserver(function() {
+ if (this.isVirtual) {
+ var parentView = get(this, 'parentView');
+ if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }
+ }
+ }, 'childViews'),
+
+ /**
+ When it's a virtual view, we need to notify the parent that their
+ childViews did change.
+ */
+ _childViewsDidChange: Ember.observer(function() {
+ if (this.isVirtual) {
+ var parentView = get(this, 'parentView');
+ if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }
+ }
+ }, 'childViews'),
+
+ /**
+ Return the nearest ancestor that is an instance of the provided
+ class.
+
+ @param {Class} klass Subclass of Ember.View (or Ember.View itself)
+ @returns Ember.View
+ */
+ nearestInstanceOf: function(klass) {
+ var view = get(this, 'parentView');
+
+ while (view) {
+ if(view instanceof klass) { return view; }
+ view = get(view, 'parentView');
+ }
+ },
+
+ /**
+ Return the nearest ancestor that has a given property.
+
+ @param {String} property A property name
+ @returns Ember.View
+ */
+ nearestWithProperty: function(property) {
+ var view = get(this, 'parentView');
+
+ while (view) {
+ if (property in view) { return view; }
+ view = get(view, 'parentView');
+ }
+ },
+
+ /**
+ Return the nearest ancestor whose parent is an instance of
+ `klass`.
+
+ @param {Class} klass Subclass of Ember.View (or Ember.View itself)
+ @returns Ember.View
+ */
+ nearestChildOf: function(klass) {
+ var view = get(this, 'parentView');
+
+ while (view) {
+ if(get(view, 'parentView') instanceof klass) { return view; }
+ view = get(view, 'parentView');
+ }
+ },
+
+ /**
+ Return the nearest ancestor that is an Ember.CollectionView
+
+ @returns Ember.CollectionView
+ */
+ collectionView: Ember.computed(function() {
+ return this.nearestInstanceOf(Ember.CollectionView);
+ }).cacheable(),
+
+ /**
+ Return the nearest ancestor that is a direct child of
+ an Ember.CollectionView
+
+ @returns Ember.View
+ */
+ itemView: Ember.computed(function() {
+ return this.nearestChildOf(Ember.CollectionView);
+ }).cacheable(),
+
+ /**
+ Return the nearest ancestor that has the property
+ `content`.
+
+ @returns Ember.View
+ */
+ contentView: Ember.computed(function() {
+ return this.nearestWithProperty('content');
+ }).cacheable(),
+
+ /**
+ @private
+
+ When the parent view changes, recursively invalidate
+ collectionView, itemView, and contentView
+ */
+ _parentViewDidChange: Ember.observer(function() {
+ if (this.isDestroying) { return; }
+
+ this.invokeRecursively(function(view) {
+ view.propertyDidChange('collectionView');
+ view.propertyDidChange('itemView');
+ view.propertyDidChange('contentView');
+ });
+
+ if (get(this, 'parentView.controller') && !get(this, 'controller')) {
+ this.notifyPropertyChange('controller');
+ }
+ }, '_parentView'),
+
+ _controllerDidChange: Ember.observer(function() {
+ if (this.isDestroying) { return; }
+
+ this.forEachChildView(function(view) {
+ view.propertyDidChange('controller');
+ });
+ }, 'controller'),
+
+ cloneKeywords: function() {
+ var templateData = get(this, 'templateData');
+
+ var keywords = templateData ? Ember.copy(templateData.keywords) : {};
+ set(keywords, 'view', get(this, 'concreteView'));
+ set(keywords, 'controller', get(this, 'controller'));
+
+ return keywords;
+ },
+
+ /**
+ Called on your view when it should push strings of HTML into a
+ Ember.RenderBuffer. Most users will want to override the `template`
+ or `templateName` properties instead of this method.
+
+ By default, Ember.View will look for a function in the `template`
+ property and invoke it with the value of `context`. The value of
+ `context` will be the view's controller unless you override it.
+
+ @param {Ember.RenderBuffer} buffer The render buffer
+ */
+ render: function(buffer) {
+ // If this view has a layout, it is the responsibility of the
+ // the layout to render the view's template. Otherwise, render the template
+ // directly.
+ var template = get(this, 'layout') || get(this, 'template');
+
+ if (template) {
+ var context = get(this, '_context');
+ var keywords = this.cloneKeywords();
+
+ var data = {
+ view: this,
+ buffer: buffer,
+ isRenderData: true,
+ keywords: keywords
+ };
+
+ // Invoke the template with the provided template context, which
+ // is the view by default. A hash of data is also passed that provides
+ // the template with access to the view and render buffer.
+
+ Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile("...") or specify templateName instead?', typeof template === 'function');
+ // The template should write directly to the render buffer instead
+ // of returning a string.
+ var output = template(context, { data: data });
+
+ // If the template returned a string instead of writing to the buffer,
+ // push the string onto the buffer.
+ if (output !== undefined) { buffer.push(output); }
+ }
+ },
+
+ invokeForState: function(name) {
+ var stateName = this.state, args, fn;
+
+ // try to find the function for the state in the cache
+ if (fn = invokeForState[stateName][name]) {
+ args = a_slice.call(arguments);
+ args[0] = this;
+
+ return fn.apply(this, args);
+ }
+
+ // otherwise, find and cache the function for this state
+ var parent = this, states = parent.states, state;
+
+ while (states) {
+ state = states[stateName];
+
+ while (state) {
+ fn = state[name];
+
+ if (fn) {
+ invokeForState[stateName][name] = fn;
+
+ args = a_slice.call(arguments, 1);
+ args.unshift(this);
+
+ return fn.apply(this, args);
+ }
+
+ state = state.parentState;
+ }
+
+ states = states.parent;
+ }
+ },
+
+ /**
+ Renders the view again. This will work regardless of whether the
+ view is already in the DOM or not. If the view is in the DOM, the
+ rendering process will be deferred to give bindings a chance
+ to synchronize.
+
+ If children were added during the rendering process using `appendChild`,
+ `rerender` will remove them, because they will be added again
+ if needed by the next `render`.
+
+ In general, if the display of your view changes, you should modify
+ the DOM element directly instead of manually calling `rerender`, which can
+ be slow.
+ */
+ rerender: function() {
+ return this.invokeForState('rerender');
+ },
+
+ clearRenderedChildren: function() {
+ var lengthBefore = this.lengthBeforeRender,
+ lengthAfter = this.lengthAfterRender;
+
+ // If there were child views created during the last call to render(),
+ // remove them under the assumption that they will be re-created when
+ // we re-render.
+
+ // VIEW-TODO: Unit test this path.
+ var childViews = this._childViews;
+ for (var i=lengthAfter-1; i>=lengthBefore; i--) {
+ if (childViews[i]) { childViews[i].destroy(); }
+ }
+ },
+
+ /**
+ @private
+
+ Iterates over the view's `classNameBindings` array, inserts the value
+ of the specified property into the `classNames` array, then creates an
+ observer to update the view's element if the bound property ever changes
+ in the future.
+ */
+ _applyClassNameBindings: function() {
+ var classBindings = get(this, 'classNameBindings'),
+ classNames = get(this, 'classNames'),
+ elem, newClass, dasherizedClass;
+
+ if (!classBindings) { return; }
+
+ // Loop through all of the configured bindings. These will be either
+ // property names ('isUrgent') or property paths relative to the view
+ // ('content.isUrgent')
+ a_forEach(classBindings, function(binding) {
+
+ // Variable in which the old class value is saved. The observer function
+ // closes over this variable, so it knows which string to remove when
+ // the property changes.
+ var oldClass;
+
+ // Set up an observer on the context. If the property changes, toggle the
+ // class name.
+ var observer = function() {
+ // Get the current value of the property
+ newClass = this._classStringForProperty(binding);
+ elem = this.$();
+
+ // If we had previously added a class to the element, remove it.
+ if (oldClass) {
+ elem.removeClass(oldClass);
+ // Also remove from classNames so that if the view gets rerendered,
+ // the class doesn't get added back to the DOM.
+ classNames.removeObject(oldClass);
+ }
+
+ // If necessary, add a new class. Make sure we keep track of it so
+ // it can be removed in the future.
+ if (newClass) {
+ elem.addClass(newClass);
+ oldClass = newClass;
+ } else {
+ oldClass = null;
+ }
+ };
+
+ // Get the class name for the property at its current value
+ dasherizedClass = this._classStringForProperty(binding);
+
+ if (dasherizedClass) {
+ // Ensure that it gets into the classNames array
+ // so it is displayed when we render.
+ classNames.push(dasherizedClass);
+
+ // Save a reference to the class name so we can remove it
+ // if the observer fires. Remember that this variable has
+ // been closed over by the observer.
+ oldClass = dasherizedClass;
+ }
+
+ // Extract just the property name from bindings like 'foo:bar'
+ var parsedPath = Ember.View._parsePropertyPath(binding);
+ addObserver(this, parsedPath.path, observer);
+ }, this);
+ },
+
+ /**
+ Iterates through the view's attribute bindings, sets up observers for each,
+ then applies the current value of the attributes to the passed render buffer.
+
+ @param {Ember.RenderBuffer} buffer
+ */
+ _applyAttributeBindings: function(buffer) {
+ var attributeBindings = get(this, 'attributeBindings'),
+ attributeValue, elem, type;
+
+ if (!attributeBindings) { return; }
+
+ a_forEach(attributeBindings, function(binding) {
+ var split = binding.split(':'),
+ property = split[0],
+ attributeName = split[1] || property;
+
+ // Create an observer to add/remove/change the attribute if the
+ // JavaScript property changes.
+ var observer = function() {
+ elem = this.$();
+ if (!elem) { return; }
+
+ attributeValue = get(this, property);
+
+ Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);
+ };
+
+ addObserver(this, property, observer);
+
+ // Determine the current value and add it to the render buffer
+ // if necessary.
+ attributeValue = get(this, property);
+ Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);
+ }, this);
+ },
+
+ /**
+ @private
+
+ Given a property name, returns a dasherized version of that
+ property name if the property evaluates to a non-falsy value.
+
+ For example, if the view has property `isUrgent` that evaluates to true,
+ passing `isUrgent` to this method will return `"is-urgent"`.
+ */
+ _classStringForProperty: function(property) {
+ var parsedPath = Ember.View._parsePropertyPath(property);
+ var path = parsedPath.path;
+
+ var val = get(this, path);
+ if (val === undefined && Ember.isGlobalPath(path)) {
+ val = get(window, path);
+ }
+
+ return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);
+ },
+
+ // ..........................................................
+ // ELEMENT SUPPORT
+ //
+
+ /**
+ Returns the current DOM element for the view.
+
+ @field
+ @type DOMElement
+ */
+ element: Ember.computed(function(key, value) {
+ if (value !== undefined) {
+ return this.invokeForState('setElement', value);
+ } else {
+ return this.invokeForState('getElement');
+ }
+ }).property('_parentView').cacheable(),
+
+ /**
+ Returns a jQuery object for this view's element. If you pass in a selector
+ string, this method will return a jQuery object, using the current element
+ as its buffer.
+
+ For example, calling `view.$('li')` will return a jQuery object containing
+ all of the `li` elements inside the DOM element of this view.
+
+ @param {String} [selector] a jQuery-compatible selector string
+ @returns {Ember.CoreQuery} the CoreQuery object for the DOM node
+ */
+ $: function(sel) {
+ return this.invokeForState('$', sel);
+ },
+
+ /** @private */
+ mutateChildViews: function(callback) {
+ var childViews = this._childViews,
+ idx = childViews.length,
+ view;
+
+ while(--idx >= 0) {
+ view = childViews[idx];
+ callback.call(this, view, idx);
+ }
+
+ return this;
+ },
+
+ /** @private */
+ forEachChildView: function(callback) {
+ var childViews = this._childViews;
+
+ if (!childViews) { return this; }
+
+ var len = childViews.length,
+ view, idx;
+
+ for(idx = 0; idx < len; idx++) {
+ view = childViews[idx];
+ callback.call(this, view);
+ }
+
+ return this;
+ },
+
+ /**
+ Appends the view's element to the specified parent element.
+
+ If the view does not have an HTML representation yet, `createElement()`
+ will be called automatically.
+
+ Note that this method just schedules the view to be appended; the DOM
+ element will not be appended to the given element until all bindings have
+ finished synchronizing.
+
+ This is not typically a function that you will need to call directly
+ when building your application. You might consider using Ember.ContainerView
+ instead. If you do need to use appendTo, be sure that the target element you
+ are providing is associated with an Ember.Application and does not have an
+ ancestor element that is associated with an Ember view.
+
+ @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object
+ @returns {Ember.View} receiver
+ */
+ appendTo: function(target) {
+ // Schedule the DOM element to be created and appended to the given
+ // element after bindings have synchronized.
+ this._insertElementLater(function() {
+ Ember.assert("You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));
+ this.$().appendTo(target);
+ });
+
+ return this;
+ },
+
+ /**
+ Replaces the content of the specified parent element with this view's element.
+ If the view does not have an HTML representation yet, `createElement()`
+ will be called automatically.
+
+ Note that this method just schedules the view to be appended; the DOM
+ element will not be appended to the given element until all bindings have
+ finished synchronizing
+
+ @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object
+ @returns {Ember.View} received
+ */
+ replaceIn: function(target) {
+ Ember.assert("You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));
+
+ this._insertElementLater(function() {
+ Ember.$(target).empty();
+ this.$().appendTo(target);
+ });
+
+ return this;
+ },
+
+ /**
+ @private
+
+ Schedules a DOM operation to occur during the next render phase. This
+ ensures that all bindings have finished synchronizing before the view is
+ rendered.
+
+ To use, pass a function that performs a DOM operation..
+
+ Before your function is called, this view and all child views will receive
+ the `willInsertElement` event. After your function is invoked, this view
+ and all of its child views will receive the `didInsertElement` event.
+
+ view._insertElementLater(function() {
+ this.createElement();
+ this.$().appendTo('body');
+ });
+
+ @param {Function} fn the function that inserts the element into the DOM
+ */
+ _insertElementLater: function(fn) {
+ this._lastInsert = Ember.guidFor(fn);
+ Ember.run.schedule('render', this, this.invokeForState, 'insertElement', fn);
+ },
+
+ /**
+ Appends the view's element to the document body. If the view does
+ not have an HTML representation yet, `createElement()` will be called
+ automatically.
+
+ Note that this method just schedules the view to be appended; the DOM
+ element will not be appended to the document body until all bindings have
+ finished synchronizing.
+
+ @returns {Ember.View} receiver
+ */
+ append: function() {
+ return this.appendTo(document.body);
+ },
+
+ /**
+ Removes the view's element from the element to which it is attached.
+
+ @returns {Ember.View} receiver
+ */
+ remove: function() {
+ // What we should really do here is wait until the end of the run loop
+ // to determine if the element has been re-appended to a different
+ // element.
+ // In the interim, we will just re-render if that happens. It is more
+ // important than elements get garbage collected.
+ this.destroyElement();
+ this.invokeRecursively(function(view) {
+ view.clearRenderedChildren();
+ });
+ },
+
+ /**
+ The ID to use when trying to locate the element in the DOM. If you do not
+ set the elementId explicitly, then the view's GUID will be used instead.
+ This ID must be set at the time the view is created.
+
+ @type String
+ @readOnly
+ */
+ elementId: Ember.computed(function(key, value) {
+ return value !== undefined ? value : Ember.guidFor(this);
+ }).cacheable(),
+
+ /**
+ @private
+
+ TODO: Perhaps this should be removed from the production build somehow.
+ */
+ _elementIdDidChange: Ember.beforeObserver(function() {
+ throw "Changing a view's elementId after creation is not allowed.";
+ }, 'elementId'),
+
+ /**
+ Attempts to discover the element in the parent element. The default
+ implementation looks for an element with an ID of elementId (or the view's
+ guid if elementId is null). You can override this method to provide your
+ own form of lookup. For example, if you want to discover your element
+ using a CSS class name instead of an ID.
+
+ @param {DOMElement} parentElement The parent's DOM element
+ @returns {DOMElement} The discovered element
+ */
+ findElementInParentElement: function(parentElem) {
+ var id = "#" + get(this, 'elementId');
+ return Ember.$(id)[0] || Ember.$(id, parentElem)[0];
+ },
+
+ /**
+ Creates a new renderBuffer with the passed tagName. You can override this
+ method to provide further customization to the buffer if needed. Normally
+ you will not need to call or override this method.
+
+ @returns {Ember.RenderBuffer}
+ */
+ renderBuffer: function(tagName) {
+ tagName = tagName || get(this, 'tagName');
+
+ // Explicitly check for null or undefined, as tagName
+ // may be an empty string, which would evaluate to false.
+ if (tagName === null || tagName === undefined) {
+ tagName = 'div';
+ }
+
+ return Ember.RenderBuffer(tagName);
+ },
+
+ /**
+ Creates a DOM representation of the view and all of its
+ child views by recursively calling the `render()` method.
+
+ After the element has been created, `didInsertElement` will
+ be called on this view and all of its child views.
+
+ @returns {Ember.View} receiver
+ */
+ createElement: function() {
+ if (get(this, 'element')) { return this; }
+
+ var buffer = this.renderToBuffer();
+ set(this, 'element', buffer.element());
+
+ return this;
+ },
+
+ /**
+ Called when a view is going to insert an element into the DOM.
+ */
+ willInsertElement: Ember.K,
+
+ /**
+ Called when the element of the view has been inserted into the DOM.
+ Override this function to do any set up that requires an element in the
+ document body.
+ */
+ didInsertElement: Ember.K,
+
+ /**
+ Called when the view is about to rerender, but before anything has
+ been torn down. This is a good opportunity to tear down any manual
+ observers you have installed based on the DOM state
+ */
+ willRerender: Ember.K,
+
+ /**
+ Run this callback on the current view and recursively on child views.
+
+ @private
+ */
+ invokeRecursively: function(fn) {
+ fn.call(this, this);
+
+ this.forEachChildView(function(view) {
+ view.invokeRecursively(fn);
+ });
+ },
+
+ /**
+ Invalidates the cache for a property on all child views.
+ */
+ invalidateRecursively: function(key) {
+ this.forEachChildView(function(view) {
+ view.propertyDidChange(key);
+ });
+ },
+
+ /**
+ @private
+
+ Invokes the receiver's willInsertElement() method if it exists and then
+ invokes the same on all child views.
+
+ NOTE: In some cases this was called when the element existed. This no longer
+ works so we let people know. We can remove this warning code later.
+ */
+ _notifyWillInsertElement: function() {
+ this.invokeRecursively(function(view) {
+ view.trigger('willInsertElement');
+ });
+ },
+
+ /**
+ @private
+
+ Invokes the receiver's didInsertElement() method if it exists and then
+ invokes the same on all child views.
+ */
+ _notifyDidInsertElement: function() {
+ this.invokeRecursively(function(view) {
+ view.trigger('didInsertElement');
+ });
+ },
+
+ /**
+ @private
+
+ Invokes the receiver's willRerender() method if it exists and then
+ invokes the same on all child views.
+ */
+ _notifyWillRerender: function() {
+ this.invokeRecursively(function(view) {
+ view.trigger('willRerender');
+ });
+ },
+
+ /**
+ Destroys any existing element along with the element for any child views
+ as well. If the view does not currently have a element, then this method
+ will do nothing.
+
+ If you implement willDestroyElement() on your view, then this method will
+ be invoked on your view before your element is destroyed to give you a
+ chance to clean up any event handlers, etc.
+
+ If you write a willDestroyElement() handler, you can assume that your
+ didInsertElement() handler was called earlier for the same element.
+
+ Normally you will not call or override this method yourself, but you may
+ want to implement the above callbacks when it is run.
+
+ @returns {Ember.View} receiver
+ */
+ destroyElement: function() {
+ return this.invokeForState('destroyElement');
+ },
+
+ /**
+ Called when the element of the view is going to be destroyed. Override
+ this function to do any teardown that requires an element, like removing
+ event listeners.
+ */
+ willDestroyElement: function() {},
+
+ /**
+ @private
+
+ Invokes the `willDestroyElement` callback on the view and child views.
+ */
+ _notifyWillDestroyElement: function() {
+ this.invokeRecursively(function(view) {
+ view.trigger('willDestroyElement');
+ });
+ },
+
+ /** @private (nodoc) */
+ _elementWillChange: Ember.beforeObserver(function() {
+ this.forEachChildView(function(view) {
+ Ember.propertyWillChange(view, 'element');
+ });
+ }, 'element'),
+
+ /**
+ @private
+
+ If this view's element changes, we need to invalidate the caches of our
+ child views so that we do not retain references to DOM elements that are
+ no longer needed.
+
+ @observes element
+ */
+ _elementDidChange: Ember.observer(function() {
+ this.forEachChildView(function(view) {
+ Ember.propertyDidChange(view, 'element');
+ });
+ }, 'element'),
+
+ /**
+ Called when the parentView property has changed.
+
+ @function
+ */
+ parentViewDidChange: Ember.K,
+
+ /**
+ @private
+
+ Invoked by the view system when this view needs to produce an HTML
+ representation. This method will create a new render buffer, if needed,
+ then apply any default attributes, such as class names and visibility.
+ Finally, the `render()` method is invoked, which is responsible for
+ doing the bulk of the rendering.
+
+ You should not need to override this method; instead, implement the
+ `template` property, or if you need more control, override the `render`
+ method.
+
+ @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is
+ passed, a default buffer, using the current view's `tagName`, will
+ be used.
+ */
+ renderToBuffer: function(parentBuffer, bufferOperation) {
+ var buffer;
+
+ Ember.run.sync();
+
+ // Determine where in the parent buffer to start the new buffer.
+ // By default, a new buffer will be appended to the parent buffer.
+ // The buffer operation may be changed if the child views array is
+ // mutated by Ember.ContainerView.
+ bufferOperation = bufferOperation || 'begin';
+
+ // If this is the top-most view, start a new buffer. Otherwise,
+ // create a new buffer relative to the original using the
+ // provided buffer operation (for example, `insertAfter` will
+ // insert a new buffer after the "parent buffer").
+ if (parentBuffer) {
+ var tagName = get(this, 'tagName');
+ if (tagName === null || tagName === undefined) {
+ tagName = 'div';
+ }
+
+ buffer = parentBuffer[bufferOperation](tagName);
+ } else {
+ buffer = this.renderBuffer();
+ }
+
+ this.buffer = buffer;
+ this.transitionTo('inBuffer', false);
+
+ this.lengthBeforeRender = this._childViews.length;
+
+ this.beforeRender(buffer);
+ this.render(buffer);
+ this.afterRender(buffer);
+
+ this.lengthAfterRender = this._childViews.length;
+
+ return buffer;
+ },
+
+ beforeRender: function(buffer) {
+ this.applyAttributesToBuffer(buffer);
+ },
+
+ afterRender: Ember.K,
+
+ /**
+ @private
+ */
+ applyAttributesToBuffer: function(buffer) {
+ // Creates observers for all registered class name and attribute bindings,
+ // then adds them to the element.
+ this._applyClassNameBindings();
+
+ // Pass the render buffer so the method can apply attributes directly.
+ // This isn't needed for class name bindings because they use the
+ // existing classNames infrastructure.
+ this._applyAttributeBindings(buffer);
+
+
+ a_forEach(get(this, 'classNames'), function(name){ buffer.addClass(name); });
+ buffer.id(get(this, 'elementId'));
+
+ var role = get(this, 'ariaRole');
+ if (role) {
+ buffer.attr('role', role);
+ }
+
+ if (get(this, 'isVisible') === false) {
+ buffer.style('display', 'none');
+ }
+ },
+
+ // ..........................................................
+ // STANDARD RENDER PROPERTIES
+ //
+
+ /**
+ Tag name for the view's outer element. The tag name is only used when
+ an element is first created. If you change the tagName for an element, you
+ must destroy and recreate the view element.
+
+ By default, the render buffer will use a `<div>` tag for views.
+
+ @type String
+ @default null
+ */
+
+ // We leave this null by default so we can tell the difference between
+ // the default case and a user-specified tag.
+ tagName: null,
+
+ /**
+ The WAI-ARIA role of the control represented by this view. For example, a
+ button may have a role of type 'button', or a pane may have a role of
+ type 'alertdialog'. This property is used by assistive software to help
+ visually challenged users navigate rich web applications.
+
+ The full list of valid WAI-ARIA roles is available at:
+ http://www.w3.org/TR/wai-aria/roles#roles_categorization
+
+ @type String
+ @default null
+ */
+ ariaRole: null,
+
+ /**
+ Standard CSS class names to apply to the view's outer element. This
+ property automatically inherits any class names defined by the view's
+ superclasses as well.
+
+ @type Array
+ @default ['ember-view']
+ */
+ classNames: ['ember-view'],
+
+ /**
+ A list of properties of the view to apply as class names. If the property
+ is a string value, the value of that string will be applied as a class
+ name.
+
+ // Applies the 'high' class to the view element
+ Ember.View.create({
+ classNameBindings: ['priority']
+ priority: 'high'
+ });
+
+ If the value of the property is a Boolean, the name of that property is
+ added as a dasherized class name.
+
+ // Applies the 'is-urgent' class to the view element
+ Ember.View.create({
+ classNameBindings: ['isUrgent']
+ isUrgent: true
+ });
+
+ If you would prefer to use a custom value instead of the dasherized
+ property name, you can pass a binding like this:
+
+ // Applies the 'urgent' class to the view element
+ Ember.View.create({
+ classNameBindings: ['isUrgent:urgent']
+ isUrgent: true
+ });
+
+ This list of properties is inherited from the view's superclasses as well.
+
+ @type Array
+ @default []
+ */
+ classNameBindings: [],
+
+ /**
+ A list of properties of the view to apply as attributes. If the property is
+ a string value, the value of that string will be applied as the attribute.
+
+ // Applies the type attribute to the element
+ // with the value "button", like <div type="button">
+ Ember.View.create({
+ attributeBindings: ['type'],
+ type: 'button'
+ });
+
+ If the value of the property is a Boolean, the name of that property is
+ added as an attribute.
+
+ // Renders something like <div enabled="enabled">
+ Ember.View.create({
+ attributeBindings: ['enabled'],
+ enabled: true
+ });
+ */
+ attributeBindings: [],
+
+ state: 'preRender',
+
+ // .......................................................
+ // CORE DISPLAY METHODS
+ //
+
+ /**
+ @private
+
+ Setup a view, but do not finish waking it up.
+ - configure childViews
+ - register the view with the global views hash, which is used for event
+ dispatch
+ */
+ init: function() {
+ this._super();
+
+ // Register the view for event handling. This hash is used by
+ // Ember.EventDispatcher to dispatch incoming events.
+ if (!this.isVirtual) Ember.View.views[get(this, 'elementId')] = this;
+
+ // setup child views. be sure to clone the child views array first
+ this._childViews = this._childViews.slice();
+
+ Ember.assert("Only arrays are allowed for 'classNameBindings'", Ember.typeOf(this.classNameBindings) === 'array');
+ this.classNameBindings = Ember.A(this.classNameBindings.slice());
+
+ Ember.assert("Only arrays are allowed for 'classNames'", Ember.typeOf(this.classNames) === 'array');
+ this.classNames = Ember.A(this.classNames.slice());
+
+ var viewController = get(this, 'viewController');
+ if (viewController) {
+ viewController = get(viewController);
+ if (viewController) {
+ set(viewController, 'view', this);
+ }
+ }
+ },
+
+ appendChild: function(view, options) {
+ return this.invokeForState('appendChild', view, options);
+ },
+
+ /**
+ Removes the child view from the parent view.
+
+ @param {Ember.View} view
+ @returns {Ember.View} receiver
+ */
+ removeChild: function(view) {
+ // If we're destroying, the entire subtree will be
+ // freed, and the DOM will be handled separately,
+ // so no need to mess with childViews.
+ if (this.isDestroying) { return; }
+
+ // update parent node
+ set(view, '_parentView', null);
+
+ // remove view from childViews array.
+ var childViews = this._childViews;
+
+ Ember.EnumerableUtils.removeObject(childViews, view);
+
+ this.propertyDidChange('childViews'); // HUH?! what happened to will change?
+
+ return this;
+ },
+
+ /**
+ Removes all children from the parentView.
+
+ @returns {Ember.View} receiver
+ */
+ removeAllChildren: function() {
+ return this.mutateChildViews(function(view) {
+ this.removeChild(view);
+ });
+ },
+
+ destroyAllChildren: function() {
+ return this.mutateChildViews(function(view) {
+ view.destroy();
+ });
+ },
+
+ /**
+ Removes the view from its parentView, if one is found. Otherwise
+ does nothing.
+
+ @returns {Ember.View} receiver
+ */
+ removeFromParent: function() {
+ var parent = get(this, '_parentView');
+
+ // Remove DOM element from parent
+ this.remove();
+
+ if (parent) { parent.removeChild(this); }
+ return this;
+ },
+
+ /**
+ You must call `destroy` on a view to destroy the view (and all of its
+ child views). This will remove the view from any parent node, then make
+ sure that the DOM element managed by the view can be released by the
+ memory manager.
+ */
+ willDestroy: function() {
+ // calling this._super() will nuke computed properties and observers,
+ // so collect any information we need before calling super.
+ var childViews = this._childViews,
+ parent = get(this, '_parentView'),
+ childLen;
+
+ // destroy the element -- this will avoid each child view destroying
+ // the element over and over again...
+ if (!this.removedFromDOM) { this.destroyElement(); }
+
+ // remove from non-virtual parent view if viewName was specified
+ if (this.viewName) {
+ var nonVirtualParentView = get(this, 'parentView');
+ if (nonVirtualParentView) {
+ set(nonVirtualParentView, this.viewName, null);
+ }
+ }
+
+ // remove from parent if found. Don't call removeFromParent,
+ // as removeFromParent will try to remove the element from
+ // the DOM again.
+ if (parent) { parent.removeChild(this); }
+
+ this.state = 'destroyed';
+
+ childLen = childViews.length;
+ for (var i=childLen-1; i>=0; i--) {
+ childViews[i].removedFromDOM = true;
+ childViews[i].destroy();
+ }
+
+ // next remove view from global hash
+ if (!this.isVirtual) delete Ember.View.views[get(this, 'elementId')];
+ },
+
+ /**
+ Instantiates a view to be added to the childViews array during view
+ initialization. You generally will not call this method directly unless
+ you are overriding createChildViews(). Note that this method will
+ automatically configure the correct settings on the new view instance to
+ act as a child of the parent.
+
+ @param {Class} viewClass
+ @param {Hash} [attrs] Attributes to add
+ @returns {Ember.View} new instance
+ @test in createChildViews
+ */
+ createChildView: function(view, attrs) {
+ if (Ember.View.detect(view)) {
+ attrs = attrs || {};
+ attrs._parentView = this;
+ attrs.templateData = attrs.templateData || get(this, 'templateData');
+
+ view = view.create(attrs);
+
+ // don't set the property on a virtual view, as they are invisible to
+ // consumers of the view API
+ if (view.viewName) { set(get(this, 'concreteView'), view.viewName, view); }
+ } else {
+ Ember.assert('You must pass instance or subclass of View', view instanceof Ember.View);
+ Ember.assert("You can only pass attributes when a class is provided", !attrs);
+
+ if (!get(view, 'templateData')) {
+ set(view, 'templateData', get(this, 'templateData'));
+ }
+
+ set(view, '_parentView', this);
+ }
+
+ return view;
+ },
+
+ becameVisible: Ember.K,
+ becameHidden: Ember.K,
+
+ /**
+ @private
+
+ When the view's `isVisible` property changes, toggle the visibility
+ element of the actual DOM element.
+ */
+ _isVisibleDidChange: Ember.observer(function() {
+ var $el = this.$();
+ if (!$el) { return; }
+
+ var isVisible = get(this, 'isVisible');
+
+ $el.toggle(isVisible);
+
+ if (this._isAncestorHidden()) { return; }
+
+ if (isVisible) {
+ this._notifyBecameVisible();
+ } else {
+ this._notifyBecameHidden();
+ }
+ }, 'isVisible'),
+
+ _notifyBecameVisible: function() {
+ this.trigger('becameVisible');
+
+ this.forEachChildView(function(view) {
+ var isVisible = get(view, 'isVisible');
+
+ if (isVisible || isVisible === null) {
+ view._notifyBecameVisible();
+ }
+ });
+ },
+
+ _notifyBecameHidden: function() {
+ this.trigger('becameHidden');
+ this.forEachChildView(function(view) {
+ var isVisible = get(view, 'isVisible');
+
+ if (isVisible || isVisible === null) {
+ view._notifyBecameHidden();
+ }
+ });
+ },
+
+ _isAncestorHidden: function() {
+ var parent = get(this, 'parentView');
+
+ while (parent) {
+ if (get(parent, 'isVisible') === false) { return true; }
+
+ parent = get(parent, 'parentView');
+ }
+
+ return false;
+ },
+
+ clearBuffer: function() {
+ this.invokeRecursively(function(view) {
+ this.buffer = null;
+ });
+ },
+
+ transitionTo: function(state, children) {
+ this.state = state;
+
+ if (children !== false) {
+ this.forEachChildView(function(view) {
+ view.transitionTo(state);
+ });
+ }
+ },
+
+ /**
+ @private
+
+ Override the default event firing from Ember.Evented to
+ also call methods with the given name.
+ */
+ trigger: function(name) {
+ this._super.apply(this, arguments);
+ var method = this[name];
+ if (method) {
+ var args = [], i, l;
+ for (i = 1, l = arguments.length; i < l; i++) {
+ args.push(arguments[i]);
+ }
+ return method.apply(this, args);
+ }
+ },
+
+ has: function(name) {
+ return Ember.typeOf(this[name]) === 'function' || this._super(name);
+ },
+
+ // .......................................................
+ // EVENT HANDLING
+ //
+
+ /**
+ @private
+
+ Handle events from `Ember.EventDispatcher`
+ */
+ handleEvent: function(eventName, evt) {
+ return this.invokeForState('handleEvent', eventName, evt);
+ }
+
+});
+
+/**
+ Describe how the specified actions should behave in the various
+ states that a view can exist in. Possible states:
+
+ * preRender: when a view is first instantiated, and after its
+ element was destroyed, it is in the preRender state
+ * inBuffer: once a view has been rendered, but before it has
+ been inserted into the DOM, it is in the inBuffer state
+ * inDOM: once a view has been inserted into the DOM it is in
+ the inDOM state. A view spends the vast majority of its
+ existence in this state.
+ * destroyed: once a view has been destroyed (using the destroy
+ method), it is in this state. No further actions can be invoked
+ on a destroyed view.
+*/
+
+ // in the destroyed state, everything is illegal
+
+ // before rendering has begun, all legal manipulations are noops.
+
+ // inside the buffer, legal manipulations are done on the buffer
+
+ // once the view has been inserted into the DOM, legal manipulations
+ // are done on the DOM element.
+
+/** @private */
+var DOMManager = {
+ prepend: function(view, childView) {
+ childView._insertElementLater(function() {
+ var element = view.$();
+ element.prepend(childView.$());
+ });
+ },
+
+ after: function(view, nextView) {
+ nextView._insertElementLater(function() {
+ var element = view.$();
+ element.after(nextView.$());
+ });
+ },
+
+ replace: function(view) {
+ var element = get(view, 'element');
+
+ set(view, 'element', null);
+
+ view._insertElementLater(function() {
+ Ember.$(element).replaceWith(get(view, 'element'));
+ });
+ },
+
+ remove: function(view) {
+ var elem = get(view, 'element');
+
+ set(view, 'element', null);
+ view._lastInsert = null;
+
+ Ember.$(elem).remove();
+ },
+
+ empty: function(view) {
+ view.$().empty();
+ }
+};
+
+Ember.View.reopen({
+ states: Ember.View.states,
+ domManager: DOMManager
+});
+
+Ember.View.reopenClass({
+
+ /**
+ @private
+
+ Parse a path and return an object which holds the parsed properties.
+
+ For example a path like "content.isEnabled:enabled:disabled" wil return the
+ following object:
+
+ {
+ path: "content.isEnabled",
+ className: "enabled",
+ falsyClassName: "disabled",
+ classNames: ":enabled:disabled"
+ }
+
+ */
+ _parsePropertyPath: function(path) {
+ var split = path.split(/:/),
+ propertyPath = split[0],
+ classNames = "",
+ className,
+ falsyClassName;
+
+ // check if the property is defined as prop:class or prop:trueClass:falseClass
+ if (split.length > 1) {
+ className = split[1];
+ if (split.length === 3) { falsyClassName = split[2]; }
+
+ classNames = ':' + className;
+ if (falsyClassName) { classNames += ":" + falsyClassName; }
+ }
+
+ return {
+ path: propertyPath,
+ classNames: classNames,
+ className: (className === '') ? undefined : className,
+ falsyClassName: falsyClassName
+ };
+ },
+
+ /**
+ @private
+
+ Get the class name for a given value, based on the path, optional className
+ and optional falsyClassName.
+
+ - if the value is truthy and a className is defined, the className is returned
+ - if the value is true, the dasherized last part of the supplied path is returned
+ - if the value is false and a falsyClassName is supplied, the falsyClassName is returned
+ - if the value is truthy, the value is returned
+ - if none of the above rules apply, null is returned
+
+ */
+ _classStringForValue: function(path, val, className, falsyClassName) {
+ // If the value is truthy and we're using the colon syntax,
+ // we should return the className directly
+ if (!!val && className) {
+ return className;
+
+ // If value is a Boolean and true, return the dasherized property
+ // name.
+ } else if (val === true) {
+ // catch syntax like isEnabled::not-enabled
+ if (val === true && !className && falsyClassName) { return null; }
+
+ // Normalize property path to be suitable for use
+ // as a class name. For exaple, content.foo.barBaz
+ // becomes bar-baz.
+ var parts = path.split('.');
+ return Ember.String.dasherize(parts[parts.length-1]);
+
+ // If the value is false and a falsyClassName is specified, return it
+ } else if (val === false && falsyClassName) {
+ return falsyClassName;
+
+ // If the value is not false, undefined, or null, return the current
+ // value of the property.
+ } else if (val !== false && val !== undefined && val !== null) {
+ return val;
+
+ // Nothing to display. Return null so that the old class is removed
+ // but no new class is added.
+ } else {
+ return null;
+ }
+ }
+});
+
+// Create a global view hash.
+Ember.View.views = {};
+
+// If someone overrides the child views computed property when
+// defining their class, we want to be able to process the user's
+// supplied childViews and then restore the original computed property
+// at view initialization time. This happens in Ember.ContainerView's init
+// method.
+Ember.View.childViewsProperty = childViewsProperty;
+
+Ember.View.applyAttributeBindings = function(elem, name, value) {
+ var type = Ember.typeOf(value);
+ var currentValue = elem.attr(name);
+
+ // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js
+ if ((type === 'string' || (type === 'number' && !isNaN(value))) && value !== currentValue) {
+ elem.attr(name, value);
+ } else if (value && type === 'boolean') {
+ elem.attr(name, name);
+ } else if (!value) {
+ elem.removeAttr(name);
+ }
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+Ember.View.states = {
+ _default: {
+ // appendChild is only legal while rendering the buffer.
+ appendChild: function() {
+ throw "You can't use appendChild outside of the rendering process";
+ },
+
+ $: function() {
+ return undefined;
+ },
+
+ getElement: function() {
+ return null;
+ },
+
+ // Handle events from `Ember.EventDispatcher`
+ handleEvent: function() {
+ return true; // continue event propagation
+ },
+
+ destroyElement: function(view) {
+ set(view, 'element', null);
+ view._lastInsert = null;
+ return view;
+ }
+ }
+};
+
+Ember.View.reopen({
+ states: Ember.View.states
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+Ember.View.states.preRender = {
+ parentState: Ember.View.states._default,
+
+ // a view leaves the preRender state once its element has been
+ // created (createElement).
+ insertElement: function(view, fn) {
+ if (view._lastInsert !== Ember.guidFor(fn)){
+ return;
+ }
+ view.createElement();
+ view._notifyWillInsertElement();
+ // after createElement, the view will be in the hasElement state.
+ fn.call(view);
+ view.transitionTo('inDOM');
+ view._notifyDidInsertElement();
+ },
+
+ empty: Ember.K,
+
+ setElement: function(view, value) {
+ if (value !== null) {
+ view.transitionTo('hasElement');
+ }
+ return value;
+ }
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, meta = Ember.meta;
+
+Ember.View.states.inBuffer = {
+ parentState: Ember.View.states._default,
+
+ $: function(view, sel) {
+ // if we don't have an element yet, someone calling this.$() is
+ // trying to update an element that isn't in the DOM. Instead,
+ // rerender the view to allow the render method to reflect the
+ // changes.
+ view.rerender();
+ return Ember.$();
+ },
+
+ // when a view is rendered in a buffer, rerendering it simply
+ // replaces the existing buffer with a new one
+ rerender: function(view) {
+ Ember.deprecate("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM. Because this is avoidable and the cause of significant performance issues in applications, this behavior is deprecated. If you want to use the debugger to find out what caused this, you can set ENV.RAISE_ON_DEPRECATION to true.");
+
+ view._notifyWillRerender();
+
+ view.clearRenderedChildren();
+ view.renderToBuffer(view.buffer, 'replaceWith');
+ },
+
+ // when a view is rendered in a buffer, appending a child
+ // view will render that view and append the resulting
+ // buffer into its buffer.
+ appendChild: function(view, childView, options) {
+ var buffer = view.buffer;
+
+ childView = this.createChildView(childView, options);
+ view._childViews.push(childView);
+
+ childView.renderToBuffer(buffer);
+
+ view.propertyDidChange('childViews');
+
+ return childView;
+ },
+
+ // when a view is rendered in a buffer, destroying the
+ // element will simply destroy the buffer and put the
+ // state back into the preRender state.
+ destroyElement: function(view) {
+ view.clearBuffer();
+ view._notifyWillDestroyElement();
+ view.transitionTo('preRender');
+
+ return view;
+ },
+
+ empty: function() {
+ Ember.assert("Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.");
+ },
+
+ // It should be impossible for a rendered view to be scheduled for
+ // insertion.
+ insertElement: function() {
+ throw "You can't insert an element that has already been rendered";
+ },
+
+ setElement: function(view, value) {
+ if (value === null) {
+ view.transitionTo('preRender');
+ } else {
+ view.clearBuffer();
+ view.transitionTo('hasElement');
+ }
+
+ return value;
+ }
+};
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, meta = Ember.meta;
+
+Ember.View.states.hasElement = {
+ parentState: Ember.View.states._default,
+
+ $: function(view, sel) {
+ var elem = get(view, 'element');
+ return sel ? Ember.$(sel, elem) : Ember.$(elem);
+ },
+
+ getElement: function(view) {
+ var parent = get(view, 'parentView');
+ if (parent) { parent = get(parent, 'element'); }
+ if (parent) { return view.findElementInParentElement(parent); }
+ return Ember.$("#" + get(view, 'elementId'))[0];
+ },
+
+ setElement: function(view, value) {
+ if (value === null) {
+ view.transitionTo('preRender');
+ } else {
+ throw "You cannot set an element to a non-null value when the element is already in the DOM.";
+ }
+
+ return value;
+ },
+
+ // once the view has been inserted into the DOM, rerendering is
+ // deferred to allow bindings to synchronize.
+ rerender: function(view) {
+ view._notifyWillRerender();
+
+ view.clearRenderedChildren();
+
+ view.domManager.replace(view);
+ return view;
+ },
+
+ // once the view is already in the DOM, destroying it removes it
+ // from the DOM, nukes its element, and puts it back into the
+ // preRender state if inDOM.
+
+ destroyElement: function(view) {
+ view._notifyWillDestroyElement();
+ view.domManager.remove(view);
+ return view;
+ },
+
+ empty: function(view) {
+ var _childViews = view._childViews, len, idx;
+ if (_childViews) {
+ len = _childViews.length;
+ for (idx = 0; idx < len; idx++) {
+ _childViews[idx]._notifyWillDestroyElement();
+ }
+ }
+ view.domManager.empty(view);
+ },
+
+ // Handle events from `Ember.EventDispatcher`
+ handleEvent: function(view, eventName, evt) {
+ if (view.has(eventName)) {
+ // Handler should be able to re-dispatch events, so we don't
+ // preventDefault or stopPropagation.
+ return view.trigger(eventName, evt);
+ } else {
+ return true; // continue event propagation
+ }
+ }
+};
+
+Ember.View.states.inDOM = {
+ parentState: Ember.View.states.hasElement,
+
+ insertElement: function(view, fn) {
+ if (view._lastInsert !== Ember.guidFor(fn)){
+ return;
+ }
+ throw "You can't insert an element into the DOM that has already been inserted";
+ }
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var destroyedError = "You can't call %@ on a destroyed view", fmt = Ember.String.fmt;
+
+Ember.View.states.destroyed = {
+ parentState: Ember.View.states._default,
+
+ appendChild: function() {
+ throw fmt(destroyedError, ['appendChild']);
+ },
+ rerender: function() {
+ throw fmt(destroyedError, ['rerender']);
+ },
+ destroyElement: function() {
+ throw fmt(destroyedError, ['destroyElement']);
+ },
+ empty: function() {
+ throw fmt(destroyedError, ['empty']);
+ },
+
+ setElement: function() {
+ throw fmt(destroyedError, ["set('element', ...)"]);
+ },
+
+ // Since element insertion is scheduled, don't do anything if
+ // the view has been destroyed between scheduling and execution
+ insertElement: Ember.K
+};
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, meta = Ember.meta;
+var forEach = Ember.EnumerableUtils.forEach;
+
+var childViewsProperty = Ember.computed(function() {
+ return get(this, '_childViews');
+}).property('_childViews').cacheable();
+
+/**
+ @class
+
+ A `ContainerView` is an `Ember.View` subclass that allows for manual or programatic
+ management of a view's `childViews` array that will correctly update the `ContainerView`
+ instance's rendered DOM representation.
+
+ ## Setting Initial Child Views
+ The initial array of child views can be set in one of two ways. You can provide
+ a `childViews` property at creation time that contains instance of `Ember.View`:
+
+
+ aContainer = Ember.ContainerView.create({
+ childViews: [Ember.View.create(), Ember.View.create()]
+ })
+
+ You can also provide a list of property names whose values are instances of `Ember.View`:
+
+ aContainer = Ember.ContainerView.create({
+ childViews: ['aView', 'bView', 'cView'],
+ aView: Ember.View.create(),
+ bView: Ember.View.create()
+ cView: Ember.View.create()
+ })
+
+ The two strategies can be combined:
+
+ aContainer = Ember.ContainerView.create({
+ childViews: ['aView', Ember.View.create()],
+ aView: Ember.View.create()
+ })
+
+ Each child view's rendering will be inserted into the container's rendered HTML in the same
+ order as its position in the `childViews` property.
+
+ ## Adding and Removing Child Views
+ The views in a container's `childViews` array should be added and removed by manipulating
+ the `childViews` property directly.
+
+ To remove a view pass that view into a `removeObject` call on the container's `childViews` property.
+
+ Given an empty `<body>` the following code
+
+ aContainer = Ember.ContainerView.create({
+ classNames: ['the-container'],
+ childViews: ['aView', 'bView'],
+ aView: Ember.View.create({
+ template: Ember.Handlebars.compile("A")
+ }),
+ bView: Ember.View.create({
+ template: Ember.Handlebars.compile("B")
+ })
+ })
+
+ aContainer.appendTo('body')
+
+ Results in the HTML
+
+ <div class="ember-view the-container">
+ <div class="ember-view">A</div>
+ <div class="ember-view">B</div>
+ </div>
+
+ Removing a view
+
+ aContainer.get('childViews') // [aContainer.aView, aContainer.bView]
+ aContainer.get('childViews').removeObject(aContainer.get('bView'))
+ aContainer.get('childViews') // [aContainer.aView]
+
+ Will result in the following HTML
+
+ <div class="ember-view the-container">
+ <div class="ember-view">A</div>
+ </div>
+
+
+ Similarly, adding a child view is accomplished by adding `Ember.View` instances to the
+ container's `childViews` property.
+
+ Given an empty `<body>` the following code
+
+ aContainer = Ember.ContainerView.create({
+ classNames: ['the-container'],
+ childViews: ['aView', 'bView'],
+ aView: Ember.View.create({
+ template: Ember.Handlebars.compile("A")
+ }),
+ bView: Ember.View.create({
+ template: Ember.Handlebars.compile("B")
+ })
+ })
+
+ aContainer.appendTo('body')
+
+ Results in the HTML
+
+ <div class="ember-view the-container">
+ <div class="ember-view">A</div>
+ <div class="ember-view">B</div>
+ </div>
+
+ Adding a view
+
+ AnotherViewClass = Ember.View.extend({
+ template: Ember.Handlebars.compile("Another view")
+ })
+
+ aContainer.get('childViews') // [aContainer.aView, aContainer.bView]
+ aContainer.get('childViews').pushObject(AnotherViewClass.create())
+ aContainer.get('childViews') // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]
+
+ Will result in the following HTML
+
+ <div class="ember-view the-container">
+ <div class="ember-view">A</div>
+ <div class="ember-view">B</div>
+ <div class="ember-view">Another view</div>
+ </div>
+
+
+ Direct manipulation of childViews presence or absence in the DOM via calls to
+ `remove` or `removeFromParent` or calls to a container's `removeChild` may not behave
+ correctly.
+
+ Calling `remove()` on a child view will remove the view's HTML, but it will remain as part of its
+ container's `childView`s property.
+
+ Calling `removeChild()` on the container will remove the passed view instance from the container's
+ `childView`s but keep its HTML within the container's rendered view.
+
+ Calling `removeFromParent()` behaves as expected but should be avoided in favor of direct
+ manipulation of a container's `childViews` property.
+
+ aContainer = Ember.ContainerView.create({
+ classNames: ['the-container'],
+ childViews: ['aView', 'bView'],
+ aView: Ember.View.create({
+ template: Ember.Handlebars.compile("A")
+ }),
+ bView: Ember.View.create({
+ template: Ember.Handlebars.compile("B")
+ })
+ })
+
+ aContainer.appendTo('body')
+
+ Results in the HTML
+
+ <div class="ember-view the-container">
+ <div class="ember-view">A</div>
+ <div class="ember-view">B</div>
+ </div>
+
+ Calling `aContainer.get('aView').removeFromParent()` will result in the following HTML
+
+ <div class="ember-view the-container">
+ <div class="ember-view">B</div>
+ </div>
+
+ And the `Ember.View` instance stored in `aContainer.aView` will be removed from `aContainer`'s
+ `childViews` array.
+
+ ## Templates and Layout
+ A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or `defaultLayout`
+ property on a container view will not result in the template or layout being rendered.
+ The HTML contents of a `Ember.ContainerView`'s DOM representation will only be the rendered HTML
+ of its child views.
+
+ ## Binding a View to Display
+
+ If you would like to display a single view in your ContainerView, you can set its `currentView`
+ property. When the `currentView` property is set to a view instance, it will be added to the
+ ContainerView's `childViews` array. If the `currentView` property is later changed to a
+ different view, the new view will replace the old view. If `currentView` is set to `null`, the
+ last `currentView` will be removed.
+
+ This functionality is useful for cases where you want to bind the display of a ContainerView to
+ a controller or state manager. For example, you can bind the `currentView` of a container to
+ a controller like this:
+
+ // Controller
+ App.appController = Ember.Object.create({
+ view: Ember.View.create({
+ templateName: 'person_template'
+ })
+ });
+
+ // Handlebars template
+ {{view Ember.ContainerView currentViewBinding="App.appController.view"}}
+
+ @extends Ember.View
+*/
+
+Ember.ContainerView = Ember.View.extend({
+
+ init: function() {
+ this._super();
+
+ var childViews = get(this, 'childViews');
+ Ember.defineProperty(this, 'childViews', childViewsProperty);
+
+ var _childViews = this._childViews;
+
+ forEach(childViews, function(viewName, idx) {
+ var view;
+
+ if ('string' === typeof viewName) {
+ view = get(this, viewName);
+ view = this.createChildView(view);
+ set(this, viewName, view);
+ } else {
+ view = this.createChildView(viewName);
+ }
+
+ _childViews[idx] = view;
+ }, this);
+
+ var currentView = get(this, 'currentView');
+ if (currentView) _childViews.push(this.createChildView(currentView));
+
+ // Make the _childViews array observable
+ Ember.A(_childViews);
+
+ // Sets up an array observer on the child views array. This
+ // observer will detect when child views are added or removed
+ // and update the DOM to reflect the mutation.
+ get(this, 'childViews').addArrayObserver(this, {
+ willChange: 'childViewsWillChange',
+ didChange: 'childViewsDidChange'
+ });
+ },
+
+ /**
+ Instructs each child view to render to the passed render buffer.
+
+ @param {Ember.RenderBuffer} buffer the buffer to render to
+ @private
+ */
+ render: function(buffer) {
+ this.forEachChildView(function(view) {
+ view.renderToBuffer(buffer);
+ });
+ },
+
+ /**
+ When the container view is destroyed, tear down the child views
+ array observer.
+
+ @private
+ */
+ willDestroy: function() {
+ get(this, 'childViews').removeArrayObserver(this, {
+ willChange: 'childViewsWillChange',
+ didChange: 'childViewsDidChange'
+ });
+
+ this._super();
+ },
+
+ /**
+ When a child view is removed, destroy its element so that
+ it is removed from the DOM.
+
+ The array observer that triggers this action is set up in the
+ `renderToBuffer` method.
+
+ @private
+ @param {Ember.Array} views the child views array before mutation
+ @param {Number} start the start position of the mutation
+ @param {Number} removed the number of child views removed
+ **/
+ childViewsWillChange: function(views, start, removed) {
+ if (removed === 0) { return; }
+
+ var changedViews = views.slice(start, start+removed);
+ this.initializeViews(changedViews, null, null);
+
+ this.invokeForState('childViewsWillChange', views, start, removed);
+ },
+
+ /**
+ When a child view is added, make sure the DOM gets updated appropriately.
+
+ If the view has already rendered an element, we tell the child view to
+ create an element and insert it into the DOM. If the enclosing container view
+ has already written to a buffer, but not yet converted that buffer into an
+ element, we insert the string representation of the child into the appropriate
+ place in the buffer.
+
+ @private
+ @param {Ember.Array} views the array of child views afte the mutation has occurred
+ @param {Number} start the start position of the mutation
+ @param {Number} removed the number of child views removed
+ @param {Number} the number of child views added
+ */
+ childViewsDidChange: function(views, start, removed, added) {
+ var len = get(views, 'length');
+
+ // No new child views were added; bail out.
+ if (added === 0) return;
+
+ var changedViews = views.slice(start, start+added);
+ this.initializeViews(changedViews, this, get(this, 'templateData'));
+
+ // Let the current state handle the changes
+ this.invokeForState('childViewsDidChange', views, start, added);
+ },
+
+ initializeViews: function(views, parentView, templateData) {
+ forEach(views, function(view) {
+ set(view, '_parentView', parentView);
+
+ if (!get(view, 'templateData')) {
+ set(view, 'templateData', templateData);
+ }
+ });
+ },
+
+ /**
+ Schedules a child view to be inserted into the DOM after bindings have
+ finished syncing for this run loop.
+
+ @param {Ember.View} view the child view to insert
+ @param {Ember.View} prev the child view after which the specified view should
+ be inserted
+ @private
+ */
+ _scheduleInsertion: function(view, prev) {
+ if (prev) {
+ prev.domManager.after(prev, view);
+ } else {
+ this.domManager.prepend(this, view);
+ }
+ },
+
+ currentView: null,
+
+ _currentViewWillChange: Ember.beforeObserver(function() {
+ var childViews = get(this, 'childViews'),
+ currentView = get(this, 'currentView');
+
+ if (currentView) {
+ childViews.removeObject(currentView);
+ currentView.destroy();
+ }
+ }, 'currentView'),
+
+ _currentViewDidChange: Ember.observer(function() {
+ var childViews = get(this, 'childViews'),
+ currentView = get(this, 'currentView');
+
+ if (currentView) {
+ childViews.pushObject(currentView);
+ }
+ }, 'currentView')
+});
+
+// Ember.ContainerView extends the default view states to provide different
+// behavior for childViewsWillChange and childViewsDidChange.
+Ember.ContainerView.states = {
+ parent: Ember.View.states,
+
+ inBuffer: {
+ childViewsDidChange: function(parentView, views, start, added) {
+ var buffer = parentView.buffer,
+ startWith, prev, prevBuffer, view;
+
+ // Determine where to begin inserting the child view(s) in the
+ // render buffer.
+ if (start === 0) {
+ // If views were inserted at the beginning, prepend the first
+ // view to the render buffer, then begin inserting any
+ // additional views at the beginning.
+ view = views[start];
+ startWith = start + 1;
+ view.renderToBuffer(buffer, 'prepend');
+ } else {
+ // Otherwise, just insert them at the same place as the child
+ // views mutation.
+ view = views[start - 1];
+ startWith = start;
+ }
+
+ for (var i=startWith; i<start+added; i++) {
+ prev = view;
+ view = views[i];
+ prevBuffer = prev.buffer;
+ view.renderToBuffer(prevBuffer, 'insertAfter');
+ }
+ }
+ },
+
+ hasElement: {
+ childViewsWillChange: function(view, views, start, removed) {
+ for (var i=start; i<start+removed; i++) {
+ views[i].remove();
+ }
+ },
+
+ childViewsDidChange: function(view, views, start, added) {
+ // If the DOM element for this container view already exists,
+ // schedule each child view to insert its DOM representation after
+ // bindings have finished syncing.
+ var prev = start === 0 ? null : views[start-1];
+
+ for (var i=start; i<start+added; i++) {
+ view = views[i];
+ this._scheduleInsertion(view, prev);
+ prev = view;
+ }
+ }
+ }
+};
+
+Ember.ContainerView.states.inDOM = {
+ parentState: Ember.ContainerView.states.hasElement
+};
+
+Ember.ContainerView.reopen({
+ states: Ember.ContainerView.states
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
+
+/**
+ @class
+
+ `Ember.CollectionView` is an `Ember.View` descendent responsible for managing a
+ collection (an array or array-like object) by maintaing a child view object and
+ associated DOM representation for each item in the array and ensuring that child
+ views and their associated rendered HTML are updated when items in the array
+ are added, removed, or replaced.
+
+ ## Setting content
+ The managed collection of objects is referenced as the `Ember.CollectionView` instance's
+ `content` property.
+
+ someItemsView = Ember.CollectionView.create({
+ content: ['A', 'B','C']
+ })
+
+ The view for each item in the collection will have its `content` property set
+ to the item.
+
+ ## Specifying itemViewClass
+ By default the view class for each item in the managed collection will be an instance
+ of `Ember.View`. You can supply a different class by setting the `CollectionView`'s
+ `itemViewClass` property.
+
+ Given an empty `<body>` and the following code:
+
+
+ someItemsView = Ember.CollectionView.create({
+ classNames: ['a-collection'],
+ content: ['A','B','C'],
+ itemViewClass: Ember.View.extend({
+ template: Ember.Handlebars.compile("the letter: {{view.content}}")
+ })
+ })
+
+ someItemsView.appendTo('body')
+
+ Will result in the following HTML structure
+
+ <div class="ember-view a-collection">
+ <div class="ember-view">the letter: A</div>
+ <div class="ember-view">the letter: B</div>
+ <div class="ember-view">the letter: C</div>
+ </div>
+
+ ## Automatic matching of parent/child tagNames
+
+ Setting the `tagName` property of a `CollectionView` to any of
+ "ul", "ol", "table", "thead", "tbody", "tfoot", "tr", or "select" will result
+ in the item views receiving an appropriately matched `tagName` property.
+
+
+ Given an empty `<body>` and the following code:
+
+ anUndorderedListView = Ember.CollectionView.create({
+ tagName: 'ul',
+ content: ['A','B','C'],
+ itemViewClass: Ember.View.extend({
+ template: Ember.Handlebars.compile("the letter: {{view.content}}")
+ })
+ })
+
+ anUndorderedListView.appendTo('body')
+
+ Will result in the following HTML structure
+
+ <ul class="ember-view a-collection">
+ <li class="ember-view">the letter: A</li>
+ <li class="ember-view">the letter: B</li>
+ <li class="ember-view">the letter: C</li>
+ </ul>
+
+ Additional tagName pairs can be provided by adding to `Ember.CollectionView.CONTAINER_MAP `
+
+ Ember.CollectionView.CONTAINER_MAP['article'] = 'section'
+
+
+ ## Empty View
+ You can provide an `Ember.View` subclass to the `Ember.CollectionView` instance as its
+ `emptyView` property. If the `content` property of a `CollectionView` is set to `null`
+ or an empty array, an instance of this view will be the `CollectionView`s only child.
+
+ aListWithNothing = Ember.CollectionView.create({
+ classNames: ['nothing']
+ content: null,
+ emptyView: Ember.View.extend({
+ template: Ember.Handlebars.compile("The collection is empty")
+ })
+ })
+
+ aListWithNothing.appendTo('body')
+
+ Will result in the following HTML structure
+
+ <div class="ember-view nothing">
+ <div class="ember-view">
+ The collection is empty
+ </div>
+ </div>
+
+ ## Adding and Removing items
+ The `childViews` property of a `CollectionView` should not be directly manipulated. Instead,
+ add, remove, replace items from its `content` property. This will trigger
+ appropriate changes to its rendered HTML.
+
+ ## Use in templates via the `{{collection}}` Ember.Handlebars helper
+ Ember.Handlebars provides a helper specifically for adding `CollectionView`s to templates.
+ See `Ember.Handlebars.collection` for more details
+
+ @since Ember 0.9
+ @extends Ember.ContainerView
+*/
+Ember.CollectionView = Ember.ContainerView.extend(
+/** @scope Ember.CollectionView.prototype */ {
+
+ /**
+ A list of items to be displayed by the Ember.CollectionView.
+
+ @type Ember.Array
+ @default null
+ */
+ content: null,
+
+ /**
+ @private
+
+ This provides metadata about what kind of empty view class this
+ collection would like if it is being instantiated from another
+ system (like Handlebars)
+ */
+ emptyViewClass: Ember.View,
+
+ /**
+ An optional view to display if content is set to an empty array.
+
+ @type Ember.View
+ @default null
+ */
+ emptyView: null,
+
+ /**
+ @type Ember.View
+ @default Ember.View
+ */
+ itemViewClass: Ember.View,
+
+ /** @private */
+ init: function() {
+ var ret = this._super();
+ this._contentDidChange();
+ return ret;
+ },
+
+ _contentWillChange: Ember.beforeObserver(function() {
+ var content = this.get('content');
+
+ if (content) { content.removeArrayObserver(this); }
+ var len = content ? get(content, 'length') : 0;
+ this.arrayWillChange(content, 0, len);
+ }, 'content'),
+
+ /**
+ @private
+
+ Check to make sure that the content has changed, and if so,
+ update the children directly. This is always scheduled
+ asynchronously, to allow the element to be created before
+ bindings have synchronized and vice versa.
+ */
+ _contentDidChange: Ember.observer(function() {
+ var content = get(this, 'content');
+
+ if (content) {
+ Ember.assert(fmt("an Ember.CollectionView's content must implement Ember.Array. You passed %@", [content]), Ember.Array.detect(content));
+ content.addArrayObserver(this);
+ }
+
+ var len = content ? get(content, 'length') : 0;
+ this.arrayDidChange(content, 0, null, len);
+ }, 'content'),
+
+ willDestroy: function() {
+ var content = get(this, 'content');
+ if (content) { content.removeArrayObserver(this); }
+
+ this._super();
+ },
+
+ arrayWillChange: function(content, start, removedCount) {
+ // If the contents were empty before and this template collection has an
+ // empty view remove it now.
+ var emptyView = get(this, 'emptyView');
+ if (emptyView && emptyView instanceof Ember.View) {
+ emptyView.removeFromParent();
+ }
+
+ // Loop through child views that correspond with the removed items.
+ // Note that we loop from the end of the array to the beginning because
+ // we are mutating it as we go.
+ var childViews = get(this, 'childViews'), childView, idx, len;
+
+ len = get(childViews, 'length');
+
+ var removingAll = removedCount === len;
+
+ if (removingAll) {
+ this.invokeForState('empty');
+ }
+
+ for (idx = start + removedCount - 1; idx >= start; idx--) {
+ childView = childViews[idx];
+ if (removingAll) { childView.removedFromDOM = true; }
+ childView.destroy();
+ }
+ },
+
+ /**
+ Called when a mutation to the underlying content array occurs.
+
+ This method will replay that mutation against the views that compose the
+ Ember.CollectionView, ensuring that the view reflects the model.
+
+ This array observer is added in contentDidChange.
+
+ @param {Array} addedObjects
+ the objects that were added to the content
+
+ @param {Array} removedObjects
+ the objects that were removed from the content
+
+ @param {Number} changeIndex
+ the index at which the changes occurred
+ */
+ arrayDidChange: function(content, start, removed, added) {
+ var itemViewClass = get(this, 'itemViewClass'),
+ childViews = get(this, 'childViews'),
+ addedViews = [], view, item, idx, len, itemTagName;
+
+ if ('string' === typeof itemViewClass) {
+ itemViewClass = get(itemViewClass);
+ }
+
+ Ember.assert(fmt("itemViewClass must be a subclass of Ember.View, not %@", [itemViewClass]), Ember.View.detect(itemViewClass));
+
+ len = content ? get(content, 'length') : 0;
+ if (len) {
+ for (idx = start; idx < start+added; idx++) {
+ item = content.objectAt(idx);
+
+ view = this.createChildView(itemViewClass, {
+ content: item,
+ contentIndex: idx
+ });
+
+ addedViews.push(view);
+ }
+ } else {
+ var emptyView = get(this, 'emptyView');
+ if (!emptyView) { return; }
+
+ emptyView = this.createChildView(emptyView);
+ addedViews.push(emptyView);
+ set(this, 'emptyView', emptyView);
+ }
+ childViews.replace(start, 0, addedViews);
+ },
+
+ createChildView: function(view, attrs) {
+ view = this._super(view, attrs);
+
+ var itemTagName = get(view, 'tagName');
+ var tagName = (itemTagName === null || itemTagName === undefined) ? Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')] : itemTagName;
+
+ set(view, 'tagName', tagName);
+
+ return view;
+ }
+});
+
+/**
+ @static
+
+ A map of parent tags to their default child tags. You can add
+ additional parent tags if you want collection views that use
+ a particular parent tag to default to a child tag.
+
+ @type Hash
+ @constant
+*/
+Ember.CollectionView.CONTAINER_MAP = {
+ ul: 'li',
+ ol: 'li',
+ table: 'tr',
+ thead: 'tr',
+ tbody: 'tr',
+ tfoot: 'tr',
+ tr: 'td',
+ select: 'option'
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2006-2011 Strobe Inc. and contributors.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+/*globals jQuery*/
+
+})();
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ @extends Ember.Object
+*/
+Ember.State = Ember.Object.extend(Ember.Evented,
+/** @scope Ember.State.prototype */{
+ isState: true,
+
+ /**
+ A reference to the parent state.
+
+ @type Ember.State
+ */
+ parentState: null,
+ start: null,
+
+ /**
+ The name of this state.
+
+ @type String
+ */
+ name: null,
+
+ /**
+ The full path to this state.
+
+ @type String
+ @readOnly
+ */
+ path: Ember.computed(function() {
+ var parentPath = get(this, 'parentState.path'),
+ path = get(this, 'name');
+
+ if (parentPath) {
+ path = parentPath + '.' + path;
+ }
+
+ return path;
+ }).property().cacheable(),
+
+ /**
+ @private
+
+ Override the default event firing from Ember.Evented to
+ also call methods with the given name.
+ */
+ trigger: function(name) {
+ if (this[name]) {
+ this[name].apply(this, [].slice.call(arguments, 1));
+ }
+ this._super.apply(this, arguments);
+ },
+
+ /** @private */
+ init: function() {
+ var states = get(this, 'states'), foundStates;
+ set(this, 'childStates', Ember.A());
+ set(this, 'eventTransitions', get(this, 'eventTransitions') || {});
+
+ var name, value, transitionTarget;
+
+ // As a convenience, loop over the properties
+ // of this state and look for any that are other
+ // Ember.State instances or classes, and move them
+ // to the `states` hash. This avoids having to
+ // create an explicit separate hash.
+
+ if (!states) {
+ states = {};
+
+ for (name in this) {
+ if (name === "constructor") { continue; }
+
+ if (value = this[name]) {
+ if (transitionTarget = value.transitionTarget) {
+ this.eventTransitions[name] = transitionTarget;
+ }
+
+ this.setupChild(states, name, value);
+ }
+ }
+
+ set(this, 'states', states);
+ } else {
+ for (name in states) {
+ this.setupChild(states, name, states[name]);
+ }
+ }
+
+ set(this, 'pathsCache', {});
+ set(this, 'pathsCacheNoContext', {});
+ },
+
+ /** @private */
+ setupChild: function(states, name, value) {
+ if (!value) { return false; }
+
+ if (value.isState) {
+ set(value, 'name', name);
+ } else if (Ember.State.detect(value)) {
+ value = value.create({
+ name: name
+ });
+ }
+
+ if (value.isState) {
+ set(value, 'parentState', this);
+ get(this, 'childStates').pushObject(value);
+ states[name] = value;
+ }
+ },
+
+ lookupEventTransition: function(name) {
+ var path, state = this;
+
+ while(state && !path) {
+ path = state.eventTransitions[name];
+ state = state.get('parentState');
+ }
+
+ return path;
+ },
+
+ /**
+ A Boolean value indicating whether the state is a leaf state
+ in the state hierarchy. This is false if the state has child
+ states; otherwise it is true.
+
+ @type Boolean
+ */
+ isLeaf: Ember.computed(function() {
+ return !get(this, 'childStates').length;
+ }).cacheable(),
+
+ /**
+ A boolean value indicating whether the state takes a context.
+ By default we assume all states take contexts.
+ */
+ hasContext: true,
+
+ /**
+ This is the default transition event.
+
+ @event
+ @param {Ember.StateManager} manager
+ @param context
+ @see Ember.StateManager#transitionEvent
+ */
+ setup: Ember.K,
+
+ /**
+ This event fires when the state is entered.
+
+ @event
+ @param {Ember.StateManager} manager
+ */
+ enter: Ember.K,
+
+ /**
+ This event fires when the state is exited.
+
+ @event
+ @param {Ember.StateManager} manager
+ */
+ exit: Ember.K
+});
+
+var Event = Ember.$ && Ember.$.Event;
+
+Ember.State.reopenClass(
+/** @scope Ember.State */{
+
+ /**
+ @static
+
+ Creates an action function for transitioning to the named state while preserving context.
+
+ The following example StateManagers are equivalent:
+
+ aManager = Ember.StateManager.create({
+ stateOne: Ember.State.create({
+ changeToStateTwo: Ember.State.transitionTo('stateTwo')
+ }),
+ stateTwo: Ember.State.create({})
+ })
+
+ bManager = Ember.StateManager.create({
+ stateOne: Ember.State.create({
+ changeToStateTwo: function(manager, context){
+ manager.transitionTo('stateTwo', context)
+ }
+ }),
+ stateTwo: Ember.State.create({})
+ })
+
+ @param {String} target
+ */
+ transitionTo: function(target) {
+ var event = function(stateManager, context) {
+ if (Event && context instanceof Event) {
+ if (context.hasOwnProperty('context')) {
+ context = context.context;
+ } else {
+ // If we received an event and it doesn't contain
+ // a context, don't pass along a superfluous
+ // context to the target of the event.
+ return stateManager.transitionTo(target);
+ }
+ }
+
+ stateManager.transitionTo(target, context);
+ };
+
+ event.transitionTarget = target;
+
+ return event;
+ }
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
+var arrayForEach = Ember.ArrayPolyfills.forEach;
+/**
+ @private
+
+ A Transition takes the enter, exit and resolve states and normalizes
+ them:
+
+ * takes any passed in contexts into consideration
+ * adds in `initialState`s
+*/
+var Transition = function(raw) {
+ this.enterStates = raw.enterStates.slice();
+ this.exitStates = raw.exitStates.slice();
+ this.resolveState = raw.resolveState;
+
+ this.finalState = raw.enterStates[raw.enterStates.length - 1] || raw.resolveState;
+};
+
+Transition.prototype = {
+ /**
+ @private
+
+ Normalize the passed in enter, exit and resolve states.
+
+ This process also adds `finalState` and `contexts` to the Transition object.
+
+ @param {Ember.StateManager} manager the state manager running the transition
+ @param {Array} contexts a list of contexts passed into `transitionTo`
+ */
+ normalize: function(manager, contexts) {
+ this.matchContextsToStates(contexts);
+ this.addInitialStates();
+ this.removeUnchangedContexts(manager);
+ return this;
+ },
+
+ /**
+ @private
+
+ Match each of the contexts passed to `transitionTo` to a state.
+ This process may also require adding additional enter and exit
+ states if there are more contexts than enter states.
+
+ @param {Array} contexts a list of contexts passed into `transitionTo`
+ */
+ matchContextsToStates: function(contexts) {
+ var stateIdx = this.enterStates.length - 1,
+ matchedContexts = [],
+ state,
+ context;
+
+ // Next, we will match the passed in contexts to the states they
+ // represent.
+ //
+ // First, assign a context to each enter state in reverse order. If
+ // any contexts are left, add a parent state to the list of states
+ // to enter and exit, and assign a context to the parent state.
+ //
+ // If there are still contexts left when the state manager is
+ // reached, raise an exception.
+ //
+ // This allows the following:
+ //
+ // |- root
+ // | |- post
+ // | | |- comments
+ // | |- about (* current state)
+ //
+ // For `transitionTo('post.comments', post, post.get('comments')`,
+ // the first context (`post`) will be assigned to `root.post`, and
+ // the second context (`post.get('comments')`) will be assigned
+ // to `root.post.comments`.
+ //
+ // For the following:
+ //
+ // |- root
+ // | |- post
+ // | | |- index (* current state)
+ // | | |- comments
+ //
+ // For `transitionTo('post.comments', otherPost, otherPost.get('comments')`,
+ // the `<root.post>` state will be added to the list of enter and exit
+ // states because its context has changed.
+
+ while (contexts.length > 0) {
+ if (stateIdx >= 0) {
+ state = this.enterStates[stateIdx--];
+ } else {
+ if (this.enterStates.length) {
+ state = get(this.enterStates[0], 'parentState');
+ if (!state) { throw "Cannot match all contexts to states"; }
+ } else {
+ // If re-entering the current state with a context, the resolve
+ // state will be the current state.
+ state = this.resolveState;
+ }
+
+ this.enterStates.unshift(state);
+ this.exitStates.unshift(state);
+ }
+
+ // in routers, only states with dynamic segments have a context
+ if (get(state, 'hasContext')) {
+ context = contexts.pop();
+ } else {
+ context = null;
+ }
+
+ matchedContexts.unshift(context);
+ }
+
+ this.contexts = matchedContexts;
+ },
+
+ /**
+ @private
+
+ Add any `initialState`s to the list of enter states.
+ */
+ addInitialStates: function() {
+ var finalState = this.finalState, initialState;
+
+ while(true) {
+ initialState = get(finalState, 'initialState') || 'start';
+ finalState = get(finalState, 'states.' + initialState);
+
+ if (!finalState) { break; }
+
+ this.finalState = finalState;
+ this.enterStates.push(finalState);
+ this.contexts.push(undefined);
+ }
+ },
+
+ /**
+ @private
+
+ Remove any states that were added because the number of contexts
+ exceeded the number of explicit enter states, but the context has
+ not changed since the last time the state was entered.
+
+ @param {Ember.StateManager} manager passed in to look up the last
+ context for a states
+ */
+ removeUnchangedContexts: function(manager) {
+ // Start from the beginning of the enter states. If the state was added
+ // to the list during the context matching phase, make sure the context
+ // has actually changed since the last time the state was entered.
+ while (this.enterStates.length > 0) {
+ if (this.enterStates[0] !== this.exitStates[0]) { break; }
+
+ if (this.enterStates.length === this.contexts.length) {
+ if (manager.getStateMeta(this.enterStates[0], 'context') !== this.contexts[0]) { break; }
+ this.contexts.shift();
+ }
+
+ this.resolveState = this.enterStates.shift();
+ this.exitStates.shift();
+ }
+ }
+};
+
+/**
+ @class
+
+ StateManager is part of Ember's implementation of a finite state machine. A StateManager
+ instance manages a number of properties that are instances of `Ember.State`,
+ tracks the current active state, and triggers callbacks when states have changed.
+
+ ## Defining States
+
+ The states of StateManager can be declared in one of two ways. First, you can define
+ a `states` property that contains all the states:
+
+ managerA = Ember.StateManager.create({
+ states: {
+ stateOne: Ember.State.create(),
+ stateTwo: Ember.State.create()
+ }
+ })
+
+ managerA.get('states')
+ // {
+ // stateOne: Ember.State.create(),
+ // stateTwo: Ember.State.create()
+ // }
+
+ You can also add instances of `Ember.State` (or an `Ember.State` subclass) directly as properties
+ of a StateManager. These states will be collected into the `states` property for you.
+
+ managerA = Ember.StateManager.create({
+ stateOne: Ember.State.create(),
+ stateTwo: Ember.State.create()
+ })
+
+ managerA.get('states')
+ // {
+ // stateOne: Ember.State.create(),
+ // stateTwo: Ember.State.create()
+ // }
+
+ ## The Initial State
+ When created a StateManager instance will immediately enter into the state
+ defined as its `start` property or the state referenced by name in its
+ `initialState` property:
+
+ managerA = Ember.StateManager.create({
+ start: Ember.State.create({})
+ })
+
+ managerA.get('currentState.name') // 'start'
+
+ managerB = Ember.StateManager.create({
+ initialState: 'beginHere',
+ beginHere: Ember.State.create({})
+ })
+
+ managerB.get('currentState.name') // 'beginHere'
+
+ Because it is a property you may also provide a computed function if you wish to derive
+ an `initialState` programmatically:
+
+ managerC = Ember.StateManager.create({
+ initialState: function(){
+ if (someLogic) {
+ return 'active';
+ } else {
+ return 'passive';
+ }
+ }.property(),
+ active: Ember.State.create({}),
+ passive: Ember.State.create({})
+ })
+
+ ## Moving Between States
+ A StateManager can have any number of Ember.State objects as properties
+ and can have a single one of these states as its current state.
+
+ Calling `transitionTo` transitions between states:
+
+ robotManager = Ember.StateManager.create({
+ initialState: 'poweredDown',
+ poweredDown: Ember.State.create({}),
+ poweredUp: Ember.State.create({})
+ })
+
+ robotManager.get('currentState.name') // 'poweredDown'
+ robotManager.transitionTo('poweredUp')
+ robotManager.get('currentState.name') // 'poweredUp'
+
+ Before transitioning into a new state the existing `currentState` will have its
+ `exit` method called with the StateManager instance as its first argument and
+ an object representing the transition as its second argument.
+
+ After transitioning into a new state the new `currentState` will have its
+ `enter` method called with the StateManager instance as its first argument and
+ an object representing the transition as its second argument.
+
+ robotManager = Ember.StateManager.create({
+ initialState: 'poweredDown',
+ poweredDown: Ember.State.create({
+ exit: function(stateManager){
+ console.log("exiting the poweredDown state")
+ }
+ }),
+ poweredUp: Ember.State.create({
+ enter: function(stateManager){
+ console.log("entering the poweredUp state. Destroy all humans.")
+ }
+ })
+ })
+
+ robotManager.get('currentState.name') // 'poweredDown'
+ robotManager.transitionTo('poweredUp')
+ // will log
+ // 'exiting the poweredDown state'
+ // 'entering the poweredUp state. Destroy all humans.'
+
+
+ Once a StateManager is already in a state, subsequent attempts to enter that state will
+ not trigger enter or exit method calls. Attempts to transition into a state that the
+ manager does not have will result in no changes in the StateManager's current state:
+
+ robotManager = Ember.StateManager.create({
+ initialState: 'poweredDown',
+ poweredDown: Ember.State.create({
+ exit: function(stateManager){
+ console.log("exiting the poweredDown state")
+ }
+ }),
+ poweredUp: Ember.State.create({
+ enter: function(stateManager){
+ console.log("entering the poweredUp state. Destroy all humans.")
+ }
+ })
+ })
+
+ robotManager.get('currentState.name') // 'poweredDown'
+ robotManager.transitionTo('poweredUp')
+ // will log
+ // 'exiting the poweredDown state'
+ // 'entering the poweredUp state. Destroy all humans.'
+ robotManager.transitionTo('poweredUp') // no logging, no state change
+
+ robotManager.transitionTo('someUnknownState') // silently fails
+ robotManager.get('currentState.name') // 'poweredUp'
+
+
+ Each state property may itself contain properties that are instances of Ember.State.
+ The StateManager can transition to specific sub-states in a series of transitionTo method calls or
+ via a single transitionTo with the full path to the specific state. The StateManager will also
+ keep track of the full path to its currentState
+
+ robotManager = Ember.StateManager.create({
+ initialState: 'poweredDown',
+ poweredDown: Ember.State.create({
+ charging: Ember.State.create(),
+ charged: Ember.State.create()
+ }),
+ poweredUp: Ember.State.create({
+ mobile: Ember.State.create(),
+ stationary: Ember.State.create()
+ })
+ })
+
+ robotManager.get('currentState.name') // 'poweredDown'
+
+ robotManager.transitionTo('poweredUp')
+ robotManager.get('currentState.name') // 'poweredUp'
+
+ robotManager.transitionTo('mobile')
+ robotManager.get('currentState.name') // 'mobile'
+
+ // transition via a state path
+ robotManager.transitionTo('poweredDown.charging')
+ robotManager.get('currentState.name') // 'charging'
+
+ robotManager.get('currentState.path') // 'poweredDown.charging'
+
+ Enter transition methods will be called for each state and nested child state in their
+ hierarchical order. Exit methods will be called for each state and its nested states in
+ reverse hierarchical order.
+
+ Exit transitions for a parent state are not called when entering into one of its child states,
+ only when transitioning to a new section of possible states in the hierarchy.
+
+ robotManager = Ember.StateManager.create({
+ initialState: 'poweredDown',
+ poweredDown: Ember.State.create({
+ enter: function(){},
+ exit: function(){
+ console.log("exited poweredDown state")
+ },
+ charging: Ember.State.create({
+ enter: function(){},
+ exit: function(){}
+ }),
+ charged: Ember.State.create({
+ enter: function(){
+ console.log("entered charged state")
+ },
+ exit: function(){
+ console.log("exited charged state")
+ }
+ })
+ }),
+ poweredUp: Ember.State.create({
+ enter: function(){
+ console.log("entered poweredUp state")
+ },
+ exit: function(){},
+ mobile: Ember.State.create({
+ enter: function(){
+ console.log("entered mobile state")
+ },
+ exit: function(){}
+ }),
+ stationary: Ember.State.create({
+ enter: function(){},
+ exit: function(){}
+ })
+ })
+ })
+
+
+ robotManager.get('currentState.path') // 'poweredDown'
+ robotManager.transitionTo('charged')
+ // logs 'entered charged state'
+ // but does *not* log 'exited poweredDown state'
+ robotManager.get('currentState.name') // 'charged
+
+ robotManager.transitionTo('poweredUp.mobile')
+ // logs
+ // 'exited charged state'
+ // 'exited poweredDown state'
+ // 'entered poweredUp state'
+ // 'entered mobile state'
+
+ During development you can set a StateManager's `enableLogging` property to `true` to
+ receive console messages of state transitions.
+
+ robotManager = Ember.StateManager.create({
+ enableLogging: true
+ })
+
+ ## Managing currentState with Actions
+ To control which transitions between states are possible for a given state, StateManager
+ can receive and route action messages to its states via the `send` method. Calling to `send` with
+ an action name will begin searching for a method with the same name starting at the current state
+ and moving up through the parent states in a state hierarchy until an appropriate method is found
+ or the StateManager instance itself is reached.
+
+ If an appropriately named method is found it will be called with the state manager as the first
+ argument and an optional `context` object as the second argument.
+
+ managerA = Ember.StateManager.create({
+ initialState: 'stateOne.substateOne.subsubstateOne',
+ stateOne: Ember.State.create({
+ substateOne: Ember.State.create({
+ anAction: function(manager, context){
+ console.log("an action was called")
+ },
+ subsubstateOne: Ember.State.create({})
+ })
+ })
+ })
+
+ managerA.get('currentState.name') // 'subsubstateOne'
+ managerA.send('anAction')
+ // 'stateOne.substateOne.subsubstateOne' has no anAction method
+ // so the 'anAction' method of 'stateOne.substateOne' is called
+ // and logs "an action was called"
+ // with managerA as the first argument
+ // and no second argument
+
+ someObject = {}
+ managerA.send('anAction', someObject)
+ // the 'anAction' method of 'stateOne.substateOne' is called again
+ // with managerA as the first argument and
+ // someObject as the second argument.
+
+
+ If the StateManager attempts to send an action but does not find an appropriately named
+ method in the current state or while moving upwards through the state hierarchy
+ it will throw a new Ember.Error. Action detection only moves upwards through the state hierarchy
+ from the current state. It does not search in other portions of the hierarchy.
+
+ managerB = Ember.StateManager.create({
+ initialState: 'stateOne.substateOne.subsubstateOne',
+ stateOne: Ember.State.create({
+ substateOne: Ember.State.create({
+ subsubstateOne: Ember.State.create({})
+ })
+ }),
+ stateTwo: Ember.State.create({
+ anAction: function(manager, context){
+ // will not be called below because it is
+ // not a parent of the current state
+ }
+ })
+ })
+
+ managerB.get('currentState.name') // 'subsubstateOne'
+ managerB.send('anAction')
+ // Error: <Ember.StateManager:ember132> could not
+ // respond to event anAction in state stateOne.substateOne.subsubstateOne.
+
+ Inside of an action method the given state should delegate `transitionTo` calls on its
+ StateManager.
+
+ robotManager = Ember.StateManager.create({
+ initialState: 'poweredDown.charging',
+ poweredDown: Ember.State.create({
+ charging: Ember.State.create({
+ chargeComplete: function(manager, context){
+ manager.transitionTo('charged')
+ }
+ }),
+ charged: Ember.State.create({
+ boot: function(manager, context){
+ manager.transitionTo('poweredUp')
+ }
+ })
+ }),
+ poweredUp: Ember.State.create({
+ beginExtermination: function(manager, context){
+ manager.transitionTo('rampaging')
+ },
+ rampaging: Ember.State.create()
+ })
+ })
+
+ robotManager.get('currentState.name') // 'charging'
+ robotManager.send('boot') // throws error, no boot action
+ // in current hierarchy
+ robotManager.get('currentState.name') // remains 'charging'
+
+ robotManager.send('beginExtermination') // throws error, no beginExtermination
+ // action in current hierarchy
+ robotManager.get('currentState.name') // remains 'charging'
+
+ robotManager.send('chargeComplete')
+ robotManager.get('currentState.name') // 'charged'
+
+ robotManager.send('boot')
+ robotManager.get('currentState.name') // 'poweredUp'
+
+ robotManager.send('beginExtermination', allHumans)
+ robotManager.get('currentState.name') // 'rampaging'
+
+ Transition actions can also be created using the `transitionTo` method of the Ember.State class. The
+ following example StateManagers are equivalent:
+
+ aManager = Ember.StateManager.create({
+ stateOne: Ember.State.create({
+ changeToStateTwo: Ember.State.transitionTo('stateTwo')
+ }),
+ stateTwo: Ember.State.create({})
+ })
+
+ bManager = Ember.StateManager.create({
+ stateOne: Ember.State.create({
+ changeToStateTwo: function(manager, context){
+ manager.transitionTo('stateTwo', context)
+ }
+ }),
+ stateTwo: Ember.State.create({})
+ })
+**/
+Ember.StateManager = Ember.State.extend(
+/** @scope Ember.StateManager.prototype */ {
+
+ /**
+ When creating a new statemanager, look for a default state to transition
+ into. This state can either be named `start`, or can be specified using the
+ `initialState` property.
+ */
+ init: function() {
+ this._super();
+
+ set(this, 'stateMeta', Ember.Map.create());
+
+ var initialState = get(this, 'initialState');
+
+ if (!initialState && get(this, 'states.start')) {
+ initialState = 'start';
+ }
+
+ if (initialState) {
+ this.transitionTo(initialState);
+ Ember.assert('Failed to transition to initial state "' + initialState + '"', !!get(this, 'currentState'));
+ }
+ },
+
+ stateMetaFor: function(state) {
+ var meta = get(this, 'stateMeta'),
+ stateMeta = meta.get(state);
+
+ if (!stateMeta) {
+ stateMeta = {};
+ meta.set(state, stateMeta);
+ }
+
+ return stateMeta;
+ },
+
+ setStateMeta: function(state, key, value) {
+ return set(this.stateMetaFor(state), key, value);
+ },
+
+ getStateMeta: function(state, key) {
+ return get(this.stateMetaFor(state), key);
+ },
+
+ /**
+ The current state from among the manager's possible states. This property should
+ not be set directly. Use `transitionTo` to move between states by name.
+
+ @type Ember.State
+ @readOnly
+ */
+ currentState: null,
+
+ /**
+ The name of transitionEvent that this stateManager will dispatch
+
+ @property {String}
+ @default 'setup'
+ */
+ transitionEvent: 'setup',
+
+ /**
+ If set to true, `errorOnUnhandledEvents` will cause an exception to be
+ raised if you attempt to send an event to a state manager that is not
+ handled by the current state or any of its parent states.
+
+ @type Boolean
+ @default true
+ */
+ errorOnUnhandledEvent: true,
+
+ send: function(event, context) {
+ Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
+ return this.sendRecursively(event, get(this, 'currentState'), context);
+ },
+
+ sendRecursively: function(event, currentState, context) {
+ var log = this.enableLogging,
+ action = currentState[event];
+
+ // Test to see if the action is a method that
+ // can be invoked. Don't blindly check just for
+ // existence, because it is possible the state
+ // manager has a child state of the given name,
+ // and we should still raise an exception in that
+ // case.
+ if (typeof action === 'function') {
+ if (log) { Ember.Logger.log(fmt("STATEMANAGER: Sending event '%@' to state %@.", [event, get(currentState, 'path')])); }
+ return action.call(currentState, this, context);
+ } else {
+ var parentState = get(currentState, 'parentState');
+ if (parentState) {
+ return this.sendRecursively(event, parentState, context);
+ } else if (get(this, 'errorOnUnhandledEvent')) {
+ throw new Ember.Error(this.toString() + " could not respond to event " + event + " in state " + get(this, 'currentState.path') + ".");
+ }
+ }
+ },
+
+ /**
+ Finds a state by its state path.
+
+ Example:
+
+ manager = Ember.StateManager.create({
+ root: Ember.State.create({
+ dashboard: Ember.State.create()
+ })
+ });
+
+ manager.getStateByPath(manager, "root.dashboard")
+
+ // returns the dashboard state
+
+ @param {Ember.State} root the state to start searching from
+ @param {String} path the state path to follow
+ @returns {Ember.State} the state at the end of the path
+ */
+ getStateByPath: function(root, path) {
+ var parts = path.split('.'),
+ state = root;
+
+ for (var i=0, l=parts.length; i<l; i++) {
+ state = get(get(state, 'states'), parts[i]);
+ if (!state) { break; }
+ }
+
+ return state;
+ },
+
+ findStateByPath: function(state, path) {
+ var possible;
+
+ while (!possible && state) {
+ possible = this.getStateByPath(state, path);
+ state = get(state, 'parentState');
+ }
+
+ return possible;
+ },
+
+ /**
+ @private
+
+ A state stores its child states in its `states` hash.
+ This code takes a path like `posts.show` and looks
+ up `origin.states.posts.states.show`.
+
+ It returns a list of all of the states from the
+ origin, which is the list of states to call `enter`
+ on.
+ */
+ findStatesByPath: function(origin, path) {
+ if (!path || path === "") { return undefined; }
+ var r = path.split('.'),
+ ret = [];
+
+ for (var i=0, len = r.length; i < len; i++) {
+ var states = get(origin, 'states');
+
+ if (!states) { return undefined; }
+
+ var s = get(states, r[i]);
+ if (s) { origin = s; ret.push(s); }
+ else { return undefined; }
+ }
+
+ return ret;
+ },
+
+ goToState: function() {
+ // not deprecating this yet so people don't constantly need to
+ // make trivial changes for little reason.
+ return this.transitionTo.apply(this, arguments);
+ },
+
+ transitionTo: function(path, context) {
+ // XXX When is transitionTo called with no path
+ if (Ember.empty(path)) { return; }
+
+ // The ES6 signature of this function is `path, ...contexts`
+ var contexts = context ? Array.prototype.slice.call(arguments, 1) : [],
+ currentState = get(this, 'currentState') || this;
+
+ // First, get the enter, exit and resolve states for the current state
+ // and specified path. If possible, use an existing cache.
+ var hash = this.contextFreeTransition(currentState, path);
+
+ // Next, process the raw state information for the contexts passed in.
+ var transition = new Transition(hash).normalize(this, contexts);
+
+ this.enterState(transition);
+ this.triggerSetupContext(transition);
+ },
+
+ contextFreeTransition: function(currentState, path) {
+ var cache = currentState.pathsCache[path];
+ if (cache) { return cache; }
+
+ var enterStates = this.findStatesByPath(currentState, path),
+ exitStates = [],
+ resolveState = currentState;
+
+ // Walk up the states. For each state, check whether a state matching
+ // the `path` is nested underneath. This will find the closest
+ // parent state containing `path`.
+ //
+ // This allows the user to pass in a relative path. For example, for
+ // the following state hierarchy:
+ //
+ // | |root
+ // | |- posts
+ // | | |- show (* current)
+ // | |- comments
+ // | | |- show
+ //
+ // If the current state is `<root.posts.show>`, an attempt to
+ // transition to `comments.show` will match `<root.comments.show>`.
+ //
+ // First, this code will look for root.posts.show.comments.show.
+ // Next, it will look for root.posts.comments.show. Finally,
+ // it will look for `root.comments.show`, and find the state.
+ //
+ // After this process, the following variables will exist:
+ //
+ // * resolveState: a common parent state between the current
+ // and target state. In the above example, `<root>` is the
+ // `resolveState`.
+ // * enterStates: a list of all of the states represented
+ // by the path from the `resolveState`. For example, for
+ // the path `root.comments.show`, `enterStates` would have
+ // `[<root.comments>, <root.comments.show>]`
+ // * exitStates: a list of all of the states from the
+ // `resolveState` to the `currentState`. In the above
+ // example, `exitStates` would have
+ // `[<root.posts>`, `<root.posts.show>]`.
+ while (resolveState && !enterStates) {
+ exitStates.unshift(resolveState);
+
+ resolveState = get(resolveState, 'parentState');
+ if (!resolveState) {
+ enterStates = this.findStatesByPath(this, path);
+ if (!enterStates) {
+ Ember.assert('Could not find state for path: "'+path+'"');
+ return;
+ }
+ }
+ enterStates = this.findStatesByPath(resolveState, path);
+ }
+
+ // If the path contains some states that are parents of both the
+ // current state and the target state, remove them.
+ //
+ // For example, in the following hierarchy:
+ //
+ // |- root
+ // | |- post
+ // | | |- index (* current)
+ // | | |- show
+ //
+ // If the `path` is `root.post.show`, the three variables will
+ // be:
+ //
+ // * resolveState: `<state manager>`
+ // * enterStates: `[<root>, <root.post>, <root.post.show>]`
+ // * exitStates: `[<root>, <root.post>, <root.post.index>]`
+ //
+ // The goal of this code is to remove the common states, so we
+ // have:
+ //
+ // * resolveState: `<root.post>`
+ // * enterStates: `[<root.post.show>]`
+ // * exitStates: `[<root.post.index>]`
+ //
+ // This avoid unnecessary calls to the enter and exit transitions.
+ while (enterStates.length > 0 && enterStates[0] === exitStates[0]) {
+ resolveState = enterStates.shift();
+ exitStates.shift();
+ }
+
+ // Cache the enterStates, exitStates, and resolveState for the
+ // current state and the `path`.
+ var transitions = currentState.pathsCache[path] = {
+ exitStates: exitStates,
+ enterStates: enterStates,
+ resolveState: resolveState
+ };
+
+ return transitions;
+ },
+
+ triggerSetupContext: function(transitions) {
+ var contexts = transitions.contexts,
+ offset = transitions.enterStates.length - contexts.length,
+ enterStates = transitions.enterStates,
+ transitionEvent = get(this, 'transitionEvent');
+
+ Ember.assert("More contexts provided than states", offset >= 0);
+
+ arrayForEach.call(enterStates, function(state, idx) {
+ state.trigger(transitionEvent, this, contexts[idx-offset]);
+ }, this);
+ },
+
+ getState: function(name) {
+ var state = get(this, name),
+ parentState = get(this, 'parentState');
+
+ if (state) {
+ return state;
+ } else if (parentState) {
+ return parentState.getState(name);
+ }
+ },
+
+ enterState: function(transition) {
+ var log = this.enableLogging;
+
+ var exitStates = transition.exitStates.slice(0).reverse();
+ arrayForEach.call(exitStates, function(state) {
+ state.trigger('exit', this);
+ }, this);
+
+ arrayForEach.call(transition.enterStates, function(state) {
+ if (log) { Ember.Logger.log("STATEMANAGER: Entering " + get(state, 'path')); }
+ state.trigger('enter', this);
+ }, this);
+
+ set(this, 'currentState', transition.finalState);
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Statecharts
+// Copyright: ©2011 Living Social Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+(function() {
+var get = Ember.get;
+
+Ember._ResolvedState = Ember.Object.extend({
+ manager: null,
+ state: null,
+ match: null,
+
+ object: Ember.computed(function(key, value) {
+ if (arguments.length === 2) {
+ this._object = value;
+ return value;
+ } else {
+ if (this._object) {
+ return this._object;
+ } else {
+ var state = get(this, 'state'),
+ match = get(this, 'match'),
+ manager = get(this, 'manager');
+ return state.deserialize(manager, match.hash);
+ }
+ }
+ }).property(),
+
+ hasPromise: Ember.computed(function() {
+ return Ember.canInvoke(get(this, 'object'), 'then');
+ }).property('object'),
+
+ promise: Ember.computed(function() {
+ var object = get(this, 'object');
+ if (Ember.canInvoke(object, 'then')) {
+ return object;
+ } else {
+ return {
+ then: function(success) { success(object); }
+ };
+ }
+ }).property('object'),
+
+ transition: function() {
+ var manager = get(this, 'manager'),
+ path = get(this, 'state.path'),
+ object = get(this, 'object');
+ manager.transitionTo(path, object);
+ }
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get;
+
+// The Ember Routable mixin assumes the existance of a simple
+// routing shim that supports the following three behaviors:
+//
+// * .getURL() - this is called when the page loads
+// * .setURL(newURL) - this is called from within the state
+// manager when the state changes to a routable state
+// * .onURLChange(callback) - this happens when the user presses
+// the back or forward button
+
+var paramForClass = function(classObject) {
+ var className = classObject.toString(),
+ parts = className.split("."),
+ last = parts[parts.length - 1];
+
+ return Ember.String.underscore(last) + "_id";
+};
+
+var merge = function(original, hash) {
+ for (var prop in hash) {
+ if (!hash.hasOwnProperty(prop)) { continue; }
+ if (original.hasOwnProperty(prop)) { continue; }
+
+ original[prop] = hash[prop];
+ }
+};
+
+/**
+ @class
+ @extends Ember.Mixin
+*/
+Ember.Routable = Ember.Mixin.create({
+ init: function() {
+ var redirection;
+ this.on('connectOutlets', this, this.stashContext);
+
+ if (redirection = get(this, 'redirectsTo')) {
+ Ember.assert("You cannot use `redirectsTo` if you already have a `connectOutlets` method", this.connectOutlets === Ember.K);
+
+ this.connectOutlets = function(router) {
+ router.transitionTo(redirection);
+ };
+ }
+
+ // normalize empty route to '/'
+ var route = get(this, 'route');
+ if (route === '') {
+ route = '/';
+ }
+
+ this._super();
+
+ Ember.assert("You cannot use `redirectsTo` on a state that has child states", !redirection || (!!redirection && !!get(this, 'isLeaf')));
+ },
+
+ /**
+ @private
+
+ Whenever a routable state is entered, the context it was entered with
+ is stashed so that we can regenerate the state's `absoluteURL` on
+ demand.
+ */
+ stashContext: function(manager, context) {
+ var serialized = this.serialize(manager, context);
+ Ember.assert('serialize must return a hash', !serialized || typeof serialized === 'object');
+
+ manager.setStateMeta(this, 'context', context);
+ manager.setStateMeta(this, 'serialized', serialized);
+
+ if (get(this, 'isRoutable') && !get(manager, 'isRouting')) {
+ this.updateRoute(manager, get(manager, 'location'));
+ }
+ },
+
+ /**
+ @private
+
+ Whenever a routable state is entered, the router's location object
+ is notified to set the URL to the current absolute path.
+
+ In general, this will update the browser's URL.
+ */
+ updateRoute: function(manager, location) {
+ if (get(this, 'isLeafRoute')) {
+ var path = this.absoluteRoute(manager);
+ location.setURL(path);
+ }
+ },
+
+ /**
+ @private
+
+ Get the absolute route for the current state and a given
+ hash.
+
+ This method is private, as it expects a serialized hash,
+ not the original context object.
+ */
+ absoluteRoute: function(manager, hash) {
+ var parentState = get(this, 'parentState');
+ var path = '', generated;
+
+ // If the parent state is routable, use its current path
+ // as this route's prefix.
+ if (get(parentState, 'isRoutable')) {
+ path = parentState.absoluteRoute(manager, hash);
+ }
+
+ var matcher = get(this, 'routeMatcher'),
+ serialized = manager.getStateMeta(this, 'serialized');
+
+ // merge the existing serialized object in with the passed
+ // in hash.
+ hash = hash || {};
+ merge(hash, serialized);
+
+ generated = matcher && matcher.generate(hash);
+
+ if (generated) {
+ path = path + '/' + generated;
+ }
+
+ return path;
+ },
+
+ /**
+ @private
+
+ At the moment, a state is routable if it has a string `route`
+ property. This heuristic may change.
+ */
+ isRoutable: Ember.computed(function() {
+ return typeof get(this, 'route') === 'string';
+ }).cacheable(),
+
+ /**
+ @private
+
+ Determine if this is the last routeable state
+ */
+ isLeafRoute: Ember.computed(function() {
+ if (get(this, 'isLeaf')) { return true; }
+ return !get(this, 'childStates').findProperty('isRoutable');
+ }).cacheable(),
+
+ /**
+ @private
+
+ A _RouteMatcher object generated from the current route's `route`
+ string property.
+ */
+ routeMatcher: Ember.computed(function() {
+ var route = get(this, 'route');
+ if (route) {
+ return Ember._RouteMatcher.create({ route: route });
+ }
+ }).cacheable(),
+
+ /**
+ @private
+
+ Check whether the route has dynamic segments and therefore takes
+ a context.
+ */
+ hasContext: Ember.computed(function() {
+ var routeMatcher = get(this, 'routeMatcher');
+ if (routeMatcher) {
+ return routeMatcher.identifiers.length > 0;
+ }
+ }).cacheable(),
+
+ /**
+ @private
+
+ The model class associated with the current state. This property
+ uses the `modelType` property, in order to allow it to be
+ specified as a String.
+ */
+ modelClass: Ember.computed(function() {
+ var modelType = get(this, 'modelType');
+
+ if (typeof modelType === 'string') {
+ return Ember.get(window, modelType);
+ } else {
+ return modelType;
+ }
+ }).cacheable(),
+
+ /**
+ @private
+
+ Get the model class for the state. The heuristic is:
+
+ * The state must have a single dynamic segment
+ * The dynamic segment must end in `_id`
+ * A dynamic segment like `blog_post_id` is converted into `BlogPost`
+ * The name is then looked up on the passed in namespace
+
+ The process of initializing an application with a router will
+ pass the application's namespace into the router, which will be
+ used here.
+ */
+ modelClassFor: function(namespace) {
+ var modelClass, routeMatcher, identifiers, match, className;
+
+ // if an explicit modelType was specified, use that
+ if (modelClass = get(this, 'modelClass')) { return modelClass; }
+
+ // if the router has no lookup namespace, we won't be able to guess
+ // the modelType
+ if (!namespace) { return; }
+
+ // make sure this state is actually a routable state
+ routeMatcher = get(this, 'routeMatcher');
+ if (!routeMatcher) { return; }
+
+ // only guess modelType for states with a single dynamic segment
+ // (no more, no fewer)
+ identifiers = routeMatcher.identifiers;
+ if (identifiers.length !== 2) { return; }
+
+ // extract the `_id` from the end of the dynamic segment; if the
+ // dynamic segment does not end in `_id`, we can't guess the
+ // modelType
+ match = identifiers[1].match(/^(.*)_id$/);
+ if (!match) { return; }
+
+ // convert the underscored type into a class form and look it up
+ // on the router's namespace
+ className = Ember.String.classify(match[1]);
+ return get(namespace, className);
+ },
+
+ /**
+ The default method that takes a `params` object and converts
+ it into an object.
+
+ By default, a params hash that looks like `{ post_id: 1 }`
+ will be looked up as `namespace.Post.find(1)`. This is
+ designed to work seamlessly with Ember Data, but will work
+ fine with any class that has a `find` method.
+ */
+ deserialize: function(manager, params) {
+ var modelClass, routeMatcher, param;
+
+ if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {
+ Ember.assert("Expected "+modelClass.toString()+" to implement `find` for use in '"+this.get('path')+"' `deserialize`. Please implement the `find` method or overwrite `deserialize`.", modelClass.find);
+ return modelClass.find(params[paramForClass(modelClass)]);
+ }
+
+ return params;
+ },
+
+ /**
+ The default method that takes an object and converts it into
+ a params hash.
+
+ By default, if there is a single dynamic segment named
+ `blog_post_id` and the object is a `BlogPost` with an
+ `id` of `12`, the serialize method will produce:
+
+ { blog_post_id: 12 }
+ */
+ serialize: function(manager, context) {
+ var modelClass, routeMatcher, namespace, param, id;
+
+ if (Ember.empty(context)) { return ''; }
+
+ if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {
+ param = paramForClass(modelClass);
+ id = get(context, 'id');
+ context = {};
+ context[param] = id;
+ }
+
+ return context;
+ },
+
+ /**
+ @private
+ */
+ resolvePath: function(manager, path) {
+ if (get(this, 'isLeafRoute')) { return Ember.A(); }
+
+ var childStates = get(this, 'childStates'), match;
+
+ childStates = Ember.A(childStates.filterProperty('isRoutable'));
+
+ childStates = childStates.sort(function(a, b) {
+ var aDynamicSegments = get(a, 'routeMatcher.identifiers.length'),
+ bDynamicSegments = get(b, 'routeMatcher.identifiers.length'),
+ aRoute = get(a, 'route'),
+ bRoute = get(b, 'route');
+
+ if (aRoute.indexOf(bRoute) === 0) {
+ return -1;
+ } else if (bRoute.indexOf(aRoute) === 0) {
+ return 1;
+ }
+
+ if (aDynamicSegments !== bDynamicSegments) {
+ return aDynamicSegments - bDynamicSegments;
+ }
+
+ return get(b, 'route.length') - get(a, 'route.length');
+ });
+
+ var state = childStates.find(function(state) {
+ var matcher = get(state, 'routeMatcher');
+ if (match = matcher.match(path)) { return true; }
+ });
+
+ Ember.assert("Could not find state for path " + path, !!state);
+
+ var resolvedState = Ember._ResolvedState.create({
+ manager: manager,
+ state: state,
+ match: match
+ });
+
+ var states = state.resolvePath(manager, match.remaining);
+
+ return Ember.A([resolvedState]).pushObjects(states);
+ },
+
+ /**
+ @private
+
+ Once `unroute` has finished unwinding, `routePath` will be called
+ with the remainder of the route.
+
+ For example, if you were in the /posts/1/comments state, and you
+ moved into the /posts/2/comments state, `routePath` will be called
+ on the state whose path is `/posts` with the path `/2/comments`.
+ */
+ routePath: function(manager, path) {
+ if (get(this, 'isLeafRoute')) { return; }
+
+ var resolvedStates = this.resolvePath(manager, path),
+ hasPromises = resolvedStates.some(function(s) { return get(s, 'hasPromise'); });
+
+ function runTransition() {
+ resolvedStates.forEach(function(rs) { rs.transition(); });
+ }
+
+ if (hasPromises) {
+ manager.transitionTo('loading');
+
+ Ember.assert('Loading state should be the child of a route', Ember.Routable.detect(get(manager, 'currentState.parentState')));
+ Ember.assert('Loading state should not be a route', !Ember.Routable.detect(get(manager, 'currentState')));
+
+ manager.handleStatePromises(resolvedStates, runTransition);
+ } else {
+ runTransition();
+ }
+ },
+
+ /**
+ @private
+
+ When you move to a new route by pressing the back
+ or forward button, this method is called first.
+
+ Its job is to move the state manager into a parent
+ state of the state it will eventually move into.
+ */
+ unroutePath: function(router, path) {
+ var parentState = get(this, 'parentState');
+
+ // If we're at the root state, we're done
+ if (parentState === router) {
+ return;
+ }
+
+ path = path.replace(/^(?=[^\/])/, "/");
+ var absolutePath = this.absoluteRoute(router);
+
+ var route = get(this, 'route');
+
+ // If the current path is empty, move up one state,
+ // because the index ('/') state must be a leaf node.
+ if (route !== '/') {
+ // If the current path is a prefix of the path we're trying
+ // to go to, we're done.
+ var index = path.indexOf(absolutePath),
+ next = path.charAt(absolutePath.length);
+
+ if (index === 0 && (next === "/" || next === "")) {
+ return;
+ }
+ }
+
+ // Transition to the parent and call unroute again.
+ router.enterState({
+ exitStates: [this],
+ enterStates: [],
+ finalState: parentState
+ });
+
+ router.send('unroutePath', path);
+ },
+
+ /**
+ The `connectOutlets` event will be triggered once a
+ state has been entered. It will be called with the
+ route's context.
+ */
+ connectOutlets: Ember.K,
+
+ /**
+ The `navigateAway` event will be triggered when the
+ URL changes due to the back/forward button
+ */
+ navigateAway: Ember.K
+});
+
+})();
+
+
+
+(function() {
+/**
+ @class
+ @extends Ember.Routable
+*/
+Ember.Route = Ember.State.extend(Ember.Routable);
+
+})();
+
+
+
+(function() {
+var escapeForRegex = function(text) {
+ return text.replace(/[\-\[\]{}()*+?.,\\\^\$|#\s]/g, "\\$&");
+};
+
+Ember._RouteMatcher = Ember.Object.extend({
+ state: null,
+
+ init: function() {
+ var route = this.route,
+ identifiers = [],
+ count = 1,
+ escaped;
+
+ // Strip off leading slash if present
+ if (route.charAt(0) === '/') {
+ route = this.route = route.substr(1);
+ }
+
+ escaped = escapeForRegex(route);
+
+ var regex = escaped.replace(/:([a-z_]+)(?=$|\/)/gi, function(match, id) {
+ identifiers[count++] = id;
+ return "([^/]+)";
+ });
+
+ this.identifiers = identifiers;
+ this.regex = new RegExp("^/?" + regex);
+ },
+
+ match: function(path) {
+ var match = path.match(this.regex);
+
+ if (match) {
+ var identifiers = this.identifiers,
+ hash = {};
+
+ for (var i=1, l=identifiers.length; i<l; i++) {
+ hash[identifiers[i]] = match[i];
+ }
+
+ return {
+ remaining: path.substr(match[0].length),
+ hash: identifiers.length > 0 ? hash : null
+ };
+ }
+ },
+
+ generate: function(hash) {
+ var identifiers = this.identifiers, route = this.route, id;
+ for (var i=1, l=identifiers.length; i<l; i++) {
+ id = identifiers[i];
+ route = route.replace(new RegExp(":" + id), hash[id]);
+ }
+ return route;
+ }
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+var merge = function(original, hash) {
+ for (var prop in hash) {
+ if (!hash.hasOwnProperty(prop)) { continue; }
+ if (original.hasOwnProperty(prop)) { continue; }
+
+ original[prop] = hash[prop];
+ }
+};
+
+/**
+ @class
+
+ `Ember.Router` is the subclass of `Ember.StateManager` responsible for providing URL-based
+ application state detection. The `Ember.Router` instance of an application detects the browser URL
+ at application load time and attempts to match it to a specific application state. Additionally
+ the router will update the URL to reflect an application's state changes over time.
+
+ ## Adding a Router Instance to Your Application
+ An instance of Ember.Router can be associated with an instance of Ember.Application in one of two ways:
+
+ You can provide a subclass of Ember.Router as the `Router` property of your application. An instance
+ of this Router class will be instantiated and route detection will be enabled when the application's
+ `initialize` method is called. The Router instance will be available as the `router` property
+ of the application:
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({ ... })
+ });
+
+ App.initialize();
+ App.get('router') // an instance of App.Router
+
+ If you want to define a Router instance elsewhere, you can pass the instance to the application's
+ `initialize` method:
+
+ App = Ember.Application.create();
+ aRouter = Ember.Router.create({ ... });
+
+ App.initialize(aRouter);
+ App.get('router') // aRouter
+
+ ## Adding Routes to a Router
+ The `initialState` property of Ember.Router instances is named `root`. The state stored in this
+ property must be a subclass of Ember.Route. The `root` route acts as the container for the
+ set of routable states but is not routable itself. It should have states that are also subclasses
+ of Ember.Route which each have a `route` property describing the URL pattern you would like to detect.
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ index: Ember.Route.extend({
+ route: '/'
+ }),
+ ... additional Ember.Routes ...
+ })
+ })
+ });
+ App.initialize();
+
+
+ When an application loads, Ember will parse the URL and attempt to find an Ember.Route within
+ the application's states that matches. (The example URL-matching below will use the default
+ 'hash syntax' provided by `Ember.HashLocation`.)
+
+ In the following route structure:
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/'
+ }),
+ bRoute: Ember.Route.extend({
+ route: '/alphabeta'
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ Loading the page at the URL '#/' will detect the route property of 'root.aRoute' ('/') and
+ transition the router first to the state named 'root' and then to the substate 'aRoute'.
+
+ Respectively, loading the page at the URL '#/alphabeta' would detect the route property of
+ 'root.bRoute' ('/alphabeta') and transition the router first to the state named 'root' and
+ then to the substate 'bRoute'.
+
+ ## Adding Nested Routes to a Router
+ Routes can contain nested subroutes each with their own `route` property describing the nested
+ portion of the URL they would like to detect and handle. Router, like all instances of StateManager,
+ cannot call `transitonTo` with an intermediary state. To avoid transitioning the Router into an
+ intermediary state when detecting URLs, a Route with nested routes must define both a base `route`
+ property for itself and a child Route with a `route` property of `'/'` which will be transitioned
+ to when the base route is detected in the URL:
+
+ Given the following application code:
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/theBaseRouteForThisSet',
+
+ indexSubRoute: Ember.Route.extend({
+ route: '/',
+ }),
+
+ subRouteOne: Ember.Route.extend({
+ route: '/subroute1
+ }),
+
+ subRouteTwo: Ember.Route.extend({
+ route: '/subRoute2'
+ })
+
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ When the application is loaded at '/theBaseRouteForThisSet' the Router will transition to the route
+ at path 'root.aRoute' and then transition to state 'indexSubRoute'.
+
+ When the application is loaded at '/theBaseRouteForThisSet/subRoute1' the Router will transition to
+ the route at path 'root.aRoute' and then transition to state 'subRouteOne'.
+
+ ## Route Transition Events
+ Transitioning between Ember.Route instances (including the transition into the detected
+ route when loading the application) triggers the same transition events as state transitions for
+ base `Ember.State`s. However, the default `setup` transition event is named `connectOutlets` on
+ Ember.Router instances (see 'Changing View Hierarchy in Response To State Change').
+
+ The following route structure when loaded with the URL "#/"
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/',
+ enter: function(router) {
+ console.log("entering root.aRoute from", router.get('currentState.name'));
+ },
+ connectOutlets: function(router) {
+ console.log("entered root.aRoute, fully transitioned to", router.get('currentState.path'));
+ }
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ Will result in console output of:
+
+ 'entering root.aRoute from root'
+ 'entered root.aRoute, fully transitioned to root.aRoute '
+
+ Ember.Route has two additional callbacks for handling URL serialization and deserialization. See
+ 'Serializing/Deserializing URLs'
+
+ ## Routes With Dynamic Segments
+ An Ember.Route's `route` property can reference dynamic sections of the URL by prefacing a URL segment
+ with the ':' character. The values of these dynamic segments will be passed as a hash to the
+ `deserialize` method of the matching Route (see 'Serializing/Deserializing URLs').
+
+ ## Serializing/Deserializing URLs
+ Ember.Route has two callbacks for associating a particular object context with a URL: `serialize`
+ for converting an object into a parameters hash to fill dynamic segments of a URL and `deserialize`
+ for converting a hash of dynamic segments from the URL into the appropriate object.
+
+ ### Deserializing A URL's Dynamic Segments
+ When an application is first loaded or the URL is changed manually (e.g. through the browser's
+ back button) the `deserialize` method of the URL's matching Ember.Route will be called with
+ the application's router as its first argument and a hash of the URLs dynamic segments and values
+ as its second argument.
+
+ The following route structure when loaded with the URL "#/fixed/thefirstvalue/anotherFixed/thesecondvalue":
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/fixed/:dynamicSectionA/anotherFixed/:dynamicSectionB',
+ deserialize: function(router, params) {}
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ Will call the 'deserialize' method of the Route instance at the path 'root.aRoute' with the
+ following hash as its second argument:
+
+ {
+ dynamicSectionA: 'thefirstvalue',
+ dynamicSectionB: 'thesecondvalue'
+ }
+
+ Within `deserialize` you should use this information to retrieve or create an appropriate context
+ object for the given URL (e.g. by loading from a remote API or accessing the browser's
+ `localStorage`). This object must be the `return` value of `deserialize` and will be
+ passed to the Route's `connectOutlets` and `serialize` methods.
+
+ When an application's state is changed from within the application itself, the context provided for
+ the transition will be passed and `deserialize` is not called (see 'Transitions Between States').
+
+ ### Serializing An Object For URLs with Dynamic Segments
+ When transitioning into a Route whose `route` property contains dynamic segments the Route's
+ `serialize` method is called with the Route's router as the first argument and the Route's
+ context as the second argument. The return value of `serialize` will be use to populate the
+ dynamic segments and should be a object with keys that match the names of the dynamic sections.
+
+ Given the following route structure:
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/'
+ }),
+ bRoute: Ember.Route.extend({
+ route: '/staticSection/:someDynamicSegment',
+ serialize: function(router, context) {
+ return {
+ someDynamicSegment: context.get('name')
+ }
+ }
+ })
+ })
+ })
+ });
+ App.initialize();
+
+
+ Transitioning to "root.bRoute" with a context of `Object.create({name: 'Yehuda'})` will call
+ the Route's `serialize` method with the context as its second argument and update the URL to
+ '#/staticSection/Yehuda'.
+
+ ## Transitions Between States
+ Once a routed application has initialized its state based on the entry URL, subsequent transitions to other
+ states will update the URL if the entered Route has a `route` property. Given the following route structure
+ loaded at the URL '#/':
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/',
+ moveElsewhere: Ember.Route.transitionTo('bRoute')
+ }),
+ bRoute: Ember.Route.extend({
+ route: '/someOtherLocation'
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ And application code:
+
+ App.get('router').send('moveElsewhere');
+
+ Will transition the application's state to 'root.bRoute' and trigger an update of the URL to
+ '#/someOtherLocation'.
+
+ For URL patterns with dynamic segments a context can be supplied as the second argument to `send`.
+ The router will match dynamic segments names to keys on this object and fill in the URL with the
+ supplied values. Given the following state structure loaded at the URL '#/':
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/',
+ moveElsewhere: Ember.Route.transitionTo('bRoute')
+ }),
+ bRoute: Ember.Route.extend({
+ route: '/a/route/:dynamicSection/:anotherDynamicSection',
+ connectOutlets: function(router, context) {},
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ And application code:
+
+ App.get('router').send('moveElsewhere', {
+ dynamicSection: '42',
+ anotherDynamicSection: 'Life'
+ });
+
+ Will transition the application's state to 'root.bRoute' and trigger an update of the URL to
+ '#/a/route/42/Life'.
+
+ The context argument will also be passed as the second argument to the `serialize` method call.
+
+ ## Injection of Controller Singletons
+ During application initialization Ember will detect properties of the application ending in 'Controller',
+ create singleton instances of each class, and assign them as a properties on the router. The property name
+ will be the UpperCamel name converted to lowerCamel format. These controller classes should be subclasses
+ of Ember.ObjectController, Ember.ArrayController, Ember.Controller, or a custom Ember.Object that includes the
+ Ember.ControllerMixin mixin.
+
+ App = Ember.Application.create({
+ FooController: Ember.Object.create(Ember.ControllerMixin),
+ Router: Ember.Router.extend({ ... })
+ });
+
+ App.get('router.fooController'); // instance of App.FooController
+
+ The controller singletons will have their `namespace` property set to the application and their `target`
+ property set to the application's router singleton for easy integration with Ember's user event system.
+ See 'Changing View Hierarchy in Response To State Change' and 'Responding to User-initiated Events'
+
+ ## Responding to User-initiated Events
+ Controller instances injected into the router at application initialization have their `target` property
+ set to the application's router instance. These controllers will also be the default `context` for their
+ associated views. Uses of the `{{action}}` helper will automatically target the application's router.
+
+ Given the following application entered at the URL '#/':
+
+ App = Ember.Application.create({
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/',
+ anActionOnTheRouter: function(router, context) {
+ router.transitionTo('anotherState', context);
+ }
+ })
+ anotherState: Ember.Route.extend({
+ route: '/differentUrl',
+ connectOutlets: function(router, context) {
+
+ }
+ })
+ })
+ })
+ });
+ App.initialize();
+
+ The following template:
+
+ <script type="text/x-handlebars" data-template-name="aView">
+ <h1><a {{action anActionOnTheRouter}}>{{title}}</a></h1>
+ </script>
+
+ Will delegate `click` events on the rendered `h1` to the application's router instance. In this case the
+ `anActionOnTheRouter` method of the state at 'root.aRoute' will be called with the view's controller
+ as the context argument. This context will be passed to the `connectOutlets` as its second argument.
+
+ Different `context` can be supplied from within the `{{action}}` helper, allowing specific context passing
+ between application states:
+
+ <script type="text/x-handlebars" data-template-name="photos">
+ {{#each photo in controller}}
+ <h1><a {{action showPhoto photo}}>{{title}}</a></h1>
+ {{/each}}
+ </script>
+
+ See Handlebars.helpers.action for additional usage examples.
+
+
+ ## Changing View Hierarchy in Response To State Change
+ Changes in application state that change the URL should be accompanied by associated changes in view
+ hierarchy. This can be accomplished by calling 'connectOutlet' on the injected controller singletons from
+ within the 'connectOutlets' event of an Ember.Route:
+
+ App = Ember.Application.create({
+ OneController: Ember.ObjectController.extend(),
+ OneView: Ember.View.extend(),
+
+ AnotherController: Ember.ObjectController.extend(),
+ AnotherView: Ember.View.extend(),
+
+ Router: Ember.Router.extend({
+ root: Ember.Route.extend({
+ aRoute: Ember.Route.extend({
+ route: '/',
+ connectOutlets: function(router, context) {
+ router.get('oneController').connectOutlet('another');
+ },
+ })
+ })
+ })
+ });
+ App.initialize();
+
+
+ This will detect the '{{outlet}}' portion of `oneController`'s view (an instance of `App.OneView`) and
+ fill it with a rendered instance of `App.AnotherView` whose `context` will be the single instance of
+ `App.AnotherController` stored on the router in the `anotherController` property.
+
+ For more information about Outlets, see `Ember.Handlebars.helpers.outlet`. For additional information on
+ the `connectOutlet` method, see `Ember.Controller.connectOutlet`. For more information on
+ controller injections, see `Ember.Application#initialize()`. For additional information about view context,
+ see `Ember.View`.
+
+ @extends Ember.StateManager
+*/
+Ember.Router = Ember.StateManager.extend(
+/** @scope Ember.Router.prototype */ {
+
+ /**
+ @property {String}
+ @default 'root'
+ */
+ initialState: 'root',
+
+ /**
+ The `Ember.Location` implementation to be used to manage the application
+ URL state. The following values are supported:
+
+ * 'hash': Uses URL fragment identifiers (like #/blog/1) for routing.
+ * 'none': Does not read or set the browser URL, but still allows for
+ routing to happen. Useful for testing.
+
+ @type String
+ @default 'hash'
+ */
+ location: 'hash',
+
+ /**
+ This is only used when a history location is used so that applications that
+ don't live at the root of the domain can append paths to their root.
+
+ @type String
+ @default '/'
+ */
+
+ rootURL: '/',
+
+ /**
+ On router, transitionEvent should be called connectOutlets
+
+ @property {String}
+ @default 'connectOutlets'
+ */
+ transitionEvent: 'connectOutlets',
+
+ transitionTo: function() {
+ this.abortRoutingPromises();
+ this._super.apply(this, arguments);
+ },
+
+ route: function(path) {
+ this.abortRoutingPromises();
+
+ set(this, 'isRouting', true);
+
+ var routableState;
+
+ try {
+ path = path.replace(/^(?=[^\/])/, "/");
+
+ this.send('navigateAway');
+ this.send('unroutePath', path);
+
+ routableState = get(this, 'currentState');
+ while (routableState && !routableState.get('isRoutable')) {
+ routableState = get(routableState, 'parentState');
+ }
+ var currentURL = routableState ? routableState.absoluteRoute(this) : '';
+ var rest = path.substr(currentURL.length);
+
+ this.send('routePath', rest);
+ } finally {
+ set(this, 'isRouting', false);
+ }
+
+ routableState = get(this, 'currentState');
+ while (routableState && !routableState.get('isRoutable')) {
+ routableState = get(routableState, 'parentState');
+ }
+
+ if (routableState) {
+ routableState.updateRoute(this, get(this, 'location'));
+ }
+ },
+
+ urlFor: function(path, hash) {
+ var currentState = get(this, 'currentState') || this,
+ state = this.findStateByPath(currentState, path);
+
+ Ember.assert(Ember.String.fmt("Could not find route with path '%@'", [path]), !!state);
+ Ember.assert("To get a URL for a state, it must have a `route` property.", !!get(state, 'routeMatcher'));
+
+ var location = get(this, 'location'),
+ absoluteRoute = state.absoluteRoute(this, hash);
+
+ return location.formatURL(absoluteRoute);
+ },
+
+ urlForEvent: function(eventName) {
+ var contexts = Array.prototype.slice.call(arguments, 1);
+ var currentState = get(this, 'currentState');
+ var targetStateName = currentState.lookupEventTransition(eventName);
+
+ Ember.assert(Ember.String.fmt("You must specify a target state for event '%@' in order to link to it in the current state '%@'.", [eventName, get(currentState, 'path')]), !!targetStateName);
+
+ var targetState = this.findStateByPath(currentState, targetStateName);
+
+ Ember.assert("Your target state name " + targetStateName + " for event " + eventName + " did not resolve to a state", !!targetState);
+
+ var hash = this.serializeRecursively(targetState, contexts, {});
+
+ return this.urlFor(targetStateName, hash);
+ },
+
+ /** @private */
+ serializeRecursively: function(state, contexts, hash) {
+ var parentState,
+ context = get(state, 'hasContext') ? contexts.pop() : null;
+ merge(hash, state.serialize(this, context));
+ parentState = state.get("parentState");
+ if (parentState && parentState instanceof Ember.Route) {
+ return this.serializeRecursively(parentState, contexts, hash);
+ } else {
+ return hash;
+ }
+ },
+
+ abortRoutingPromises: function() {
+ if (this._routingPromises) {
+ this._routingPromises.abort();
+ this._routingPromises = null;
+ }
+ },
+
+ /**
+ @private
+ */
+ handleStatePromises: function(states, complete) {
+ this.abortRoutingPromises();
+
+ this.set('isLocked', true);
+
+ var manager = this;
+
+ this._routingPromises = Ember._PromiseChain.create({
+ promises: states.slice(),
+
+ successCallback: function() {
+ manager.set('isLocked', false);
+ complete();
+ },
+
+ failureCallback: function() {
+ throw "Unable to load object";
+ },
+
+ promiseSuccessCallback: function(item, args) {
+ set(item, 'object', args[0]);
+ },
+
+ abortCallback: function() {
+ manager.set('isLocked', false);
+ }
+ }).start();
+ },
+
+ /** @private */
+ init: function() {
+ this._super();
+
+ var location = get(this, 'location'),
+ rootURL = get(this, 'rootURL');
+
+ if ('string' === typeof location) {
+ set(this, 'location', Ember.Location.create({
+ implementation: location,
+ rootURL: rootURL
+ }));
+ }
+ },
+
+ /** @private */
+ willDestroy: function() {
+ get(this, 'location').destroy();
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Routing
+// Copyright: ©2012 Tilde Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+(function() {
+var get = Ember.get;
+
+Ember.StateManager.reopen(
+/** @scope Ember.StateManager.prototype */ {
+
+ /**
+ If the current state is a view state or the descendent of a view state,
+ this property will be the view associated with it. If there is no
+ view state active in this state manager, this value will be null.
+
+ @type Ember.View
+ */
+ currentView: Ember.computed(function() {
+ var currentState = get(this, 'currentState'),
+ view;
+
+ while (currentState) {
+ // TODO: Remove this when view state is removed
+ if (get(currentState, 'isViewState')) {
+ view = get(currentState, 'view');
+ if (view) { return view; }
+ }
+
+ currentState = get(currentState, 'parentState');
+ }
+
+ return null;
+ }).property('currentState').cacheable()
+
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+/**
+ @class
+ @deprecated
+
+ Ember.ViewState extends Ember.State to control the presence of a childView within a
+ container based on the current state of the ViewState's StateManager.
+
+ ## Interactions with Ember's View System.
+ When combined with instances of `Ember.StateManager`, ViewState is designed to
+ interact with Ember's view system to control which views are added to
+ and removed from the DOM based on the manager's current state.
+
+ By default, a StateManager will manage views inside the 'body' element. This can be
+ customized by setting the `rootElement` property to a CSS selector of an existing
+ HTML element you would prefer to receive view rendering.
+
+
+ viewStates = Ember.StateManager.create({
+ rootElement: '#some-other-element'
+ })
+
+ You can also specify a particular instance of `Ember.ContainerView` you would like to receive
+ view rendering by setting the `rootView` property. You will be responsible for placing
+ this element into the DOM yourself.
+
+ aLayoutView = Ember.ContainerView.create()
+
+ // make sure this view instance is added to the browser
+ aLayoutView.appendTo('body')
+
+ App.viewStates = Ember.StateManager.create({
+ rootView: aLayoutView
+ })
+
+
+ Once you have an instance of StateManager controlling a view, you can provide states
+ that are instances of `Ember.ViewState`. When the StateManager enters a state
+ that is an instance of `Ember.ViewState` that `ViewState`'s `view` property will be
+ instantiated and inserted into the StateManager's `rootView` or `rootElement`.
+ When a state is exited, the `ViewState`'s view will be removed from the StateManager's
+ view.
+
+ ContactListView = Ember.View.extend({
+ classNames: ['my-contacts-css-class'],
+ template: Ember.Handlebars.compile('<h2>People</h2>')
+ })
+
+ PhotoListView = Ember.View.extend({
+ classNames: ['my-photos-css-class'],
+ template: Ember.Handlebars.compile('<h2>Photos</h2>')
+ })
+
+ viewStates = Ember.StateManager.create({
+ showingPeople: Ember.ViewState.create({
+ view: ContactListView
+ }),
+ showingPhotos: Ember.ViewState.create({
+ view: PhotoListView
+ })
+ })
+
+ viewStates.transitionTo('showingPeople')
+
+ The above code will change the rendered HTML from
+
+ <body></body>
+
+ to
+
+ <body>
+ <div id="ember1" class="ember-view my-contacts-css-class">
+ <h2>People</h2>
+ </div>
+ </body>
+
+ Changing the current state via `transitionTo` from `showingPeople` to
+ `showingPhotos` will remove the `showingPeople` view and add the `showingPhotos` view:
+
+ viewStates.transitionTo('showingPhotos')
+
+ will change the rendered HTML to
+
+ <body>
+ <div id="ember2" class="ember-view my-photos-css-class">
+ <h2>Photos</h2>
+ </div>
+ </body>
+
+
+ When entering nested `ViewState`s, each state's view will be draw into the the StateManager's
+ `rootView` or `rootElement` as siblings.
+
+
+ ContactListView = Ember.View.extend({
+ classNames: ['my-contacts-css-class'],
+ template: Ember.Handlebars.compile('<h2>People</h2>')
+ })
+
+ EditAContactView = Ember.View.extend({
+ classNames: ['editing-a-contact-css-class'],
+ template: Ember.Handlebars.compile('Editing...')
+ })
+
+ viewStates = Ember.StateManager.create({
+ showingPeople: Ember.ViewState.create({
+ view: ContactListView,
+
+ withEditingPanel: Ember.ViewState.create({
+ view: EditAContactView
+ })
+ })
+ })
+
+
+ viewStates.transitionTo('showingPeople.withEditingPanel')
+
+
+ Will result in the following rendered HTML:
+
+ <body>
+ <div id="ember2" class="ember-view my-contacts-css-class">
+ <h2>People</h2>
+ </div>
+
+ <div id="ember2" class="ember-view editing-a-contact-css-class">
+ Editing...
+ </div>
+ </body>
+
+
+ ViewState views are added and removed from their StateManager's view via their
+ `enter` and `exit` methods. If you need to override these methods, be sure to call
+ `_super` to maintain the adding and removing behavior:
+
+ viewStates = Ember.StateManager.create({
+ aState: Ember.ViewState.create({
+ view: Ember.View.extend({}),
+ enter: function(manager){
+ // calling _super ensures this view will be
+ // properly inserted
+ this._super(manager);
+
+ // now you can do other things
+ }
+ })
+ })
+
+ ## Managing Multiple Sections of A Page With States
+ Multiple StateManagers can be combined to control multiple areas of an application's rendered views.
+ Given the following HTML body:
+
+ <body>
+ <div id='sidebar-nav'>
+ </div>
+ <div id='content-area'>
+ </div>
+ </body>
+
+ You could separately manage view state for each section with two StateManagers
+
+ navigationStates = Ember.StateManager.create({
+ rootElement: '#sidebar-nav',
+ userAuthenticated: Em.ViewState.create({
+ view: Ember.View.extend({})
+ }),
+ userNotAuthenticated: Em.ViewState.create({
+ view: Ember.View.extend({})
+ })
+ })
+
+ contentStates = Ember.StateManager.create({
+ rootElement: '#content-area',
+ books: Em.ViewState.create({
+ view: Ember.View.extend({})
+ }),
+ music: Em.ViewState.create({
+ view: Ember.View.extend({})
+ })
+ })
+
+
+ If you prefer to start with an empty body and manage state programmatically you
+ can also take advantage of StateManager's `rootView` property and the ability of
+ `Ember.ContainerView`s to manually manage their child views.
+
+
+ dashboard = Ember.ContainerView.create({
+ childViews: ['navigationAreaView', 'contentAreaView'],
+ navigationAreaView: Ember.ContainerView.create({}),
+ contentAreaView: Ember.ContainerView.create({})
+ })
+
+ navigationStates = Ember.StateManager.create({
+ rootView: dashboard.get('navigationAreaView'),
+ userAuthenticated: Em.ViewState.create({
+ view: Ember.View.extend({})
+ }),
+ userNotAuthenticated: Em.ViewState.create({
+ view: Ember.View.extend({})
+ })
+ })
+
+ contentStates = Ember.StateManager.create({
+ rootView: dashboard.get('contentAreaView'),
+ books: Em.ViewState.create({
+ view: Ember.View.extend({})
+ }),
+ music: Em.ViewState.create({
+ view: Ember.View.extend({})
+ })
+ })
+
+ dashboard.appendTo('body')
+
+ ## User Manipulation of State via `{{action}}` Helpers
+ The Handlebars `{{action}}` helper is StateManager-aware and will use StateManager action sending
+ to connect user interaction to action-based state transitions.
+
+ Given the following body and handlebars template
+
+ <body>
+ <script type='text/x-handlebars'>
+ <a href="#" {{action "anAction" target="App.appStates"}}> Go </a>
+ </script>
+ </body>
+
+ And application code
+
+ App = Ember.Application.create()
+ App.appStates = Ember.StateManager.create({
+ initialState: 'aState',
+ aState: Ember.State.create({
+ anAction: function(manager, context){}
+ }),
+ bState: Ember.State.create({})
+ })
+
+ A user initiated click or touch event on "Go" will trigger the 'anAction' method of
+ `App.appStates.aState` with `App.appStates` as the first argument and a
+ `jQuery.Event` object as the second object. The `jQuery.Event` will include a property
+ `view` that references the `Ember.View` object that was interacted with.
+
+**/
+Ember.ViewState = Ember.State.extend(
+/** @scope Ember.ViewState.prototype */ {
+ isViewState: true,
+
+ init: function() {
+ Ember.deprecate("Ember.ViewState is deprecated and will be removed from future releases. Consider using the outlet pattern to display nested views instead. For more information, see http://emberjs.com/guides/outlets/.");
+ return this._super();
+ },
+
+ enter: function(stateManager) {
+ var view = get(this, 'view'), root, childViews;
+
+ if (view) {
+ if (Ember.View.detect(view)) {
+ view = view.create();
+ set(this, 'view', view);
+ }
+
+ Ember.assert('view must be an Ember.View', view instanceof Ember.View);
+
+ root = stateManager.get('rootView');
+
+ if (root) {
+ childViews = get(root, 'childViews');
+ childViews.pushObject(view);
+ } else {
+ root = stateManager.get('rootElement') || 'body';
+ view.appendTo(root);
+ }
+ }
+ },
+
+ exit: function(stateManager) {
+ var view = get(this, 'view');
+
+ if (view) {
+ // If the view has a parent view, then it is
+ // part of a view hierarchy and should be removed
+ // from its parent.
+ if (get(view, 'parentView')) {
+ view.removeFromParent();
+ } else {
+
+ // Otherwise, the view is a "root view" and
+ // was appended directly to the DOM.
+ view.remove();
+ }
+ }
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Statecharts
+// Copyright: ©2011 Living Social Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+(function() {
+// ==========================================================================
+// Project: metamorph
+// Copyright: ©2011 My Company Inc. All rights reserved.
+// ==========================================================================
+
+(function(window) {
+
+ var K = function(){},
+ guid = 0,
+ document = window.document,
+
+ // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges
+ supportsRange = ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,
+
+ // Internet Explorer prior to 9 does not allow setting innerHTML if the first element
+ // is a "zero-scope" element. This problem can be worked around by making
+ // the first node an invisible text node. We, like Modernizr, use &shy;
+ needsShy = (function(){
+ var testEl = document.createElement('div');
+ testEl.innerHTML = "<div></div>";
+ testEl.firstChild.innerHTML = "<script></script>";
+ return testEl.firstChild.innerHTML === '';
+ })();
+
+ // Constructor that supports either Metamorph('foo') or new
+ // Metamorph('foo');
+ //
+ // Takes a string of HTML as the argument.
+
+ var Metamorph = function(html) {
+ var self;
+
+ if (this instanceof Metamorph) {
+ self = this;
+ } else {
+ self = new K();
+ }
+
+ self.innerHTML = html;
+ var myGuid = 'metamorph-'+(guid++);
+ self.start = myGuid + '-start';
+ self.end = myGuid + '-end';
+
+ return self;
+ };
+
+ K.prototype = Metamorph.prototype;
+
+ var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;
+
+ outerHTMLFunc = function() {
+ return this.startTag() + this.innerHTML + this.endTag();
+ };
+
+ startTagFunc = function() {
+ return "<script id='" + this.start + "' type='text/x-placeholder'></script>";
+ };
+
+ endTagFunc = function() {
+ return "<script id='" + this.end + "' type='text/x-placeholder'></script>";
+ };
+
+ // If we have the W3C range API, this process is relatively straight forward.
+ if (supportsRange) {
+
+ // Get a range for the current morph. Optionally include the starting and
+ // ending placeholders.
+ rangeFor = function(morph, outerToo) {
+ var range = document.createRange();
+ var before = document.getElementById(morph.start);
+ var after = document.getElementById(morph.end);
+
+ if (outerToo) {
+ range.setStartBefore(before);
+ range.setEndAfter(after);
+ } else {
+ range.setStartAfter(before);
+ range.setEndBefore(after);
+ }
+
+ return range;
+ };
+
+ htmlFunc = function(html, outerToo) {
+ // get a range for the current metamorph object
+ var range = rangeFor(this, outerToo);
+
+ // delete the contents of the range, which will be the
+ // nodes between the starting and ending placeholder.
+ range.deleteContents();
+
+ // create a new document fragment for the HTML
+ var fragment = range.createContextualFragment(html);
+
+ // insert the fragment into the range
+ range.insertNode(fragment);
+ };
+
+ removeFunc = function() {
+ // get a range for the current metamorph object including
+ // the starting and ending placeholders.
+ var range = rangeFor(this, true);
+
+ // delete the entire range.
+ range.deleteContents();
+ };
+
+ appendToFunc = function(node) {
+ var range = document.createRange();
+ range.setStart(node);
+ range.collapse(false);
+ var frag = range.createContextualFragment(this.outerHTML());
+ node.appendChild(frag);
+ };
+
+ afterFunc = function(html) {
+ var range = document.createRange();
+ var after = document.getElementById(this.end);
+
+ range.setStartAfter(after);
+ range.setEndAfter(after);
+
+ var fragment = range.createContextualFragment(html);
+ range.insertNode(fragment);
+ };
+
+ prependFunc = function(html) {
+ var range = document.createRange();
+ var start = document.getElementById(this.start);
+
+ range.setStartAfter(start);
+ range.setEndAfter(start);
+
+ var fragment = range.createContextualFragment(html);
+ range.insertNode(fragment);
+ };
+
+ } else {
+ /**
+ * This code is mostly taken from jQuery, with one exception. In jQuery's case, we
+ * have some HTML and we need to figure out how to convert it into some nodes.
+ *
+ * In this case, jQuery needs to scan the HTML looking for an opening tag and use
+ * that as the key for the wrap map. In our case, we know the parent node, and
+ * can use its type as the key for the wrap map.
+ **/
+ var wrapMap = {
+ select: [ 1, "<select multiple='multiple'>", "</select>" ],
+ fieldset: [ 1, "<fieldset>", "</fieldset>" ],
+ table: [ 1, "<table>", "</table>" ],
+ tbody: [ 2, "<table><tbody>", "</tbody></table>" ],
+ tr: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ colgroup: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ map: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ };
+
+ /**
+ * Given a parent node and some HTML, generate a set of nodes. Return the first
+ * node, which will allow us to traverse the rest using nextSibling.
+ *
+ * We need to do this because innerHTML in IE does not really parse the nodes.
+ **/
+ var firstNodeFor = function(parentNode, html) {
+ var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;
+ var depth = arr[0], start = arr[1], end = arr[2];
+
+ if (needsShy) { html = '&shy;'+html; }
+
+ var element = document.createElement('div');
+ element.innerHTML = start + html + end;
+
+ for (var i=0; i<=depth; i++) {
+ element = element.firstChild;
+ }
+
+ // Look for &shy; to remove it.
+ if (needsShy) {
+ var shyElement = element;
+
+ // Sometimes we get nameless elements with the shy inside
+ while (shyElement.nodeType === 1 && !shyElement.nodeName) {
+ shyElement = shyElement.firstChild;
+ }
+
+ // At this point it's the actual unicode character.
+ if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === "\u00AD") {
+ shyElement.nodeValue = shyElement.nodeValue.slice(1);
+ }
+ }
+
+ return element;
+ };
+
+ /**
+ * In some cases, Internet Explorer can create an anonymous node in
+ * the hierarchy with no tagName. You can create this scenario via:
+ *
+ * div = document.createElement("div");
+ * div.innerHTML = "<table>&shy<script></script><tr><td>hi</td></tr></table>";
+ * div.firstChild.firstChild.tagName //=> ""
+ *
+ * If our script markers are inside such a node, we need to find that
+ * node and use *it* as the marker.
+ **/
+ var realNode = function(start) {
+ while (start.parentNode.tagName === "") {
+ start = start.parentNode;
+ }
+
+ return start;
+ };
+
+ /**
+ * When automatically adding a tbody, Internet Explorer inserts the
+ * tbody immediately before the first <tr>. Other browsers create it
+ * before the first node, no matter what.
+ *
+ * This means the the following code:
+ *
+ * div = document.createElement("div");
+ * div.innerHTML = "<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>
+ *
+ * Generates the following DOM in IE:
+ *
+ * + div
+ * + table
+ * - script id='first'
+ * + tbody
+ * + tr
+ * + td
+ * - "hi"
+ * - script id='last'
+ *
+ * Which means that the two script tags, even though they were
+ * inserted at the same point in the hierarchy in the original
+ * HTML, now have different parents.
+ *
+ * This code reparents the first script tag by making it the tbody's
+ * first child.
+ **/
+ var fixParentage = function(start, end) {
+ if (start.parentNode !== end.parentNode) {
+ end.parentNode.insertBefore(start, end.parentNode.firstChild);
+ }
+ };
+
+ htmlFunc = function(html, outerToo) {
+ // get the real starting node. see realNode for details.
+ var start = realNode(document.getElementById(this.start));
+ var end = document.getElementById(this.end);
+ var parentNode = end.parentNode;
+ var node, nextSibling, last;
+
+ // make sure that the start and end nodes share the same
+ // parent. If not, fix it.
+ fixParentage(start, end);
+
+ // remove all of the nodes after the starting placeholder and
+ // before the ending placeholder.
+ node = start.nextSibling;
+ while (node) {
+ nextSibling = node.nextSibling;
+ last = node === end;
+
+ // if this is the last node, and we want to remove it as well,
+ // set the `end` node to the next sibling. This is because
+ // for the rest of the function, we insert the new nodes
+ // before the end (note that insertBefore(node, null) is
+ // the same as appendChild(node)).
+ //
+ // if we do not want to remove it, just break.
+ if (last) {
+ if (outerToo) { end = node.nextSibling; } else { break; }
+ }
+
+ node.parentNode.removeChild(node);
+
+ // if this is the last node and we didn't break before
+ // (because we wanted to remove the outer nodes), break
+ // now.
+ if (last) { break; }
+
+ node = nextSibling;
+ }
+
+ // get the first node for the HTML string, even in cases like
+ // tables and lists where a simple innerHTML on a div would
+ // swallow some of the content.
+ node = firstNodeFor(start.parentNode, html);
+
+ // copy the nodes for the HTML between the starting and ending
+ // placeholder.
+ while (node) {
+ nextSibling = node.nextSibling;
+ parentNode.insertBefore(node, end);
+ node = nextSibling;
+ }
+ };
+
+ // remove the nodes in the DOM representing this metamorph.
+ //
+ // this includes the starting and ending placeholders.
+ removeFunc = function() {
+ var start = realNode(document.getElementById(this.start));
+ var end = document.getElementById(this.end);
+
+ this.html('');
+ start.parentNode.removeChild(start);
+ end.parentNode.removeChild(end);
+ };
+
+ appendToFunc = function(parentNode) {
+ var node = firstNodeFor(parentNode, this.outerHTML());
+
+ while (node) {
+ nextSibling = node.nextSibling;
+ parentNode.appendChild(node);
+ node = nextSibling;
+ }
+ };
+
+ afterFunc = function(html) {
+ // get the real starting node. see realNode for details.
+ var end = document.getElementById(this.end);
+ var insertBefore = end.nextSibling;
+ var parentNode = end.parentNode;
+ var nextSibling;
+ var node;
+
+ // get the first node for the HTML string, even in cases like
+ // tables and lists where a simple innerHTML on a div would
+ // swallow some of the content.
+ node = firstNodeFor(parentNode, html);
+
+ // copy the nodes for the HTML between the starting and ending
+ // placeholder.
+ while (node) {
+ nextSibling = node.nextSibling;
+ parentNode.insertBefore(node, insertBefore);
+ node = nextSibling;
+ }
+ };
+
+ prependFunc = function(html) {
+ var start = document.getElementById(this.start);
+ var parentNode = start.parentNode;
+ var nextSibling;
+ var node;
+
+ node = firstNodeFor(parentNode, html);
+ var insertBefore = start.nextSibling;
+
+ while (node) {
+ nextSibling = node.nextSibling;
+ parentNode.insertBefore(node, insertBefore);
+ node = nextSibling;
+ }
+ }
+ }
+
+ Metamorph.prototype.html = function(html) {
+ this.checkRemoved();
+ if (html === undefined) { return this.innerHTML; }
+
+ htmlFunc.call(this, html);
+
+ this.innerHTML = html;
+ };
+
+ Metamorph.prototype.replaceWith = function(html) {
+ this.checkRemoved();
+ htmlFunc.call(this, html, true);
+ };
+
+ Metamorph.prototype.remove = removeFunc;
+ Metamorph.prototype.outerHTML = outerHTMLFunc;
+ Metamorph.prototype.appendTo = appendToFunc;
+ Metamorph.prototype.after = afterFunc;
+ Metamorph.prototype.prepend = prependFunc;
+ Metamorph.prototype.startTag = startTagFunc;
+ Metamorph.prototype.endTag = endTagFunc;
+
+ Metamorph.prototype.isRemoved = function() {
+ var before = document.getElementById(this.start);
+ var after = document.getElementById(this.end);
+
+ return !before || !after;
+ };
+
+ Metamorph.prototype.checkRemoved = function() {
+ if (this.isRemoved()) {
+ throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.");
+ }
+ };
+
+ window.Metamorph = Metamorph;
+})(this);
+
+
+})();
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Handlebars */
+var objectCreate = Ember.create;
+
+/**
+ @namespace
+ @name Handlebars
+ @private
+*/
+
+/**
+ @namespace
+ @name Handlebars.helpers
+ @description Helpers for Handlebars templates
+*/
+
+Ember.assert("Ember Handlebars requires Handlebars 1.0.beta.5 or greater", window.Handlebars && window.Handlebars.VERSION.match(/^1\.0\.beta\.[56789]$|^1\.0\.rc\.[123456789]+/));
+
+/**
+ @class
+
+ Prepares the Handlebars templating library for use inside Ember's view
+ system.
+
+ The Ember.Handlebars object is the standard Handlebars library, extended to use
+ Ember's get() method instead of direct property access, which allows
+ computed properties to be used inside templates.
+
+ To create an Ember.Handlebars template, call Ember.Handlebars.compile(). This will
+ return a function that can be used by Ember.View for rendering.
+*/
+Ember.Handlebars = objectCreate(Handlebars);
+
+Ember.Handlebars.helpers = objectCreate(Handlebars.helpers);
+
+/**
+ Override the the opcode compiler and JavaScript compiler for Handlebars.
+ @private
+*/
+Ember.Handlebars.Compiler = function() {};
+Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);
+Ember.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;
+
+/** @private */
+Ember.Handlebars.JavaScriptCompiler = function() {};
+Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);
+Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;
+Ember.Handlebars.JavaScriptCompiler.prototype.namespace = "Ember.Handlebars";
+
+
+Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {
+ return "''";
+};
+
+/**
+ Override the default buffer for Ember Handlebars. By default, Handlebars creates
+ an empty String at the beginning of each invocation and appends to it. Ember's
+ Handlebars overrides this to append to a single shared buffer.
+
+ @private
+*/
+Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {
+ return "data.buffer.push("+string+");";
+};
+
+/**
+ Rewrite simple mustaches from {{foo}} to {{bind "foo"}}. This means that all simple
+ mustaches in Ember's Handlebars will also set up an observer to keep the DOM
+ up to date when the underlying property changes.
+
+ @private
+*/
+Ember.Handlebars.Compiler.prototype.mustache = function(mustache) {
+ if (mustache.params.length || mustache.hash) {
+ return Handlebars.Compiler.prototype.mustache.call(this, mustache);
+ } else {
+ var id = new Handlebars.AST.IdNode(['_triageMustache']);
+
+ // Update the mustache node to include a hash value indicating whether the original node
+ // was escaped. This will allow us to properly escape values when the underlying value
+ // changes and we need to re-render the value.
+ if(!mustache.escaped) {
+ mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);
+ mustache.hash.pairs.push(["unescaped", new Handlebars.AST.StringNode("true")]);
+ }
+ mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);
+ return Handlebars.Compiler.prototype.mustache.call(this, mustache);
+ }
+};
+
+/**
+ Used for precompilation of Ember Handlebars templates. This will not be used during normal
+ app execution.
+
+ @param {String} string The template to precompile
+*/
+Ember.Handlebars.precompile = function(string) {
+ var ast = Handlebars.parse(string);
+
+ var options = {
+ knownHelpers: {
+ action: true,
+ unbound: true,
+ bindAttr: true,
+ template: true,
+ view: true,
+ _triageMustache: true
+ },
+ data: true,
+ stringParams: true
+ };
+
+ var environment = new Ember.Handlebars.Compiler().compile(ast, options);
+ return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
+};
+
+/**
+ The entry point for Ember Handlebars. This replaces the default Handlebars.compile and turns on
+ template-local data and String parameters.
+
+ @param {String} string The template to compile
+*/
+Ember.Handlebars.compile = function(string) {
+ var ast = Handlebars.parse(string);
+ var options = { data: true, stringParams: true };
+ var environment = new Ember.Handlebars.Compiler().compile(ast, options);
+ var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
+
+ return Handlebars.template(templateSpec);
+};
+
+/**
+ If a path starts with a reserved keyword, returns the root
+ that should be used.
+
+ @private
+*/
+var normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {
+ var keywords = (data && data.keywords) || {},
+ keyword, isKeyword;
+
+ // Get the first segment of the path. For example, if the
+ // path is "foo.bar.baz", returns "foo".
+ keyword = path.split('.', 1)[0];
+
+ // Test to see if the first path is a keyword that has been
+ // passed along in the view's data hash. If so, we will treat
+ // that object as the new root.
+ if (keywords.hasOwnProperty(keyword)) {
+ // Look up the value in the template's data hash.
+ root = keywords[keyword];
+ isKeyword = true;
+
+ // Handle cases where the entire path is the reserved
+ // word. In that case, return the object itself.
+ if (path === keyword) {
+ path = '';
+ } else {
+ // Strip the keyword from the path and look up
+ // the remainder from the newly found root.
+ path = path.substr(keyword.length+1);
+ }
+ }
+
+ return { root: root, path: path, isKeyword: isKeyword };
+};
+/**
+ Lookup both on root and on window. If the path starts with
+ a keyword, the corresponding object will be looked up in the
+ template's data hash and used to resolve the path.
+
+ @param {Object} root The object to look up the property on
+ @param {String} path The path to be lookedup
+ @param {Object} options The template's option hash
+*/
+
+Ember.Handlebars.getPath = function(root, path, options) {
+ var data = options && options.data,
+ normalizedPath = normalizePath(root, path, data),
+ value;
+
+ // In cases where the path begins with a keyword, change the
+ // root to the value represented by that keyword, and ensure
+ // the path is relative to it.
+ root = normalizedPath.root;
+ path = normalizedPath.path;
+
+ value = Ember.get(root, path);
+
+ if (value === undefined && root !== window && Ember.isGlobalPath(path)) {
+ value = Ember.get(window, path);
+ }
+ return value;
+};
+
+/**
+ Registers a helper in Handlebars that will be called if no property with the
+ given name can be found on the current context object, and no helper with
+ that name is registered.
+
+ This throws an exception with a more helpful error message so the user can
+ track down where the problem is happening.
+
+ @name Handlebars.helpers.helperMissing
+ @param {String} path
+ @param {Hash} options
+*/
+Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
+ var error, view = "";
+
+ error = "%@ Handlebars error: Could not find property '%@' on object %@.";
+ if (options.data){
+ view = options.data.view;
+ }
+ throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));
+});
+
+
+})();
+
+
+
+(function() {
+
+Ember.String.htmlSafe = function(str) {
+ return new Handlebars.SafeString(str);
+};
+
+var htmlSafe = Ember.String.htmlSafe;
+
+if (Ember.EXTEND_PROTOTYPES) {
+
+ /**
+ @see Ember.String.htmlSafe
+ */
+ String.prototype.htmlSafe = function() {
+ return htmlSafe(this);
+ };
+
+}
+
+})();
+
+
+
+(function() {
+/*jshint newcap:false*/
+var set = Ember.set, get = Ember.get;
+
+var DOMManager = {
+ remove: function(view) {
+ var morph = view.morph;
+ if (morph.isRemoved()) { return; }
+ set(view, 'element', null);
+ view._lastInsert = null;
+ morph.remove();
+ },
+
+ prepend: function(view, childView) {
+ childView._insertElementLater(function() {
+ var morph = view.morph;
+ morph.prepend(childView.outerHTML);
+ childView.outerHTML = null;
+ });
+ },
+
+ after: function(view, nextView) {
+ nextView._insertElementLater(function() {
+ var morph = view.morph;
+ morph.after(nextView.outerHTML);
+ nextView.outerHTML = null;
+ });
+ },
+
+ replace: function(view) {
+ var morph = view.morph;
+
+ view.transitionTo('preRender');
+ view.clearRenderedChildren();
+ var buffer = view.renderToBuffer();
+
+ Ember.run.schedule('render', this, function() {
+ if (get(view, 'isDestroyed')) { return; }
+ view.invalidateRecursively('element');
+ view._notifyWillInsertElement();
+ morph.replaceWith(buffer.string());
+ view.transitionTo('inDOM');
+ view._notifyDidInsertElement();
+ });
+ },
+
+ empty: function(view) {
+ view.morph.html("");
+ }
+};
+
+// The `morph` and `outerHTML` properties are internal only
+// and not observable.
+
+Ember._Metamorph = Ember.Mixin.create({
+ isVirtual: true,
+ tagName: '',
+
+ init: function() {
+ this._super();
+ this.morph = Metamorph();
+ },
+
+ beforeRender: function(buffer) {
+ buffer.push(this.morph.startTag());
+ },
+
+ afterRender: function(buffer) {
+ buffer.push(this.morph.endTag());
+ },
+
+ createElement: function() {
+ var buffer = this.renderToBuffer();
+ this.outerHTML = buffer.string();
+ this.clearBuffer();
+ },
+
+ domManager: DOMManager
+});
+
+Ember._MetamorphView = Ember.View.extend(Ember._Metamorph);
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Handlebars */
+
+var get = Ember.get, set = Ember.set, getPath = Ember.Handlebars.getPath;
+/**
+ @ignore
+ @private
+ @class
+
+ Ember._HandlebarsBoundView is a private view created by the Handlebars `{{bind}}`
+ helpers that is used to keep track of bound properties.
+
+ Every time a property is bound using a `{{mustache}}`, an anonymous subclass
+ of Ember._HandlebarsBoundView is created with the appropriate sub-template and
+ context set up. When the associated property changes, just the template for
+ this view will re-render.
+*/
+Ember._HandlebarsBoundView = Ember._MetamorphView.extend({
+/** @scope Ember._HandlebarsBoundView.prototype */
+
+ /**
+ The function used to determine if the `displayTemplate` or
+ `inverseTemplate` should be rendered. This should be a function that takes
+ a value and returns a Boolean.
+
+ @type Function
+ @default null
+ */
+ shouldDisplayFunc: null,
+
+ /**
+ Whether the template rendered by this view gets passed the context object
+ of its parent template, or gets passed the value of retrieving `path`
+ from the `pathRoot`.
+
+ For example, this is true when using the `{{#if}}` helper, because the
+ template inside the helper should look up properties relative to the same
+ object as outside the block. This would be false when used with `{{#with
+ foo}}` because the template should receive the object found by evaluating
+ `foo`.
+
+ @type Boolean
+ @default false
+ */
+ preserveContext: false,
+
+ /**
+ If `preserveContext` is true, this is the object that will be used
+ to render the template.
+
+ @type Object
+ */
+ previousContext: null,
+
+ /**
+ The template to render when `shouldDisplayFunc` evaluates to true.
+
+ @type Function
+ @default null
+ */
+ displayTemplate: null,
+
+ /**
+ The template to render when `shouldDisplayFunc` evaluates to false.
+
+ @type Function
+ @default null
+ */
+ inverseTemplate: null,
+
+
+ /**
+ The path to look up on `pathRoot` that is passed to
+ `shouldDisplayFunc` to determine which template to render.
+
+ In addition, if `preserveContext` is false, the object at this path will
+ be passed to the template when rendering.
+
+ @type String
+ @default null
+ */
+ path: null,
+
+ /**
+ The object from which the `path` will be looked up. Sometimes this is the
+ same as the `previousContext`, but in cases where this view has been generated
+ for paths that start with a keyword such as `view` or `controller`, the
+ path root will be that resolved object.
+
+ @type Object
+ */
+ pathRoot: null,
+
+ normalizedValue: Ember.computed(function() {
+ var path = get(this, 'path'),
+ pathRoot = get(this, 'pathRoot'),
+ valueNormalizer = get(this, 'valueNormalizerFunc'),
+ result, templateData;
+
+ // Use the pathRoot as the result if no path is provided. This
+ // happens if the path is `this`, which gets normalized into
+ // a `pathRoot` of the current Handlebars context and a path
+ // of `''`.
+ if (path === '') {
+ result = pathRoot;
+ } else {
+ templateData = get(this, 'templateData');
+ result = getPath(pathRoot, path, { data: templateData });
+ }
+
+ return valueNormalizer ? valueNormalizer(result) : result;
+ }).property('path', 'pathRoot', 'valueNormalizerFunc').volatile(),
+
+ rerenderIfNeeded: function() {
+ if (!get(this, 'isDestroyed') && get(this, 'normalizedValue') !== this._lastNormalizedValue) {
+ this.rerender();
+ }
+ },
+
+ /**
+ Determines which template to invoke, sets up the correct state based on
+ that logic, then invokes the default Ember.View `render` implementation.
+
+ This method will first look up the `path` key on `pathRoot`,
+ then pass that value to the `shouldDisplayFunc` function. If that returns
+ true, the `displayTemplate` function will be rendered to DOM. Otherwise,
+ `inverseTemplate`, if specified, will be rendered.
+
+ For example, if this Ember._HandlebarsBoundView represented the {{#with foo}}
+ helper, it would look up the `foo` property of its context, and
+ `shouldDisplayFunc` would always return true. The object found by looking
+ up `foo` would be passed to `displayTemplate`.
+
+ @param {Ember.RenderBuffer} buffer
+ */
+ render: function(buffer) {
+ // If not invoked via a triple-mustache ({{{foo}}}), escape
+ // the content of the template.
+ var escape = get(this, 'isEscaped');
+
+ var shouldDisplay = get(this, 'shouldDisplayFunc'),
+ preserveContext = get(this, 'preserveContext'),
+ context = get(this, 'previousContext');
+
+ var inverseTemplate = get(this, 'inverseTemplate'),
+ displayTemplate = get(this, 'displayTemplate');
+
+ var result = get(this, 'normalizedValue');
+ this._lastNormalizedValue = result;
+
+ // First, test the conditional to see if we should
+ // render the template or not.
+ if (shouldDisplay(result)) {
+ set(this, 'template', displayTemplate);
+
+ // If we are preserving the context (for example, if this
+ // is an #if block, call the template with the same object.
+ if (preserveContext) {
+ set(this, '_context', context);
+ } else {
+ // Otherwise, determine if this is a block bind or not.
+ // If so, pass the specified object to the template
+ if (displayTemplate) {
+ set(this, '_context', result);
+ } else {
+ // This is not a bind block, just push the result of the
+ // expression to the render context and return.
+ if (result === null || result === undefined) {
+ result = "";
+ } else if (!(result instanceof Handlebars.SafeString)) {
+ result = String(result);
+ }
+
+ if (escape) { result = Handlebars.Utils.escapeExpression(result); }
+ buffer.push(result);
+ return;
+ }
+ }
+ } else if (inverseTemplate) {
+ set(this, 'template', inverseTemplate);
+
+ if (preserveContext) {
+ set(this, '_context', context);
+ } else {
+ set(this, '_context', result);
+ }
+ } else {
+ set(this, 'template', function() { return ''; });
+ }
+
+ return this._super(buffer);
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
+var getPath = Ember.Handlebars.getPath, normalizePath = Ember.Handlebars.normalizePath;
+var forEach = Ember.ArrayPolyfills.forEach;
+
+var EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;
+
+// Binds a property into the DOM. This will create a hook in DOM that the
+// KVO system will look for and update if the property changes.
+/** @private */
+function bind(property, options, preserveContext, shouldDisplay, valueNormalizer) {
+ var data = options.data,
+ fn = options.fn,
+ inverse = options.inverse,
+ view = data.view,
+ currentContext = this,
+ pathRoot, path, normalized;
+
+ normalized = normalizePath(currentContext, property, data);
+
+ pathRoot = normalized.root;
+ path = normalized.path;
+
+ // Set up observers for observable objects
+ if ('object' === typeof this) {
+ // Create the view that will wrap the output of this template/property
+ // and add it to the nearest view's childViews array.
+ // See the documentation of Ember._HandlebarsBoundView for more.
+ var bindView = view.createChildView(Ember._HandlebarsBoundView, {
+ preserveContext: preserveContext,
+ shouldDisplayFunc: shouldDisplay,
+ valueNormalizerFunc: valueNormalizer,
+ displayTemplate: fn,
+ inverseTemplate: inverse,
+ path: path,
+ pathRoot: pathRoot,
+ previousContext: currentContext,
+ isEscaped: !options.hash.unescaped,
+ templateData: options.data
+ });
+
+ view.appendChild(bindView);
+
+ /** @private */
+ var observer = function() {
+ Ember.run.once(bindView, 'rerenderIfNeeded');
+ };
+
+ // Observes the given property on the context and
+ // tells the Ember._HandlebarsBoundView to re-render. If property
+ // is an empty string, we are printing the current context
+ // object ({{this}}) so updating it is not our responsibility.
+ if (path !== '') {
+ Ember.addObserver(pathRoot, path, observer);
+ }
+ } else {
+ // The object is not observable, so just render it out and
+ // be done with it.
+ data.buffer.push(getPath(pathRoot, path, options));
+ }
+}
+
+/**
+ '_triageMustache' is used internally select between a binding and helper for
+ the given context. Until this point, it would be hard to determine if the
+ mustache is a property reference or a regular helper reference. This triage
+ helper resolves that.
+
+ This would not be typically invoked by directly.
+
+ @private
+ @name Handlebars.helpers._triageMustache
+ @param {String} property Property/helperID to triage
+ @param {Function} fn Context to provide for rendering
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('_triageMustache', function(property, fn) {
+ Ember.assert("You cannot pass more than one argument to the _triageMustache helper", arguments.length <= 2);
+ if (helpers[property]) {
+ return helpers[property].call(this, fn);
+ }
+ else {
+ return helpers.bind.apply(this, arguments);
+ }
+});
+
+/**
+ `bind` can be used to display a value, then update that value if it
+ changes. For example, if you wanted to print the `title` property of
+ `content`:
+
+ {{bind "content.title"}}
+
+ This will return the `title` property as a string, then create a new
+ observer at the specified path. If it changes, it will update the value in
+ DOM. Note that if you need to support IE7 and IE8 you must modify the
+ model objects properties using Ember.get() and Ember.set() for this to work as
+ it relies on Ember's KVO system. For all other browsers this will be handled
+ for you automatically.
+
+ @private
+ @name Handlebars.helpers.bind
+ @param {String} property Property to bind
+ @param {Function} fn Context to provide for rendering
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('bind', function(property, fn) {
+ Ember.assert("You cannot pass more than one argument to the bind helper", arguments.length <= 2);
+
+ var context = (fn.contexts && fn.contexts[0]) || this;
+
+ return bind.call(context, property, fn, false, function(result) {
+ return !Ember.none(result);
+ });
+});
+
+/**
+ Use the `boundIf` helper to create a conditional that re-evaluates
+ whenever the bound value changes.
+
+ {{#boundIf "content.shouldDisplayTitle"}}
+ {{content.title}}
+ {{/boundIf}}
+
+ @private
+ @name Handlebars.helpers.boundIf
+ @param {String} property Property to bind
+ @param {Function} fn Context to provide for rendering
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('boundIf', function(property, fn) {
+ var context = (fn.contexts && fn.contexts[0]) || this;
+ var func = function(result) {
+ if (Ember.typeOf(result) === 'array') {
+ return get(result, 'length') !== 0;
+ } else {
+ return !!result;
+ }
+ };
+
+ return bind.call(context, property, fn, true, func, func);
+});
+
+/**
+ @name Handlebars.helpers.with
+ @param {Function} context
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('with', function(context, options) {
+ if (arguments.length === 4) {
+ var keywordName, path, rootPath, normalized;
+
+ Ember.assert("If you pass more than one argument to the with helper, it must be in the form #with foo as bar", arguments[1] === "as");
+ options = arguments[3];
+ keywordName = arguments[2];
+ path = arguments[0];
+
+ Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
+
+ if (Ember.isGlobalPath(path)) {
+ Ember.bind(options.data.keywords, keywordName, path);
+ } else {
+ normalized = normalizePath(this, path, options.data);
+ path = normalized.path;
+ rootPath = normalized.root;
+
+ // This is a workaround for the fact that you cannot bind separate objects
+ // together. When we implement that functionality, we should use it here.
+ var contextKey = Ember.$.expando + Ember.guidFor(rootPath);
+ options.data.keywords[contextKey] = rootPath;
+
+ // if the path is '' ("this"), just bind directly to the current context
+ var contextPath = path ? contextKey + '.' + path : contextKey;
+ Ember.bind(options.data.keywords, keywordName, contextPath);
+ }
+
+ return bind.call(this, path, options.fn, true, function(result) {
+ return !Ember.none(result);
+ });
+ } else {
+ Ember.assert("You must pass exactly one argument to the with helper", arguments.length === 2);
+ Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
+ return helpers.bind.call(options.contexts[0], context, options);
+ }
+});
+
+
+/**
+ @name Handlebars.helpers.if
+ @param {Function} context
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('if', function(context, options) {
+ Ember.assert("You must pass exactly one argument to the if helper", arguments.length === 2);
+ Ember.assert("You must pass a block to the if helper", options.fn && options.fn !== Handlebars.VM.noop);
+
+ return helpers.boundIf.call(options.contexts[0], context, options);
+});
+
+/**
+ @name Handlebars.helpers.unless
+ @param {Function} context
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('unless', function(context, options) {
+ Ember.assert("You must pass exactly one argument to the unless helper", arguments.length === 2);
+ Ember.assert("You must pass a block to the unless helper", options.fn && options.fn !== Handlebars.VM.noop);
+
+ var fn = options.fn, inverse = options.inverse;
+
+ options.fn = inverse;
+ options.inverse = fn;
+
+ return helpers.boundIf.call(options.contexts[0], context, options);
+});
+
+/**
+ `bindAttr` allows you to create a binding between DOM element attributes and
+ Ember objects. For example:
+
+ <img {{bindAttr src="imageUrl" alt="imageTitle"}}>
+
+ @name Handlebars.helpers.bindAttr
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('bindAttr', function(options) {
+
+ var attrs = options.hash;
+
+ Ember.assert("You must specify at least one hash argument to bindAttr", !!Ember.keys(attrs).length);
+
+ var view = options.data.view;
+ var ret = [];
+ var ctx = this;
+
+ // Generate a unique id for this element. This will be added as a
+ // data attribute to the element so it can be looked up when
+ // the bound property changes.
+ var dataId = ++Ember.$.uuid;
+
+ // Handle classes differently, as we can bind multiple classes
+ var classBindings = attrs['class'];
+ if (classBindings !== null && classBindings !== undefined) {
+ var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);
+ ret.push('class="' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '"');
+ delete attrs['class'];
+ }
+
+ var attrKeys = Ember.keys(attrs);
+
+ // For each attribute passed, create an observer and emit the
+ // current value of the property as an attribute.
+ forEach.call(attrKeys, function(attr) {
+ var path = attrs[attr],
+ pathRoot, normalized;
+
+ Ember.assert(fmt("You must provide a String for a bound attribute, not %@", [path]), typeof path === 'string');
+
+ normalized = normalizePath(ctx, path, options.data);
+
+ pathRoot = normalized.root;
+ path = normalized.path;
+
+ var value = (path === 'this') ? pathRoot : getPath(pathRoot, path, options),
+ type = Ember.typeOf(value);
+
+ Ember.assert(fmt("Attributes must be numbers, strings or booleans, not %@", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');
+
+ var observer, invoker;
+
+ /** @private */
+ observer = function observer() {
+ var result = getPath(pathRoot, path, options);
+
+ Ember.assert(fmt("Attributes must be numbers, strings or booleans, not %@", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');
+
+ var elem = view.$("[data-bindattr-" + dataId + "='" + dataId + "']");
+
+ // If we aren't able to find the element, it means the element
+ // to which we were bound has been removed from the view.
+ // In that case, we can assume the template has been re-rendered
+ // and we need to clean up the observer.
+ if (elem.length === 0) {
+ Ember.removeObserver(pathRoot, path, invoker);
+ return;
+ }
+
+ Ember.View.applyAttributeBindings(elem, attr, result);
+ };
+
+ /** @private */
+ invoker = function() {
+ Ember.run.once(observer);
+ };
+
+ // Add an observer to the view for when the property changes.
+ // When the observer fires, find the element using the
+ // unique data id and update the attribute to the new value.
+ if (path !== 'this') {
+ Ember.addObserver(pathRoot, path, invoker);
+ }
+
+ // if this changes, also change the logic in ember-views/lib/views/view.js
+ if ((type === 'string' || (type === 'number' && !isNaN(value)))) {
+ ret.push(attr + '="' + Handlebars.Utils.escapeExpression(value) + '"');
+ } else if (value && type === 'boolean') {
+ // The developer controls the attr name, so it should always be safe
+ ret.push(attr + '="' + attr + '"');
+ }
+ }, this);
+
+ // Add the unique identifier
+ // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG
+ ret.push('data-bindattr-' + dataId + '="' + dataId + '"');
+ return new EmberHandlebars.SafeString(ret.join(' '));
+});
+
+/**
+ Helper that, given a space-separated string of property paths and a context,
+ returns an array of class names. Calling this method also has the side
+ effect of setting up observers at those property paths, such that if they
+ change, the correct class name will be reapplied to the DOM element.
+
+ For example, if you pass the string "fooBar", it will first look up the
+ "fooBar" value of the context. If that value is true, it will add the
+ "foo-bar" class to the current element (i.e., the dasherized form of
+ "fooBar"). If the value is a string, it will add that string as the class.
+ Otherwise, it will not add any new class name.
+
+ @param {Ember.Object} context
+ The context from which to lookup properties
+
+ @param {String} classBindings
+ A string, space-separated, of class bindings to use
+
+ @param {Ember.View} view
+ The view in which observers should look for the element to update
+
+ @param {Srting} bindAttrId
+ Optional bindAttr id used to lookup elements
+
+ @returns {Array} An array of class names to add
+*/
+EmberHandlebars.bindClasses = function(context, classBindings, view, bindAttrId, options) {
+ var ret = [], newClass, value, elem;
+
+ // Helper method to retrieve the property from the context and
+ // determine which class string to return, based on whether it is
+ // a Boolean or not.
+ var classStringForPath = function(root, parsedPath, options) {
+ var val,
+ path = parsedPath.path;
+
+ if (path === 'this') {
+ val = root;
+ } else if (path === '') {
+ val = true;
+ } else {
+ val = getPath(root, path, options);
+ }
+
+ return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);
+ };
+
+ // For each property passed, loop through and setup
+ // an observer.
+ forEach.call(classBindings.split(' '), function(binding) {
+
+ // Variable in which the old class value is saved. The observer function
+ // closes over this variable, so it knows which string to remove when
+ // the property changes.
+ var oldClass;
+
+ var observer, invoker;
+
+ var parsedPath = Ember.View._parsePropertyPath(binding),
+ path = parsedPath.path,
+ pathRoot = context,
+ normalized;
+
+ if (path !== '' && path !== 'this') {
+ normalized = normalizePath(context, path, options.data);
+
+ pathRoot = normalized.root;
+ path = normalized.path;
+ }
+
+ // Set up an observer on the context. If the property changes, toggle the
+ // class name.
+ /** @private */
+ observer = function() {
+ // Get the current value of the property
+ newClass = classStringForPath(pathRoot, parsedPath, options);
+ elem = bindAttrId ? view.$("[data-bindattr-" + bindAttrId + "='" + bindAttrId + "']") : view.$();
+
+ // If we can't find the element anymore, a parent template has been
+ // re-rendered and we've been nuked. Remove the observer.
+ if (elem.length === 0) {
+ Ember.removeObserver(pathRoot, path, invoker);
+ } else {
+ // If we had previously added a class to the element, remove it.
+ if (oldClass) {
+ elem.removeClass(oldClass);
+ }
+
+ // If necessary, add a new class. Make sure we keep track of it so
+ // it can be removed in the future.
+ if (newClass) {
+ elem.addClass(newClass);
+ oldClass = newClass;
+ } else {
+ oldClass = null;
+ }
+ }
+ };
+
+ /** @private */
+ invoker = function() {
+ Ember.run.once(observer);
+ };
+
+ if (path !== '' && path !== 'this') {
+ Ember.addObserver(pathRoot, path, invoker);
+ }
+
+ // We've already setup the observer; now we just need to figure out the
+ // correct behavior right now on the first pass through.
+ value = classStringForPath(pathRoot, parsedPath, options);
+
+ if (value) {
+ ret.push(value);
+
+ // Make sure we save the current value so that it can be removed if the
+ // observer fires.
+ oldClass = value;
+ }
+ });
+
+ return ret;
+};
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Handlebars */
+
+// TODO: Don't require the entire module
+var get = Ember.get, set = Ember.set;
+var PARENT_VIEW_PATH = /^parentView\./;
+var EmberHandlebars = Ember.Handlebars;
+var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
+
+/** @private */
+EmberHandlebars.ViewHelper = Ember.Object.create({
+
+ propertiesFromHTMLOptions: function(options, thisContext) {
+ var hash = options.hash, data = options.data;
+ var extensions = {},
+ classes = hash['class'],
+ dup = false;
+
+ if (hash.id) {
+ extensions.elementId = hash.id;
+ dup = true;
+ }
+
+ if (classes) {
+ classes = classes.split(' ');
+ extensions.classNames = classes;
+ dup = true;
+ }
+
+ if (hash.classBinding) {
+ extensions.classNameBindings = hash.classBinding.split(' ');
+ dup = true;
+ }
+
+ if (hash.classNameBindings) {
+ if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];
+ extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));
+ dup = true;
+ }
+
+ if (hash.attributeBindings) {
+ Ember.assert("Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.");
+ extensions.attributeBindings = null;
+ dup = true;
+ }
+
+ if (dup) {
+ hash = Ember.$.extend({}, hash);
+ delete hash.id;
+ delete hash['class'];
+ delete hash.classBinding;
+ }
+
+ // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings
+ // as well as class name bindings. If the bindings are local, make them relative to the current context
+ // instead of the view.
+ var path;
+
+ // Evaluate the context of regular attribute bindings:
+ for (var prop in hash) {
+ if (!hash.hasOwnProperty(prop)) { continue; }
+
+ // Test if the property ends in "Binding"
+ if (Ember.IS_BINDING.test(prop) && typeof hash[prop] === 'string') {
+ path = this.contextualizeBindingPath(hash[prop], data);
+ if (path) { hash[prop] = path; }
+ }
+ }
+
+ // Evaluate the context of class name bindings:
+ if (extensions.classNameBindings) {
+ for (var b in extensions.classNameBindings) {
+ var full = extensions.classNameBindings[b];
+ if (typeof full === 'string') {
+ // Contextualize the path of classNameBinding so this:
+ //
+ // classNameBinding="isGreen:green"
+ //
+ // is converted to this:
+ //
+ // classNameBinding="bindingContext.isGreen:green"
+ var parsedPath = Ember.View._parsePropertyPath(full);
+ path = this.contextualizeBindingPath(parsedPath.path, data);
+ if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }
+ }
+ }
+ }
+
+ // Make the current template context available to the view
+ // for the bindings set up above.
+ extensions.bindingContext = thisContext;
+
+ return Ember.$.extend(hash, extensions);
+ },
+
+ // Transform bindings from the current context to a context that can be evaluated within the view.
+ // Returns null if the path shouldn't be changed.
+ //
+ // TODO: consider the addition of a prefix that would allow this method to return `path`.
+ contextualizeBindingPath: function(path, data) {
+ var normalized = Ember.Handlebars.normalizePath(null, path, data);
+ if (normalized.isKeyword) {
+ return 'templateData.keywords.' + path;
+ } else if (Ember.isGlobalPath(path)) {
+ return null;
+ } else if (path === 'this') {
+ return 'bindingContext';
+ } else {
+ return 'bindingContext.' + path;
+ }
+ },
+
+ helper: function(thisContext, path, options) {
+ var inverse = options.inverse,
+ data = options.data,
+ view = data.view,
+ fn = options.fn,
+ hash = options.hash,
+ newView;
+
+ if ('string' === typeof path) {
+ newView = EmberHandlebars.getPath(thisContext, path, options);
+ Ember.assert("Unable to find view at path '" + path + "'", !!newView);
+ } else {
+ newView = path;
+ }
+
+ Ember.assert(Ember.String.fmt('You must pass a view class to the #view helper, not %@ (%@)', [path, newView]), Ember.View.detect(newView));
+
+ var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);
+ var currentView = data.view;
+ viewOptions.templateData = options.data;
+
+ if (fn) {
+ Ember.assert("You cannot provide a template block if you also specified a templateName", !get(viewOptions, 'templateName') && !get(newView.proto(), 'templateName'));
+ viewOptions.template = fn;
+ }
+
+ // We only want to override the `_context` computed property if there is
+ // no specified controller. See View#_context for more information.
+ if (VIEW_PRESERVES_CONTEXT && !newView.proto().controller && !newView.proto().controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {
+ viewOptions._context = thisContext;
+ }
+
+ currentView.appendChild(newView, viewOptions);
+ }
+});
+
+/**
+ `{{view}}` inserts a new instance of `Ember.View` into a template passing its options
+ to the `Ember.View`'s `create` method and using the supplied block as the view's own template.
+
+ An empty `<body>` and the following template:
+
+ <script type="text/x-handlebars">
+ A span:
+ {{#view tagName="span"}}
+ hello.
+ {{/view}}
+ </script>
+
+ Will result in HTML structure:
+
+ <body>
+ <!-- Note: the handlebars template script
+ also results in a rendered Ember.View
+ which is the outer <div> here -->
+
+ <div class="ember-view">
+ A span:
+ <span id="ember1" class="ember-view">
+ Hello.
+ </span>
+ </div>
+ </body>
+
+ ### parentView setting
+
+ The `parentView` property of the new `Ember.View` instance created through `{{view}}`
+ will be set to the `Ember.View` instance of the template where `{{view}}` was called.
+
+ aView = Ember.View.create({
+ template: Ember.Handlebars.compile("{{#view}} my parent: {{parentView.elementId}} {{/view}}")
+ })
+
+ aView.appendTo('body')
+
+ Will result in HTML structure:
+
+ <div id="ember1" class="ember-view">
+ <div id="ember2" class="ember-view">
+ my parent: ember1
+ </div>
+ </div>
+
+ ### Setting CSS id and class attributes
+
+ The HTML `id` attribute can be set on the `{{view}}`'s resulting element with the `id` option.
+ This option will _not_ be passed to `Ember.View.create`.
+
+ <script type="text/x-handlebars">
+ {{#view tagName="span" id="a-custom-id"}}
+ hello.
+ {{/view}}
+ </script>
+
+ Results in the following HTML structure:
+
+ <div class="ember-view">
+ <span id="a-custom-id" class="ember-view">
+ hello.
+ </span>
+ </div>
+
+ The HTML `class` attribute can be set on the `{{view}}`'s resulting element with
+ the `class` or `classNameBindings` options. The `class` option
+ will directly set the CSS `class` attribute and will not be passed to
+ `Ember.View.create`. `classNameBindings` will be passed to `create` and use
+ `Ember.View`'s class name binding functionality:
+
+ <script type="text/x-handlebars">
+ {{#view tagName="span" class="a-custom-class"}}
+ hello.
+ {{/view}}
+ </script>
+
+ Results in the following HTML structure:
+
+ <div class="ember-view">
+ <span id="ember2" class="ember-view a-custom-class">
+ hello.
+ </span>
+ </div>
+
+ ### Supplying a different view class
+ `{{view}}` can take an optional first argument before its supplied options to specify a
+ path to a custom view class.
+
+ <script type="text/x-handlebars">
+ {{#view "MyApp.CustomView"}}
+ hello.
+ {{/view}}
+ </script>
+
+ The first argument can also be a relative path. Ember will search for the view class
+ starting at the `Ember.View` of the template where `{{view}}` was used as the root object:
+
+ MyApp = Ember.Application.create({})
+ MyApp.OuterView = Ember.View.extend({
+ innerViewClass: Ember.View.extend({
+ classNames: ['a-custom-view-class-as-property']
+ }),
+ template: Ember.Handlebars.compile('{{#view "innerViewClass"}} hi {{/view}}')
+ })
+
+ MyApp.OuterView.create().appendTo('body')
+
+Will result in the following HTML:
+
+ <div id="ember1" class="ember-view">
+ <div id="ember2" class="ember-view a-custom-view-class-as-property">
+ hi
+ </div>
+ </div>
+
+ ### Blockless use
+
+ If you supply a custom `Ember.View` subclass that specifies its own template
+ or provide a `templateName` option to `{{view}}` it can be used without supplying a block.
+ Attempts to use both a `templateName` option and supply a block will throw an error.
+
+ <script type="text/x-handlebars">
+ {{view "MyApp.ViewWithATemplateDefined"}}
+ </script>
+
+ ### viewName property
+
+ You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance will
+ be referenced as a property of its parent view by this name.
+
+ aView = Ember.View.create({
+ template: Ember.Handlebars.compile('{{#view viewName="aChildByName"}} hi {{/view}}')
+ })
+
+ aView.appendTo('body')
+ aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper
+
+ @name Handlebars.helpers.view
+ @param {String} path
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+EmberHandlebars.registerHelper('view', function(path, options) {
+ Ember.assert("The view helper only takes a single argument", arguments.length <= 2);
+
+ // If no path is provided, treat path param as options.
+ if (path && path.data && path.data.isRenderData) {
+ options = path;
+ path = "Ember.View";
+ }
+
+ return EmberHandlebars.ViewHelper.helper(this, path, options);
+});
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Handlebars */
+
+// TODO: Don't require all of this module
+var get = Ember.get, getPath = Ember.Handlebars.getPath, fmt = Ember.String.fmt;
+
+/**
+ `{{collection}}` is a `Ember.Handlebars` helper for adding instances of
+ `Ember.CollectionView` to a template. See `Ember.CollectionView` for additional
+ information on how a `CollectionView` functions.
+
+ `{{collection}}`'s primary use is as a block helper with a `contentBinding` option
+ pointing towards an `Ember.Array`-compatible object. An `Ember.View` instance will
+ be created for each item in its `content` property. Each view will have its own
+ `content` property set to the appropriate item in the collection.
+
+ The provided block will be applied as the template for each item's view.
+
+ Given an empty `<body>` the following template:
+
+ <script type="text/x-handlebars">
+ {{#collection contentBinding="App.items"}}
+ Hi {{content.name}}
+ {{/collection}}
+ </script>
+
+ And the following application code
+
+ App = Ember.Application.create()
+ App.items = [
+ Ember.Object.create({name: 'Dave'}),
+ Ember.Object.create({name: 'Mary'}),
+ Ember.Object.create({name: 'Sara'})
+ ]
+
+ Will result in the HTML structure below
+
+ <div class="ember-view">
+ <div class="ember-view">Hi Dave</div>
+ <div class="ember-view">Hi Mary</div>
+ <div class="ember-view">Hi Sara</div>
+ </div>
+
+ ### Blockless Use
+ If you provide an `itemViewClass` option that has its own `template` you can omit
+ the block.
+
+ The following template:
+
+ <script type="text/x-handlebars">
+ {{collection contentBinding="App.items" itemViewClass="App.AnItemView"}}
+ </script>
+
+ And application code
+
+ App = Ember.Application.create()
+ App.items = [
+ Ember.Object.create({name: 'Dave'}),
+ Ember.Object.create({name: 'Mary'}),
+ Ember.Object.create({name: 'Sara'})
+ ]
+
+ App.AnItemView = Ember.View.extend({
+ template: Ember.Handlebars.compile("Greetings {{content.name}}")
+ })
+
+ Will result in the HTML structure below
+
+ <div class="ember-view">
+ <div class="ember-view">Greetings Dave</div>
+ <div class="ember-view">Greetings Mary</div>
+ <div class="ember-view">Greetings Sara</div>
+ </div>
+
+ ### Specifying a CollectionView subclass
+ By default the `{{collection}}` helper will create an instance of `Ember.CollectionView`.
+ You can supply a `Ember.CollectionView` subclass to the helper by passing it
+ as the first argument:
+
+ <script type="text/x-handlebars">
+ {{#collection App.MyCustomCollectionClass contentBinding="App.items"}}
+ Hi {{content.name}}
+ {{/collection}}
+ </script>
+
+
+ ### Forwarded `item.*`-named Options
+ As with the `{{view}}`, helper options passed to the `{{collection}}` will be set on
+ the resulting `Ember.CollectionView` as properties. Additionally, options prefixed with
+ `item` will be applied to the views rendered for each item (note the camelcasing):
+
+ <script type="text/x-handlebars">
+ {{#collection contentBinding="App.items"
+ itemTagName="p"
+ itemClassNames="greeting"}}
+ Howdy {{content.name}}
+ {{/collection}}
+ </script>
+
+ Will result in the following HTML structure:
+
+ <div class="ember-view">
+ <p class="ember-view greeting">Howdy Dave</p>
+ <p class="ember-view greeting">Howdy Mary</p>
+ <p class="ember-view greeting">Howdy Sara</p>
+ </div>
+
+ @name Handlebars.helpers.collection
+ @param {String} path
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+Ember.Handlebars.registerHelper('collection', function(path, options) {
+ // If no path is provided, treat path param as options.
+ if (path && path.data && path.data.isRenderData) {
+ options = path;
+ path = undefined;
+ Ember.assert("You cannot pass more than one argument to the collection helper", arguments.length === 1);
+ } else {
+ Ember.assert("You cannot pass more than one argument to the collection helper", arguments.length === 2);
+ }
+
+ var fn = options.fn;
+ var data = options.data;
+ var inverse = options.inverse;
+
+ // If passed a path string, convert that into an object.
+ // Otherwise, just default to the standard class.
+ var collectionClass;
+ collectionClass = path ? getPath(this, path, options) : Ember.CollectionView;
+ Ember.assert(fmt("%@ #collection: Could not find collection class %@", [data.view, path]), !!collectionClass);
+
+ var hash = options.hash, itemHash = {}, match;
+
+ // Extract item view class if provided else default to the standard class
+ var itemViewClass, itemViewPath = hash.itemViewClass;
+ var collectionPrototype = collectionClass.proto();
+ delete hash.itemViewClass;
+ itemViewClass = itemViewPath ? getPath(collectionPrototype, itemViewPath, options) : collectionPrototype.itemViewClass;
+ Ember.assert(fmt("%@ #collection: Could not find itemViewClass %@", [data.view, itemViewPath]), !!itemViewClass);
+
+ // Go through options passed to the {{collection}} helper and extract options
+ // that configure item views instead of the collection itself.
+ for (var prop in hash) {
+ if (hash.hasOwnProperty(prop)) {
+ match = prop.match(/^item(.)(.*)$/);
+
+ if(match) {
+ // Convert itemShouldFoo -> shouldFoo
+ itemHash[match[1].toLowerCase() + match[2]] = hash[prop];
+ // Delete from hash as this will end up getting passed to the
+ // {{view}} helper method.
+ delete hash[prop];
+ }
+ }
+ }
+
+ var tagName = hash.tagName || collectionPrototype.tagName;
+
+ if (fn) {
+ itemHash.template = fn;
+ delete options.fn;
+ }
+
+ var emptyViewClass;
+ if (inverse && inverse !== Handlebars.VM.noop) {
+ emptyViewClass = get(collectionPrototype, 'emptyViewClass');
+ emptyViewClass = emptyViewClass.extend({
+ template: inverse,
+ tagName: itemHash.tagName
+ });
+ } else if (hash.emptyViewClass) {
+ emptyViewClass = getPath(this, hash.emptyViewClass, options);
+ }
+ hash.emptyView = emptyViewClass;
+
+ if (hash.eachHelper === 'each') {
+ itemHash._context = Ember.computed(function() {
+ return get(this, 'content');
+ }).property('content');
+ delete hash.eachHelper;
+ }
+
+ var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);
+ hash.itemViewClass = itemViewClass.extend(viewOptions);
+
+ return Ember.Handlebars.helpers.view.call(this, collectionClass, options);
+});
+
+
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Handlebars */
+var getPath = Ember.Handlebars.getPath;
+
+/**
+ `unbound` allows you to output a property without binding. *Important:* The
+ output will not be updated if the property changes. Use with caution.
+
+ <div>{{unbound somePropertyThatDoesntChange}}</div>
+
+ @name Handlebars.helpers.unbound
+ @param {String} property
+ @returns {String} HTML string
+*/
+Ember.Handlebars.registerHelper('unbound', function(property, fn) {
+ var context = (fn.contexts && fn.contexts[0]) || this;
+ return getPath(context, property, fn);
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+/*jshint debug:true*/
+var getPath = Ember.Handlebars.getPath, normalizePath = Ember.Handlebars.normalizePath;
+
+/**
+ `log` allows you to output the value of a value in the current rendering
+ context.
+
+ {{log myVariable}}
+
+ @name Handlebars.helpers.log
+ @param {String} property
+*/
+Ember.Handlebars.registerHelper('log', function(property, options) {
+ var context = (options.contexts && options.contexts[0]) || this,
+ normalized = normalizePath(context, property, options.data),
+ pathRoot = normalized.root,
+ path = normalized.path,
+ value = (path === 'this') ? pathRoot : getPath(pathRoot, path, options);
+ Ember.Logger.log(value);
+});
+
+/**
+ The `debugger` helper executes the `debugger` statement in the current
+ context.
+
+ {{debugger}}
+
+ @name Handlebars.helpers.debugger
+ @param {String} property
+*/
+Ember.Handlebars.registerHelper('debugger', function() {
+ debugger;
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+Ember.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {
+ itemViewClass: Ember._MetamorphView,
+ emptyViewClass: Ember._MetamorphView,
+
+ createChildView: function(view, attrs) {
+ view = this._super(view, attrs);
+
+ // At the moment, if a container view subclass wants
+ // to insert keywords, it is responsible for cloning
+ // the keywords hash. This will be fixed momentarily.
+ var keyword = get(this, 'keyword');
+
+ if (keyword) {
+ var data = get(view, 'templateData');
+
+ data = Ember.copy(data);
+ data.keywords = view.cloneKeywords();
+ set(view, 'templateData', data);
+
+ var content = get(view, 'content');
+
+ // In this case, we do not bind, because the `content` of
+ // a #each item cannot change.
+ data.keywords[keyword] = content;
+ }
+
+ return view;
+ }
+});
+
+Ember.Handlebars.registerHelper('each', function(path, options) {
+ if (arguments.length === 4) {
+ Ember.assert("If you pass more than one argument to the each helper, it must be in the form #each foo in bar", arguments[1] === "in");
+
+ var keywordName = arguments[0];
+
+ options = arguments[3];
+ path = arguments[2];
+ if (path === '') { path = "this"; }
+
+ options.hash.keyword = keywordName;
+ } else {
+ options.hash.eachHelper = 'each';
+ }
+
+ Ember.assert("You must pass a block to the each helper", options.fn && options.fn !== Handlebars.VM.noop);
+
+ options.hash.contentBinding = path;
+ // Set up emptyView as a metamorph with no tag
+ //options.hash.emptyViewClass = Ember._MetamorphView;
+
+ return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);
+});
+
+})();
+
+
+
+(function() {
+/**
+ `template` allows you to render a template from inside another template.
+ This allows you to re-use the same template in multiple places. For example:
+
+ <script type="text/x-handlebars">
+ {{#with loggedInUser}}
+ Last Login: {{lastLogin}}
+ User Info: {{template "user_info"}}
+ {{/with}}
+ </script>
+
+ <script type="text/x-handlebars" data-template-name="user_info">
+ Name: <em>{{name}}</em>
+ Karma: <em>{{karma}}</em>
+ </script>
+
+ This helper looks for templates in the global Ember.TEMPLATES hash. If you
+ add &lt;script&gt; tags to your page with the `data-template-name` attribute set,
+ they will be compiled and placed in this hash automatically.
+
+ You can also manually register templates by adding them to the hash:
+
+ Ember.TEMPLATES["my_cool_template"] = Ember.Handlebars.compile('<b>{{user}}</b>');
+
+ @name Handlebars.helpers.template
+ @param {String} templateName the template to render
+*/
+
+Ember.Handlebars.registerHelper('template', function(name, options) {
+ var template = Ember.TEMPLATES[name];
+
+ Ember.assert("Unable to find template with name '"+name+"'.", !!template);
+
+ Ember.TEMPLATES[name](this, { data: options.data });
+});
+
+})();
+
+
+
+(function() {
+var EmberHandlebars = Ember.Handlebars,
+ getPath = EmberHandlebars.getPath,
+ get = Ember.get,
+ a_slice = Array.prototype.slice;
+
+var ActionHelper = EmberHandlebars.ActionHelper = {
+ registeredActions: {}
+};
+
+ActionHelper.registerAction = function(actionName, options) {
+ var actionId = (++Ember.$.uuid).toString();
+
+ ActionHelper.registeredActions[actionId] = {
+ eventName: options.eventName,
+ handler: function(event) {
+ var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,
+ secondaryClick = event.which > 1, // IE9 may return undefined
+ nonStandard = modifier || secondaryClick;
+
+ if (options.link && nonStandard) {
+ // Allow the browser to handle special link clicks normally
+ return;
+ }
+
+ event.preventDefault();
+
+ event.view = options.view;
+
+ if (options.hasOwnProperty('context')) {
+ event.context = options.context;
+ }
+
+ if (options.hasOwnProperty('contexts')) {
+ event.contexts = options.contexts;
+ }
+
+ var target = options.target;
+
+ // Check for StateManager (or compatible object)
+ if (target.isState && typeof target.send === 'function') {
+ return target.send(actionName, event);
+ } else {
+ Ember.assert(Ember.String.fmt('Target %@ does not have action %@', [target, actionName]), target[actionName]);
+ return target[actionName].call(target, event);
+ }
+ }
+ };
+
+ options.view.on('willRerender', function() {
+ delete ActionHelper.registeredActions[actionId];
+ });
+
+ return actionId;
+};
+
+/**
+ The `{{action}}` helper registers an HTML element within a template for
+ DOM event handling and forwards that interaction to the Application's router,
+ the template's `Ember.View` instance, or supplied `target` option (see 'Specifiying a Target').
+
+ User interaction with that element will invoke the supplied action name on
+ the appropriate target.
+
+ Given the following Handlebars template on the page
+
+ <script type="text/x-handlebars" data-template-name='a-template'>
+ <div {{action anActionName}}>
+ click me
+ </div>
+ </script>
+
+ And application code
+
+ AView = Ember.View.extend({
+ templateName; 'a-template',
+ anActionName: function(event){}
+ });
+
+ aView = AView.create();
+ aView.appendTo('body');
+
+ Will results in the following rendered HTML
+
+ <div class="ember-view">
+ <div data-ember-action="1">
+ click me
+ </div>
+ </div>
+
+ Clicking "click me" will trigger the `anActionName` method of the `aView`
+ object with a `jQuery.Event` object as its argument. The `jQuery.Event`
+ object will be extended to include a `view` property that is set to the
+ original view interacted with (in this case the `aView` object).
+
+ ### Event Propagation
+
+ Events triggered through the action helper will automatically have
+ `.preventDefault()` called on them. You do not need to do so in your event
+ handlers. To stop propagation of the event, simply return `false` from your
+ handler.
+
+ If you need the default handler to trigger you should either register your
+ own event handler, or use event methods on your view class. See Ember.View
+ 'Responding to Browser Events' for more information.
+
+ ### Specifying DOM event type
+
+ By default the `{{action}}` helper registers for DOM `click` events. You can
+ supply an `on` option to the helper to specify a different DOM event name:
+
+ <script type="text/x-handlebars" data-template-name='a-template'>
+ <div {{action anActionName on="doubleClick"}}>
+ click me
+ </div>
+ </script>
+
+ See Ember.View 'Responding to Browser Events' for a list of
+ acceptable DOM event names.
+
+ Because `{{action}}` depends on Ember's event dispatch system it will only
+ function if an `Ember.EventDispatcher` instance is available. An
+ `Ember.EventDispatcher` instance will be created when a new
+ `Ember.Application` is created. Having an instance of `Ember.Application`
+ will satisfy this requirement.
+
+
+ ### Specifying a Target
+ There are several possible target objects for `{{action}}` helpers:
+
+ In a typical `Ember.Router`-backed Application where views are managed
+ through use of the `{{outlet}}` helper, actions will be forwarded to the
+ current state of the Applications's Router. See Ember.Router 'Responding
+ to User-initiated Events' for more information.
+
+ If you manaully set the `target` property on the controller of a template's
+ `Ember.View` instance, the specifed `controller.target` will become the target
+ for any actions. Likely custom values for a controller's `target` are the
+ controller itself or a StateManager other than the Application's Router.
+
+ If the templates's view lacks a controller property the view itself is the target.
+
+ Finally, a `target` option can be provided to the helper to change which object
+ will receive the method call. This option must be a string representing a
+ path to an object:
+
+ <script type="text/x-handlebars" data-template-name='a-template'>
+ <div {{action anActionName target="MyApplication.someObject"}}>
+ click me
+ </div>
+ </script>
+
+ Clicking "click me" in the rendered HTML of the above template will trigger
+ the `anActionName` method of the object at `MyApplication.someObject`.
+ The first argument to this method will be a `jQuery.Event` extended to
+ include a `view` property that is set to the original view interacted with.
+
+ A path relative to the template's `Ember.View` instance can also be used as
+ a target:
+
+ <script type="text/x-handlebars" data-template-name='a-template'>
+ <div {{action anActionName target="parentView"}}>
+ click me
+ </div>
+ </script>
+
+ Clicking "click me" in the rendered HTML of the above template will trigger
+ the `anActionName` method of the view's parent view.
+
+ The `{{action}}` helper is `Ember.StateManager` aware. If the target of the
+ action is an `Ember.StateManager` instance `{{action}}` will use the `send`
+ functionality of StateManagers. The documentation for `Ember.StateManager`
+ has additional information about this use.
+
+ If an action's target does not implement a method that matches the supplied
+ action name an error will be thrown.
+
+ <script type="text/x-handlebars" data-template-name='a-template'>
+ <div {{action aMethodNameThatIsMissing}}>
+ click me
+ </div>
+ </script>
+
+ With the following application code
+
+ AView = Ember.View.extend({
+ templateName; 'a-template',
+ // note: no method 'aMethodNameThatIsMissing'
+ anActionName: function(event){}
+ });
+
+ aView = AView.create();
+ aView.appendTo('body');
+
+ Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when
+ "click me" is clicked.
+
+ ### Specifying a context
+
+ By default the `{{action}}` helper passes the current Handlebars context
+ along in the `jQuery.Event` object. You may specify an alternate object to
+ pass as the context by providing a property path:
+
+ <script type="text/x-handlebars" data-template-name='a-template'>
+ {{#each person in people}}
+ <div {{action edit person}}>
+ click me
+ </div>
+ {{/each}}
+ </script>
+
+ @name Handlebars.helpers.action
+ @param {String} actionName
+ @param {Object...} contexts
+ @param {Hash} options
+*/
+EmberHandlebars.registerHelper('action', function(actionName) {
+ var options = arguments[arguments.length - 1],
+ contexts = a_slice.call(arguments, 1, -1);
+
+ var hash = options.hash,
+ view = options.data.view,
+ target, controller, link;
+
+ // create a hash to pass along to registerAction
+ var action = {
+ eventName: hash.on || "click"
+ };
+
+ action.view = view = get(view, 'concreteView');
+
+ if (hash.target) {
+ target = getPath(this, hash.target, options);
+ } else if (controller = options.data.keywords.controller) {
+ target = get(controller, 'target');
+ }
+
+ action.target = target = target || view;
+
+ if (contexts.length) {
+ action.contexts = contexts = Ember.EnumerableUtils.map(contexts, function(context) {
+ return getPath(this, context, options);
+ }, this);
+ action.context = contexts[0];
+ }
+
+ var output = [], url;
+
+ if (hash.href && target.urlForEvent) {
+ url = target.urlForEvent.apply(target, [actionName].concat(contexts));
+ output.push('href="' + url + '"');
+ action.link = true;
+ }
+
+ var actionId = ActionHelper.registerAction(actionName, action);
+ output.push('data-ember-action="' + actionId + '"');
+
+ return new EmberHandlebars.SafeString(output.join(" "));
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, set = Ember.set;
+
+/**
+
+ When used in a Handlebars template that is assigned to an `Ember.View` instance's
+ `layout` property Ember will render the layout template first, inserting the view's
+ own rendered output at the `{{ yield }}` location.
+
+ An empty `<body>` and the following application code:
+
+ AView = Ember.View.extend({
+ classNames: ['a-view-with-layout'],
+ layout: Ember.Handlebars.compile('<div class="wrapper">{{ yield }}</div>'),
+ template: Ember.Handlebars.compile('<span>I am wrapped</span>')
+ })
+
+ aView = AView.create()
+ aView.appendTo('body')
+
+ Will result in the following HTML output:
+
+ <body>
+ <div class='ember-view a-view-with-layout'>
+ <div class="wrapper">
+ <span>I am wrapped</span>
+ </div>
+ </div>
+ </body>
+
+ The yield helper cannot be used outside of a template assigned to an `Ember.View`'s `layout` property
+ and will throw an error if attempted.
+
+ BView = Ember.View.extend({
+ classNames: ['a-view-with-layout'],
+ template: Ember.Handlebars.compile('{{yield}}')
+ })
+
+ bView = BView.create()
+ bView.appendTo('body')
+
+ // throws
+ // Uncaught Error: assertion failed: You called yield in a template that was not a layout
+
+ @name Handlebars.helpers.yield
+ @param {Hash} options
+ @returns {String} HTML string
+*/
+Ember.Handlebars.registerHelper('yield', function(options) {
+ var view = options.data.view, template;
+
+ while (view && !get(view, 'layout')) {
+ view = get(view, 'parentView');
+ }
+
+ Ember.assert("You called yield in a template that was not a layout", !!view);
+
+ template = get(view, 'template');
+
+ if (template) { template(this, options); }
+});
+
+})();
+
+
+
+(function() {
+/**
+ The `outlet` helper allows you to specify that the current
+ view's controller will fill in the view for a given area.
+
+ {{outlet}}
+
+ By default, when the the current controller's `view`
+ property changes, the outlet will replace its current
+ view with the new view.
+
+ controller.set('view', someView);
+
+ You can also specify a particular name, other than view:
+
+ {{outlet masterView}}
+ {{outlet detailView}}
+
+ Then, you can control several outlets from a single
+ controller:
+
+ controller.set('masterView', postsView);
+ controller.set('detailView', postView);
+
+ @name Handlebars.helpers.outlet
+ @param {String} property the property on the controller
+ that holds the view for this outlet
+*/
+Ember.Handlebars.registerHelper('outlet', function(property, options) {
+ if (property && property.data && property.data.isRenderData) {
+ options = property;
+ property = 'view';
+ }
+
+ options.hash.currentViewBinding = "controller." + property;
+
+ return Ember.Handlebars.helpers.view.call(this, Ember.ContainerView, options);
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var set = Ember.set, get = Ember.get;
+
+/**
+ @class
+
+ Creates an HTML input of type 'checkbox' with HTML related properties
+ applied directly to the input.
+
+ {{view Ember.Checkbox classNames="applicaton-specific-checkbox"}}
+
+ <input id="ember1" class="ember-view ember-checkbox applicaton-specific-checkbox" type="checkbox">
+
+ You can add a `label` tag yourself in the template where the Ember.Checkbox is being used.
+
+ <label>
+ Some Title
+ {{view Ember.Checkbox classNames="applicaton-specific-checkbox"}}
+ </label>
+
+
+ The `checked` attribute of an Ember.Checkbox object should always be set
+ through the Ember object or by interacting with its rendered element representation
+ via the mouse, keyboard, or touch. Updating the value of the checkbox via jQuery will
+ result in the checked value of the object and its element losing synchronization.
+
+ ## Layout and LayoutName properties
+ Because HTML `input` elements are self closing `layout` and `layoutName` properties will
+ not be applied. See `Ember.View`'s layout section for more information.
+
+ @extends Ember.View
+*/
+Ember.Checkbox = Ember.View.extend({
+ classNames: ['ember-checkbox'],
+
+ tagName: 'input',
+
+ attributeBindings: ['type', 'checked', 'disabled', 'tabindex'],
+
+ type: "checkbox",
+ checked: false,
+ disabled: false,
+
+ init: function() {
+ this._super();
+ this.on("change", this, this._updateElementValue);
+ },
+
+ /**
+ @private
+ */
+ _updateElementValue: function() {
+ set(this, 'checked', this.$().prop('checked'));
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+/** @class */
+Ember.TextSupport = Ember.Mixin.create(
+/** @scope Ember.TextSupport.prototype */ {
+
+ value: "",
+
+ attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex'],
+ placeholder: null,
+ disabled: false,
+ maxlength: null,
+
+ insertNewline: Ember.K,
+ cancel: Ember.K,
+
+ /** @private */
+ init: function() {
+ this._super();
+ this.on("focusOut", this, this._elementValueDidChange);
+ this.on("change", this, this._elementValueDidChange);
+ this.on("keyUp", this, this.interpretKeyEvents);
+ },
+
+ /**
+ @private
+ */
+ interpretKeyEvents: function(event) {
+ var map = Ember.TextSupport.KEY_EVENTS;
+ var method = map[event.keyCode];
+
+ this._elementValueDidChange();
+ if (method) { return this[method](event); }
+ },
+
+ _elementValueDidChange: function() {
+ set(this, 'value', this.$().val());
+ }
+
+});
+
+Ember.TextSupport.KEY_EVENTS = {
+ 13: 'insertNewline',
+ 27: 'cancel'
+};
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ The `Ember.TextField` view class renders a text
+ [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It
+ allows for binding Ember properties to the text field contents (`value`),
+ live-updating as the user inputs text.
+
+ Example:
+
+ {{view Ember.TextField valueBinding="firstName"}}
+
+ ## Layout and LayoutName properties
+ Because HTML `input` elements are self closing `layout` and `layoutName` properties will
+ not be applied. See `Ember.View`'s layout section for more information.
+
+ @extends Ember.View
+ @extends Ember.TextSupport
+*/
+Ember.TextField = Ember.View.extend(Ember.TextSupport,
+ /** @scope Ember.TextField.prototype */ {
+
+ classNames: ['ember-text-field'],
+ tagName: "input",
+ attributeBindings: ['type', 'value', 'size'],
+
+ /**
+ The value attribute of the input element. As the user inputs text, this
+ property is updated live.
+
+ @type String
+ @default ""
+ */
+ value: "",
+
+ /**
+ The type attribute of the input element.
+
+ @type String
+ @default "text"
+ */
+ type: "text",
+
+ /**
+ The size of the text field in characters.
+
+ @type String
+ @default null
+ */
+ size: null
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+Ember.Button = Ember.View.extend(Ember.TargetActionSupport, {
+ classNames: ['ember-button'],
+ classNameBindings: ['isActive'],
+
+ tagName: 'button',
+
+ propagateEvents: false,
+
+ attributeBindings: ['type', 'disabled', 'href', 'tabindex'],
+
+ /** @private
+ Overrides TargetActionSupport's targetObject computed
+ property to use Handlebars-specific path resolution.
+ */
+ targetObject: Ember.computed(function() {
+ var target = get(this, 'target'),
+ root = get(this, 'context'),
+ data = get(this, 'templateData');
+
+ if (typeof target !== 'string') { return target; }
+
+ return Ember.Handlebars.getPath(root, target, { data: data });
+ }).property('target').cacheable(),
+
+ // Defaults to 'button' if tagName is 'input' or 'button'
+ type: Ember.computed(function(key, value) {
+ var tagName = this.get('tagName');
+ if (value !== undefined) { this._type = value; }
+ if (this._type !== undefined) { return this._type; }
+ if (tagName === 'input' || tagName === 'button') { return 'button'; }
+ }).property('tagName').cacheable(),
+
+ disabled: false,
+
+ // Allow 'a' tags to act like buttons
+ href: Ember.computed(function() {
+ return this.get('tagName') === 'a' ? '#' : null;
+ }).property('tagName').cacheable(),
+
+ mouseDown: function() {
+ if (!get(this, 'disabled')) {
+ set(this, 'isActive', true);
+ this._mouseDown = true;
+ this._mouseEntered = true;
+ }
+ return get(this, 'propagateEvents');
+ },
+
+ mouseLeave: function() {
+ if (this._mouseDown) {
+ set(this, 'isActive', false);
+ this._mouseEntered = false;
+ }
+ },
+
+ mouseEnter: function() {
+ if (this._mouseDown) {
+ set(this, 'isActive', true);
+ this._mouseEntered = true;
+ }
+ },
+
+ mouseUp: function(event) {
+ if (get(this, 'isActive')) {
+ // Actually invoke the button's target and action.
+ // This method comes from the Ember.TargetActionSupport mixin.
+ this.triggerAction();
+ set(this, 'isActive', false);
+ }
+
+ this._mouseDown = false;
+ this._mouseEntered = false;
+ return get(this, 'propagateEvents');
+ },
+
+ keyDown: function(event) {
+ // Handle space or enter
+ if (event.keyCode === 13 || event.keyCode === 32) {
+ this.mouseDown();
+ }
+ },
+
+ keyUp: function(event) {
+ // Handle space or enter
+ if (event.keyCode === 13 || event.keyCode === 32) {
+ this.mouseUp();
+ }
+ },
+
+ // TODO: Handle proper touch behavior. Including should make inactive when
+ // finger moves more than 20x outside of the edge of the button (vs mouse
+ // which goes inactive as soon as mouse goes out of edges.)
+
+ touchStart: function(touch) {
+ return this.mouseDown(touch);
+ },
+
+ touchEnd: function(touch) {
+ return this.mouseUp(touch);
+ },
+
+ init: function() {
+ Ember.deprecate("Ember.Button is deprecated and will be removed from future releases. Consider using the `{{action}}` helper.");
+ this._super();
+ }
+});
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+var get = Ember.get, set = Ember.set;
+
+/**
+ @class
+
+ The `Ember.TextArea` view class renders a
+ [textarea](https://developer.mozilla.org/en/HTML/Element/textarea) element.
+ It allows for binding Ember properties to the text area contents (`value`),
+ live-updating as the user inputs text.
+
+ ## Layout and LayoutName properties
+
+ Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName`
+ properties will not be applied. See `Ember.View`'s layout section for more information.
+
+ @extends Ember.View
+ @extends Ember.TextSupport
+*/
+Ember.TextArea = Ember.View.extend(Ember.TextSupport,
+/** @scope Ember.TextArea.prototype */ {
+
+ classNames: ['ember-text-area'],
+
+ tagName: "textarea",
+ attributeBindings: ['rows', 'cols'],
+ rows: null,
+ cols: null,
+
+ _updateElementValue: Ember.observer(function() {
+ // We do this check so cursor position doesn't get affected in IE
+ var value = get(this, 'value'),
+ $el = this.$();
+ if ($el && value !== $el.val()) {
+ $el.val(value);
+ }
+ }, 'value'),
+
+ /** @private */
+ init: function() {
+ this._super();
+ this.on("didInsertElement", this, this._updateElementValue);
+ }
+
+});
+
+})();
+
+
+
+(function() {
+Ember.TabContainerView = Ember.View.extend({
+ init: function() {
+ Ember.deprecate("Ember.TabContainerView is deprecated and will be removed from future releases.");
+ this._super();
+ }
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get;
+
+Ember.TabPaneView = Ember.View.extend({
+ tabsContainer: Ember.computed(function() {
+ return this.nearestInstanceOf(Ember.TabContainerView);
+ }).property().volatile(),
+
+ isVisible: Ember.computed(function() {
+ return get(this, 'viewName') === get(this, 'tabsContainer.currentView');
+ }).property('tabsContainer.currentView').volatile(),
+
+ init: function() {
+ Ember.deprecate("Ember.TabPaneView is deprecated and will be removed from future releases.");
+ this._super();
+ }
+});
+
+})();
+
+
+
+(function() {
+var get = Ember.get, setPath = Ember.setPath;
+
+Ember.TabView = Ember.View.extend({
+ tabsContainer: Ember.computed(function() {
+ return this.nearestInstanceOf(Ember.TabContainerView);
+ }).property().volatile(),
+
+ mouseUp: function() {
+ setPath(this, 'tabsContainer.currentView', get(this, 'value'));
+ },
+
+ init: function() {
+ Ember.deprecate("Ember.TabView is deprecated and will be removed from future releases.");
+ this._super();
+ }
+});
+
+})();
+
+
+
+(function() {
+
+})();
+
+
+
+(function() {
+/*jshint eqeqeq:false */
+
+var set = Ember.set, get = Ember.get;
+var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.indexesOf;
+
+/**
+ @class
+
+ The Ember.Select view class renders a
+ [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,
+ allowing the user to choose from a list of options. The selected option(s)
+ are updated live in the `selection` property, while the corresponding value
+ is updated in the `value` property.
+
+ ### Using Strings
+ The simplest version of an Ember.Select takes an array of strings for the options
+ of a select box and a valueBinding to set the value.
+
+ Example:
+
+ App.controller = Ember.Object.create({
+ selected: null,
+ content: [
+ "Yehuda",
+ "Tom"
+ ]
+ })
+
+ {{view Ember.Select
+ contentBinding="App.controller.content"
+ valueBinding="App.controller.selected"
+ }}
+
+ Would result in the following HTML:
+
+ <select class="ember-select">
+ <option value="Yehuda">Yehuda</option>
+ <option value="Tom">Tom</option>
+ </select>
+
+ Selecting Yehuda from the select box will set `App.controller.selected` to "Yehuda"
+
+ ### Using Objects
+ An Ember.Select can also take an array of JS or Ember objects.
+
+ When using objects you need to supply optionLabelPath and optionValuePath parameters
+ which will be used to get the label and value for each of the options.
+
+ Usually you will bind to either the selection or the value attribute of the select.
+
+ Use selectionBinding if you would like to set the whole object as a property on the target.
+ Use valueBinding if you would like to set just the value.
+
+ Example using selectionBinding:
+
+ App.controller = Ember.Object.create({
+ selectedPerson: null,
+ selectedPersonId: null,
+ content: [
+ Ember.Object.create({firstName: "Yehuda", id: 1}),
+ Ember.Object.create({firstName: "Tom", id: 2})
+ ]
+ })
+
+ {{view Ember.Select
+ contentBinding="App.controller.content"
+ optionLabelPath="content.firstName"
+ optionValuePath="content.id"
+ selectionBinding="App.controller.selectedPerson"
+ prompt="Please Select"}}
+
+ <select class="ember-select">
+ <option value>Please Select</option>
+ <option value="1">Yehuda</option>
+ <option value="2">Tom</option>
+ </select>
+
+ Selecting Yehuda here will set `App.controller.selectedPerson` to
+ the Yehuda object.
+
+ Example using valueBinding:
+
+ {{view Ember.Select
+ contentBinding="App.controller.content"
+ optionLabelPath="content.firstName"
+ optionValuePath="content.id"
+ valueBinding="App.controller.selectedPersonId"
+ prompt="Please Select"}}
+
+ Selecting Yehuda in this case will set `App.controller.selectedPersonId` to 1.
+
+ @extends Ember.View
+*/
+Ember.Select = Ember.View.extend(
+ /** @scope Ember.Select.prototype */ {
+
+ tagName: 'select',
+ classNames: ['ember-select'],
+ defaultTemplate: Ember.Handlebars.compile('{{#if view.prompt}}<option value>{{view.prompt}}</option>{{/if}}{{#each view.content}}{{view Ember.SelectOption contentBinding="this"}}{{/each}}'),
+ attributeBindings: ['multiple', 'tabindex'],
+
+ /**
+ The `multiple` attribute of the select element. Indicates whether multiple
+ options can be selected.
+
+ @type Boolean
+ @default false
+ */
+ multiple: false,
+
+ /**
+ The list of options.
+
+ If `optionLabelPath` and `optionValuePath` are not overridden, this should
+ be a list of strings, which will serve simultaneously as labels and values.
+
+ Otherwise, this should be a list of objects. For instance:
+
+ content: Ember.A([
+ { id: 1, firstName: 'Yehuda' },
+ { id: 2, firstName: 'Tom' }
+ ]),
+ optionLabelPath: 'content.firstName',
+ optionValuePath: 'content.id'
+
+ @type Array
+ @default null
+ */
+ content: null,
+
+ /**
+ When `multiple` is false, the element of `content` that is currently
+ selected, if any.
+
+ When `multiple` is true, an array of such elements.
+
+ @type Object or Array
+ @default null
+ */
+ selection: null,
+
+ /**
+ In single selection mode (when `multiple` is false), value can be used to get
+ the current selection's value or set the selection by it's value.
+
+ It is not currently supported in multiple selection mode.
+
+ @type String
+ @default null
+ */
+ value: Ember.computed(function(key, value) {
+ if (arguments.length === 2) { return value; }
+
+ var valuePath = get(this, 'optionValuePath').replace(/^content\.?/, '');
+ return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');
+ }).property('selection').cacheable(),
+
+ /**
+ If given, a top-most dummy option will be rendered to serve as a user
+ prompt.
+
+ @type String
+ @default null
+ */
+ prompt: null,
+
+ /**
+ The path of the option labels. See `content`.
+
+ @type String
+ @default 'content'
+ */
+ optionLabelPath: 'content',
+
+ /**
+ The path of the option values. See `content`.
+
+ @type String
+ @default 'content'
+ */
+ optionValuePath: 'content',
+
+ _change: function() {
+ if (get(this, 'multiple')) {
+ this._changeMultiple();
+ } else {
+ this._changeSingle();
+ }
+ },
+
+ selectionDidChange: Ember.observer(function() {
+ var selection = get(this, 'selection'),
+ isArray = Ember.isArray(selection);
+ if (get(this, 'multiple')) {
+ if (!isArray) {
+ set(this, 'selection', Ember.A([selection]));
+ return;
+ }
+ this._selectionDidChangeMultiple();
+ } else {
+ this._selectionDidChangeSingle();
+ }
+ }, 'selection'),
+
+ valueDidChange: Ember.observer(function() {
+ var content = get(this, 'content'),
+ value = get(this, 'value'),
+ valuePath = get(this, 'optionValuePath').replace(/^content\.?/, ''),
+ selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),
+ selection;
+
+ if (value !== selectedValue) {
+ selection = content.find(function(obj) {
+ return value === (valuePath ? get(obj, valuePath) : obj);
+ });
+
+ this.set('selection', selection);
+ }
+ }, 'value'),
+
+
+ _triggerChange: function() {
+ var selection = get(this, 'selection');
+
+ if (selection) { this.selectionDidChange(); }
+
+ this._change();
+ },
+
+ _changeSingle: function() {
+ var selectedIndex = this.$()[0].selectedIndex,
+ content = get(this, 'content'),
+ prompt = get(this, 'prompt');
+
+ if (!content) { return; }
+ if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }
+
+ if (prompt) { selectedIndex -= 1; }
+ set(this, 'selection', content.objectAt(selectedIndex));
+ },
+
+ _changeMultiple: function() {
+ var options = this.$('option:selected'),
+ prompt = get(this, 'prompt'),
+ offset = prompt ? 1 : 0,
+ content = get(this, 'content');
+
+ if (!content){ return; }
+ if (options) {
+ var selectedIndexes = options.map(function(){
+ return this.index - offset;
+ }).toArray();
+ set(this, 'selection', content.objectsAt(selectedIndexes));
+ }
+ },
+
+ _selectionDidChangeSingle: function() {
+ var el = this.get('element');
+ if (!el) { return; }
+
+ var content = get(this, 'content'),
+ selection = get(this, 'selection'),
+ selectionIndex = content ? indexOf(content, selection) : -1,
+ prompt = get(this, 'prompt');
+
+ if (prompt) { selectionIndex += 1; }
+ if (el) { el.selectedIndex = selectionIndex; }
+ },
+
+ _selectionDidChangeMultiple: function() {
+ var content = get(this, 'content'),
+ selection = get(this, 'selection'),
+ selectedIndexes = content ? indexesOf(content, selection) : [-1],
+ prompt = get(this, 'prompt'),
+ offset = prompt ? 1 : 0,
+ options = this.$('option'),
+ adjusted;
+
+ if (options) {
+ options.each(function() {
+ adjusted = this.index > -1 ? this.index + offset : -1;
+ this.selected = indexOf(selectedIndexes, adjusted) > -1;
+ });
+ }
+ },
+
+ init: function() {
+ this._super();
+ this.on("didInsertElement", this, this._triggerChange);
+ this.on("change", this, this._change);
+ }
+});
+
+Ember.SelectOption = Ember.View.extend({
+ tagName: 'option',
+ attributeBindings: ['value', 'selected'],
+
+ defaultTemplate: function(context, options) {
+ options = { data: options.data, hash: {} };
+ Ember.Handlebars.helpers.bind.call(context, "view.label", options);
+ },
+
+ init: function() {
+ this.labelPathDidChange();
+ this.valuePathDidChange();
+
+ this._super();
+ },
+
+ selected: Ember.computed(function() {
+ var content = get(this, 'content'),
+ selection = get(this, 'parentView.selection');
+ if (get(this, 'parentView.multiple')) {
+ return selection && indexOf(selection, content) > -1;
+ } else {
+ // Primitives get passed through bindings as objects... since
+ // `new Number(4) !== 4`, we use `==` below
+ return content == selection;
+ }
+ }).property('content', 'parentView.selection').volatile(),
+
+ labelPathDidChange: Ember.observer(function() {
+ var labelPath = get(this, 'parentView.optionLabelPath');
+
+ if (!labelPath) { return; }
+
+ Ember.defineProperty(this, 'label', Ember.computed(function() {
+ return get(this, labelPath);
+ }).property(labelPath).cacheable());
+ }, 'parentView.optionLabelPath'),
+
+ valuePathDidChange: Ember.observer(function() {
+ var valuePath = get(this, 'parentView.optionValuePath');
+
+ if (!valuePath) { return; }
+
+ Ember.defineProperty(this, 'value', Ember.computed(function() {
+ return get(this, valuePath);
+ }).property(valuePath).cacheable());
+ }, 'parentView.optionValuePath')
+});
+
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+/*globals Handlebars */
+// Find templates stored in the head tag as script tags and make them available
+// to Ember.CoreView in the global Ember.TEMPLATES object. This will be run as as
+// jQuery DOM-ready callback.
+//
+// Script tags with "text/x-handlebars" will be compiled
+// with Ember's Handlebars and are suitable for use as a view's template.
+// Those with type="text/x-raw-handlebars" will be compiled with regular
+// Handlebars and are suitable for use in views' computed properties.
+Ember.Handlebars.bootstrap = function(ctx) {
+ var selectors = 'script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';
+
+ Ember.$(selectors, ctx)
+ .each(function() {
+ // Get a reference to the script tag
+ var script = Ember.$(this),
+ type = script.attr('type');
+
+ var compile = (script.attr('type') === 'text/x-raw-handlebars') ?
+ Ember.$.proxy(Handlebars.compile, Handlebars) :
+ Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),
+ // Get the name of the script, used by Ember.View's templateName property.
+ // First look for data-template-name attribute, then fall back to its
+ // id if no name is found.
+ templateName = script.attr('data-template-name') || script.attr('id'),
+ template = compile(script.html()),
+ view, viewPath, elementId, options;
+
+ if (templateName) {
+ // For templates which have a name, we save them and then remove them from the DOM
+ Ember.TEMPLATES[templateName] = template;
+
+ // Remove script tag from DOM
+ script.remove();
+ } else {
+ if (script.parents('head').length !== 0) {
+ // don't allow inline templates in the head
+ throw new Ember.Error("Template found in <head> without a name specified. " +
+ "Please provide a data-template-name attribute.\n" +
+ script.html());
+ }
+
+ // For templates which will be evaluated inline in the HTML document, instantiates a new
+ // view, and replaces the script tag holding the template with the new
+ // view's DOM representation.
+ //
+ // Users can optionally specify a custom view subclass to use by setting the
+ // data-view attribute of the script tag.
+ viewPath = script.attr('data-view');
+ view = viewPath ? Ember.get(viewPath) : Ember.View;
+
+ // Get the id of the script, used by Ember.View's elementId property,
+ // Look for data-element-id attribute.
+ elementId = script.attr('data-element-id');
+
+ options = { template: template };
+ if (elementId) { options.elementId = elementId; }
+
+ view = view.create(options);
+
+ view._insertElementLater(function() {
+ script.replaceWith(this.$());
+
+ // Avoid memory leak in IE
+ script = null;
+ });
+ }
+ });
+};
+
+/** @private */
+function bootstrap() {
+ Ember.Handlebars.bootstrap( Ember.$(document) );
+}
+
+/*
+ We tie this to application.load to ensure that we've at least
+ attempted to bootstrap at the point that the application is loaded.
+
+ We also tie this to document ready since we're guaranteed that all
+ the inline templates are present at this point.
+
+ There's no harm to running this twice, since we remove the templates
+ from the DOM after processing.
+*/
+
+Ember.$(document).ready(bootstrap);
+Ember.onLoad('application', bootstrap);
+
+})();
+
+
+
+(function() {
+// ==========================================================================
+// Project: Ember Handlebars Views
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
+// Version: v1.0.pre
+// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
+
+
+(function() {
+// ==========================================================================
+// Project: Ember
+// Copyright: ©2011 Strobe Inc. and contributors.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+})();
+
diff --git a/src/components/HMI/lib/ember-1.0.pre.min.js b/src/components/HMI/lib/ember-1.0.pre.min.js
new file mode 100644
index 0000000000..73375a7d56
--- /dev/null
+++ b/src/components/HMI/lib/ember-1.0.pre.min.js
@@ -0,0 +1,18 @@
+// ==========================================================================
+// Project: Ember - JavaScript Application Framework
+// Copyright: ©2011-2012 Tilde Inc. and contributors
+// Portions ©2006-2011 Strobe Inc.
+// Portions ©2008-2011 Apple Inc. All rights reserved.
+// License: Licensed under MIT license (see license.js)
+// ==========================================================================
+
+
+// Version: v1.0.pre
+// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
+
+
+(function(){"undefined"==typeof Ember&&(Ember={}),"undefined"!=typeof window&&(window.Em=window.Ember=Em=Ember),Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.pre",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES!==!1,Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.CP_DEFAULT_CACHEABLE=Ember.ENV.CP_DEFAULT_CACHEABLE!==!1,Ember.VIEW_PRESERVES_CONTEXT=Ember.ENV.VIEW_PRESERVES_CONTEXT!==!1,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(a,b){return b}),"undefined"==typeof ember_assert&&(window.ember_assert=Ember.K),"undefined"==typeof ember_warn&&(window.ember_warn=Ember.K),"undefined"==typeof ember_deprecate&&(window.ember_deprecate=Ember.K),"undefined"==typeof ember_deprecateFunc&&(window.ember_deprecateFunc=function(a,b){return b}),Ember.Logger=window.console||{log:Ember.K,warn:Ember.K,error:Ember.K,info:Ember.K,debug:Ember.K}})(),function(){var a=function(a){return a&&Function.prototype.toString.call(a).indexOf("[native code]")>-1},b=a(Array.prototype.map)?Array.prototype.map:function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;var d=new Array(c),e=arguments[1];for(var f=0;f<c;f++)f in b&&(d[f]=a.call(e,b[f],f,b));return d},c=a(Array.prototype.forEach)?Array.prototype.forEach:function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;var d=arguments[1];for(var e=0;e<c;e++)e in b&&a.call(d,b[e],e,b)},d=a(Array.prototype.indexOf)?Array.prototype.indexOf:function(a,b){b===null||b===undefined?b=0:b<0&&(b=Math.max(0,this.length+b));for(var c=b,d=this.length;c<d;c++)if(this[c]===a)return c;return-1};Ember.ArrayPolyfills={map:b,forEach:c,indexOf:d};var e=Ember.EnumerableUtils={map:function(a,c,d){return a.map?a.map.call(a,c,d):b.call(a,c,d)},forEach:function(a,b,d){return a.forEach?a.forEach.call(a,b,d):c.call(a,b,d)},indexOf:function(a,b,c){return a.indexOf?a.indexOf.call(a,b,c):d.call(a,b,c)},indexesOf:function(a,b){return b===undefined?[]:e.map(b,function(b){return e.indexOf(a,b)})},removeObject:function(a,b){var c=e.indexOf(a,b);c!==-1&&a.splice(c,1)}};Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=b),Array.prototype.forEach||(Array.prototype.forEach=c),Array.prototype.indexOf||(Array.prototype.indexOf=d))}(),function(){var a=Ember.platform={};Ember.create=Object.create;if(!Ember.create){var b=function(){};Ember.create=function(a,c){b.prototype=a,a=new b;if(c){b.prototype=a;for(var d in c)b.prototype[d]=c[d].value;a=new b}return b.prototype=null,a},Ember.create.isSimulated=!0}var c=Object.defineProperty,d,e;if(c)try{c({},"a",{get:function(){}})}catch(f){c=null}c&&(d=function(){var a={};return c(a,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),c(a,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),a.a===!0}(),e=function(){try{return c(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(a){}return!1}(),d?e||(c=function(a,b,c){var d;return typeof Node=="object"?d=a instanceof Node:d=typeof a=="object"&&typeof a.nodeType=="number"&&typeof a.nodeName=="string",d?a[b]=c.value:Object.defineProperty(a,b,c)}):c=null),a.defineProperty=c,a.hasPropertyAccessors=!0,a.defineProperty||(a.hasPropertyAccessors=!1,a.defineProperty=function(a,b,c){c.get||(a[b]=c.value)},a.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!a.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function m(a){this.descs={},this.watching={},this.cache={},this.source=a}function n(a,b){return!!a&&typeof a[b]=="function"}var a=Ember.platform.defineProperty,b=Ember.create,c="__ember"+ +(new Date),d=0,e=[],f={},g=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=c;var h={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,f){f||(f="ember");var g=f+d++;return e&&(h.value=g,a(e,c,h)),g},Ember.guidFor=function(g){if(g===undefined)return"(undefined)";if(g===null)return"(null)";var i,j,k=typeof g;switch(k){case"number":return j=e[g],j||(j=e[g]="nu"+g),j;case"string":return j=f[g],j||(j=f[g]="st"+d++),j;case"boolean":return g?"(true)":"(false)";default:if(g[c])return g[c];if(g===Object)return"(Object)";if(g===Array)return"(Array)";return j="ember"+d++,h.value=j,a(g,c,h),j}};var i={writable:!0,configurable:!1,enumerable:!1,value:null},j=Ember.GUID_KEY+"_meta";Ember.META_KEY=j;var k={descs:{},watching:{}};g&&(k.values={}),Ember.EMPTY_META=k,Object.freeze&&Object.freeze(k);var l=Ember.platform.defineProperty.isSimulated;l&&(m.prototype.__preventPlainObject__=!0),Ember.meta=function(d,e){var f=d[j];return e===!1?f||k:(f?f.source!==d&&(l||a(d,j,i),f=b(f),f.descs=b(f.descs),f.watching=b(f.watching),f.cache={},f.source=d,g&&(f.values=b(f.values)),d[j]=f):(l||a(d,j,i),f=new m(d),g&&(f.values={}),d[j]=f,f.descs.constructor=null),f)},Ember.getMeta=function(b,c){var d=Ember.meta(b,!1);return d[c]},Ember.setMeta=function(b,c,d){var e=Ember.meta(b,!0);return e[c]=d,d},Ember.metaPath=function(c,d,e){var f=Ember.meta(c,e),g,h;for(var i=0,j=d.length;i<j;i++){g=d[i],h=f[g];if(!h){if(!e)return undefined;h=f[g]={__ember_source__:c}}else if(h.__ember_source__!==c){if(!e)return undefined;h=f[g]=b(h),h.__ember_source__=c}f=h}return h},Ember.wrap=function(a,b){function c(){}var d=function(){var d,e=this._super;return this._super=b||c,d=a.apply(this,arguments),this._super=e,d};return d.base=a,d},Ember.isArray=function(a){return!a||a.setInterval?!1:Array.isArray&&Array.isArray(a)?!0:Ember.Array&&Ember.Array.detect(a)?!0:a.length!==undefined&&"object"==typeof a?!0:!1},Ember.makeArray=function(a){return a===null||a===undefined?[]:Ember.isArray(a)?a:[a]},Ember.canInvoke=n,Ember.tryInvoke=function(a,b,c){if(n(a,b))return a[b].apply(a,c)}}(),function(){var a=Ember.guidFor,b=Ember.ArrayPolyfills.indexOf,c=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},d=function(a,b){var d=a.keys.copy(),e=c(a.values);return b.keys=d,b.values=e,b},e=Ember.OrderedSet=function(){this.clear()};e.create=function(){return new e},e.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(b){var c=a(b),d=this.presenceSet,e=this.list;if(c in d)return;d[c]=!0,e.push(b)},remove:function(c){var d=a(c),e=this.presenceSet,f=this.list;delete e[d];var g=b.call(f,c);g>-1&&f.splice(g,1)},isEmpty:function(){return this.list.length===0},forEach:function(a,b){var c=this.list.slice();for(var d=0,e=c.length;d<e;d++)a.call(b,c[d])},toArray:function(){return this.list.slice()},copy:function(){var a=new e;return a.presenceSet=c(this.presenceSet),a.list=this.list.slice(),a}};var f=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};f.create=function(){return new f},f.prototype={get:function(b){var c=this.values,d=a(b);return c[d]},set:function(b,c){var d=this.keys,e=this.values,f=a(b);d.add(b),e[f]=c},remove:function(b){var c=this.keys,d=this.values,e=a(b),f;return d.hasOwnProperty(e)?(c.remove(b),f=d[e],delete d[e],!0):!1},has:function(b){var c=this.values,d=a(b);return c.hasOwnProperty(d)},forEach:function(b,c){var d=this.keys,e=this.values;d.forEach(function(d){var f=a(d);b.call(c,d,e[f])})},copy:function(){return d(this,new f)}};var g=Ember.MapWithDefault=function(a){f.call(this),this.defaultValue=a.defaultValue};g.create=function(a){return a?new g(a):new f},g.prototype=Ember.create(f.prototype),g.prototype.get=function(a){var b=this.has(a);if(b)return f.prototype.get.call(this,a);var c=this.defaultValue(a);return this.set(a,c),c},g.prototype.copy=function(){return d(this,new g({defaultValue:this.defaultValue}))}}(),function(){function i(a){return a.match(h)[0]}function j(a,c){var d=g.test(c),e=!d&&f.test(c),h;if(!a||e)a=window;d&&(c=c.slice(5)),a===window&&(h=i(c),a=b(a,h),c=c.slice(h.length+1));if(!c||c.length===0)throw new Error("Invalid Path");return[a,c]}function k(a,c){var d,e,f,h,i;if(a===null&&c.indexOf(".")===-1)return b(window,c);d=g.test(c);if(!a||d)f=j(a,c),a=f[0],c=f[1],f.length=0;e=c.split("."),i=e.length;for(h=0;a&&h<i;h++){a=b(a,e[h],!0);if(a&&a.isDestroyed)return undefined}return a}function l(a,b,d,e){var f;f=b.slice(b.lastIndexOf(".")+1),b=b.slice(0,b.length-(f.length+1)),b!=="this"&&(a=k(a,b));if(!f||f.length===0)throw new Error("You passed an empty path");if(!a){if(e)return;throw new Error("Object in path "+b+" could not be found or was destroyed.")}return c(a,f,d)}var a=Ember.META_KEY,b,c,d=Ember.ENV.MANDATORY_SETTER,e=/^([A-Z$]|([0-9][A-Z$]))/,f=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,g=/^this[\.\*]/,h=/^([^\.\*]+)/;b=function(c,e){if(e==="")return c;!e&&"string"==typeof c&&(e=c,c=null);if(!c||e.indexOf(".")!==-1)return k(c,e);var f=c[a],g=f&&f.descs[e],h;return g?g.get(c,e):(d&&f&&f.watching[e]>0?h=f.values[e]:h=c[e],h!==undefined||"object"!=typeof c||e in c||"function"!=typeof c.unknownProperty?h:c.unknownProperty(e))},c=function(c,e,f,g){typeof c=="string"&&(f=e,e=c,c=null);if(!c||e.indexOf(".")!==-1)return l(c,e,f,g);var h=c[a],i=h&&h.descs[e],j,k;return i?i.set(c,e,f):(j="object"==typeof c&&!(e in c),j&&"function"==typeof c.setUnknownProperty?c.setUnknownProperty(e,f):h&&h.watching[e]>0?(d?k=h.values[e]:k=c[e],f!==k&&(Ember.propertyWillChange(c,e),d?k!==undefined||e in c?h.values[e]=f:Ember.defineProperty(c,e,null,f):c[e]=f,Ember.propertyDidChange(c,e))):c[e]=f),f},Ember.normalizeTuple=function(a,b){return j(a,b)},Ember.getWithDefault=function(a,c,d){var e=b(a,c);return e===undefined?d:e},Ember.get=b,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=c,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(a,b,d){return c(a,b,d,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(a){return e.test(a)},Ember.config.overrideAccessors&&(Ember.config.overrideAccessors(),b=Ember.get,c=Ember.set)}(),function(){var a=Ember.GUID_KEY,b=Ember.META_KEY,c=Ember.EMPTY_META,d=Ember.meta,e=Ember.create,f=Ember.platform.defineProperty,g=Ember.ENV.MANDATORY_SETTER,h=Ember.Descriptor=function(){};Ember.defineProperty=function(a,c,e,h,i){var j,k,l,m;return i||(i=d(a)),j=i.descs,k=i.descs[c],l=i.watching[c]>0,k instanceof Ember.Descriptor&&k.teardown(a,c),e instanceof Ember.Descriptor?(m=e,j[c]=e,g&&l?f(a,c,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):a[c]=undefined,e.setup(a,c)):(j[c]=undefined,e==null?(m=h,g&&l?(i.values[c]=h,f(a,c,{configurable:!0,enumerable:!0,set:function(){},get:function(){var a=this[b];return a&&a.values[c]}})):a[c]=h):(m=e,f(a,c,e))),l&&Ember.overrideChains(a,c,i),a.didDefineProperty&&a.didDefineProperty(a,c,m),this}}(),function(){function j(a,b,c,e){d&&!e?h.push(a,b,c):Ember.sendEvent(a,b,[a,c])}function k(){i.clear(),h.flush()}function l(b){return b+a}function m(a){return a+b}var a=":change",b=":before",c=Ember.guidFor,d=0,e=[].slice,f=function(){this.targetSet={}};f.prototype.add=function(a,b){var c=this.targetSet,d=Ember.guidFor(a),e=c[d];return e||(c[d]=e={}),e[b]?!1:e[b]=!0},f.prototype.clear=function(){this.targetSet={}};var g=function(){this.targetSet={},this.queue=[]};g.prototype.push=function(a,b,c){var d=this.targetSet,e=this.queue,f=Ember.guidFor(a),g=d[f],h;g||(d[f]=g={}),h=g[b],h===undefined?g[b]=e.push(Ember.deferEvent(a,b,[a,c]))-1:e[h]=Ember.deferEvent(a,b,[a,c])},g.prototype.flush=function(){var a=this.queue;this.queue=[],this.targetSet={};for(var b=0,c=a.length;b<c;++b)a[b]()};var h=new g,i=new f;Ember.beginPropertyChanges=function(){return d++,this},Ember.endPropertyChanges=function(){d--,d<=0&&k()},Ember.changeProperties=function(a,b){Ember.beginPropertyChanges();try{a.call(b)}finally{Ember.endPropertyChanges()}},Ember.setProperties=function(a,b){return Ember.changeProperties(function(){for(var c in b)b.hasOwnProperty(c)&&Ember.set(a,c,b[c])}),a},Ember.addObserver=function(a,b,c,d){return Ember.addListener(a,l(b),c,d),Ember.watch(a,b),this},Ember.observersFor=function(a,b){return Ember.listenersFor(a,l(b))},Ember.removeObserver=function(a,b,c,d){return Ember.unwatch(a,b),Ember.removeListener(a,l(b),c,d),this},Ember.addBeforeObserver=function(a,b,c,d){return Ember.addListener(a,m(b),c,d),Ember.watch(a,b),this},Ember._suspendBeforeObserver=function(a,b,c,d,e){return Ember._suspendListener(a,m(b),c,d,e)},Ember._suspendObserver=function(a,b,c,d,e){return Ember._suspendListener(a,l(b),c,d,e)},Ember.beforeObserversFor=function(a,b){return Ember.listenersFor(a,m(b))},Ember.removeBeforeObserver=function(a,b,c,d){return Ember.unwatch(a,b),Ember.removeListener(a,m(b),c,d),this},Ember.notifyObservers=function(a,b){if(a.isDestroying)return;j(a,l(b),b)},Ember.notifyBeforeObservers=function(a,b){if(a.isDestroying)return;var c,e,f=!1;if(d){if(!i.add(a,b))return;f=!0}j(a,m(b),b,f)}}(),function(){function n(a){return a.match(j)[0]}function o(a){return a==="*"||!k.test(a)}function q(b,c,d,e,f){var g=a(c);e[g]||(e[g]={});if(e[g][d])return;e[g][d]=!0;var h=f.deps;h=h&&h[d];if(h)for(var i in h){if(p[i])continue;b(c,i)}}function t(a,b,c){if(a.isDestroying)return;var d=r,e=!d;e&&(d=r={}),q(G,a,b,d,c),e&&(r=null)}function u(a,b,c){if(a.isDestroying)return;var d=s,e=!d;e&&(d=s={}),q(H,a,b,d,c),e&&(s=null)}function v(c,d,e){if(!c||"object"!=typeof c)return;var f=b(c),g=f.chainWatchers;if(!g||g.__emberproto__!==c)g=f.chainWatchers={__emberproto__:c};g[d]||(g[d]={}),g[d][a(e)]=e,Ember.watch(c,d)}function w(c,d,e){if(!c||"object"!=typeof c)return;var f=b(c,!1),g=f.chainWatchers;if(!g||g.__emberproto__!==c)return;g[d]&&delete g[d][a(e)],Ember.unwatch(c,d)}function y(){if(x.length===0)return;var a=x;x=[],i.call(a,function(a){a[0].add(a[1])})}function z(a){return b(a,!1).proto===a}function C(a){var c=b(a),d=c.chains;return d?d.value()!==a&&(d=c.chains=d.copy(a)):d=c.chains=new A(null,null,a),d}function D(a,b,c,d,e){var f=b.chainWatchers;if(!f||f.__emberproto__!==a)return;f=f[c];if(!f)return;for(var g in f){if(!f.hasOwnProperty(g))continue;f[g][d](e)}}function E(a,b,c){D(a,c,b,"willChange")}function F(a,b,c){D(a,c,b,"didChange")}function G(a,c,d){var e=b(a,!1),f=e.watching[c]>0||c==="length",g=e.proto,h=e.descs[c];if(!f)return;if(g===a)return;h&&h.willChange&&h.willChange(a,c),t(a,c,e),E(a,c,e),Ember.notifyBeforeObservers(a,c)}function H(a,c){var d=b(a,!1),e=d.watching[c]>0||c==="length",f=d.proto,g=d.descs[c];if(f===a)return;g&&g.didChange&&g.didChange(a,c);if(!e&&c!=="length")return;u(a,c,d),F(a,c,d),Ember.notifyObservers(a,c)}var a=Ember.guidFor,b=Ember.meta,c=Ember.get,d=Ember.set,e=Ember.normalizeTuple,f=Ember.GUID_KEY,g=Ember.META_KEY,h=Ember.notifyObservers,i=Ember.ArrayPolyfills.forEach,j=/^([^\.\*]+)/,k=/[\.\*]/,l=Ember.ENV.MANDATORY_SETTER,m=Ember.platform.defineProperty,p={__emberproto__:!0},r,s,x=[],A=function(a,b,c,d){var e;this._parent=a,this._key=b,this._watching=c===undefined,this._value=c,this._separator=d||".",this._paths={},this._watching&&(this._object=a.value(),this._object&&v(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},B=A.prototype;B.value=function(){if(this._value===undefined&&this._watching){var a=this._parent.value();this._value=a&&!z(a)?c(a,this._key):undefined}return this._value},B.destroy=function(){if(this._watching){var a=this._object;a&&w(a,this._key,this),this._watching=!1}},B.copy=function(a){var b=new A(null,null,a,this._separator),c=this._paths,d;for(d in c){if(c[d]<=0)continue;b.add(d)}return b},B.add=function(a){var b,c,d,f,g,h;h=this._paths,h[a]=(h[a]||0)+1,b=this.value(),c=e(b,a);if(c[0]&&c[0]===b)a=c[1],d=n(a),a=a.slice(d.length+1);else{if(!c[0]){x.push([this,a]),c.length=0;return}f=c[0],d=a.slice(0,0-(c[1].length+1)),g=a.slice(d.length,d.length+1),a=c[1]}c.length=0,this.chain(d,a,f,g)},B.remove=function(a){var b,c,d,f,g;g=this._paths,g[a]>0&&g[a]--,b=this.value(),c=e(b,a),c[0]===b?(a=c[1],d=n(a),a=a.slice(d.length+1)):(f=c[0],d=a.slice(0,0-(c[1].length+1)),a=c[1]),c.length=0,this.unchain(d,a)},B.count=0,B.chain=function(a,b,c,d){var e=this._chains,f;e||(e=this._chains={}),f=e[a],f||(f=e[a]=new A(this,a,c,d)),f.count++,b&&b.length>0&&(a=n(b),b=b.slice(a.length+1),f.chain(a,b))},B.unchain=function(a,b){var c=this._chains,d=c[a];b&&b.length>1&&(a=n(b),b=b.slice(a.length+1),d.unchain(a,b)),d.count--,d.count<=0&&(delete c[d._key],d.destroy())},B.willChange=function(){var a=this._chains;if(a)for(var b in a){if(!a.hasOwnProperty(b))continue;a[b].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},B.chainWillChange=function(a,b,c){this._key&&(b=this._key+this._separator+b),this._parent?this._parent.chainWillChange(this,b,c+1):(c>1&&Ember.propertyWillChange(this.value(),b),b="this."+b,this._paths[b]>0&&Ember.propertyWillChange(this.value(),b))},B.chainDidChange=function(a,b,c){this._key&&(b=this._key+this._separator+b),this._parent?this._parent.chainDidChange(this,b,c+1):(c>1&&Ember.propertyDidChange(this.value(),b),b="this."+b,this._paths[b]>0&&Ember.propertyDidChange(this.value(),b))},B.didChange=function(a){if(this._watching){var b=this._parent.value();b!==this._object&&(w(this._object,this._key,this),this._object=b,v(b,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var c=this._chains;if(c)for(var d in c){if(!c.hasOwnProperty(d))continue;c[d].didChange(a)}if(a)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(a,b,c){D(a,c,b,"didChange",!0)},Ember.watch=function(a,c){if(c==="length"&&Ember.typeOf(a)==="array")return this;var d=b(a),e=d.watching,f;return e[c]?e[c]=(e[c]||0)+1:(e[c]=1,o(c)?(f=d.descs[c],f&&f.willWatch&&f.willWatch(a,c),"function"==typeof a.willWatchProperty&&a.willWatchProperty(c),l&&c in a&&(d.values[c]=a[c],m(a,c,{configurable:!0,enumerable:!0,set:function(){},get:function(){var a=this[g];return a&&a.values[c]}}))):C(a).add(c)),this},Ember.isWatching=function(b,c){var d=b[g];return(d&&d.watching[c])>0},Ember.watch.flushPending=y,Ember.unwatch=function(a,c){if(c==="length"&&Ember.typeOf(a)==="array")return this;var d=b(a),e=d.watching,f;return e[c]===1?(e[c]=0,o(c)?(f=d.descs[c],f&&f.didUnwatch&&f.didUnwatch(a,c),"function"==typeof a.didUnwatchProperty&&a.didUnwatchProperty(c),l&&c in a&&(m(a,c,{configurable:!0,enumerable:!0,writable:!0,value:d.values[c]}),delete d.values[c])):C(a).remove(c)):e[c]>1&&e[c]--,this},Ember.rewatch=function(a){var c=b(a,!1),d=c.chains;return f in a&&!a.hasOwnProperty(f)&&Ember.generateGuid(a,"ember"),d&&d.value()!==a&&(c.chains=d.copy(a)),this},Ember.finishChains=function(a){var c=b(a,!1),d=c.chains;d&&(d.value()!==a&&(c.chains=d=d.copy(a)),d.didChange(!0))},Ember.propertyWillChange=G,Ember.propertyDidChange=H;var I=[];Ember.destroy=function(a){var b=a[g],c,d,e,f;if(b){a[g]=null,c=b.chains;if(c){I.push(c);while(I.length>0){c=I.pop(),d=c._chains;if(d)for(e in d)d.hasOwnProperty(e)&&I.push(d[e]);c._watching&&(f=c._object,f&&w(f,c._key,c))}}}}}(),function(){function i(a,b,c){var d=b[c];return d?d.__emberproto__!==a&&(d=b[c]=e(d),d.__emberproto__=a):d=b[c]={__emberproto__:a},d}function j(a,b){var c=b.deps;return c?c.__emberproto__!==a&&(c=b.deps=e(c),c.__emberproto__=a):c=b.deps={__emberproto__:a},c}function k(a,b,c,d){var e=a._dependentKeys,f,h,k,l,m;if(!e)return;f=j(b,d);for(h=0,k=e.length;h<k;h++)l=e[h],m=i(b,f,l),m[c]=(m[c]||0)+1,g(b,l)}function l(a,b,c,d){var e=a._dependentKeys,f,g,k,l,m;if(!e)return;f=j(b,d);for(g=0,k=e.length;g<k;g++)l=e[g],m=i(b,f,l),m[c]=(m[c]||0)-1,h(b,l)}function m(a,b){this.func=a,this._cacheable=b&&b.cacheable!==undefined?b.cacheable:Ember.CP_DEFAULT_CACHEABLE,this._dependentKeys=b&&b.dependentKeys}var a=Ember.get,b=Ember.meta,c=Ember.guidFor,d=[].slice,e=Ember.create,f=Ember.META_KEY,g=Ember.watch,h=Ember.unwatch;Ember.ComputedProperty=m,m.prototype=new Ember.Descriptor;var n=m.prototype;n.cacheable=function(a){return this._cacheable=a!==!1,this},n.volatile=function(){return this.cacheable(!1)},n.property=function(){var a=[];for(var b=0,c=arguments.length;b<c;b++)a.push(arguments[b]);return this._dependentKeys=a,this},n.meta=function(a){return arguments.length===0?this._meta||{}:(this._meta=a,this)},n.willWatch=function(a,b){var c=a[f];b in c.cache||k(this,a,b,c)},n.didUnwatch=function(a,b){var c=a[f];b in c.cache||l(this,a,b,c)},n.didChange=function(a,c){if(this._cacheable&&this._suspended!==a){var d=b(a);c in d.cache&&(delete d.cache[c],d.watching[c]||l(this,a,c,d))}},n.get=function(a,c){var d,e,f;if(this._cacheable){f=b(a),e=f.cache;if(c in e)return e[c];d=e[c]=this.func.call(a,c),f.watching[c]||k(this,a,c,f)}else d=this.func.call(a,c);return d},n.set=function(a,c,d){var e=this._cacheable,f=b(a,e),g=f.watching[c],h=this._suspended,i,j;return this._suspended=a,g&&Ember.propertyWillChange(a,c),e&&c in f.cache&&(delete f.cache[c],i=!0),j=this.func.call(a,c,d),e&&(!g&&!i&&k(this,a,c,f),f.cache[c]=j),g&&Ember.propertyDidChange(a,c),this._suspended=h,j},n.setup=function(a,c){var d=a[f];d&&d.watching[c]&&k(this,a,c,b(a))},n.teardown=function(a,c){var d=b(a);return(d.watching[c]||c in d.cache)&&l(this,a,c,d),this._cacheable&&delete d.cache[c],null},Ember.computed=function(a){var b;arguments.length>1&&(b=d.call(arguments,0,-1),a=d.call(arguments,-1)[0]);var c=new m(a);return b&&c.property.apply(c,b),c},Ember.cacheFor=function(c,d){var e=b(c,!1).cache;if(e&&d in e)return e[d]},Ember.computed.not=function(b){return Ember.computed(b,function(c){return!a(this,b)}).cacheable()},Ember.computed.empty=function(b){return Ember.computed(b,function(c){var d=a(this,b);return d===undefined||d===null||d===""||Ember.isArray(d)&&a(d,"length")===0}).cacheable()},Ember.computed.bool=function(b){return Ember.computed(b,function(c){return!!a(this,b)}).cacheable()}}(),function(){function f(a,b,e,f){return c(a,["listeners",b,d(e)],f)}function g(a,c){var d=b(a,!1).listeners;return d?d[c]||!1:!1}function i(a,b,c,d){var e=g(a,b);if(!e)return!1;for(var f in e){if(h[f])continue;var i=e[f];if(i)for(var j in i){if(h[j])continue;var k=i[j];if(k&&c(k,d,a)===!0)return!0}}return!1}function j(a,b,c){var d=a.method,e=a.target;e||(e=c),"string"==typeof d&&(d=e[d]),b?d.apply(e,b):d.apply(e)}function k(a,b,c,e){!e&&"function"==typeof c&&(e=c,c=null);var g=f(a,b,c,!0),h=d(e);g[h]||(g[h]={target:c,method:e}),"function"==typeof a.didAddListener&&a.didAddListener(b,c,e)}function l(a,b,c,e){!e&&"function"==typeof c&&(e=c,c=null);var g=f(a,b,c,!0),h=d(e);g&&g[h]&&(g[h]=null),"function"==typeof a.didRemoveListener&&a.didRemoveListener(b,c,e)}function m(a,b,c,e,g){!e&&"function"==typeof c&&(e=c,c=null);var h=f(a,b,c,!0),i=d(e),j=h&&h[i];h[i]=null;try{return g.call(c)}finally{h[i]=j}}function n(a){var c=b(a,!1).listeners,d=[];if(c)for(var e in c)!h[e]&&c[e]&&d.push(e);return d}function o(a,b,c){return a!==Ember&&"function"==typeof a.sendEvent&&a.sendEvent(b,c),i(a,b,j,c),!0}function p(a,b,c){var d=[];return i(a,b,function(a){d.push(a)}),function(){if(a.isDestroyed)return;a!==Ember&&"function"==typeof a.sendEvent&&a.sendEvent(b,c);for(var e=0,f=d.length;e<f;++e)j(d[e],c,a)}}function q(a,b){if(i(a,b,function(){return!0}))return!0;var d=c(a,["listeners"],!0);return d[b]=null,!1}function r(a,b){var c=[];return i(a,b,function(a){c.push([a.target,a.method])}),c}var a=Ember.create,b=Ember.meta,c=Ember.metaPath,d=Ember.guidFor,e=[].slice,h={__ember_source__:!0};Ember.addListener=k,Ember.removeListener=l,Ember._suspendListener=m,Ember.sendEvent=o,Ember.hasListeners=q,Ember.watchedEvents=n,Ember.listenersFor=r,Ember.deferEvent=p}(),function(){function c(b,c,d,e){c===undefined&&(c=b,b=undefined),"string"==typeof c&&(c=b[c]),d&&e>0&&(d=d.length>e?a.call(d,e):null);if("function"!=typeof Ember.onerror)return c.apply(b||this,d||[]);try{return c.apply(b||this,d||[])}catch(f){Ember.onerror(f)}}function h(){g=null,f.currentRunLoop&&f.end()}function k(){j=null;var a=+(new Date),b=-1;for(var d in i){if(!i.hasOwnProperty(d))continue;var e=i[d];if(e&&e.expires)if(a>=e.expires)delete i[d],c(e.target,e.method,e.args,2);else if(b<0||e.expires<b)b=e.expires}b>0&&(j=setTimeout(k,b- +(new Date)))}function l(a,b){b[this.tguid]&&delete b[this.tguid][this.mguid],i[a]&&c(this.target,this.method,this.args,2),delete i[a]}function n(){m=null;for(var a in i){if(!i.hasOwnProperty(a))continue;var b=i[a];b.next&&(delete i[a],c(b.target,b.method,b.args,2))}}var a=[].slice,b=Ember.ArrayPolyfills.forEach,d,e=function(a){this._prev=a||null,this.onceTimers={}};e.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(b,c,d){var e=this._queues,f;e||(e=this._queues={}),f=e[b],f||(f=e[b]=[]);var g=arguments.length>3?a.call(arguments,3):null;return f.push({target:c,method:d,args:g}),this},flush:function(a){function j(a){c(a.target,a.method,a.args)}var e,f,g,h,i;if(!this._queues)return this;Ember.watch.flushPending();if(a)while(this._queues&&(h=this._queues[a])){this._queues[a]=null;if(a==="sync"){i=Ember.LOG_BINDINGS,i&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges();try{b.call(h,j)}finally{Ember.endPropertyChanges()}i&&Ember.Logger.log("End: Flush Sync Queue")}else b.call(h,j)}else{e=Ember.run.queues,g=e.length,f=0;a:while(f<g){a=e[f],h=this._queues&&this._queues[a],delete this._queues[a];if(h)if(a==="sync"){i=Ember.LOG_BINDINGS,i&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges();try{b.call(h,j)}finally{Ember.endPropertyChanges()}i&&Ember.Logger.log("End: Flush Sync Queue")}else b.call(h,j);for(var k=0;k<=f;k++)if(this._queues&&this._queues[e[k]]){f=k;continue a}f++}}return d=null,this}},Ember.RunLoop=e,Ember.run=function(a,b){var d,e;f.begin();try{if(a||b)d=c(a,b,arguments,2)}finally{f.end()}return d};var f=Ember.run;Ember.run.begin=function(){f.currentRunLoop=new e(f.currentRunLoop)},Ember.run.end=function(){try{f.currentRunLoop.end()}finally{f.currentRunLoop=f.currentRunLoop.prev()}},Ember.run.queues=["sync","actions","destroy","timers"],Ember.run.schedule=function(a,b,c){var d=f.autorun();d.schedule.apply(d,arguments)};var g;Ember.run.hasScheduledTimers=function(){return!!(g||j||m)},Ember.run.cancelTimers=function(){g&&(clearTimeout(g),g=null),j&&(clearTimeout(j),j=null),m&&(clearTimeout(m),m=null),i={}},Ember.run.autorun=function(){return f.currentRunLoop||(f.begin(),g||(g=setTimeout(h,1))),f.currentRunLoop},Ember.run.sync=function(){f.autorun(),f.currentRunLoop.flush("sync")};var i={},j;Ember.run.later=function(b,c){var d,e,g,h,j;return arguments.length===2&&"function"==typeof b?(j=c,c=b,b=undefined,d=[b,c]):(d=a.call(arguments),j=d.pop()),e=+(new Date)+j,g={target:b,method:c,expires:e,args:d},h=Ember.guidFor(g),i[h]=g,f.once(i,k),h},Ember.run.once=function(b,c){var d=Ember.guidFor(b),e=Ember.guidFor(c),g=f.autorun().onceTimers,h=g[d]&&g[d][e],j;return h&&i[h]?i[h].args=a.call(arguments):(j={target:b,method:c,args:a.call(arguments),tguid:d,mguid:e},h=Ember.guidFor(j),i[h]=j,g[d]||(g[d]={}),g[d][e]=h,f.schedule("actions",j,l,h,g)),h};var m;Ember.run.next=function(b,c){var d,e={target:b,method:c,args:a.call(arguments),next:!0};return d=Ember.guidFor(e),i[d]=e,m||(m=setTimeout(n,1)),d},Ember.run.cancel=function(a){delete i[a]}}(),function(){function e(b,c){return a(d(c)?window:b,c)}function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var a=Ember.get,b=Ember.set,c=Ember.guidFor,d=Ember.isGlobalPath,f=function(a,b){this._direction="fwd",this._from=b,this._to=a,this._directionMap=Ember.Map.create()};f.prototype={copy:function(){var a=new f(this._to,this._from);return this._oneWay&&(a._oneWay=!0),a},from:function(a){return this._from=a,this},to:function(a){return this._to=a,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var a=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+c(this)+">("+this._from+" -> "+this._to+")"+a},connect:function(a){var b=this._from,c=this._to;return Ember.trySet(a,c,e(a,b)),Ember.addObserver(a,b,this,this.fromDidChange),this._oneWay||Ember.addObserver(a,c,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(a){var b=!this._oneWay;return Ember.removeObserver(a,this._from,this,this.fromDidChange),b&&Ember.removeObserver(a,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(a){this._scheduleSync(a,"fwd")},toDidChange:function(a){this._scheduleSync(a,"back")},_scheduleSync:function(a,b){var c=this._directionMap,d=c.get(a);d||(Ember.run.schedule("sync",this,this._sync,a),c.set(a,b)),d==="back"&&b==="fwd"&&c.set(a,"fwd")},_sync:function(b){var c=Ember.LOG_BINDINGS;if(b.isDestroyed||!this._readyToSync)return;var d=this._directionMap,f=d.get(b),g=this._from,h=this._to;d.remove(b);if(f==="fwd"){var i=e(b,this._from);c&&Ember.Logger.log(" ",this.toString(),"->",i,b),this._oneWay?Ember.trySet(b,h,i):Ember._suspendObserver(b,h,this,this.toDidChange,function(){Ember.trySet(b,h,i)})}else if(f==="back"){var j=a(b,this._to);c&&Ember.Logger.log(" ",this.toString(),"<-",j,b),Ember._suspendObserver(b,g,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(g)?window:b,g,j)})}}},g(f,{from:function(){var a=this,b=new a;return b.from.apply(b,arguments)},to:function(){var a=this,b=new a;return b.to.apply(b,arguments)},oneWay:function(a,b){var c=this,d=new c(null,a);return d.oneWay(b)}}),Ember.Binding=f,Ember.bind=function(a,b,c){return(new Ember.Binding(b,c)).connect(a)},Ember.oneWay=function(a,b,c){return(new Ember.Binding(b,c)).oneWay().connect(a)}}(),function(){function o(a){var b=Ember.meta(a,!0),c=b.mixins;return c?c.__emberproto__!==a&&(c=b.mixins=l(c),c.__emberproto__=a):c=b.mixins={__emberproto__:a},c}function p(b,c){return c&&c.length>0&&(b.mixins=f.call(c,function(b){if(b instanceof a)return b;var c=new a;return c.properties=b,c})),b}function q(a){return"function"==typeof a&&a.isMethod!==!1&&a!==Boolean&&a!==Object&&a!==Number&&a!==Array&&a!==Date&&a!==String}function r(c,d,e,f,i){function v(a){delete e[a],delete f[a]}var j=c.length,k,l,m,o,p,s,t,u;for(k=0;k<j;k++){l=c[k];if(l instanceof a){m=n(l);if(d[m])continue;d[m]=l,o=l.properties}else o=l;if(o){u=f.concatenatedProperties||i.concatenatedProperties,o.concatenatedProperties&&(u=u?u.concat(o.concatenatedProperties):o.concatenatedProperties);for(s in o){if(!o.hasOwnProperty(s))continue;p=o[s];if(p instanceof Ember.Descriptor){if(p===b&&e[s])continue;e[s]=p,f[s]=undefined}else{if(q(p)){t=e[s]===undefined&&f[s],t||(t=i[s]),"function"!=typeof t&&(t=null);if(t){var w=p.__ember_observes__,x=p.__ember_observesBefore__;p=Ember.wrap(p,t),p.__ember_observes__=w,p.__ember_observesBefore__=x}}else if(u&&g.call(u,s)>=0||s==="concatenatedProperties"){var y=f[s]||i[s];p=y?y.concat(p):Ember.makeArray(p)}e[s]=undefined,f[s]=p}}o.hasOwnProperty("toString")&&(i.toString=o.toString)}else l.mixins&&(r(l.mixins,d,e,f,i),l._without&&h.call(l._without,v))}}function s(a){var b=Ember.meta(a),c=b.required;if(!c||c.__emberproto__!==a)c=b.required=c?l(c):{__ember_count__:0},c.__emberproto__=a;return c}function u(a,b,c,d){if(t.test(b)){var e=d.bindings;e?e.__emberproto__!==a&&(e=d.bindings=l(d.bindings),e.__emberproto__=a):e=d.bindings={__emberproto__:a},e[b]=c}}function v(a,b){var c=b.bindings,d,e,f;if(c){for(d in c)e=d!=="__emberproto__"&&c[d],e&&(f=d.slice(0,-7),e instanceof Ember.Binding?(e=e.copy(),e.to(f)):e=new Ember.Binding(f,e),e.connect(a),a[d]=e);b.bindings={__emberproto__:a}}}function w(a,b){return v(a,b||Ember.meta(a)),a}function x(a,d,e){var f={},g={},h=Ember.meta(a),i=h.required,j,l,n,p,q,t,v;r(d,o(a),f,g,a);for(j in g){if(j==="contructor")continue;if(!g.hasOwnProperty(j))continue;n=f[j],l=g[j];if(n===b)j in a||(i=s(a),i.__ember_count__++,i[j]=!0);else{while(n&&n instanceof c){var x=n.methodName;f[x]||g[x]?(l=g[x],n=f[x]):h.descs[x]?(n=h.descs[x],l=undefined):(n=undefined,l=a[x])}if(n===undefined&&l===undefined)continue;p=a[j];if("function"==typeof p)if(q=p.__ember_observesBefore__){t=q.length;for(v=0;v<t;v++)Ember.removeBeforeObserver(a,q[v],null,j)}else if(q=p.__ember_observes__){t=q.length;for(v=0;v<t;v++)Ember.removeObserver(a,q[v],null,j)}u(a,j,l,h),m(a,j,n,l,h);if("function"==typeof l)if(q=l.__ember_observesBefore__){t=q.length;for(v=0;v<t;v++)Ember.addBeforeObserver(a,q[v],null,j)}else if(q=l.__ember_observes__){t=q.length;for(v=0;v<t;v++)Ember.addObserver(a,q[v],null,j)}i&&i[j]&&(i=s(a),i.__ember_count__--,i[j]=!1)}}e||w(a,h);if(!e&&i&&i.__ember_count__>0){var y=[];for(j in i){if(k[j])continue;y.push(j)}}return a
+}function z(a,b,c){var d=n(a);if(c[d])return!1;c[d]=!0;if(a===b)return!0;var e=a.mixins,f=e?e.length:0;while(--f>=0)if(z(e[f],b,c))return!0;return!1}function A(a,b,c){if(c[n(b)])return;c[n(b)]=!0;if(b.properties){var d=b.properties;for(var e in d)d.hasOwnProperty(e)&&(a[e]=!0)}else b.mixins&&h.call(b.mixins,function(b){A(a,b,c)})}function D(a,b,c){var e=a.length;for(var f in b){if(!b.hasOwnProperty||!b.hasOwnProperty(f))continue;var g=b[f];a[e]=f;if(g&&g.toString===d)g[B]=a.join(".");else if(g&&C(g,"isNamespace")){if(c[n(g)])continue;c[n(g)]=!0,D(a,g,c)}}a.length=e}function E(){var a=Ember.Namespace,b,c;if(a.PROCESSED)return;for(var d in window){if(d==="globalStorage"&&window.StorageList&&window.globalStorage instanceof window.StorageList)continue;if(window.hasOwnProperty&&!window.hasOwnProperty(d))continue;try{b=window[d],c=b&&C(b,"isNamespace")}catch(e){continue}c&&(b[B]=d)}}var a,b,c,d,e,f=Ember.ArrayPolyfills.map,g=Ember.ArrayPolyfills.indexOf,h=Ember.ArrayPolyfills.forEach,i=[].slice,j={},k={__emberproto__:!0,__ember_count__:!0},l=Ember.create,m=Ember.defineProperty,n=Ember.guidFor,t=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(a){var b=i.call(arguments,1);return x(a,b,!1),a},Ember.Mixin=function(){return p(this,arguments)},a=Ember.Mixin,a._apply=x,a.applyPartial=function(a){var b=i.call(arguments,1);return x(a,b,!0)},a.finishPartial=w,a.create=function(){d.processed=!1;var a=this;return p(new a,arguments)};var y=a.prototype;y.reopen=function(){var b,c;this.properties?(b=a.create(),b.properties=this.properties,delete this.properties,this.mixins=[b]):this.mixins||(this.mixins=[]);var d=arguments.length,e=this.mixins,f;for(f=0;f<d;f++)b=arguments[f],b instanceof a?e.push(b):(c=a.create(),c.properties=b,e.push(c));return this},y.apply=function(a){return x(a,[this],!1)},y.applyPartial=function(a){return x(a,[this],!0)},y.detect=function(b){if(!b)return!1;if(b instanceof a)return z(b,this,{});var c=Ember.meta(b,!1).mixins;return c?!!c[n(this)]:!1},y.without=function(){var b=new a(this);return b._without=i.call(arguments),b},y.keys=function(){var a={},b={},c=[];A(a,this,b);for(var d in a)a.hasOwnProperty(d)&&c.push(d);return c};var B=Ember.GUID_KEY+"_name",C=Ember.get;Ember.identifyNamespaces=E,e=function(a){var b=a.superclass;if(b)return b[B]?b[B]:e(b);return},d=function(){var a=Ember.Namespace,b;if(a&&!this[B]&&!d.processed){a.PROCESSED||(E(),a.PROCESSED=!0),d.processed=!0;var c=a.NAMESPACES;for(var f=0,g=c.length;f<g;f++)b=c[f],D([b.toString()],b,{})}if(this[B])return this[B];var h=e(this);return h?"(subclass of "+h+")":"(unknown mixin)"},y.toString=d,a.mixins=function(a){var b=[],c=Ember.meta(a,!1).mixins,d,e;if(c)for(d in c){if(k[d])continue;e=c[d],e.properties||b.push(c[d])}return b},b=new Ember.Descriptor,b.toString=function(){return"(Required Property)"},Ember.required=function(){return b},c=function(a){this.methodName=a},c.prototype=new Ember.Descriptor,Ember.alias=function(a){return new c(a)},Ember.observer=function(a){var b=i.call(arguments,1);return a.__ember_observes__=b,a},Ember.immediateObserver=function(){for(var a=0,b=arguments.length;a<b;a++)var c=arguments[a];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(a){var b=i.call(arguments,1);return a.__ember_observesBefore__=b,a}}(),function(){}(),function(){}(),function(){function e(b,c,d,f){var g,h,i;if("object"!=typeof b||b===null)return b;if(c&&(h=a(d,b))>=0)return f[h];if(Ember.typeOf(b)==="array"){g=b.slice();if(c){h=g.length;while(--h>=0)g[h]=e(g[h],c,d,f)}}else if(Ember.Copyable&&Ember.Copyable.detect(b))g=b.copy(c,d,f);else{g={};for(i in b){if(!b.hasOwnProperty(i))continue;g[i]=c?e(b[i],c,d,f):b[i]}}return c&&(d.push(b),f.push(g)),g}var a=Ember.EnumerableUtils.indexOf,b={},c="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(c,function(a){b["[object "+a+"]"]=a.toLowerCase()});var d=Object.prototype.toString;Ember.typeOf=function(a){var c;return c=a===null||a===undefined?String(a):b[d.call(a)]||"object",c==="function"?Ember.Object&&Ember.Object.detect(a)&&(c="class"):c==="object"&&(a instanceof Error?c="error":Ember.Object&&a instanceof Ember.Object?c="instance":c="object"),c},Ember.none=function(a){return a===null||a===undefined},Ember.empty=function(a){return a===null||a===undefined||a.length===0&&typeof a!="function"},Ember.compare=function f(a,b){if(a===b)return 0;var c=Ember.typeOf(a),d=Ember.typeOf(b),e=Ember.Comparable;if(e){if(c==="instance"&&e.detect(a.constructor))return a.constructor.compare(a,b);if(d==="instance"&&e.detect(b.constructor))return 1-b.constructor.compare(b,a)}var g=Ember.ORDER_DEFINITION_MAPPING;if(!g){var h=Ember.ORDER_DEFINITION;g=Ember.ORDER_DEFINITION_MAPPING={};var i,j;for(i=0,j=h.length;i<j;++i)g[h[i]]=i;delete Ember.ORDER_DEFINITION}var k=g[c],l=g[d];if(k<l)return-1;if(k>l)return 1;switch(c){case"boolean":case"number":if(a<b)return-1;if(a>b)return 1;return 0;case"string":var m=a.localeCompare(b);if(m<0)return-1;if(m>0)return 1;return 0;case"array":var n=a.length,o=b.length,p=Math.min(n,o),q=0,r=0;while(q===0&&r<p)q=f(a[r],b[r]),r++;if(q!==0)return q;if(n<o)return-1;if(n>o)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(a))return a.compare(a,b);return 0;case"date":var s=a.getTime(),t=b.getTime();if(s<t)return-1;if(s>t)return 1;return 0;default:return 0}},Ember.copy=function(a,b){return"object"!=typeof a||a===null?a:Ember.Copyable&&Ember.Copyable.detect(a)?a.copy(b):e(a,b,b?[]:null,b?[]:null)},Ember.inspect=function(a){var b,c=[];for(var d in a)if(a.hasOwnProperty(d)){b=a[d];if(b==="toString")continue;Ember.typeOf(b)==="function"&&(b="function() { ... }"),c.push(d+": "+b)}return"{"+c.join(" , ")+"}"},Ember.isEqual=function(a,b){return a&&"function"==typeof a.isEqual?a.isEqual(b):a===b},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,Ember.keys||(Ember.keys=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b}),Ember.Error=function(){var a=Error.prototype.constructor.apply(this,arguments);for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);this.message=a.message},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){var a=/[ _]/g,b={},c=/([a-z])([A-Z])/g,d=/(\-|_|\s)+(.)?/g,e=/([a-z\d])([A-Z]+)/g,f=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(a,b){var c=0;return a.replace(/%@([0-9]+)?/g,function(a,d){return d=d?parseInt(d,0)-1:c++,a=b[d],(a===null?"(null)":a===undefined?"":a).toString()})},loc:function(a,b){return a=Ember.STRINGS[a]||a,Ember.String.fmt(a,b)},w:function(a){return a.split(/\s+/)},decamelize:function(a){return a.replace(c,"$1_$2").toLowerCase()},dasherize:function(c){var d=b,e=d[c];return e?e:(e=Ember.String.decamelize(c).replace(a,"-"),d[c]=e,e)},camelize:function(a){return a.replace(d,function(a,b,c){return c?c.toUpperCase():""})},classify:function(a){var b=Ember.String.camelize(a);return b.charAt(0).toUpperCase()+b.substr(1)},underscore:function(a){return a.replace(e,"$1_$2").replace(f,"_").toLowerCase()}}}(),function(){var a=Ember.String.fmt,b=Ember.String.w,c=Ember.String.loc,d=Ember.String.camelize,e=Ember.String.decamelize,f=Ember.String.dasherize,g=Ember.String.underscore;Ember.EXTEND_PROTOTYPES&&(String.prototype.fmt=function(){return a(this,arguments)},String.prototype.w=function(){return b(this)},String.prototype.loc=function(){return c(this,arguments)},String.prototype.camelize=function(){return d(this)},String.prototype.decamelize=function(){return e(this)},String.prototype.dasherize=function(){return f(this)},String.prototype.underscore=function(){return g(this)})}(),function(){var a=Array.prototype.slice;Ember.EXTEND_PROTOTYPES&&(Function.prototype.property=function(){var a=Ember.computed(this);return a.property.apply(a,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=a.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=a.call(arguments),this})}(),function(){}(),function(){function f(){return e.length===0?{}:e.pop()}function g(a){return e.push(a),null}function h(b,c){function e(e){var f=a(e,b);return d?c===f:!!f}var d=arguments.length===2;return e}var a=Ember.get,b=Ember.set,c=Array.prototype.slice,d=Ember.EnumerableUtils.indexOf,e=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(a(this,"length")===0)return undefined;var b=f(),c;return c=this.nextObject(0,null,b),g(b),c}).property("[]").cacheable(),lastObject:Ember.computed(function(){var b=a(this,"length");if(b===0)return undefined;var c=f(),d=0,e,h=null;do h=e,e=this.nextObject(d++,h,c);while(e!==undefined);return g(c),h}).property("[]").cacheable(),contains:function(a){return this.find(function(b){return b===a})!==undefined},forEach:function(b,c){if(typeof b!="function")throw new TypeError;var d=a(this,"length"),e=null,h=f();c===undefined&&(c=null);for(var i=0;i<d;i++){var j=this.nextObject(i,e,h);b.call(c,j,i,this),e=j}return e=null,h=g(h),this},getEach:function(a){return this.mapProperty(a)},setEach:function(a,c){return this.forEach(function(d){b(d,a,c)})},map:function(a,b){var c=[];return this.forEach(function(d,e,f){c[e]=a.call(b,d,e,f)}),c},mapProperty:function(b){return this.map(function(c){return a(c,b)})},filter:function(a,b){var c=[];return this.forEach(function(d,e,f){a.call(b,d,e,f)&&c.push(d)}),c},filterProperty:function(a,b){return this.filter(h.apply(this,arguments))},find:function(b,c){var d=a(this,"length");c===undefined&&(c=null);var e=null,h,i=!1,j,k=f();for(var l=0;l<d&&!i;l++){h=this.nextObject(l,e,k);if(i=b.call(c,h,l,this))j=h;e=h}return h=e=null,k=g(k),j},findProperty:function(a,b){return this.find(h.apply(this,arguments))},every:function(a,b){return!this.find(function(c,d,e){return!a.call(b,c,d,e)})},everyProperty:function(a,b){return this.every(h.apply(this,arguments))},some:function(a,b){return!!this.find(function(c,d,e){return!!a.call(b,c,d,e)})},someProperty:function(a,b){return this.some(h.apply(this,arguments))},reduce:function(a,b,c){if(typeof a!="function")throw new TypeError;var d=b;return this.forEach(function(b,e){d=a.call(null,d,b,e,this,c)},this),d},invoke:function(a){var b,d=[];return arguments.length>1&&(b=c.call(arguments,1)),this.forEach(function(c,e){var f=c&&c[a];"function"==typeof f&&(d[e]=b?f.apply(c,b):f.call(c))},this),d},toArray:function(){var a=[];return this.forEach(function(b,c){a[c]=b}),a},compact:function(){return this.without(null)},without:function(a){if(!this.contains(a))return this;var b=[];return this.forEach(function(c){c!==a&&(b[b.length]=c)}),b},uniq:function(){var a=[];return this.forEach(function(b){d(a,b)<0&&a.push(b)}),a},"[]":Ember.computed(function(a,b){return this}).property().cacheable(),addEnumerableObserver:function(b,c){var d=c&&c.willChange||"enumerableWillChange",e=c&&c.didChange||"enumerableDidChange",f=a(this,"hasEnumerableObservers");return f||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",b,d),Ember.addListener(this,"@enumerable:change",b,e),f||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(b,c){var d=c&&c.willChange||"enumerableWillChange",e=c&&c.didChange||"enumerableDidChange",f=a(this,"hasEnumerableObservers");return f&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",b,d),Ember.removeListener(this,"@enumerable:change",b,e),f&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}).property().cacheable(),enumerableContentWillChange:function(b,c){var d,e,f;return"number"==typeof b?d=b:b?d=a(b,"length"):d=b=-1,"number"==typeof c?e=c:c?e=a(c,"length"):e=c=-1,f=e<0||d<0||e-d!==0,b===-1&&(b=null),c===-1&&(c=null),Ember.propertyWillChange(this,"[]"),f&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,b,c]),this},enumerableContentDidChange:function(b,c){var d=this.propertyDidChange,e,f,g;return"number"==typeof b?e=b:b?e=a(b,"length"):e=b=-1,"number"==typeof c?f=c:c?f=a(c,"length"):f=c=-1,g=f<0||e<0||f-e!==0,b===-1&&(b=null),c===-1&&(c=null),Ember.sendEvent(this,"@enumerable:change",[this,b,c]),g&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function f(a){return a===null||a===undefined}var a=Ember.get,b=Ember.set,c=Ember.meta,d=Ember.EnumerableUtils.map,e=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(b){return b<0||b>=a(this,"length")?undefined:a(this,b)},objectsAt:function(a){var b=this;return d(a,function(a){return b.objectAt(a)})},nextObject:function(a){return this.objectAt(a)},"[]":Ember.computed(function(b,c){return c!==undefined&&this.replace(0,a(this,"length"),c),this}).property().cacheable(),firstObject:Ember.computed(function(){return this.objectAt(0)}).property().cacheable(),lastObject:Ember.computed(function(){return this.objectAt(a(this,"length")-1)}).property().cacheable(),contains:function(a){return this.indexOf(a)>=0},slice:function(b,c){var d=[],e=a(this,"length");f(b)&&(b=0);if(f(c)||c>e)c=e;while(b<c)d[d.length]=this.objectAt(b++);return d},indexOf:function(b,c){var d,e=a(this,"length");c===undefined&&(c=0),c<0&&(c+=e);for(d=c;d<e;d++)if(this.objectAt(d,!0)===b)return d;return-1},lastIndexOf:function(b,c){var d,e=a(this,"length");if(c===undefined||c>=e)c=e-1;c<0&&(c+=e);for(d=c;d>=0;d--)if(this.objectAt(d)===b)return d;return-1},addArrayObserver:function(b,c){var d=c&&c.willChange||"arrayWillChange",e=c&&c.didChange||"arrayDidChange",f=a(this,"hasArrayObservers");return f||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",b,d),Ember.addListener(this,"@array:change",b,e),f||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(b,c){var d=c&&c.willChange||"arrayWillChange",e=c&&c.didChange||"arrayDidChange",f=a(this,"hasArrayObservers");return f&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",b,d),Ember.removeListener(this,"@array:change",b,e),f&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}).property().cacheable(),arrayContentWillChange:function(b,c,d){b===undefined?(b=0,c=d=-1):(c===undefined&&(c=-1),d===undefined&&(d=-1)),Ember.isWatching(this,"@each")&&a(this,"@each"),Ember.sendEvent(this,"@array:before",[this,b,c,d]);var e,f;if(b>=0&&c>=0&&a(this,"hasEnumerableObservers")){e=[],f=b+c;for(var g=b;g<f;g++)e.push(this.objectAt(g))}else e=c;return this.enumerableContentWillChange(e,d),this},arrayContentDidChange:function(b,c,d){b===undefined?(b=0,c=d=-1):(c===undefined&&(c=-1),d===undefined&&(d=-1));var f,g;if(b>=0&&d>=0&&a(this,"hasEnumerableObservers")){f=[],g=b+d;for(var h=b;h<g;h++)f.push(this.objectAt(h))}else f=d;this.enumerableContentDidChange(c,f),Ember.sendEvent(this,"@array:change",[this,b,c,d]);var i=a(this,"length"),j=e(this,"firstObject"),k=e(this,"lastObject");return this.objectAt(0)!==j&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(i-1)!==k&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each}).property().cacheable()})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var a=Ember.get,b=Ember.set;Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return a(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var a=Ember.get,b=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return a(this,"isFrozen")?this:(b(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var a=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(b){return Ember.beginPropertyChanges(this),a(b,function(a){this.addObject(a)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(b){return Ember.beginPropertyChanges(this),a(b,function(a){this.removeObject(a)},this),Ember.endPropertyChanges(this),this}})}(),function(){var a="Index out of range",b=[],c=Ember.get,d=Ember.set,e=Ember.EnumerableUtils.forEach;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var a=c(this,"length");return a===0?this:(this.replace(0,a,b),this)},insertAt:function(b,d){if(b>c(this,"length"))throw new Error(a);return this.replace(b,0,[d]),this},removeAt:function(d,e){var f=0;if("number"==typeof d){if(d<0||d>=c(this,"length"))throw new Error(a);e===undefined&&(e=1),this.replace(d,e,b)}return this},pushObject:function(a){return this.insertAt(c(this,"length"),a),a},pushObjects:function(a){return this.replace(c(this,"length"),0,a),this},popObject:function(){var a=c(this,"length");if(a===0)return null;var b=this.objectAt(a-1);return this.removeAt(a-1,1),b},shiftObject:function(){if(c(this,"length")===0)return null;var a=this.objectAt(0);return this.removeAt(0),a},unshiftObject:function(a){return this.insertAt(0,a),a},unshiftObjects:function(a){return this.replace(0,0,a),this},reverseObjects:function(){var a=c(this,"length");if(a===0)return this;var b=this.toArray().reverse();return this.replace(0,a,b),this},removeObject:function(a){var b=c(this,"length")||0;while(--b>=0){var d=this.objectAt(b);d===a&&this.removeAt(b)}return this},addObject:function(a){return this.contains(a)||this.pushObject(a),this}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.defineProperty;Ember.Observable=Ember.Mixin.create({isObserverable:!0,get:function(b){return a(this,b)},getProperties:function(){var b={},c=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(c=arguments[0]);for(var d=0;d<c.length;d++)b[c[d]]=a(this,c[d]);return b},set:function(a,c){return b(this,a,c),this},setProperties:function(a){return Ember.setProperties(this,a)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(a){return Ember.propertyWillChange(this,a),this},propertyDidChange:function(a){return Ember.propertyDidChange(this,a),this},notifyPropertyChange:function(a){return this.propertyWillChange(a),this.propertyDidChange(a),this},addBeforeObserver:function(a,b,c){Ember.addBeforeObserver(this,a,b,c)},addObserver:function(a,b,c){Ember.addObserver(this,a,b,c)},removeObserver:function(a,b,c){Ember.removeObserver(this,a,b,c)},hasObserverFor:function(a){return Ember.hasListeners(this,a+":change")},unknownProperty:function(a){return undefined},setUnknownProperty:function(a,d){c(this,a),b(this,a,d)},getPath:function(a){return this.get(a)},setPath:function(a,b){return this.set(a,b)},getWithDefault:function(a,b){return Ember.getWithDefault(this,a,b)},incrementProperty:function(c,d){return d||(d=1),b(this,c,(a(this,c)||0)+d),a(this,c)},decrementProperty:function(c,d){return d||(d=1),b(this,c,(a(this,c)||0)-d),a(this,c)},toggleProperty:function(c){return b(this,c,!a(this,c)),a(this,c)},cacheFor:function(a){return Ember.cacheFor(this,a)},observersForKey:function(a){return Ember.observersFor(this,a)}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var b=a(this,"target");if(Ember.typeOf(b)==="string"){var c=a(this,b);return c===undefined&&(c=a(window,b)),c}return b}).property("target").cacheable(),triggerAction:function(){var b=a(this,"action"),c=a(this,"targetObject");if(c&&b){var d;return typeof c.send=="function"?d=c.send(b,this):(typeof b=="string"&&(b=c[b]),d=b.call(c,this)),d!==!1&&(d=!0),d}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(a,b,c){Ember.addListener(this,a,b,c)},one:function(a,b,c){c||(c=b,b=null);var d=this,e=function(){Ember.removeListener(d,a,b,e),"string"==typeof c&&(c=this[c]),c.apply(this,arguments)};this.on(a,b,e)},trigger:function(a){var b=[],c,d;for(c=1,d=arguments.length;c<d;c++)b.push(arguments[c]);Ember.sendEvent(this,a,b)},fire:function(a){this.trigger.apply(this,arguments)},off:function(a,b,c){Ember.removeListener(this,a,b,c)},has:function(a){return Ember.hasListeners(this,a)}})}(),function(){}(),function(){function m(){var b=!1,c,d=function(){b||d.proto();var a=Ember.meta(this);a.proto=this,c&&(this.reopen.apply(this,c),c=null),e(this,Ember.GUID_KEY,l),e(this,"_super",l),j(this,a),delete a.proto,i(this),this.init.apply(this,arguments)};return d.toString=a,d.willReopen=function(){b&&(d.PrototypeMixin=Ember.Mixin.create(d.PrototypeMixin)),b=!1},d._initMixins=function(a){c=a},d.proto=function(){var a=d.superclass;return a&&a.proto(),b||(b=!0,d.PrototypeMixin.applyPartial(d.prototype),h(d.prototype)),this.prototype},d}var a=Ember.Mixin.prototype.toString,b=Ember.set,c=Ember.get,d=Ember.create,e=Ember.platform.defineProperty,f=Array.prototype.slice,g=Ember.meta,h=Ember.rewatch,i=Ember.finishChains,j=Ember.Mixin.finishPartial,k=Ember.Mixin.prototype.reopen,l={configurable:!0,writable:!0,enumerable:!1,value:undefined},n=m();n.PrototypeMixin=Ember.Mixin.create({reopen:function(){return Ember.Mixin._apply(this,arguments,!0),this},isInstance:!0,init:function(){},isDestroyed:!1,isDestroying:!1,destroy:function(){if(this.isDestroying)return;return this.isDestroying=!0,this.willDestroy&&this.willDestroy(),b(this,"isDestroyed",!0),Ember.run.schedule("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){Ember.destroy(this),this.didDestroy&&this.didDestroy()},bind:function(a,b){return b instanceof Ember.Binding||(b=Ember.Binding.from(b)),b.to(a).connect(this),b},toString:function(){return"<"+this.constructor.toString()+":"+Ember.guidFor(this)+">"}}),Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(n.PrototypeMixin),n.__super__=null;var o=Ember.Mixin.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var a=m(),b;return a.ClassMixin=Ember.Mixin.create(this.ClassMixin),a.PrototypeMixin=Ember.Mixin.create(this.PrototypeMixin),a.ClassMixin.ownerConstructor=a,a.PrototypeMixin.ownerConstructor=a,k.apply(a.PrototypeMixin,arguments),a.superclass=this,a.__super__=this.prototype,b=a.prototype=d(this.prototype),b.constructor=a,Ember.generateGuid(b,"ember"),g(b).proto=b,a.ClassMixin.apply(a),a},create:function(){var a=this;return arguments.length>0&&this._initMixins(arguments),new a},reopen:function(){return this.willReopen(),k.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return k.apply(this.ClassMixin,arguments),Ember.Mixin._apply(this,arguments,!1),this},detect:function(a){if("function"!=typeof a)return!1;while(a){if(a===this)return!0;a=a.superclass}return!1},detectInstance:function(a){return a instanceof this},metaForProperty:function(a){var b=g(this.proto(),!1).descs[a];return b._meta||{}},eachComputedProperty:function(a,b){var c=this.proto(),d=g(c).descs,e={},f;for(var h in d)f=d[h],f instanceof Ember.ComputedProperty&&a.call(b||this,h,f._meta||e)}});Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(o),n.ClassMixin=o,o.apply(n),Ember.CoreObject=n}(),function(){var a=Ember.get,b=Ember.set,c=Ember.guidFor,d=Ember.none;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var d=a(this,"length");if(d===0)return this;var e;this.enumerableContentWillChange(d,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var f=0;f<d;f++)e=c(this[f]),delete this[e],delete this[f];return b(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(d,0),this},isEqual:function(b){if(!Ember.Enumerable.detect(b))return!1;var c=a(this,"length");if(a(b,"length")!==c)return!1;while(--c>=0)if(!b.contains(this[c]))return!1;return!0},add:Ember.alias("addObject"),remove:Ember.alias("removeObject"),pop:function(){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var b=this.length>0?this[this.length-1]:null;return this.remove(b),b},push:Ember.alias("addObject"),shift:Ember.alias("pop"),unshift:Ember.alias("push"),addEach:Ember.alias("addObjects"),removeEach:Ember.alias("removeObjects"),init:function(a){this._super(),a&&this.addObjects(a)},nextObject:function(a){return this[a]},firstObject:Ember.computed(function(){return this.length>0?this[0]:undefined}).property().cacheable(),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}).property().cacheable(),addObject:function(e){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(d(e))return this;var f=c(e),g=this[f],h=a(this,"length"),i;return g>=0&&g<h&&this[g]===e?this:(i=[e],this.enumerableContentWillChange(null,i),Ember.propertyWillChange(this,"lastObject"),h=a(this,"length"),this[f]=h,this[h]=e,b(this,"length",h+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,i),this)},removeObject:function(e){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(d(e))return this;var f=c(e),g=this[f],h=a(this,"length"),i=g===0,j=g===h-1,k,l;return g>=0&&g<h&&this[g]===e&&(l=[e],this.enumerableContentWillChange(l,null),i&&Ember.propertyWillChange(this,"firstObject"),j&&Ember.propertyWillChange(this,"lastObject"),g<h-1&&(k=this[h-1],this[g]=k,this[c(k)]=g),delete this[f],delete this[h-1],b(this,"length",h-1),i&&Ember.propertyDidChange(this,"firstObject"),j&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(l,null)),this},contains:function(a){return this[c(a)]>=0},copy:function(){var d=this.constructor,e=new d,f=a(this,"length");b(e,"length",f);while(--f>=0)e[f]=this[f],e[c(this[f])]=f;return e},toString:function(){var a=this.length,b,c=[];for(b=0;b<a;b++)c[b]=this[b];return"Ember.Set<%@>".fmt(c.join(","))}})}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable)}(),function(){var a=Ember.ArrayPolyfills.indexOf;Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){return Ember.identifyNamespaces(),this[Ember.GUID_KEY+"_name"]},destroy:function(){var b=Ember.Namespace.NAMESPACES;window[this.toString()]=undefined,b.splice(a.call(b,this),1),this._super()}}),Ember.Namespace.NAMESPACES=[Ember],Ember.Namespace.PROCESSED=!1}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var a=Ember.get,b=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed("content",function(){return a(this,"content")}).cacheable(),objectAtContent:function(b){return a(this,"arrangedContent").objectAt(b)},replaceContent:function(b,c,d){a(this,"arrangedContent").replace(b,c,d)},_contentWillChange:Ember.beforeObserver(function(){var b=a(this,"content");b&&b.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},"content"),contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var b=a(this,"content"),c=b?a(b,"length"):0;b&&b.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},"content"),_arrangedContentWillChange:Ember.beforeObserver(function(){var b=a(this,"arrangedContent"),c=b?a(b,"length"):0;this.arrangedContentArrayWillChange(this,0,c,undefined),b&&b.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var b=a(this,"arrangedContent"),c=b?a(b,"length"):0;b&&b.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"}),this.arrangedContentArrayDidChange(this,0,undefined,c)},"arrangedContent"),objectAt:function(b){return a(this,"content")&&this.objectAtContent(b)},length:Ember.computed(function(){var b=a(this,"arrangedContent");return b?a(b,"length"):0}).property().cacheable(),replace:function(b,c,d){return a(this,"content")&&this.replaceContent(b,c,d),this},arrangedContentArrayWillChange:function(a,b,c,d){this.arrayContentWillChange(b,c,d)},arrangedContentArrayDidChange:function(a,b,c,d){this.arrayContentDidChange(b,c,d)},init:function(){this._super(),this._contentWillChange(),this._contentDidChange(),this._arrangedContentWillChange(),this._arrangedContentDidChange()}})}(),function(){function j(a,b){var c=b.slice(8);if(c in this)return;h(this,c)}function k(a,b){var c=b.slice(8);if(c in this)return;i(this,c)}var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.addBeforeObserver,e=Ember.addObserver,f=Ember.removeBeforeObserver,g=Ember.removeObserver,h=Ember.propertyWillChange,i=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),willWatchProperty:function(a){var b="content."+a;d(this,b,null,j),e(this,b,null,k)},didUnwatchProperty:function(a){var b="content."+a;f(this,b,null,j),g(this,b,null,k)},unknownProperty:function(b){var c=a(this,"content");if(c)return a(c,b)},setUnknownProperty:function(c,d){var e=a(this,"content");return b(e,c,d)}})}(),function(){function g(a,b,d,e,f){var g=d._objects,h;g||(g=d._objects={});while(--f>=e){var i=a.objectAt(f);i&&(Ember.addBeforeObserver(i,b,d,"contentKeyWillChange"),Ember.addObserver(i,b,d,"contentKeyDidChange"),h=c(i),g[h]||(g[h]=[]),g[h].push(f))}}function h(a,b,d,e,f){var g=d._objects;g||(g=d._objects={});var h,i;while(--f>=e){var j=a.objectAt(f);j&&(Ember.removeBeforeObserver(j,b,d,"contentKeyWillChange"),Ember.removeObserver(j,b,d,"contentKeyDidChange"),i=c(j),h=g[i],h[h.indexOf(f)]=null)}}var a=Ember.set,b=Ember.get,c=Ember.guidFor,d=Ember.EnumerableUtils.forEach,e=Ember.Object.extend(Ember.Array,{init:function(a,b,c){this._super(),this._keyName=b,this._owner=c,this._content=a},objectAt:function(a){var c=this._content.objectAt(a);return c&&b(c,this._keyName)},length:Ember.computed(function(){var a=this._content;return a?b(a,"length"):0}).property().cacheable()}),f=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(a){this._super(),this._content=a,a.addArrayObserver(this),d(Ember.watchedEvents(this),function(a){this.didAddListener(a)},this)},unknownProperty:function(a,b){var c;return c=new e(this._content,a,this),Ember.defineProperty(this,a,null,c),this.beginObservingContentKey(a),c},arrayWillChange:function(a,b,c,d){var e=this._keys,f,g,i;i=c>0?b+c:-1,Ember.beginPropertyChanges(this);for(f in e){if(!e.hasOwnProperty(f))continue;i>0&&h(a,f,this,b,i),Ember.propertyWillChange(this,f)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(a,b,c,d){var e=this._keys,f,h,i;i=d>0?b+d:-1,Ember.beginPropertyChanges(this);for(f in e){if(!e.hasOwnProperty(f))continue;i>0&&g(a,f,this,b,i),Ember.propertyDidChange(this,f)}Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(a){f.test(a)&&this.beginObservingContentKey(a.slice(0,-7))},didRemoveListener:function(a){f.test(a)&&this.stopObservingContentKey(a.slice(0,-7))},beginObservingContentKey:function(a){var c=this._keys;c||(c=this._keys={});if(!c[a]){c[a]=1;var d=this._content,e=b(d,"length");g(d,a,this,0,e)}else c[a]++},stopObservingContentKey:function(a){var c=this._keys;if(c&&c[a]>0&&--c[a]<=0){var d=this._content,e=b(d,"length");h(d,a,this,0,e)}},contentKeyWillChange:function(a,b){Ember.propertyWillChange(this,b)},contentKeyDidChange:function(a,b){Ember.propertyDidChange(this,b)}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(a){return a==="length"?this.length:"number"==typeof a?this[a]:this._super(a)},objectAt:function(a){return this[a]},replace:function(b,c,d){if(this.isFrozen)throw Ember.FROZEN_ERROR;var e=
+d?a(d,"length"):0;this.arrayContentWillChange(b,c,e);if(!d||d.length===0)this.splice(b,c);else{var f=[b,c].concat(d);this.splice.apply(this,f)}return this.arrayContentDidChange(b,c,e),this},unknownProperty:function(a,b){var c;return b!==undefined&&c===undefined&&(c=this[a]=b),c},indexOf:function(a,b){var c,d=this.length;b===undefined?b=0:b=b<0?Math.ceil(b):Math.floor(b),b<0&&(b+=d);for(c=b;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:function(a,b){var c,d=this.length;b===undefined?b=d-1:b=b<0?Math.ceil(b):Math.floor(b),b<0&&(b+=d);for(c=b;c>=0;c--)if(this[c]===a)return c;return-1},copy:function(){return this.slice()}}),d=["length"];Ember.EnumerableUtils.forEach(c.keys(),function(a){Array.prototype[a]&&d.push(a)}),d.length>0&&(c=c.without.apply(c,d)),Ember.NativeArray=c,Ember.A=function(a){return a===undefined&&(a=[]),Ember.NativeArray.apply(a)},Ember.NativeArray.activate=function(){c.apply(Array.prototype),Ember.A=function(a){return a||[]}},Ember.EXTEND_PROTOTYPES&&Ember.NativeArray.activate()}(),function(){var a=Ember.get,b=Ember.set;Ember._PromiseChain=Ember.Object.extend({promises:null,failureCallback:Ember.K,successCallback:Ember.K,abortCallback:Ember.K,promiseSuccessCallback:Ember.K,runNextPromise:function(){if(a(this,"isDestroyed"))return;var b=a(this,"promises").shiftObject();if(b){var c=a(b,"promise")||b,d=this,e=function(){d.promiseSuccessCallback.call(this,b,arguments),d.runNextPromise()},f=a(d,"failureCallback");c.then(e,f)}else this.successCallback()},start:function(){return this.runNextPromise(),this},abort:function(){this.abortCallback(),this.destroy()},init:function(){b(this,"promises",Ember.A(a(this,"promises"))),this._super()}})}(),function(){var a={},b={};Ember.onLoad=function(c,d){var e;a[c]=a[c]||Ember.A(),a[c].pushObject(d),(e=b[c])&&d(e)},Ember.runLoadHooks=function(c,d){var e;b[c]=d,(e=a[c])&&a[c].forEach(function(a){a(d)})}}(),function(){}(),function(){Ember.ControllerMixin=Ember.Mixin.create({target:null,store:null}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var a=Ember.get,b=Ember.set,c=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,addObject:function(b){var c=a(this,"content");c.pushObject(b)},removeObject:function(b){var c=a(this,"content");c.removeObject(b)},orderBy:function(b,d){var e=0,f=a(this,"sortProperties"),g=a(this,"sortAscending");return c(f,function(c){e===0&&(e=Ember.compare(a(b,c),a(d,c)),e!==0&&!g&&(e=-1*e))}),e},destroy:function(){var b=a(this,"content"),d=a(this,"sortProperties");return b&&d&&c(b,function(a){c(d,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed("sortProperties",function(){return!!a(this,"sortProperties")}),arrangedContent:Ember.computed("content","sortProperties.@each",function(b,d){var e=a(this,"content"),f=a(this,"isSorted"),g=a(this,"sortProperties"),h=this;return e&&f?(e=e.slice(),e.sort(function(a,b){return h.orderBy(a,b)}),c(e,function(a){c(g,function(b){Ember.addObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(e)):e}).cacheable(),_contentWillChange:Ember.beforeObserver(function(){var b=a(this,"content"),d=a(this,"sortProperties");b&&d&&c(b,function(a){c(d,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=a(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(a(this,"sortAscending")!==this._lastSortAscending){var b=a(this,"arrangedContent");b.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(b,d,e,f){var g=a(this,"isSorted");if(g){var h=a(this,"arrangedContent"),i=b.slice(d,d+e),j=a(this,"sortProperties");c(i,function(a){h.removeObject(a),c(j,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)})}return this._super(b,d,e,f)},contentArrayDidChange:function(b,d,e,f){var g=a(this,"isSorted"),h=a(this,"sortProperties");if(g){var i=b.slice(d,d+f),j=a(this,"arrangedContent");c(i,function(a){this.insertItemSorted(a),c(h,function(b){Ember.addObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(b,d,e,f)},insertItemSorted:function(b){var c=a(this,"arrangedContent"),d=a(c,"length"),e=this._binarySearch(b,0,d);c.insertAt(e,b)},contentItemSortPropertyDidChange:function(b){var c=a(this,"arrangedContent"),d=c.indexOf(b);c.removeObject(b),this.insertItemSorted(b)},_binarySearch:function(b,c,d){var e,f,g,h;return c===d?c:(h=a(this,"arrangedContent"),e=c+Math.floor((d-c)/2),f=h.objectAt(e),g=this.orderBy(f,b),g<0?this._binarySearch(b,e+1,d):g>0?this._binarySearch(b,c,e):e)}})}(),function(){var a=Ember.get,b=Ember.set;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin)}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),function(){var a=Ember.get,b=Ember.set;Ember.Application=Ember.Namespace.extend({rootElement:"body",eventDispatcher:null,customEvents:null,init:function(){var c,d=a(this,"rootElement");this._super(),c=Ember.EventDispatcher.create({rootElement:d}),b(this,"eventDispatcher",c);if(Ember.$.isReady)Ember.run.once(this,this.didBecomeReady);else{var e=this;Ember.$(document).ready(function(){Ember.run.once(e,e.didBecomeReady)})}},initialize:function(c){var d=Ember.A(Ember.keys(this)),e=a(this.constructor,"injections"),f=this,g,h;!c&&Ember.Router.detect(f.Router)&&(c=f.Router.create(),this._createdRouter=c),c&&(b(this,"router",c),b(c,"namespace",this)),Ember.runLoadHooks("application",this),e.forEach(function(a){d.forEach(function(b){a[1](f,c,b)})}),c&&c instanceof Ember.Router&&this.startRouting(c)},didBecomeReady:function(){var b=a(this,"eventDispatcher"),c=a(this,"customEvents");b.setup(c),this.ready()},startRouting:function(b){var c=a(b,"location"),d=a(this,"rootElement"),e=a(b,"applicationController"),f=this.ApplicationView.create({controller:e});this._createdApplicationView=f,f.appendTo(d),b.route(c.getURL()),c.onUpdateURL(function(a){b.route(a)})},ready:Ember.K,willDestroy:function(){a(this,"eventDispatcher").destroy(),this._createdRouter&&this._createdRouter.destroy(),this._createdApplicationView&&this._createdApplicationView.destroy()},registerInjection:function(a){this.constructor.registerInjection(a)}}),Ember.Application.reopenClass({concatenatedProperties:["injections"],injections:Ember.A(),registerInjection:function(b){var c=a(this,"injections"),d=b.before,e=b.name,f=b.injection,g;d?(g=c.find(function(a){if(a[0]===d)return!0}),g=c.indexOf(g)):g=a(c,"length"),c.splice(g,0,[e,f])}}),Ember.Application.registerInjection({name:"controllers",injection:function(a,b,c){if(!/^[A-Z].*Controller$/.test(c))return;var d=c.charAt(0).toLowerCase()+c.substr(1),e=a[c].create();b.set(d,e),e.setProperties({target:b,controllers:b,namespace:a})}})}(),function(){var a=Ember.get,b=Ember.set;Ember.Location={create:function(a){var b=a&&a.implementation,c=this.implementations[b];return c.create.apply(c,arguments)},registerImplementation:function(a,b){this.implementations[a]=b},implementations:{}}}(),function(){var a=Ember.get,b=Ember.set;Ember.HashLocation=Ember.Object.extend({init:function(){b(this,"location",a(this,"location")||window.location)},getURL:function(){return a(this,"location").hash.substr(1)},setURL:function(c){a(this,"location").hash=c,b(this,"lastSetURL",c)},onUpdateURL:function(c){var d=this,e=Ember.guidFor(this);Ember.$(window).bind("hashchange.ember-location-"+e,function(){var e=location.hash.substr(1);if(a(d,"lastSetURL")===e)return;b(d,"lastSetURL",null),c(location.hash.substr(1))})},formatURL:function(a){return"#"+a},willDestroy:function(){var a=Ember.guidFor(this);Ember.$(window).unbind("hashchange.ember-location-"+a)}}),Ember.Location.registerImplementation("hash",Ember.HashLocation)}(),function(){var a=Ember.get,b=Ember.set;Ember.HistoryLocation=Ember.Object.extend({init:function(){b(this,"location",a(this,"location")||window.location),b(this,"_initialURL",a(this,"location").pathname)},rootURL:"/",_initialURL:null,getURL:function(){return a(this,"location").pathname},setURL:function(b){var c=window.history.state,d=a(this,"_initialURL");b=this.formatPath(b),(d!==b&&!c||c&&c.path!==b)&&window.history.pushState({path:b},null,b)},onUpdateURL:function(a){var b=Ember.guidFor(this);Ember.$(window).bind("popstate.ember-location-"+b,function(b){a(location.pathname)})},formatPath:function(b){var c=a(this,"rootURL");return b!==""&&(c=c.replace(/\/$/,"")),c+b},formatURL:function(a){return a},willDestroy:function(){var a=Ember.guidFor(this);Ember.$(window).unbind("popstate.ember-location-"+a)}}),Ember.Location.registerImplementation("history",Ember.HistoryLocation)}(),function(){var a=Ember.get,b=Ember.set;Ember.NoneLocation=Ember.Object.extend({path:"",getURL:function(){return a(this,"path")},setURL:function(a){b(this,"path",a)},onUpdateURL:function(a){},formatURL:function(a){return a}}),Ember.Location.registerImplementation("none",Ember.NoneLocation)}(),function(){}(),function(){}(),function(){Ember.$=window.jQuery}(),function(){var a=Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");Ember.EnumerableUtils.forEach(a,function(a){Ember.$.event.fixHooks[a]={props:["dataTransfer"]}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.ArrayPolyfills.indexOf,d=function(){this.seen={},this.list=[]};d.prototype={add:function(a){if(a in this.seen)return;this.seen[a]=!0,this.list.push(a)},toDOM:function(){return this.list.join(" ")}},Ember.RenderBuffer=function(a){return new Ember._RenderBuffer(a)},Ember._RenderBuffer=function(a){this.elementTag=a,this.childBuffers=[]},Ember._RenderBuffer.prototype={elementClasses:null,elementId:null,elementAttributes:null,elementTag:null,elementStyle:null,parentBuffer:null,push:function(a){return this.childBuffers.push(String(a)),this},addClass:function(a){var b=this.elementClasses=this.elementClasses||new d;return this.elementClasses.add(a),this},id:function(a){return this.elementId=a,this},attr:function(a,b){var c=this.elementAttributes=this.elementAttributes||{};return arguments.length===1?c[a]:(c[a]=b,this)},removeAttr:function(a){var b=this.elementAttributes;return b&&delete b[a],this},style:function(a,b){var c=this.elementStyle=this.elementStyle||{};return this.elementStyle[a]=b,this},newBuffer:function(a,b,c,d){var e=new Ember._RenderBuffer(a);return e.parentBuffer=b,d&&Ember.$.extend(e,d),c&&c.call(this,e),e},replaceWithBuffer:function(a){var b=this.parentBuffer;if(!b)return;var d=b.childBuffers,e=c.call(d,this);a?d.splice(e,1,a):d.splice(e,1)},begin:function(a){return this.newBuffer(a,this,function(a){this.childBuffers.push(a)})},prepend:function(a){return this.newBuffer(a,this,function(a){this.childBuffers.splice(0,0,a)})},replaceWith:function(a){var b=this.parentBuffer;return this.newBuffer(a,b,function(a){this.replaceWithBuffer(a)})},insertAfter:function(b){var d=a(this,"parentBuffer");return this.newBuffer(b,d,function(a){var b=d.childBuffers,e=c.call(b,this);b.splice(e+1,0,a)})},end:function(){var a=this.parentBuffer;return a||this},remove:function(){this.replaceWithBuffer(null)},element:function(){return Ember.$(this.string())[0]},string:function(){var a="",b=this.elementTag,c;if(b){var d=this.elementId,e=this.elementClasses,f=this.elementAttributes,g=this.elementStyle,h="",i;c=["<"+b],d&&c.push('id="'+this._escapeAttribute(d)+'"'),e&&c.push('class="'+this._escapeAttribute(e.toDOM())+'"');if(g){for(i in g)g.hasOwnProperty(i)&&(h+=i+":"+this._escapeAttribute(g[i])+";");c.push('style="'+h+'"')}if(f)for(i in f)f.hasOwnProperty(i)&&c.push(i+'="'+this._escapeAttribute(f[i])+'"');c=c.join(" ")+">"}var j=this.childBuffers;return Ember.ArrayPolyfills.forEach.call(j,function(b){var c=typeof b=="string";a+=c?b:b.string()}),b?c+a+"</"+b+">":a},_escapeAttribute:function(a){var b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[<>"'`]/g,d=/[&<>"'`]/,e=function(a){return b[a]||"&amp;"},f=a.toString();return d.test(f)?f.replace(c,e):f}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt;Ember.EventDispatcher=Ember.Object.extend({rootElement:"body",setup:function(b){var c,d={touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",mousemove:"mouseMove",focusin:"focusIn",focusout:"focusOut",mouseenter:"mouseEnter",mouseleave:"mouseLeave",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"};Ember.$.extend(d,b||{});var e=Ember.$(a(this,"rootElement"));e.addClass("ember-application");for(c in d)d.hasOwnProperty(c)&&this.setupHandler(e,c,d[c])},setupHandler:function(a,b,c){var d=this;a.delegate(".ember-view",b+".ember",function(a,b){var e=Ember.View.views[this.id],f=!0,g=null;return g=d._findNearestEventManager(e,c),g&&g!==b?f=d._dispatchEvent(g,a,c,e):e?f=d._bubbleEvent(e,a,c):a.stopPropagation(),f}),a.delegate("[data-ember-action]",b+".ember",function(a){var b=Ember.$(a.currentTarget).attr("data-ember-action"),d=Ember.Handlebars.ActionHelper.registeredActions[b],e=d.handler;if(d.eventName===c)return e(a)})},_findNearestEventManager:function(b,c){var d=null;while(b){d=a(b,"eventManager");if(d&&d[c])break;b=a(b,"parentView")}return d},_dispatchEvent:function(a,b,c,d){var e=!0,f=a[c];return Ember.typeOf(f)==="function"?(e=f.call(a,b,d),b.stopPropagation()):e=this._bubbleEvent(d,b,c),e},_bubbleEvent:function(a,b,c){return Ember.run(function(){return a.handleEvent(c,b)})},destroy:function(){var b=a(this,"rootElement");return Ember.$(b).undelegate(".ember").removeClass("ember-application"),this._super()}})}(),function(){var a=Ember.run.queues;a.splice(Ember.$.inArray("actions",a)+1,0,"render")}(),function(){var a=Ember.get,b=Ember.set;Ember.ControllerMixin.reopen({target:null,controllers:null,namespace:null,view:null,connectOutlet:function(c,d){var e,f,g,h,i;Ember.typeOf(d)==="string"&&(e=c,c=d,d=arguments[2]),arguments.length===1?Ember.typeOf(c)==="object"&&(i=c,e=i.outletName,c=i.name,f=i.viewClass,h=i.controller,d=i.context):i={},e=e||"view";if(c){var j=a(this,"namespace"),k=a(this,"controllers"),l=c.charAt(0).toUpperCase()+c.substr(1)+"View";f=a(j,l),h=a(k,c+"Controller")}return h&&d&&h.set("content",d),g=f.create(),h&&b(g,"controller",h),b(this,e,g),g},connectControllers:function(){var c=a(this,"controllers"),d=Array.prototype.slice.apply(arguments),e;for(var f=0,g=d.length;f<g;f++)e=d[f]+"Controller",b(this,e,a(c,e))}})}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=Ember.addObserver,d=Ember.meta,e=Ember.String.fmt,f=[].slice,g=Ember.EnumerableUtils.forEach,h=Ember.computed(function(){var b=this._childViews,c=Ember.A();return g(b,function(b){b.isVirtual?c.pushObjects(a(b,"childViews")):c.push(b)}),c}).property().cacheable(),i=Ember.VIEW_PRESERVES_CONTEXT;Ember.TEMPLATES={};var j={preRender:{},inBuffer:{},hasElement:{},inDOM:{},destroyed:{}};Ember.View=Ember.Object.extend(Ember.Evented,{concatenatedProperties:["classNames","classNameBindings","attributeBindings"],isView:!0,templateName:null,layoutName:null,templates:Ember.TEMPLATES,template:Ember.computed(function(b,c){if(c!==undefined)return c;var d=a(this,"templateName"),e=this.templateForName(d,"template");return e||a(this,"defaultTemplate")}).property("templateName").cacheable(),controller:Ember.computed(function(b,c){var d;return arguments.length===2?c:(d=a(this,"parentView"),d?a(d,"controller"):null)}).property().cacheable(),layout:Ember.computed(function(b,c){if(arguments.length===2)return c;var d=a(this,"layoutName"),e=this.templateForName(d,"layout");return e||a(this,"defaultLayout")}).property("layoutName").cacheable(),templateForName:function(b,c){if(!b)return;var d=a(this,"templates"),f=a(d,b);if(!f)throw new Ember.Error(e('%@ - Unable to find %@ "%@".',[this,c,b]));return f},context:Ember.computed(function(c,d){return arguments.length===2?(b(this,"_context",d),d):a(this,"_context")}).cacheable(),_context:Ember.computed(function(b,c){var d,e,f;if(arguments.length===2)return c;if(i){if(e=a(this,"controller"))return e;d=a(this,"_parentView");if(d)return a(d,"_context")}return this}).cacheable(),_displayPropertyDidChange:Ember.observer(function(){this.rerender()},"context","controller"),parentView:Ember.computed(function(){var b=a(this,"_parentView");return b&&b.isVirtual?a(b,"parentView"):b}).property("_parentView").volatile(),_parentView:null,concreteView:Ember.computed(function(){return this.isVirtual?a(this,"parentView"):this}).property("_parentView").volatile(),isVisible:!0,childViews:h,_childViews:[],_childViewsWillChange:Ember.beforeObserver(function(){if(this.isVirtual){var b=a(this,"parentView");b&&Ember.propertyWillChange(b,"childViews")}},"childViews"),_childViewsDidChange:Ember.observer(function(){if(this.isVirtual){var b=a(this,"parentView");b&&Ember.propertyDidChange(b,"childViews")}},"childViews"),nearestInstanceOf:function(b){var c=a(this,"parentView");while(c){if(c instanceof b)return c;c=a(c,"parentView")}},nearestWithProperty:function(b){var c=a(this,"parentView");while(c){if(b in c)return c;c=a(c,"parentView")}},nearestChildOf:function(b){var c=a(this,"parentView");while(c){if(a(c,"parentView")instanceof b)return c;c=a(c,"parentView")}},collectionView:Ember.computed(function(){return this.nearestInstanceOf(Ember.CollectionView)}).cacheable(),itemView:Ember.computed(function(){return this.nearestChildOf(Ember.CollectionView)}).cacheable(),contentView:Ember.computed(function(){return this.nearestWithProperty("content")}).cacheable(),_parentViewDidChange:Ember.observer(function(){if(this.isDestroying)return;this.invokeRecursively(function(a){a.propertyDidChange("collectionView"),a.propertyDidChange("itemView"),a.propertyDidChange("contentView")}),a(this,"parentView.controller")&&!a(this,"controller")&&this.notifyPropertyChange("controller")},"_parentView"),_controllerDidChange:Ember.observer(function(){if(this.isDestroying)return;this.forEachChildView(function(a){a.propertyDidChange("controller")})},"controller"),cloneKeywords:function(){var c=a(this,"templateData"),d=c?Ember.copy(c.keywords):{};return b(d,"view",a(this,"concreteView")),b(d,"controller",a(this,"controller")),d},render:function(b){var c=a(this,"layout")||a(this,"template");if(c){var d=a(this,"_context"),e=this.cloneKeywords(),f={view:this,buffer:b,isRenderData:!0,keywords:e},g=c(d,{data:f});g!==undefined&&b.push(g)}},invokeForState:function(a){var b=this.state,c,d;if(d=j[b][a])return c=f.call(arguments),c[0]=this,d.apply(this,c);var e=this,g=e.states,h;while(g){h=g[b];while(h){d=h[a];if(d)return j[b][a]=d,c=f.call(arguments,1),c.unshift(this),d.apply(this,c);h=h.parentState}g=g.parent}},rerender:function(){return this.invokeForState("rerender")},clearRenderedChildren:function(){var a=this.lengthBeforeRender,b=this.lengthAfterRender,c=this._childViews;for(var d=b-1;d>=a;d--)c[d]&&c[d].destroy()},_applyClassNameBindings:function(){var b=a(this,"classNameBindings"),d=a(this,"classNames"),e,f,h;if(!b)return;g(b,function(a){var b,g=function(){f=this._classStringForProperty(a),e=this.$(),b&&(e.removeClass(b),d.removeObject(b)),f?(e.addClass(f),b=f):b=null};h=this._classStringForProperty(a),h&&(d.push(h),b=h);var i=Ember.View._parsePropertyPath(a);c(this,i.path,g)},this)},_applyAttributeBindings:function(b){var d=a(this,"attributeBindings"),e,f,h;if(!d)return;g(d,function(d){var g=d.split(":"),h=g[0],i=g[1]||h,j=function(){f=this.$();if(!f)return;e=a(this,h),Ember.View.applyAttributeBindings(f,i,e)};c(this,h,j),e=a(this,h),Ember.View.applyAttributeBindings(b,i,e)},this)},_classStringForProperty:function(b){var c=Ember.View._parsePropertyPath(b),d=c.path,e=a(this,d);return e===undefined&&Ember.isGlobalPath(d)&&(e=a(window,d)),Ember.View._classStringForValue(d,e,c.className,c.falsyClassName)},element:Ember.computed(function(a,b){return b!==undefined?this.invokeForState("setElement",b):this.invokeForState("getElement")}).property("_parentView").cacheable(),$:function(a){return this.invokeForState("$",a)},mutateChildViews:function(a){var b=this._childViews,c=b.length,d;while(--c>=0)d=b[c],a.call(this,d,c);return this},forEachChildView:function(a){var b=this._childViews;if(!b)return this;var c=b.length,d,e;for(e=0;e<c;e++)d=b[e],a.call(this,d);return this},appendTo:function(a){return this._insertElementLater(function(){this.$().appendTo(a)}),this},replaceIn:function(a){return this._insertElementLater(function(){Ember.$(a).empty(),this.$().appendTo(a)}),this},_insertElementLater:function(a){this._lastInsert=Ember.guidFor(a),Ember.run.schedule("render",this,this.invokeForState,"insertElement",a)},append:function(){return this.appendTo(document.body)},remove:function(){this.destroyElement(),this.invokeRecursively(function(a){a.clearRenderedChildren()})},elementId:Ember.computed(function(a,b){return b!==undefined?b:Ember.guidFor(this)}).cacheable(),_elementIdDidChange:Ember.beforeObserver(function(){throw"Changing a view's elementId after creation is not allowed."},"elementId"),findElementInParentElement:function(b){var c="#"+a(this,"elementId");return Ember.$(c)[0]||Ember.$(c,b)[0]},renderBuffer:function(b){b=b||a(this,"tagName");if(b===null||b===undefined)b="div";return Ember.RenderBuffer(b)},createElement:function(){if(a(this,"element"))return this;var c=this.renderToBuffer();return b(this,"element",c.element()),this},willInsertElement:Ember.K,didInsertElement:Ember.K,willRerender:Ember.K,invokeRecursively:function(a){a.call(this,this),this.forEachChildView(function(b){b.invokeRecursively(a)})},invalidateRecursively:function(a){this.forEachChildView(function(b){b.propertyDidChange(a)})},_notifyWillInsertElement:function(){this.invokeRecursively(function(a){a.trigger("willInsertElement")})},_notifyDidInsertElement:function(){this.invokeRecursively(function(a){a.trigger("didInsertElement")})},_notifyWillRerender:function(){this.invokeRecursively(function(a){a.trigger("willRerender")})},destroyElement:function(){return this.invokeForState("destroyElement")},willDestroyElement:function(){},_notifyWillDestroyElement:function(){this.invokeRecursively(function(a){a.trigger("willDestroyElement")})},_elementWillChange:Ember.beforeObserver(function(){this.forEachChildView(function(a){Ember.propertyWillChange(a,"element")})},"element"),_elementDidChange:Ember.observer(function(){this.forEachChildView(function(a){Ember.propertyDidChange(a,"element")})},"element"),parentViewDidChange:Ember.K,renderToBuffer:function(b,c){var d;Ember.run.sync(),c=c||"begin";if(b){var e=a(this,"tagName");if(e===null||e===undefined)e="div";d=b[c](e)}else d=this.renderBuffer();return this.buffer=d,this.transitionTo("inBuffer",!1),this.lengthBeforeRender=this._childViews.length,this.beforeRender(d),this.render(d),this.afterRender(d),this.lengthAfterRender=this._childViews.length,d},beforeRender:function(a){this.applyAttributesToBuffer(a)},afterRender:Ember.K,applyAttributesToBuffer:function(b){this._applyClassNameBindings(),this._applyAttributeBindings(b),g(a(this,"classNames"),function(a){b.addClass(a)}),b.id(a(this,"elementId"));var c=a(this,"ariaRole");c&&b.attr("role",c),a(this,"isVisible")===!1&&b.style("display","none")},tagName:null,ariaRole:null,classNames:["ember-view"],classNameBindings:[],attributeBindings:[],state:"preRender",init:function(){this._super(),this.isVirtual||(Ember.View.views[a(this,"elementId")]=this),this._childViews=this._childViews.slice(),this.classNameBindings=Ember.A(this.classNameBindings.slice()),this.classNames=Ember.A(this.classNames.slice());var c=a(this,"viewController");c&&(c=a(c),c&&b(c,"view",this))},appendChild:function(a,b){return this.invokeForState("appendChild",a,b)},removeChild:function(a){if(this.isDestroying)return;b(a,"_parentView",null);var c=this._childViews;return Ember.EnumerableUtils.removeObject(c,a),this.propertyDidChange("childViews"),this},removeAllChildren:function(){return this.mutateChildViews(function(a){this.removeChild(a)})},destroyAllChildren:function(){return this.mutateChildViews(function(a){a.destroy()})},removeFromParent:function(){var b=a(this,"_parentView");return this.remove(),b&&b.removeChild(this),this},willDestroy:function(){var c=this._childViews,d=a(this,"_parentView"),e;this.removedFromDOM||this.destroyElement();if(this.viewName){var f=a(this,"parentView");f&&b(f,this.viewName,null)}d&&d.removeChild(this),this.state="destroyed",e=c.length;for(var g=e-1;g>=0;g--)c[g].removedFromDOM=!0,c[g].destroy();this.isVirtual||delete Ember.View.views[a(this,"elementId")]},createChildView:function(c,d){return Ember.View.detect(c)?(d=d||{},d._parentView=this,d.templateData=d.templateData||a(this,"templateData"),c=c.create(d),c.viewName&&b(a(this,"concreteView"),c.viewName,c)):(a(c,"templateData")||b(c,"templateData",a(this,"templateData")),b(c,"_parentView",this)),c},becameVisible:Ember.K,becameHidden:Ember.K,_isVisibleDidChange:Ember.observer(function(){var b=this.$();if(!b)return;var c=a(this,"isVisible");b.toggle(c);if(this._isAncestorHidden())return;c?this._notifyBecameVisible():this._notifyBecameHidden()},"isVisible"),_notifyBecameVisible:function(){this.trigger("becameVisible"),this.forEachChildView(function(b){var c=a(b,"isVisible");(c||c===null)&&b._notifyBecameVisible()})},_notifyBecameHidden:function(){this.trigger("becameHidden"),this.forEachChildView(function(b){var c=a(b,"isVisible");(c||c===null)&&b._notifyBecameHidden()})},_isAncestorHidden:function(){var b=a(this,"parentView");while(b){if(a(b,"isVisible")===!1)return!0;b=a(b,"parentView")}return!1},clearBuffer:function(){this.invokeRecursively(function(a){this.buffer=null})},transitionTo:function(a,b){this.state=a,b!==!1&&this.forEachChildView(function(b){b.transitionTo(a)})},trigger:function(a){this._super.apply(this,arguments);var b=this[a];if(b){var c=[],d,e;for(d=1,e=arguments.length;d<e;d++)c.push(arguments[d]);return b.apply(this,c)}},has:function(a){return Ember.typeOf(this[a])==="function"||this._super(a)},handleEvent:function(a,b){return this.invokeForState("handleEvent",a,b)}});var k={prepend:function(a,b){b._insertElementLater(function(){var c=a.$();c.prepend(b.$())})},after:function(a,b){b._insertElementLater(function(){var c=a.$();c.after(b.$())})},replace:function(c){var d=a(c,"element");b(c,"element",null),c._insertElementLater(function(){Ember.$(d).replaceWith(a(c,"element"))})},remove:function(c){var d=a(c,"element");b(c,"element",null),c._lastInsert=null,Ember.$(d).remove()},empty:function(a){a.$().empty()}};Ember.View.reopen({states:Ember.View.states,domManager:k}),Ember.View.reopenClass({_parsePropertyPath:function(a){var b=a.split(/:/),c=b[0],d="",e,f;return b.length>1&&(e=b[1],b.length===3&&(f=b[2]),d=":"+e,f&&(d+=":"+f)),{path:c,classNames:d,className:e===""?undefined:e,falsyClassName:f}},_classStringForValue:function(a,b,c,d){if(!!b&&c)return c;if(b===!0){if(b===!0&&!c&&d)return null;var e=a.split(".");return Ember.String.dasherize(e[e.length-1])}return b===!1&&d?d:b!==!1&&b!==undefined&&b!==null?b:null}}),Ember.View.views={},Ember.View.childViewsProperty=h,Ember.View.applyAttributeBindings=function(a,b,c){var d=Ember.typeOf(c),e=a.attr(b);(d==="string"||d==="number"&&!isNaN(c))&&c!==e?a.attr(b,c):c&&d==="boolean"?a.attr(b,b):c||a.removeAttr(b)}}(),function(){var a=Ember.get,b=Ember.set;Ember.View.states={_default:{appendChild:function(){throw"You can't use appendChild outside of the rendering process"},$:function(){return undefined},getElement:function(){return null},handleEvent:function(){return!0},destroyElement:function(a){return b(a,"element",null),a._lastInsert=null,a}}},Ember.View.reopen({states:Ember.View.states})}(),function(){Ember.View.states.preRender={parentState:Ember.View.states._default,insertElement:function(a,b){if(a._lastInsert!==Ember.guidFor(b))return;a.createElement(),a._notifyWillInsertElement(),b.call(a),a.transitionTo("inDOM"),a._notifyDidInsertElement()},empty:Ember.K,setElement:function(a,b){return b!==null&&a.transitionTo("hasElement"),b}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta;Ember.View.states.inBuffer={parentState:Ember.View.states._default,$:function(a,b){return a.rerender(),Ember.$()},rerender:function(a){a._notifyWillRerender(),a.clearRenderedChildren(),a.renderToBuffer(a.buffer,"replaceWith")},appendChild:function(a,b,c){var d=a.buffer;return b=this.createChildView(b,c),a._childViews.push(b),b.renderToBuffer(d),a.propertyDidChange("childViews"),b},destroyElement:function(a){return a.clearBuffer(),a._notifyWillDestroyElement(),a.transitionTo("preRender"),a},empty:function(){},insertElement:function(){throw"You can't insert an element that has already been rendered"},setElement:function(a,b){return b===null?a.transitionTo("preRender"):(a.clearBuffer(),a.transitionTo("hasElement")),b}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta;Ember.View.states.hasElement={parentState:Ember.View.states._default,$:function(b,c){var d=a(b,"element");return c?Ember.$(c,d):Ember.$(d)},getElement:function(b){var c=a(b,"parentView");return c&&(c=a(c,"element")),c?b.findElementInParentElement(c):Ember.$("#"+a(b,"elementId"))[0]},setElement:function(a,b){if(b!==null)throw"You cannot set an element to a non-null value when the element is already in the DOM.";return a.transitionTo("preRender"),b},rerender:function(a){return a._notifyWillRerender(),a.clearRenderedChildren(),a.domManager.replace(a),a},destroyElement:function(a){return a._notifyWillDestroyElement(),a.domManager.remove(a),a},empty:function(a){var b=a._childViews,c,d;if(b){c=b.length;for(d=0;d<c;d++)b[d]._notifyWillDestroyElement()}a.domManager.empty(a)},handleEvent:function(a,b,c){return a.has(b)?a.trigger(b,c):!0}},Ember.View.states.inDOM={parentState:Ember.View.states.hasElement,insertElement:function(a,b){if(a._lastInsert!==Ember.guidFor(b))return;throw"You can't insert an element into the DOM that has already been inserted"}}}(),function(){var a="You can't call %@ on a destroyed view",b=Ember.String.fmt;Ember.View.states.destroyed={parentState:Ember.View.states._default,appendChild:function(){throw b(a,["appendChild"])},rerender:function(){throw b(a,["rerender"])},destroyElement:function(){throw b(a,["destroyElement"])},empty:function(){throw b(a,["empty"])},setElement:function(){throw b(a,["set('element', ...)"])},insertElement:Ember.K}}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta,d=Ember.EnumerableUtils.forEach,e=Ember.computed(function(){return a(this,"_childViews")}).property("_childViews").cacheable();Ember.ContainerView=Ember.View.extend({init:function(){this._super();var c=a(this,"childViews");Ember.defineProperty(this,"childViews",e);var f=this._childViews;d(c,function(c,d){var e;"string"==typeof c?(e=a(this,c),e=this.createChildView(e),b(this,c,e)):e=this.createChildView(c),f[d]=e},this);var g=a(this,"currentView");g&&f.push(this.createChildView(g)),Ember.A(f),a(this,"childViews").addArrayObserver(this,{willChange:"childViewsWillChange",didChange:"childViewsDidChange"})},render:function(a){this.forEachChildView(function(b){b.renderToBuffer(a)})},willDestroy:function(){a(this,"childViews").removeArrayObserver(this,{willChange:"childViewsWillChange",didChange:"childViewsDidChange"}),this._super()},childViewsWillChange:function(a,b,c){if(c===0)return;var d=a.slice(b,b+c);this.initializeViews(d,null,null),this.invokeForState("childViewsWillChange",a,b,c)},childViewsDidChange:function(b,c,d,e){var f=a(b,"length");if(e===0)return;var g=b.slice(c,c+e);this.initializeViews(g,this,a(this,"templateData")),this.invokeForState("childViewsDidChange",b,c,e)},initializeViews:function(c,e,f){d(c,function(c){b(c,"_parentView",e),a(c,"templateData")||b(c,"templateData",f)})},_scheduleInsertion:function(a,b){b?b.domManager.after(b,a):this.domManager.prepend(this,a)},currentView:null,_currentViewWillChange:Ember.beforeObserver(function(){var b=a(this,"childViews"),c=a(this,"currentView");c&&(b.removeObject(c),c.destroy())},"currentView"),_currentViewDidChange:Ember.observer(function(){var b=a(this,"childViews"),c=a(this,"currentView");c&&b.pushObject(c)},"currentView")}),Ember.ContainerView.states={parent:Ember.View.states,inBuffer:{childViewsDidChange:function(a,b,c,d){var e=a.buffer,f,g,h,i;c===0?(i=b[c],f=c+1,i.renderToBuffer(e,"prepend")):(i=b[c-1],f=c);for(var j=f;j<c+d;j++)g=i,i=b[j],h=g.buffer,i.renderToBuffer(h,"insertAfter")}},hasElement:{childViewsWillChange:function(a,b,c,d){for(var e=c;e<c+d;e++)b[e].remove()},childViewsDidChange
+:function(a,b,c,d){var e=c===0?null:b[c-1];for(var f=c;f<c+d;f++)a=b[f],this._scheduleInsertion(a,e),e=a}}},Ember.ContainerView.states.inDOM={parentState:Ember.ContainerView.states.hasElement},Ember.ContainerView.reopen({states:Ember.ContainerView.states})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt;Ember.CollectionView=Ember.ContainerView.extend({content:null,emptyViewClass:Ember.View,emptyView:null,itemViewClass:Ember.View,init:function(){var a=this._super();return this._contentDidChange(),a},_contentWillChange:Ember.beforeObserver(function(){var b=this.get("content");b&&b.removeArrayObserver(this);var c=b?a(b,"length"):0;this.arrayWillChange(b,0,c)},"content"),_contentDidChange:Ember.observer(function(){var b=a(this,"content");b&&b.addArrayObserver(this);var c=b?a(b,"length"):0;this.arrayDidChange(b,0,null,c)},"content"),willDestroy:function(){var b=a(this,"content");b&&b.removeArrayObserver(this),this._super()},arrayWillChange:function(b,c,d){var e=a(this,"emptyView");e&&e instanceof Ember.View&&e.removeFromParent();var f=a(this,"childViews"),g,h,i;i=a(f,"length");var j=d===i;j&&this.invokeForState("empty");for(h=c+d-1;h>=c;h--)g=f[h],j&&(g.removedFromDOM=!0),g.destroy()},arrayDidChange:function(c,d,e,f){var g=a(this,"itemViewClass"),h=a(this,"childViews"),i=[],j,k,l,m,n;"string"==typeof g&&(g=a(g)),m=c?a(c,"length"):0;if(m)for(l=d;l<d+f;l++)k=c.objectAt(l),j=this.createChildView(g,{content:k,contentIndex:l}),i.push(j);else{var o=a(this,"emptyView");if(!o)return;o=this.createChildView(o),i.push(o),b(this,"emptyView",o)}h.replace(d,0,i)},createChildView:function(c,d){c=this._super(c,d);var e=a(c,"tagName"),f=e===null||e===undefined?Ember.CollectionView.CONTAINER_MAP[a(this,"tagName")]:e;return b(c,"tagName",f),c}}),Ember.CollectionView.CONTAINER_MAP={ul:"li",ol:"li",table:"tr",thead:"tr",tbody:"tr",tfoot:"tr",tr:"td",select:"option"}}(),function(){}(),function(){}(),function(){var a=Ember.get,b=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var b=a(this,"parentState.path"),c=a(this,"name");return b&&(c=b+"."+c),c}).property().cacheable(),trigger:function(a){this[a]&&this[a].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var c=a(this,"states"),d;b(this,"childStates",Ember.A()),b(this,"eventTransitions",a(this,"eventTransitions")||{});var e,f,g;if(!c){c={};for(e in this){if(e==="constructor")continue;if(f=this[e]){if(g=f.transitionTarget)this.eventTransitions[e]=g;this.setupChild(c,e,f)}}b(this,"states",c)}else for(e in c)this.setupChild(c,e,c[e]);b(this,"pathsCache",{}),b(this,"pathsCacheNoContext",{})},setupChild:function(c,d,e){if(!e)return!1;e.isState?b(e,"name",d):Ember.State.detect(e)&&(e=e.create({name:d})),e.isState&&(b(e,"parentState",this),a(this,"childStates").pushObject(e),c[d]=e)},lookupEventTransition:function(a){var b,c=this;while(c&&!b)b=c.eventTransitions[a],c=c.get("parentState");return b},isLeaf:Ember.computed(function(){return!a(this,"childStates").length}).cacheable(),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K});var c=Ember.$&&Ember.$.Event;Ember.State.reopenClass({transitionTo:function(a){var b=function(b,d){if(c&&d instanceof c){if(!d.hasOwnProperty("context"))return b.transitionTo(a);d=d.context}b.transitionTo(a,d)};return b.transitionTarget=a,b}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.ArrayPolyfills.forEach,e=function(a){this.enterStates=a.enterStates.slice(),this.exitStates=a.exitStates.slice(),this.resolveState=a.resolveState,this.finalState=a.enterStates[a.enterStates.length-1]||a.resolveState};e.prototype={normalize:function(a,b){return this.matchContextsToStates(b),this.addInitialStates(),this.removeUnchangedContexts(a),this},matchContextsToStates:function(b){var c=this.enterStates.length-1,d=[],e,f;while(b.length>0){if(c>=0)e=this.enterStates[c--];else{if(this.enterStates.length){e=a(this.enterStates[0],"parentState");if(!e)throw"Cannot match all contexts to states"}else e=this.resolveState;this.enterStates.unshift(e),this.exitStates.unshift(e)}a(e,"hasContext")?f=b.pop():f=null,d.unshift(f)}this.contexts=d},addInitialStates:function(){var b=this.finalState,c;for(;;){c=a(b,"initialState")||"start",b=a(b,"states."+c);if(!b)break;this.finalState=b,this.enterStates.push(b),this.contexts.push(undefined)}},removeUnchangedContexts:function(a){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;if(this.enterStates.length===this.contexts.length){if(a.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}},Ember.StateManager=Ember.State.extend({init:function(){this._super(),b(this,"stateMeta",Ember.Map.create());var c=a(this,"initialState");!c&&a(this,"states.start")&&(c="start"),c&&this.transitionTo(c)},stateMetaFor:function(b){var c=a(this,"stateMeta"),d=c.get(b);return d||(d={},c.set(b,d)),d},setStateMeta:function(a,c,d){return b(this.stateMetaFor(a),c,d)},getStateMeta:function(b,c){return a(this.stateMetaFor(b),c)},currentState:null,transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(b,c){return this.sendRecursively(b,a(this,"currentState"),c)},sendRecursively:function(b,d,e){var f=this.enableLogging,g=d[b];if(typeof g=="function")return f&&Ember.Logger.log(c("STATEMANAGER: Sending event '%@' to state %@.",[b,a(d,"path")])),g.call(d,this,e);var h=a(d,"parentState");if(h)return this.sendRecursively(b,h,e);if(a(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+b+" in state "+a(this,"currentState.path")+".")},getStateByPath:function(b,c){var d=c.split("."),e=b;for(var f=0,g=d.length;f<g;f++){e=a(a(e,"states"),d[f]);if(!e)break}return e},findStateByPath:function(b,c){var d;while(!d&&b)d=this.getStateByPath(b,c),b=a(b,"parentState");return d},findStatesByPath:function(b,c){if(!c||c==="")return undefined;var d=c.split("."),e=[];for(var f=0,g=d.length;f<g;f++){var h=a(b,"states");if(!h)return undefined;var i=a(h,d[f]);if(!i)return undefined;b=i,e.push(i)}return e},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(b,c){if(Ember.empty(b))return;var d=c?Array.prototype.slice.call(arguments,1):[],f=a(this,"currentState")||this,g=this.contextFreeTransition(f,b),h=(new e(g)).normalize(this,d);this.enterState(h),this.triggerSetupContext(h)},contextFreeTransition:function(b,c){var d=b.pathsCache[c];if(d)return d;var e=this.findStatesByPath(b,c),f=[],g=b;while(g&&!e){f.unshift(g),g=a(g,"parentState");if(!g){e=this.findStatesByPath(this,c);if(!e)return}e=this.findStatesByPath(g,c)}while(e.length>0&&e[0]===f[0])g=e.shift(),f.shift();var h=b.pathsCache[c]={exitStates:f,enterStates:e,resolveState:g};return h},triggerSetupContext:function(b){var c=b.contexts,e=b.enterStates.length-c.length,f=b.enterStates,g=a(this,"transitionEvent");d.call(f,function(a,b){a.trigger(g,this,c[b-e])},this)},getState:function(b){var c=a(this,b),d=a(this,"parentState");if(c)return c;if(d)return d.getState(b)},enterState:function(c){var e=this.enableLogging,f=c.exitStates.slice(0).reverse();d.call(f,function(a){a.trigger("exit",this)},this),d.call(c.enterStates,function(b){e&&Ember.Logger.log("STATEMANAGER: Entering "+a(b,"path")),b.trigger("enter",this)},this),b(this,"currentState",c.finalState)}})}(),function(){}(),function(){var a=Ember.get;Ember._ResolvedState=Ember.Object.extend({manager:null,state:null,match:null,object:Ember.computed(function(b,c){if(arguments.length===2)return this._object=c,c;if(this._object)return this._object;var d=a(this,"state"),e=a(this,"match"),f=a(this,"manager");return d.deserialize(f,e.hash)}).property(),hasPromise:Ember.computed(function(){return Ember.canInvoke(a(this,"object"),"then")}).property("object"),promise:Ember.computed(function(){var b=a(this,"object");return Ember.canInvoke(b,"then")?b:{then:function(a){a(b)}}}).property("object"),transition:function(){var b=a(this,"manager"),c=a(this,"state.path"),d=a(this,"object");b.transitionTo(c,d)}})}(),function(){var a=Ember.get,b=function(a){var b=a.toString(),c=b.split("."),d=c[c.length-1];return Ember.String.underscore(d)+"_id"},c=function(a,b){for(var c in b){if(!b.hasOwnProperty(c))continue;if(a.hasOwnProperty(c))continue;a[c]=b[c]}};Ember.Routable=Ember.Mixin.create({init:function(){var b;this.on("connectOutlets",this,this.stashContext);if(b=a(this,"redirectsTo"))this.connectOutlets=function(a){a.transitionTo(b)};var c=a(this,"route");c===""&&(c="/"),this._super()},stashContext:function(b,c){var d=this.serialize(b,c);b.setStateMeta(this,"context",c),b.setStateMeta(this,"serialized",d),a(this,"isRoutable")&&!a(b,"isRouting")&&this.updateRoute(b,a(b,"location"))},updateRoute:function(b,c){if(a(this,"isLeafRoute")){var d=this.absoluteRoute(b);c.setURL(d)}},absoluteRoute:function(b,d){var e=a(this,"parentState"),f="",g;a(e,"isRoutable")&&(f=e.absoluteRoute(b,d));var h=a(this,"routeMatcher"),i=b.getStateMeta(this,"serialized");return d=d||{},c(d,i),g=h&&h.generate(d),g&&(f=f+"/"+g),f},isRoutable:Ember.computed(function(){return typeof a(this,"route")=="string"}).cacheable(),isLeafRoute:Ember.computed(function(){return a(this,"isLeaf")?!0:!a(this,"childStates").findProperty("isRoutable")}).cacheable(),routeMatcher:Ember.computed(function(){var b=a(this,"route");if(b)return Ember._RouteMatcher.create({route:b})}).cacheable(),hasContext:Ember.computed(function(){var b=a(this,"routeMatcher");if(b)return b.identifiers.length>0}).cacheable(),modelClass:Ember.computed(function(){var b=a(this,"modelType");return typeof b=="string"?Ember.get(window,b):b}).cacheable(),modelClassFor:function(b){var c,d,e,f,g;if(c=a(this,"modelClass"))return c;if(!b)return;d=a(this,"routeMatcher");if(!d)return;e=d.identifiers;if(e.length!==2)return;f=e[1].match(/^(.*)_id$/);if(!f)return;return g=Ember.String.classify(f[1]),a(b,g)},deserialize:function(c,d){var e,f,g;return(e=this.modelClassFor(a(c,"namespace")))?e.find(d[b(e)]):d},serialize:function(c,d){var e,f,g,h,i;if(Ember.empty(d))return"";if(e=this.modelClassFor(a(c,"namespace")))h=b(e),i=a(d,"id"),d={},d[h]=i;return d},resolvePath:function(b,c){if(a(this,"isLeafRoute"))return Ember.A();var d=a(this,"childStates"),e;d=Ember.A(d.filterProperty("isRoutable")),d=d.sort(function(b,c){var d=a(b,"routeMatcher.identifiers.length"),e=a(c,"routeMatcher.identifiers.length"),f=a(b,"route"),g=a(c,"route");return f.indexOf(g)===0?-1:g.indexOf(f)===0?1:d!==e?d-e:a(c,"route.length")-a(b,"route.length")});var f=d.find(function(b){var d=a(b,"routeMatcher");if(e=d.match(c))return!0}),g=Ember._ResolvedState.create({manager:b,state:f,match:e}),h=f.resolvePath(b,e.remaining);return Ember.A([g]).pushObjects(h)},routePath:function(b,c){function f(){d.forEach(function(a){a.transition()})}if(a(this,"isLeafRoute"))return;var d=this.resolvePath(b,c),e=d.some(function(b){return a(b,"hasPromise")});e?(b.transitionTo("loading"),b.handleStatePromises(d,f)):f()},unroutePath:function(b,c){var d=a(this,"parentState");if(d===b)return;c=c.replace(/^(?=[^\/])/,"/");var e=this.absoluteRoute(b),f=a(this,"route");if(f!=="/"){var g=c.indexOf(e),h=c.charAt(e.length);if(g===0&&(h==="/"||h===""))return}b.enterState({exitStates:[this],enterStates:[],finalState:d}),b.send("unroutePath",c)},connectOutlets:Ember.K,navigateAway:Ember.K})}(),function(){Ember.Route=Ember.State.extend(Ember.Routable)}(),function(){var a=function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^\$|#\s]/g,"\\$&")};Ember._RouteMatcher=Ember.Object.extend({state:null,init:function(){var b=this.route,c=[],d=1,e;b.charAt(0)==="/"&&(b=this.route=b.substr(1)),e=a(b);var f=e.replace(/:([a-z_]+)(?=$|\/)/gi,function(a,b){return c[d++]=b,"([^/]+)"});this.identifiers=c,this.regex=new RegExp("^/?"+f)},match:function(a){var b=a.match(this.regex);if(b){var c=this.identifiers,d={};for(var e=1,f=c.length;e<f;e++)d[c[e]]=b[e];return{remaining:a.substr(b[0].length),hash:c.length>0?d:null}}},generate:function(a){var b=this.identifiers,c=this.route,d;for(var e=1,f=b.length;e<f;e++)d=b[e],c=c.replace(new RegExp(":"+d),a[d]);return c}})}(),function(){var a=Ember.get,b=Ember.set,c=function(a,b){for(var c in b){if(!b.hasOwnProperty(c))continue;if(a.hasOwnProperty(c))continue;a[c]=b[c]}};Ember.Router=Ember.StateManager.extend({initialState:"root",location:"hash",rootURL:"/",transitionEvent:"connectOutlets",transitionTo:function(){this.abortRoutingPromises(),this._super.apply(this,arguments)},route:function(c){this.abortRoutingPromises(),b(this,"isRouting",!0);var d;try{c=c.replace(/^(?=[^\/])/,"/"),this.send("navigateAway"),this.send("unroutePath",c),d=a(this,"currentState");while(d&&!d.get("isRoutable"))d=a(d,"parentState");var e=d?d.absoluteRoute(this):"",f=c.substr(e.length);this.send("routePath",f)}finally{b(this,"isRouting",!1)}d=a(this,"currentState");while(d&&!d.get("isRoutable"))d=a(d,"parentState");d&&d.updateRoute(this,a(this,"location"))},urlFor:function(b,c){var d=a(this,"currentState")||this,e=this.findStateByPath(d,b),f=a(this,"location"),g=e.absoluteRoute(this,c);return f.formatURL(g)},urlForEvent:function(b){var c=Array.prototype.slice.call(arguments,1),d=a(this,"currentState"),e=d.lookupEventTransition(b),f=this.findStateByPath(d,e),g=this.serializeRecursively(f,c,{});return this.urlFor(e,g)},serializeRecursively:function(b,d,e){var f,g=a(b,"hasContext")?d.pop():null;return c(e,b.serialize(this,g)),f=b.get("parentState"),f&&f instanceof Ember.Route?this.serializeRecursively(f,d,e):e},abortRoutingPromises:function(){this._routingPromises&&(this._routingPromises.abort(),this._routingPromises=null)},handleStatePromises:function(a,c){this.abortRoutingPromises(),this.set("isLocked",!0);var d=this;this._routingPromises=Ember._PromiseChain.create({promises:a.slice(),successCallback:function(){d.set("isLocked",!1),c()},failureCallback:function(){throw"Unable to load object"},promiseSuccessCallback:function(a,c){b(a,"object",c[0])},abortCallback:function(){d.set("isLocked",!1)}}).start()},init:function(){this._super();var c=a(this,"location"),d=a(this,"rootURL");"string"==typeof c&&b(this,"location",Ember.Location.create({implementation:c,rootURL:d}))},willDestroy:function(){a(this,"location").destroy()}})}(),function(){}(),function(){var a=Ember.get;Ember.StateManager.reopen({currentView:Ember.computed(function(){var b=a(this,"currentState"),c;while(b){if(a(b,"isViewState")){c=a(b,"view");if(c)return c}b=a(b,"parentState")}return null}).property("currentState").cacheable()})}(),function(){var a=Ember.get,b=Ember.set;Ember.ViewState=Ember.State.extend({isViewState:!0,init:function(){return this._super()},enter:function(c){var d=a(this,"view"),e,f;d&&(Ember.View.detect(d)&&(d=d.create(),b(this,"view",d)),e=c.get("rootView"),e?(f=a(e,"childViews"),f.pushObject(d)):(e=c.get("rootElement")||"body",d.appendTo(e)))},exit:function(b){var c=a(this,"view");c&&(a(c,"parentView")?c.removeFromParent():c.remove())}})}(),function(){}(),function(){(function(a){var b=function(){},c=0,d=a.document,e="createRange"in d&&typeof Range!="undefined"&&Range.prototype.createContextualFragment,f=function(){var a=d.createElement("div");return a.innerHTML="<div></div>",a.firstChild.innerHTML="<script></script>",a.firstChild.innerHTML===""}(),g=function(a){var d;this instanceof g?d=this:d=new b,d.innerHTML=a;var e="metamorph-"+c++;return d.start=e+"-start",d.end=e+"-end",d};b.prototype=g.prototype;var h,i,j,k,l,m,n,o,p;k=function(){return this.startTag()+this.innerHTML+this.endTag()},o=function(){return"<script id='"+this.start+"' type='text/x-placeholder'></script>"},p=function(){return"<script id='"+this.end+"' type='text/x-placeholder'></script>"};if(e)h=function(a,b){var c=d.createRange(),e=d.getElementById(a.start),f=d.getElementById(a.end);return b?(c.setStartBefore(e),c.setEndAfter(f)):(c.setStartAfter(e),c.setEndBefore(f)),c},i=function(a,b){var c=h(this,b);c.deleteContents();var d=c.createContextualFragment(a);c.insertNode(d)},j=function(){var a=h(this,!0);a.deleteContents()},l=function(a){var b=d.createRange();b.setStart(a),b.collapse(!1);var c=b.createContextualFragment(this.outerHTML());a.appendChild(c)},m=function(a){var b=d.createRange(),c=d.getElementById(this.end);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)},n=function(a){var b=d.createRange(),c=d.getElementById(this.start);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)};else{var q={select:[1,"<select multiple='multiple'>","</select>"],fieldset:[1,"<fieldset>","</fieldset>"],table:[1,"<table>","</table>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"],colgroup:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],map:[1,"<map>","</map>"],_default:[0,"",""]},r=function(a,b){var c=q[a.tagName.toLowerCase()]||q._default,e=c[0],g=c[1],h=c[2];f&&(b="&shy;"+b);var i=d.createElement("div");i.innerHTML=g+b+h;for(var j=0;j<=e;j++)i=i.firstChild;if(f){var k=i;while(k.nodeType===1&&!k.nodeName)k=k.firstChild;k.nodeType===3&&k.nodeValue.charAt(0)==="­"&&(k.nodeValue=k.nodeValue.slice(1))}return i},s=function(a){while(a.parentNode.tagName==="")a=a.parentNode;return a},t=function(a,b){a.parentNode!==b.parentNode&&b.parentNode.insertBefore(a,b.parentNode.firstChild)};i=function(a,b){var c=s(d.getElementById(this.start)),e=d.getElementById(this.end),f=e.parentNode,g,h,i;t(c,e),g=c.nextSibling;while(g){h=g.nextSibling,i=g===e;if(i){if(!b)break;e=g.nextSibling}g.parentNode.removeChild(g);if(i)break;g=h}g=r(c.parentNode,a);while(g)h=g.nextSibling,f.insertBefore(g,e),g=h},j=function(){var a=s(d.getElementById(this.start)),b=d.getElementById(this.end);this.html(""),a.parentNode.removeChild(a),b.parentNode.removeChild(b)},l=function(a){var b=r(a,this.outerHTML());while(b)nextSibling=b.nextSibling,a.appendChild(b),b=nextSibling},m=function(a){var b=d.getElementById(this.end),c=b.nextSibling,e=b.parentNode,f,g;g=r(e,a);while(g)f=g.nextSibling,e.insertBefore(g,c),g=f},n=function(a){var b=d.getElementById(this.start),c=b.parentNode,e,f;f=r(c,a);var g=b.nextSibling;while(f)e=f.nextSibling,c.insertBefore(f,g),f=e}}g.prototype.html=function(a){this.checkRemoved();if(a===undefined)return this.innerHTML;i.call(this,a),this.innerHTML=a},g.prototype.replaceWith=function(a){this.checkRemoved(),i.call(this,a,!0)},g.prototype.remove=j,g.prototype.outerHTML=k,g.prototype.appendTo=l,g.prototype.after=m,g.prototype.prepend=n,g.prototype.startTag=o,g.prototype.endTag=p,g.prototype.isRemoved=function(){var a=d.getElementById(this.start),b=d.getElementById(this.end);return!a||!b},g.prototype.checkRemoved=function(){if(this.isRemoved())throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")},a.Metamorph=g})(this)}(),function(){var a=Ember.create;Ember.Handlebars=a(Handlebars),Ember.Handlebars.helpers=a(Handlebars.helpers),Ember.Handlebars.Compiler=function(){},Ember.Handlebars.Compiler.prototype=a(Handlebars.Compiler.prototype),Ember.Handlebars.Compiler.prototype.compiler=Ember.Handlebars.Compiler,Ember.Handlebars.JavaScriptCompiler=function(){},Ember.Handlebars.JavaScriptCompiler.prototype=a(Handlebars.JavaScriptCompiler.prototype),Ember.Handlebars.JavaScriptCompiler.prototype.compiler=Ember.Handlebars.JavaScriptCompiler,Ember.Handlebars.JavaScriptCompiler.prototype.namespace="Ember.Handlebars",Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer=function(){return"''"},Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer=function(a){return"data.buffer.push("+a+");"},Ember.Handlebars.Compiler.prototype.mustache=function(a){if(a.params.length||a.hash)return Handlebars.Compiler.prototype.mustache.call(this,a);var b=new Handlebars.AST.IdNode(["_triageMustache"]);return a.escaped||(a.hash=a.hash||new Handlebars.AST.HashNode([]),a.hash.pairs.push(["unescaped",new Handlebars.AST.StringNode("true")])),a=new Handlebars.AST.MustacheNode([b].concat([a.id]),a.hash,!a.escaped),Handlebars.Compiler.prototype.mustache.call(this,a)},Ember.Handlebars.precompile=function(a){var b=Handlebars.parse(a),c={knownHelpers:{action:!0,unbound:!0,bindAttr:!0,template:!0,view:!0,_triageMustache:!0},data:!0,stringParams:!0},d=(new Ember.Handlebars.Compiler).compile(b,c);return(new Ember.Handlebars.JavaScriptCompiler).compile(d,c,undefined,!0)},Ember.Handlebars.compile=function(a){var b=Handlebars.parse(a),c={data:!0,stringParams:!0},d=(new Ember.Handlebars.Compiler).compile(b,c),e=(new Ember.Handlebars.JavaScriptCompiler).compile(d,c,undefined,!0);return Handlebars.template(e)};var b=Ember.Handlebars.normalizePath=function(a,b,c){var d=c&&c.keywords||{},e,f;return e=b.split(".",1)[0],d.hasOwnProperty(e)&&(a=d[e],f=!0,b===e?b="":b=b.substr(e.length+1)),{root:a,path:b,isKeyword:f}};Ember.Handlebars.getPath=function(a,c,d){var e=d&&d.data,f=b(a,c,e),g;return a=f.root,c=f.path,g=Ember.get(a,c),g===undefined&&a!==window&&Ember.isGlobalPath(c)&&(g=Ember.get(window,c)),g},Ember.Handlebars.registerHelper("helperMissing",function(a,b){var c,d="";throw c="%@ Handlebars error: Could not find property '%@' on object %@.",b.data&&(d=b.data.view),new Ember.Error(Ember.String.fmt(c,[d,a,this]))})}(),function(){Ember.String.htmlSafe=function(a){return new Handlebars.SafeString(a)};var a=Ember.String.htmlSafe;Ember.EXTEND_PROTOTYPES&&(String.prototype.htmlSafe=function(){return a(this)})}(),function(){var a=Ember.set,b=Ember.get,c={remove:function(b){var c=b.morph;if(c.isRemoved())return;a(b,"element",null),b._lastInsert=null,c.remove()},prepend:function(a,b){b._insertElementLater(function(){var c=a.morph;c.prepend(b.outerHTML),b.outerHTML=null})},after:function(a,b){b._insertElementLater(function(){var c=a.morph;c.after(b.outerHTML),b.outerHTML=null})},replace:function(a){var c=a.morph;a.transitionTo("preRender"),a.clearRenderedChildren();var d=a.renderToBuffer();Ember.run.schedule("render",this,function(){if(b(a,"isDestroyed"))return;a.invalidateRecursively("element"),a._notifyWillInsertElement(),c.replaceWith(d.string()),a.transitionTo("inDOM"),a._notifyDidInsertElement()})},empty:function(a){a.morph.html("")}};Ember._Metamorph=Ember.Mixin.create({isVirtual:!0,tagName:"",init:function(){this._super(),this.morph=Metamorph()},beforeRender:function(a){a.push(this.morph.startTag())},afterRender:function(a){a.push(this.morph.endTag())},createElement:function(){var a=this.renderToBuffer();this.outerHTML=a.string(),this.clearBuffer()},domManager:c}),Ember._MetamorphView=Ember.View.extend(Ember._Metamorph)}(),function(){var a=Ember.get,b=Ember.set,c=Ember.Handlebars.getPath;Ember._HandlebarsBoundView=Ember._MetamorphView.extend({shouldDisplayFunc:null,preserveContext:!1,previousContext:null,displayTemplate:null,inverseTemplate:null,path:null,pathRoot:null,normalizedValue:Ember.computed(function(){var b=a(this,"path"),d=a(this,"pathRoot"),e=a(this,"valueNormalizerFunc"),f,g;return b===""?f=d:(g=a(this,"templateData"),f=c(d,b,{data:g})),e?e(f):f}).property("path","pathRoot","valueNormalizerFunc").volatile(),rerenderIfNeeded:function(){!a(this,"isDestroyed")&&a(this,"normalizedValue")!==this._lastNormalizedValue&&this.rerender()},render:function(c){var d=a(this,"isEscaped"),e=a(this,"shouldDisplayFunc"),f=a(this,"preserveContext"),g=a(this,"previousContext"),h=a(this,"inverseTemplate"),i=a(this,"displayTemplate"),j=a(this,"normalizedValue");this._lastNormalizedValue=j;if(e(j)){b(this,"template",i);if(f)b(this,"_context",g);else{if(!i){j===null||j===undefined?j="":j instanceof Handlebars.SafeString||(j=String(j)),d&&(j=Handlebars.Utils.escapeExpression(j)),c.push(j);return}b(this,"_context",j)}}else h?(b(this,"template",h),f?b(this,"_context",g):b(this,"_context",j)):b(this,"template",function(){return""});return this._super(c)}})}(),function(){function i(a,b,c,f,g){var h=b.data,i=b.fn,j=b.inverse,k=h.view,l=this,m,n,o;o=e(l,a,h),m=o.root,n=o.path;if("object"==typeof this){var p=k.createChildView(Ember._HandlebarsBoundView,{preserveContext:c,shouldDisplayFunc:f,valueNormalizerFunc:g,displayTemplate:i,inverseTemplate:j,path:n,pathRoot:m,previousContext:l,isEscaped:!b.hash.unescaped,templateData:b.data});k.appendChild(p);var q=function(){Ember.run.once(p,"rerenderIfNeeded")};n!==""&&Ember.addObserver(m,n,q)}else h.buffer.push(d(m,n,b))}var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.Handlebars.getPath,e=Ember.Handlebars.normalizePath,f=Ember.ArrayPolyfills.forEach,g=Ember.Handlebars,h=g.helpers;g.registerHelper("_triageMustache",function(a,b){return h[a]?h[a].call(this,b):h.bind.apply(this,arguments)}),g.registerHelper("bind",function(a,b){var c=b.contexts&&b.contexts[0]||this;return i.call(c,a,b,!1,function(a){return!Ember.none(a)})}),g.registerHelper("boundIf",function(b,c){var d=c.contexts&&c.contexts[0]||this,e=function(b){return Ember.typeOf(b)==="array"?a(b,"length")!==0:!!b};return i.call(d,b,c,!0,e,e)}),g.registerHelper("with",function(a,b){if(arguments.length===4){var c,d,f,g;b=arguments[3],c=arguments[2],d=arguments[0];if(Ember.isGlobalPath(d))Ember.bind(b.data.keywords,c,d);else{g=e(this,d,b.data),d=g.path,f=g.root;var j=Ember.$.expando+Ember.guidFor(f);b.data.keywords[j]=f;var k=d?j+"."+d:j;Ember.bind(b.data.keywords,c,k)}return i.call(this,d,b.fn,!0,function(a){return!Ember.none(a)})}return h.bind.call(b.contexts[0],a,b)}),g.registerHelper("if",function(a,b){return h.boundIf.call(b.contexts[0],a,b)}),g.registerHelper("unless",function(a,b){var c=b.fn,d=b.inverse;return b.fn=d,b.inverse=c,h.boundIf.call(b.contexts[0],a,b)}),g.registerHelper("bindAttr",function(a){var b=a.hash,c=a.data.view,h=[],i=this,j=++Ember.$.uuid,k=b["class"];if(k!==null&&k!==undefined){var l=g.bindClasses(this,k,c,j,a);h.push('class="'+Handlebars.Utils.escapeExpression(l.join(" "))+'"'),delete b["class"]}var m=Ember.keys(b);return f.call(m,function(f){var g=b[f],k,l;l=e(i,g,a.data),k=l.root,g=l.path;var m=g==="this"?k:d(k,g,a),n=Ember.typeOf(m),o,p;o=function(){var e=d(k,g,a),h=c.$("[data-bindattr-"+j+"='"+j+"']");if(h.length===0){Ember.removeObserver(k,g,p);return}Ember.View.applyAttributeBindings(h,f,e)},p=function(){Ember.run.once(o)},g!=="this"&&Ember.addObserver(k,g,p),n==="string"||n==="number"&&!isNaN(m)?h.push(f+'="'+Handlebars.Utils.escapeExpression(m)+'"'):m&&n==="boolean"&&h.push(f+'="'+f+'"')},this),h.push("data-bindattr-"+j+'="'+j+'"'),new g.SafeString(h.join(" "))}),g.bindClasses=function(a,b,c,g,h){var i=[],j,k,l,m=function(a,b,c){var e,f=b.path;return f==="this"?e=a:f===""?e=!0:e=d(a,f,c),Ember.View._classStringForValue(f,e,b.className,b.falsyClassName)};return f.call(b.split(" "),function(b){var d,f,n,o=Ember.View._parsePropertyPath(b),p=o.path,q=a,r;p!==""&&p!=="this"&&(r=e(a,p,h.data),q=r.root,p=r.path),f=function(){j=m(q,o,h),l=g?c.$("[data-bindattr-"+g+"='"+g+"']"):c.$(),l.length===0?Ember.removeObserver(q,p,n):(d&&l.removeClass(d),j?(l.addClass(j),d=j):d=null)},n=function(){Ember.run.once(f)},p!==""&&p!=="this"&&Ember.addObserver(q,p,n),k=m(q,o,h),k&&(i.push(k),d=k)}),i}}(),function(){var a=Ember.get,b=Ember.set,c=/^parentView\./,d=Ember.Handlebars,e=Ember.VIEW_PRESERVES_CONTEXT;d.ViewHelper=Ember.Object.create({propertiesFromHTMLOptions:function(a,b){var c=a.hash,d=a.data,e={},f=c["class"],g=!1;c.id&&(e.elementId=c.id,g=!0),f&&(f=f.split(" "),e.classNames=f,g=!0),c.classBinding&&(e.classNameBindings=c.classBinding.split(" "),g=!0),c.classNameBindings&&(e.classNameBindings===undefined&&(e.classNameBindings=[]),e.classNameBindings=e.classNameBindings.concat(c.classNameBindings.split(" ")),g=!0),c.attributeBindings&&(e.attributeBindings=null,g=!0),g&&(c=Ember.$.extend({},c),delete c.id,delete c["class"],delete c.classBinding);var h;for(var i in c){if(!c.hasOwnProperty(i))continue;Ember.IS_BINDING.test(i)&&typeof c[i]=="string"&&(h=this.contextualizeBindingPath(c[i],d),h&&(c[i]=h))}if(e.classNameBindings)for(var j in e.classNameBindings){var k=e.classNameBindings[j];if(typeof k=="string"){var l=Ember.View._parsePropertyPath(k);h=this.contextualizeBindingPath(l.path,d),h&&(e.classNameBindings[j]=h+l.classNames)}}return e.bindingContext=b,Ember.$.extend(c,e)},contextualizeBindingPath:function(a,b){var c=Ember.Handlebars.normalizePath(null,a,b);return c.isKeyword?"templateData.keywords."+a:Ember.isGlobalPath(a)?null:a==="this"?"bindingContext":"bindingContext."+a},helper:function(a,b,c){var f=c.inverse,g=c.data,h=g.view,i=c.fn,j=c.hash,k;"string"==typeof b?k=d.getPath(a,b,c):k=b;var l=this.propertiesFromHTMLOptions(c,a),m=g.view;l.templateData=c.data,i&&(l.template=i),e&&!k.proto().controller&&!k.proto().controllerBinding&&!l.controller&&!l.controllerBinding&&(l._context=a),m.appendChild(k,l)}}),d.registerHelper("view",function(a,b){return a&&a.data&&a.data.isRenderData&&(b=a,a="Ember.View"),d.ViewHelper.helper(this,a,b)})}(),function(){var a=Ember.get,b=Ember.Handlebars.getPath,c=Ember.String.fmt;Ember.Handlebars.registerHelper("collection",function(c,d){c&&c.data&&c.data.isRenderData&&(d=c,c=undefined);var e=d.fn,f=d.data,g=d.inverse,h;h=c?b(this,c,d):Ember.CollectionView;var i=d.hash,j={},k,l,m=i.itemViewClass,n=h.proto();delete i.itemViewClass,l=m?b(n,m,d):n.itemViewClass;for(var o in i)i.hasOwnProperty(o)&&(k=o.match(/^item(.)(.*)$/),k&&(j[k[1].toLowerCase()+k[2]]=i[o],delete i[o]));var p=i.tagName||n.tagName;e&&(j.template=e,delete d.fn);var q;g&&g!==Handlebars.VM.noop?(q=a(n,"emptyViewClass"),q=q.extend({template:g,tagName:j.tagName})):i.emptyViewClass&&(q=b(this,i.emptyViewClass,d)),i.emptyView=q,i.eachHelper==="each"&&(j._context=Ember.computed(function(){return a(this,"content")}).property("content"),delete i.eachHelper);var r=Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({data:f,hash:j},this);return i.itemViewClass=l.extend(r),Ember.Handlebars.helpers.view.call(this,h,d)})}(),function(){var a=Ember.Handlebars.getPath;Ember.Handlebars.registerHelper("unbound",function(b,c){var d=c.contexts&&c.contexts[0]||this;return a(d,b,c)})}(),function(){var a=Ember.Handlebars.getPath,b=Ember.Handlebars.normalizePath;Ember.Handlebars.registerHelper("log",function(c,d){var e=d.contexts&&d.contexts[0]||this,f=b(e,c,d.data),g=f.root,h=f.path,i=h==="this"?g:a(g,h,d);Ember.Logger.log(i)}),Ember.Handlebars.registerHelper("debugger",function(){debugger})}(),function(){var a=Ember.get,b=Ember.set;Ember.Handlebars.EachView=Ember.CollectionView.extend(Ember._Metamorph,{itemViewClass:Ember._MetamorphView,emptyViewClass:Ember._MetamorphView,createChildView:function(c,d){c=this._super(c,d);var e=a(this,"keyword");if(e){var f=a(c,"templateData");f=Ember.copy(f),f.keywords=c.cloneKeywords(),b(c,"templateData",f);var g=a(c,"content");f.keywords[e]=g}return c}}),Ember.Handlebars.registerHelper("each",function(a,b){if(arguments.length===4){var c=arguments[0];b=arguments[3],a=arguments[2],a===""&&(a="this"),b.hash.keyword=c}else b.hash.eachHelper="each";return b.hash.contentBinding=a,Ember.Handlebars.helpers.collection.call(this,"Ember.Handlebars.EachView",b)})}(),function(){Ember.Handlebars.registerHelper("template",function(a,b){var c=Ember.TEMPLATES[a];Ember.TEMPLATES[a](this,{data:b.data})})}(),function(){var a=Ember.Handlebars,b=a.getPath,c=Ember.get,d=Array.prototype.slice,e=a.ActionHelper={registeredActions:{}};e.registerAction=function(a,b){var c=(++Ember.$.uuid).toString();return e.registeredActions[c]={eventName:b.eventName,handler:function(c){var d=c.shiftKey||c.metaKey||c.altKey||c.ctrlKey,e=c.which>1,f=d||e;if(b.link&&f)return;c.preventDefault(),c.view=b.view,b.hasOwnProperty("context")&&(c.context=b.context),b.hasOwnProperty("contexts")&&(c.contexts=b.contexts);var g=b.target;return g.isState&&typeof g.send=="function"?g.send(a,c):g[a].call(g,c)}},b.view.on("willRerender",function(){delete e.registeredActions[c]}),c},a.registerHelper("action",function(f){var g=arguments[arguments.length-1],h=d.call(arguments,1,-1),i=g.hash,j=g.data.view,k,l,m,n={eventName:i.on||"click"};n.view=j=c(j,"concreteView");if(i.target)k=b(this,i.target,g);else if(l=g.data.keywords.controller)k=c(l,"target");n.target=k=k||j,h.length&&(n.contexts=h=Ember.EnumerableUtils.map(h,function(a){return b(this,a,g)},this),n.context=h[0]);var o=[],p;i.href&&k.urlForEvent&&(p=k.urlForEvent.apply(k,[f].concat(h)),o.push('href="'+p+'"'),n.link=!0);var q=e.registerAction(f,n);return o.push('data-ember-action="'+q+'"'),new a.SafeString(o.join(" "))})}(),function(){var a=Ember.get,b=Ember.set;Ember.Handlebars.registerHelper("yield",function(b){var c=b.data.view,d;while(c&&!a(c,"layout"))c=a(c,"parentView");d=a(c,"template"),d&&d(this,b)})}(),function(){Ember.Handlebars.registerHelper("outlet",function(a,b){return a&&a.data&&a.data.isRenderData&&(b=a,a="view"),b.hash.currentViewBinding="controller."+a,Ember.Handlebars
+.helpers.view.call(this,Ember.ContainerView,b)})}(),function(){}(),function(){}(),function(){var a=Ember.set,b=Ember.get;Ember.Checkbox=Ember.View.extend({classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","disabled","tabindex"],type:"checkbox",checked:!1,disabled:!1,init:function(){this._super(),this.on("change",this,this._updateElementValue)},_updateElementValue:function(){a(this,"checked",this.$().prop("checked"))}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TextSupport=Ember.Mixin.create({value:"",attributeBindings:["placeholder","disabled","maxlength","tabindex"],placeholder:null,disabled:!1,maxlength:null,insertNewline:Ember.K,cancel:Ember.K,init:function(){this._super(),this.on("focusOut",this,this._elementValueDidChange),this.on("change",this,this._elementValueDidChange),this.on("keyUp",this,this.interpretKeyEvents)},interpretKeyEvents:function(a){var b=Ember.TextSupport.KEY_EVENTS,c=b[a.keyCode];this._elementValueDidChange();if(c)return this[c](a)},_elementValueDidChange:function(){b(this,"value",this.$().val())}}),Ember.TextSupport.KEY_EVENTS={13:"insertNewline",27:"cancel"}}(),function(){var a=Ember.get,b=Ember.set;Ember.TextField=Ember.View.extend(Ember.TextSupport,{classNames:["ember-text-field"],tagName:"input",attributeBindings:["type","value","size"],value:"",type:"text",size:null})}(),function(){var a=Ember.get,b=Ember.set;Ember.Button=Ember.View.extend(Ember.TargetActionSupport,{classNames:["ember-button"],classNameBindings:["isActive"],tagName:"button",propagateEvents:!1,attributeBindings:["type","disabled","href","tabindex"],targetObject:Ember.computed(function(){var b=a(this,"target"),c=a(this,"context"),d=a(this,"templateData");return typeof b!="string"?b:Ember.Handlebars.getPath(c,b,{data:d})}).property("target").cacheable(),type:Ember.computed(function(a,b){var c=this.get("tagName");b!==undefined&&(this._type=b);if(this._type!==undefined)return this._type;if(c==="input"||c==="button")return"button"}).property("tagName").cacheable(),disabled:!1,href:Ember.computed(function(){return this.get("tagName")==="a"?"#":null}).property("tagName").cacheable(),mouseDown:function(){return a(this,"disabled")||(b(this,"isActive",!0),this._mouseDown=!0,this._mouseEntered=!0),a(this,"propagateEvents")},mouseLeave:function(){this._mouseDown&&(b(this,"isActive",!1),this._mouseEntered=!1)},mouseEnter:function(){this._mouseDown&&(b(this,"isActive",!0),this._mouseEntered=!0)},mouseUp:function(c){return a(this,"isActive")&&(this.triggerAction(),b(this,"isActive",!1)),this._mouseDown=!1,this._mouseEntered=!1,a(this,"propagateEvents")},keyDown:function(a){(a.keyCode===13||a.keyCode===32)&&this.mouseDown()},keyUp:function(a){(a.keyCode===13||a.keyCode===32)&&this.mouseUp()},touchStart:function(a){return this.mouseDown(a)},touchEnd:function(a){return this.mouseUp(a)},init:function(){this._super()}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TextArea=Ember.View.extend(Ember.TextSupport,{classNames:["ember-text-area"],tagName:"textarea",attributeBindings:["rows","cols"],rows:null,cols:null,_updateElementValue:Ember.observer(function(){var b=a(this,"value"),c=this.$();c&&b!==c.val()&&c.val(b)},"value"),init:function(){this._super(),this.on("didInsertElement",this,this._updateElementValue)}})}(),function(){Ember.TabContainerView=Ember.View.extend({init:function(){this._super()}})}(),function(){var a=Ember.get;Ember.TabPaneView=Ember.View.extend({tabsContainer:Ember.computed(function(){return this.nearestInstanceOf(Ember.TabContainerView)}).property().volatile(),isVisible:Ember.computed(function(){return a(this,"viewName")===a(this,"tabsContainer.currentView")}).property("tabsContainer.currentView").volatile(),init:function(){this._super()}})}(),function(){var a=Ember.get,b=Ember.setPath;Ember.TabView=Ember.View.extend({tabsContainer:Ember.computed(function(){return this.nearestInstanceOf(Ember.TabContainerView)}).property().volatile(),mouseUp:function(){b(this,"tabsContainer.currentView",a(this,"value"))},init:function(){this._super()}})}(),function(){}(),function(){var a=Ember.set,b=Ember.get,c=Ember.EnumerableUtils.indexOf,d=Ember.EnumerableUtils.indexesOf;Ember.Select=Ember.View.extend({tagName:"select",classNames:["ember-select"],defaultTemplate:Ember.Handlebars.template(function(b,c,d,e,f){function q(a,b){var c="",e,f,g,h;return b.buffer.push("<option value>"),e=a,f="view.prompt",g={},h="true",g.escaped=h,h=d._triageMustache||a._triageMustache,k={},k.hash=g,k.contexts=[],k.contexts.push(e),k.data=b,typeof h===m?e=h.call(a,f,k):h===o?e=n.call(a,"_triageMustache",f,k):e=h,b.buffer.push(p(e)+"</option>"),c}function r(a,b){var c,e,f,g;c=a,e="Ember.SelectOption",f={},g="this",f.contentBinding=g,g=d.view||a.view,k={},k.hash=f,k.contexts=[],k.contexts.push(c),k.data=b,typeof g===m?c=g.call(a,e,k):g===o?c=n.call(a,"view",e,k):c=g,b.buffer.push(p(c))}d=d||Ember.Handlebars.helpers;var g="",h,i,j,k,l=this,m="function",n=d.helperMissing,o=void 0,p=this.escapeExpression;return h=c,i="view.prompt",j=d["if"],k=l.program(1,q,f),k.hash={},k.contexts=[],k.contexts.push(h),k.fn=k,k.inverse=l.noop,k.data=f,h=j.call(c,i,k),(h||h===0)&&f.buffer.push(h),h=c,i="view.content",j=d.each,k=l.program(3,r,f),k.hash={},k.contexts=[],k.contexts.push(h),k.fn=k,k.inverse=l.noop,k.data=f,h=j.call(c,i,k),(h||h===0)&&f.buffer.push(h),g}),attributeBindings:["multiple","tabindex"],multiple:!1,content:null,selection:null,value:Ember.computed(function(a,c){if(arguments.length===2)return c;var d=b(this,"optionValuePath").replace(/^content\.?/,"");return d?b(this,"selection."+d):b(this,"selection")}).property("selection").cacheable(),prompt:null,optionLabelPath:"content",optionValuePath:"content",_change:function(){b(this,"multiple")?this._changeMultiple():this._changeSingle()},selectionDidChange:Ember.observer(function(){var c=b(this,"selection"),d=Ember.isArray(c);if(b(this,"multiple")){if(!d){a(this,"selection",Ember.A([c]));return}this._selectionDidChangeMultiple()}else this._selectionDidChangeSingle()},"selection"),valueDidChange:Ember.observer(function(){var a=b(this,"content"),c=b(this,"value"),d=b(this,"optionValuePath").replace(/^content\.?/,""),e=d?b(this,"selection."+d):b(this,"selection"),f;c!==e&&(f=a.find(function(a){return c===(d?b(a,d):a)}),this.set("selection",f))},"value"),_triggerChange:function(){var a=b(this,"selection");a&&this.selectionDidChange(),this._change()},_changeSingle:function(){var c=this.$()[0].selectedIndex,d=b(this,"content"),e=b(this,"prompt");if(!d)return;if(e&&c===0){a(this,"selection",null);return}e&&(c-=1),a(this,"selection",d.objectAt(c))},_changeMultiple:function(){var c=this.$("option:selected"),d=b(this,"prompt"),e=d?1:0,f=b(this,"content");if(!f)return;if(c){var g=c.map(function(){return this.index-e}).toArray();a(this,"selection",f.objectsAt(g))}},_selectionDidChangeSingle:function(){var a=this.get("element");if(!a)return;var d=b(this,"content"),e=b(this,"selection"),f=d?c(d,e):-1,g=b(this,"prompt");g&&(f+=1),a&&(a.selectedIndex=f)},_selectionDidChangeMultiple:function(){var a=b(this,"content"),e=b(this,"selection"),f=a?d(a,e):[-1],g=b(this,"prompt"),h=g?1:0,i=this.$("option"),j;i&&i.each(function(){j=this.index>-1?this.index+h:-1,this.selected=c(f,j)>-1})},init:function(){this._super(),this.on("didInsertElement",this,this._triggerChange),this.on("change",this,this._change)}}),Ember.SelectOption=Ember.View.extend({tagName:"option",attributeBindings:["value","selected"],defaultTemplate:function(a,b){b={data:b.data,hash:{}},Ember.Handlebars.helpers.bind.call(a,"view.label",b)},init:function(){this.labelPathDidChange(),this.valuePathDidChange(),this._super()},selected:Ember.computed(function(){var a=b(this,"content"),d=b(this,"parentView.selection");return b(this,"parentView.multiple")?d&&c(d,a)>-1:a==d}).property("content","parentView.selection").volatile(),labelPathDidChange:Ember.observer(function(){var a=b(this,"parentView.optionLabelPath");if(!a)return;Ember.defineProperty(this,"label",Ember.computed(function(){return b(this,a)}).property(a).cacheable())},"parentView.optionLabelPath"),valuePathDidChange:Ember.observer(function(){var a=b(this,"parentView.optionValuePath");if(!a)return;Ember.defineProperty(this,"value",Ember.computed(function(){return b(this,a)}).property(a).cacheable())},"parentView.optionValuePath")})}(),function(){}(),function(){function a(){Ember.Handlebars.bootstrap(Ember.$(document))}Ember.Handlebars.bootstrap=function(a){var b='script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';Ember.$(b,a).each(function(){var a=Ember.$(this),b=a.attr("type"),c=a.attr("type")==="text/x-raw-handlebars"?Ember.$.proxy(Handlebars.compile,Handlebars):Ember.$.proxy(Ember.Handlebars.compile,Ember.Handlebars),d=a.attr("data-template-name")||a.attr("id"),e=c(a.html()),f,g,h,i;if(d)Ember.TEMPLATES[d]=e,a.remove();else{if(a.parents("head").length!==0)throw new Ember.Error("Template found in <head> without a name specified. Please provide a data-template-name attribute.\n"+a.html());g=a.attr("data-view"),f=g?Ember.get(g):Ember.View,h=a.attr("data-element-id"),i={template:e},h&&(i.elementId=h),f=f.create(i),f._insertElementLater(function(){a.replaceWith(this.$()),a=null})}})},Ember.$(document).ready(a),Ember.onLoad("application",a)}(),function(){}(); \ No newline at end of file
diff --git a/src/components/HMI/lib/handlebars-1.0.0.beta.6.js b/src/components/HMI/lib/handlebars-1.0.0.beta.6.js
new file mode 100644
index 0000000000..70665b1c37
--- /dev/null
+++ b/src/components/HMI/lib/handlebars-1.0.0.beta.6.js
@@ -0,0 +1,1550 @@
+// lib/handlebars/base.js
+var Handlebars = {};
+
+Handlebars.VERSION = "1.0.beta.6";
+
+Handlebars.helpers = {};
+Handlebars.partials = {};
+
+Handlebars.registerHelper = function(name, fn, inverse) {
+ if(inverse) { fn.not = inverse; }
+ this.helpers[name] = fn;
+};
+
+Handlebars.registerPartial = function(name, str) {
+ this.partials[name] = str;
+};
+
+Handlebars.registerHelper('helperMissing', function(arg) {
+ if(arguments.length === 2) {
+ return undefined;
+ } else {
+ throw new Error("Could not find property '" + arg + "'");
+ }
+});
+
+var toString = Object.prototype.toString, functionType = "[object Function]";
+
+Handlebars.registerHelper('blockHelperMissing', function(context, options) {
+ var inverse = options.inverse || function() {}, fn = options.fn;
+
+
+ var ret = "";
+ var type = toString.call(context);
+
+ if(type === functionType) { context = context.call(this); }
+
+ if(context === true) {
+ return fn(this);
+ } else if(context === false || context == null) {
+ return inverse(this);
+ } else if(type === "[object Array]") {
+ if(context.length > 0) {
+ for(var i=0, j=context.length; i<j; i++) {
+ ret = ret + fn(context[i]);
+ }
+ } else {
+ ret = inverse(this);
+ }
+ return ret;
+ } else {
+ return fn(context);
+ }
+});
+
+Handlebars.registerHelper('each', function(context, options) {
+ var fn = options.fn, inverse = options.inverse;
+ var ret = "";
+
+ if(context && context.length > 0) {
+ for(var i=0, j=context.length; i<j; i++) {
+ ret = ret + fn(context[i]);
+ }
+ } else {
+ ret = inverse(this);
+ }
+ return ret;
+});
+
+Handlebars.registerHelper('if', function(context, options) {
+ var type = toString.call(context);
+ if(type === functionType) { context = context.call(this); }
+
+ if(!context || Handlebars.Utils.isEmpty(context)) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+});
+
+Handlebars.registerHelper('unless', function(context, options) {
+ var fn = options.fn, inverse = options.inverse;
+ options.fn = inverse;
+ options.inverse = fn;
+
+ return Handlebars.helpers['if'].call(this, context, options);
+});
+
+Handlebars.registerHelper('with', function(context, options) {
+ return options.fn(context);
+});
+
+Handlebars.registerHelper('log', function(context) {
+ Handlebars.log(context);
+});
+;
+// lib/handlebars/compiler/parser.js
+/* Jison generated parser */
+var handlebars = (function(){
+
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1},
+terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},
+productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],
+performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1: return $$[$0-1]
+break;
+case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0])
+break;
+case 3: this.$ = new yy.ProgramNode($$[$0])
+break;
+case 4: this.$ = new yy.ProgramNode([])
+break;
+case 5: this.$ = [$$[$0]]
+break;
+case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
+break;
+case 7: this.$ = new yy.InverseNode($$[$0-2], $$[$0-1], $$[$0])
+break;
+case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0])
+break;
+case 9: this.$ = $$[$0]
+break;
+case 10: this.$ = $$[$0]
+break;
+case 11: this.$ = new yy.ContentNode($$[$0])
+break;
+case 12: this.$ = new yy.CommentNode($$[$0])
+break;
+case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
+break;
+case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
+break;
+case 15: this.$ = $$[$0-1]
+break;
+case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
+break;
+case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true)
+break;
+case 18: this.$ = new yy.PartialNode($$[$0-1])
+break;
+case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1])
+break;
+case 20:
+break;
+case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]
+break;
+case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]
+break;
+case 23: this.$ = [[$$[$0-1]], $$[$0]]
+break;
+case 24: this.$ = [[$$[$0]], null]
+break;
+case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
+break;
+case 26: this.$ = [$$[$0]]
+break;
+case 27: this.$ = $$[$0]
+break;
+case 28: this.$ = new yy.StringNode($$[$0])
+break;
+case 29: this.$ = new yy.IntegerNode($$[$0])
+break;
+case 30: this.$ = new yy.BooleanNode($$[$0])
+break;
+case 31: this.$ = new yy.HashNode($$[$0])
+break;
+case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
+break;
+case 33: this.$ = [$$[$0]]
+break;
+case 34: this.$ = [$$[$0-2], $$[$0]]
+break;
+case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]
+break;
+case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]
+break;
+case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]
+break;
+case 38: this.$ = new yy.IdNode($$[$0])
+break;
+case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
+break;
+case 40: this.$ = [$$[$0]]
+break;
+}
+},
+table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],
+defaultActions: {16:[2,1],37:[2,23],53:[2,21]},
+parseError: function parseError(str, hash) {
+ throw new Error(str);
+},
+parse: function parse(input) {
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ if (typeof this.lexer.yylloc == "undefined")
+ this.lexer.yylloc = {};
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+ if (typeof this.yy.parseError === "function")
+ this.parseError = this.yy.parseError;
+ function popStack(n) {
+ stack.length = stack.length - 2 * n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+ function lex() {
+ var token;
+ token = self.lexer.lex() || 1;
+ if (typeof token !== "number") {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol == null)
+ symbol = lex();
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ if (!recovering) {
+ expected = [];
+ for (p in table[state])
+ if (this.terminals_[p] && p > 2) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ var errStr = "";
+ if (this.lexer.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+ }
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0)
+ recovering--;
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+}
+};/* Jison generated lexer */
+var lexer = (function(){
+
+var lexer = ({EOF:1,
+parseError:function parseError(str, hash) {
+ if (this.yy.parseError) {
+ this.yy.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+setInput:function (input) {
+ this._input = input;
+ this._more = this._less = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = '';
+ this.conditionStack = ['INITIAL'];
+ this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
+ return this;
+ },
+input:function () {
+ var ch = this._input[0];
+ this.yytext+=ch;
+ this.yyleng++;
+ this.match+=ch;
+ this.matched+=ch;
+ var lines = ch.match(/\n/);
+ if (lines) this.yylineno++;
+ this._input = this._input.slice(1);
+ return ch;
+ },
+unput:function (ch) {
+ this._input = ch + this._input;
+ return this;
+ },
+more:function () {
+ this._more = true;
+ return this;
+ },
+pastInput:function () {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
+ },
+upcomingInput:function () {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20-next.length);
+ }
+ return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
+ },
+showPosition:function () {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c+"^";
+ },
+next:function () {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) this.done = true;
+
+ var token,
+ match,
+ col,
+ lines;
+ if (!this._more) {
+ this.yytext = '';
+ this.match = '';
+ }
+ var rules = this._currentRules();
+ for (var i=0;i < rules.length; i++) {
+ match = this._input.match(this.rules[rules[i]]);
+ if (match) {
+ lines = match[0].match(/\n.*/g);
+ if (lines) this.yylineno += lines.length;
+ this.yylloc = {first_line: this.yylloc.last_line,
+ last_line: this.yylineno+1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ this._more = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);
+ if (token) return token;
+ else return;
+ }
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
+ {text: "", token: null, line: this.yylineno});
+ }
+ },
+lex:function lex() {
+ var r = this.next();
+ if (typeof r !== 'undefined') {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+begin:function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+popState:function popState() {
+ return this.conditionStack.pop();
+ },
+_currentRules:function _currentRules() {
+ return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
+ },
+topState:function () {
+ return this.conditionStack[this.conditionStack.length-2];
+ },
+pushState:function begin(condition) {
+ this.begin(condition);
+ }});
+lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
+
+var YYSTATE=YY_START
+switch($avoiding_name_collisions) {
+case 0:
+ if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
+ if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
+ if(yy_.yytext) return 14;
+
+break;
+case 1: return 14;
+break;
+case 2: this.popState(); return 14;
+break;
+case 3: return 24;
+break;
+case 4: return 16;
+break;
+case 5: return 20;
+break;
+case 6: return 19;
+break;
+case 7: return 19;
+break;
+case 8: return 23;
+break;
+case 9: return 23;
+break;
+case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
+break;
+case 11: return 22;
+break;
+case 12: return 34;
+break;
+case 13: return 33;
+break;
+case 14: return 33;
+break;
+case 15: return 36;
+break;
+case 16: /*ignore whitespace*/
+break;
+case 17: this.popState(); return 18;
+break;
+case 18: this.popState(); return 18;
+break;
+case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 28;
+break;
+case 20: return 30;
+break;
+case 21: return 30;
+break;
+case 22: return 29;
+break;
+case 23: return 33;
+break;
+case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33;
+break;
+case 25: return 'INVALID';
+break;
+case 26: return 5;
+break;
+}
+};
+lexer.rules = [/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/];
+lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,26],"inclusive":true}};return lexer;})()
+parser.lexer = lexer;
+return parser;
+})();
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
+exports.parser = handlebars;
+exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
+exports.main = function commonjsMain(args) {
+ if (!args[1])
+ throw new Error('Usage: '+args[0]+' FILE');
+ if (typeof process !== 'undefined') {
+ var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
+ } else {
+ var cwd = require("file").path(require("file").cwd());
+ var source = cwd.join(args[1]).read({charset: "utf-8"});
+ }
+ return exports.parser.parse(source);
+}
+if (typeof module !== 'undefined' && require.main === module) {
+ exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
+}
+};
+;
+// lib/handlebars/compiler/base.js
+Handlebars.Parser = handlebars;
+
+Handlebars.parse = function(string) {
+ Handlebars.Parser.yy = Handlebars.AST;
+ return Handlebars.Parser.parse(string);
+};
+
+Handlebars.print = function(ast) {
+ return new Handlebars.PrintVisitor().accept(ast);
+};
+
+Handlebars.logger = {
+ DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
+
+ // override in the host environment
+ log: function(level, str) {}
+};
+
+Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
+;
+// lib/handlebars/compiler/ast.js
+(function() {
+
+ Handlebars.AST = {};
+
+ Handlebars.AST.ProgramNode = function(statements, inverse) {
+ this.type = "program";
+ this.statements = statements;
+ if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
+ };
+
+ Handlebars.AST.MustacheNode = function(params, hash, unescaped) {
+ this.type = "mustache";
+ this.id = params[0];
+ this.params = params.slice(1);
+ this.hash = hash;
+ this.escaped = !unescaped;
+ };
+
+ Handlebars.AST.PartialNode = function(id, context) {
+ this.type = "partial";
+
+ // TODO: disallow complex IDs
+
+ this.id = id;
+ this.context = context;
+ };
+
+ var verifyMatch = function(open, close) {
+ if(open.original !== close.original) {
+ throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
+ }
+ };
+
+ Handlebars.AST.BlockNode = function(mustache, program, close) {
+ verifyMatch(mustache.id, close);
+ this.type = "block";
+ this.mustache = mustache;
+ this.program = program;
+ };
+
+ Handlebars.AST.InverseNode = function(mustache, program, close) {
+ verifyMatch(mustache.id, close);
+ this.type = "inverse";
+ this.mustache = mustache;
+ this.program = program;
+ };
+
+ Handlebars.AST.ContentNode = function(string) {
+ this.type = "content";
+ this.string = string;
+ };
+
+ Handlebars.AST.HashNode = function(pairs) {
+ this.type = "hash";
+ this.pairs = pairs;
+ };
+
+ Handlebars.AST.IdNode = function(parts) {
+ this.type = "ID";
+ this.original = parts.join(".");
+
+ var dig = [], depth = 0;
+
+ for(var i=0,l=parts.length; i<l; i++) {
+ var part = parts[i];
+
+ if(part === "..") { depth++; }
+ else if(part === "." || part === "this") { this.isScoped = true; }
+ else { dig.push(part); }
+ }
+
+ this.parts = dig;
+ this.string = dig.join('.');
+ this.depth = depth;
+ this.isSimple = (dig.length === 1) && (depth === 0);
+ };
+
+ Handlebars.AST.StringNode = function(string) {
+ this.type = "STRING";
+ this.string = string;
+ };
+
+ Handlebars.AST.IntegerNode = function(integer) {
+ this.type = "INTEGER";
+ this.integer = integer;
+ };
+
+ Handlebars.AST.BooleanNode = function(bool) {
+ this.type = "BOOLEAN";
+ this.bool = bool;
+ };
+
+ Handlebars.AST.CommentNode = function(comment) {
+ this.type = "comment";
+ this.comment = comment;
+ };
+
+})();;
+// lib/handlebars/utils.js
+Handlebars.Exception = function(message) {
+ var tmp = Error.prototype.constructor.apply(this, arguments);
+
+ for (var p in tmp) {
+ if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
+ }
+
+ this.message = tmp.message;
+};
+Handlebars.Exception.prototype = new Error;
+
+// Build out our basic SafeString type
+Handlebars.SafeString = function(string) {
+ this.string = string;
+};
+Handlebars.SafeString.prototype.toString = function() {
+ return this.string.toString();
+};
+
+(function() {
+ var escape = {
+ "<": "&lt;",
+ ">": "&gt;",
+ '"': "&quot;",
+ "'": "&#x27;",
+ "`": "&#x60;"
+ };
+
+ var badChars = /&(?!\w+;)|[<>"'`]/g;
+ var possible = /[&<>"'`]/;
+
+ var escapeChar = function(chr) {
+ return escape[chr] || "&amp;";
+ };
+
+ Handlebars.Utils = {
+ escapeExpression: function(string) {
+ // don't escape SafeStrings, since they're already safe
+ if (string instanceof Handlebars.SafeString) {
+ return string.toString();
+ } else if (string == null || string === false) {
+ return "";
+ }
+
+ if(!possible.test(string)) { return string; }
+ return string.replace(badChars, escapeChar);
+ },
+
+ isEmpty: function(value) {
+ if (typeof value === "undefined") {
+ return true;
+ } else if (value === null) {
+ return true;
+ } else if (value === false) {
+ return true;
+ } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ };
+})();;
+// lib/handlebars/compiler/compiler.js
+Handlebars.Compiler = function() {};
+Handlebars.JavaScriptCompiler = function() {};
+
+(function(Compiler, JavaScriptCompiler) {
+ Compiler.OPCODE_MAP = {
+ appendContent: 1,
+ getContext: 2,
+ lookupWithHelpers: 3,
+ lookup: 4,
+ append: 5,
+ invokeMustache: 6,
+ appendEscaped: 7,
+ pushString: 8,
+ truthyOrFallback: 9,
+ functionOrFallback: 10,
+ invokeProgram: 11,
+ invokePartial: 12,
+ push: 13,
+ assignToHash: 15,
+ pushStringParam: 16
+ };
+
+ Compiler.MULTI_PARAM_OPCODES = {
+ appendContent: 1,
+ getContext: 1,
+ lookupWithHelpers: 2,
+ lookup: 1,
+ invokeMustache: 3,
+ pushString: 1,
+ truthyOrFallback: 1,
+ functionOrFallback: 1,
+ invokeProgram: 3,
+ invokePartial: 1,
+ push: 1,
+ assignToHash: 1,
+ pushStringParam: 1
+ };
+
+ Compiler.DISASSEMBLE_MAP = {};
+
+ for(var prop in Compiler.OPCODE_MAP) {
+ var value = Compiler.OPCODE_MAP[prop];
+ Compiler.DISASSEMBLE_MAP[value] = prop;
+ }
+
+ Compiler.multiParamSize = function(code) {
+ return Compiler.MULTI_PARAM_OPCODES[Compiler.DISASSEMBLE_MAP[code]];
+ };
+
+ Compiler.prototype = {
+ compiler: Compiler,
+
+ disassemble: function() {
+ var opcodes = this.opcodes, opcode, nextCode;
+ var out = [], str, name, value;
+
+ for(var i=0, l=opcodes.length; i<l; i++) {
+ opcode = opcodes[i];
+
+ if(opcode === 'DECLARE') {
+ name = opcodes[++i];
+ value = opcodes[++i];
+ out.push("DECLARE " + name + " = " + value);
+ } else {
+ str = Compiler.DISASSEMBLE_MAP[opcode];
+
+ var extraParams = Compiler.multiParamSize(opcode);
+ var codes = [];
+
+ for(var j=0; j<extraParams; j++) {
+ nextCode = opcodes[++i];
+
+ if(typeof nextCode === "string") {
+ nextCode = "\"" + nextCode.replace("\n", "\\n") + "\"";
+ }
+
+ codes.push(nextCode);
+ }
+
+ str = str + " " + codes.join(" ");
+
+ out.push(str);
+ }
+ }
+
+ return out.join("\n");
+ },
+
+ guid: 0,
+
+ compile: function(program, options) {
+ this.children = [];
+ this.depths = {list: []};
+ this.options = options;
+
+ // These changes will propagate to the other compiler components
+ var knownHelpers = this.options.knownHelpers;
+ this.options.knownHelpers = {
+ 'helperMissing': true,
+ 'blockHelperMissing': true,
+ 'each': true,
+ 'if': true,
+ 'unless': true,
+ 'with': true,
+ 'log': true
+ };
+ if (knownHelpers) {
+ for (var name in knownHelpers) {
+ this.options.knownHelpers[name] = knownHelpers[name];
+ }
+ }
+
+ return this.program(program);
+ },
+
+ accept: function(node) {
+ return this[node.type](node);
+ },
+
+ program: function(program) {
+ var statements = program.statements, statement;
+ this.opcodes = [];
+
+ for(var i=0, l=statements.length; i<l; i++) {
+ statement = statements[i];
+ this[statement.type](statement);
+ }
+ this.isSimple = l === 1;
+
+ this.depths.list = this.depths.list.sort(function(a, b) {
+ return a - b;
+ });
+
+ return this;
+ },
+
+ compileProgram: function(program) {
+ var result = new this.compiler().compile(program, this.options);
+ var guid = this.guid++;
+
+ this.usePartial = this.usePartial || result.usePartial;
+
+ this.children[guid] = result;
+
+ for(var i=0, l=result.depths.list.length; i<l; i++) {
+ depth = result.depths.list[i];
+
+ if(depth < 2) { continue; }
+ else { this.addDepth(depth - 1); }
+ }
+
+ return guid;
+ },
+
+ block: function(block) {
+ var mustache = block.mustache;
+ var depth, child, inverse, inverseGuid;
+
+ var params = this.setupStackForMustache(mustache);
+
+ var programGuid = this.compileProgram(block.program);
+
+ if(block.program.inverse) {
+ inverseGuid = this.compileProgram(block.program.inverse);
+ this.declare('inverse', inverseGuid);
+ }
+
+ this.opcode('invokeProgram', programGuid, params.length, !!mustache.hash);
+ this.declare('inverse', null);
+ this.opcode('append');
+ },
+
+ inverse: function(block) {
+ var params = this.setupStackForMustache(block.mustache);
+
+ var programGuid = this.compileProgram(block.program);
+
+ this.declare('inverse', programGuid);
+
+ this.opcode('invokeProgram', null, params.length, !!block.mustache.hash);
+ this.declare('inverse', null);
+ this.opcode('append');
+ },
+
+ hash: function(hash) {
+ var pairs = hash.pairs, pair, val;
+
+ this.opcode('push', '{}');
+
+ for(var i=0, l=pairs.length; i<l; i++) {
+ pair = pairs[i];
+ val = pair[1];
+
+ this.accept(val);
+ this.opcode('assignToHash', pair[0]);
+ }
+ },
+
+ partial: function(partial) {
+ var id = partial.id;
+ this.usePartial = true;
+
+ if(partial.context) {
+ this.ID(partial.context);
+ } else {
+ this.opcode('push', 'depth0');
+ }
+
+ this.opcode('invokePartial', id.original);
+ this.opcode('append');
+ },
+
+ content: function(content) {
+ this.opcode('appendContent', content.string);
+ },
+
+ mustache: function(mustache) {
+ var params = this.setupStackForMustache(mustache);
+
+ this.opcode('invokeMustache', params.length, mustache.id.original, !!mustache.hash);
+
+ if(mustache.escaped && !this.options.noEscape) {
+ this.opcode('appendEscaped');
+ } else {
+ this.opcode('append');
+ }
+ },
+
+ ID: function(id) {
+ this.addDepth(id.depth);
+
+ this.opcode('getContext', id.depth);
+
+ this.opcode('lookupWithHelpers', id.parts[0] || null, id.isScoped || false);
+
+ for(var i=1, l=id.parts.length; i<l; i++) {
+ this.opcode('lookup', id.parts[i]);
+ }
+ },
+
+ STRING: function(string) {
+ this.opcode('pushString', string.string);
+ },
+
+ INTEGER: function(integer) {
+ this.opcode('push', integer.integer);
+ },
+
+ BOOLEAN: function(bool) {
+ this.opcode('push', bool.bool);
+ },
+
+ comment: function() {},
+
+ // HELPERS
+ pushParams: function(params) {
+ var i = params.length, param;
+
+ while(i--) {
+ param = params[i];
+
+ if(this.options.stringParams) {
+ if(param.depth) {
+ this.addDepth(param.depth);
+ }
+
+ this.opcode('getContext', param.depth || 0);
+ this.opcode('pushStringParam', param.string);
+ } else {
+ this[param.type](param);
+ }
+ }
+ },
+
+ opcode: function(name, val1, val2, val3) {
+ this.opcodes.push(Compiler.OPCODE_MAP[name]);
+ if(val1 !== undefined) { this.opcodes.push(val1); }
+ if(val2 !== undefined) { this.opcodes.push(val2); }
+ if(val3 !== undefined) { this.opcodes.push(val3); }
+ },
+
+ declare: function(name, value) {
+ this.opcodes.push('DECLARE');
+ this.opcodes.push(name);
+ this.opcodes.push(value);
+ },
+
+ addDepth: function(depth) {
+ if(depth === 0) { return; }
+
+ if(!this.depths[depth]) {
+ this.depths[depth] = true;
+ this.depths.list.push(depth);
+ }
+ },
+
+ setupStackForMustache: function(mustache) {
+ var params = mustache.params;
+
+ this.pushParams(params);
+
+ if(mustache.hash) {
+ this.hash(mustache.hash);
+ }
+
+ this.ID(mustache.id);
+
+ return params;
+ }
+ };
+
+ JavaScriptCompiler.prototype = {
+ // PUBLIC API: You can override these methods in a subclass to provide
+ // alternative compiled forms for name lookup and buffering semantics
+ nameLookup: function(parent, name, type) {
+ if (/^[0-9]+$/.test(name)) {
+ return parent + "[" + name + "]";
+ } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
+ return parent + "." + name;
+ }
+ else {
+ return parent + "['" + name + "']";
+ }
+ },
+
+ appendToBuffer: function(string) {
+ if (this.environment.isSimple) {
+ return "return " + string + ";";
+ } else {
+ return "buffer += " + string + ";";
+ }
+ },
+
+ initializeBuffer: function() {
+ return this.quotedString("");
+ },
+
+ namespace: "Handlebars",
+ // END PUBLIC API
+
+ compile: function(environment, options, context, asObject) {
+ this.environment = environment;
+ this.options = options || {};
+
+ this.name = this.environment.name;
+ this.isChild = !!context;
+ this.context = context || {
+ programs: [],
+ aliases: { self: 'this' },
+ registers: {list: []}
+ };
+
+ this.preamble();
+
+ this.stackSlot = 0;
+ this.stackVars = [];
+
+ this.compileChildren(environment, options);
+
+ var opcodes = environment.opcodes, opcode;
+
+ this.i = 0;
+
+ for(l=opcodes.length; this.i<l; this.i++) {
+ opcode = this.nextOpcode(0);
+
+ if(opcode[0] === 'DECLARE') {
+ this.i = this.i + 2;
+ this[opcode[1]] = opcode[2];
+ } else {
+ this.i = this.i + opcode[1].length;
+ this[opcode[0]].apply(this, opcode[1]);
+ }
+ }
+
+ return this.createFunctionContext(asObject);
+ },
+
+ nextOpcode: function(n) {
+ var opcodes = this.environment.opcodes, opcode = opcodes[this.i + n], name, val;
+ var extraParams, codes;
+
+ if(opcode === 'DECLARE') {
+ name = opcodes[this.i + 1];
+ val = opcodes[this.i + 2];
+ return ['DECLARE', name, val];
+ } else {
+ name = Compiler.DISASSEMBLE_MAP[opcode];
+
+ extraParams = Compiler.multiParamSize(opcode);
+ codes = [];
+
+ for(var j=0; j<extraParams; j++) {
+ codes.push(opcodes[this.i + j + 1 + n]);
+ }
+
+ return [name, codes];
+ }
+ },
+
+ eat: function(opcode) {
+ this.i = this.i + opcode.length;
+ },
+
+ preamble: function() {
+ var out = [];
+
+ // this register will disambiguate helper lookup from finding a function in
+ // a context. This is necessary for mustache compatibility, which requires
+ // that context functions in blocks are evaluated by blockHelperMissing, and
+ // then proceed as if the resulting value was provided to blockHelperMissing.
+ this.useRegister('foundHelper');
+
+ if (!this.isChild) {
+ var namespace = this.namespace;
+ var copies = "helpers = helpers || " + namespace + ".helpers;";
+ if(this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
+ out.push(copies);
+ } else {
+ out.push('');
+ }
+
+ if (!this.environment.isSimple) {
+ out.push(", buffer = " + this.initializeBuffer());
+ } else {
+ out.push("");
+ }
+
+ // track the last context pushed into place to allow skipping the
+ // getContext opcode when it would be a noop
+ this.lastContext = 0;
+ this.source = out;
+ },
+
+ createFunctionContext: function(asObject) {
+ var locals = this.stackVars;
+ if (!this.isChild) {
+ locals = locals.concat(this.context.registers.list);
+ }
+
+ if(locals.length > 0) {
+ this.source[1] = this.source[1] + ", " + locals.join(", ");
+ }
+
+ // Generate minimizer alias mappings
+ if (!this.isChild) {
+ var aliases = []
+ for (var alias in this.context.aliases) {
+ this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
+ }
+ }
+
+ if (this.source[1]) {
+ this.source[1] = "var " + this.source[1].substring(2) + ";";
+ }
+
+ // Merge children
+ if (!this.isChild) {
+ this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
+ }
+
+ if (!this.environment.isSimple) {
+ this.source.push("return buffer;");
+ }
+
+ var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
+
+ for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
+ params.push("depth" + this.environment.depths.list[i]);
+ }
+
+ if (asObject) {
+ params.push(this.source.join("\n "));
+
+ return Function.apply(this, params);
+ } else {
+ var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + this.source.join("\n ") + '}';
+ Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
+ return functionSource;
+ }
+ },
+
+ appendContent: function(content) {
+ this.source.push(this.appendToBuffer(this.quotedString(content)));
+ },
+
+ append: function() {
+ var local = this.popStack();
+ this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
+ if (this.environment.isSimple) {
+ this.source.push("else { " + this.appendToBuffer("''") + " }");
+ }
+ },
+
+ appendEscaped: function() {
+ var opcode = this.nextOpcode(1), extra = "";
+ this.context.aliases.escapeExpression = 'this.escapeExpression';
+
+ if(opcode[0] === 'appendContent') {
+ extra = " + " + this.quotedString(opcode[1][0]);
+ this.eat(opcode);
+ }
+
+ this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
+ },
+
+ getContext: function(depth) {
+ if(this.lastContext !== depth) {
+ this.lastContext = depth;
+ }
+ },
+
+ lookupWithHelpers: function(name, isScoped) {
+ if(name) {
+ var topStack = this.nextStack();
+
+ this.usingKnownHelper = false;
+
+ var toPush;
+ if (!isScoped && this.options.knownHelpers[name]) {
+ toPush = topStack + " = " + this.nameLookup('helpers', name, 'helper');
+ this.usingKnownHelper = true;
+ } else if (isScoped || this.options.knownHelpersOnly) {
+ toPush = topStack + " = " + this.nameLookup('depth' + this.lastContext, name, 'context');
+ } else {
+ this.register('foundHelper', this.nameLookup('helpers', name, 'helper'));
+ toPush = topStack + " = foundHelper || " + this.nameLookup('depth' + this.lastContext, name, 'context');
+ }
+
+ toPush += ';';
+ this.source.push(toPush);
+ } else {
+ this.pushStack('depth' + this.lastContext);
+ }
+ },
+
+ lookup: function(name) {
+ var topStack = this.topStack();
+ this.source.push(topStack + " = (" + topStack + " === null || " + topStack + " === undefined || " + topStack + " === false ? " +
+ topStack + " : " + this.nameLookup(topStack, name, 'context') + ");");
+ },
+
+ pushStringParam: function(string) {
+ this.pushStack('depth' + this.lastContext);
+ this.pushString(string);
+ },
+
+ pushString: function(string) {
+ this.pushStack(this.quotedString(string));
+ },
+
+ push: function(name) {
+ this.pushStack(name);
+ },
+
+ invokeMustache: function(paramSize, original, hasHash) {
+ this.populateParams(paramSize, this.quotedString(original), "{}", null, hasHash, function(nextStack, helperMissingString, id) {
+ if (!this.usingKnownHelper) {
+ this.context.aliases.helperMissing = 'helpers.helperMissing';
+ this.context.aliases.undef = 'void 0';
+ this.source.push("else if(" + id + "=== undef) { " + nextStack + " = helperMissing.call(" + helperMissingString + "); }");
+ if (nextStack !== id) {
+ this.source.push("else { " + nextStack + " = " + id + "; }");
+ }
+ }
+ });
+ },
+
+ invokeProgram: function(guid, paramSize, hasHash) {
+ var inverse = this.programExpression(this.inverse);
+ var mainProgram = this.programExpression(guid);
+
+ this.populateParams(paramSize, null, mainProgram, inverse, hasHash, function(nextStack, helperMissingString, id) {
+ if (!this.usingKnownHelper) {
+ this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+ this.source.push("else { " + nextStack + " = blockHelperMissing.call(" + helperMissingString + "); }");
+ }
+ });
+ },
+
+ populateParams: function(paramSize, helperId, program, inverse, hasHash, fn) {
+ var needsRegister = hasHash || this.options.stringParams || inverse || this.options.data;
+ var id = this.popStack(), nextStack;
+ var params = [], param, stringParam, stringOptions;
+
+ if (needsRegister) {
+ this.register('tmp1', program);
+ stringOptions = 'tmp1';
+ } else {
+ stringOptions = '{ hash: {} }';
+ }
+
+ if (needsRegister) {
+ var hash = (hasHash ? this.popStack() : '{}');
+ this.source.push('tmp1.hash = ' + hash + ';');
+ }
+
+ if(this.options.stringParams) {
+ this.source.push('tmp1.contexts = [];');
+ }
+
+ for(var i=0; i<paramSize; i++) {
+ param = this.popStack();
+ params.push(param);
+
+ if(this.options.stringParams) {
+ this.source.push('tmp1.contexts.push(' + this.popStack() + ');');
+ }
+ }
+
+ if(inverse) {
+ this.source.push('tmp1.fn = tmp1;');
+ this.source.push('tmp1.inverse = ' + inverse + ';');
+ }
+
+ if(this.options.data) {
+ this.source.push('tmp1.data = data;');
+ }
+
+ params.push(stringOptions);
+
+ this.populateCall(params, id, helperId || id, fn, program !== '{}');
+ },
+
+ populateCall: function(params, id, helperId, fn, program) {
+ var paramString = ["depth0"].concat(params).join(", ");
+ var helperMissingString = ["depth0"].concat(helperId).concat(params).join(", ");
+
+ var nextStack = this.nextStack();
+
+ if (this.usingKnownHelper) {
+ this.source.push(nextStack + " = " + id + ".call(" + paramString + ");");
+ } else {
+ this.context.aliases.functionType = '"function"';
+ var condition = program ? "foundHelper && " : ""
+ this.source.push("if(" + condition + "typeof " + id + " === functionType) { " + nextStack + " = " + id + ".call(" + paramString + "); }");
+ }
+ fn.call(this, nextStack, helperMissingString, id);
+ this.usingKnownHelper = false;
+ },
+
+ invokePartial: function(context) {
+ params = [this.nameLookup('partials', context, 'partial'), "'" + context + "'", this.popStack(), "helpers", "partials"];
+
+ if (this.options.data) {
+ params.push("data");
+ }
+
+ this.pushStack("self.invokePartial(" + params.join(", ") + ");");
+ },
+
+ assignToHash: function(key) {
+ var value = this.popStack();
+ var hash = this.topStack();
+
+ this.source.push(hash + "['" + key + "'] = " + value + ";");
+ },
+
+ // HELPERS
+
+ compiler: JavaScriptCompiler,
+
+ compileChildren: function(environment, options) {
+ var children = environment.children, child, compiler;
+
+ for(var i=0, l=children.length; i<l; i++) {
+ child = children[i];
+ compiler = new this.compiler();
+
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
+ var index = this.context.programs.length;
+ child.index = index;
+ child.name = 'program' + index;
+ this.context.programs[index] = compiler.compile(child, options, this.context);
+ }
+ },
+
+ programExpression: function(guid) {
+ if(guid == null) { return "self.noop"; }
+
+ var child = this.environment.children[guid],
+ depths = child.depths.list;
+ var programParams = [child.index, child.name, "data"];
+
+ for(var i=0, l = depths.length; i<l; i++) {
+ depth = depths[i];
+
+ if(depth === 1) { programParams.push("depth0"); }
+ else { programParams.push("depth" + (depth - 1)); }
+ }
+
+ if(depths.length === 0) {
+ return "self.program(" + programParams.join(", ") + ")";
+ } else {
+ programParams.shift();
+ return "self.programWithDepth(" + programParams.join(", ") + ")";
+ }
+ },
+
+ register: function(name, val) {
+ this.useRegister(name);
+ this.source.push(name + " = " + val + ";");
+ },
+
+ useRegister: function(name) {
+ if(!this.context.registers[name]) {
+ this.context.registers[name] = true;
+ this.context.registers.list.push(name);
+ }
+ },
+
+ pushStack: function(item) {
+ this.source.push(this.nextStack() + " = " + item + ";");
+ return "stack" + this.stackSlot;
+ },
+
+ nextStack: function() {
+ this.stackSlot++;
+ if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
+ return "stack" + this.stackSlot;
+ },
+
+ popStack: function() {
+ return "stack" + this.stackSlot--;
+ },
+
+ topStack: function() {
+ return "stack" + this.stackSlot;
+ },
+
+ quotedString: function(str) {
+ return '"' + str
+ .replace(/\\/g, '\\\\')
+ .replace(/"/g, '\\"')
+ .replace(/\n/g, '\\n')
+ .replace(/\r/g, '\\r') + '"';
+ }
+ };
+
+ var reservedWords = (
+ "break else new var" +
+ " case finally return void" +
+ " catch for switch while" +
+ " continue function this with" +
+ " default if throw" +
+ " delete in try" +
+ " do instanceof typeof" +
+ " abstract enum int short" +
+ " boolean export interface static" +
+ " byte extends long super" +
+ " char final native synchronized" +
+ " class float package throws" +
+ " const goto private transient" +
+ " debugger implements protected volatile" +
+ " double import public let yield"
+ ).split(" ");
+
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
+
+ for(var i=0, l=reservedWords.length; i<l; i++) {
+ compilerWords[reservedWords[i]] = true;
+ }
+
+ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
+ if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
+ return true;
+ }
+ return false;
+ }
+
+})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
+
+Handlebars.precompile = function(string, options) {
+ options = options || {};
+
+ var ast = Handlebars.parse(string);
+ var environment = new Handlebars.Compiler().compile(ast, options);
+ return new Handlebars.JavaScriptCompiler().compile(environment, options);
+};
+
+Handlebars.compile = function(string, options) {
+ options = options || {};
+
+ var compiled;
+ function compile() {
+ var ast = Handlebars.parse(string);
+ var environment = new Handlebars.Compiler().compile(ast, options);
+ var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
+ return Handlebars.template(templateSpec);
+ }
+
+ // Template is only compiled on first use and cached after that point.
+ return function(context, options) {
+ if (!compiled) {
+ compiled = compile();
+ }
+ return compiled.call(this, context, options);
+ };
+};
+;
+// lib/handlebars/runtime.js
+Handlebars.VM = {
+ template: function(templateSpec) {
+ // Just add water
+ var container = {
+ escapeExpression: Handlebars.Utils.escapeExpression,
+ invokePartial: Handlebars.VM.invokePartial,
+ programs: [],
+ program: function(i, fn, data) {
+ var programWrapper = this.programs[i];
+ if(data) {
+ return Handlebars.VM.program(fn, data);
+ } else if(programWrapper) {
+ return programWrapper;
+ } else {
+ programWrapper = this.programs[i] = Handlebars.VM.program(fn);
+ return programWrapper;
+ }
+ },
+ programWithDepth: Handlebars.VM.programWithDepth,
+ noop: Handlebars.VM.noop
+ };
+
+ return function(context, options) {
+ options = options || {};
+ return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
+ };
+ },
+
+ programWithDepth: function(fn, data, $depth) {
+ var args = Array.prototype.slice.call(arguments, 2);
+
+ return function(context, options) {
+ options = options || {};
+
+ return fn.apply(this, [context, options.data || data].concat(args));
+ };
+ },
+ program: function(fn, data) {
+ return function(context, options) {
+ options = options || {};
+
+ return fn(context, options.data || data);
+ };
+ },
+ noop: function() { return ""; },
+ invokePartial: function(partial, name, context, helpers, partials, data) {
+ options = { helpers: helpers, partials: partials, data: data };
+
+ if(partial === undefined) {
+ throw new Handlebars.Exception("The partial " + name + " could not be found");
+ } else if(partial instanceof Function) {
+ return partial(context, options);
+ } else if (!Handlebars.compile) {
+ throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
+ } else {
+ partials[name] = Handlebars.compile(partial);
+ return partials[name](context, options);
+ }
+ }
+};
+
+Handlebars.template = Handlebars.VM.template;
+;
diff --git a/src/components/HMI/lib/iscroll-lite.js b/src/components/HMI/lib/iscroll-lite.js
new file mode 100644
index 0000000000..3a6cab7d2c
--- /dev/null
+++ b/src/components/HMI/lib/iscroll-lite.js
@@ -0,0 +1,594 @@
+/*!
+ * iScroll Lite base on iScroll v4.1.6 ~ Copyright (c) 2011 Matteo Spinelli, http://cubiq.org
+ * Released under MIT license, http://cubiq.org/license
+ */
+
+(function(){
+var m = Math,
+ mround = function (r) { return r >> 0; },
+ vendor = (/webkit/i).test(navigator.appVersion) ? 'webkit' :
+ (/firefox/i).test(navigator.userAgent) ? 'Moz' :
+ 'opera' in window ? 'O' : '',
+
+ // Browser capabilities
+ isAndroid = (/android/gi).test(navigator.appVersion),
+ isIDevice = (/iphone|ipad/gi).test(navigator.appVersion),
+ isPlaybook = (/playbook/gi).test(navigator.appVersion),
+ isTouchPad = (/hp-tablet/gi).test(navigator.appVersion),
+
+ has3d = 'WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix(),
+ hasTouch = 'ontouchstart' in window && !isTouchPad,
+ hasTransform = vendor + 'Transform' in document.documentElement.style,
+ hasTransitionEnd = isIDevice || isPlaybook,
+
+ nextFrame = (function() {
+ return window.requestAnimationFrame
+ || window.webkitRequestAnimationFrame
+ || window.mozRequestAnimationFrame
+ || window.oRequestAnimationFrame
+ || window.msRequestAnimationFrame
+ || function(callback) { return setTimeout(callback, 17); }
+ })(),
+ cancelFrame = (function () {
+ return window.cancelRequestAnimationFrame
+ || window.webkitCancelAnimationFrame
+ || window.webkitCancelRequestAnimationFrame
+ || window.mozCancelRequestAnimationFrame
+ || window.oCancelRequestAnimationFrame
+ || window.msCancelRequestAnimationFrame
+ || clearTimeout
+ })(),
+
+ // Events
+ RESIZE_EV = 'onorientationchange' in window ? 'orientationchange' : 'resize',
+ START_EV = hasTouch ? 'touchstart' : 'mousedown',
+ MOVE_EV = hasTouch ? 'touchmove' : 'mousemove',
+ END_EV = hasTouch ? 'touchend' : 'mouseup',
+ CANCEL_EV = hasTouch ? 'touchcancel' : 'mouseup',
+
+ // Helpers
+ trnOpen = 'translate' + (has3d ? '3d(' : '('),
+ trnClose = has3d ? ',0)' : ')',
+
+ // Constructor
+ iScroll = function (el, options) {
+ var that = this,
+ doc = document,
+ i;
+
+ that.wrapper = typeof el == 'object' ? el : doc.getElementById(el);
+ that.wrapper.style.overflow = 'hidden';
+ that.scroller = that.wrapper.children[0];
+
+ // Default options
+ that.options = {
+ hScroll: true,
+ vScroll: true,
+ x: 0,
+ y: 0,
+ bounce: true,
+ bounceLock: false,
+ momentum: true,
+ lockDirection: true,
+ useTransform: true,
+ useTransition: false,
+
+ // Events
+ onRefresh: null,
+ onBeforeScrollStart: function (e) { e.preventDefault(); },
+ onScrollStart: null,
+ onBeforeScrollMove: null,
+ onScrollMove: null,
+ onBeforeScrollEnd: null,
+ onScrollEnd: null,
+ onTouchEnd: null,
+ onDestroy: null
+ };
+
+ // User defined options
+ for (i in options) that.options[i] = options[i];
+
+ // Set starting position
+ that.x = that.options.x;
+ that.y = that.options.y;
+
+ // Normalize options
+ that.options.useTransform = hasTransform ? that.options.useTransform : false;
+ that.options.hScrollbar = that.options.hScroll && that.options.hScrollbar;
+ that.options.vScrollbar = that.options.vScroll && that.options.vScrollbar;
+ that.options.useTransition = hasTransitionEnd && that.options.useTransition;
+
+ // Set some default styles
+ that.scroller.style[vendor + 'TransitionProperty'] = that.options.useTransform ? '-' + vendor.toLowerCase() + '-transform' : 'top left';
+ that.scroller.style[vendor + 'TransitionDuration'] = '0';
+ that.scroller.style[vendor + 'TransformOrigin'] = '0 0';
+ if (that.options.useTransition) that.scroller.style[vendor + 'TransitionTimingFunction'] = 'cubic-bezier(0.33,0.66,0.66,1)';
+
+ if (that.options.useTransform) that.scroller.style[vendor + 'Transform'] = trnOpen + that.x + 'px,' + that.y + 'px' + trnClose;
+ else that.scroller.style.cssText += ';position:absolute;top:' + that.y + 'px;left:' + that.x + 'px';
+
+ that.refresh();
+
+ that._bind(RESIZE_EV, window);
+ that._bind(START_EV);
+ if (!hasTouch) that._bind('mouseout', that.wrapper);
+ };
+
+// Prototype
+iScroll.prototype = {
+ enabled: true,
+ x: 0,
+ y: 0,
+ steps: [],
+ scale: 1,
+
+ handleEvent: function (e) {
+ var that = this;
+ switch(e.type) {
+ case START_EV:
+ if (!hasTouch && e.button !== 0) return;
+ that._start(e);
+ break;
+ case MOVE_EV: that._move(e); break;
+ case END_EV:
+ case CANCEL_EV: that._end(e); break;
+ case RESIZE_EV: that._resize(); break;
+ case 'mouseout': that._mouseout(e); break;
+ case 'webkitTransitionEnd': that._transitionEnd(e); break;
+ }
+ },
+
+ _resize: function () {
+ this.refresh();
+ },
+
+ _pos: function (x, y) {
+ x = this.hScroll ? x : 0;
+ y = this.vScroll ? y : 0;
+
+ if (this.options.useTransform) {
+ this.scroller.style[vendor + 'Transform'] = trnOpen + x + 'px,' + y + 'px' + trnClose + ' scale(' + this.scale + ')';
+ } else {
+ x = mround(x);
+ y = mround(y);
+ this.scroller.style.left = x + 'px';
+ this.scroller.style.top = y + 'px';
+ }
+
+ this.x = x;
+ this.y = y;
+ },
+
+ _start: function (e) {
+ var that = this,
+ point = hasTouch ? e.touches[0] : e,
+ matrix, x, y;
+
+ if (!that.enabled) return;
+
+ if (that.options.onBeforeScrollStart) that.options.onBeforeScrollStart.call(that, e);
+
+ if (that.options.useTransition) that._transitionTime(0);
+
+ that.moved = false;
+ that.animating = false;
+ that.zoomed = false;
+ that.distX = 0;
+ that.distY = 0;
+ that.absDistX = 0;
+ that.absDistY = 0;
+ that.dirX = 0;
+ that.dirY = 0;
+
+ if (that.options.momentum) {
+ if (that.options.useTransform) {
+ // Very lame general purpose alternative to CSSMatrix
+ matrix = getComputedStyle(that.scroller, null)[vendor + 'Transform'].replace(/[^0-9-.,]/g, '').split(',');
+ x = matrix[4] * 1;
+ y = matrix[5] * 1;
+ } else {
+ x = getComputedStyle(that.scroller, null).left.replace(/[^0-9-]/g, '') * 1;
+ y = getComputedStyle(that.scroller, null).top.replace(/[^0-9-]/g, '') * 1;
+ }
+
+ if (x != that.x || y != that.y) {
+ if (that.options.useTransition) that._unbind('webkitTransitionEnd');
+ else cancelFrame(that.aniTime);
+ that.steps = [];
+ that._pos(x, y);
+ }
+ }
+
+ that.startX = that.x;
+ that.startY = that.y;
+ that.pointX = point.pageX;
+ that.pointY = point.pageY;
+
+ that.startTime = e.timeStamp || Date.now();
+
+ if (that.options.onScrollStart) that.options.onScrollStart.call(that, e);
+
+ that._bind(MOVE_EV);
+ that._bind(END_EV);
+ that._bind(CANCEL_EV);
+ },
+
+ _move: function (e) {
+ var that = this,
+ point = hasTouch ? e.touches[0] : e,
+ deltaX = point.pageX - that.pointX,
+ deltaY = point.pageY - that.pointY,
+ newX = that.x + deltaX,
+ newY = that.y + deltaY,
+ timestamp = e.timeStamp || Date.now();
+
+ if (that.options.onBeforeScrollMove) that.options.onBeforeScrollMove.call(that, e);
+
+ that.pointX = point.pageX;
+ that.pointY = point.pageY;
+
+ // Slow down if outside of the boundaries
+ if (newX > 0 || newX < that.maxScrollX) {
+ newX = that.options.bounce ? that.x + (deltaX / 2) : newX >= 0 || that.maxScrollX >= 0 ? 0 : that.maxScrollX;
+ }
+ if (newY > 0 || newY < that.maxScrollY) {
+ newY = that.options.bounce ? that.y + (deltaY / 2) : newY >= 0 || that.maxScrollY >= 0 ? 0 : that.maxScrollY;
+ }
+
+ that.distX += deltaX;
+ that.distY += deltaY;
+ that.absDistX = m.abs(that.distX);
+ that.absDistY = m.abs(that.distY);
+
+ if (that.absDistX < 6 && that.absDistY < 6) {
+ return;
+ }
+
+ // Lock direction
+ if (that.options.lockDirection) {
+ if (that.absDistX > that.absDistY + 5) {
+ newY = that.y;
+ deltaY = 0;
+ } else if (that.absDistY > that.absDistX + 5) {
+ newX = that.x;
+ deltaX = 0;
+ }
+ }
+
+ that.moved = true;
+ that._pos(newX, newY);
+ that.dirX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;
+ that.dirY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;
+
+ if (timestamp - that.startTime > 300) {
+ that.startTime = timestamp;
+ that.startX = that.x;
+ that.startY = that.y;
+ }
+
+ if (that.options.onScrollMove) that.options.onScrollMove.call(that, e);
+ },
+
+ _end: function (e) {
+ if (hasTouch && e.touches.length != 0) return;
+
+ var that = this,
+ point = hasTouch ? e.changedTouches[0] : e,
+ target, ev,
+ momentumX = { dist:0, time:0 },
+ momentumY = { dist:0, time:0 },
+ duration = (e.timeStamp || Date.now()) - that.startTime,
+ newPosX = that.x,
+ newPosY = that.y,
+ newDuration;
+
+ that._unbind(MOVE_EV);
+ that._unbind(END_EV);
+ that._unbind(CANCEL_EV);
+
+ if (that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e);
+
+ if (!that.moved) {
+ if (hasTouch) {
+ // Find the last touched element
+ target = point.target;
+ while (target.nodeType != 1) target = target.parentNode;
+
+ if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA') {
+ ev = document.createEvent('MouseEvents');
+ ev.initMouseEvent('click', true, true, e.view, 1,
+ point.screenX, point.screenY, point.clientX, point.clientY,
+ e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
+ 0, null);
+ ev._fake = true;
+ target.dispatchEvent(ev);
+ }
+ }
+
+ that._resetPos(200);
+
+ if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
+ return;
+ }
+
+ if (duration < 300 && that.options.momentum) {
+ momentumX = newPosX ? that._momentum(newPosX - that.startX, duration, -that.x, that.scrollerW - that.wrapperW + that.x, that.options.bounce ? that.wrapperW : 0) : momentumX;
+ momentumY = newPosY ? that._momentum(newPosY - that.startY, duration, -that.y, (that.maxScrollY < 0 ? that.scrollerH - that.wrapperH + that.y : 0), that.options.bounce ? that.wrapperH : 0) : momentumY;
+
+ newPosX = that.x + momentumX.dist;
+ newPosY = that.y + momentumY.dist;
+
+ if ((that.x > 0 && newPosX > 0) || (that.x < that.maxScrollX && newPosX < that.maxScrollX)) momentumX = { dist:0, time:0 };
+ if ((that.y > 0 && newPosY > 0) || (that.y < that.maxScrollY && newPosY < that.maxScrollY)) momentumY = { dist:0, time:0 };
+ }
+
+ if (momentumX.dist || momentumY.dist) {
+ newDuration = m.max(m.max(momentumX.time, momentumY.time), 10);
+
+ that.scrollTo(mround(newPosX), mround(newPosY), newDuration);
+
+ if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
+ return;
+ }
+
+ that._resetPos(200);
+ if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
+ },
+
+ _resetPos: function (time) {
+ var that = this,
+ resetX = that.x >= 0 ? 0 : that.x < that.maxScrollX ? that.maxScrollX : that.x,
+ resetY = that.y >= 0 || that.maxScrollY > 0 ? 0 : that.y < that.maxScrollY ? that.maxScrollY : that.y;
+
+ if (resetX == that.x && resetY == that.y) {
+ if (that.moved) {
+ if (that.options.onScrollEnd) that.options.onScrollEnd.call(that); // Execute custom code on scroll end
+ that.moved = false;
+ }
+
+ return;
+ }
+
+ that.scrollTo(resetX, resetY, time || 0);
+ },
+
+ _mouseout: function (e) {
+ var t = e.relatedTarget;
+
+ if (!t) {
+ this._end(e);
+ return;
+ }
+
+ while (t = t.parentNode) if (t == this.wrapper) return;
+
+ this._end(e);
+ },
+
+ _transitionEnd: function (e) {
+ var that = this;
+
+ if (e.target != that.scroller) return;
+
+ that._unbind('webkitTransitionEnd');
+
+ that._startAni();
+ },
+
+ /**
+ *
+ * Utilities
+ *
+ */
+ _startAni: function () {
+ var that = this,
+ startX = that.x, startY = that.y,
+ startTime = Date.now(),
+ step, easeOut,
+ animate;
+
+ if (that.animating) return;
+
+ if (!that.steps.length) {
+ that._resetPos(400);
+ return;
+ }
+
+ step = that.steps.shift();
+
+ if (step.x == startX && step.y == startY) step.time = 0;
+
+ that.animating = true;
+ that.moved = true;
+
+ if (that.options.useTransition) {
+ that._transitionTime(step.time);
+ that._pos(step.x, step.y);
+ that.animating = false;
+ if (step.time) that._bind('webkitTransitionEnd');
+ else that._resetPos(0);
+ return;
+ }
+
+ animate = function () {
+ var now = Date.now(),
+ newX, newY;
+
+ if (now >= startTime + step.time) {
+ that._pos(step.x, step.y);
+ that.animating = false;
+ if (that.options.onAnimationEnd) that.options.onAnimationEnd.call(that); // Execute custom code on animation end
+ that._startAni();
+ return;
+ }
+
+ now = (now - startTime) / step.time - 1;
+ easeOut = m.sqrt(1 - now * now);
+ newX = (step.x - startX) * easeOut + startX;
+ newY = (step.y - startY) * easeOut + startY;
+ that._pos(newX, newY);
+ if (that.animating) that.aniTime = nextFrame(animate);
+ };
+
+ animate();
+ },
+
+ _transitionTime: function (time) {
+ this.scroller.style[vendor + 'TransitionDuration'] = time + 'ms';
+ },
+
+ _momentum: function (dist, time, maxDistUpper, maxDistLower, size) {
+ var deceleration = 0.0006,
+ speed = m.abs(dist) / time,
+ newDist = (speed * speed) / (2 * deceleration),
+ newTime = 0, outsideDist = 0;
+
+ // Proportinally reduce speed if we are outside of the boundaries
+ if (dist > 0 && newDist > maxDistUpper) {
+ outsideDist = size / (6 / (newDist / speed * deceleration));
+ maxDistUpper = maxDistUpper + outsideDist;
+ speed = speed * maxDistUpper / newDist;
+ newDist = maxDistUpper;
+ } else if (dist < 0 && newDist > maxDistLower) {
+ outsideDist = size / (6 / (newDist / speed * deceleration));
+ maxDistLower = maxDistLower + outsideDist;
+ speed = speed * maxDistLower / newDist;
+ newDist = maxDistLower;
+ }
+
+ newDist = newDist * (dist < 0 ? -1 : 1);
+ newTime = speed / deceleration;
+
+ return { dist: newDist, time: mround(newTime) };
+ },
+
+ _offset: function (el) {
+ var left = -el.offsetLeft,
+ top = -el.offsetTop;
+
+ while (el = el.offsetParent) {
+ left -= el.offsetLeft;
+ top -= el.offsetTop;
+ }
+
+ return { left: left, top: top };
+ },
+
+ _bind: function (type, el, bubble) {
+ (el || this.scroller).addEventListener(type, this, !!bubble);
+ },
+
+ _unbind: function (type, el, bubble) {
+ (el || this.scroller).removeEventListener(type, this, !!bubble);
+ },
+
+
+ /**
+ *
+ * Public methods
+ *
+ */
+ destroy: function () {
+ var that = this;
+
+ that.scroller.style[vendor + 'Transform'] = '';
+
+ // Remove the event listeners
+ that._unbind(RESIZE_EV, window);
+ that._unbind(START_EV);
+ that._unbind(MOVE_EV);
+ that._unbind(END_EV);
+ that._unbind(CANCEL_EV);
+ that._unbind('mouseout', that.wrapper);
+ if (that.options.useTransition) that._unbind('webkitTransitionEnd');
+
+ if (that.options.onDestroy) that.options.onDestroy.call(that);
+ },
+
+ refresh: function () {
+ var that = this,
+ offset;
+
+ that.wrapperW = that.wrapper.clientWidth;
+ that.wrapperH = that.wrapper.clientHeight;
+
+ that.scrollerW = that.scroller.offsetWidth;
+ that.scrollerH = that.scroller.offsetHeight;
+ that.maxScrollX = that.wrapperW - that.scrollerW;
+ that.maxScrollY = that.wrapperH - that.scrollerH;
+ that.dirX = 0;
+ that.dirY = 0;
+
+ that.hScroll = that.options.hScroll && that.maxScrollX < 0;
+ that.vScroll = that.options.vScroll && (!that.options.bounceLock && !that.hScroll || that.scrollerH > that.wrapperH);
+
+ offset = that._offset(that.wrapper);
+ that.wrapperOffsetLeft = -offset.left;
+ that.wrapperOffsetTop = -offset.top;
+
+
+ that.scroller.style[vendor + 'TransitionDuration'] = '0';
+
+ that._resetPos(200);
+ },
+
+ scrollTo: function (x, y, time, relative) {
+ var that = this,
+ step = x,
+ i, l;
+
+ that.stop();
+
+ if (!step.length) step = [{ x: x, y: y, time: time, relative: relative }];
+
+ for (i=0, l=step.length; i<l; i++) {
+ if (step[i].relative) { step[i].x = that.x - step[i].x; step[i].y = that.y - step[i].y; }
+ that.steps.push({ x: step[i].x, y: step[i].y, time: step[i].time || 0 });
+ }
+
+ that._startAni();
+ },
+
+ scrollToElement: function (el, time) {
+ var that = this, pos;
+ el = el.nodeType ? el : that.scroller.querySelector(el);
+ if (!el) return;
+
+ pos = that._offset(el);
+ pos.left += that.wrapperOffsetLeft;
+ pos.top += that.wrapperOffsetTop;
+
+ pos.left = pos.left > 0 ? 0 : pos.left < that.maxScrollX ? that.maxScrollX : pos.left;
+ pos.top = pos.top > 0 ? 0 : pos.top < that.maxScrollY ? that.maxScrollY : pos.top;
+ time = time === undefined ? m.max(m.abs(pos.left)*2, m.abs(pos.top)*2) : time;
+
+ that.scrollTo(pos.left, pos.top, time);
+ },
+
+ disable: function () {
+ this.stop();
+ this._resetPos(0);
+ this.enabled = false;
+
+ // If disabled after touchstart we make sure that there are no left over events
+ this._unbind(MOVE_EV);
+ this._unbind(END_EV);
+ this._unbind(CANCEL_EV);
+ },
+
+ enable: function () {
+ this.enabled = true;
+ },
+
+ stop: function () {
+ cancelFrame(this.aniTime);
+ this.steps = [];
+ this.moved = false;
+ this.animating = false;
+ }
+};
+
+if (typeof exports !== 'undefined') exports.iScroll = iScroll;
+else window.iScroll = iScroll;
+
+})();
diff --git a/src/components/HMI/lib/jquery-1.7.2.js b/src/components/HMI/lib/jquery-1.7.2.js
new file mode 100644
index 0000000000..0073dfc8c3
--- /dev/null
+++ b/src/components/HMI/lib/jquery-1.7.2.js
@@ -0,0 +1,9404 @@
+/*!
+ * jQuery JavaScript Library v1.7.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Wed Mar 21 12:46:34 2012 -0700
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+ navigator = window.navigator,
+ location = window.location;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ trimLeft = /^\s+/,
+ trimRight = /\s+$/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+ // Useragent RegExp
+ rwebkit = /(webkit)[ \/]([\w.]+)/,
+ ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+ rmsie = /(msie) ([\w.]+)/,
+ rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z]|[0-9])/ig,
+ rmsPrefix = /^-ms-/,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return ( letter + "" ).toUpperCase();
+ },
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwn = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ trim = String.prototype.trim,
+ indexOf = Array.prototype.indexOf,
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context && document.body ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = quickExpr.exec( selector );
+ }
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = ( context ? context.ownerDocument || context : document );
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+ selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.7.2",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = this.constructor();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // Add the callback
+ readyList.add( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ i = +i;
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+ // Either a released hold or an DOMready/load event and not yet ready
+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.fireWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger( "ready" ).off( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyList ) {
+ return;
+ }
+
+ readyList = jQuery.Callbacks( "once memory" );
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+ var xml, tmp;
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction( object );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return object;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: trim ?
+ function( text ) {
+ return text == null ?
+ "" :
+ trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ var type = jQuery.type( array );
+
+ if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array, i ) {
+ var len;
+
+ if ( array ) {
+ if ( indexOf ) {
+ return indexOf.call( array, elem, i );
+ }
+
+ len = array.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in array && array[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length,
+ j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [], retVal;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key, ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ if ( typeof context === "string" ) {
+ var tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ var args = slice.call( arguments, 2 ),
+ proxy = function() {
+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Mutifunctional method to get and set values to a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
+ var exec,
+ bulk = key == null,
+ i = 0,
+ length = elems.length;
+
+ // Sets many values
+ if ( key && typeof key === "object" ) {
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
+ }
+ chainable = 1;
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = pass === undefined && jQuery.isFunction( value );
+
+ if ( bulk ) {
+ // Bulk operations only iterate when executing function values
+ if ( exec ) {
+ exec = fn;
+ fn = function( elem, key, value ) {
+ return exec.call( jQuery( elem ), value );
+ };
+
+ // Otherwise they run against the entire set
+ } else {
+ fn.call( elems, value );
+ fn = null;
+ }
+ }
+
+ if ( fn ) {
+ for (; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+ }
+
+ chainable = 1;
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = rwebkit.exec( ua ) ||
+ ropera.exec( ua ) ||
+ rmsie.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ sub: function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+ },
+
+ browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+ trimLeft = /^[\s\xA0]+/;
+ trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch(e) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+return jQuery;
+
+})();
+
+
+// String to Object flags format cache
+var flagsCache = {};
+
+// Convert String-formatted flags into Object-formatted ones and store in cache
+function createFlags( flags ) {
+ var object = flagsCache[ flags ] = {},
+ i, length;
+ flags = flags.split( /\s+/ );
+ for ( i = 0, length = flags.length; i < length; i++ ) {
+ object[ flags[i] ] = true;
+ }
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * flags: an optional list of space-separated flags that will change how
+ * the callback list behaves
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible flags:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( flags ) {
+
+ // Convert flags from String-formatted to Object-formatted
+ // (we check in cache first)
+ flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
+
+ var // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = [],
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // Flag to know if list is currently firing
+ firing,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // Add one or several callbacks to the list
+ add = function( args ) {
+ var i,
+ length,
+ elem,
+ type,
+ actual;
+ for ( i = 0, length = args.length; i < length; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
+ if ( type === "array" ) {
+ // Inspect recursively
+ add( elem );
+ } else if ( type === "function" ) {
+ // Add if not in unique mode and callback is not in
+ if ( !flags.unique || !self.has( elem ) ) {
+ list.push( elem );
+ }
+ }
+ }
+ },
+ // Fire callbacks
+ fire = function( context, args ) {
+ args = args || [];
+ memory = !flags.memory || [ context, args ];
+ fired = true;
+ firing = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
+ memory = true; // Mark as halted
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( !flags.once ) {
+ if ( stack && stack.length ) {
+ memory = stack.shift();
+ self.fireWith( memory[ 0 ], memory[ 1 ] );
+ }
+ } else if ( memory === true ) {
+ self.disable();
+ } else {
+ list = [];
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ var length = list.length;
+ add( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away, unless previous
+ // firing was halted (stopOnFalse)
+ } else if ( memory && memory !== true ) {
+ firingStart = length;
+ fire( memory[ 0 ], memory[ 1 ] );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ var args = arguments,
+ argIndex = 0,
+ argLength = args.length;
+ for ( ; argIndex < argLength ; argIndex++ ) {
+ for ( var i = 0; i < list.length; i++ ) {
+ if ( args[ argIndex ] === list[ i ] ) {
+ // Handle firingIndex and firingLength
+ if ( firing ) {
+ if ( i <= firingLength ) {
+ firingLength--;
+ if ( i <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ // Remove the element
+ list.splice( i--, 1 );
+ // If we have some unicity property then
+ // we only need to do this once
+ if ( flags.unique ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+ return this;
+ },
+ // Control if a given callback is in the list
+ has: function( fn ) {
+ if ( list ) {
+ var i = 0,
+ length = list.length;
+ for ( ; i < length; i++ ) {
+ if ( fn === list[ i ] ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory || memory === true ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( stack ) {
+ if ( firing ) {
+ if ( !flags.once ) {
+ stack.push( [ context, args ] );
+ }
+ } else if ( !( flags.once && memory ) ) {
+ fire( context, args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+
+
+var // Static reference to slice
+ sliceDeferred = [].slice;
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var doneList = jQuery.Callbacks( "once memory" ),
+ failList = jQuery.Callbacks( "once memory" ),
+ progressList = jQuery.Callbacks( "memory" ),
+ state = "pending",
+ lists = {
+ resolve: doneList,
+ reject: failList,
+ notify: progressList
+ },
+ promise = {
+ done: doneList.add,
+ fail: failList.add,
+ progress: progressList.add,
+
+ state: function() {
+ return state;
+ },
+
+ // Deprecated
+ isResolved: doneList.fired,
+ isRejected: failList.fired,
+
+ then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
+ deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
+ return this;
+ },
+ always: function() {
+ deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
+ return this;
+ },
+ pipe: function( fnDone, fnFail, fnProgress ) {
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( {
+ done: [ fnDone, "resolve" ],
+ fail: [ fnFail, "reject" ],
+ progress: [ fnProgress, "notify" ]
+ }, function( handler, data ) {
+ var fn = data[ 0 ],
+ action = data[ 1 ],
+ returned;
+ if ( jQuery.isFunction( fn ) ) {
+ deferred[ handler ](function() {
+ returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+ }
+ });
+ } else {
+ deferred[ handler ]( newDefer[ action ] );
+ }
+ });
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ if ( obj == null ) {
+ obj = promise;
+ } else {
+ for ( var key in promise ) {
+ obj[ key ] = promise[ key ];
+ }
+ }
+ return obj;
+ }
+ },
+ deferred = promise.promise({}),
+ key;
+
+ for ( key in lists ) {
+ deferred[ key ] = lists[ key ].fire;
+ deferred[ key + "With" ] = lists[ key ].fireWith;
+ }
+
+ // Handle state
+ deferred.done( function() {
+ state = "resolved";
+ }, failList.disable, progressList.lock ).fail( function() {
+ state = "rejected";
+ }, doneList.disable, progressList.lock );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( firstParam ) {
+ var args = sliceDeferred.call( arguments, 0 ),
+ i = 0,
+ length = args.length,
+ pValues = new Array( length ),
+ count = length,
+ pCount = length,
+ deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+ firstParam :
+ jQuery.Deferred(),
+ promise = deferred.promise();
+ function resolveFunc( i ) {
+ return function( value ) {
+ args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ if ( !( --count ) ) {
+ deferred.resolveWith( deferred, args );
+ }
+ };
+ }
+ function progressFunc( i ) {
+ return function( value ) {
+ pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+ deferred.notifyWith( promise, pValues );
+ };
+ }
+ if ( length > 1 ) {
+ for ( ; i < length; i++ ) {
+ if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
+ args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
+ } else {
+ --count;
+ }
+ }
+ if ( !count ) {
+ deferred.resolveWith( deferred, args );
+ }
+ } else if ( deferred !== firstParam ) {
+ deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+ }
+ return promise;
+ }
+});
+
+
+
+
+jQuery.support = (function() {
+
+ var support,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ fragment,
+ tds,
+ events,
+ eventName,
+ i,
+ isSupported,
+ div = document.createElement( "div" ),
+ documentElement = document.documentElement;
+
+ // Preliminary tests
+ div.setAttribute("className", "t");
+ div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ all = div.getElementsByTagName( "*" );
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement( "select" );
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName( "input" )[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute("href") === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Tests for enctype support on a form(#6743)
+ enctype: !!document.createElement("form").enctype,
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true,
+ pixelMargin: true
+ };
+
+ // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
+ jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent( "onclick" );
+ }
+
+ // Check if a radio maintains its value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute("type", "radio");
+ support.radioValue = input.value === "t";
+
+ input.setAttribute("checked", "checked");
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.lastChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ fragment.removeChild( input );
+ fragment.appendChild( div );
+
+ // Technique from Juriy Zaytsev
+ // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for ( i in {
+ submit: 1,
+ change: 1,
+ focusin: 1
+ }) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ fragment.removeChild( div );
+
+ // Null elements to avoid leaks in IE
+ fragment = select = opt = div = input = null;
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, outer, inner, table, td, offsetSupport,
+ marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
+ paddingMarginBorderVisibility, paddingMarginBorder,
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ conMarginTop = 1;
+ paddingMarginBorder = "padding:0;margin:0;border:";
+ positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
+ paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
+ style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
+ html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
+ "<table " + style + "' cellpadding='0' cellspacing='0'>" +
+ "<tr><td></td></tr></table>";
+
+ container = document.createElement("div");
+ container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
+ body.insertBefore( container, body.firstChild );
+
+ // Construct the test element
+ div = document.createElement("div");
+ container.appendChild( div );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName( "td" );
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE <= 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ if ( window.getComputedStyle ) {
+ div.innerHTML = "";
+ marginDiv = document.createElement( "div" );
+ marginDiv.style.width = "0";
+ marginDiv.style.marginRight = "0";
+ div.style.width = "2px";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+ }
+
+ if ( typeof div.style.zoom !== "undefined" ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.innerHTML = "";
+ div.style.width = div.style.padding = "1px";
+ div.style.border = 0;
+ div.style.overflow = "hidden";
+ div.style.display = "inline";
+ div.style.zoom = 1;
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "block";
+ div.style.overflow = "visible";
+ div.innerHTML = "<div style='width:5px;'></div>";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+ }
+
+ div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
+ div.innerHTML = html;
+
+ outer = div.firstChild;
+ inner = outer.firstChild;
+ td = outer.nextSibling.firstChild.firstChild;
+
+ offsetSupport = {
+ doesNotAddBorder: ( inner.offsetTop !== 5 ),
+ doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
+ };
+
+ inner.style.position = "fixed";
+ inner.style.top = "20px";
+
+ // safari subtracts parent border width here which is 5px
+ offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
+ inner.style.position = inner.style.top = "";
+
+ outer.style.overflow = "hidden";
+ outer.style.position = "relative";
+
+ offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
+ offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
+
+ if ( window.getComputedStyle ) {
+ div.style.marginTop = "1%";
+ support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
+ }
+
+ if ( typeof container.style.zoom !== "undefined" ) {
+ container.style.zoom = 1;
+ }
+
+ body.removeChild( container );
+ marginDiv = div = container = null;
+
+ jQuery.extend( support, offsetSupport );
+ });
+
+ return support;
+})();
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ // Please use with caution
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var privateCache, thisCache, ret,
+ internalKey = jQuery.expando,
+ getByName = typeof name === "string",
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
+ isEvents = name === "events";
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ internalKey ] = id = ++jQuery.uuid;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // Avoids exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ privateCache = thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Users should not attempt to inspect the internal events object using jQuery.data,
+ // it is undocumented and subject to change. But does anyone listen? No.
+ if ( isEvents && !thisCache[ name ] ) {
+ return privateCache.events;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( getByName ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i, l,
+
+ // Reference to internal data cache key
+ internalKey = jQuery.expando,
+
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+
+ // See jQuery.data for more information
+ id = isNode ? elem[ internalKey ] : internalKey;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split( " " );
+ }
+ }
+ }
+
+ for ( i = 0, l = name.length; i < l; i++ ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject(cache[ id ]) ) {
+ return;
+ }
+ }
+
+ // Browsers that fail expando deletion also refuse to delete expandos on
+ // the window, but it will allow it on all other JS objects; other browsers
+ // don't care
+ // Ensure that `cache` is not a window object #10080
+ if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+ delete cache[ id ];
+ } else {
+ cache[ id ] = null;
+ }
+
+ // We destroyed the cache and need to eliminate the expando on the node to avoid
+ // false lookups in the cache for entries that no longer exist
+ if ( isNode ) {
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ internalKey ];
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( internalKey );
+ } else {
+ elem[ internalKey ] = null;
+ }
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ if ( elem.nodeName ) {
+ var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ if ( match ) {
+ return !(match === true || elem.getAttribute("classid") !== match);
+ }
+ }
+
+ return true;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var parts, part, attr, name, l,
+ elem = this[0],
+ i = 0,
+ data = null;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ attr = elem.attributes;
+ for ( l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ parts = key.split( ".", 2 );
+ parts[1] = parts[1] ? "." + parts[1] : "";
+ part = parts[1] + "!";
+
+ return jQuery.access( this, function( value ) {
+
+ if ( value === undefined ) {
+ data = this.triggerHandler( "getData" + part, [ parts[0] ] );
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && elem ) {
+ data = jQuery.data( elem, key );
+ data = dataAttr( elem, key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ }
+
+ parts[1] = value;
+ this.each(function() {
+ var self = jQuery( this );
+
+ self.triggerHandler( "setData" + part, parts );
+ jQuery.data( this, key, value );
+ self.triggerHandler( "changeData" + part, parts );
+ });
+ }, null, value, arguments.length > 1, null, false );
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ jQuery.isNumeric( data ) ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ for ( var name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+ var deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ defer = jQuery._data( elem, deferDataKey );
+ if ( defer &&
+ ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
+ ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
+ // Give room for hard-coded callbacks to fire first
+ // and eventually mark/queue something else on the element
+ setTimeout( function() {
+ if ( !jQuery._data( elem, queueDataKey ) &&
+ !jQuery._data( elem, markDataKey ) ) {
+ jQuery.removeData( elem, deferDataKey, true );
+ defer.fire();
+ }
+ }, 0 );
+ }
+}
+
+jQuery.extend({
+
+ _mark: function( elem, type ) {
+ if ( elem ) {
+ type = ( type || "fx" ) + "mark";
+ jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
+ }
+ },
+
+ _unmark: function( force, elem, type ) {
+ if ( force !== true ) {
+ type = elem;
+ elem = force;
+ force = false;
+ }
+ if ( elem ) {
+ type = type || "fx";
+ var key = type + "mark",
+ count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
+ if ( count ) {
+ jQuery._data( elem, key, count );
+ } else {
+ jQuery.removeData( elem, key, true );
+ handleQueueMarkDefer( elem, type, "mark" );
+ }
+ }
+ },
+
+ queue: function( elem, type, data ) {
+ var q;
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ q = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ q.push( data );
+ }
+ }
+ return q || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift(),
+ hooks = {};
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ jQuery._data( elem, type + ".run", hooks );
+ fn.call( elem, function() {
+ jQuery.dequeue( elem, type );
+ }, hooks );
+ }
+
+ if ( !queue.length ) {
+ jQuery.removeData( elem, type + "queue " + type + ".run", true );
+ handleQueueMarkDefer( elem, type, "queue" );
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, object ) {
+ if ( typeof type !== "string" ) {
+ object = type;
+ type = undefined;
+ }
+ type = type || "fx";
+ var defer = jQuery.Deferred(),
+ elements = this,
+ i = elements.length,
+ count = 1,
+ deferDataKey = type + "defer",
+ queueDataKey = type + "queue",
+ markDataKey = type + "mark",
+ tmp;
+ function resolve() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ }
+ while( i-- ) {
+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+ jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
+ count++;
+ tmp.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( object );
+ }
+});
+
+
+
+
+var rclass = /[\n\t\r]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea)?$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute,
+ nodeHook, boolHook, fixSpecified;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ classNames = ( value || "" ).split( rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var self = jQuery(this), val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, i, max, option,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ i = one ? index : 0;
+ max = one ? index + 1 : options.length;
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === "undefined" ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( notxml ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, "" + value );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var propName, attrNames, name, l, isBool,
+ i = 0;
+
+ if ( value && elem.nodeType === 1 ) {
+ attrNames = value.toLowerCase().split( rspace );
+ l = attrNames.length;
+
+ for ( ; i < l; i++ ) {
+ name = attrNames[ i ];
+
+ if ( name ) {
+ propName = jQuery.propFix[ name ] || name;
+ isBool = rboolean.test( name );
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ // Do not do this for boolean attributes (see #10870)
+ if ( !isBool ) {
+ jQuery.attr( elem, name, "" );
+ }
+ elem.removeAttribute( getSetAttribute ? name : propName );
+
+ // Set corresponding property to false for boolean attributes
+ if ( isBool && propName in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ // Use the value property for back compat
+ // Use the nodeHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ propFix: {
+ tabindex: "tabIndex",
+ readonly: "readOnly",
+ "for": "htmlFor",
+ "class": "className",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ cellpadding: "cellPadding",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ usemap: "useMap",
+ frameborder: "frameBorder",
+ contenteditable: "contentEditable"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return ( elem[ name ] = value );
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabindex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ }
+});
+
+// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
+jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode,
+ property = jQuery.prop( elem, name );
+ return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ fixSpecified = {
+ name: true,
+ id: true,
+ coords: true
+ };
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
+ ret.nodeValue :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ ret = document.createAttribute( name );
+ elem.setAttributeNode( ret );
+ }
+ return ( ret.nodeValue = value + "" );
+ }
+ };
+
+ // Apply the nodeHook to tabindex
+ jQuery.attrHooks.tabindex.set = nodeHook.set;
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ get: nodeHook.get,
+ set: function( elem, value, name ) {
+ if ( value === "" ) {
+ value = "false";
+ }
+ nodeHook.set( elem, value, name );
+ }
+ };
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = "" + value );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ });
+}
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ });
+});
+
+
+
+
+var rformElems = /^(?:textarea|input|select)$/i,
+ rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
+ rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
+ quickParse = function( selector ) {
+ var quick = rquickIs.exec( selector );
+ if ( quick ) {
+ // 0 1 2 3
+ // [ _, tag, id, class ]
+ quick[1] = ( quick[1] || "" ).toLowerCase();
+ quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
+ }
+ return quick;
+ },
+ quickIs = function( elem, m ) {
+ var attrs = elem.attributes || {};
+ return (
+ (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
+ (!m[2] || (attrs.id || {}).value === m[2]) &&
+ (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
+ );
+ },
+ hoverHack = function( events ) {
+ return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
+ };
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var elemData, eventHandle, events,
+ t, tns, type, namespaces, handleObj,
+ handleObjIn, quick, handlers, special;
+
+ // Don't attach events to noData or text/comment nodes (allow plain objects tho)
+ if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ events = elemData.events;
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+ eventHandle = elemData.handle;
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = jQuery.trim( hoverHack(types) ).split( " " );
+ for ( t = 0; t < types.length; t++ ) {
+
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = tns[1];
+ namespaces = ( tns[2] || "" ).split( "." ).sort();
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: tns[1],
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ quick: selector && quickParse( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ handlers = events[ type ];
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
+ t, tns, type, origType, namespaces, origCount,
+ j, events, special, handle, eventType, handleObj;
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
+ for ( t = 0; t < types.length; t++ ) {
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tns[1];
+ namespaces = tns[2];
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector? special.delegateType : special.bindType ) || type;
+ eventType = events[ type ] || [];
+ origCount = eventType.length;
+ namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+
+ // Remove matching events
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ eventType.splice( j--, 1 );
+
+ if ( handleObj.selector ) {
+ eventType.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( eventType.length === 0 && origCount !== eventType.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery.removeData( elem, [ "events", "handle" ], true );
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Don't do events on text and comment nodes
+ if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
+ return;
+ }
+
+ // Event object or event type
+ var type = event.type || event,
+ namespaces = [],
+ cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf( "!" ) >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf( "." ) >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.isTrigger = true;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join( "." );
+ event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+ ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
+
+ // Handle a global trigger
+ if ( !elem ) {
+
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ cache = jQuery.cache;
+ for ( i in cache ) {
+ if ( cache[ i ].events && cache[ i ].events[ type ] ) {
+ jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
+ }
+ }
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ eventPath = [[ elem, special.bindType || type ]];
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
+ old = null;
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push([ cur, bubbleType ]);
+ old = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( old && old === elem.ownerDocument ) {
+ eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
+ }
+ }
+
+ // Fire handlers on the event path
+ for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
+
+ cur = eventPath[i][0];
+ event.type = eventPath[i][1];
+
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+ // Note that this is a bare JS function and not a jQuery handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ // IE<9 dies on focus/blur to hidden element (#1486)
+ if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event || window.event );
+
+ var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
+ delegateCount = handlers.delegateCount,
+ args = [].slice.call( arguments, 0 ),
+ run_all = !event.exclusive && !event.namespace,
+ special = jQuery.event.special[ event.type ] || {},
+ handlerQueue = [],
+ i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers that should run if there are delegated events
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && !(event.button && event.type === "click") ) {
+
+ // Pregenerate a single jQuery object for reuse with .is()
+ jqcur = jQuery(this);
+ jqcur.context = this.ownerDocument || this;
+
+ for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
+
+ // Don't process events on disabled elements (#6911, #8165)
+ if ( cur.disabled !== true ) {
+ selMatch = {};
+ matches = [];
+ jqcur[0] = cur;
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+ sel = handleObj.selector;
+
+ if ( selMatch[ sel ] === undefined ) {
+ selMatch[ sel ] = (
+ handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
+ );
+ }
+ if ( selMatch[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, matches: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( handlers.length > delegateCount ) {
+ handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
+ }
+
+ // Run delegates first; they may want to stop propagation beneath us
+ for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
+ matched = handlerQueue[ i ];
+ event.currentTarget = matched.elem;
+
+ for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
+ handleObj = matched.matches[ j ];
+
+ // Triggered event must either 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
+ props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var eventDoc, doc, body,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop,
+ originalEvent = event,
+ fixHook = jQuery.event.fixHooks[ event.type ] || {},
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = jQuery.Event( originalEvent );
+
+ for ( i = copy.length; i; ) {
+ prop = copy[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Target should not be a text node (#504, Safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
+ if ( event.metaKey === undefined ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady
+ },
+
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+
+ focus: {
+ delegateType: "focusin"
+ },
+ blur: {
+ delegateType: "focusout"
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ { type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+// Some plugins are using, but it's undocumented/deprecated and will be removed.
+// The 1.7 special event interface should provide all the hooks needed now.
+jQuery.event.handle = jQuery.event.dispatch;
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ if ( elem.detachEvent ) {
+ elem.detachEvent( "on" + type, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj,
+ selector = handleObj.selector,
+ ret;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !form._submit_attached ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submit_bubble = true;
+ });
+ form._submit_attached = true;
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !jQuery.support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ jQuery.event.simulate( "change", this, event, true );
+ }
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ elem._change_attached = true;
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0,
+ handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) { // && selector != null
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ var handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( var type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ live: function( types, data, fn ) {
+ jQuery( this.context ).on( types, this.selector, data, fn );
+ return this;
+ },
+ die: function( types, fn ) {
+ jQuery( this.context ).off( types, this.selector || "**", fn );
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+
+ if ( rkeyEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
+ }
+
+ if ( rmouseEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
+ }
+});
+
+
+
+/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ expando = "sizcache" + (Math.random() + '').replace('.', ''),
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true,
+ rBackslash = /\\/g,
+ rReturn = /\r\n/g,
+ rNonWord = /\W/;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+
+ var origContext = context;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var m, set, checkSet, extra, ret, cur, pop, i,
+ prune = true,
+ contextXML = Sizzle.isXML( context ),
+ parts = [],
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ do {
+ chunker.exec( "" );
+ m = chunker.exec( soFar );
+
+ if ( m ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+ } while ( m );
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context, seed );
+
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set, seed );
+ }
+ }
+
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+ ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set )[0] :
+ ret.set[0];
+ }
+
+ if ( context ) {
+ ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+ set = ret.expr ?
+ Sizzle.filter( ret.expr, ret.set ) :
+ ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray( set );
+
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ cur = parts.pop();
+ pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+
+ } else if ( context && context.nodeType === 1 ) {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+
+ } else {
+ for ( i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+ return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+ return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+ var set, i, len, match, type, left;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( i = 0, len = Expr.order.length; i < len; i++ ) {
+ type = Expr.order[i];
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ left = match[1];
+ match.splice( 1, 1 );
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace( rBackslash, "" );
+ set = Expr.find[ type ]( match, context, isXML );
+
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( "*" ) :
+ [];
+ }
+
+ return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+ var match, anyFound,
+ type, found, item, filter, left,
+ i, pass,
+ old = expr,
+ result = [],
+ curLoop = set,
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+ while ( expr && set.length ) {
+ for ( type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ filter = Expr.filter[ type ];
+ left = match[1];
+
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ pass = not ^ found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+
+ } else {
+ curLoop[i] = false;
+ }
+
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Utility function for retreiving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+var getText = Sizzle.getText = function( elem ) {
+ var i, node,
+ nodeType = elem.nodeType,
+ ret = "";
+
+ if ( nodeType ) {
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent || innerText for elements
+ if ( typeof elem.textContent === 'string' ) {
+ return elem.textContent;
+ } else if ( typeof elem.innerText === 'string' ) {
+ // Replace IE's carriage returns
+ return elem.innerText.replace( rReturn, '' );
+ } else {
+ // Traverse it's children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ } else {
+
+ // If no nodeType, this is expected to be an array
+ for ( i = 0; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ if ( node.nodeType !== 8 ) {
+ ret += getText( node );
+ }
+ }
+ }
+ return ret;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+
+ leftMatch: {},
+
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+
+ attrHandle: {
+ href: function( elem ) {
+ return elem.getAttribute( "href" );
+ },
+ type: function( elem ) {
+ return elem.getAttribute( "type" );
+ }
+ },
+
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !rNonWord.test( part ),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+
+ ">": function( checkSet, part ) {
+ var elem,
+ isPartStr = typeof part === "string",
+ i = 0,
+ l = checkSet.length;
+
+ if ( isPartStr && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+
+ } else {
+ for ( ; i < l; i++ ) {
+ elem = checkSet[i];
+
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+
+ "": function(checkSet, part, isXML){
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
+ },
+
+ "~": function( checkSet, part, isXML ) {
+ var nodeCheck,
+ doneName = done++,
+ checkFn = dirCheck;
+
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
+ part = part.toLowerCase();
+ nodeCheck = part;
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+ }
+ },
+
+ find: {
+ ID: function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ },
+
+ NAME: function( match, context ) {
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [],
+ results = context.getElementsByName( match[1] );
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+
+ TAG: function( match, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( match[1] );
+ }
+ }
+ },
+ preFilter: {
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+ match = " " + match[1].replace( rBackslash, "" ) + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+
+ ID: function( match ) {
+ return match[1].replace( rBackslash, "" );
+ },
+
+ TAG: function( match, curLoop ) {
+ return match[1].replace( rBackslash, "" ).toLowerCase();
+ },
+
+ CHILD: function( match ) {
+ if ( match[1] === "nth" ) {
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[2] = match[2].replace(/^\+|\s*/g, '');
+
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+ else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+ var name = match[1] = match[1].replace( rBackslash, "" );
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ // Handle if an un-quoted value was used
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+
+ PSEUDO: function( match, curLoop, inplace, result, not ) {
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+
+ return false;
+ }
+
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+
+ POS: function( match ) {
+ match.unshift( true );
+
+ return match;
+ }
+ },
+
+ filters: {
+ enabled: function( elem ) {
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+
+ disabled: function( elem ) {
+ return elem.disabled === true;
+ },
+
+ checked: function( elem ) {
+ return elem.checked === true;
+ },
+
+ selected: function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ parent: function( elem ) {
+ return !!elem.firstChild;
+ },
+
+ empty: function( elem ) {
+ return !elem.firstChild;
+ },
+
+ has: function( elem, i, match ) {
+ return !!Sizzle( match[3], elem ).length;
+ },
+
+ header: function( elem ) {
+ return (/h\d/i).test( elem.nodeName );
+ },
+
+ text: function( elem ) {
+ var attr = elem.getAttribute( "type" ), type = elem.type;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ },
+
+ radio: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
+ },
+
+ checkbox: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
+ },
+
+ file: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
+ },
+
+ password: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ },
+
+ submit: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "submit" === elem.type;
+ },
+
+ image: function( elem ) {
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
+ },
+
+ reset: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
+ },
+
+ button: function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && "button" === elem.type || name === "button";
+ },
+
+ input: function( elem ) {
+ return (/input|select|textarea|button/i).test( elem.nodeName );
+ },
+
+ focus: function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ }
+ },
+ setFilters: {
+ first: function( elem, i ) {
+ return i === 0;
+ },
+
+ last: function( elem, i, match, array ) {
+ return i === array.length - 1;
+ },
+
+ even: function( elem, i ) {
+ return i % 2 === 0;
+ },
+
+ odd: function( elem, i ) {
+ return i % 2 === 1;
+ },
+
+ lt: function( elem, i, match ) {
+ return i < match[3] - 0;
+ },
+
+ gt: function( elem, i, match ) {
+ return i > match[3] - 0;
+ },
+
+ nth: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ },
+
+ eq: function( elem, i, match ) {
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function( elem, match, i, array ) {
+ var name = match[1],
+ filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var j = 0, l = not.length; j < l; j++ ) {
+ if ( not[j] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ } else {
+ Sizzle.error( name );
+ }
+ },
+
+ CHILD: function( elem, match ) {
+ var first, last,
+ doneName, parent, cache,
+ count, diff,
+ type = match[1],
+ node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ /* falls through */
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+
+ case "nth":
+ first = match[2];
+ last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ doneName = match[0];
+ parent = elem.parentNode;
+
+ if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
+ count = 0;
+
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+
+ parent[ expando ] = doneName;
+ }
+
+ diff = elem.nodeIndex - last;
+
+ if ( first === 0 ) {
+ return diff === 0;
+
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+
+ ID: function( elem, match ) {
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+
+ TAG: function( elem, match ) {
+ return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
+ },
+
+ CLASS: function( elem, match ) {
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+
+ ATTR: function( elem, match ) {
+ var name = match[1],
+ result = Sizzle.attr ?
+ Sizzle.attr( elem, name ) :
+ Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ !type && Sizzle.attr ?
+ result != null :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+
+ POS: function( elem, match, i, array ) {
+ var name = match[2],
+ filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS,
+ fescape = function(all, num){
+ return "\\" + (num - 0 + 1);
+ };
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
+}
+// Expose origPOS
+// "global" as in regardless of relation to brackets/parens
+Expr.match.globalPOS = origPOS;
+
+var makeArray = function( array, results ) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch( e ) {
+ makeArray = function( array, results ) {
+ var i = 0,
+ ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+
+ } else {
+ for ( ; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder, siblingCheck;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+ };
+
+} else {
+ sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+ siblingCheck = function( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+ };
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date()).getTime(),
+ root = document.documentElement;
+
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function( match, context, isXML ) {
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+
+ return m ?
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+ [m] :
+ undefined :
+ [];
+ }
+ };
+
+ Expr.filter.ID = function( elem, match ) {
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+
+ // release memory in IE
+ root = form = null;
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function( match, context ) {
+ var results = context.getElementsByTagName( match[1] );
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+
+ Expr.attrHandle.href = function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ };
+ }
+
+ // release memory in IE
+ div = null;
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle,
+ div = document.createElement("div"),
+ id = "__sizzle__";
+
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function( query, context, extra, seed ) {
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && !Sizzle.isXML(context) ) {
+ // See if we find a selector to speed up
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+ // Speed-up: Sizzle("TAG")
+ if ( match[1] ) {
+ return makeArray( context.getElementsByTagName( query ), extra );
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+ return makeArray( context.getElementsByClassName( match[2] ), extra );
+ }
+ }
+
+ if ( context.nodeType === 9 ) {
+ // Speed-up: Sizzle("body")
+ // The body element only exists once, optimize finding it
+ if ( query === "body" && context.body ) {
+ return makeArray( [ context.body ], extra );
+
+ // Speed-up: Sizzle("#ID")
+ } else if ( match && match[3] ) {
+ var elem = context.getElementById( match[3] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id === match[3] ) {
+ return makeArray( [ elem ], extra );
+ }
+
+ } else {
+ return makeArray( [], extra );
+ }
+ }
+
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(qsaError) {}
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ var oldContext = context,
+ old = context.getAttribute( "id" ),
+ nid = old || id,
+ hasParent = context.parentNode,
+ relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+ if ( !old ) {
+ context.setAttribute( "id", nid );
+ } else {
+ nid = nid.replace( /'/g, "\\$&" );
+ }
+ if ( relativeHierarchySelector && hasParent ) {
+ context = context.parentNode;
+ }
+
+ try {
+ if ( !relativeHierarchySelector || hasParent ) {
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+ }
+
+ } catch(pseudoError) {
+ } finally {
+ if ( !old ) {
+ oldContext.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ // release memory in IE
+ div = null;
+ })();
+}
+
+(function(){
+ var html = document.documentElement,
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+ if ( matches ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9 fails this)
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+ pseudoWorks = false;
+
+ try {
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( document.documentElement, "[test!='']:sizzle" );
+
+ } catch( pseudoError ) {
+ pseudoWorks = true;
+ }
+
+ Sizzle.matchesSelector = function( node, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+ if ( !Sizzle.isXML( node ) ) {
+ try {
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+ var ret = matches.call( node, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || !disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9, so check for that
+ node.document && node.document.nodeType !== 11 ) {
+ return ret;
+ }
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle(expr, null, null, [node]).length > 0;
+ };
+ }
+})();
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function( match, context, isXML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ // release memory in IE
+ div = null;
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem[ expando ] === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem[ expando ] = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+
+ if ( elem ) {
+ var match = false;
+
+ elem = elem[dir];
+
+ while ( elem ) {
+ if ( elem[ expando ] === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem[ expando ] = doneName;
+ elem.sizset = i;
+ }
+
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+if ( document.documentElement.contains ) {
+ Sizzle.contains = function( a, b ) {
+ return a !== b && (a.contains ? a.contains(b) : true);
+ };
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+ Sizzle.contains = function( a, b ) {
+ return !!(a.compareDocumentPosition(b) & 16);
+ };
+
+} else {
+ Sizzle.contains = function() {
+ return false;
+ };
+}
+
+Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function( selector, context, seed ) {
+ var match,
+ tmpSet = [],
+ later = "",
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet, seed );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+// Override sizzle attribute retrieval
+Sizzle.attr = jQuery.attr;
+Sizzle.selectors.attrMap = {};
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})();
+
+
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice,
+ POS = jQuery.expr.match.globalPOS,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var self = this,
+ i, l;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ var ret = this.pushStack( "", "find", selector ),
+ length, n, r;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && (
+ typeof selector === "string" ?
+ // If this is a positional selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ POS.test( selector ) ?
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var ret = [], i, l, cur = this[0];
+
+ // Array (deprecated as of jQuery 1.7)
+ if ( jQuery.isArray( selectors ) ) {
+ var level = 1;
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( i = 0; i < selectors.length; i++ ) {
+
+ if ( jQuery( cur ).is( selectors[ i ] ) ) {
+ ret.push({ selector: selectors[ i ], elem: cur, level: level });
+ }
+ }
+
+ cur = cur.parentNode;
+ level++;
+ }
+
+ return ret;
+ }
+
+ // String
+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+
+ } else {
+ cur = cur.parentNode;
+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+ break;
+ }
+ }
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call( arguments ).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( elem === qualifier ) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
+ });
+}
+
+
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style)/i,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ },
+ safeFragment = createSafeFragment( document );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return jQuery.access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery.clean( arguments );
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery.clean(arguments) );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return jQuery.access( this, function( value ) {
+ var elem = this[0] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ null;
+ }
+
+
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName( "*" ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, fragment, parent,
+ value = args[0],
+ scripts = [];
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = jQuery.buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ // Make sure that we do not leak memory by inadvertently discarding
+ // the original fragment (which might have attached data) instead of
+ // using it; in addition, use the original fragment object for the last
+ // item instead of first because it can end up being emptied incorrectly
+ // in certain situations (Bug #8070).
+ // Fragments from the fragment cache must always be cloned and never used
+ // in place.
+ results.cacheable || ( l > 1 && i < lastIndex ) ?
+ jQuery.clone( fragment, true, true ) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, function( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ type: "GET",
+ global: false,
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ });
+ }
+ }
+
+ return this;
+ }
+});
+
+function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 fail to clone children inside object elements that use
+ // the proprietary classid attribute value (rather than the type
+ // attribute) to identify the type of content to display
+ if ( nodeName === "object" ) {
+ dest.outerHTML = src.outerHTML;
+
+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+ if ( src.checked ) {
+ dest.defaultChecked = dest.checked = src.checked;
+ }
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+
+ // IE blanks contents when cloning scripts
+ } else if ( nodeName === "script" && dest.text !== src.text ) {
+ dest.text = src.text;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+
+ // Clear flags for bubbling special change/submit events, they must
+ // be reattached when the newly cloned events are first activated
+ dest.removeAttribute( "_submit_attached" );
+ dest.removeAttribute( "_change_attached" );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults, doc,
+ first = args[ 0 ];
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
+ if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
+ first.charAt(0) === "<" && !rnocache.test( first ) &&
+ (jQuery.support.checkClone || !rchecked.test( first )) &&
+ (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
+
+ cacheable = true;
+
+ cacheresults = jQuery.fragments[ first ];
+ if ( cacheresults && cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ first ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [],
+ insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = ( i > 0 ? this.clone(true) : this ).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( typeof elem.querySelectorAll !== "undefined" ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+ var nodeName = ( elem.nodeName || "" ).toLowerCase();
+ if ( nodeName === "input" ) {
+ fixDefaultChecked( elem );
+ // Skip scripts, get other children
+ } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+}
+
+// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
+function shimCloneNode( elem ) {
+ var div = document.createElement( "div" );
+ safeFragment.appendChild( div );
+
+ div.innerHTML = elem.outerHTML;
+ return div.firstChild;
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var srcElements,
+ destElements,
+ i,
+ // IE<=8 does not properly clone detached, unknown element nodes
+ clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
+ elem.cloneNode( true ) :
+ shimCloneNode( elem );
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var checkScriptType, script, j,
+ ret = [];
+
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div"),
+ safeChildNodes = safeFragment.childNodes,
+ remove;
+
+ // Append wrapper element to unknown element safe doc fragment
+ if ( context === document ) {
+ // Use the fragment we've already created for this document
+ safeFragment.appendChild( div );
+ } else {
+ // Use a fragment created with the owner document
+ createSafeFragment( context ).appendChild( div );
+ }
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+
+ // Clear elements from DocumentFragment (safeFragment or otherwise)
+ // to avoid hoarding elements. Fixes #11356
+ if ( div ) {
+ div.parentNode.removeChild( div );
+
+ // Guard against -1 index exceptions in FF3.6
+ if ( safeChildNodes.length > 0 ) {
+ remove = safeChildNodes[ safeChildNodes.length - 1 ];
+
+ if ( remove && remove.parentNode ) {
+ remove.parentNode.removeChild( remove );
+ }
+ }
+ }
+ }
+ }
+
+ // Resets defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ var len;
+ if ( !jQuery.support.appendChecked ) {
+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
+ }
+ } else {
+ findInputs( elem );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ checkScriptType = function( elem ) {
+ return !elem.type || rscriptType.test( elem.type );
+ };
+ for ( i = 0; ret[i]; i++ ) {
+ script = ret[i];
+ if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
+ scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
+
+ } else {
+ if ( script.nodeType === 1 ) {
+ var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
+
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ }
+ fragment.appendChild( script );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id,
+ cache = jQuery.cache,
+ special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ continue;
+ }
+
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ];
+
+ if ( data && data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+
+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
+ if ( data.handle ) {
+ data.handle.elem = null;
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ // fixed for IE9, see #8346
+ rupper = /([A-Z]|^ms)/g,
+ rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
+ rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
+ rrelNum = /^([\-+])=([\-+.\de]+)/,
+ rmargin = /^margin/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+
+ // order is important!
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
+
+ curCSS,
+
+ getComputedStyle,
+ currentStyle;
+
+jQuery.fn.css = function( name, value ) {
+ return jQuery.access( this, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+};
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, origName = jQuery.camelCase( name ),
+ style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+ name = jQuery.cssProps[ origName ] || origName;
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra ) {
+ var ret, hooks;
+
+ // Make sure that we're working with the right name
+ name = jQuery.camelCase( name );
+ hooks = jQuery.cssHooks[ name ];
+ name = jQuery.cssProps[ name ] || name;
+
+ // cssFloat needs a special treatment
+ if ( name === "cssFloat" ) {
+ name = "float";
+ }
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ return ret;
+
+ // Otherwise, if a way to get the computed value exists, use that
+ } else if ( curCSS ) {
+ return curCSS( elem, name );
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {},
+ ret, name;
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+// DEPRECATED in 1.3, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ getComputedStyle = function( elem, name ) {
+ var ret, defaultView, computedStyle, width,
+ style = elem.style;
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ if ( (defaultView = elem.ownerDocument.defaultView) &&
+ (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+
+ ret = computedStyle.getPropertyValue( name );
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
+ // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
+ width = style.width;
+ style.width = ret;
+ ret = computedStyle.width;
+ style.width = width;
+ }
+
+ return ret;
+ };
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
+ var left, rsLeft, uncomputed,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ style = elem.style;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && (uncomputed = style[ name ]) ) {
+ ret = uncomputed;
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( rnumnonpx.test( ret ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ i = name === "width" ? 1 : 0,
+ len = 4;
+
+ if ( val > 0 ) {
+ if ( extra !== "border" ) {
+ for ( ; i < len; i += 2 ) {
+ if ( !extra ) {
+ val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
+ } else {
+ val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
+ }
+ }
+ }
+
+ return val + "px";
+ }
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Add padding, border, margin
+ if ( extra ) {
+ for ( ; i < len; i += 2 ) {
+ val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
+ if ( extra !== "padding" ) {
+ val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
+ }
+ if ( extra === "margin" ) {
+ val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
+ }
+ }
+ }
+
+ return val + "px";
+}
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ if ( elem.offsetWidth !== 0 ) {
+ return getWidthOrHeight( elem, name, extra );
+ } else {
+ return jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ });
+ }
+ }
+ },
+
+ set: function( elem, value ) {
+ return rnum.test( value ) ?
+ value + "px" :
+ value;
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there there is no filter style applied in a css rule, we are done
+ if ( currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery(function() {
+ // This hook cannot be added until DOM ready because the support test
+ // for it is not run until after DOM ready
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ return curCSS( elem, "margin-right" );
+ } else {
+ return elem.style.marginRight;
+ }
+ });
+ }
+ };
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth,
+ height = elem.offsetHeight;
+
+ return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i,
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ],
+ expanded = {};
+
+ for ( i = 0; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+});
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rselectTextarea = /^(?:select|textarea)/i,
+ rspacesAjax = /\s+/,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Document location
+ ajaxLocation,
+
+ // Document location segments
+ ajaxLocParts,
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = ["*/"] + ["*"];
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ if ( jQuery.isFunction( func ) ) {
+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+ i = 0,
+ length = dataTypes.length,
+ dataType,
+ list,
+ placeBefore;
+
+ // For each dataType in the dataTypeExpression
+ for ( ; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for ( ; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+}
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf( " " );
+ if ( off >= 0 ) {
+ var selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ // Complete callback (responseText is used internally)
+ complete: function( jqXHR, status, responseText ) {
+ // Store the response as specified by the jqXHR object
+ responseText = jqXHR.responseText;
+ // If successful, inject the HTML into all the matched elements
+ if ( jqXHR.isResolved() ) {
+ // #4825: Get the actual response in case
+ // a dataFilter is present in ajaxSettings
+ jqXHR.done(function( r ) {
+ responseText = r;
+ });
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [ responseText, status, jqXHR ] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.on( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ if ( settings ) {
+ // Building a settings object
+ ajaxExtend( target, jQuery.ajaxSettings );
+ } else {
+ // Extending ajaxSettings
+ settings = target;
+ target = jQuery.ajaxSettings;
+ }
+ ajaxExtend( target, settings );
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ text: "text/plain",
+ json: "application/json, text/javascript",
+ "*": allTypes
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ context: true,
+ url: true
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks( "once memory" ),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // The jqXHR state
+ state = 0,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || "abort";
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, nativeStatusText, responses, headers ) {
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ var isSuccess,
+ success,
+ error,
+ statusText = nativeStatusText,
+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+ lastModified,
+ etag;
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ }
+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+ jQuery.etag[ ifModifiedKey ] = etag;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ try {
+ success = ajaxConvert( s, response );
+ statusText = "success";
+ isSuccess = true;
+ } catch(e) {
+ // We have a parsererror
+ statusText = "parsererror";
+ error = e;
+ }
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = "" + ( nativeStatusText || statusText );
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.add;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for ( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.then( tmp, tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+
+ // Determine if a cross-domain request is in order
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return false;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already
+ jqXHR.abort();
+ return false;
+
+ }
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : value;
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+ }
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( var name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields,
+ ct,
+ type,
+ finalDataType,
+ firstDataType;
+
+ // Fill responseXXX fields
+ for ( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ var dataTypes = s.dataTypes,
+ converters = {},
+ i,
+ key,
+ length = dataTypes.length,
+ tmp,
+ // Current and previous dataTypes
+ current = dataTypes[ 0 ],
+ prev,
+ // Conversion expression
+ conversion,
+ // Conversion function
+ conv,
+ // Conversion functions (transitive conversion)
+ conv1,
+ conv2;
+
+ // For each dataType in the chain
+ for ( i = 1; i < length; i++ ) {
+
+ // Create converters map
+ // with lowercased keys
+ if ( i === 1 ) {
+ for ( key in s.converters ) {
+ if ( typeof key === "string" ) {
+ converters[ key.toLowerCase() ] = s.converters[ key ];
+ }
+ }
+ }
+
+ // Get the dataTypes
+ prev = current;
+ current = dataTypes[ i ];
+
+ // If current is auto dataType, update it to prev
+ if ( current === "*" ) {
+ current = prev;
+ // If no auto and dataTypes are actually different
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Get the converter
+ conversion = prev + " " + current;
+ conv = converters[ conversion ] || converters[ "* " + current ];
+
+ // If there is no direct converter, search transitively
+ if ( !conv ) {
+ conv2 = undefined;
+ for ( conv1 in converters ) {
+ tmp = conv1.split( " " );
+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+ conv2 = converters[ tmp[1] + " " + current ];
+ if ( conv2 ) {
+ conv1 = converters[ conv1 ];
+ if ( conv1 === true ) {
+ conv = conv2;
+ } else if ( conv2 === true ) {
+ conv = conv1;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // If we found no converter, dispatch an error
+ if ( !( conv || conv2 ) ) {
+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+ }
+ // If found converter is not an equivalence
+ if ( conv !== true ) {
+ // Convert with 1 or 2 converters accordingly
+ response = conv ? conv( response ) : conv2( conv1(response) );
+ }
+ }
+ }
+ return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+ jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ return jQuery.expando + "_" + ( jsc++ );
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
+
+ if ( s.dataTypes[ 0 ] === "jsonp" ||
+ s.jsonp !== false && ( jsre.test( s.url ) ||
+ inspectData && jsre.test( s.data ) ) ) {
+
+ var responseContainer,
+ jsonpCallback = s.jsonpCallback =
+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+ previous = window[ jsonpCallback ],
+ url = s.url,
+ data = s.data,
+ replace = "$1" + jsonpCallback + "$2";
+
+ if ( s.jsonp !== false ) {
+ url = url.replace( jsre, replace );
+ if ( s.url === url ) {
+ if ( inspectData ) {
+ data = data.replace( jsre, replace );
+ }
+ if ( s.data === data ) {
+ // Add callback manually
+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+ }
+ }
+ }
+
+ s.url = url;
+ s.data = data;
+
+ // Install callback
+ window[ jsonpCallback ] = function( response ) {
+ responseContainer = [ response ];
+ };
+
+ // Clean-up function
+ jqXHR.always(function() {
+ // Set callback back to previous value
+ window[ jsonpCallback ] = previous;
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( previous ) ) {
+ window[ jsonpCallback ]( responseContainer[ 0 ] );
+ }
+ });
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( jsonpCallback + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0,
+ xhrCallbacks;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var xhr = s.xhr(),
+ handle,
+ i;
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occured
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+
+ // When requesting binary data, IE6-9 will throw an exception
+ // on any attempt to access responseText (#11426)
+ try {
+ responses.text = xhr.responseText;
+ } catch( _ ) {
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ // if we're in sync mode or it's in cache
+ // and has been retrieved directly (IE6 & IE7)
+ // we need to manually fire the callback
+ if ( !s.async || xhr.readyState === 4 ) {
+ callback();
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+
+
+
+
+var elemdisplay = {},
+ iframe, iframeDoc,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ],
+ fxNow;
+
+jQuery.fn.extend({
+ show: function( speed, easing, callback ) {
+ var elem, display;
+
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("show", 3), speed, easing, callback );
+
+ } else {
+ for ( var i = 0, j = this.length; i < j; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+ display = elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( (display === "" && jQuery.css(elem, "display") === "none") ||
+ !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+ jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.style ) {
+ display = elem.style.display;
+
+ if ( display === "" || display === "none" ) {
+ elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
+ }
+ }
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, easing, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, easing, callback);
+
+ } else {
+ var elem, display,
+ i = 0,
+ j = this.length;
+
+ for ( ; i < j; i++ ) {
+ elem = this[i];
+ if ( elem.style ) {
+ display = jQuery.css( elem, "display" );
+
+ if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
+ jQuery._data( elem, "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( i = 0; i < j; i++ ) {
+ if ( this[i].style ) {
+ this[i].style.display = "none";
+ }
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2, callback ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2, callback);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, easing, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, easing, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed( speed, easing, callback );
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete, [ false ] );
+ }
+
+ // Do not change referenced properties as per-property easing will be lost
+ prop = jQuery.extend( {}, prop );
+
+ function doAnimation() {
+ // XXX 'this' does not always have a nodeName when running the
+ // test suite
+
+ if ( optall.queue === false ) {
+ jQuery._mark( this );
+ }
+
+ var opt = jQuery.extend( {}, optall ),
+ isElement = this.nodeType === 1,
+ hidden = isElement && jQuery(this).is(":hidden"),
+ name, val, p, e, hooks, replace,
+ parts, start, end, unit,
+ method;
+
+ // will store per property easing and be used to determine when an animation is complete
+ opt.animatedProperties = {};
+
+ // first pass over propertys to expand / normalize
+ for ( p in prop ) {
+ name = jQuery.camelCase( p );
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ }
+
+ if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
+ replace = hooks.expand( prop[ name ] );
+ delete prop[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'p' from above because we have the correct "name"
+ for ( p in replace ) {
+ if ( ! ( p in prop ) ) {
+ prop[ p ] = replace[ p ];
+ }
+ }
+ }
+ }
+
+ for ( name in prop ) {
+ val = prop[ name ];
+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+ if ( jQuery.isArray( val ) ) {
+ opt.animatedProperties[ name ] = val[ 1 ];
+ val = prop[ name ] = val[ 0 ];
+ } else {
+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+ }
+
+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
+ return opt.complete.call( this );
+ }
+
+ if ( isElement && ( name === "height" || name === "width" ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( this, "display" ) === "inline" &&
+ jQuery.css( this, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
+ this.style.display = "inline-block";
+
+ } else {
+ this.style.zoom = 1;
+ }
+ }
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ for ( p in prop ) {
+ e = new jQuery.fx( this, opt, p );
+ val = prop[ p ];
+
+ if ( rfxtypes.test( val ) ) {
+
+ // Tracks whether to show or hide based on private
+ // data attached to the element
+ method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
+ if ( method ) {
+ jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
+ e[ method ]();
+ } else {
+ e[ val ]();
+ }
+
+ } else {
+ parts = rfxnum.exec( val );
+ start = e.cur();
+
+ if ( parts ) {
+ end = parseFloat( parts[2] );
+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ jQuery.style( this, p, (end || 1) + unit);
+ start = ( (end || 1) / e.cur() ) * start;
+ jQuery.style( this, p, start + unit);
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ }
+
+ // For JS strict compliance
+ return true;
+ }
+
+ return optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+
+ stop: function( type, clearQueue, gotoEnd ) {
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var index,
+ hadTimers = false,
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ // clear marker counters if we know they won't be
+ if ( !gotoEnd ) {
+ jQuery._unmark( true, this );
+ }
+
+ function stopQueue( elem, data, index ) {
+ var hooks = data[ index ];
+ jQuery.removeData( elem, index, true );
+ hooks.stop( gotoEnd );
+ }
+
+ if ( type == null ) {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
+ stopQueue( this, data, index );
+ }
+ }
+ } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
+ stopQueue( this, data, index );
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ if ( gotoEnd ) {
+
+ // force the next step to be the last
+ timers[ index ]( true );
+ } else {
+ timers[ index ].saveState();
+ }
+ hadTimers = true;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( !( gotoEnd && hadTimers ) ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ }
+
+});
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx( "show", 1 ),
+ slideUp: genFx( "hide", 1 ),
+ slideToggle: genFx( "toggle", 1 ),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function( noUnmark ) {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ } else if ( noUnmark !== false ) {
+ jQuery._unmark( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ options.orig = options.orig || {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
+ },
+
+ // Get the current size
+ cur: function() {
+ if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var parsed,
+ r = jQuery.css( this.elem, this.prop );
+ // Empty strings, null, undefined and "auto" are converted to 0,
+ // complex values such as "rotate(1rad)" are returned as is,
+ // simple values such as "10px" are parsed to Float.
+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ var self = this,
+ fx = jQuery.fx;
+
+ this.startTime = fxNow || createFxNow();
+ this.end = to;
+ this.now = this.start = from;
+ this.pos = this.state = 0;
+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
+
+ function t( gotoEnd ) {
+ return self.step( gotoEnd );
+ }
+
+ t.queue = this.options.queue;
+ t.elem = this.elem;
+ t.saveState = function() {
+ if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
+ if ( self.options.hide ) {
+ jQuery._data( self.elem, "fxshow" + self.prop, self.start );
+ } else if ( self.options.show ) {
+ jQuery._data( self.elem, "fxshow" + self.prop, self.end );
+ }
+ }
+ };
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval( fx.tick, fx.interval );
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
+
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any flash of content
+ if ( dataShow !== undefined ) {
+ // This show is picking up where a previous hide or show left off
+ this.custom( this.cur(), dataShow );
+ } else {
+ this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
+ }
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom( this.cur(), 0 );
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var p, n, complete,
+ t = fxNow || createFxNow(),
+ done = true,
+ elem = this.elem,
+ options = this.options;
+
+ if ( gotoEnd || t >= options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ options.animatedProperties[ this.prop ] = true;
+
+ for ( p in options.animatedProperties ) {
+ if ( options.animatedProperties[ p ] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ // Reset the overflow
+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+ jQuery.each( [ "", "X", "Y" ], function( index, value ) {
+ elem.style[ "overflow" + value ] = options.overflow[ index ];
+ });
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( options.hide ) {
+ jQuery( elem ).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( options.hide || options.show ) {
+ for ( p in options.animatedProperties ) {
+ jQuery.style( elem, p, options.orig[ p ] );
+ jQuery.removeData( elem, "fxshow" + p, true );
+ // Toggle data is no longer needed
+ jQuery.removeData( elem, "toggle" + p, true );
+ }
+ }
+
+ // Execute the complete function
+ // in the event that the complete function throws an exception
+ // we must ensure it won't be called twice. #5684
+
+ complete = options.complete;
+ if ( complete ) {
+
+ options.complete = false;
+ complete.call( elem );
+ }
+ }
+
+ return false;
+
+ } else {
+ // classical easing cannot be used with an Infinity duration
+ if ( options.duration == Infinity ) {
+ this.now = t;
+ } else {
+ n = t - this.startTime;
+ this.state = n / options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
+ this.now = this.start + ( (this.end - this.start) * this.pos );
+ }
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ interval: 13,
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style( fx.elem, "opacity", fx.now );
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+// Ensure props that can't be negative don't go there on undershoot easing
+jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
+ // exclude marginTop, marginLeft, marginBottom and marginRight from this list
+ if ( prop.indexOf( "margin" ) ) {
+ jQuery.fx.step[ prop ] = function( fx ) {
+ jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
+ };
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+ if ( !elemdisplay[ nodeName ] ) {
+
+ var body = document.body,
+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
+ display = elem.css( "display" );
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // No iframe to use yet, so create it
+ if ( !iframe ) {
+ iframe = document.createElement( "iframe" );
+ iframe.frameBorder = iframe.width = iframe.height = 0;
+ }
+
+ body.appendChild( iframe );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.createElement( nodeName );
+
+ iframeDoc.body.appendChild( elem );
+
+ display = jQuery.css( elem, "display" );
+ body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return elemdisplay[ nodeName ];
+}
+
+
+
+
+var getOffset,
+ rtable = /^t(?:able|d|h)$/i,
+ rroot = /^(?:body|html)$/i;
+
+if ( "getBoundingClientRect" in document.documentElement ) {
+ getOffset = function( elem, doc, docElem, box ) {
+ try {
+ box = elem.getBoundingClientRect();
+ } catch(e) {}
+
+ // Make sure we're not dealing with a disconnected DOM node
+ if ( !box || !jQuery.contains( docElem, elem ) ) {
+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+ }
+
+ var body = doc.body,
+ win = getWindow( doc ),
+ clientTop = docElem.clientTop || body.clientTop || 0,
+ clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+ top = box.top + scrollTop - clientTop,
+ left = box.left + scrollLeft - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ getOffset = function( elem, doc, docElem ) {
+ var computedStyle,
+ offsetParent = elem.offsetParent,
+ prevOffsetParent = elem,
+ body = doc.body,
+ defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop,
+ left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent;
+ offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.fn.offset = function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var elem = this[0],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return null;
+ }
+
+ if ( elem === doc.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ return getOffset( elem, doc, doc.documentElement );
+};
+
+jQuery.offset = {
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return jQuery.access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+
+
+
+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ var clientProp = "client" + name,
+ scrollProp = "scroll" + name,
+ offsetProp = "offset" + name;
+
+ // innerHeight and innerWidth
+ jQuery.fn[ "inner" + name ] = function() {
+ var elem = this[0];
+ return elem ?
+ elem.style ?
+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
+ this[ type ]() :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn[ "outer" + name ] = function( margin ) {
+ var elem = this[0];
+ return elem ?
+ elem.style ?
+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
+ this[ type ]() :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( value ) {
+ return jQuery.access( this, function( elem, type, value ) {
+ var doc, docElemProp, orig, ret;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+ doc = elem.document;
+ docElemProp = doc.documentElement[ clientProp ];
+ return jQuery.support.boxModel && docElemProp ||
+ doc.body && doc.body[ clientProp ] || docElemProp;
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ doc = elem.documentElement;
+
+ // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
+ // so we can't use max, as it'll choose the incorrect offset[Width/Height]
+ // instead we use the correct client[Width/Height]
+ // support:IE6
+ if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
+ return doc[ clientProp ];
+ }
+
+ return Math.max(
+ elem.body[ scrollProp ], doc[ scrollProp ],
+ elem.body[ offsetProp ], doc[ offsetProp ]
+ );
+ }
+
+ // Get width or height on the element
+ if ( value === undefined ) {
+ orig = jQuery.css( elem, type );
+ ret = parseFloat( orig );
+ return jQuery.isNumeric( ret ) ? ret : orig;
+ }
+
+ // Set the width or height on the element
+ jQuery( elem ).css( type, value );
+ }, type, value, arguments.length, null );
+ };
+});
+
+
+
+
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+// Expose jQuery as an AMD module, but only for AMD loaders that
+// understand the issues with loading multiple versions of jQuery
+// in a page that all might call define(). The loader will indicate
+// they have special allowances for multiple jQuery versions by
+// specifying define.amd.jQuery = true. Register as a named module,
+// since jQuery can be concatenated with other files that may use define,
+// but not use a proper concatenation script that understands anonymous
+// AMD modules. A named AMD is safest and most robust way to register.
+// Lowercase jquery is used because AMD module names are derived from
+// file names, and jQuery is normally delivered in a lowercase file name.
+// Do this after creating the global so that if an AMD module wants to call
+// noConflict to hide this version of jQuery, it will work.
+if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
+ define( "jquery", [], function () { return jQuery; } );
+}
+
+
+
+})( window );
diff --git a/src/components/HMI/lib/jquery-1.7.2.min.js b/src/components/HMI/lib/jquery-1.7.2.min.js
new file mode 100644
index 0000000000..1775c9c031
--- /dev/null
+++ b/src/components/HMI/lib/jquery-1.7.2.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.2 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
+a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
+.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file
diff --git a/src/components/HMI/locale/eng.js b/src/components/HMI/locale/eng.js
new file mode 100644
index 0000000000..75c7e200d1
--- /dev/null
+++ b/src/components/HMI/locale/eng.js
@@ -0,0 +1,62 @@
+SDL.eng = {
+
+ view_warning: 'WARNING!',
+ view_warning_paragraph1: 'This application is intended to be used as a demonstrative aid only, while the vehicle is parked. Don&apos;t use it while driving.',
+ view_warning_paragraph2: 'Use extreme caution when using any device that takes your attention off the road. Ford recommends against the use of any hand-held device while driving and that you comply with all applicable laws. Your primary responsibility is the safe operation of the vehicle.',
+
+ view_mediaStatus_entertainment: 'Entertainment',
+
+ view_info_alerts_sort: 'Sort By',
+
+ view_info_alerts_dateIcon: [
+ 'Date', 'Icon'
+ ],
+ view_info_alerts_911Assist: '911 Assist Set To OFF 2012',
+ view_info_alerts_view: 'View',
+ view_info_alerts_delete: 'Delete',
+ view_info_alerts_deleteAll: 'Delete All',
+ view_info_apps_911Assist: '911 Assist',
+ view_info_apps_vehicle_VehicleHealthReport: 'Vehicle Health Report',
+ view_info_apps_vehicle_InstallApplicationsUp: 'Install Applications/Up',
+ view_info_apps_vehicle_FindNewApplications: 'Find New Apps',
+ view_info_apps_vehicle_GetDeviceList: 'Change Devices',
+
+ view_info_calendar_date: 'Jul, 2012',
+ view_info_calendar_today: 'Go to Today',
+ view_info_calendar_day1: 'SUN',
+ view_info_calendar_day2: 'MON',
+ view_info_calendar_day3: 'TUE',
+ view_info_calendar_day4: 'WED',
+ view_info_calendar_day5: 'THU',
+ view_info_calendar_day6: 'FRI',
+ view_info_calendar_day7: 'SAT',
+
+ view_info_services_syncServices: 'SYNC Services',
+ view_info_services_trafficDirectionsAndInformation: 'TRAFFIC, DIRECTIONS AND INFORMATION',
+ view_info_services_getTheLatestTrafficRreport: 'Get the latest traffic report',
+ view_info_services_findBusinessesAndDownloadSaved: 'Find Businesses and Download Saved ',
+ view_info_services_hearPersonalizedInformationMore: 'Hear Personalized Information & More',
+ view_info_services_connecttoServices: 'Connect to Services',
+ view_info_services_toActivate: 'To activate, log onto www.SyncMyRide.com',
+
+ view_info_travelLink_trafficOnRoute: 'Traffic on Route',
+ view_info_travelLink_trafficNearby: 'Traffic Nearby',
+ view_info_travelLink_fuelPrices: 'Fuel Prices',
+ view_info_travelLink_movieListings: 'Movie Listings',
+ view_info_travelLink_subscriptionInfo: 'Subscription Info',
+ view_info_travelLink_weather: 'Weather',
+ view_info_travelLink_sportsInfo: 'Sports Info',
+ view_info_travelLink_skiConditions: 'Ski Conditions',
+
+ view_info_leftmenu_services: 'Services',
+ view_info_leftmenu_travelLink: 'Travel Link',
+ view_info_leftmenu_alerts: 'Alerts',
+ view_info_leftmenu_calendar: 'Calendar',
+ view_info_leftmenu_apps: 'Apps',
+
+ view_media_cd: 'CD',
+ view_phone_dial: 'Dial',
+ view_phone_end: 'End',
+ view_phone_phone: 'Phone',
+ view_phone_popUp_callEnded: 'Call Ended'
+}; \ No newline at end of file
diff --git a/src/components/HMI/locale/locale.js b/src/components/HMI/locale/locale.js
new file mode 100644
index 0000000000..486fe75260
--- /dev/null
+++ b/src/components/HMI/locale/locale.js
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met: ·
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. · Redistributions in binary
+ * form must reproduce the above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation and/or other materials provided
+ * with the distribution. · Neither the name of the Ford Motor Company nor the
+ * names of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.locale
+ * @desc SDL localization object
+ * @category Localization
+ * @filesource locale/locale.js
+ * @version 1.0
+ */
+
+SDL.locale = Em.Object.create( {
+
+ label: SDL[SDL.localization],
+
+ setLang: function(lang) {
+
+ this.set('label', SDL[SDL.localization]);
+ }.observes('SDL.localization')
+}); \ No newline at end of file
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
new file mode 100644
index 0000000000..1a23890c0e
--- /dev/null
+++ b/src/components/application_manager/CMakeLists.txt
@@ -0,0 +1,338 @@
+set (COMPONENTS_DIR ${CMAKE_SOURCE_DIR}/src/components)
+set (AM_SOURCE_DIR ${COMPONENTS_DIR}/application_manager)
+set (AM_TEST_DIR ${AM_SOURCE_DIR}/test)
+set (AM_MOCK_DIR ${AM_TEST_DIR}/mock)
+
+
+if (EXTENDED_POLICY_FLAG)
+ add_definitions(-DEXTENDED_POLICY)
+endif()
+
+include_directories (
+ include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/formatters/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/hmi_message_handler/include
+ ${COMPONENTS_DIR}/media_manager/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/config_profile/include/
+ ${COMPONENTS_DIR}/request_watchdog/include/
+ ${COMPONENTS_DIR}/resumption/include/
+ ${COMPONENTS_DIR}/rpc_base/include/
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${COMPONENTS_DIR}/include/
+ ${COMPONENTS_DIR}/policy/src/policy/include/
+ ${COMPONENTS_DIR}/policy/src/policy/usage_statistics/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${ENCRYPTION_INCLUDE_DIRECTORY}
+ ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+file (GLOB SOURCES
+ ${AM_SOURCE_DIR}/src/*
+)
+
+set (POLICIES_MANAGER
+${AM_SOURCE_DIR}/src/policies/policy_handler.cc
+${AM_SOURCE_DIR}/src/policies/policy_event_observer.cc
+)
+
+if (EXTENDED_POLICY_FLAG)
+ include_directories(
+ ${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct_ext
+ )
+ list(APPEND POLICIES_MANAGER
+ ${AM_SOURCE_DIR}/src/policies/pt_exchange_handler_ext.cc
+ )
+else ()
+ include_directories(
+ ${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct
+ )
+ list(APPEND POLICIES_MANAGER
+ ${AM_SOURCE_DIR}/src/policies/pt_exchange_handler_impl.cc
+ ${AM_SOURCE_DIR}/src/policies/policy_retry_sequence.cc
+ )
+endif ()
+
+file (GLOB EVENT_ENGINE
+ ${AM_SOURCE_DIR}/src/event_engine/*
+)
+
+file (GLOB MOBILE_COMMANDS_SOURCES
+ ${AM_SOURCE_DIR}/src/commands/*
+ ${AM_SOURCE_DIR}/src/commands/mobile/*
+)
+
+ set (HMI_COMMANDS_SOURCES
+ ${AM_SOURCE_DIR}/src/commands/hmi/request_to_hmi.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/response_from_hmi.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/request_from_hmi.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/response_to_hmi.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/notification_to_hmi.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/notification_from_hmi.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/allow_all_apps_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/allow_all_apps_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/allow_app_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/allow_app_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/update_sdl_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/update_sdl_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/activate_app_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/activate_app_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/get_system_info_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/get_system_info_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_list_of_permissions_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_list_of_permissions_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_user_friendly_message_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_user_friendly_message_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_status_update_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_get_status_update_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_status_update_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_activate_app_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_activate_app_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/mixing_audio_supported_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/mixing_audio_supported_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/update_app_list_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/update_app_list_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_update_device_list.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/update_device_list_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/update_device_list_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_consent_needed_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_persistence_complete_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_exit_all_applications_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_exit_application_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_start_device_discovery.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/close_popup_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/close_popup_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_app_activated_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/button_get_capabilities_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/button_get_capabilities_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_is_ready_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_is_ready_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_add_command_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_add_command_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_delete_command_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_delete_command_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_change_registration_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_change_registration_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_supported_languages_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_supported_languages_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_language_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_language_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_capabilities_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_get_capabilities_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_is_ready_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_is_ready_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_change_registration_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_change_registration_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_language_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_language_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_supported_languages_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_supported_languages_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_stop_speaking_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_stop_speaking_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_speak_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_speak_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_set_global_properties_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_set_global_properties_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_capabilities_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/tts_get_capabilities_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_perform_interaction_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vr_perform_interaction_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_command_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_command_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_command_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_command_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_submenu_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_add_submenu_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_submenu_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_delete_submenu_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_supported_languages_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_supported_languages_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_language_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_language_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_capabilities_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_get_capabilities_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_change_registration_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_change_registration_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_alert_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_alert_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_slider_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_scrollable_message_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_scrollable_message_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_global_properties_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_global_properties_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_slider_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_is_ready_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_is_ready_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_end_audio_pass_thru_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_end_audio_pass_thru_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_interaction_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_perform_interaction_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_icon_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_icon_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_media_clock_timer_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_media_clock_timer_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_show_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_is_ready_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_is_ready_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_read_did_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_read_did_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_dtcs_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_dtcs_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_diagnostic_message_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_diagnostic_message_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_type_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_type_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_is_ready_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_is_ready_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_alert_maneuver_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_alert_maneuver_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_update_turn_list_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_update_turn_list_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_show_constant_tbt_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_show_constant_tbt_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_send_location_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_send_location_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ready_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_system_context_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_device_chosen_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_allow_sdl_functionality_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_app_permission_consent_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_app_registered_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_app_permission_changed_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_app_unregistered_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_driver_distraction_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ignition_cycle_over_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_system_info_changed_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_file_removed_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_play_tone_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_started_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_stopped_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_started_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_stopped_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_command_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_command_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_navi_tbt_client_state_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_app_deactivated_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_language_change_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vr_language_change_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_language_change_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_button_event_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_button_press_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_find_applications.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_keyboard_input_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_touch_event_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_ui_reset_timeout_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_start_stream_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_start_stream_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_stop_stream_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_stop_stream_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_start_stream_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_start_stream_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_stop_stream_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/navi_audio_stop_stream_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_system_request_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_put_file_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_resume_audio_source_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_sdl_close_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_display_layout_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/ui_set_display_layout_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_record_start_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/add_statistics_info_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_system_error_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/basic_communication_system_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/basic_communication_system_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_policy_update.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/sdl_policy_update_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_received_policy_update.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_policy_update.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/get_urls.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/get_urls_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_device_state_changed_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_tts_reset_timeout_notification.cc
+)
+
+set (HMI_COMMANDS_SOURCES_JSON
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_data_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_get_vehicle_data_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_vehicle_data_notification.cc
+)
+
+set (HMI_COMMANDS_SOURCES_DBUS
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_gps_data_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_speed_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_rpm_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_fuel_level_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_fuel_level_state_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_external_temperature_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_vin_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_prndl_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_tire_pressure_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_odometer_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_belt_status_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_body_information_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_device_status_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_driver_braking_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_wiper_status_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_head_lamp_status_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_engine_torque_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
+ ${AM_SOURCE_DIR}/src/commands/hmi/on_vi_my_key_notification.cc
+)
+
+if (${HMI_JSON_API})
+ set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
+endif (${HMI_JSON_API})
+if (${HMI_DBUS_API})
+ set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS})
+endif (${HMI_DBUS_API})
+
+SET (LIBRARIES
+ UsageStatistics
+ dl
+ ProtocolLibrary
+)
+
+IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
+ list(REMOVE_ITEM LIBRARIES dl)
+endif()
+
+add_library("AMEventEngine" ${EVENT_ENGINE})
+target_link_libraries("AMEventEngine" ${LIBRARIES})
+
+add_library("AMPolicyLibrary" ${POLICIES_MANAGER} )
+target_link_libraries("AMPolicyLibrary" ${LIBRARIES} AMEventEngine)
+
+add_library("AMHMICommandsLibrary" ${HMI_COMMANDS_SOURCES})
+target_link_libraries("AMHMICommandsLibrary" ${LIBRARIES} AMEventEngine)
+
+add_library("AMMobileCommandsLibrary" ${MOBILE_COMMANDS_SOURCES} )
+target_link_libraries("AMMobileCommandsLibrary" ${LIBRARIES} AMEventEngine)
+
+add_library("ApplicationManager" ${SOURCES})
+target_link_libraries("ApplicationManager" ${LIBRARIES} AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ AMEventEngine
+ AMPolicyLibrary)
+
+if(ENABLE_LOG)
+ target_link_libraries("ApplicationManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
new file mode 100644
index 0000000000..636b0aaa41
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -0,0 +1,549 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
+
+#include <string>
+#include <map>
+#include "utils/shared_ptr.h"
+#include "interfaces/MOBILE_API.h"
+#include "connection_handler/device.h"
+#include "application_manager/message.h"
+#include <set>
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace mobile_api = mobile_apis;
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+typedef int32_t ErrorCode;
+
+class UsageStatistics;
+
+enum APIVersion {
+ kUnknownAPI = -1,
+ kAPIV0 = 0,
+ kAPIV1 = 1,
+ kAPIV2 = 2,
+ kAPIV3 = 3
+};
+
+enum TLimitSource {
+ POLICY_TABLE = 0,
+ CONFIG_FILE
+};
+
+
+struct Version {
+ APIVersion min_supported_api_version;
+ APIVersion max_supported_api_version;
+
+ Version()
+ : min_supported_api_version(APIVersion::kUnknownAPI),
+ max_supported_api_version(APIVersion::kUnknownAPI) {
+ }
+};
+
+struct AppFile {
+ // need to use in std::map;
+ AppFile() {
+ }
+ AppFile(const std::string& name, bool persistent, bool download_complete,
+ mobile_apis::FileType::eType type)
+ : file_name(name),
+ is_persistent(persistent),
+ is_download_complete(download_complete),
+ file_type(type){
+ }
+ std::string file_name;
+ bool is_persistent;
+ bool is_download_complete;
+ mobile_apis::FileType::eType file_type;
+};
+typedef std::map<std::string, AppFile> AppFilesMap;
+class InitialApplicationData {
+ public:
+ virtual ~InitialApplicationData() {
+ }
+
+ virtual const smart_objects::SmartObject* app_types() const = 0;
+ virtual const smart_objects::SmartObject* vr_synonyms() const = 0;
+ virtual const smart_objects::SmartObject* mobile_app_id() const = 0;
+ virtual const smart_objects::SmartObject* tts_name() const = 0;
+ virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
+ virtual const mobile_api::Language::eType& language() const = 0;
+ virtual const mobile_api::Language::eType& ui_language() const = 0;
+ virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0;
+ virtual void set_vr_synonyms(
+ const smart_objects::SmartObject& vr_synonyms) = 0;
+ virtual void set_mobile_app_id(
+ const smart_objects::SmartObject& mobile_app_id) = 0;
+ virtual void set_tts_name(const smart_objects::SmartObject& tts_name) = 0;
+ virtual void set_ngn_media_screen_name(
+ const smart_objects::SmartObject& ngn_name) = 0;
+ virtual void set_language(const mobile_api::Language::eType& language) = 0;
+ virtual void set_ui_language(
+ const mobile_api::Language::eType& ui_language) = 0;
+};
+
+/*
+ * @brief Typedef for supported commands in application menu
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> CommandsMap;
+
+/*
+ * @brief Typedef for supported sub menu in application menu
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> SubMenuMap;
+
+/*
+ * @brief Typedef for interaction choice set
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> ChoiceSetMap;
+
+/*
+ * @brief Typedef for perform interaction choice set
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> PerformChoiceSetMap;
+
+/**
+ * @brief Defines id of SoftButton
+ */
+typedef std::set<uint32_t> SoftButtonID;
+
+class DynamicApplicationData {
+ public:
+ virtual ~DynamicApplicationData() {
+ }
+ virtual const smart_objects::SmartObject* help_prompt() const = 0;
+ virtual const smart_objects::SmartObject* timeout_prompt() const = 0;
+ virtual const smart_objects::SmartObject* vr_help_title() const = 0;
+ virtual const smart_objects::SmartObject* vr_help() const = 0;
+ virtual const mobile_api::TBTState::eType& tbt_state() const = 0;
+ virtual const smart_objects::SmartObject* show_command() const = 0;
+ virtual const smart_objects::SmartObject* tbt_show_command() const = 0;
+ virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const = 0;
+ virtual const std::set<uint32_t>& SubscribesIVI() const = 0;
+ virtual const smart_objects::SmartObject* keyboard_props() const = 0;
+ virtual const smart_objects::SmartObject* menu_title() const = 0;
+ virtual const smart_objects::SmartObject* menu_icon() const = 0;
+
+ virtual void set_help_prompt(
+ const smart_objects::SmartObject& help_prompt) = 0;
+ virtual void set_timeout_prompt(
+ const smart_objects::SmartObject& timeout_prompt) = 0;
+ virtual void set_vr_help_title(
+ const smart_objects::SmartObject& vr_help_title) = 0;
+ virtual void reset_vr_help_title() = 0;
+ virtual void set_vr_help(const smart_objects::SmartObject& vr_help) = 0;
+ virtual void reset_vr_help() = 0;
+ virtual void set_tbt_state(const mobile_api::TBTState::eType& tbt_state) = 0;
+ virtual void set_show_command(
+ const smart_objects::SmartObject& show_command) = 0;
+ virtual void set_tbt_show_command(
+ const smart_objects::SmartObject& tbt_show) = 0;
+ virtual void set_keyboard_props(
+ const smart_objects::SmartObject& keyboard_props) = 0;
+ virtual void set_menu_title(
+ const smart_objects::SmartObject& menu_title) = 0;
+ virtual void set_menu_icon(
+ const smart_objects::SmartObject& menu_icon) = 0;
+ /*
+ * @brief Adds a command to the in application menu
+ */
+ virtual void AddCommand(uint32_t cmd_id,
+ const smart_objects::SmartObject& command) = 0;
+
+ /*
+ * @brief Deletes all commands from the application
+ * menu with the specified command id
+ */
+ virtual void RemoveCommand(uint32_t cmd_id) = 0;
+
+ /*
+ * @brief Finds command with the specified command id
+ */
+ virtual smart_objects::SmartObject* FindCommand(uint32_t cmd_id) = 0;
+
+ /*
+ * @brief Adds a menu to the application
+ */
+ virtual void AddSubMenu(uint32_t menu_id,
+ const smart_objects::SmartObject& menu) = 0;
+
+ /*
+ * @brief Deletes menu from the application menu
+ */
+ virtual void RemoveSubMenu(uint32_t menu_id) = 0;
+
+ /*
+ * @brief Finds menu with the specified id
+ */
+ virtual smart_objects::SmartObject* FindSubMenu(
+ uint32_t menu_id) const = 0;
+
+ /*
+ * @brief Returns true if sub menu with such name already exist
+ */
+ virtual bool IsSubMenuNameAlreadyExist(const std::string& name) = 0;
+
+ /*
+ * @brief Adds a interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represent choice set
+ */
+ virtual void AddChoiceSet(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set) = 0;
+
+ /*
+ * @brief Deletes choice set from the application
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ virtual void RemoveChoiceSet(uint32_t choice_set_id) = 0;
+
+ /*
+ * @brief Finds choice set with the specified choice_set_id id
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ virtual smart_objects::SmartObject* FindChoiceSet(
+ uint32_t choice_set_id) = 0;
+
+ /*
+ * @brief Adds perform interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represents choice set
+ */
+ virtual void AddPerformInteractionChoiceSet(
+ uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set) = 0;
+
+ /*
+ * @brief Deletes entirely perform interaction choice set map
+ *
+ */
+ virtual void DeletePerformInteractionChoiceSetMap() = 0;
+
+ /*
+ * @brief Retrieves entirely ChoiceSet - VR commands map
+ *
+ * @return ChoiceSet map that is currently in use
+ */
+ virtual const PerformChoiceSetMap&
+ performinteraction_choice_set_map() const = 0;
+
+ /*
+ * @brief Retrieves choice set that is currently in use by perform
+ * interaction
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ *
+ * @return SmartObject that represents choice set
+ */
+ virtual smart_objects::SmartObject* FindPerformInteractionChoiceSet(
+ uint32_t choice_set_id) const = 0;
+
+ /*
+ * @brief Retrieve application commands
+ */
+ virtual const CommandsMap& commands_map() const = 0;
+
+ /*
+ * @brief Retrieve application sub menus
+ */
+ virtual const SubMenuMap& sub_menu_map() const = 0;
+
+ /*
+ * @brief Retrieve application choice set map
+ */
+ virtual const ChoiceSetMap& choice_set_map() const = 0;
+
+ /*
+ * @brief Sets perform interaction state
+ *
+ * @param active Current state of the perform interaction
+ */
+ virtual void set_perform_interaction_active(uint32_t active) = 0;
+
+ /*
+ * @brief Retrieves perform interaction state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ virtual uint32_t is_perform_interaction_active() const = 0;
+
+ /*
+ * @brief Sets the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @param choice Choice that was selected
+ */
+ virtual void set_perform_interaction_ui_corrid(uint32_t choice) = 0;
+
+ /*
+ * @brief Retrieve the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @return Choice that was selected in response to PerformInteraction
+ */
+ virtual uint32_t perform_interaction_ui_corrid() const = 0;
+
+ /*
+ * @brief Sets the mode for perform interaction: UI/VR/BOTH
+ *
+ * @param mode Mode that was selected (MENU; VR; BOTH)
+ */
+ virtual void set_perform_interaction_mode(int32_t mode) = 0;
+
+ /*
+ * @brief Retrieve the mode that was PerformInteraction sent in
+ *
+ * @return mode of PerformInteraction
+ */
+ virtual int32_t perform_interaction_mode() const = 0;
+
+ /*
+ * @brief Sets reset global properties state
+ *
+ * @param active Current state of the reset global properties
+ */
+ virtual void set_reset_global_properties_active(bool active) = 0;
+
+ /*
+ * @brief Retrieves reset global properties state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ virtual bool is_reset_global_properties_active() const = 0;
+};
+
+class Application : public virtual InitialApplicationData,
+ public virtual DynamicApplicationData {
+ public:
+ virtual ~Application() {
+ }
+
+ /**
+ * @brief Returns message belonging to the application
+ * that is currently executed (i.e. on HMI).
+ * @return smart_objects::SmartObject * Active message
+ */
+ virtual const smart_objects::SmartObject* active_message() const = 0;
+
+ /**
+ * @brief Change Hash value and return it
+ * @return next Hash value
+ */
+ virtual uint32_t nextHash() = 0;
+
+ /**
+ * @brief returns cuurent hash value
+ * @return current Hash value
+ */
+ virtual uint32_t curHash() const = 0;
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
+ virtual uint32_t UpdateHash() = 0;
+
+ virtual void CloseActiveMessage() = 0;
+ virtual bool IsFullscreen() const = 0;
+ virtual bool MakeFullscreen() = 0;
+ virtual bool IsAudible() const = 0;
+ virtual void MakeNotAudible() = 0;
+
+ virtual bool allowed_support_navigation() const = 0;
+ virtual void set_allowed_support_navigation(bool allow) = 0;
+ virtual bool hmi_supports_navi_video_streaming() const = 0;
+ virtual void set_hmi_supports_navi_video_streaming(bool supports) = 0;
+ virtual bool hmi_supports_navi_audio_streaming() const = 0;
+ virtual void set_hmi_supports_navi_audio_streaming(bool supports) = 0;
+
+ virtual bool app_allowed() const = 0;
+ virtual bool has_been_activated() const = 0;
+
+ virtual const Version& version() const = 0;
+ virtual void set_hmi_application_id(uint32_t hmi_app_id) = 0;
+ virtual uint32_t hmi_app_id() const = 0;
+ virtual uint32_t app_id() const = 0;
+ virtual const std::string& name() const = 0;
+ virtual const std::string folder_name() const = 0;
+ virtual bool is_media_application() const = 0;
+ virtual const mobile_api::HMILevel::eType& hmi_level() const = 0;
+ virtual const uint32_t put_file_in_none_count() const = 0;
+ virtual const uint32_t delete_file_in_none_count() const = 0;
+ virtual const uint32_t list_files_in_none_count() const = 0;
+ virtual const mobile_api::SystemContext::eType& system_context() const = 0;
+ virtual const mobile_api::AudioStreamingState::eType&
+ audio_streaming_state() const = 0;
+ virtual const std::string& app_icon_path() const = 0;
+ virtual connection_handler::DeviceHandle device() const = 0;
+ virtual void set_tts_speak_state(bool state_tts_speak) = 0;
+ virtual bool tts_speak_state() = 0;
+ /**
+ * @brief sets true if application has sent TTS GlobalProperties
+ * request with empty array help_prompt to HMI with level
+ * NONE BACKGROUND
+ * @param active contains state of sending TTS GlobalProperties
+ */
+ virtual void set_tts_properties_in_none(
+ bool active) = 0;
+ /**
+ * @brief returns true if application has sent TTS GlobalProperties
+ * otherwise return false
+ * @return flag tts_properties_in_none
+ */
+ virtual bool tts_properties_in_none() = 0;
+ /**
+ * @brief sets true if application has sent TTS GlobalProperties
+ * request with default array help_prompt to HMI with level
+ * FULL LIMITED
+ * @param active contains state of sending TTS GlobalProperties
+ */
+ virtual void set_tts_properties_in_full(
+ bool active) = 0;
+ /**
+ * @brief returns true if application has sent TTS GlobalProperties
+ * otherwise return false
+ * @return flag tts_properties_in_full
+ */
+ virtual bool tts_properties_in_full() = 0;
+ virtual void set_version(const Version& version) = 0;
+ virtual void set_name(const std::string& name) = 0;
+ virtual void set_is_media_application(bool is_media) = 0;
+ virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
+ virtual void increment_put_file_in_none_count() = 0;
+ virtual void increment_delete_file_in_none_count() = 0;
+ virtual void increment_list_files_in_none_count() = 0;
+ virtual void set_system_context(
+ const mobile_api::SystemContext::eType& system_context) = 0;
+ virtual void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) = 0;
+ virtual bool set_app_icon_path(const std::string& file_name) = 0;
+ virtual void set_app_allowed(const bool& allowed) = 0;
+ virtual void set_device(connection_handler::DeviceHandle device) = 0;
+ virtual uint32_t get_grammar_id() const = 0 ;
+ virtual void set_grammar_id(uint32_t value) = 0;
+
+ virtual void set_protocol_version(
+ const ProtocolVersion& protocol_version) = 0;
+ virtual ProtocolVersion protocol_version() const = 0;
+
+ virtual bool AddFile(AppFile& file) = 0;
+ virtual const AppFilesMap& getAppFiles() const = 0;
+
+ /**
+ * @brief Updates fields of existing file
+ * @param file_name File name, that need to update
+ * @param is_persistent Bollean describes is file persistent?
+ * @param is_download_complete Bollean describes is file downloaded fully on need to finish downloading?
+ * @return TRUE if file exist and updated sucsesfuly, othervise return false
+ */
+ virtual bool UpdateFile(AppFile& file) = 0;
+ virtual bool DeleteFile(const std::string& file_name) = 0;
+ virtual const AppFile* GetFile(const std::string& file_name) = 0;
+
+ virtual bool SubscribeToButton(mobile_apis::ButtonName::eType btn_name) = 0;
+ virtual bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name) = 0;
+ virtual bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name) = 0;
+
+ virtual bool SubscribeToIVI(uint32_t vehicle_info_type_) = 0;
+ virtual bool IsSubscribedToIVI(uint32_t vehicle_info_type_) = 0;
+ virtual bool UnsubscribeFromIVI(uint32_t vehicle_info_type_) = 0;
+
+ /**
+ * @brief Check, if limits for command number per time is exceeded
+ * @param cmd_id Unique command id from mobile API
+ * @param source Limits source, e.g. policy table, config file etc.
+ * @return true, if - excedeed, otherwise - false
+ */
+ virtual bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source) = 0;
+
+ /**
+ * Returns object for recording statistics
+ * @return object for recording statistics
+ */
+ virtual UsageStatistics& usage_report() = 0;
+
+ /**
+ * @brief Keeps id of softbuttons which is created in commands:
+ * Alert, Show, ScrollableMessage, ShowConstantTBT, AlertManeuver, UpdateTurnList
+ * @param cmd_id Unique command id from mobile API
+ * @param list of softbuttons were created by command.
+ */
+ virtual void SubscribeToSoftButtons(int32_t cmd_id,
+ const SoftButtonID& softbuttons_id) = 0;
+
+ /**
+ * @brief Determine the existence of softbutton
+ * @param Softbutton_id contains id of softbutton
+ * @return Returns true if application contains softbutton id otherwise returns false.
+ */
+ virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id) = 0;
+
+ /**
+ * @brief Removes list of softbuttons which is created in commands
+ * @param cmd_id Unique command id from mobile API
+ */
+ virtual void UnsubscribeFromSoftButtons(int32_t cmd_id) = 0;
+
+ protected:
+
+ // interfaces for NAVI retry sequence
+ virtual bool video_stream_retry_active() const = 0;
+ virtual void set_video_stream_retry_active(bool active) = 0;
+ virtual bool audio_stream_retry_active() const = 0;
+ virtual void set_audio_stream_retry_active(bool active) = 0;
+ virtual void OnVideoStreamRetry() = 0;
+ virtual void OnAudioStreamRetry() = 0;
+};
+
+typedef utils::SharedPtr<Application> ApplicationSharedPtr;
+typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
new file mode 100644
index 0000000000..556eee4349
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/application_data_impl.h
@@ -0,0 +1,328 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
+
+#include <string>
+#include "smart_objects/smart_object.h"
+#include "application_manager/application.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace mobile_api = mobile_apis;
+
+class InitialApplicationDataImpl : public virtual Application {
+ public:
+ InitialApplicationDataImpl();
+ ~InitialApplicationDataImpl();
+
+ const smart_objects::SmartObject* app_types() const;
+ const smart_objects::SmartObject* vr_synonyms() const;
+ const smart_objects::SmartObject* mobile_app_id() const;
+ const smart_objects::SmartObject* tts_name() const;
+ const smart_objects::SmartObject* ngn_media_screen_name() const;
+ const mobile_api::Language::eType& language() const;
+ const mobile_api::Language::eType& ui_language() const;
+ void set_app_types(const smart_objects::SmartObject& app_types);
+ void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms);
+ void set_mobile_app_id(const smart_objects::SmartObject& mobile_app_id);
+ void set_tts_name(const smart_objects::SmartObject& tts_name);
+ void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name);
+ void set_language(const mobile_api::Language::eType& language);
+ void set_ui_language(const mobile_api::Language::eType& ui_language);
+
+ protected:
+ smart_objects::SmartObject* app_types_;
+ smart_objects::SmartObject* vr_synonyms_;
+ smart_objects::SmartObject* mobile_app_id_;
+ smart_objects::SmartObject* tts_name_;
+ smart_objects::SmartObject* ngn_media_screen_name_;
+ mobile_api::Language::eType language_;
+ mobile_api::Language::eType ui_language_;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl);
+};
+
+class DynamicApplicationDataImpl : public virtual Application {
+ public:
+ DynamicApplicationDataImpl();
+ ~DynamicApplicationDataImpl();
+ const smart_objects::SmartObject* help_prompt() const;
+ const smart_objects::SmartObject* timeout_prompt() const;
+ const smart_objects::SmartObject* vr_help_title() const;
+ const smart_objects::SmartObject* vr_help() const;
+ const mobile_api::TBTState::eType& tbt_state() const;
+ const smart_objects::SmartObject* show_command() const;
+ const smart_objects::SmartObject* tbt_show_command() const;
+ const smart_objects::SmartObject* keyboard_props() const;
+ const smart_objects::SmartObject* menu_title() const;
+ const smart_objects::SmartObject* menu_icon() const;
+
+ void set_help_prompt(const smart_objects::SmartObject& help_prompt);
+ void set_timeout_prompt(const smart_objects::SmartObject& timeout_prompt);
+ void set_vr_help_title(const smart_objects::SmartObject& vr_help_title);
+ void reset_vr_help_title();
+ void set_vr_help(const smart_objects::SmartObject& vr_help);
+ void reset_vr_help();
+ void set_tbt_state(const mobile_api::TBTState::eType& tbt_state);
+ void set_show_command(const smart_objects::SmartObject& show_command);
+ void set_tbt_show_command(const smart_objects::SmartObject& tbt_show);
+ void set_keyboard_props(const smart_objects::SmartObject& keyboard_props);
+ void set_menu_title(const smart_objects::SmartObject& menu_title);
+ void set_menu_icon(const smart_objects::SmartObject& menu_icon);
+ /*
+ * @brief Adds a command to the in application menu
+ */
+ void AddCommand(uint32_t cmd_id,
+ const smart_objects::SmartObject& command);
+
+ /*
+ * @brief Deletes all commands from the application menu with the specified command id
+ */
+ void RemoveCommand(uint32_t cmd_id);
+
+ /*
+ * @brief Finds command with the specified command id
+ */
+ smart_objects::SmartObject* FindCommand(uint32_t cmd_id);
+
+ /*
+ * @brief Adds a menu to the application
+ */
+ void AddSubMenu(uint32_t menu_id, const smart_objects::SmartObject& menu);
+
+ /*
+ * @brief Deletes menu from the application menu
+ */
+ void RemoveSubMenu(uint32_t menu_id);
+
+ /*
+ * @brief Finds menu with the specified id
+ */
+ smart_objects::SmartObject* FindSubMenu(uint32_t menu_id) const;
+
+ /*
+ * @brief Returns true if sub menu with such name already exist
+ */
+ bool IsSubMenuNameAlreadyExist(const std::string& name);
+
+ /*
+ * @brief Adds a interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represent choice set
+ */
+ void AddChoiceSet(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set);
+
+ /*
+ * @brief Deletes choice set from the application
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ void RemoveChoiceSet(uint32_t choice_set_id);
+
+ /*
+ * @brief Finds choice set with the specified choice_set_id id
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ smart_objects::SmartObject* FindChoiceSet(uint32_t choice_set_id);
+
+ /*
+ * @brief Adds perform interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represents choice set
+ */
+ void AddPerformInteractionChoiceSet(
+ uint32_t choice_set_id, const smart_objects::SmartObject& choice_set);
+
+ /*
+ * @brief Deletes entirely perform interaction choice set map
+ *
+ */
+ void DeletePerformInteractionChoiceSetMap();
+
+ /*
+ * @brief Retrieves entirely ChoiceSet - VR commands map
+ *
+ * @return ChoiceSet map that is currently in use
+ */
+ inline const PerformChoiceSetMap& performinteraction_choice_set_map() const;
+
+ /*
+ * @brief Retrieves choice set that is currently in use by perform
+ * interaction
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ *
+ * @return SmartObject that represents choice set
+ */
+ smart_objects::SmartObject* FindPerformInteractionChoiceSet(
+ uint32_t choice_set_id) const;
+
+ /*
+ * @brief Retrieve application commands
+ */
+ inline const CommandsMap& commands_map() const;
+
+ /*
+ * @brief Retrieve application sub menus
+ */
+ inline const SubMenuMap& sub_menu_map() const;
+
+ /*
+ * @brief Retrieve application choice set map
+ */
+ inline const ChoiceSetMap& choice_set_map() const;
+
+ /*
+ * @brief Sets perform interaction state
+ *
+ * @param active Current state of the perform interaction
+ */
+ void set_perform_interaction_active(uint32_t active);
+
+ /*
+ * @brief Retrieves perform interaction state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ inline uint32_t is_perform_interaction_active() const;
+
+ /*
+ * @brief Sets the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @param choice Choice that was selected
+ */
+ void set_perform_interaction_ui_corrid(uint32_t corr_id);
+
+ /*
+ * @brief Retrieve the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @return Choice that was selected in response to PerformInteraction
+ */
+ inline uint32_t perform_interaction_ui_corrid() const;
+ /*
+ * @brief Sets the mode for perform interaction: UI/VR/BOTH
+ *
+ * @param mode Mode that was selected (MENU; VR; BOTH)
+ */
+ void set_perform_interaction_mode(int32_t mode);
+
+ /*
+ * @brief Retrieve the mode that was PerformInteraction sent in
+ *
+ * @return mode of PerformInteraction
+ */
+ inline int32_t perform_interaction_mode() const;
+
+ /*
+ * @brief Sets reset global properties state
+ *
+ * @param active Current state of the reset global properties
+ */
+ void set_reset_global_properties_active(bool active);
+
+ /*
+ * @brief Retrieves reset global properties state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ inline bool is_reset_global_properties_active() const;
+
+ protected:
+ smart_objects::SmartObject* help_prompt_;
+ smart_objects::SmartObject* timeout_prompt_;
+ smart_objects::SmartObject* vr_help_title_;
+ smart_objects::SmartObject* vr_help_;
+ mobile_api::TBTState::eType tbt_state_;
+ smart_objects::SmartObject* show_command_;
+ smart_objects::SmartObject* keyboard_props_;
+ smart_objects::SmartObject* menu_title_;
+ smart_objects::SmartObject* menu_icon_;
+ smart_objects::SmartObject* tbt_show_command_;
+
+
+ CommandsMap commands_;
+ SubMenuMap sub_menu_;
+ ChoiceSetMap choice_set_map_;
+ PerformChoiceSetMap performinteraction_choice_set_map_;
+ uint32_t is_perform_interaction_active_;
+ uint32_t perform_interaction_ui_corrid_;
+ bool is_reset_global_properties_active_;
+ int32_t perform_interaction_mode_;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
+};
+
+const CommandsMap& DynamicApplicationDataImpl::commands_map() const {
+ return commands_;
+}
+
+const SubMenuMap& DynamicApplicationDataImpl::sub_menu_map() const {
+ return sub_menu_;
+}
+
+const ChoiceSetMap& DynamicApplicationDataImpl::choice_set_map() const {
+ return choice_set_map_;
+}
+
+uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
+ return is_perform_interaction_active_;
+}
+
+uint32_t DynamicApplicationDataImpl::perform_interaction_ui_corrid() const {
+ return perform_interaction_ui_corrid_;
+}
+
+bool DynamicApplicationDataImpl::is_reset_global_properties_active() const {
+ return is_reset_global_properties_active_;
+}
+
+const PerformChoiceSetMap&
+DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
+ return performinteraction_choice_set_map_;
+}
+
+inline int32_t DynamicApplicationDataImpl::perform_interaction_mode() const {
+ return perform_interaction_mode_;
+}
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
new file mode 100644
index 0000000000..0a056df92b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -0,0 +1,275 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
+
+#include <map>
+#include <set>
+#include <vector>
+#include <utility>
+
+#include "utils/date_time.h"
+#include "application_manager/application_data_impl.h"
+#include "application_manager/usage_statistics.h"
+#include "connection_handler/device.h"
+#include "utils/timer_thread.h"
+#include "utils/lock.h"
+
+namespace usage_statistics {
+class StatisticsManager;
+} // namespace usage_statistics
+
+namespace application_manager {
+namespace mobile_api = mobile_apis;
+
+class ApplicationImpl : public virtual InitialApplicationDataImpl,
+ public virtual DynamicApplicationDataImpl {
+ public:
+ ApplicationImpl(uint32_t application_id,
+ const std::string& mobile_app_id,
+ const std::string& app_name,
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager);
+
+ ~ApplicationImpl();
+
+ /**
+ * @brief Returns message belonging to the application
+ * that is currently executed (i.e. on HMI).
+ * @return smart_objects::SmartObject * Active message
+ */
+ const smart_objects::SmartObject* active_message() const;
+ void CloseActiveMessage();
+ bool IsFullscreen() const;
+ bool MakeFullscreen();
+ bool IsAudible() const;
+ void MakeNotAudible();
+
+ // navi
+ bool allowed_support_navigation() const;
+ void set_allowed_support_navigation(bool allow);
+ bool hmi_supports_navi_video_streaming() const;
+ void set_hmi_supports_navi_video_streaming(bool supports);
+ bool hmi_supports_navi_audio_streaming() const;
+ void set_hmi_supports_navi_audio_streaming(bool supports);
+
+ inline bool app_allowed() const;
+ bool has_been_activated() const;
+
+ const Version& version() const;
+ void set_hmi_application_id(uint32_t hmi_app_id);
+ inline uint32_t hmi_app_id() const;
+ inline uint32_t app_id() const;
+ const std::string& name() const;
+ const std::string folder_name() const;
+ bool is_media_application() const;
+ const mobile_api::HMILevel::eType& hmi_level() const;
+ const uint32_t put_file_in_none_count() const;
+ const uint32_t delete_file_in_none_count() const;
+ const uint32_t list_files_in_none_count() const;
+ const mobile_api::SystemContext::eType& system_context() const;
+ inline const mobile_api::AudioStreamingState::eType&
+ audio_streaming_state() const;
+ const std::string& app_icon_path() const;
+ connection_handler::DeviceHandle device() const;
+ void set_tts_speak_state(bool state_tts_speak);
+ bool tts_speak_state();
+ void set_tts_properties_in_none(bool active);
+ bool tts_properties_in_none();
+ void set_tts_properties_in_full(bool active);
+ bool tts_properties_in_full();
+ void set_version(const Version& ver);
+ void set_name(const std::string& name);
+ void set_is_media_application(bool is_media);
+ void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level);
+ void increment_put_file_in_none_count();
+ void increment_delete_file_in_none_count();
+ void increment_list_files_in_none_count();
+ void set_system_context(
+ const mobile_api::SystemContext::eType& system_context);
+ void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state);
+ bool set_app_icon_path(const std::string& path);
+ void set_app_allowed(const bool& allowed);
+ void set_device(connection_handler::DeviceHandle device);
+ virtual uint32_t get_grammar_id() const;
+ virtual void set_grammar_id(uint32_t value);
+
+ virtual void set_protocol_version(const ProtocolVersion& protocol_version);
+ virtual ProtocolVersion protocol_version() const;
+
+ bool AddFile(AppFile& file);
+ bool UpdateFile(AppFile& file);
+
+ bool DeleteFile(const std::string& file_name);
+ virtual const AppFilesMap& getAppFiles() const;
+
+ virtual const AppFile* GetFile(const std::string& file_name);
+
+ bool SubscribeToButton(mobile_apis::ButtonName::eType btn_name);
+ bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name);
+ bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name);
+
+ bool SubscribeToIVI(uint32_t vehicle_info_type_);
+ bool IsSubscribedToIVI(uint32_t vehicle_info_type_);
+ bool UnsubscribeFromIVI(uint32_t vehicle_info_type_);
+
+ virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const;
+ virtual const std::set<uint32_t>& SubscribesIVI() const;
+
+ virtual uint32_t nextHash();
+ virtual uint32_t curHash() const;
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
+ virtual uint32_t UpdateHash();
+
+ UsageStatistics& usage_report();
+
+ bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source);
+ virtual void SubscribeToSoftButtons(int32_t cmd_id,
+ const SoftButtonID& softbuttons_id);
+ virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id);
+
+ virtual void UnsubscribeFromSoftButtons(int32_t cmd_id);
+
+ protected:
+
+ /**
+ * @brief Clean up application folder. Persistent files will stay
+ */
+ void CleanupFiles();
+
+ /**
+ * @brief Load persistent files from application folder.
+ */
+ void LoadPersistentFiles();
+
+ private:
+
+ // interfaces for NAVI retry sequence
+ bool video_stream_retry_active() const;
+ void set_video_stream_retry_active(bool active);
+ bool audio_stream_retry_active() const;
+ void set_audio_stream_retry_active(bool active);
+ void OnVideoStreamRetry();
+ void OnAudioStreamRetry();
+
+ uint32_t hash_val_;
+ uint32_t grammar_id_;
+
+
+ Version version_;
+ std::string app_name_;
+ uint32_t hmi_app_id_;
+ uint32_t app_id_;
+ smart_objects::SmartObject* active_message_;
+ bool is_media_;
+ bool allowed_support_navigation_;
+ bool hmi_supports_navi_video_streaming_;
+ bool hmi_supports_navi_audio_streaming_;
+ bool is_app_allowed_;
+ bool has_been_activated_;
+ bool tts_speak_state_;
+ bool tts_properties_in_none_;
+ bool tts_properties_in_full_;
+ mobile_api::HMILevel::eType hmi_level_;
+ uint32_t put_file_in_none_count_;
+ uint32_t delete_file_in_none_count_;
+ uint32_t list_files_in_none_count_;
+ mobile_api::SystemContext::eType system_context_;
+ mobile_api::AudioStreamingState::eType audio_streaming_state_;
+ std::string app_icon_path_;
+ connection_handler::DeviceHandle device_;
+
+ AppFilesMap app_files_;
+ std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
+ std::set<uint32_t> subscribed_vehicle_info_;
+ UsageStatistics usage_report_;
+ ProtocolVersion protocol_version_;
+
+ // NAVI retry stream
+ volatile bool is_video_stream_retry_active_;
+ volatile bool is_audio_stream_retry_active_;
+ uint32_t video_stream_retry_number_;
+ uint32_t audio_stream_retry_number_;
+ utils::SharedPtr<timer::TimerThread<ApplicationImpl>> video_stream_retry_timer_;
+ utils::SharedPtr<timer::TimerThread<ApplicationImpl>> audio_stream_retry_timer_;
+
+
+ /**
+ * @brief Defines number per time in seconds limits
+ */
+ typedef std::pair<TimevalStruct, uint32_t> TimeToNumberLimit;
+
+ /**
+ * @brief Defines specific command number per time in seconds limits
+ */
+ typedef std::map<mobile_apis::FunctionID::eType, TimeToNumberLimit>
+ CommandNumberTimeLimit;
+
+ /**
+ * @brief Defines id of SoftButton which is related from name of command
+ */
+ typedef std::map<int32_t, SoftButtonID>
+ CommandSoftButtonID;
+ CommandNumberTimeLimit cmd_number_to_time_limits_;
+ CommandSoftButtonID cmd_softbuttonid_;
+ // Lock for command soft button id
+ sync_primitives::Lock cmd_softbuttonid_lock_;
+ DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
+};
+
+uint32_t ApplicationImpl::hmi_app_id() const {
+ return hmi_app_id_;
+}
+
+uint32_t ApplicationImpl::app_id() const {
+ return app_id_;
+}
+
+const mobile_api::AudioStreamingState::eType&
+ApplicationImpl::audio_streaming_state() const {
+ return audio_streaming_state_;
+}
+
+bool ApplicationImpl::app_allowed() const {
+ return is_app_allowed_;
+}
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/application_manager.h b/src/components/application_manager/include/application_manager/application_manager.h
new file mode 100644
index 0000000000..6ca85a5d3f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/application_manager.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+
+// Other compomnents class declaration
+namespace hmi_message_handler {
+ class HMIMessageHandler;
+}
+namespace protocol_handler {
+ class ProtocolHandler;
+}
+namespace connection_handler {
+ class ConnectionHandler;
+}
+
+namespace application_manager {
+
+class Application;
+class HMIMatrix;
+
+class ApplicationManager {
+ public:
+ virtual ~ApplicationManager() {
+ }
+
+ /**
+ * Inits application manager
+ */
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Stop work.
+ *
+ * @return TRUE on success otherwise FALSE.
+ **/
+ virtual bool Stop() = 0;
+
+ virtual void set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) = 0;
+ virtual void set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) = 0;
+ virtual void set_connection_handler(
+ connection_handler::ConnectionHandler* handler) = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
new file mode 100644
index 0000000000..b29bd10252
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -0,0 +1,820 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+#include <set>
+#include "application_manager/hmi_command_factory.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/message.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/resume_ctrl.h"
+#include "application_manager/vehicle_info_data.h"
+#include "protocol_handler/protocol_observer.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_sender.h"
+
+#include "media_manager/media_manager_impl.h"
+
+#include "connection_handler/connection_handler_observer.h"
+#include "connection_handler/device.h"
+
+#include "formatters/CSmartFactory.hpp"
+
+#include "interfaces/HMI_API.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+
+#include "interfaces/v4_protocol_v1_2_no_extra.h"
+#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
+#ifdef TIME_TESTER
+#include "time_metric_observer.h"
+#endif // TIME_TESTER
+
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "utils/message_queue.h"
+#include "utils/prioritized_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/lock.h"
+#include "utils/singleton.h"
+
+namespace policy {
+class PolicyManager;
+}
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+namespace threads {
+class Thread;
+}
+class CommandNotificationImpl;
+
+namespace application_manager {
+namespace mobile_api = mobile_apis;
+
+class ApplicationManagerImpl;
+
+enum VRTTSSessionChanging {
+ kVRSessionChanging = 0,
+ kTTSSessionChanging = 1
+};
+
+struct CommandParametersPermissions;
+
+namespace impl {
+using namespace threads;
+
+/*
+ * These dummy classes are here to locally impose strong typing on different
+ * kinds of messages
+ * Currently there is no type difference between incoming and outgoing messages
+ * And due to ApplicationManagerImpl works as message router it has to distinguish
+ * messages passed from it's different connection points
+ * TODO(ik): replace these with globally defined message types
+ * when we have them.
+ */
+struct MessageFromMobile: public utils::SharedPtr<Message> {
+ explicit MessageFromMobile(const utils::SharedPtr<Message>& message)
+ : utils::SharedPtr<Message>(message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+struct MessageToMobile: public utils::SharedPtr<Message> {
+ explicit MessageToMobile(const utils::SharedPtr<Message>& message,
+ bool final_message)
+ : utils::SharedPtr<Message>(message),
+ is_final(final_message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+ // Signals if connection to mobile must be closed after sending this message
+ bool is_final;
+};
+
+struct MessageFromHmi: public utils::SharedPtr<Message> {
+ explicit MessageFromHmi(const utils::SharedPtr<Message>& message)
+ : utils::SharedPtr<Message>(message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+struct MessageToHmi: public utils::SharedPtr<Message> {
+ explicit MessageToHmi(const utils::SharedPtr<Message>& message)
+ : utils::SharedPtr<Message>(message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+// Short type names for prioritized message queues
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> > FromMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> > ToMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> > FromHmiQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> > ToHmiQueue;
+}
+typedef std::vector<std::string> RPCParams;
+
+class ApplicationManagerImpl : public ApplicationManager,
+ public hmi_message_handler::HMIMessageObserver,
+ public protocol_handler::ProtocolObserver,
+ public connection_handler::ConnectionHandlerObserver,
+ public impl::FromMobileQueue::Handler, public impl::ToMobileQueue::Handler,
+ public impl::FromHmiQueue::Handler, public impl::ToHmiQueue::Handler,
+ public utils::Singleton<ApplicationManagerImpl> {
+
+ friend class ResumeCtrl;
+ friend class CommandImpl;
+
+ public:
+ ~ApplicationManagerImpl();
+
+ /**
+ * Inits application manager
+ */
+ virtual bool Init();
+
+ /**
+ * @brief Stop work.
+ *
+ * @return TRUE on success otherwise FALSE.
+ **/
+ virtual bool Stop();
+
+ /////////////////////////////////////////////////////
+
+ ApplicationSharedPtr application(uint32_t app_id) const;
+ ApplicationSharedPtr application_by_policy_id(
+ const std::string& policy_app_id) const;
+ ApplicationSharedPtr active_application() const;
+ std::vector<ApplicationSharedPtr> applications_by_button(uint32_t button);
+ std::vector<ApplicationSharedPtr> applications_by_ivi(uint32_t vehicle_info);
+ std::vector<ApplicationSharedPtr> applications_with_navi();
+
+ /**
+ * @brief Notifies all components interested in Vehicle Data update
+ * i.e. new value of odometer etc and returns list of applications
+ * subscribed for event.
+ * @param vehicle_info Enum value of type of vehicle data
+ * @param new value (for integer values currently) of vehicle data
+ */
+ std::vector<utils::SharedPtr<Application>> IviInfoUpdated(
+ VehicleDataType vehicle_info, int value);
+
+ /////////////////////////////////////////////////////
+
+ HMICapabilities& hmi_capabilities();
+
+#ifdef TIME_TESTER
+ /**
+ * @brief Setup observer for time metric.
+ *
+ * @param observer - pointer to observer
+ */
+ void SetTimeMetricObserver(AMMetricObserver* observer);
+#endif // TIME_TESTER
+
+ ApplicationSharedPtr RegisterApplication(
+ const utils::SharedPtr<smart_objects::SmartObject>& request_for_registration);
+ /*
+ * @brief Closes application by id
+ *
+ * @param app_id Application id
+ * @param reason reason of unregistering application
+ * @param is_resuming describes - is this unregister
+ * is normal or need to be resumed\
+ * @param is_unexpected_disconnect
+ * Indicates if connection was unexpectedly lost(TM layer, HB)
+ */
+ void UnregisterApplication(const uint32_t& app_id,
+ mobile_apis::Result::eType reason,
+ bool is_resuming = false,
+ bool is_unexpected_disconnect = false);
+
+ /**
+ * @brief Unregister application revoked by Policy
+ * @param app_id Application id
+ * @param reason Reason of unregistering application
+ */
+ void UnregisterRevokedApplication(const uint32_t& app_id,
+ mobile_apis::Result::eType reason);
+
+ /*
+ * @brief Sets unregister reason for closing all registered applications
+ * duringHU switching off
+ *
+ * @param reason Describes the reason for HU switching off
+ */
+ void SetUnregisterAllApplicationsReason(
+ mobile_api::AppInterfaceUnregisteredReason::eType reason);
+
+ /*
+ * @brief Called on Master_reset or Factory_defaults
+ * when User chooses to reset HU.
+ * Resets Policy Table if applicable.
+ */
+ void HeadUnitReset(
+ mobile_api::AppInterfaceUnregisteredReason::eType reason);
+
+ /*
+ * @brief Called by HMI on SUSPEND.
+ * SDL must save all persistence data(Resume, Policy)
+ */
+ void HeadUnitSuspend();
+
+ /*
+ * @brief Closes all registered applications
+ */
+ void UnregisterAllApplications(bool generated_by_hmi = false);
+
+ bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
+ bool LoadAppDataToHMI(ApplicationSharedPtr app);
+ bool ActivateApplication(ApplicationSharedPtr app);
+ /**
+ * @brief Put application in Limited HMI Level if possible,
+ * otherwise put applicatuion other HMI level.
+ * do not send any notifications to mobile
+ * @param app, application, that need to be puted in Limeted
+ * @return seted HMI Level
+ */
+ mobile_api::HMILevel::eType PutApplicationInLimited(ApplicationSharedPtr app);
+
+ /**
+ * @brief Put application in FULL HMI Level if possible,
+ * otherwise put applicatuion other HMI level.
+ * do not send any notifications to mobile
+ * @param app, application, that need to be puted in FULL
+ * @return seted HMI Level
+ */
+ mobile_api::HMILevel::eType PutApplicationInFull(ApplicationSharedPtr app);
+
+ void ConnectToDevice(uint32_t id);
+ void OnHMIStartedCooperation();
+
+ /*
+ * @brief Returns unique correlation ID for HMI request
+ *
+ * @return Unique correlation ID
+ */
+ uint32_t GetNextHMICorrelationID();
+
+ /* @brief Starts audio passthru process
+ *
+ * @return true on success, false if passthru is already in process
+ */
+ bool begin_audio_pass_thru();
+
+ /*
+ * @brief Finishes already started audio passthru process
+ *
+ * @return true on success, false if passthru is not active
+ */
+ bool end_audio_pass_thru();
+
+ /*
+ * @brief Retrieves driver distraction state
+ *
+ * @return Current state of the distraction state
+ */
+ inline bool driver_distraction() const;
+
+ /*
+ * @brief Sets state for driver distraction
+ *
+ * @param state New state to be set
+ */
+ void set_driver_distraction(bool is_distracting);
+
+ /*
+ * @brief Retrieves if VR session has started
+ *
+ * @return Current VR session state (started, stopped)
+ */
+ inline bool vr_session_started() const;
+
+ /*
+ * @brief Sets VR session state
+ *
+ * @param state Current HMI VR session state
+ */
+ void set_vr_session_started(const bool& state);
+
+ /*
+ * @brief Retrieves SDL access to all mobile apps
+ *
+ * @return Currently active state of the access
+ */
+ inline bool all_apps_allowed() const;
+
+ /*
+ * @brief Sets SDL access to all mobile apps
+ *
+ * @param allowed SDL access to all mobile apps
+ */
+ void set_all_apps_allowed(const bool& allowed);
+
+ /*
+ * @brief Starts audio pass thru thread
+ *
+ * @param session_key Session key of connection for Mobile side
+ * @param correlation_id Correlation id for response for Mobile side
+ * @param max_duration Max duration of audio recording in milliseconds
+ * @param sampling_rate Value for rate(8, 16, 22, 44 kHz)
+ * @param bits_per_sample The quality the audio is recorded.
+ * @param audio_type Type of audio data
+ */
+ void StartAudioPassThruThread(int32_t session_key, int32_t correlation_id,
+ int32_t max_duration, int32_t sampling_rate,
+ int32_t bits_per_sample, int32_t audio_type);
+
+ /*
+ * @brief Terminates audio pass thru thread
+ * @param application_key Id of application for which
+ * audio pass thru should be stopped
+ */
+ void StopAudioPassThru(int32_t application_key);
+
+ void SendAudioPassThroughNotification(uint32_t session_key,
+ std::vector<uint8_t> binaryData);
+
+ std::string GetDeviceName(connection_handler::DeviceHandle handle);
+
+ /////////////////////////////////////////////////////
+
+ void set_hmi_message_handler(hmi_message_handler::HMIMessageHandler* handler);
+ void set_connection_handler(connection_handler::ConnectionHandler* handler);
+ void set_protocol_handler(protocol_handler::ProtocolHandler* handler);
+
+ ///////////////////////////////////////////////////////
+
+ void StartDevicesDiscovery();
+
+ // Put message to the queue to be sent to mobile.
+ // if |final_message| parameter is set connection to mobile will be closed
+ // after processing this message
+ void SendMessageToMobile(
+ const utils::SharedPtr<smart_objects::SmartObject>& message,
+ bool final_message = false);
+ bool ManageMobileCommand(
+ const utils::SharedPtr<smart_objects::SmartObject>& message);
+ void SendMessageToHMI(
+ const utils::SharedPtr<smart_objects::SmartObject>& message);
+ bool ManageHMICommand(
+ const utils::SharedPtr<smart_objects::SmartObject>& message);
+
+ /////////////////////////////////////////////////////////
+ /*
+ * @brief Overriden ProtocolObserver method
+ */
+ virtual void OnMessageReceived(
+ const RawMessagePtr message);
+
+ /*
+ * @brief Overriden ProtocolObserver method
+ */
+ virtual void OnMobileMessageSent(
+ const RawMessagePtr message);
+
+ void OnMessageReceived(hmi_message_handler::MessageSharedPointer message);
+ void OnErrorSending(hmi_message_handler::MessageSharedPointer message);
+
+ void OnDeviceListUpdated(const connection_handler::DeviceMap& device_list);
+ //TODO (EZamakhov): fix all indentations in this file
+ virtual void OnFindNewApplicationsRequest();
+ void RemoveDevice(const connection_handler::DeviceHandle& device_handle);
+ bool OnServiceStartedCallback(
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key, const protocol_handler::ServiceType& type);
+ void OnServiceEndedCallback(const int32_t& session_key,
+ const protocol_handler::ServiceType& type);
+
+ /**
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ void addNotification(const CommandSharedPtr ptr);
+
+ /**
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ void removeNotification(const commands::Command* notification);
+
+ /**
+ * @ Updates request timeout
+ *
+ * @param connection_key Connection key of application
+ * @param mobile_correlation_id Correlation ID of the mobile request
+ * @param new_timeout_value New timeout to be set
+ */
+ void updateRequestTimeout(uint32_t connection_key,
+ uint32_t mobile_correlation_id,
+ uint32_t new_timeout_value);
+
+ /*
+ * @brief Retrieves application id associated whith correlation id
+ *
+ * @param correlation_id Correlation ID of the HMI request
+ *
+ * @return application id associated whith correlation id
+ */
+ const uint32_t application_id(const int32_t correlation_id);
+
+ /*
+ * @brief Sets application id correlation id
+ *
+ * @param correlation_id Correlation ID of the HMI request
+ * @param app_id Application ID
+ */
+ void set_application_id(const int32_t correlation_id, const uint32_t app_id);
+
+ /*
+ * @brief Change AudioStreamingState for all application according to
+ * system audio-mixing capabilities (NOT_AUDIBLE/ATTENUATED) and
+ * send notification for this changes
+ * @param If changing_state == kVRSessionChanging function is used by
+ * on_vr_started_notification, if changing_state == kTTSSessionChanging
+ * function is used by on_tts_started_notification
+ */
+ void Mute(VRTTSSessionChanging changing_state);
+
+ /*
+ * @brief Change AudioStreamingState for all application to AUDIBLE and
+ * send notification for this changes
+ * @param If changing_state == kVRSessionChanging function is used by
+ * on_vr_stopped_notification, if changing_state == kTTSSessionChanging
+ * function is used by on_tts_stopped_notification
+ */
+ void Unmute(VRTTSSessionChanging changing_state);
+
+ /*
+ * @brief Checks HMI level and returns true if audio streaming is allowed
+ */
+ bool IsAudioStreamingAllowed(uint32_t connection_key) const;
+
+ /*
+ * @brief Checks HMI level and returns true if video streaming is allowed
+ */
+ bool IsVideoStreamingAllowed(uint32_t connection_key) const;
+
+ /**
+ * Getter for resume_controller
+ * @return Resume Controller
+ */
+ ResumeCtrl& resume_controller() {
+ return resume_ctrl_;
+ }
+
+ /**
+ * Generate grammar ID
+ *
+ * @return New grammar ID
+ */
+ uint32_t GenerateGrammarID();
+
+ /**
+ * Generate new HMI application ID
+ *
+ * @return New HMI application ID
+ */
+ uint32_t GenerateNewHMIAppID();
+
+ /**
+ * @brief Parse smartObject and replace mobile app Id by HMI app ID
+ *
+ * @param message Smartobject to be parsed
+ */
+ void ReplaceMobileByHMIAppId(
+ smart_objects::SmartObject& message);
+
+ /**
+ * @brief Parse smartObject and replace HMI app ID by mobile app Id
+ *
+ * @param message Smartobject to be parsed
+ */
+ void ReplaceHMIByMobileAppId(
+ smart_objects::SmartObject& message);
+
+ /*
+ * @brief Save binary data to specified directory
+ *
+ * @param binary data
+ * @param path for saving data
+ * @param file_name File name
+ * @param offset for saving data to existing file with offset.
+ * If offset is 0 - create new file ( overrite existing )
+ *
+ *
+ * @return SUCCESS if file was saved, other code otherwise
+ */
+ mobile_apis::Result::eType SaveBinary(
+ const std::vector<uint8_t>& binary_data,
+ const std::string& file_path,
+ const std::string& file_name,
+ const int64_t offset);
+
+ /**
+ * @brief Get available app space
+ * @param name of the app folder(make + mobile app id)
+ * @return free app space.
+ */
+ uint32_t GetAvailableSpaceForApp(const std::string& folder_name);
+
+ /*
+ * @brief returns true if HMI is cooperating
+ */
+ bool IsHMICooperating() const;
+
+ /**
+ * @brief Method used to send default app tts globalProperties
+ * in case they were not provided from mobile side after defined time
+ */
+ void OnTimerSendTTSGlobalProperties();
+
+ /**
+ * @brief method adds application
+ * to tts_global_properties_app_list_
+ * @param app_id contains application which will
+ * send TTS global properties after timeout
+ */
+ void AddAppToTTSGlobalPropertiesList(const uint32_t app_id);
+
+ /**
+ * @brief method removes application
+ * from tts_global_properties_app_list_
+ * @param app_id contains application which will
+ * send TTS global properties after timeout
+ */
+ void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id);
+
+ /**
+ * Function used only by HMI request/response/notification base classes
+ * to change HMI app id to Mobile app id and vice versa.
+ * Dot use it inside Core
+ */
+ ApplicationSharedPtr application_by_hmi_app(uint32_t hmi_app_id) const;
+
+ // TODO(AOleynik): Temporary added, to fix build. Should be reworked.
+ connection_handler::ConnectionHandler* connection_handler();
+
+ /**
+ * @brief Checks, if given RPC is allowed at current HMI level for specific
+ * application in policy table
+ * @param policy_app_id Application id
+ * @param hmi_level Current HMI level of application
+ * @param function_id FunctionID of RPC
+ * @param params_permissions Permissions for RPC parameters (e.g.
+ * SubscribeVehicleData) defined in policy table
+ * @return SUCCESS, if allowed, otherwise result code of check
+ */
+ mobile_apis::Result::eType CheckPolicyPermissions(
+ const std::string& policy_app_id,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::FunctionID::eType function_id,
+ const RPCParams& rpc_params,
+ CommandParametersPermissions* params_permissions = NULL);
+
+ // typedef for Applications list
+ typedef const std::set<ApplicationSharedPtr> TAppList;
+
+ // typedef for Applications list iterator
+ typedef std::set<ApplicationSharedPtr>::iterator TAppListIt;
+
+ // typedef for Applications list const iterator
+ typedef std::set<ApplicationSharedPtr>::const_iterator TAppListConstIt;
+
+ /**
+ * Class for thread-safe access to applications list
+ */
+ class ApplicationListAccessor {
+ public:
+
+ /**
+ * @brief ApplicationListAccessor class constructor
+ */
+ ApplicationListAccessor() {
+ ApplicationManagerImpl::instance()->applications_list_lock_.Acquire();
+ }
+
+ /**
+ * @brief ApplicationListAccessor class destructor
+ */
+ ~ApplicationListAccessor() {
+ ApplicationManagerImpl::instance()->applications_list_lock_.Release();
+ }
+
+ // TODO(VS): Now we have return application list by value, because we have
+ // situations, when our process is killed without Stop method called.
+ // This problem must be discussed and fixed.
+ /**
+ * @brief thread-safe getter for applications
+ * @return applications list
+ */
+ TAppList applications() {
+ return ApplicationManagerImpl::instance()->application_list_;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ApplicationListAccessor);
+ };
+
+ friend class ApplicationListAccessor;
+
+ private:
+ ApplicationManagerImpl();
+
+ hmi_apis::HMI_API& hmi_so_factory();
+ mobile_apis::MOBILE_API& mobile_so_factory();
+
+ bool ConvertMessageToSO(const Message& message,
+ smart_objects::SmartObject& output);
+ bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
+ Message& output);
+ utils::SharedPtr<Message> ConvertRawMsgToMessage(
+ const RawMessagePtr message);
+
+ void ProcessMessageFromMobile(const utils::SharedPtr<Message>& message);
+ void ProcessMessageFromHMI(const utils::SharedPtr<Message>& message);
+
+ // threads::MessageLoopThread<*>::Handler implementations
+ /*
+ * @brief Handles for threads pumping different types
+ * of messages. Beware, each is called on different thread!
+ */
+ // CALLED ON messages_from_mobile_ thread!
+ virtual void Handle(const impl::MessageFromMobile message) OVERRIDE;
+
+ // CALLED ON messages_to_mobile_ thread!
+ virtual void Handle(const impl::MessageToMobile message) OVERRIDE;
+
+ // CALLED ON messages_from_hmi_ thread!
+ virtual void Handle(const impl::MessageFromHmi message) OVERRIDE;
+
+ // CALLED ON messages_to_hmi_ thread!
+ virtual void Handle(const impl::MessageToHmi message) OVERRIDE;
+
+ void SendUpdateAppList(const std::list<uint32_t>& applications_ids);
+ void OnApplicationListUpdateTimer();
+
+ /*
+ * @brief Function is called on IGN_OFF, Master_reset or Factory_defaults
+ * to notify HMI that SDL is shutting down.
+ */
+ void SendOnSDLClose();
+
+ private:
+
+ // members
+
+ /**
+ * @brief List of applications
+ */
+ std::set<ApplicationSharedPtr> application_list_;
+
+ // Lock for applications list
+ mutable sync_primitives::Lock applications_list_lock_;
+
+ /**
+ * @brief Map of correlation id and associated application id.
+ */
+ std::map<const int32_t, const uint32_t> appID_list_;
+
+ /**
+ * @brief Map contains applications which
+ * will send TTS global properties to HMI after timeout
+ */
+ std::map<uint32_t, TimevalStruct> tts_global_properties_app_list_;
+
+ bool audio_pass_thru_active_;
+ sync_primitives::Lock audio_pass_thru_lock_;
+ sync_primitives::Lock tts_global_properties_app_list_lock_;
+ bool is_distracting_driver_;
+ bool is_vr_session_strated_;
+ bool hmi_cooperating_;
+ bool is_all_apps_allowed_;
+ media_manager::MediaManager* media_manager_;
+
+ hmi_message_handler::HMIMessageHandler* hmi_handler_;
+ connection_handler::ConnectionHandler* connection_handler_;
+ protocol_handler::ProtocolHandler* protocol_handler_;
+ request_controller::RequestController request_ctrl_;
+
+ hmi_apis::HMI_API* hmi_so_factory_;
+ mobile_apis::MOBILE_API* mobile_so_factory_;
+
+ static uint32_t corelation_id_;
+ static const uint32_t max_corelation_id_;
+
+
+ // Construct message threads when everything is already created
+
+ // Thread that pumps messages coming from mobile side.
+ impl::FromMobileQueue messages_from_mobile_;
+ // Thread that pumps messages being passed to mobile side.
+ impl::ToMobileQueue messages_to_mobile_;
+ // Thread that pumps messages coming from HMI.
+ impl::FromHmiQueue messages_from_hmi_;
+ // Thread that pumps messages being passed to HMI.
+ impl::ToHmiQueue messages_to_hmi_;
+
+
+ HMICapabilities hmi_capabilities_;
+ // The reason of HU shutdown
+ mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_;
+
+ /**
+ * @brief Resume controler is responcible for save and load information
+ * about persistent application data on disk, and save session ID for resuming
+ * application in case INGITION_OFF or MASTER_RESSET
+ */
+ ResumeCtrl resume_ctrl_;
+
+#ifdef TIME_TESTER
+ AMMetricObserver* metric_observer_;
+#endif // TIME_TESTER
+
+ class ApplicationListUpdateTimer : public timer::TimerThread<ApplicationManagerImpl> {
+ public:
+ ApplicationListUpdateTimer(ApplicationManagerImpl* callee) :
+ timer::TimerThread<ApplicationManagerImpl>("AM ListUpdater",
+ callee, &ApplicationManagerImpl::OnApplicationListUpdateTimer
+ ) {
+ }
+ };
+ typedef utils::SharedPtr<ApplicationListUpdateTimer> ApplicationListUpdateTimerSptr;
+ ApplicationListUpdateTimerSptr application_list_update_timer_;
+
+ timer::TimerThread<ApplicationManagerImpl> tts_global_properties_timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
+
+ FRIEND_BASE_SINGLETON_CLASS(ApplicationManagerImpl);
+};
+
+bool ApplicationManagerImpl::vr_session_started() const {
+ return is_vr_session_strated_;
+}
+
+bool ApplicationManagerImpl::driver_distraction() const {
+ return is_distracting_driver_;
+}
+
+inline bool ApplicationManagerImpl::all_apps_allowed() const {
+ return is_all_apps_allowed_;
+}
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h
new file mode 100644
index 0000000000..28c77b6229
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -0,0 +1,99 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace application_manager {
+/**
+ * @brief SmartObject type
+ **/
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+typedef utils::SharedPtr<smart_objects::SmartObject> MessageSharedPtr;
+
+namespace commands {
+
+/**
+ * @brief Base command class
+ **/
+class Command {
+ public:
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ virtual bool CheckPermissions() = 0;
+
+ /**
+ * @brief Command initialization function
+ **/
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() = 0;
+
+ /**
+ * @brief Free resources
+ **/
+ virtual bool CleanUp() = 0;
+
+ /**
+ * \brief Command class destructor
+ **/
+ virtual ~Command() {}
+
+ /**
+ * @brief Retrieves request default timeout.
+ * If request has a custom timeout, request_timeout_ should be reassign to it
+ *
+ * @return Request default timeout
+ */
+ virtual uint32_t default_timeout() const = 0;
+
+ /*
+ * @brief Retrieves correlation ID
+ */
+ virtual uint32_t correlation_id() const = 0;
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h
new file mode 100644
index 0000000000..06637d7d84
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_impl.h
@@ -0,0 +1,123 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
+
+#include "application_manager/commands/command.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+/**
+ * @brief Contains command parameters permissions (if any) defined in policy
+ * table
+ */
+struct CommandParametersPermissions {
+ std::vector<std::string> allowed_params;
+ std::vector<std::string> disallowed_params;
+ std::vector<std::string> undefined_params;
+};
+
+namespace commands {
+
+/**
+ * @brief Class is intended to encapsulate RPC as an object
+ **/
+class CommandImpl : public Command {
+ public:
+ /**
+ * @brief CommandImpl class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CommandImpl(const MessageSharedPtr& message);
+
+ /**
+ * @brief CommandImpl class destructor
+ *
+ **/
+ virtual ~CommandImpl();
+
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ virtual bool CheckPermissions();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Cleanup all resources used by command
+ **/
+ virtual bool CleanUp();
+
+ /**
+ * @brief Execute corresponding command by calling the action on reciever
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Retrieves request default timeout.
+ * If request has a custom timeout, request_timeout_ should be reassign to it
+ *
+ * @return Request default timeout
+ */
+ virtual uint32_t default_timeout() const;
+
+ /*
+ * @brief Retrieves correlation ID
+ */
+ virtual uint32_t correlation_id() const;
+
+ // members
+ static const int32_t hmi_protocol_type_;
+ static const int32_t mobile_protocol_type_;
+ static const int32_t protocol_version_;
+
+ protected:
+ MessageSharedPtr message_;
+ uint32_t default_timeout_;
+
+#ifdef ENABLE_LOG
+ static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandImpl);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
new file mode 100644
index 0000000000..7d0d11af89
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandNotificationImpl : public CommandImpl {
+ public:
+ explicit CommandNotificationImpl(const MessageSharedPtr& message);
+ virtual ~CommandNotificationImpl();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandNotificationImpl);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
new file mode 100644
index 0000000000..fb14078961
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h
@@ -0,0 +1,209 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/lock.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+namespace commands {
+
+namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+class CommandRequestImpl : public CommandImpl,
+ public event_engine::EventObserver {
+ public:
+
+ enum RequestState {
+ kAwaitingHMIResponse = 0,
+ kTimedOut,
+ kCompleted
+ };
+
+ explicit CommandRequestImpl(const MessageSharedPtr& message);
+ virtual ~CommandRequestImpl();
+ virtual bool CheckPermissions();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ /*
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Default EvenObserver's pure virtual method implementation
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /*
+ * @brief Retrieves request ID
+ */
+ inline int32_t function_id() const;
+
+ /*
+ * @brief Retrieves connection key
+ */
+ inline uint32_t connection_key() const;
+
+ /*
+ * @brief Creates Mobile response
+ *
+ * @param success true if successful; false, if failed
+ * @param result_code Result code (SUCCESS, INVALID_DATA, e.t.c)
+ * @param info Provides additional human readable info regarding the result
+ * @param response_params Additional params in response
+ */
+ void SendResponse(const bool success,
+ const mobile_apis::Result::eType& result_code,
+ const char* info = NULL,
+ const NsSmart::SmartObject* response_params = NULL);
+
+ /**
+ * @brief Check syntax of string from mobile
+ * @param str - string that need to be checked
+ * @param allow_empty_string if true methods allow empty sting
+ * @return true if success otherwise return false
+ */
+ bool CheckSyntax(std::string str, bool allow_empty_line = false);
+
+ /*
+ * @brief Sends HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ * @param use_events true if we need subscribe on event(HMI request)
+ *
+ */
+ void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject* msg_params = NULL,
+ bool use_events = false);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject& msg_params) const;
+
+ /**
+ * @brief Converts HMI result code to Mobile result code
+ *
+ * @param hmi_code HMI result code
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const;
+
+protected:
+
+ /**
+ * @brief Checks message permissions and parameters according to policy table
+ * permissions
+ */
+ bool CheckAllowedParameters();
+
+ /**
+ * @brief Remove from current message parameters disallowed by policy table
+ * @param params_permissions Parameters permissions from policy table
+ */
+ void RemoveDisallowedParameters(
+ const CommandParametersPermissions& params_permissions);
+
+ /**
+ * @brief Adds disallowed parameters back to response with appropriate
+ * reasons
+ * @param response Response message, which should be extended with blocked
+ * parameters reasons
+ */
+ void AddDisallowedParameters(smart_objects::SmartObject& response);
+
+ /**
+ * @brief Checks if any request param was marked as disallowed by policy
+ * @return true if any param was marked as disallowed
+ */
+ bool HasDisallowedParams() const;
+
+ protected:
+ RequestState current_state_;
+ sync_primitives::Lock state_lock_;
+ CommandParametersPermissions parameters_permissions_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
+
+
+ /**
+ * @brief Adds param to disallowed parameters enumeration
+ * @param info string with disallowed params enumeration
+ * @param param disallowed param
+ */
+ void AddDissalowedParameterToInfoString(std::string& info,
+ const std::string& param) const;
+
+ /**
+ * @brief Adds disallowed parameters to response info
+ * @param response Response message, which info should be extended
+ */
+ void AddDisallowedParametersToInfo(smart_objects::SmartObject& response) const;
+};
+
+int32_t CommandRequestImpl::function_id() const {
+ return (*message_)[strings::params][strings::function_id].asInt();
+}
+
+uint32_t CommandRequestImpl::connection_key() const {
+ return (*message_)[strings::params][strings::connection_key].asUInt();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
new file mode 100644
index 0000000000..0c93bf54d4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandResponseImpl : public CommandImpl {
+ public:
+ explicit CommandResponseImpl(const MessageSharedPtr& message);
+ virtual ~CommandResponseImpl();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendResponse(bool successe,
+ const mobile_apis::Result::eType& result_code =
+ mobile_apis::Result::INVALID_ENUM,
+ bool final_message = false);
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandResponseImpl);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h
new file mode 100644
index 0000000000..3495ce1377
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ActivateAppRequest command class
+ **/
+class ActivateAppRequest : public RequestToHMI, event_engine::EventObserver {
+ public:
+ /**
+ * @brief ActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ActivateAppRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief Calback for response
+ *
+ * @param event - event response
+ **/
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief ActivateAppRequest class destructor
+ **/
+ virtual ~ActivateAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
new file mode 100644
index 0000000000..1df9bc095a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ActivateAppResponse command class
+ **/
+class ActivateAppResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief ActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ActivateAppResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ActivateAppResponse class destructor
+ **/
+ virtual ~ActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h
new file mode 100644
index 0000000000..1569af434d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddStatisticsInfoNotification command class
+ **/
+class AddStatisticsInfoNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief AddStatisticsInfoNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddStatisticsInfoNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddStatisticsInfoNotification class destructor
+ **/
+ virtual ~AddStatisticsInfoNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddStatisticsInfoNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h
new file mode 100644
index 0000000000..6c2db489ce
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsRequest command class
+ **/
+class AllowAllAppsRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AllowAllAppsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAllAppsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAllAppsRequest class destructor
+ **/
+ virtual ~AllowAllAppsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h
new file mode 100644
index 0000000000..0eb8184fa8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsResponse command class
+ **/
+class AllowAllAppsResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAllAppsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAllAppsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAllAppsResponse class destructor
+ **/
+ virtual ~AllowAllAppsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h
new file mode 100644
index 0000000000..91228440a2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAppRequest command class
+ **/
+class AllowAppRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AllowAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAppRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAppRequest class destructor
+ **/
+ virtual ~AllowAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h
new file mode 100644
index 0000000000..5a24ac1a74
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAppResponse command class
+ **/
+class AllowAppResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAppResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAppResponse class destructor
+ **/
+ virtual ~AllowAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
new file mode 100644
index 0000000000..d066df813e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemRequest command class
+ **/
+class BasicCommunicationSystemRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit BasicCommunicationSystemRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief BasicCommunicationSystemRequest class destructor
+ **/
+ virtual ~BasicCommunicationSystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
new file mode 100644
index 0000000000..1948211c48
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemResponse command class
+ **/
+class BasicCommunicationSystemResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit BasicCommunicationSystemResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief BasicCommunicationSystemResponse class destructor
+ **/
+ virtual ~BasicCommunicationSystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h
new file mode 100644
index 0000000000..3c9fbac684
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class ButtonGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ButtonGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ButtonGetCapabilitiesRequest class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h
new file mode 100644
index 0000000000..067954537d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesResponse command class
+ **/
+class ButtonGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ButtonGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ButtonGetCapabilitiesResponse class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h
new file mode 100644
index 0000000000..72ff8a2c5b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ClosePopupRequest command class
+ **/
+class ClosePopupRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief ClosePopupRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ClosePopupRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ClosePopupRequest class destructor
+ **/
+ virtual ~ClosePopupRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
new file mode 100644
index 0000000000..05318e3cb9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ClosePopupResponse command class
+ **/
+class ClosePopupResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief ClosePopupResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ClosePopupResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ClosePopupResponse class destructor
+ **/
+ virtual ~ClosePopupResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
new file mode 100644
index 0000000000..8cb34718a1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetSystemInfoRequest command class
+ **/
+class GetSystemInfoRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief GetSystemInfoRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetSystemInfoRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetSystemInfoRequest class destructor
+ **/
+ virtual ~GetSystemInfoRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
new file mode 100644
index 0000000000..f10c07c52f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetSystemInfoResponse command class
+ **/
+class GetSystemInfoResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief GetSystemInfoResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetSystemInfoResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetSystemInfoResponse class destructor
+ **/
+ virtual ~GetSystemInfoResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
new file mode 100644
index 0000000000..9241446676
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief GetUrls command class
+ **/
+class GetUrls : public RequestFromHMI {
+ public:
+ /**
+ * @brief GetUrls class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetUrls(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetUrls class destructor
+ **/
+ virtual ~GetUrls();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetUrls);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
new file mode 100644
index 0000000000..6b025142e2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+class GetUrlsResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief GetUrlsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetUrlsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetUrlsResponse class destructor
+ **/
+ virtual ~GetUrlsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h
new file mode 100644
index 0000000000..905b5b3836
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedRequest command class
+ **/
+class MixingAudioSupportedRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit MixingAudioSupportedRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief MixingAudioSupportedRequest class destructor
+ **/
+ virtual ~MixingAudioSupportedRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h
new file mode 100644
index 0000000000..c8bfe4e156
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedResponse command class
+ **/
+class MixingAudioSupportedResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit MixingAudioSupportedResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief MixingAudioSupportedResponse class destructor
+ **/
+ virtual ~MixingAudioSupportedResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
new file mode 100644
index 0000000000..1e2a39df94
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverRequest command class
+ **/
+class NaviAlertManeuverRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviAlertManeuverRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviAlertManeuverRequest class destructor
+ **/
+ virtual ~NaviAlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
new file mode 100644
index 0000000000..41e0f623f1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverResponse command class
+ **/
+class NaviAlertManeuverResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviAlertManeuverResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviAlertManeuverResponse class destructor
+ **/
+ virtual ~NaviAlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
new file mode 100644
index 0000000000..a321d32dd9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamRequest command class
+ **/
+class AudioStartStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AudioStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStartStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~AudioStartStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
new file mode 100644
index 0000000000..01992eb3b7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamResponse command class
+ **/
+class AudioStartStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStartStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AudioStartStreamResponse class destructor
+ **/
+ virtual ~AudioStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
new file mode 100644
index 0000000000..04bba8b752
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AudioStopStreamRequest command class
+ **/
+class AudioStopStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AudioStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStopStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviStopStreamRequest class destructor
+ **/
+ virtual ~AudioStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
new file mode 100644
index 0000000000..7275ac34d8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class AudioStopStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStopStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~AudioStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
new file mode 100644
index 0000000000..a31efc7fe4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyRequest command class
+ **/
+class NaviIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviIsReadyRequest class destructor
+ **/
+ virtual ~NaviIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVIGATION_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h
new file mode 100644
index 0000000000..0fbad35154
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyResponse command class
+ **/
+class NaviIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviIsReadyResponse class destructor
+ **/
+ virtual ~NaviIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h
new file mode 100644
index 0000000000..9c91df648a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationRequest command class
+ */
+class NaviSendLocationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviSendLocationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ explicit NaviSendLocationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviSendLocationRequest class destructor
+ */
+ virtual ~NaviSendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h
new file mode 100644
index 0000000000..029d903192
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationResponse command class
+ */
+class NaviSendLocationResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSendLocationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ explicit NaviSendLocationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviSendLocationResponse class destructor
+ */
+ virtual ~NaviSendLocationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
new file mode 100644
index 0000000000..5da47e580b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTRequest command class
+ **/
+class NaviShowConstantTBTRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviShowConstantTBTRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviShowConstantTBTRequest class destructor
+ **/
+ virtual ~NaviShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
new file mode 100644
index 0000000000..4a26b26b09
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTResponse command class
+ **/
+class NaviShowConstantTBTResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviShowConstantTBTResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviShowConstantTBTResponse class destructor
+ **/
+ virtual ~NaviShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h
new file mode 100644
index 0000000000..f43b992219
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamRequest command class
+ **/
+class NaviStartStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStartStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~NaviStartStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h
new file mode 100644
index 0000000000..c94b6f219c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamResponse command class
+ **/
+class NaviStartStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStartStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviStartStreamResponse class destructor
+ **/
+ virtual ~NaviStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h
new file mode 100644
index 0000000000..86b0981c22
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamRequest command class
+ **/
+class NaviStopStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStopStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviStopStreamRequest class destructor
+ **/
+ virtual ~NaviStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h
new file mode 100644
index 0000000000..6f4986e4c7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class NaviStopStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStopStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~NaviStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h
new file mode 100644
index 0000000000..61beef1b3b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListRequest command class
+ **/
+class NaviUpdateTurnListRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviUpdateTurnListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviUpdateTurnListRequest class destructor
+ **/
+ virtual ~NaviUpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h
new file mode 100644
index 0000000000..9e711b8be9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListResponse command class
+ **/
+class NaviUpdateTurnListResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviUpdateTurnListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviUpdateTurnListResponse class destructor
+ **/
+ virtual ~NaviUpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
new file mode 100644
index 0000000000..219306d375
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
@@ -0,0 +1,69 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class CSmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+namespace NsSmartObj = NsSmartDeviceLink::NsSmartObjects;
+
+class NotificationFromHMI : public CommandImpl {
+ public:
+ explicit NotificationFromHMI(const MessageSharedPtr& message);
+ virtual ~NotificationFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotificationToMobile(const MessageSharedPtr& message);
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmartObj::SmartObject& msg_params) const;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h
new file mode 100644
index 0000000000..2372754b63
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class NotificationToHMI : public CommandImpl {
+ public:
+ explicit NotificationToHMI(const MessageSharedPtr& message);
+ virtual ~NotificationToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
new file mode 100644
index 0000000000..aa549638e4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAllowSDLFunctionalityNotification command class
+ **/
+class OnAllowSDLFunctionalityNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class destructor
+ **/
+ virtual ~OnAllowSDLFunctionalityNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
new file mode 100644
index 0000000000..a8bdeb6c91
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppActivatedNotification command class
+ **/
+class OnAppActivatedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppActivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppActivatedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppActivatedNotification class destructor
+ **/
+ virtual ~OnAppActivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h
new file mode 100644
index 0000000000..4c56dc4158
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppDeactivatedNotification command class
+ **/
+class OnAppDeactivatedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppDeactivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppDeactivatedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppDeactivatedNotification class destructor
+ **/
+ virtual ~OnAppDeactivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppDeactivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
new file mode 100644
index 0000000000..034efb7a8c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionChangedNotification command class
+ **/
+class OnAppPermissionChangedNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppPermissionChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppPermissionChangedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppPermissionChangedNotification class destructor
+ **/
+ virtual ~OnAppPermissionChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
new file mode 100644
index 0000000000..a5037820cc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionConsentNotification command class
+ **/
+class OnAppPermissionConsentNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppPermissionConsentNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppPermissionConsentNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppPermissionConsentNotification class destructor
+ **/
+ virtual ~OnAppPermissionConsentNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h
new file mode 100644
index 0000000000..4364aa9a35
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppRegisteredNotification command class
+ **/
+class OnAppRegisteredNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppRegisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppRegisteredNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppRegisteredNotification class destructor
+ **/
+ virtual ~OnAppRegisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppRegisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
new file mode 100644
index 0000000000..d8470af396
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppUnregisteredNotification command class
+ **/
+class OnAppUnregisteredNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppUnregisteredNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppUnregisteredNotification class destructor
+ **/
+ virtual ~OnAppUnregisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h
new file mode 100644
index 0000000000..a4657ea24e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonEventNotification command class
+ **/
+class OnButtonEventNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h
new file mode 100644
index 0000000000..065cdc4a72
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonPressNotification command class
+ **/
+class OnButtonPressNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonPressNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h
new file mode 100644
index 0000000000..e980bfe41b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnDeviceChosenNotification command class
+ **/
+class OnDeviceChosenNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceChosenNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDeviceChosenNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDeviceChosenNotification class destructor
+ **/
+ virtual ~OnDeviceChosenNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceChosenNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h
new file mode 100644
index 0000000000..5c12bdfd9f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnDeviceStateChangedNotification command class
+ **/
+class OnDeviceStateChangedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceStateChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDeviceStateChangedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDeviceStateChangedNotification class destructor
+ **/
+ virtual ~OnDeviceStateChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..77da5cf3b2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnDriverDistractionNotification command class
+ **/
+class OnDriverDistractionNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDriverDistractionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
new file mode 100644
index 0000000000..c913509e5e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnExitAllApplicationsNotification command class
+ **/
+class OnExitAllApplicationsNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitAllApplicationsNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnExitAllApplicationsNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnExitAllApplicationsNotification class destructor
+ **/
+ virtual ~OnExitAllApplicationsNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /**
+ * @brief Notify's HMI that SDL stored all data required for resumption
+ **/
+ void SendOnSDLPersistenceComplete();
+
+ DISALLOW_COPY_AND_ASSIGN(OnExitAllApplicationsNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
new file mode 100644
index 0000000000..b78c0e2afe
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnExitApplicationNotification command class
+ **/
+class OnExitApplicationNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitApplicationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnExitApplicationNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnExitApplicationNotification class destructor
+ **/
+ virtual ~OnExitApplicationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnExitApplicationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h
new file mode 100644
index 0000000000..b6b46041f8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnFileRemovedNotification command class
+ **/
+class OnFileRemovedNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnFileRemovedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnFileRemovedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnFileRemovedNotification class destructor
+ **/
+ virtual ~OnFileRemovedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFileRemovedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
new file mode 100644
index 0000000000..2499129b2c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnFindApplications command class
+ **/
+class OnFindApplications : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnFindApplications class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnFindApplications(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnFindApplications class destructor
+ **/
+ virtual ~OnFindApplications();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFindApplications);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
new file mode 100644
index 0000000000..ed0638f3cc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnIgnitionCycleOverNotification command class
+ **/
+class OnIgnitionCycleOverNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnIgnitionCycleOverNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnIgnitionCycleOverNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnIgnitionCycleOverNotification class destructor
+ **/
+ virtual ~OnIgnitionCycleOverNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
new file mode 100644
index 0000000000..6e42e1a0cd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnNaviTBTClientStateNotification command class
+ **/
+class OnNaviTBTClientStateNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnNaviTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnNaviTBTClientStateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviTBTClientStateNotification class destructor
+ **/
+ virtual ~OnNaviTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnNaviTBTClientStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h
new file mode 100644
index 0000000000..8e463c3276
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_play_tone_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnPlayToneNotification command class
+ **/
+class OnPlayToneNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnPlayToneNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPlayToneNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPlayToneNotification class destructor
+ **/
+ virtual ~OnPlayToneNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPlayToneNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
new file mode 100644
index 0000000000..f71de540e5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+class OnPolicyUpdate : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPolicyUpdate(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPolicyUpdate class destructor
+ **/
+ virtual ~OnPolicyUpdate();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
+};
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h
new file mode 100644
index 0000000000..839af785be
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnPutFileNotification command class
+ **/
+class OnPutFileNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnPutFileNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPutFileNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPutFileNotification class destructor
+ **/
+ virtual ~OnPutFileNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h
new file mode 100644
index 0000000000..a3e2dd731d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnReadyNotification command class
+ **/
+class OnReadyNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReadyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnReadyNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnReadyNotification class destructor
+ **/
+ virtual ~OnReadyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReadyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
new file mode 100644
index 0000000000..38a4470d22
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class OnReceivedPolicyUpdate : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReceivedPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnReceivedPolicyUpdate(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnReceivedPolicyUpdate class destructor
+ **/
+ virtual ~OnReceivedPolicyUpdate();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h
new file mode 100644
index 0000000000..81f0b5bdda
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnRecordStartdNotification command class
+ **/
+class OnRecordStartdNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnRecordStartdNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnRecordStartdNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnRecordStartdNotification class destructor
+ **/
+ virtual ~OnRecordStartdNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnRecordStartdNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
new file mode 100644
index 0000000000..c27e2e5ee8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnResumeAudioSourceNotification command class
+ **/
+class OnResumeAudioSourceNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnResumeAudioSourceNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnResumeAudioSourceNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnResumeAudioSourceNotification class destructor
+ **/
+ virtual ~OnResumeAudioSourceNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h
new file mode 100644
index 0000000000..e6b4418d6d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSDLCloseNotification command class
+ **/
+class OnSDLCloseNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLCloseNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSDLCloseNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSdlCloseNotification class destructor
+ **/
+ virtual ~OnSDLCloseNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLCloseNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
new file mode 100644
index 0000000000..c9b93a4dcf
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSDLConsentNeededNotification command class
+ **/
+class OnSDLConsentNeededNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLConsentNeededNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSDLConsentNeededNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSDLConsentNeededNotification class destructor
+ **/
+ virtual ~OnSDLConsentNeededNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
new file mode 100644
index 0000000000..5da06ef34c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSDLPersistenceCompleteNotification command class
+ **/
+class OnSDLPersistenceCompleteNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class destructor
+ **/
+ virtual ~OnSDLPersistenceCompleteNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
new file mode 100644
index 0000000000..3e4dc1daf4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnStartDeviceDiscovery command class
+ **/
+class OnStartDeviceDiscovery : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnStartDeviceDiscovery class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnStartDeviceDiscovery(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnStartDeviceDiscovery class destructor
+ **/
+ virtual ~OnStartDeviceDiscovery();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStartDeviceDiscovery);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
new file mode 100644
index 0000000000..ae85d13713
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnGetStatusUpdateNotification command class
+ **/
+class OnStatusUpdateNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnGetStatusUpdateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnStatusUpdateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnGetStatusUpdateNotification class destructor
+ **/
+ virtual ~OnStatusUpdateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h
new file mode 100644
index 0000000000..b16df6069e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile_api = mobile_apis;
+/**
+ * @brief OnSystemContextNotification command class
+ **/
+class OnSystemContextNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemContextNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemContextNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemContextNotification class destructor
+ **/
+ virtual ~OnSystemContextNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void SendSystemContextNotification(ApplicationSharedPtr app,
+ mobile_api::SystemContext::eType system_context);
+
+ DISALLOW_COPY_AND_ASSIGN(OnSystemContextNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h
new file mode 100644
index 0000000000..cb3fc12017
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSystemErrorNotification command class
+ **/
+class OnSystemErrorNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemErrorNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemErrorNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemErrorNotification class destructor
+ **/
+ virtual ~OnSystemErrorNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemErrorNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
new file mode 100644
index 0000000000..d0bcadfaac
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSystemInfoChangedNotification command class
+ **/
+class OnSystemInfoChangedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemInfoChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemInfoChangedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemInfoChangedNotification class destructor
+ **/
+ virtual ~OnSystemInfoChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h
new file mode 100644
index 0000000000..6e3a0eea7f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSystemRequestNotification command class
+ **/
+class OnSystemRequestNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemRequestNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemRequestNotification class destructor
+ **/
+ virtual ~OnSystemRequestNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h
new file mode 100644
index 0000000000..d9b55ac0c1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTTSLanguageChangeNotification command class
+ **/
+class OnTTSLanguageChangeNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTTSLanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSLanguageChangeNotification class destructor
+ **/
+ virtual ~OnTTSLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
new file mode 100644
index 0000000000..3bafc920b7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnTTSResetTimeoutNotification command class
+ **/
+class OnTTSResetTimeoutNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTTSResetTimeoutNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSResetTimeoutNotification class destructor
+ **/
+ virtual ~OnTTSResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h
new file mode 100644
index 0000000000..8cb6256074
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTTSStartedNotification command class
+ **/
+class OnTTSStartedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTTSStartedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSStartedNotification class destructor
+ **/
+ virtual ~OnTTSStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h
new file mode 100644
index 0000000000..31fb6fb31c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTTSStoppedNotification command class
+ **/
+class OnTTSStoppedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject OnTTSStartedNotificationmessage
+ **/
+ explicit OnTTSStoppedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSStoppedNotification class destructor
+ **/
+ virtual ~OnTTSStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h
new file mode 100644
index 0000000000..1d0aaf3078
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnUICommandNotification command class
+ **/
+class OnUICommandNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUICommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUICommandNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUICommandNotification class destructor
+ **/
+ virtual ~OnUICommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUICommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
new file mode 100644
index 0000000000..bb0a6a72d3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIKeyBoardInputNotification command class
+ **/
+class OnUIKeyBoardInputNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUIKeyBoardInputNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUIKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnUIKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIKeyBoardInputNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h
new file mode 100644
index 0000000000..85b8f60c4d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnUILanguageChangeNotification command class
+ **/
+class OnUILanguageChangeNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUILanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUILanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUILanguageChangeNotification class destructor
+ **/
+ virtual ~OnUILanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUILanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
new file mode 100644
index 0000000000..511606d077
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIResetTimeoutNotification command class
+ **/
+class OnUIResetTimeoutNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUIResetTimeoutNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUIResetTimeoutNotification class destructor
+ **/
+ virtual ~OnUIResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
new file mode 100644
index 0000000000..3231d1ca29
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUITouchEventNotification command class
+ **/
+class OnUITouchEventNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUITouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUITouchEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUITouchEventNotification class destructor
+ **/
+ virtual ~OnUITouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUITouchEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h
new file mode 100644
index 0000000000..c0d355c925
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnUpdateDeviceList command class
+ **/
+class OnUpdateDeviceList : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUpdateDeviceList class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUpdateDeviceList(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUpdateDeviceList class destructor
+ **/
+ virtual ~OnUpdateDeviceList();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUpdateDeviceList);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
new file mode 100644
index 0000000000..04bb3e54bc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIAccPedalPositionNotification command class
+ **/
+class OnVIAccPedalPositionNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIAccPedalPositionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIAccPedalPositionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIAccPedalPositionNotification class destructor
+ **/
+ virtual ~OnVIAccPedalPositionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
new file mode 100644
index 0000000000..3cfb048cdc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIBeltStatusNotification command class
+ **/
+class OnVIBeltStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBeltStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIBeltStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIBeltStatusNotification class destructor
+ **/
+ virtual ~OnVIBeltStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h
new file mode 100644
index 0000000000..b9ecf5a34b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIBodyInformationNotification command class
+ **/
+class OnVIBodyInformationNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBodyInformationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIBodyInformationNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIBodyInformationNotification class destructor
+ **/
+ virtual ~OnVIBodyInformationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h
new file mode 100644
index 0000000000..925989e8c6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIDeviceStatusNotification command class
+ **/
+class OnVIDeviceStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDeviceStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIDeviceStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIDeviceStatusNotification class destructor
+ **/
+ virtual ~OnVIDeviceStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
new file mode 100644
index 0000000000..7baea90651
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIDriverBrakingNotification command class
+ **/
+class OnVIDriverBrakingNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDriverBrakingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIDriverBrakingNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIDriverBrakingNotification class destructor
+ **/
+ virtual ~OnVIDriverBrakingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
new file mode 100644
index 0000000000..33dd824c6e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIEngineTorqueNotification command class
+ **/
+class OnVIEngineTorqueNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIEngineTorqueNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIEngineTorqueNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIEngineTorqueNotification class destructor
+ **/
+ virtual ~OnVIEngineTorqueNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
new file mode 100644
index 0000000000..207302a373
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIExternalTemperatureNotification command class
+ **/
+class OnVIExternalTemperatureNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIExternalTemperatureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIExternalTemperatureNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIExternalTemperatureNotification class destructor
+ **/
+ virtual ~OnVIExternalTemperatureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
new file mode 100644
index 0000000000..535758db25
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelNotification command class
+ **/
+class OnVIFuelLevelNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIFuelLevelNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIFuelLevelNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
new file mode 100644
index 0000000000..92dffd89b3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelStateNotification command class
+ **/
+class OnVIFuelLevelStateNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIFuelLevelStateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIFuelLevelStateNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
new file mode 100644
index 0000000000..d8f2a768fc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIGpsDataNotification command class
+ **/
+class OnVIGpsDataNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIGpsDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIGpsDataNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIGpsDataNotification class destructor
+ **/
+ virtual ~OnVIGpsDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
new file mode 100644
index 0000000000..47802e97eb
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIHeadLampStatusNotification command class
+ **/
+class OnVIHeadLampStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIHeadLampStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIHeadLampStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIHeadLampStatusNotification class destructor
+ **/
+ virtual ~OnVIHeadLampStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
new file mode 100644
index 0000000000..fe38412980
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIInstantFuelConsumptionNotification command class
+ **/
+class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIInstantFuelConsumptionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class destructor
+ **/
+ virtual ~OnVIInstantFuelConsumptionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h
new file mode 100644
index 0000000000..d636b6e779
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIMyKeyNotification command class
+ **/
+class OnVIMyKeyNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIMyKeyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIMyKeyNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIMyKeyNotification class destructor
+ **/
+ virtual ~OnVIMyKeyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h
new file mode 100644
index 0000000000..1cf4c25878
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIOdometerNotification command class
+ **/
+class OnVIOdometerNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIOdometerNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIOdometerNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIOdometerNotification class destructor
+ **/
+ virtual ~OnVIOdometerNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h
new file mode 100644
index 0000000000..5a3a136374
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIPrndlNotification command class
+ **/
+class OnVIPrndlNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIPrndlNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIPrndlNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIPrndlNotification class destructor
+ **/
+ virtual ~OnVIPrndlNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h
new file mode 100644
index 0000000000..80dea2a6e2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIRpmNotification command class
+ **/
+class OnVIRpmNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIRpmNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIRpmNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIRpmNotification class destructor
+ **/
+ virtual ~OnVIRpmNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h
new file mode 100644
index 0000000000..19bffabf4f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVISpeedNotification command class
+ **/
+class OnVISpeedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISpeedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVISpeedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVISpeedNotification class destructor
+ **/
+ virtual ~OnVISpeedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
new file mode 100644
index 0000000000..0826cb6c6f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVISteeringWheelAngleNotification command class
+ **/
+class OnVISteeringWheelAngleNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISteeringWheelAngleNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVISteeringWheelAngleNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVISteeringWheelAngleNotification class destructor
+ **/
+ virtual ~OnVISteeringWheelAngleNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
new file mode 100644
index 0000000000..ba8eceefc3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVITirePressureNotification command class
+ **/
+class OnVITirePressureNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVITirePressureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVITirePressureNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVITirePressureNotification class destructor
+ **/
+ virtual ~OnVITirePressureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
new file mode 100644
index 0000000000..30ad9d6acc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIVehicleDataNotification command class
+ * Sent by HMI for the periodic and non periodic vehicle data
+ **/
+class OnVIVehicleDataNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIVehicleDataNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIVehicleDataNotification class destructor
+ **/
+ virtual ~OnVIVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVehicleDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h
new file mode 100644
index 0000000000..0cb5fb17d2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIVinNotification command class
+ **/
+class OnVIVinNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVinNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIVinNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIVinNotification class destructor
+ **/
+ virtual ~OnVIVinNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
new file mode 100644
index 0000000000..c7a1a6bd62
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIWiperStatusNotification command class
+ **/
+class OnVIWiperStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIWiperStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIWiperStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIWiperStatusNotification class destructor
+ **/
+ virtual ~OnVIWiperStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h
new file mode 100644
index 0000000000..677bc26727
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRCommandNotification command class
+ **/
+class OnVRCommandNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRCommandNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRCommandNotification class destructor
+ **/
+ virtual ~OnVRCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h
new file mode 100644
index 0000000000..24c60c32d9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRLanguageChangeNotification command class
+ **/
+class OnVRLanguageChangeNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRLanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRLanguageChangeNotification class destructor
+ **/
+ virtual ~OnVRLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h
new file mode 100644
index 0000000000..cc78f010b6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRStartedNotification command class
+ **/
+class OnVRStartedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRStartedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRStartedNotification class destructor
+ **/
+ virtual ~OnVRStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h
new file mode 100644
index 0000000000..2ee8ad429e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRStoppedNotification command class
+ **/
+class OnVRStoppedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRStoppedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRStoppedNotification class destructor
+ **/
+ virtual ~OnVRStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
new file mode 100644
index 0000000000..39ebd95819
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
@@ -0,0 +1,66 @@
+ /**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
+ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
+
+ #include "application_manager/commands/command_impl.h"
+ #include "interfaces/HMI_API.h"
+
+ namespace NsSmartDeviceLink {
+ namespace NsSmartObjects {
+ class SmartObject;
+ }
+ }
+
+ namespace application_manager {
+
+ namespace commands {
+
+ namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+ class RequestFromHMI : public CommandImpl {
+ public:
+ explicit RequestFromHMI(const MessageSharedPtr& message);
+ virtual ~RequestFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
+ };
+
+ } // namespace commands
+ } // namespace application_manager
+
+ #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
new file mode 100644
index 0000000000..3a9de4b7b5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h
@@ -0,0 +1,67 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+
+class RequestToHMI : public CommandImpl {
+ public:
+ explicit RequestToHMI(const MessageSharedPtr& message);
+ virtual ~RequestToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendRequest();
+
+ /*
+ * @brief Retrieves application ID
+ */
+ inline uint32_t application_id() const {
+ return (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h
new file mode 100644
index 0000000000..21497a1335
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h
@@ -0,0 +1,77 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+class ResponseFromHMI : public CommandImpl {
+ public:
+ explicit ResponseFromHMI(const MessageSharedPtr& message);
+ virtual ~ResponseFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendResponseToMobile(const MessageSharedPtr& message);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject& msg_params) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
new file mode 100644
index 0000000000..ce9e9469d0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
@@ -0,0 +1,67 @@
+
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+class ResponseToHMI : public CommandImpl {
+ public:
+ explicit ResponseToHMI(const MessageSharedPtr& message);
+ virtual ~ResponseToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseToHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h
new file mode 100644
index 0000000000..db4a93b0b5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppRequest command class
+ **/
+class SDLActivateAppRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLActivateAppRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLActivateAppRequest class destructor
+ **/
+ virtual ~SDLActivateAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
new file mode 100644
index 0000000000..63adc6c0d3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppResponse command class
+ **/
+class SDLActivateAppResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLActivateAppResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLActivateAppResponse class destructor
+ **/
+ virtual ~SDLActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
new file mode 100644
index 0000000000..5da473b1a7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsRequest command class
+ **/
+class SDLGetListOfPermissionsRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetListOfPermissionsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetListOfPermissionsRequest class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
new file mode 100644
index 0000000000..5de9fc0ea8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsResponse command class
+ **/
+class SDLGetListOfPermissionsResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetListOfPermissionsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetListOfPermissionsResponse class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
new file mode 100644
index 0000000000..a098e0a113
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateRequest command class
+ **/
+class SDLGetStatusUpdateRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetStatusUpdateRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetStatusUpdateRequest class destructor
+ **/
+ virtual ~SDLGetStatusUpdateRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
new file mode 100644
index 0000000000..6299cde630
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateResponse command class
+ **/
+class SDLGetStatusUpdateResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetStatusUpdateResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetStatusUpdateResponse class destructor
+ **/
+ virtual ~SDLGetStatusUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
new file mode 100644
index 0000000000..b729a16170
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageRequest command class
+ **/
+class SDLGetUserFriendlyMessageRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
new file mode 100644
index 0000000000..bb7a7f8e20
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageResponse command class
+ **/
+class SDLGetUserFriendlyMessageResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
new file mode 100644
index 0000000000..ee2b9865c8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class SDLPolicyUpdate : public RequestToHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLPolicyUpdate(const MessageSharedPtr& message);
+ virtual ~SDLPolicyUpdate();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
new file mode 100644
index 0000000000..b6ab925fd6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class SDLPolicyUpdateResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLPolicyUpdateResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLPolicyUpdateResponse class destructor
+ **/
+ virtual ~SDLPolicyUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h
new file mode 100644
index 0000000000..a587af950b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistrationRequest command class
+ **/
+class TTSChangeRegistrationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSChangeRegistrationRequest class destructor
+ **/
+ virtual ~TTSChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h
new file mode 100644
index 0000000000..3a9e9fda51
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistratioResponse command class
+ **/
+class TTSChangeRegistratioResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSChangeRegistratioResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSChangeRegistratioResponse class destructor
+ **/
+ virtual ~TTSChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h
new file mode 100644
index 0000000000..73edd9de73
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesRequest command class
+ **/
+class TTSGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetCapabilitiesRequest class destructor
+ **/
+ virtual ~TTSGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h
new file mode 100644
index 0000000000..71f85d68e3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesResponse command class
+ **/
+class TTSGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetCapabilitiesResponse class destructor
+ **/
+ virtual ~TTSGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h
new file mode 100644
index 0000000000..94e38ec473
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageRequest command class
+ **/
+class TTSGetLanguageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetLanguageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetLanguageRequest class destructor
+ **/
+ virtual ~TTSGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h
new file mode 100644
index 0000000000..bd67d64f32
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageResponse command class
+ **/
+class TTSGetLanguageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetLanguageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetLanguageResponse class destructor
+ **/
+ virtual ~TTSGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
new file mode 100644
index 0000000000..ff80dd2389
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesRequest command class
+ **/
+class TTSGetSupportedLanguagesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
new file mode 100644
index 0000000000..244f223460
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesResponse command class
+ **/
+class TTSGetSupportedLanguagesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
new file mode 100644
index 0000000000..dc58d852ea
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyRequest command class
+ **/
+class TTSIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSIsReadyRequest class destructor
+ **/
+ virtual ~TTSIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h
new file mode 100644
index 0000000000..375e5a5d1f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyResponse command class
+ **/
+class TTSIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSIsReadyResponse class destructor
+ **/
+ virtual ~TTSIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h
new file mode 100644
index 0000000000..b398e0b2d2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesRequest command class
+ **/
+class TTSSetGlobalPropertiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h
new file mode 100644
index 0000000000..adf0b70276
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesResponse command class
+ **/
+class TTSSetGlobalPropertiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h
new file mode 100644
index 0000000000..326c638f4d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakRequest command class
+ **/
+class TTSSpeakRequest
+ : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSSpeakRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSpeakRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSpeakRequest class destructor
+ **/
+ virtual ~TTSSpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h
new file mode 100644
index 0000000000..e22c549871
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakResponse command class
+ **/
+class TTSSpeakResponse
+ : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSpeakResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSpeakResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSpeakResponse class destructor
+ **/
+ virtual ~TTSSpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h
new file mode 100644
index 0000000000..0d82121fd7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingRequest command class
+ **/
+class TTSStopSpeakingRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSStopSpeakingRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSStopSpeakingRequest class destructor
+ **/
+ virtual ~TTSStopSpeakingRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h
new file mode 100644
index 0000000000..b9055bfbe5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingResponse command class
+ **/
+class TTSStopSpeakingResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSStopSpeakingResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSStopSpeakingResponse class destructor
+ **/
+ virtual ~TTSStopSpeakingResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h
new file mode 100644
index 0000000000..ffd6eeeefd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandRequest command class
+ **/
+class UIAddCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddCommandRequest class destructor
+ **/
+ virtual ~UIAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h
new file mode 100644
index 0000000000..f84b71d0f1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandResponse command class
+ **/
+class UIAddCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddCommandResponse class destructor
+ **/
+ virtual ~UIAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h
new file mode 100644
index 0000000000..1227de0463
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIAddSubmenuRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddSubmenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddSubmenuRequest class destructor
+ **/
+ virtual ~UIAddSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h
new file mode 100644
index 0000000000..1b3a10729e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuResponse command class
+ **/
+class UIAddSubmenuResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddSubmenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddSubmenuResponse class destructor
+ **/
+ virtual ~UIAddSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h
new file mode 100644
index 0000000000..7395eb19e1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAlertRequest command class
+ **/
+class UIAlertRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIAlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAlertRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAlertRequest class destructor
+ **/
+ virtual ~UIAlertRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h
new file mode 100644
index 0000000000..1d17d98095
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAlertResponse command class
+ **/
+class UIAlertResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAlertResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAlertResponse class destructor
+ **/
+ virtual ~UIAlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h
new file mode 100644
index 0000000000..51276b7b0f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistrationRequest command class
+ **/
+class UIChangeRegistrationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIChangeRegistrationRequest class destructor
+ **/
+ virtual ~UIChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h
new file mode 100644
index 0000000000..edb7574e8d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistratioResponse command class
+ **/
+class UIChangeRegistratioResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIChangeRegistratioResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIChangeRegistratioResponse class destructor
+ **/
+ virtual ~UIChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h
new file mode 100644
index 0000000000..398f78c28f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandRequest command class
+ **/
+class UIDeleteCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteCommandRequest class destructor
+ **/
+ virtual ~UIDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h
new file mode 100644
index 0000000000..bb19811908
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandResponse command class
+ **/
+class UIDeleteCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteCommandResponse class destructor
+ **/
+ virtual ~UIDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h
new file mode 100644
index 0000000000..1b3747234b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIDeleteSubmenuRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteSubmenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteSubmenuRequest class destructor
+ **/
+ virtual ~UIDeleteSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h
new file mode 100644
index 0000000000..8bbab99468
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIDeleteSubmenuResponse command class
+ **/
+class UIDeleteSubmenuResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteSubmenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteSubmenuResponse class destructor
+ **/
+ virtual ~UIDeleteSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..9e8e11c1ad
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruRequest command class
+ * When this request is invoked, the audio capture stops
+ **/
+class UIEndAudioPassThruRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIEndAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIEndAudioPassThruRequest class destructor
+ **/
+ virtual ~UIEndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..740fc5501d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruResponse command class
+ **/
+class UIEndAudioPassThruResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIEndAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIEndAudioPassThruResponse class destructor
+ **/
+ virtual ~UIEndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h
new file mode 100644
index 0000000000..2d0469d6a6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesRequest command class
+ **/
+class UIGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetCapabilitiesRequest class destructor
+ **/
+ virtual ~UIGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h
new file mode 100644
index 0000000000..dc6052e049
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesResponse command class
+ **/
+class UIGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetCapabilitiesResponse class destructor
+ **/
+ virtual ~UIGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h
new file mode 100644
index 0000000000..4fca4826be
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageRequest command class
+ **/
+class UIGetLanguageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetLanguageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetLanguageRequest class destructor
+ **/
+ virtual ~UIGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h
new file mode 100644
index 0000000000..ea43e3856d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageResponse command class
+ **/
+class UIGetLanguageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetLanguageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetLanguageResponse class destructor
+ **/
+ virtual ~UIGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
new file mode 100644
index 0000000000..cc0e70feae
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesRequest command class
+ **/
+class UIGetSupportedLanguagesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetSupportedLanguagesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
new file mode 100644
index 0000000000..15e400687f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesResponse command class
+ **/
+class UIGetSupportedLanguagesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetSupportedLanguagesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
new file mode 100644
index 0000000000..5e2cb7ef9f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyRequest command class
+ **/
+class UIIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIIsReadyRequest class destructor
+ **/
+ virtual ~UIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h
new file mode 100644
index 0000000000..bc7210f2a8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyResponse command class
+ **/
+class UIIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIIsReadyResponse class destructor
+ **/
+ virtual ~UIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..94bc4827a9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruRequest command class
+ **/
+class UIPerformAudioPassThruRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformAudioPassThruRequest class destructor
+ **/
+ virtual ~UIPerformAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..04afedfba0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruResponse command class
+ **/
+class UIPerformAudioPassThruResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformAudioPassThruResponse class destructor
+ **/
+ virtual ~UIPerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
new file mode 100644
index 0000000000..0d63139437
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionRequest command class
+ **/
+class UIPerformInteractionRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformInteractionRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformInteractionRequest class destructor
+ **/
+ virtual ~UIPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CREATE_INTERACTION_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h
new file mode 100644
index 0000000000..32a87c73c2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionResponse command class
+ **/
+class UIPerformInteractionResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformInteractionResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformInteractionResponse class destructor
+ **/
+ virtual ~UIPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h
new file mode 100644
index 0000000000..6f23d3b21c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageRequest command class
+ **/
+class UIScrollableMessageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIScrollableMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIScrollableMessageRequest class destructor
+ **/
+ virtual ~UIScrollableMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h
new file mode 100644
index 0000000000..7bf15a0511
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageResponse command class
+ **/
+class UIScrollableMessageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIScrollableMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIScrollableMessageResponse class destructor
+ **/
+ virtual ~UIScrollableMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h
new file mode 100644
index 0000000000..7e67912f53
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutRequest command class
+ **/
+class UiSetDisplayLayoutRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UiSetDisplayLayoutRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UiSetDisplayLayoutRequest class destructor
+ **/
+ virtual ~UiSetDisplayLayoutRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
new file mode 100644
index 0000000000..74df2030e5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutResponse command class
+ **/
+class UiSetDisplayLayoutResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UiSetDisplayLayoutResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UiSetDisplayLayoutResponse class destructor
+ **/
+ virtual ~UiSetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h
new file mode 100644
index 0000000000..f3f7d0e733
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesRequest command class
+ **/
+class UISetGlobalPropertiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIShowRequest class destructor
+ **/
+ virtual ~UISetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h
new file mode 100644
index 0000000000..bc00397e37
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesResponse command class
+ **/
+class UISetGlobalPropertiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~UISetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
new file mode 100644
index 0000000000..1541aada6b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetIconRequest command class
+ **/
+class UISetIconRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetIconRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetIconRequest class destructor
+ **/
+ virtual ~UISetIconRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetIconRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h
new file mode 100644
index 0000000000..f125f64282
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetIconResponse command class
+ **/
+class UISetIconResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetIconResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetIconResponse class destructor
+ **/
+ virtual ~UISetIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetIconResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
new file mode 100644
index 0000000000..44cbbbfcf9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerRequest command class
+ **/
+class UISetMediaClockTimerRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetMediaClockTimerRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetMediaClockTimerRequest class destructor
+ **/
+ virtual ~UISetMediaClockTimerRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
new file mode 100644
index 0000000000..dd46f128d9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerResponse command class
+ **/
+class UISetMediaClockTimerResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetMediaClockTimerResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetMediaClockTimerResponse class destructor
+ **/
+ virtual ~UISetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h
new file mode 100644
index 0000000000..6f22263e61
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIShowRequest command class
+ **/
+class UIShowRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIShowRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIShowRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIShowRequest class destructor
+ **/
+ virtual ~UIShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h
new file mode 100644
index 0000000000..a6391fa6c9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIShowResponse command class
+ **/
+class UIShowResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIShowResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIShowResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIShowResponse class destructor
+ **/
+ virtual ~UIShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h
new file mode 100644
index 0000000000..5cb31b4a95
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class UISliderRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISliderRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISliderRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISliderRequest class destructor
+ **/
+ virtual ~UISliderRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h
new file mode 100644
index 0000000000..aae5408e21
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISliderResponse command class
+ **/
+class UISliderResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISliderResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISliderResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISliderResponse class destructor
+ **/
+ virtual ~UISliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h
new file mode 100644
index 0000000000..d2307232e3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListRequest command class
+ **/
+class UpdateAppListRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UpdateAppListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateAppListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateAppListRequest class destructor
+ **/
+ virtual ~UpdateAppListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h
new file mode 100644
index 0000000000..3e6a1d78a2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListResponse command class
+ **/
+class UpdateAppListResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateAppListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateAppListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateAppListResponse class destructor
+ **/
+ virtual ~UpdateAppListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h
new file mode 100644
index 0000000000..e9a32e9fc4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListRequest command class
+ **/
+class UpdateDeviceListRequest : public RequestToHMI,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief UpdateDeviceListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateDeviceListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateDeviceListRequest class destructor
+ **/
+ ~UpdateDeviceListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ * Need to observe OnHMIReady event, to send UpdateDeviceListRequest
+ * when HMI will be ready
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Need to stop execution StopMethod if HMI did not started
+ */
+ virtual bool CleanUp();
+
+ private:
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::ConditionalVariable termination_condition_;
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
new file mode 100644
index 0000000000..d4191c8bee
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListResponse command class
+ **/
+class UpdateDeviceListResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateDeviceListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateDeviceListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateDeviceListResponse class destructor
+ **/
+ virtual ~UpdateDeviceListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h
new file mode 100644
index 0000000000..506c137861
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLRequest command class
+ **/
+class UpdateSDLRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UpdateSDLRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateSDLRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateSDLRequest class destructor
+ **/
+ virtual ~UpdateSDLRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h
new file mode 100644
index 0000000000..729483cfa1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLResponse command class
+ **/
+class UpdateSDLResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateSDLResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateSDLResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateSDLResponse class destructor
+ **/
+ virtual ~UpdateSDLResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
new file mode 100644
index 0000000000..90e1e145c2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageRequest command class
+ **/
+class VIDiagnosticMessageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIDiagnosticMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIDiagnosticMessageRequest class destructor
+ **/
+ virtual ~VIDiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
new file mode 100644
index 0000000000..f332a32812
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageResponse command class
+ **/
+class VIDiagnosticMessageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIDiagnosticMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIDiagnosticMessageResponse class destructor
+ **/
+ virtual ~VIDiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h
new file mode 100644
index 0000000000..93f046d7d6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsRequest command class
+ **/
+class VIGetDTCsRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetDTCsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetDTCsRequest class destructor
+ **/
+ virtual ~VIGetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h
new file mode 100644
index 0000000000..9ee7fac44a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsResponse command class
+ **/
+class VIGetDTCsResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetDTCsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetDTCsResponse class destructor
+ **/
+ virtual ~VIGetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
new file mode 100644
index 0000000000..9cb964981c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataRequest command class
+ **/
+class VIGetVehicleDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleDataRequest class destructor
+ **/
+ virtual ~VIGetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
new file mode 100644
index 0000000000..951bf0c334
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataRequestTemplate command class
+ *
+ * Template class for sending 1 subscribe thin request
+ **/
+template<event_engine::Event::EventID eventID>
+class VIGetVehicleDataRequestTemplate : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataRequestTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+ }
+
+ /**
+ * @brief Execute command with sending DBus thin request to HMI
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleDataRequestTemplate::Run");
+ SendRequest();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequestTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
new file mode 100644
index 0000000000..952b0fb4d3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataResponse command class
+ **/
+class VIGetVehicleDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleDataResponse class destructor
+ **/
+ virtual ~VIGetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
new file mode 100644
index 0000000000..ecd465365a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataResponseTemplate command class
+ **/
+template<event_engine::Event::EventID eventID>
+class VIGetVehicleDataResponseTemplate : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataResponseTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleDataResponseTemplate::Run");
+ event_engine::Event event(eventID);
+ event.set_smart_object(*message_);
+ event.raise();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponseTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
new file mode 100644
index 0000000000..876f7d2e55
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeRequest command class
+ **/
+class VIGetVehicleTypeRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleTypeRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleTypeRequest class destructor
+ **/
+ virtual ~VIGetVehicleTypeRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
new file mode 100644
index 0000000000..8b632182f0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeResponse command class
+ **/
+class VIGetVehicleTypeResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleTypeResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleTypeResponse class destructor
+ **/
+ virtual ~VIGetVehicleTypeResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
new file mode 100644
index 0000000000..e905cf4c09
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyRequest command class
+ **/
+class VIIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIIsReadyRequest class destructor
+ **/
+ virtual ~VIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h
new file mode 100644
index 0000000000..e13e368b34
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyResponse command class
+ **/
+class VIIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIIsReadyResponse class destructor
+ **/
+ virtual ~VIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h
new file mode 100644
index 0000000000..336ad4443a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDRequest command class
+ **/
+class VIReadDIDRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIReadDIDRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIReadDIDRequest class destructor
+ **/
+ virtual ~VIReadDIDRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h
new file mode 100644
index 0000000000..af66505174
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDResponse command class
+ **/
+class VIReadDIDResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIReadDIDResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIReadDIDResponse class destructor
+ **/
+ virtual ~VIReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..ef14a05f2d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataRequest command class
+ **/
+class VISubscribeVehicleDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VISubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VISubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
new file mode 100644
index 0000000000..bcfa2f6f1a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VISubscriveVehicleDataRequestTemplate command class
+ *
+ * Template class for sending 1 subscribe thin request
+ **/
+template<event_engine::Event::EventID eventID>
+class VISubscribeVehicleDataRequestTemplate : public RequestToHMI {
+ public:
+ /**
+ * @brief VISubscriveVehicleDataRequestTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataRequestTemplate(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+ }
+
+ /**
+ * @brief Execute command with sending DBus thin request to HMI
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VISubscriveVehicleDataRequestTemplate::Run");
+ SendRequest();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequestTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..057fd52e13
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataResponse command class
+ **/
+class VISubscribeVehicleDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VISubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VISubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
new file mode 100644
index 0000000000..740d8c386a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+/**
+ * @brief VISubscriveVehicleDataResponseTemplate command class
+ **/
+template<event_engine::Event::EventID eventID>
+class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscriveVehicleDataResponseTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataResponseTemplate(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VISubscribeVehicleDataResponse::Run");
+ event_engine::Event event(eventID);
+ event.set_smart_object(*message_);
+ event.raise();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..18d118fadb
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataRequest command class
+ **/
+class VIUnsubscribeVehicleDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
new file mode 100644
index 0000000000..d604d4d536
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIUnsubscriveVehicleDataRequestTemplate command class
+ *
+ * Template class for sending 1 unsubscribe thin request
+ **/
+template<event_engine::Event::EventID eventID>
+class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI {
+ public:
+ /**
+ * @brief VIUnsubscriveVehicleDataRequestTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataRequestTemplate(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+ }
+
+ /**
+ * @brief Execute command with sending DBus thin request to HMI
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIUnsubscriveVehicleDataRequestTemplate::Run");
+ SendRequest();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequestTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..b71b8241f5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataResponse command class
+ **/
+class VIUnsubscribeVehicleDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
new file mode 100644
index 0000000000..8730cc0361
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIUnsubscriveVehicleDataResponseTemplate command class
+ **/
+template<event_engine::Event::EventID eventID>
+class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscriveVehicleDataResponseTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataResponseTemplate(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIUnsubscriveVehicleDataResponseTemplate::Run");
+ event_engine::Event event(eventID);
+ event.set_smart_object(*message_);
+ event.raise();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h
new file mode 100644
index 0000000000..3675cfb153
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandRequest command class
+ **/
+class VRAddCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRAddCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRAddCommandRequest class destructor
+ **/
+ virtual ~VRAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h
new file mode 100644
index 0000000000..328e8a2058
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandResponse command class
+ **/
+class VRAddCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRAddCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRAddCommandResponse class destructor
+ **/
+ virtual ~VRAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h
new file mode 100644
index 0000000000..5e69b4c18b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationRequest command class
+ **/
+class VRChangeRegistrationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRChangeRegistrationRequest class destructor
+ **/
+ virtual ~VRChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h
new file mode 100644
index 0000000000..f79da44598
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationResponse command class
+ **/
+class VRChangeRegistrationResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRChangeRegistrationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRChangeRegistrationResponse class destructor
+ **/
+ virtual ~VRChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h
new file mode 100644
index 0000000000..b843f498f8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandRequest command class
+ **/
+class VRDeleteCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRDeleteCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRDeleteCommandRequest class destructor
+ **/
+ virtual ~VRDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h
new file mode 100644
index 0000000000..11a681bd5e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandResponse command class
+ **/
+class VRDeleteCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRDeleteCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRDeleteCommandResponse class destructor
+ **/
+ virtual ~VRDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
new file mode 100644
index 0000000000..7771bdd141
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesRequest command class
+ **/
+class VRGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetCapabilitiesRequest class destructor
+ **/
+ virtual ~VRGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
new file mode 100644
index 0000000000..ced60c9d65
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesResponse command class
+ **/
+class VRGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetCapabilitiesResponse class destructor
+ **/
+ virtual ~VRGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h
new file mode 100644
index 0000000000..955355d06c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageRequest command class
+ **/
+class VRGetLanguageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetLanguageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetLanguageRequest class destructor
+ **/
+ virtual ~VRGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h
new file mode 100644
index 0000000000..2bd59b8be2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageResponse command class
+ **/
+class VRGetLanguageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetLanguageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetLanguageResponse class destructor
+ **/
+ virtual ~VRGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
new file mode 100644
index 0000000000..79105978b0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesRequest command class
+ **/
+class VRGetSupportedLanguagesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetSupportedLanguagesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
new file mode 100644
index 0000000000..38f5056225
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesResponse command class
+ **/
+class VRGetSupportedLanguagesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetSupportedLanguagesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
new file mode 100644
index 0000000000..ac734638b1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyRequest command class
+ **/
+class VRIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRIsReadyRequest class destructor
+ **/
+ virtual ~VRIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h
new file mode 100644
index 0000000000..4f4f86d84c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyResponse command class
+ **/
+class VRIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRIsReadyResponse class destructor
+ **/
+ virtual ~VRIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
new file mode 100644
index 0000000000..b71b31baf5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRPerformInteractionRequest command class
+ **/
+class VRPerformInteractionRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRPerformInteractionRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRPerformInteractionRequest class destructor
+ **/
+ virtual ~VRPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h
new file mode 100644
index 0000000000..fbf5b87cb6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSPerformInteractionResponse command class
+ **/
+class VRPerformInteractionResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRPerformInteractionResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSPerformInteractionResponse class destructor
+ **/
+ virtual ~VRPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
new file mode 100644
index 0000000000..fc683988bf
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
@@ -0,0 +1,147 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddCommandRequest command class
+ **/
+class AddCommandRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddCommandRequest class destructor
+ **/
+ virtual ~AddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+
+ /*
+ * @brief Check if command name doesn't exist in application
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandName(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command VR synonyms doesn't exist in application commands
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandVRSynonym(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command parent ID exists in submenu map
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandParentId(ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Removes command from list when HMI sends negative response or
+ * HMI does not answer on addCommand request.
+ */
+ void RemoveCommand();
+
+ DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks add command param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if add command contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ bool send_ui_;
+ bool send_vr_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
new file mode 100644
index 0000000000..67a49a8e17
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddCommandResponse command class
+ **/
+class AddCommandResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddCommandResponse class destructor
+ **/
+ virtual ~AddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
new file mode 100644
index 0000000000..befeb76d9f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuRequest command class
+ **/
+class AddSubMenuRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AddSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddSubMenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddSubMenuRequest class destructor
+ **/
+ virtual ~AddSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+
+ /*
+ * @brief Check if submenu name is valid
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckSubMenuName();
+
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
new file mode 100644
index 0000000000..62c404951a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuResponse command class
+ **/
+class AddSubMenuResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AddSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddSubMenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddSubMenuResponse class destructor
+ **/
+ virtual ~AddSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
new file mode 100644
index 0000000000..02423f0630
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverRequest command class
+ **/
+class AlertManeuverRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertManeuverRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertManeuverRequest class destructor
+ **/
+ virtual ~AlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks alert maneuver params(ttsChunks, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if alert maneuver contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ mobile_apis::Result::eType tts_speak_result_code_;
+ mobile_apis::Result::eType navi_alert_maneuver_result_code_;
+ Pending pending_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
new file mode 100644
index 0000000000..5f0827699b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverResponse command class
+ **/
+class AlertManeuverResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertManeuverResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertManeuverResponse class destructor
+ **/
+ virtual ~AlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
new file mode 100644
index 0000000000..705a1d1454
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
@@ -0,0 +1,142 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertRequest command class
+ **/
+class AlertRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertRequest class destructor
+ **/
+ virtual ~AlertRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /*
+ * @brief Will caled by request controller, when default will be expired.
+ * If Alert request has soft buttons, timeout response should not be sent to mobile
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ protected:
+
+ private:
+ /*
+ * @brief Checks if request parameters are valid
+ * @param app_id Id of application requested this RPC
+ * @returns true if request is valid and should be processed
+ */
+ bool Validate(uint32_t app_id);
+ /*
+ * @brief Sends UI Alert request
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendAlertRequest(int32_t app_id);
+
+ /*
+ * @brief Sends TTS Speak request
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendSpeakRequest(int32_t app_id);
+
+ /*
+ * @brief Sends Basic communication playtone notification
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendPlayToneNotification(int32_t app_id);
+
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ bool HasHmiResponsesToWait();
+
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfAlertRequest();
+
+ bool awaiting_ui_alert_response_;
+ bool awaiting_tts_speak_response_;
+ bool awaiting_tts_stop_speaking_response_;
+ bool response_success_;
+ bool flag_other_component_sent_;
+ mobile_apis::Result::eType response_result_;
+ smart_objects::SmartObject response_params_;
+ mobile_apis::Result::eType tts_speak_response_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
new file mode 100644
index 0000000000..59b38933a7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertResponse command class
+ **/
+class AlertResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertResponse class destructor
+ **/
+ virtual ~AlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
new file mode 100644
index 0000000000..3de3e8fc2f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
@@ -0,0 +1,162 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+
+#include <strings.h>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ChangeRegistrationRequest command class
+ **/
+class ChangeRegistrationRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ChangeRegistrationRequest class destructor
+ **/
+ virtual ~ChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Search for requested language in HMI UI supported languages
+ *
+ * @return true if language supported by UI, otherwise false
+ */
+ bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI VR supported languages
+ *
+ * @return true if language supported by VR, otherwise false
+ */
+ bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI TTS supported languages
+ *
+ * @return true if language supported by TTS, otherwise false
+ */
+ bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /*
+ * @brief Checks result codes
+ *
+ * @return true if one of result codes is success
+ */
+ static bool WasAnySuccess(const hmi_apis::Common_Result::eType ui,
+ const hmi_apis::Common_Result::eType vr,
+ const hmi_apis::Common_Result::eType tts);
+
+ /**
+ * @brief Checks change_registration params(ttsName, appname,
+ * ngnMediaScreenAppName, vrSynonyms) on invalid characters.
+ *
+ * @return true if command contains \t\n \\t \\n of whitespace otherwise
+ * returns false.
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Check parameters (name, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * @return SUCCESS if there is no coincidence of app.name/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /**
+ * @brief Predicate for using with CheckCoincidence method to compare with VR synonym SO
+ *
+ * @return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ explicit CoincidencePredicateVR(const std::string &newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ const std::string vr_synonym = obj.asString();
+ return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str()));
+ };
+
+ const std::string &newItem_;
+ };
+
+ Pending pending_requests_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
new file mode 100644
index 0000000000..2cac5f2d58
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ChangeRegistrationResponse command class
+ **/
+class ChangeRegistrationResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ChangeRegistrationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ChangeRegistrationResponse class destructor
+ **/
+ virtual ~ChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
new file mode 100644
index 0000000000..1936c9678e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
@@ -0,0 +1,179 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetRequest command class
+ **/
+class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CreateInteractionChoiceSetRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief CreateInteractionChoiceSetRequest class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /*
+ * @brief Sends VR AddCommand request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRAddCommandRequest(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks incoming choiseSet params.
+ * @param app Registred mobile application
+ *
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType CheckChoiceSet(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare choice ID param
+ *
+ * return TRUE if there is coincidence of choice ID, otherwise FALSE
+ */
+ struct CoincidencePredicateChoiceID {
+ explicit CoincidencePredicateChoiceID(const uint32_t newItem)
+ :newItem_(newItem)
+ {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[strings::choice_id].asUInt() == newItem_;
+ }
+
+ const uint32_t newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare menu name param
+ *
+ * return TRUE if there is coincidence of menu name, otherwise FALSE
+ */
+ struct CoincidencePredicateMenuName {
+ explicit CoincidencePredicateMenuName(const std::string& newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[strings::menu_name].asString() == newItem_;
+ };
+
+ const std::string& newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare VR commands param
+ *
+ * return TRUE if there is coincidence of VR commands, otherwise FALSE
+ */
+ struct CoincidencePredicateVRCommands {
+ explicit CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return compareStr(obj, newItem_);
+ };
+
+ const smart_objects::SmartObject& newItem_;
+ };
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param choice1 Choice to compare
+ * @param choice2 Choice to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool compareSynonyms(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2);
+
+ /*
+ * @brief Checks VR synonyms ignoring differences in case.
+ *
+ * @param str1 VR synonym to compare
+ * @param str2 VR synonym to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ static bool compareStr(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2);
+
+ /**
+ * @brief Checks choice set params(menuName, tertiaryText, ...)
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @param choice_set which must check
+ * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
+
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
new file mode 100644
index 0000000000..965573f4a4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetResponse command class
+ **/
+class CreateInteractionChoiceSetResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CreateInteractionChoiceSetResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief CreateInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
new file mode 100644
index 0000000000..bae0fedd54
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandRequest command class
+ **/
+class DeleteCommandRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteCommandRequest class destructor
+ **/
+ virtual ~DeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ bool is_ui_send_;
+ bool is_vr_send_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
new file mode 100644
index 0000000000..0fe0f0959b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandResponse command class
+ **/
+class DeleteCommandResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteCommandResponse class destructor
+ **/
+ virtual ~DeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
new file mode 100644
index 0000000000..4927227465
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
@@ -0,0 +1,77 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+struct AppFile;
+
+namespace commands {
+
+/**
+ * @brief DeleteFileRequest command class
+ **/
+class DeleteFileRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteFileRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteFileRequest class destructor
+ **/
+ virtual ~DeleteFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileRequest);
+
+ void SendFileRemovedNotification(const AppFile* file) const;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
new file mode 100644
index 0000000000..cfe6aaa4fa
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteFileResponse command class
+ **/
+class DeleteFileResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteFileResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteFileResponse class destructor
+ **/
+ virtual ~DeleteFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
new file mode 100644
index 0000000000..283b882fad
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
@@ -0,0 +1,84 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetRequest command class
+ **/
+class DeleteInteractionChoiceSetRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class destructor
+ **/
+ virtual ~DeleteInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /*
+ * @brief Check if requested choice set ID in use by perform interaction
+ *
+ * @param app mobile application
+ */
+ bool ChoiceSetInUse(ApplicationConstSharedPtr app);
+
+ void SendVrDeleteCommand(ApplicationSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
new file mode 100644
index 0000000000..1f641e15b3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetResponse command class
+ **/
+class DeleteInteractionChoiceSetResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~DeleteInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_COMMAND_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
new file mode 100644
index 0000000000..6687218051
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
@@ -0,0 +1,99 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteSubMenuRequest command class
+ **/
+class DeleteSubMenuRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteSubMenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteSubMenuRequest class destructor
+ **/
+ virtual ~DeleteSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Deletes VR commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuVRCommands(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Deletes UI commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuUICommands(ApplicationSharedPtr const app);
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
new file mode 100644
index 0000000000..0bb080e93e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class DeleteSubMenuResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteSubMenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteSubMenuResponse class destructor
+ **/
+ virtual ~DeleteSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_COMMAND_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
new file mode 100644
index 0000000000..4cda040b42
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageRequest command class
+ **/
+class DiagnosticMessageRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DiagnosticMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DiagnosticMessageRequest class destructor
+ **/
+ virtual ~DiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
new file mode 100644
index 0000000000..1b6a6024f4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageResponse command class
+ **/
+class DiagnosticMessageResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DiagnosticMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DiagnosticMessageResponse class destructor
+ **/
+ virtual ~DiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
new file mode 100644
index 0000000000..10ffa5b324
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DialNumber request command class
+ **/
+class DialNumberRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief DialNumberRequest class constructor
+ **/
+ explicit DialNumberRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief DialNumberRequest class destructor
+ **/
+ virtual ~DialNumberRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..f291f7a748
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruRequest command class
+ **/
+class EndAudioPassThruRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit EndAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief EndAudioPassThruRequest class destructor
+ **/
+ virtual ~EndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..5ad5f85e6e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruResponse command class
+ **/
+class EndAudioPassThruResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit EndAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief EndAudioPassThruResponse class destructor
+ **/
+ virtual ~EndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
new file mode 100644
index 0000000000..c3b39bf917
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class GenericResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief GenericResponse class constructor
+ **/
+ explicit GenericResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+ }
+
+ /**
+ * \brief GenericResponse class destructor
+ **/
+ virtual ~GenericResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GenericResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
new file mode 100644
index 0000000000..d76ac253bc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetDTCsRequest command class
+ **/
+class GetDTCsRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief GetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetDTCsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetDTCsRequest class destructor
+ **/
+ virtual ~GetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
new file mode 100644
index 0000000000..69ff1fca59
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetDTCsResponse command class
+ **/
+class GetDTCsResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief GetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetDTCsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetDTCsResponse class destructor
+ **/
+ virtual ~GetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
new file mode 100644
index 0000000000..db9db7b0a7
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class SmartObject;
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataRequest command class
+ **/
+class GetVehicleDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief GetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetVehicleDataRequest class destructor
+ **/
+ virtual ~GetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+
+ protected:
+ virtual void on_event(const event_engine::Event& event);
+
+#ifdef HMI_DBUS_API
+ private:
+ void SendRequestsToHmi(const int32_t app_id);
+
+ struct HmiRequest {
+ hmi_apis::Common_Result::eType status;
+ bool complete;
+ smart_objects::SmartObject value;
+ const char* str;
+ hmi_apis::FunctionID::eType func_id;
+ };
+
+ typedef std::vector<HmiRequest> HmiRequests;
+ HmiRequests hmi_requests_;
+#endif // #ifdef HMI_DBUS_API
+
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
new file mode 100644
index 0000000000..f0306df6aa
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataResponse command class
+ **/
+class GetVehicleDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief GetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetVehicleDataResponse class destructor
+ **/
+ virtual ~GetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
new file mode 100644
index 0000000000..86171f1ff8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ListFilesRequest command class
+ **/
+class ListFilesRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ListFilesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ListFilesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ListFilesRequest class destructor
+ **/
+ virtual ~ListFilesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
new file mode 100644
index 0000000000..6f8e80bae2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ListFilesResponse command class
+ **/
+class ListFilesResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ListFilesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ListFilesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ListFilesResponse class destructor
+ **/
+ virtual ~ListFilesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
new file mode 100644
index 0000000000..8753660470
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
@@ -0,0 +1,74 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppInterfaceUnregisteredNotification class
+ **/
+class OnAppInterfaceUnregisteredNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppInterfaceUnregisteredNotification(
+ const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class destructor
+ **/
+ virtual ~OnAppInterfaceUnregisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppInterfaceUnregisteredNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
new file mode 100644
index 0000000000..67bc319771
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
@@ -0,0 +1,74 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAudioPassThruNotification class used to send notification with binary data written from
+ * microphone to mobile device while PerformAudioPassThru is active.
+ **/
+class OnAudioPassThruNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAudioPassThruNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAudioPassThruNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAudioPassThruNotification class destructor
+ **/
+ virtual ~OnAudioPassThruNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAudioPassThruNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
new file mode 100644
index 0000000000..d1297ba980
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
@@ -0,0 +1,86 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonEventNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonEventNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnButtonEventNotification class destructor
+ **/
+ virtual ~OnButtonEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button event notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonEvent(ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
new file mode 100644
index 0000000000..0ebdb6d7c6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonPressNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonPressNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonPressNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnButtonEventCommand class destructor
+ **/
+ virtual ~OnButtonPressNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button press notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonPress(ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
new file mode 100644
index 0000000000..751b1e7dd2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief OnCommandNotification class is used to send notification
+ * to mobile device.
+ **/
+class OnCommandNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnCommandNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnCommandNotification class destructor
+ **/
+ virtual ~OnCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnCommandNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..2f2a3c81fc
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
@@ -0,0 +1,77 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnDriverDistractionNotification class
+ **/
+class OnDriverDistractionNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDriverDistractionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
new file mode 100644
index 0000000000..be83047863
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+namespace mobile {
+
+/**
+ * @brief OnHashChangeNotification class
+ **/
+class OnHashChangeNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHashChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnHashChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnHashChangeNotification class destructor
+ **/
+ virtual ~OnHashChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
new file mode 100644
index 0000000000..aefa7f9c24
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnHMIStatusNotification class
+ **/
+class OnHMIStatusNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHMIStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnHMIStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnHMIStatusNotification class destructor
+ **/
+ virtual ~OnHMIStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h
new file mode 100644
index 0000000000..e0d6a258e9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnKeyBoardInputNotification class
+ **/
+class OnKeyBoardInputNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnKeyBoardInputNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnKeyBoardInputNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
new file mode 100644
index 0000000000..d163114890
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnLanguageChangeNotification class
+ **/
+class OnLanguageChangeNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnLanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnLanguageChangeNotification class destructor
+ **/
+ virtual ~OnLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnLanguageChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
new file mode 100644
index 0000000000..3cffe8ff49
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnPermissionsChangeNotification class
+ **/
+class OnPermissionsChangeNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnPermissionsChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPermissionsChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPermissionsChangeNotification class destructor
+ **/
+ virtual ~OnPermissionsChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPermissionsChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
new file mode 100644
index 0000000000..183b673afd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+
+#include "application_manager/commands/command_notification_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnSystemRequestNotification class
+ **/
+class OnSystemRequestNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemRequestNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemRequestNotification class destructor
+ **/
+ virtual ~OnSystemRequestNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
new file mode 100644
index 0000000000..5c34caba36
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTBTClientStateNotification class
+ **/
+class OnTBTClientStateNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTBTClientStateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTBTClientStateNotification class destructor
+ **/
+ virtual ~OnTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTBTClientStateNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h
new file mode 100644
index 0000000000..1aba3087dd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnTouchEventNotification class
+ **/
+class OnTouchEventNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTouchEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTouchEventNotification class destructor
+ **/
+ virtual ~OnTouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTouchEventNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
new file mode 100644
index 0000000000..7e64f19639
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVehicleDataNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnVehicleDataNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVehicleDataNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVehicleDataNotification class destructor
+ **/
+ virtual ~OnVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends vehicle data notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendVehicleData(ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnVehicleDataNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..62ca1257bb
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
@@ -0,0 +1,132 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruRequest command class
+ **/
+class PerformAudioPassThruRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformAudioPassThruRequest class destructor
+ **/
+ virtual ~PerformAudioPassThruRequest();
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sends TTS Speak request
+ */
+ void SendSpeakRequest();
+
+ /*
+ * @brief Sends UI PerformAudioPassThru request
+ */
+ void SendPerformAudioPassThruRequest();
+
+ /*
+ * @brief Sends UI RecordStart notification after TTS Speak response received.
+ * Indicates that capturing mic data should be started
+ */
+ void SendRecordStartNotification();
+
+ /*
+ * @brief Starts microphone recording
+ */
+ void StartMicrophoneRecording();
+
+ /**
+ * @brief Checks perform audio pass thru params(initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform audio pass thru contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
+ * TTS_StopSpeaking to HMI
+ */
+ void FinishTTSSpeak();
+
+ //flag display state of speak during perform audio pass thru
+ bool is_active_tts_speak_;
+ mobile_apis::Result::eType result_tts_speak_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..d659e59be0
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruResponse command class
+ **/
+class PerformAudioPassThruResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformAudioPassThruResponse class destructor
+ **/
+ virtual ~PerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
new file mode 100644
index 0000000000..ce85a70176
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
@@ -0,0 +1,220 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/timer_thread.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionRequest command class
+ **/
+class PerformInteractionRequest : public CommandRequestImpl {
+
+ public:
+ /**
+ * @brief PerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformInteractionRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformInteractionRequest class destructor
+ **/
+ virtual ~PerformInteractionRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Timer callback function
+ *
+ */
+ void onTimer();
+
+ private:
+ /*
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /*
+ * @brief Function will be called when VR_OnCommand event
+ * comes
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessVRResponse(const smart_objects::SmartObject& message);
+
+ /*
+ * @brief Sends PerformInteraction response to mobile side
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessPerformInteractionResponse
+ (const smart_objects::SmartObject& message);
+
+
+ /*
+ * @brief Sends UI PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendUIPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends TTS PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends UI Show VR help request to HMI
+ *
+ * @param app_id Application ID
+ */
+ void SendUIShowVRHelpRequest(ApplicationSharedPtr const app);
+
+ /**
+ * @brief Creates and Sends Perform interaction to UI.
+ */
+ void CreateUIPerformInteraction(const smart_objects::SmartObject& msg_params,
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar menu names.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar menu names in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetMenuNames(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetVRSynonyms(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if request with non-sequential positions of vrHelpItems
+ * SDLAQ-CRS-466
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE if vrHelpItems positions are sequential,
+ * otherwise FALSE
+ */
+ bool CheckVrHelpItemPositions(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Disable PerformInteraction state in application and
+ * delete VR commands from HMI
+ */
+ void DisablePerformInteraction();
+
+ /**
+ * @brief Checks perform interaction params(initialText, initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform interaction contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Send HMI close PopUp and call DisablePerformInteraction
+ */
+ void TerminatePerformInteraction();
+
+ /**
+ * @brief Checks parameter ChoiceID from response.
+ * @param app contains pointer to application
+ * @param choice_id contains ChoiceID from response.
+ * @return if ChoiceID from response is correct method returns TRUE
+ * otherwise returns FALSE.
+ */
+ bool CheckChoiceIDFromResponse(ApplicationSharedPtr app, int32_t choice_id);
+
+ // members
+ timer::TimerThread<PerformInteractionRequest> timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
+ mobile_apis::Result::eType vr_perform_interaction_code_;
+ mobile_apis::InteractionMode::eType interaction_mode_;
+ bool ui_response_recived;
+ bool vr_response_recived;
+
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
new file mode 100644
index 0000000000..4ecc149fb4
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionResponse command class
+ **/
+class PerformInteractionResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformInteractionResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformInteractionResponse class destructor
+ **/
+ virtual ~PerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
new file mode 100644
index 0000000000..8a94a708a1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PutFileRequest command class
+ **/
+class PutFileRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief PutFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PutFileRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief PutFileRequest class destructor
+ **/
+ virtual ~PutFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ int64_t offset_;
+ std::string sync_file_name_;
+ int64_t length_;
+ mobile_apis::FileType::eType file_type_;
+ bool is_persistent_file_;
+
+ void SendOnPutFileNotification();
+ DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
new file mode 100644
index 0000000000..89ff6ad08f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PutFileResponse command class
+ **/
+class PutFileResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief PutFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PutFileResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief PutFileResponse class destructor
+ **/
+ virtual ~PutFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PutFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h
new file mode 100644
index 0000000000..e2e5dbf3da
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ReadDIDRequest command class
+ **/
+class ReadDIDRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ReadDIDRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ReadDIDRequest class destructor
+ **/
+ virtual ~ReadDIDRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h
new file mode 100644
index 0000000000..80b9b5ea48
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ReadDIDResponse command class
+ **/
+class ReadDIDResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ReadDIDResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ReadDIDResponse class destructor
+ **/
+ virtual ~ReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
new file mode 100644
index 0000000000..9c1d46368f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
@@ -0,0 +1,174 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+
+#include <string.h>
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace policy {
+struct DeviceInfo;
+}
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceRequest class constructor
+ **/
+ explicit RegisterAppInterfaceRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief RegisterAppInterfaceRequest class destructor
+ **/
+ virtual ~RegisterAppInterfaceRequest();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ // virtual void cleanUp() = 0;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Sends RegisterAppInterface response to mobile
+ *
+ *@param application_impl application
+ *
+ **/
+ void SendRegisterAppInterfaceResponseToMobile(
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS);
+
+ private:
+ /*
+ * @brief Check new ID along with known mobile application ID
+ *
+ * return TRUE if ID is known already, otherwise - FALSE
+ */
+ bool IsApplicationWithSameAppIdRegistered();
+
+ /*
+ * @brief Check for some request param. names restrictions, e.g. for
+ * newline characters
+ *
+ * return SUCCESS if param name pass the check, otherwise - error code
+ * will be returned
+ */
+ mobile_apis::Result::eType CheckRestrictions() const;
+
+ /*
+ * @brief Removes hidden symbols and spaces
+ *
+ * return cleared copy of param name
+ */
+ std::string ClearParamName(std::string param_name) const;
+
+
+ /*
+ * @brief Check new application parameters (name, tts, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /*
+ * @brief Predicate for using with CheckCoincidence method to compare with VR synonym SO
+ *
+ * return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ explicit CoincidencePredicateVR(const std::string &newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ const std::string vr_synonym = obj.asString();
+ return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str()));
+ };
+
+ const std::string &newItem_;
+ };
+
+ /**
+ * @brief Check request parameters against policy table data
+ * @return SUCCESS if check ok, otherwise return appropriate error code
+ */
+ mobile_apis::Result::eType CheckWithPolicyData();
+
+ /**
+ * @brief Fill DeviceInfo struct with data from request, if any
+ * @param device_info Struct for device params from request
+ */
+ void FillDeviceInfo(policy::DeviceInfo* device_info);
+
+ /**
+ * @brief Checks register app interface params(ttsName, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if register app interface contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ std::string response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h
new file mode 100644
index 0000000000..1244cb65f8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceResponse class constructor
+ **/
+ explicit RegisterAppInterfaceResponse(const MessageSharedPtr& response)
+ : CommandResponseImpl(response) {
+ }
+
+ /**
+ * \brief RegisterAppInterfaceResponse class destructor
+ **/
+ virtual ~RegisterAppInterfaceResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void SetHeartBeatTimeout(uint32_t connection_key,
+ const std::string& mobile_app_id);
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
new file mode 100644
index 0000000000..d7abe38c11
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
@@ -0,0 +1,130 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesRequest command class
+ **/
+class ResetGlobalPropertiesRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ResetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ResetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~ResetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sets default value of the HELPPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ * @param is_timeout_promp Flag indicating that timeout prompt
+ * should be reset
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetHelpPromt(ApplicationSharedPtr app);
+
+ /*
+ * @brief Sets default value of the TIMEOUTPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sets default value of the VRHELPTITLE global property
+ * to the application name and value of the VRHELPITEMS global property
+ * to value equal to registered command -1(default command “Help / Cancel”.)
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetVrHelpTitleItems(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
+
+ bool is_ui_send_;
+ bool is_tts_send_;
+
+ bool is_ui_received_;
+ bool is_tts_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h
new file mode 100644
index 0000000000..7c0b8eb00b
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class ResetGlobalPropertiesResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ResetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ResetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~ResetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h
new file mode 100644
index 0000000000..a810f4eb2d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief scrollable message request command class
+ **/
+class ScrollableMessageRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ScrollableMessageRequest class constructor
+ **/
+ explicit ScrollableMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SliderCommand class destructor
+ **/
+ virtual ~ScrollableMessageRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h
new file mode 100644
index 0000000000..36fd311ad6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class ScrollableMessageResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief ScrollableMessageResponse class constructor
+ **/
+ explicit ScrollableMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakResponseCommand class destructor
+ **/
+ virtual ~ScrollableMessageResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h
new file mode 100644
index 0000000000..e178e284d9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h
@@ -0,0 +1,87 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief send location request command class
+ */
+class SendLocationRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SendLocationRquest class constructor
+ */
+ explicit SendLocationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SendLocationRquest class destructor
+ */
+ virtual ~SendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+
+ /**
+ * @brief Checks sendlocation params(locationName, locationDescription, ...).
+ * Checks string if it contains \t\n \\t \\n or whitespace
+ * @return true if string contains invalid characters, otherwise returns false
+ */
+ bool IsWhiteSpaceExist();
+
+
+ DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h
new file mode 100644
index 0000000000..6e18aa5f27
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+
+
+namespace application_manager {
+namespace commands {
+
+class SendLocationResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SendLocationResponse class constructor
+ */
+ explicit SendLocationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SendLocationResponse class destructor
+ */
+ virtual ~SendLocationResponse();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendLocationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h
new file mode 100644
index 0000000000..925a1cd67f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutRequest command class
+ **/
+class SetDisplayLayoutRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetDisplayLayoutRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetDisplayLayoutRequest class destructor
+ **/
+ virtual ~SetDisplayLayoutRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ **/
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h
new file mode 100644
index 0000000000..dbf3de8d88
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutResponse command class
+ **/
+class SetDisplayLayoutResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetDisplayLayoutResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetDisplayLayoutResponse class destructor
+ **/
+ virtual ~SetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
new file mode 100644
index 0000000000..d9e18dd76f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
@@ -0,0 +1,121 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~SetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Chec if HelpItems order is correct
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckVrHelpItemsOrder();
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /*
+ * @brief Checks if request has at least one parameter
+ *
+ * @param params request parameters
+ *
+ * @returns true if at least one parameter is present in object
+ */
+ static bool ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params);
+
+ /**
+ * @brief Checks set global properties params(helpPrompt, timeoutPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if set global properties contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
+
+ bool is_ui_send_;
+ bool is_tts_send_;
+
+ bool is_ui_received_;
+ bool is_tts_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h
new file mode 100644
index 0000000000..dd80e738e3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~SetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h
new file mode 100644
index 0000000000..d46094032a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetIconRequest command class
+ **/
+class SetIconRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief Contains information about the type of image
+ */
+ typedef enum {
+ STATIC = 0,
+ DYNAMIC
+ } ImageType;
+
+ /**
+ * @brief SetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetIconRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetIconRequest class destructor
+ **/
+ virtual ~SetIconRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetIconRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h
new file mode 100644
index 0000000000..88dceaf5a2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetIconResponse command class
+ **/
+class SetIconResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetIconResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetIconResponse class destructor
+ **/
+ virtual ~SetIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetIconResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h
new file mode 100644
index 0000000000..e4fae5c0b3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetMediaClockRequest request command class
+ **/
+class SetMediaClockRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief SetMediaClockRequest class constructor
+ **/
+ explicit SetMediaClockRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief ShowCommand class destructor
+ **/
+ virtual ~SetMediaClockRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ bool isDataValid();
+
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h
new file mode 100644
index 0000000000..e835c17c80
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class SetMediaClockTimerResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief SetMediaClockTimerResponse class constructor
+ **/
+ explicit SetMediaClockTimerResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SetMediaClockTimerResponse class destructor
+ **/
+ virtual ~SetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockTimerResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h
new file mode 100644
index 0000000000..a22ee9852a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h
@@ -0,0 +1,89 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTRequest command class
+ **/
+class ShowConstantTBTRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ShowConstantTBTRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ShowConstantTBTRequest class destructor
+ **/
+ virtual ~ShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks show constant TBT params(turnIcon, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if show constant TBT contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h
new file mode 100644
index 0000000000..6a102b1984
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTResponse command class
+ **/
+class ShowConstantTBTResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ShowConstantTBTResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ShowConstantTBTResponse class destructor
+ **/
+ virtual ~ShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
new file mode 100644
index 0000000000..091cab3bfd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief show request command class
+ **/
+class ShowRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief ShowRequest class constructor
+ **/
+ explicit ShowRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief ShowRequest class destructor
+ **/
+ virtual ~ShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfShowRequest();
+
+ DISALLOW_COPY_AND_ASSIGN(ShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h
new file mode 100644
index 0000000000..970b54747e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class ShowResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief ShowResponse class constructor
+ **/
+ explicit ShowResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief ShowResponse class destructor
+ **/
+ virtual ~ShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h
new file mode 100644
index 0000000000..de24438ddd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h
@@ -0,0 +1,91 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief slider request command class
+ **/
+class SliderRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief SliderRequest class constructor
+ **/
+ explicit SliderRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief SliderRequest class destructor
+ **/
+ virtual ~SliderRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks slider params(sliderHeader, sliderFooter, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if slider contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h
new file mode 100644
index 0000000000..b7821adca2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class SliderResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief SliderResponse class constructor
+ **/
+ explicit SliderResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakResponseCommand class destructor
+ **/
+ virtual ~SliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SliderResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h
new file mode 100644
index 0000000000..7d3b2096af
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h
@@ -0,0 +1,93 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief speak request command class
+ **/
+class SpeakRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief SpeakRequest class constructor
+ **/
+ explicit SpeakRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakRequest class destructor
+ **/
+ virtual ~SpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sends Speak response to mobile side
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessTTSSpeakResponse(const smart_objects::SmartObject& message);
+
+ /**
+ * @brief Checks speak param ttsChunks on the contents \t\n \\t \\n
+ * @return if speak contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h
new file mode 100644
index 0000000000..ef9b8f89d3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class SpeakResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief SpeakResponse class constructor
+ **/
+ explicit SpeakResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakResponse class destructor
+ **/
+ virtual ~SpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SpeakResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h
new file mode 100644
index 0000000000..3e0cc2ceae
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonRequest command class
+ **/
+class SubscribeButtonRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeButtonRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SubscribeButtonRequest class destructor
+ **/
+ virtual ~SubscribeButtonRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /**
+ * @brief Checks if button subscription allowed. In case non-media
+ * application trying to subscribe on buttons(tune, seek) negative result will
+ * be returned
+ *
+ * @param app Application requested subscription
+ * @param btn_id Button to be subscribe
+ *
+ * @return TRUE on success, otherwise false
+ **/
+ bool IsSubscribtionAllowed(ApplicationSharedPtr app,
+ const mobile_apis::ButtonName::eType btn_id);
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h
new file mode 100644
index 0000000000..8366884540
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonResponse command class
+ **/
+class SubscribeButtonResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeButtonResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SubscribeButtonResponse class destructor
+ **/
+ virtual ~SubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..288500e7e8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataRequest command class
+ **/
+class SubscribeVehicleDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SubscribeButtonCommandRequest class destructor
+ **/
+ virtual ~SubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+#ifdef HMI_DBUS_API
+ private:
+ struct HmiRequest {
+ hmi_apis::Common_Result::eType status;
+ bool complete;
+ smart_objects::SmartObject value;
+ const char* str;
+ hmi_apis::FunctionID::eType func_id;
+ };
+
+ typedef std::vector<HmiRequest> HmiRequests;
+ HmiRequests hmi_requests_;
+#endif // #ifdef HMI_DBUS_API
+
+ private:
+ bool IsAnythingAlreadySubscribed(
+ const smart_objects::SmartObject& msg_params) const;
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..d2771c0712
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataResponse command class
+ **/
+class SubscribeVehicleDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeVehicleDataCommandRequest class destructor
+ **/
+ virtual ~SubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h
new file mode 100644
index 0000000000..64a6510fc5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SystemRequest command class
+ **/
+class SystemRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SystemRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SystemRequest class destructor
+ **/
+ virtual ~SystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+ private:
+
+ static uint32_t index;
+ DISALLOW_COPY_AND_ASSIGN(SystemRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
new file mode 100644
index 0000000000..ca2fb99970
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SystemResponse command class
+ **/
+class SystemResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SystemResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SystemResponse class destructor
+ **/
+ virtual ~SystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h
new file mode 100644
index 0000000000..a5a53736e2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceRequest class constructor
+ **/
+ explicit UnregisterAppInterfaceRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+ }
+
+ /**
+ * \brief UnregisterAppInterfaceRequest class destructor
+ **/
+ virtual ~UnregisterAppInterfaceRequest() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ // virtual void cleanUp() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h
new file mode 100644
index 0000000000..5c8928a6c8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceResponse class constructor
+ **/
+ explicit UnregisterAppInterfaceResponse(const MessageSharedPtr& response)
+ : CommandResponseImpl(response) {
+ }
+
+ /**
+ * \brief UnregisterAppInterfaceResponse class destructor
+ **/
+ virtual ~UnregisterAppInterfaceResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
new file mode 100644
index 0000000000..3ec216de27
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonRequest command class
+ **/
+class UnsubscribeButtonRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeButtonRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeButtonRequest class destructor
+ **/
+ virtual ~UnsubscribeButtonRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h
new file mode 100644
index 0000000000..972da48065
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonResponse command class
+ **/
+class UnsubscribeButtonResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeButtonResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeButtonResponse class destructor
+ **/
+ virtual ~UnsubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..dd52a77224
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataRequest command class
+ **/
+class UnsubscribeVehicleDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~UnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+#ifdef HMI_DBUS_API
+ private:
+ struct HmiRequest {
+ hmi_apis::Common_Result::eType status;
+ bool complete;
+ smart_objects::SmartObject value;
+ const char* str;
+ hmi_apis::FunctionID::eType func_id;
+ };
+
+ typedef std::vector<HmiRequest> HmiRequests;
+ HmiRequests hmi_requests_;
+#endif // #ifdef HMI_DBUS_API
+
+ private:
+ bool IsAnythingAlreadyUnsubscribed(
+ const smart_objects::SmartObject& msg_params) const;
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..3fb932ecf3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataResponse command class
+ **/
+class UnsubscribeVehicleDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~UnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h
new file mode 100644
index 0000000000..c65c2bc534
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListRequest command class
+ **/
+class UpdateTurnListRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief UpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateTurnListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateTurnListRequest class destructor
+ **/
+ virtual ~UpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief check correct parameter turnList
+ *
+ * @return TRUE if turnList is correct,
+ * otherwise FALSE
+ */
+ bool CheckTurnListArray();
+
+ /**
+ * @brief Checks update turn list param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if update turn list contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h
new file mode 100644
index 0000000000..fdbf64826c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListResponse command class
+ **/
+class UpdateTurnListResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief UpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateTurnListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateTurnListResponse class destructor
+ **/
+ virtual ~UpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/pending.h b/src/components/application_manager/include/application_manager/commands/pending.h
new file mode 100644
index 0000000000..bbfc246659
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/pending.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
+
+#include <set>
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/*
+ * @brief Class for monitoring of pending requests/responses to HMI
+ */
+class Pending {
+ public:
+ /*
+ * Constructor
+ */
+ Pending();
+
+ /*
+ * Destructor
+ */
+ ~Pending();
+
+ void Add(hmi_apis::FunctionID::eType id);
+ void Remove(hmi_apis::FunctionID::eType id);
+ bool IsFinal(hmi_apis::FunctionID::eType id);
+
+ private:
+ std::set<hmi_apis::FunctionID::eType> pending_;
+ sync_primitives::Lock lock_;
+ hmi_apis::FunctionID::eType last_;
+ DISALLOW_COPY_AND_ASSIGN(Pending);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event.h b/src/components/application_manager/include/application_manager/event_engine/event.h
new file mode 100644
index 0000000000..e76b767f17
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/event_engine/event.h
@@ -0,0 +1,147 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+
+#include <interfaces/HMI_API.h>
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace application_manager {
+namespace event_engine {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class Event {
+ public:
+
+ // Typedef for possible Event ID's from mobile_apis functionID enum
+ typedef hmi_apis::FunctionID::eType EventID;
+
+ /*
+ * @brief Constructor with parameters
+ *
+ * @param id Event ID. Please see mobile_apis::FunctionID for possible ID's
+ */
+ explicit Event(const EventID& id);
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~Event();
+
+ /*
+ * @brief Sends synchronously event to all subscribers.
+ *
+ */
+ void raise();
+
+ /*
+ * @brief Provides event ID
+ */
+ inline const EventID& id() const;
+
+ /*
+ * @brief Sets event smart object
+ *
+ * @param so The smart_object received in HMI response
+ */
+ void set_smart_object(smart_objects::SmartObject& so);
+
+ /*
+ * @brief Retrieves event smart object
+ *
+ * @return The smart_object received in HMI response
+ */
+ inline const smart_objects::SmartObject& smart_object() const;
+
+ /*
+ * @brief Retrieves smart object request ID
+ */
+ inline int32_t smart_object_function_id() const;
+
+ /*
+ * @brief Retrieves smart object correlation ID
+ */
+ inline int32_t smart_object_correlation_id() const;
+
+ /*
+ * @brief Retrieves smart_object response type
+ */
+ inline int32_t smart_object_type() const;
+
+ protected:
+
+ private:
+
+ EventID id_;
+ smart_objects::SmartObject response_so_;
+
+ /*
+ * @brief Default constructor
+ *
+ * Unimplemented to avoid misusing
+ */
+ Event();
+
+ DISALLOW_COPY_AND_ASSIGN(Event);
+};
+
+const Event::EventID& Event::id() const {
+ return id_;
+}
+
+const smart_objects::SmartObject& Event::smart_object() const {
+ return response_so_;
+}
+
+int32_t Event::smart_object_function_id() const {
+ return response_so_.getElement(
+ strings::params).getElement(strings::function_id).asInt();
+}
+
+int32_t Event::smart_object_correlation_id() const {
+ return response_so_.getElement(
+ strings::params).getElement(strings::correlation_id).asInt();
+}
+
+int32_t Event::smart_object_type() const {
+ return response_so_.getElement(
+ strings::params).getElement(strings::message_type).asInt();
+}
+
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
new file mode 100644
index 0000000000..875add2828
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
@@ -0,0 +1,117 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
+
+#include <list>
+#include <map>
+
+#include "utils/lock.h"
+#include "utils/singleton.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+namespace event_engine {
+
+class EventObserver;
+
+class EventDispatcher : public utils::Singleton<EventDispatcher> {
+ public:
+
+ /*
+ * @brief Delivers the event to all subscribers
+ *
+ * @param event Received event
+ */
+ void raise_event(const Event& event);
+
+ /*
+ * @brief Subscribe the observer to event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID
+ * @param observer The observer to subscribe for event
+ */
+ void add_observer(const Event::EventID& event_id,
+ int32_t hmi_correlation_id,
+ EventObserver* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(const Event::EventID& event_id,
+ EventObserver* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(EventObserver* const observer);
+
+ protected:
+
+ private:
+
+ /*
+ * @brief Default constructor
+ */
+ EventDispatcher();
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~EventDispatcher();
+
+ DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
+
+ FRIEND_BASE_SINGLETON_CLASS(EventDispatcher);
+
+ // Data types section
+ typedef std::list<EventObserver*> ObserverList;
+ typedef std::map<int32_t, ObserverList> ObserversMap;
+ typedef std::map<Event::EventID, ObserversMap> EventObserverMap;
+
+ // Members section
+ sync_primitives::Lock state_lock_;
+ EventObserverMap observers_;
+};
+
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/include/application_manager/event_engine/event_observer.h
new file mode 100644
index 0000000000..8631203290
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/event_engine/event_observer.h
@@ -0,0 +1,116 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
+
+#include <string>
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace application_manager {
+namespace event_engine {
+
+class EventObserver
+{
+ public:
+
+ friend class EventDispatcher;
+
+ // Typedef for possible Observer ID's from mobile_apis functionID enum
+ typedef unsigned long ObserverID;
+
+ /*
+ * @brief Constructor
+ *
+ */
+ EventObserver();
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~EventObserver();
+
+ /**
+ * @brief Retrieves observer unique id
+ *
+ * @return Unique Observer id
+ */
+ inline const ObserverID& id() const;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const Event& event) = 0;
+
+ protected:
+
+ /*
+ * @brief Subscribe to an event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID.
+ * If param is omitted, it means subscription for HMI notification
+ */
+ void subscribe_on_event(
+ const Event::EventID& event_id, int32_t hmi_correlation_id = 0);
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ */
+ void unsubscribe_from_event(const Event::EventID& event_id);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ */
+ void unsubscribe_from_all_events();
+
+ private:
+
+ ObserverID id_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventObserver);
+};
+
+const EventObserver::ObserverID& EventObserver::id() const {
+ return id_;
+}
+
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities.h b/src/components/application_manager/include/application_manager/hmi_capabilities.h
new file mode 100644
index 0000000000..20a849baee
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities.h
@@ -0,0 +1,538 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "json/json.h"
+#include "utils/macro.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+namespace application_manager {
+class ApplicationManagerImpl;
+
+class HMICapabilities {
+
+ public:
+
+ /*
+ * @ Class constructor
+ *
+ * @param app_mngr Application manager pointer
+ */
+ explicit HMICapabilities(ApplicationManagerImpl* const app_mngr);
+
+ /*
+ * @brief Class destructor
+ *
+ */
+ virtual ~HMICapabilities();
+
+ /**
+ * @brief Checks if all HMI capabilities received
+ *
+ * @return TRUE if all information received, otherwise FALSE
+ */
+ bool is_hmi_capabilities_initialized() const;
+
+ /*
+ * @brief Checks is image type(Static/Dynamic) requested by
+ * Mobile Device is supported on current HMI.
+ * @param image_type recieved type of image from Enum.
+ * @return Bool true if supported
+ */
+ bool VerifyImageType(int32_t image_type) const;
+
+ /**
+ * @brief Checks if all HMI capabilities received
+ *
+ * @return TRUE if all information received, otherwise FALSE
+ */
+ inline bool is_vr_cooperating() const;
+ void set_is_vr_cooperating(bool value);
+
+ inline bool is_tts_cooperating() const;
+ void set_is_tts_cooperating(bool value);
+
+ inline bool is_ui_cooperating() const;
+ void set_is_ui_cooperating(bool value);
+
+ inline bool is_navi_cooperating() const;
+ void set_is_navi_cooperating(bool value);
+
+ inline bool is_ivi_cooperating() const;
+ void set_is_ivi_cooperating(bool value);
+
+ /*
+ * @brief Retrieves if mixing audio is supported by HMI
+ * (ie recording TTS command and playing audio)
+ *
+ * @return Current state of the mixing audio flag
+ */
+ inline bool attenuated_supported() const;
+
+ /*
+ * @brief Sets state for mixing audio
+ *
+ * @param state New state to be set
+ */
+ void set_attenuated_supported(bool state);
+
+ /*
+ * @brief Retrieves currently active UI language
+ *
+ * @return Currently active UI language
+ */
+ inline const hmi_apis::Common_Language::eType&
+ active_ui_language() const;
+
+ /*
+ * @brief Sets currently active UI language
+ *
+ * @param language Currently active UI language
+ */
+ void set_active_ui_language(const hmi_apis::Common_Language::eType& language);
+
+ /*
+ * @brief Retrieves UI supported languages
+ *
+ * @return Currently supported UI languages
+ */
+ inline const smart_objects::SmartObject*
+ ui_supported_languages() const;
+
+ /*
+ * @brief Sets supported UI languages
+ *
+ * @param supported_languages Supported UI languages
+ */
+ void set_ui_supported_languages(
+ const smart_objects::SmartObject& supported_languages);
+
+ /*
+ * @brief Retrieves currently active VR language
+ *
+ * @return Currently active VR language
+ */
+ inline const hmi_apis::Common_Language::eType&
+ active_vr_language() const;
+
+ /*
+ * @brief Sets currently active VR language
+ *
+ * @param language Currently active VR language
+ */
+ void set_active_vr_language(const hmi_apis::Common_Language::eType& language);
+
+ /*
+ * @brief Retrieves VR supported languages
+ *
+ * @return Currently supported VR languages
+ */
+ inline const smart_objects::SmartObject*
+ vr_supported_languages() const;
+
+ /*
+ * @brief Sets supported VR languages
+ *
+ * @param supported_languages Supported VR languages
+ */
+ void set_vr_supported_languages(
+ const smart_objects::SmartObject& supported_languages);
+
+ /*
+ * @brief Retrieves currently active TTS language
+ *
+ * @return Currently active TTS language
+ */
+ inline const hmi_apis::Common_Language::eType&
+ active_tts_language() const;
+
+ /*
+ * @brief Sets currently active TTS language
+ *
+ * @param language Currently active TTS language
+ */
+ void set_active_tts_language(
+ const hmi_apis::Common_Language::eType& language);
+
+ /*
+ * @brief Retrieves TTS supported languages
+ *
+ * @return Currently supported TTS languages
+ */
+ inline const smart_objects::SmartObject*
+ tts_supported_languages() const;
+
+ /*
+ * @brief Sets supported TTS languages
+ *
+ * @param supported_languages Supported TTS languages
+ */
+ void set_tts_supported_languages(
+ const smart_objects::SmartObject& supported_languages);
+
+ /*
+ * @brief Retrieves information about the display capabilities
+ *
+ * @return Currently supported display capabilities
+ */
+ inline const smart_objects::SmartObject*
+ display_capabilities() const;
+
+ /*
+ * @brief Sets supported display capabilities
+ *
+ * @param display_capabilities supported display capabilities
+ */
+ void set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities);
+
+ /*
+ * @brief Retrieves information about the HMI zone capabilities
+ *
+ * @return Currently supported HMI zone capabilities
+ */
+ inline const smart_objects::SmartObject*
+ hmi_zone_capabilities() const;
+
+ /*
+ * @brief Sets supported HMI zone capabilities
+ *
+ * @param hmi_zone_capabilities supported HMI zone capabilities
+ */
+ void set_hmi_zone_capabilities(
+ const smart_objects::SmartObject& hmi_zone_capabilities);
+
+ /*
+ * @brief Retrieves information about the SoftButton's capabilities
+ *
+ * @return Currently supported SoftButton's capabilities
+ */
+ inline const smart_objects::SmartObject*
+ soft_button_capabilities() const;
+
+ /*
+ * @brief Sets supported SoftButton's capabilities
+ *
+ * @param soft_button_capabilities supported SoftButton's capabilities
+ */
+ void set_soft_button_capabilities(
+ const smart_objects::SmartObject& soft_button_capabilities);
+
+ /*
+ * @brief Retrieves information about the Button's capabilities
+ *
+ * @return Currently supported Button's capabilities
+ */
+ inline const smart_objects::SmartObject* button_capabilities() const;
+
+ /*
+ * @brief Sets supported Button's capabilities
+ *
+ * @param soft_button_capabilities supported Button's capabilities
+ */
+ void set_button_capabilities(
+ const smart_objects::SmartObject& button_capabilities);
+
+ /*
+ * @brief Sets supported speech capabilities
+ *
+ * @param speech_capabilities supported speech capabilities
+ */
+ void set_speech_capabilities(
+ const smart_objects::SmartObject& speech_capabilities);
+
+ /*
+ * @brief Retrieves information about the speech capabilities
+ *
+ * @return Currently supported speech capabilities
+ */
+ inline const smart_objects::SmartObject* speech_capabilities() const;
+
+ /*
+ * @brief Sets supported VR capabilities
+ *
+ * @param vr_capabilities supported VR capabilities
+ */
+ void set_vr_capabilities(const smart_objects::SmartObject& vr_capabilities);
+
+ /*
+ * @brief Retrieves information about the VR capabilities
+ *
+ * @return Currently supported VR capabilities
+ */
+ inline const smart_objects::SmartObject* vr_capabilities() const;
+
+ /*
+ * @brief Sets supported audio_pass_thru capabilities
+ *
+ * @param vr_capabilities supported audio_pass_thru capabilities
+ */
+ void set_audio_pass_thru_capabilities(
+ const smart_objects::SmartObject& audio_pass_thru_capabilities);
+
+ /*
+ * @brief Retrieves information about the audio_pass_thru capabilities
+ *
+ * @return Currently supported audio_pass_thru capabilities
+ */
+ inline const smart_objects::SmartObject*
+ audio_pass_thru_capabilities() const;
+
+ /*
+ * @brief Retrieves information about the preset bank capabilities
+ *
+ * @return Currently supported preset bank capabilities
+ */
+ inline const smart_objects::SmartObject* preset_bank_capabilities() const;
+
+ /*
+ * @brief Sets supported preset bank capabilities
+ *
+ * @param soft_button_capabilities supported preset bank capabilities
+ */
+ void set_preset_bank_capabilities(
+ const smart_objects::SmartObject& preset_bank_capabilities);
+
+ /*
+ * @brief Sets vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ void set_vehicle_type(const smart_objects::SmartObject& vehicle_type);
+
+ /*
+ * @brief Retrieves vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ inline const smart_objects::SmartObject* vehicle_type() const;
+
+ /*
+ * @brief Retrieves information about the prerecorded speech
+ *
+ * @return Currently supported prerecorded speech
+ */
+ inline const smart_objects::SmartObject* prerecorded_speech() const;
+
+ /*
+ * @brief Sets supported prerecorded speech
+ *
+ * @param prerecorded_speech supported prerecorded speech
+ */
+ void set_prerecorded_speech(
+ const smart_objects::SmartObject& prerecorded_speech);
+
+ protected:
+
+ /*
+ * @brief Loads capabilities from local file in case SDL was launched
+ * without HMI
+ *
+ * @return TRUE if capabilities loaded successfully, otherwise FALSE.
+ */
+ bool load_capabilities_from_file();
+
+ /*
+ * @brief function checks if json member exists
+ *
+ * @param json_member from file hmi_capabilities.json
+ * @param name_of_member name which we should check
+ * hmi_capabilities.json
+ *
+ * @returns TRUE if member exists and returns FALSE if
+ * member does not exist.
+ */
+ bool check_existing_json_member(
+ const Json::Value& json_member, const char* name_of_member);
+
+ /*
+ * @brief function converts json object "languages" to smart object
+ *
+ * @param json_languages from file hmi_capabilities.json
+ * @param languages - the converted object
+ *
+ */
+ void convert_json_languages_to_obj(Json::Value& json_languages,
+ smart_objects::SmartObject& languages);
+
+ private:
+ bool is_vr_cooperating_;
+ bool is_tts_cooperating_;
+ bool is_ui_cooperating_;
+ bool is_navi_cooperating_;
+ bool is_ivi_cooperating_;
+
+ // to check if IsReady response for corresponding interface received
+ bool is_vr_ready_response_recieved_;
+ bool is_tts_ready_response_recieved_;
+ bool is_ui_ready_response_recieved_;
+ bool is_navi_ready_response_recieved_;
+ bool is_ivi_ready_response_recieved_;
+
+ bool attenuated_supported_;
+ hmi_apis::Common_Language::eType ui_language_;
+ hmi_apis::Common_Language::eType vr_language_;
+ hmi_apis::Common_Language::eType tts_language_;
+ smart_objects::SmartObject* vehicle_type_;
+ smart_objects::SmartObject* ui_supported_languages_;
+ smart_objects::SmartObject* tts_supported_languages_;
+ smart_objects::SmartObject* vr_supported_languages_;
+ smart_objects::SmartObject* display_capabilities_;
+ smart_objects::SmartObject* hmi_zone_capabilities_;
+ smart_objects::SmartObject* soft_buttons_capabilities_;
+ smart_objects::SmartObject* button_capabilities_;
+ smart_objects::SmartObject* preset_bank_capabilities_;
+ smart_objects::SmartObject* vr_capabilities_;
+ smart_objects::SmartObject* speech_capabilities_;
+ smart_objects::SmartObject* audio_pass_thru_capabilities_;
+ smart_objects::SmartObject* prerecorded_speech_;
+
+ ApplicationManagerImpl* app_mngr_;
+
+ DISALLOW_COPY_AND_ASSIGN(HMICapabilities);
+};
+
+bool HMICapabilities::is_ui_cooperating() const {
+ return is_ui_cooperating_;
+}
+
+bool HMICapabilities::is_vr_cooperating() const {
+ return is_vr_cooperating_;
+}
+
+bool HMICapabilities::is_tts_cooperating() const {
+ return is_tts_cooperating_;
+}
+
+bool HMICapabilities::is_navi_cooperating() const {
+ return is_navi_cooperating_;
+}
+
+bool HMICapabilities::is_ivi_cooperating() const {
+ return is_ivi_cooperating_;
+}
+
+const hmi_apis::Common_Language::eType&
+HMICapabilities::active_ui_language() const {
+ return ui_language_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::ui_supported_languages() const {
+ return ui_supported_languages_;
+}
+
+const hmi_apis::Common_Language::eType&
+HMICapabilities::active_vr_language() const {
+ return vr_language_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::vr_supported_languages() const {
+ return vr_supported_languages_;
+}
+
+const hmi_apis::Common_Language::eType&
+HMICapabilities::active_tts_language() const {
+ return tts_language_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::tts_supported_languages() const {
+ return tts_supported_languages_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::display_capabilities() const {
+ return display_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::hmi_zone_capabilities() const {
+ return hmi_zone_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::soft_button_capabilities() const {
+ return soft_buttons_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilities::button_capabilities() const {
+ return button_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::speech_capabilities() const {
+ return speech_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilities::vr_capabilities() const {
+ return vr_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::audio_pass_thru_capabilities() const {
+ return audio_pass_thru_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::preset_bank_capabilities() const {
+ return preset_bank_capabilities_;
+}
+
+bool HMICapabilities::attenuated_supported() const {
+ return attenuated_supported_;
+}
+
+const smart_objects::SmartObject* HMICapabilities::vehicle_type() const {
+ return vehicle_type_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::prerecorded_speech() const {
+ return prerecorded_speech_;
+}
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_command_factory.h b/src/components/application_manager/include/application_manager/hmi_command_factory.h
new file mode 100644
index 0000000000..d6f85a480d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/hmi_command_factory.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
+
+#include "application_manager/commands/command.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+
+/**
+ * @brief Factory class for command creation
+ **/
+class HMICommandFactory {
+ public:
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param smartObject SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ static CommandSharedPtr CreateCommand(const MessageSharedPtr& message);
+
+ private:
+ HMICommandFactory();
+ DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
new file mode 100644
index 0000000000..d92c89adf1
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -0,0 +1,128 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
+
+#include <string>
+#include <vector>
+
+#include "utils/shared_ptr.h"
+#include "protocol/message_priority.h"
+#include "protocol/rpc_type.h"
+#include "smart_objects/smart_object.h"
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+namespace application_manager {
+
+typedef std::vector<uint8_t> BinaryData;
+
+// Message type is a general type used by both mobile and HMI messages
+enum MessageType {
+ kUnknownType = -1,
+ kRequest = 0,
+ kResponse = 1,
+ kNotification = 2,
+ kErrorResponse = 3 // Error Response HMI ONLY
+};
+
+// Map PrcType to corresponding MessageType
+MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type);
+
+enum ProtocolVersion {
+ kUnknownProtocol = -1,
+ kHMI = 0,
+ kV1 = 1,
+ kV2 = 2,
+ kV3 = 3
+};
+
+class Message {
+ public:
+ Message(protocol_handler::MessagePriority priority);
+ Message(const Message& message);
+ Message& operator=(const Message& message);
+ bool operator==(const Message& message);
+ ~Message();
+
+ //! --------------------------------------------------------------------------
+ int32_t function_id() const;
+ int32_t correlation_id() const;
+ int32_t connection_key() const;
+
+ MessageType type() const;
+ ProtocolVersion protocol_version() const;
+
+ const std::string& json_message() const;
+ const BinaryData* binary_data() const;
+ bool has_binary_data() const;
+ size_t data_size() const;
+ size_t payload_size() const;
+ const smart_objects::SmartObject& smart_object() const;
+
+ //! --------------------------------------------------------------------------
+ void set_function_id(int32_t id);
+ void set_correlation_id(int32_t id);
+ void set_connection_key(int32_t key);
+ void set_message_type(MessageType type);
+ void set_binary_data(BinaryData* data);
+ void set_json_message(const std::string& json_message);
+ void set_protocol_version(ProtocolVersion version);
+ void set_smart_object(const smart_objects::SmartObject& object);
+ void set_data_size(size_t data_size);
+ void set_payload_size(size_t payload_size);
+
+ protocol_handler::MessagePriority Priority() const { return priority_; }
+
+ private:
+ int32_t function_id_; // @remark protocol V2.
+ int32_t correlation_id_; // @remark protocol V2.
+ MessageType type_; // @remark protocol V2.
+
+ // Pre-calculated message priority, higher priority messages are
+ // Processed first
+ protocol_handler::MessagePriority priority_;
+
+ int32_t connection_key_;
+ std::string json_message_;
+ smart_objects::SmartObject smart_object_;
+
+ // TODO(akandul): replace with shared_ptr
+ BinaryData* binary_data_;
+ size_t data_size_;
+ size_t payload_size_;
+ ProtocolVersion version_;
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
new file mode 100644
index 0000000000..e7a7631d69
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -0,0 +1,492 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
+
+#include <map>
+#include <string>
+#include <string.h>
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/macro.h"
+#include "connection_handler/device.h"
+#include "application_manager/application.h"
+#include "application_manager/vehicle_info_data.h"
+#include "policy/policy_types.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+namespace mobile_api = mobile_apis;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+/*
+ * @brief Typedef for VehicleData
+ *
+ * @param const char* Name of the parameter in mobile request
+ * @param VehicleDataType Enum for vehicle data
+ */
+typedef std::map<std::string, VehicleDataType> VehicleData;
+
+/**
+ * @brief MessageHelper class
+ **/
+class MessageHelper {
+ public:
+
+ typedef std::vector<smart_objects::SmartObject*> SmartObjectList;
+
+ /**
+ * @brief Creates request for different interfaces(JSON, DBUS)
+ * @param correlation_id unique ID
+ * @param params Vector of arguments that we need in GetVehicleData request (e.g. gps, odometer, fuel_level)
+ */
+ static void CreateGetVehicleDataRequest(uint32_t correlation_id, const std::vector<std::string>& params);
+
+ /**
+ * @brief Sends HMI status notification to mobile
+ *
+ *@param application_impl application with changed HMI status
+ *
+ **/
+ static void SendHMIStatusNotification(const Application& application_impl);
+
+ /**
+ * @brief Sends OnAppRegistered notification to HMI
+ *
+ *@param application_impl application with changed HMI status
+ *
+ **/
+ static void SendOnAppRegisteredNotificationToHMI(
+ const Application& application_impl, bool resumption = false);
+
+ /**
+ * @brief Create mobile HashUpdateNotification
+ */
+ static smart_objects::SmartObject* GetHashUpdateNotification(const uint32_t app_id);
+
+ /**
+ * @brief Sends to mobile HashUpdateNotification
+ */
+ static void SendHashUpdateNotification(const uint32_t app_id);
+
+ /**
+ * @brief Sends OnAppInterfaceUnregistered notification to mobile
+ *
+ *@param connection_key Connection key
+ *@param reason Reason
+ *
+ **/
+ static void SendOnAppInterfaceUnregisteredNotificationToMobile(
+ int32_t connection_key,
+ mobile_apis::AppInterfaceUnregisteredReason::eType reason);
+
+ /*
+ * @brief Retrieve vehicle data map for param name in mobile request
+ * to VehicleDataType
+ *
+ * @return VehicleData reference
+ */
+ static const VehicleData& vehicle_data();
+
+ /**
+ * @brief Convert string to HMI level, if possible
+ * @param hmi_level Stringified HMI level
+ * @return Appropriate enum from HMI level, or INVALID_ENUM, if conversiion
+ * is not possible
+ */
+ static mobile_api::HMILevel::eType StringToHMILevel(
+ const std::string& hmi_level);
+
+ /*
+ * @brief Used to obtain string representation of app's
+ * HMI Level.
+ * @param hmi_level Desired HMI Level
+ */
+ static std::string StringifiedHMILevel(
+ mobile_apis::HMILevel::eType hmi_level);
+
+ /*
+ * @brief Used to obtain function name by its id
+ * @param function_id Function ID
+ */
+ static std::string StringifiedFunctionID(
+ mobile_apis::FunctionID::eType function_id);
+
+ static smart_objects::SmartObject* CreateBlockedByPoliciesResponse(
+ mobile_apis::FunctionID::eType function_id,
+ mobile_apis::Result::eType result, uint32_t correlation_id,
+ uint32_t connection_key);
+
+ /*
+ * @brief Prepare GetDeviceListResponse
+ *
+ *
+ * @param devices Devices list
+ *
+ */
+ static smart_objects::SmartObject* CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices);
+
+ static smart_objects::SmartObject* CreateModuleInfoSO(
+ uint32_t function_id);
+
+ static smart_objects::SmartObject* CreateSetAppIcon(
+ const std::string& path_to_icon, uint32_t app_id);
+
+ /**
+ * @brief Sends IVI subscriptions
+ */
+ static bool SendIVISubscribtions(const uint32_t app_id);
+
+ /**
+ * @brief Sends IVI subscriptions
+ */
+ static SmartObjectList GetIVISubscribtionRequests(const uint32_t app_id);
+
+ static void SendAppDataToHMI(ApplicationConstSharedPtr app);
+ static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app);
+ static SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
+
+ static smart_objects::SmartObject* CreateAppVrHelp(ApplicationConstSharedPtr app);
+
+ static SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendShowRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+ static SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+
+ static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id);
+
+ static smart_objects::SmartObject* CreateAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id);
+
+ /*
+ * @brief Create Common.HMIApplication struct application instance
+ * @param app : applicaton instace
+ * @param output smart object to store Common.HMIApplication struct
+ * @return true on succes, otherwise return false;
+ */
+ static bool CreateHMIApplicationStruct(ApplicationConstSharedPtr app,
+ smart_objects::SmartObject& output);
+
+ static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
+ static SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Creates BasicCommunication.OnAppUnregistered notification
+ * @param app Application instance
+ * @param is_unexpected_disconnect
+ * Indicates if connection was unexpectedly lost by TM or HB
+ */
+ static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app,
+ bool is_unexpected_disconnect = false);
+ static void SendActivateAppToHMI(
+ uint32_t const app_id,
+ hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL);
+
+ static void SendOnResumeAudioSourceToHMI(const uint32_t app_id);
+
+ static std::string GetDeviceMacAddressForHandle(
+ const uint32_t device_handle);
+
+ static void GetDeviceInfoForHandle(const uint32_t device_handle,
+ policy::DeviceParams* device_info);
+ static void GetDeviceInfoForApp(uint32_t connection_key,
+ policy::DeviceParams* device_info);
+
+ /**
+ * @brief Send SDL_ActivateApp response to HMI
+ * @param permissions response parameters
+ */
+ static void SendSDLActivateAppResponse(policy::AppPermissions& permissions,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send OnSDLConsentNeeded to HMI for device data consent by user
+ * @param device_info Device info, e.g. mac, handle, name
+ */
+ static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info);
+
+ /**
+ * @brief Send request to SyncP process to read file and send
+ * Policy Table Snapshot using Retry Strategy
+ * @param file_path Path to file with PTS
+ * @param timeout Timeout to wait for PTU
+ * @param retries Seconds between retries
+ */
+ static void SendPolicyUpdate(const std::string& file_path,
+ int timeout,
+ const std::vector<int>& retries);
+
+ /**
+ * @brief Send GetUserFriendlyMessage response to HMI
+ * @param msg Appopriate messages params
+ * @param correlation_id Correlation id of request
+ */
+ static void SendGetUserFriendlyMessageResponse(
+ const std::vector<policy::UserFriendlyMessage>& msg,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send GetListOfPermissions response to HMI
+ * @param permissions Array of groups permissions
+ * @param correlation_id Correlation id of request
+ */
+ static void SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ uint32_t correlation_id);
+
+ /*
+ * @brief Sends notification to HMI to start video streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendNaviStartStream(int32_t connection_key);
+
+ /*
+ * @brief Sends notification to HMI to stop video streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendNaviStopStream(int32_t connection_key);
+
+ /*
+ * @brief Send notification for Update of Policy Table
+ * with PT Snapshot.
+ * @param connection_key Id of application to send message to
+ * @param policy_data PT Snapshot
+ * @param url If empty string, no URL is provided
+ * @param timeout If -1 no timeout is provdied
+ */
+ static void SendPolicySnapshotNotification(
+ unsigned int connection_key, const std::vector<uint8_t>& policy_data,
+ const std::string& url = "", int timeout = -1);
+
+ /*
+ * @brief Send notification to mobile on application permissions update
+ * @param connection_key Id of application to send message to
+ * @param permissions updated permissions for application
+ */
+ static void SendOnPermissionsChangeNotification(
+ uint32_t connection_key, const policy::Permissions& permissions);
+
+ /*
+ * @brief Send notification to HMI on application permissions update
+ * @param connection_key Id of application to send message to
+ * @param permissions updated permissions for application
+ */
+ static void SendOnAppPermissionsChangedNotification(
+ uint32_t connection_key, const policy::AppPermissions& permissions);
+
+ /**
+ * @brief Send GetStatusUpdate response to HMI with current policy update
+ * status
+ * @param status Update status
+ * @param correlation_id Correlation id from request
+ */
+ static void SendGetStatusUpdateResponse(const std::string& status,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send UpdateSDL response to HMI with policy update result
+ * @param result Update result
+ * @param correlation_id Correlation id from request
+ */
+ static void SendUpdateSDLResponse(const std::string& result,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send OnStatusUpdate to HMI on policy update status change
+ * @param status Policy table update status
+ */
+ static void SendOnStatusUpdate(const std::string& status);
+
+ /**
+ * @brief Send GetSystemInfo request to HMI
+ */
+ static void SendGetSystemInfoRequest();
+
+ /*
+ * @brief Sends notification to HMI to start audio streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendAudioStartStream(int32_t connection_key);
+
+ /*
+ * @brief Sends notification to HMI to stop audio streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendAudioStopStream(int32_t connection_key);
+
+ /*
+ * @brief Sends notification to HMI to stop audioPathThru
+ *
+ * @param connection_key Application connection key
+ *
+ * @return TRUE on SUCCES otherwise return FALSE
+ */
+ static bool SendStopAudioPathThru();
+
+ static smart_objects::SmartObject* CreateNegativeResponse(
+ uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
+ int32_t result_code);
+
+ /*
+ * @brief Verify image and add image file full path
+ *
+ * @param SmartObject with image
+ *
+ * @param app current application
+ *
+ * @return verification result
+ *
+ */
+ static mobile_apis::Result::eType VerifyImage(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Finds "Image" structure in request and verify image file presence
+ * in Core.
+ *
+ * @param message SmartObject with request
+ *
+ * @param app current application
+ *
+ * @return verification result
+ *
+ */
+ static mobile_apis::Result::eType VerifyImageFiles(
+ smart_objects::SmartObject& message, ApplicationConstSharedPtr app);
+
+ static mobile_apis::Result::eType VerifyImageVrHelpItems(
+ smart_objects::SmartObject& message, ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Checks string if it contains incorrect character \t\n \\t \\n
+ * or string contains only whitespace
+ * @param parameter str contains string which must be checked
+ * @return returns FALSE if string contains incorrect character or
+ * string is empty otherwise returns TRUE
+ */
+ static bool VerifySoftButtonString(const std::string& str);
+
+ static mobile_apis::Result::eType ProcessSoftButtons(
+ smart_objects::SmartObject& message_params,
+ ApplicationConstSharedPtr app);
+
+ /*
+ * @brief subscribe application to softbutton
+ *
+ * @param message_params contains data of request
+ *
+ * @param app current application
+ *
+ * @param function_id Unique command id from mobile API
+ */
+ static void SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id);
+
+ static bool PrintSmartObject(const smart_objects::SmartObject& object);
+
+ template<typename From, typename To>
+ static To ConvertEnumAPINoCheck(const From& input) {
+ return static_cast<To>(input);
+ }
+
+ /**
+ * @brief Convert common language to string representation
+ * @param language Common language
+ * @return Common language string representation
+ */
+ static std::string CommonLanguageToString(
+ hmi_apis::Common_Language::eType language);
+
+ /**
+ * @brief Gets command limit number per minute for specific application
+ * @param policy_app_id Unique application id
+ * @return Limit for number of command per minute
+ */
+ static uint32_t GetAppCommandLimit(const std::string& policy_app_id);
+
+ /**
+ * @brief Creates TTS.SetGlobalProperties request and sends
+ * to HMI for VCA module.
+ * @param app contains application which sends TTS GlobalProperties to HMI
+ * after timeout or first time when application register with level NONE or
+ * BACKGROUND
+ * @param default_help_prompt
+ * if default_help_prompt=TRUE->TTSGlobalProperties request will be created with
+ * default helpPrompt array, otherwise TTSGlobalProperties request will be created
+ * with empty helpPrompt array.
+ */
+ static void SendTTSGlobalProperties(
+ ApplicationSharedPtr app, bool default_help_prompt);
+
+ private:
+ /**
+ * @brief Allows to fill SO according to the current permissions.
+ * @param permissions application permissions.
+ * @param message which should be filled.
+ */
+ static void FillAppRevokedPermissions(const policy::AppPermissions& permissions,
+ smart_objects::SmartObject& message);
+
+ static smart_objects::SmartObject* CreateChangeRegistration(
+ int32_t function_id, int32_t language, uint32_t app_id);
+
+ MessageHelper();
+
+ static const VehicleData vehicle_data_;
+ DISALLOW_COPY_AND_ASSIGN(MessageHelper);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
diff --git a/src/components/application_manager/include/application_manager/mobile_command_factory.h b/src/components/application_manager/include/application_manager/mobile_command_factory.h
new file mode 100644
index 0000000000..1bf60fb745
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/mobile_command_factory.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
+
+#include "application_manager/commands/command.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+
+/**
+ * @brief Factory class for command creation
+ **/
+class MobileCommandFactory {
+ public:
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param smartObject SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ static commands::Command* CreateCommand(const MessageSharedPtr& message);
+
+ private:
+ MobileCommandFactory();
+ DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h
new file mode 100644
index 0000000000..c84ba54212
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
+
+#include "utils/macro.h"
+#include "protocol/common.h"
+#include "application_manager/message.h"
+
+namespace application_manager {
+typedef utils::SharedPtr<application_manager::Message> MobileMessage;
+class MobileMessageHandler {
+ public:
+ static application_manager::Message* HandleIncomingMessageProtocolV1(
+ const RawMessagePtr message);
+
+ static application_manager::Message* HandleIncomingMessageProtocolV2(
+ const RawMessagePtr message);
+
+ //! -------------------------------------------------------------
+
+ static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV1(
+ const MobileMessage& message);
+
+ static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV2(
+ const MobileMessage& message);
+
+ //! -------------------------------------------------------------
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MobileMessageHandler);
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
new file mode 100644
index 0000000000..7fdfb4e0ac
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/shared_ptr.h"
+
+namespace policy {
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class PolicyManager;
+
+class PolicyEventObserver :
+ public application_manager::event_engine::EventObserver {
+ public:
+ PolicyEventObserver(utils::SharedPtr<PolicyManager> policy_manager);
+ void on_event(const application_manager::event_engine::Event& event);
+ void subscribe_on_event(
+ const application_manager::event_engine::Event::EventID& event_id,
+ int32_t hmi_correlation_id = 0);
+ private:
+ utils::SharedPtr<PolicyManager> policy_manager_;
+ void ProcessOdometerEvent(const smart_objects::SmartObject& message);
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
new file mode 100644
index 0000000000..5bc23c106a
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -0,0 +1,376 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
+
+#include <string>
+#include <map>
+#include <set>
+#include <vector>
+#include "policy/policy_manager.h"
+#include "application_manager/policies/policy_event_observer.h"
+#include "application_manager/policies/pt_exchange_handler.h"
+#include "utils/logger.h"
+#include "utils/singleton.h"
+#include "usage_statistics/statistics_manager.h"
+
+namespace Json {
+class Value;
+}
+
+namespace policy {
+typedef std::vector<uint32_t> AppIds;
+typedef std::vector<uint32_t> DeviceHandles;
+
+class PolicyHandler :
+ public utils::Singleton<PolicyHandler, utils::deleters::Deleter<PolicyHandler> >,
+ public PolicyListener {
+ public:
+ virtual ~PolicyHandler();
+ bool LoadPolicyLibrary();
+ bool PolicyEnabled();
+ bool InitPolicyTable();
+ bool ResetPolicyTable();
+ bool ClearUserConsent();
+ bool SendMessageToSDK(const BinaryMessage& pt_string);
+ bool ReceiveMessageFromSDK(const std::string& file,
+ const BinaryMessage& pt_string);
+ bool UnloadPolicyLibrary();
+ void OnPTExchangeNeeded();
+ void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions,
+ const HMILevel& default_hmi);
+
+ bool GetPriority(const std::string& policy_app_id, std::string* priority);
+ void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result);
+
+ uint32_t GetNotificationsNumber(const std::string& priority);
+ DeviceConsent GetUserConsentForDevice(const std::string& device_id);
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi);
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL);
+ EndpointUrls GetUpdateUrls(int service_type);
+ void ResetRetrySequence();
+ int NextRetryTimeout();
+ int TimeoutExchange();
+ void OnExceededTimeout();
+ BinaryMessageSptr RequestPTUpdate();
+ const std::vector<int> RetrySequenceDelaysSeconds();
+
+ utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager();
+
+ /**
+ * Checks system action of application for permission of keep context
+ * @param system_action system action (see mobile api)
+ * @param policy_app_id unique application id
+ * @return false if system_action is KEEP_CONTEXT and it isn't allowed by policy
+ * otherwise true
+ */
+ bool CheckKeepContext(int system_action, const std::string& policy_app_id);
+
+ /**
+ * Checks system action of application for permission of steal focus
+ * @param system_action system action (see mobile api)
+ * @param policy_app_id unique application id
+ * @return false if system_action is STEAL_FOCUS and it isn't allowed by policy
+ * otherwise true
+ */
+ bool CheckStealFocus(int system_action, const std::string& policy_app_id);
+
+ /**
+ * Lets client to notify PolicyHandler that more kilometers expired
+ * @param kms New value of odometer
+ */
+ void KmsChanged(int kms);
+
+ /**
+ * @brief Gather information for application and sends it to HMI
+ * @param connection_key Connection key for application
+ */
+ void OnActivateApp(uint32_t connection_key, uint32_t correlation_id);
+
+ /**
+ * @brief Process user consent on mobile data connection access
+ * @param Device id or 0, if concern to all SDL functionality
+ * @param User consent from response
+ */
+ void OnAllowSDLFunctionalityNotification(bool is_allowed,
+ uint32_t device_id = 0);
+
+ /**
+ * @brief Increment counter for ignition cycles
+ */
+ void OnIgnitionCycleOver();
+
+ /**
+ * @brief Send notification to HMI concerning revocation of application
+ * @param policy_app_id Unique identifier of application
+ */
+ void OnAppRevoked(const std::string& policy_app_id);
+
+ void OnPendingPermissionChange(const std::string& policy_app_id);
+
+ /**
+ * Initializes PT exchange at ignition if need
+ */
+ void PTExchangeAtRegistration(const std::string& app_id);
+
+ /**
+ * Initializes PT exchange at user request
+ * @param correlation_id correlation id of request
+ */
+ void PTExchangeAtUserRequest(uint32_t correlation_id);
+
+ /**
+ * @brief Save device info for specific device to policy table
+ * @param device_id Device mac address
+ * @param device_info Device params
+ */
+ void SetDeviceInfo(std::string& device_id, const DeviceInfo& device_info);
+
+ /**
+ * @brief Store user-changed permissions consent to DB
+ * @param connection_key Connection key of application or 0, if permissions
+ * should be applied to all applications
+ * @param permissions User-changed group permissions consent
+ */
+ void OnAppPermissionConsent(const uint32_t connection_key,
+ PermissionConsent& permissions);
+
+ /**
+ * @brief Get appropriate message parameters and send them with response
+ * to HMI
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @param correlation_id correlation id of request
+ */
+ void OnGetUserFriendlyMessage(const std::vector<std::string>& message_codes,
+ const std::string& language,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Get list of permissions for application/device binded to
+ * connection key from request and send response
+ * @param connection_key Connection key for specific application or 0 for all
+ * currently registered applications
+ * @param correlation_id Correlation id from request
+ */
+ void OnGetListOfPermissions(const uint32_t connection_key,
+ const uint32_t correlation_id);
+
+ /**
+ * @brief Get current policy table update state and send response
+ * @param correlation_id Correlation id from request
+ */
+ void OnGetStatusUpdate(const uint32_t correlation_id);
+
+ /**
+ * @brief Send notification to HMI with changed policy update status
+ * @param status Current policy update state
+ */
+ void OnUpdateStatusChanged(policy::PolicyTableStatus status);
+
+ /**
+ * @brief Update currently used device id in policies manager for given
+ * application
+ * @param policy_app_id Application id
+ */
+ std::string OnCurrentDeviceIdUpdateRequired(const std::string& policy_app_id);
+
+ /**
+ * @brief Set parameters from OnSystemInfoChanged to policy table
+ * @param language System language
+ */
+ void OnSystemInfoChanged(const std::string& language);
+
+ /**
+ * @brief Save data from GetSystemInfo request to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void OnGetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ /**
+ * @brief Send request to HMI to get update on system parameters
+ */
+ virtual void OnSystemInfoUpdateRequired();
+
+ /**
+ * @brief Sends GetVehicleData request in case when Vechicle info is ready.
+ */
+ virtual void OnVIIsReady();
+
+ /**
+ * @brief Allows to update vechicle data info.
+ * @param SmartObject which contains all needed information.
+ */
+ virtual void OnVehicleDataUpdated(const smart_objects::SmartObject& message);
+
+ /**
+ * Removes device
+ * @param device_id id of device
+ */
+ void RemoveDevice(const std::string& device_id);
+
+ /**
+ * Adds statistics info
+ * @param type type of info
+ */
+ void AddStatisticsInfo(int type);
+
+ /**
+ * Handles system error
+ * @param code code of error
+ */
+ void OnSystemError(int code);
+
+ /**
+ * @brief Choose application id to be used for snapshot sending
+ * @return Application id or 0, if there are no applications registered
+ */
+ uint32_t GetAppIdForSending();
+
+ std::string GetAppName(const std::string& policy_app_id);
+
+ virtual void OnUserRequestedUpdateCheckRequired();
+
+ virtual void OnDeviceConsentChanged(const std::string& device_id,
+ bool is_allowed);
+
+ /**
+ * @brief Allows to add new or update existed application during
+ * registration process
+ * @param application_id The policy aplication id.
+ */
+ void AddApplication(const std::string& application_id);
+
+ /**
+ * Checks whether application is revoked
+ * @param app_id id application
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id);
+
+ /**
+ * @brief Notifies policy manager, that PTS was sent out
+ */
+ void OnUpdateRequestSentToMobile();
+
+ /**
+ * Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in seconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint16_t HeartBeatTimeout(const std::string& app_id) const;
+
+protected:
+
+ /**
+ * Starts next retry exchange policy table
+ */
+ void StartNextRetry();
+
+ /**
+ * Initializes PT exchange at odometer if need
+ * @param kilometers value from odometer in kilometers
+ */
+ void PTExchangeAtOdometer(int kilometers);
+
+ /**
+ * Starts proccess updating policy table
+ */
+ void StartPTExchange(bool skip_device_selection = false);
+
+ private:
+ /**
+ * @brief Choose device according to app HMI status and user consent for
+ * device
+ * @param device_info Struct with selected device parameters
+ * @return consent status for selected device
+ */
+ DeviceConsent GetDeviceForSending(DeviceParams& device_params);
+
+ /**
+ * @brief Convert internal policy update status to appropriate status for HMI
+ * @param status Internal policy update status
+ * @return Converted status for sending to HMI
+ */
+ const std::string ConvertUpdateStatus(policy::PolicyTableStatus status);
+
+private:
+ PolicyHandler();
+ static PolicyHandler* instance_;
+ static const std::string kLibrary;
+ utils::SharedPtr<PolicyManager> policy_manager_;
+ void* dl_handle_;
+ AppIds last_used_app_ids_;
+ utils::SharedPtr<PTExchangeHandler> exchange_handler_;
+ utils::SharedPtr<PolicyEventObserver> event_observer_;
+ bool on_ignition_check_done_;
+ uint32_t last_activated_app_id_;
+ bool registration_in_progress;
+
+ /**
+ * @brief Contains device handles, which were sent for user consent to HMI
+ */
+ DeviceHandles pending_device_handles_;
+
+ inline bool CreateManager();
+
+ bool is_user_requested_policy_table_update_;
+
+ /**
+ * @brief Application-to-device map is used for getting/setting user consents
+ * for all apps
+ */
+ std::map<std::string, std::string> app_to_device_link_;
+
+ DISALLOW_COPY_AND_ASSIGN(PolicyHandler);
+ FRIEND_BASE_SINGLETON_CLASS_WITH_DELETER(PolicyHandler,
+ utils::deleters::Deleter<PolicyHandler>);
+ FRIEND_DELETER_DESTRUCTOR(PolicyHandler);
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h b/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
new file mode 100644
index 0000000000..f1a9ff55b8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
+
+#include "utils/threads/thread_delegate.h"
+
+namespace policy {
+
+class PolicyHandler;
+
+class RetrySequence : public threads::ThreadDelegate {
+ public:
+ explicit RetrySequence(PolicyHandler* const policy_handler);
+ void threadMain();
+
+ private:
+ PolicyHandler* const policy_handler_;
+ void StartNextRetry();
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
diff --git a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h
new file mode 100644
index 0000000000..31f7ded507
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h
@@ -0,0 +1,47 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
+
+#include "policy/policy_manager.h"
+
+namespace policy {
+class PTExchangeHandler {
+ public:
+ virtual ~PTExchangeHandler() {};
+ virtual void Start() = 0;
+ virtual void Stop() = 0;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h
new file mode 100644
index 0000000000..05aec0c3e9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
+
+#include "application_manager/policies/pt_exchange_handler.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace policy {
+class PTExchangeHandlerExt : public PTExchangeHandler {
+ public:
+ PTExchangeHandlerExt(PolicyHandler* policy_handler);
+ ~PTExchangeHandlerExt();
+ virtual void Start();
+ virtual void Stop();
+
+ private:
+ PolicyHandler* policy_handler_;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
diff --git a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h
new file mode 100644
index 0000000000..e1e67b1505
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
+
+#include "application_manager/policies/pt_exchange_handler.h"
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
+
+namespace policy {
+
+class PolicyHandler;
+
+class PTExchangeHandlerImpl : public PTExchangeHandler {
+ public:
+ PTExchangeHandlerImpl(PolicyHandler* handler);
+ virtual ~PTExchangeHandlerImpl();
+ virtual void Start();
+ virtual void Stop();
+
+ protected:
+ PolicyHandler* policy_handler_;
+ threads::Thread retry_sequence_;
+ sync_primitives::Lock retry_sequence_lock_;
+
+ friend class RetrySequence;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h
new file mode 100644
index 0000000000..b70608fbc2
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -0,0 +1,266 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+
+#include <climits>
+#include <vector>
+#include <list>
+
+#include "utils/lock.h"
+#include "utils/shared_ptr.h"
+#include "utils/threads/thread.h"
+#include "utils/conditional_variable.h"
+#include "utils/threads/thread_delegate.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+#include "application_manager/request_info.h"
+#include "utils/timer_thread.h"
+
+
+namespace application_manager {
+
+namespace request_controller {
+
+using namespace threads;
+
+/**
+* @brief RequestController class is used to control currently active mobile
+* requests.
+*/
+class RequestController {
+ public:
+
+ /**
+ * @brief Result code for addRequest
+ */
+ enum TResult
+ {
+ SUCCESS = 0,
+ TOO_MANY_REQUESTS,
+ TOO_MANY_PENDING_REQUESTS,
+ NONE_HMI_LEVEL_MANY_REQUESTS,
+ INVALID_DATA
+ };
+
+ /**
+ * @brief Thread pool state
+ */
+ enum TPoolState
+ {
+ UNDEFINED = 0,
+ STARTED,
+ STOPPED,
+ };
+
+ // Methods
+
+ /**
+ * @brief Class constructor
+ *
+ */
+ RequestController();
+
+ /**
+ * @brief Class destructor
+ *
+ */
+ virtual ~RequestController();
+
+ /**
+ * @brief Initialize thread pool
+ *
+ */
+ void InitializeThreadpool();
+
+ /**
+ * @brief Destroy thread pool
+ *
+ */
+ void DestroyThreadpool();
+
+ /**
+ * @brief Check if max request amount wasn't exceed and adds request to queue.
+ *
+ * @param request Active mobile request
+ * @param hmi_level Current application hmi_level
+ *
+ * @return Result code
+ *
+ */
+ TResult addMobileRequest(const MobileRequestPtr& request,
+ const mobile_apis::HMILevel::eType& hmi_level);
+
+
+ /**
+ * @brief Store HMI request until response or timeout won't remove it
+ *
+ * @param request Active hmi request
+ * @return Result code
+ *
+ */
+ TResult addHMIRequest(const RequestPtr& request);
+
+ /**
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ void addNotification(const RequestPtr ptr);
+
+ /**
+ * @brief Removes request from queue
+ *
+ * @param mobile_corellation_id Active mobile request correlation ID
+ *
+ */
+ void terminateMobileRequest(const uint32_t& mobile_correlation_id);
+
+
+ /**
+ * @brief Removes request from queue
+ *
+ * @param mobile_corellation_id Active mobile request correlation ID
+ *
+ */
+ void terminateHMIRequest(const uint32_t& correlation_id);
+
+ /**
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ void removeNotification(const commands::Command* notification);
+
+ /**
+ * @brief Removes all requests from queue for specified application
+ *
+ * @param app_id Mobile application ID (app_id)
+ *
+ */
+ void terminateAppRequests(const uint32_t& app_id);
+
+ /**
+ * @brief Terminates all requests from HMI
+ */
+ void terminateAllHMIRequests();
+
+ /**
+ * @brief Updates request timeout
+ *
+ * @param app_id Connection key of application
+ * @param mobile_correlation_id Correlation ID of the mobile request
+ * @param new_timeout_value New timeout to be set
+ */
+ void updateRequestTimeout(const uint32_t& app_id,
+ const uint32_t& mobile_correlation_id,
+ const uint32_t& new_timeout);
+
+ protected:
+
+ /**
+ * @brief Checs if this app as able to add new requests, or limits was exceeded
+ * @param app_id - application id
+ * @param app_time_scale - time scale (seconds)
+ * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
+ */
+ bool checkTimeScaleMaxRequest(const uint32_t& app_id, const uint32_t& app_time_scale, const uint32_t& max_request_per_time_scale);
+
+ /**
+ * @brief Checs if this app as able to add new requests in current hmi_level, or limits was exceeded
+ * @param hmi_level - hmi level
+ * @param app_id - application id
+ * @param app_time_scale - time scale (seconds)
+ * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
+ */
+ bool checkHMILevelTimeScaleMaxRequest(const mobile_apis::HMILevel::eType& hmi_level, const uint32_t& app_id, const uint32_t& app_time_scale, const uint32_t& max_request_per_time_scale);
+
+ void onTimer();
+
+ /**
+ * @brief Update timout for next OnTimer
+ * Not thread safe
+ */
+ void UpdateTimer();
+
+ private:
+
+ // Data types
+
+ class Worker : public ThreadDelegate {
+ public:
+ Worker(RequestController* requestController);
+ virtual ~Worker();
+ virtual void threadMain();
+ virtual bool exitThreadMain();
+ protected:
+ private:
+ RequestController* request_controller_;
+ sync_primitives::Lock thread_lock_;
+ volatile bool stop_flag_;
+ };
+
+ /**
+ * @brief Typedef for thread shared pointer
+ */
+ typedef utils::SharedPtr<Thread> ThreadSharedPtr;
+
+ std::vector<ThreadSharedPtr> pool_;
+ volatile TPoolState pool_state_;
+ uint32_t pool_size_;
+ sync_primitives::ConditionalVariable cond_var_;
+
+ std::list<MobileRequestPtr> mobile_request_list_;
+ sync_primitives::Lock mobile_request_list_lock_;
+
+ RequestInfoSet pending_request_set_;
+ sync_primitives::Lock pending_request_set_lock_;
+
+ /**
+ * @brief Set of HMI notifications with timeout.
+ */
+ std::list<RequestPtr> notification_list_;
+
+ timer::TimerThread<RequestController> timer_;
+ static const uint32_t dafault_sleep_time_ = UINT_MAX;
+
+ DISALLOW_COPY_AND_ASSIGN(RequestController);
+};
+
+} // namespace request_controller
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
new file mode 100644
index 0000000000..778e72c916
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -0,0 +1,236 @@
+/**
+* \file request_info.h
+* \brief request information structure header file.
+*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
+
+#include <stdint.h>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "commands/hmi/request_to_hmi.h"
+
+#include "utils/date_time.h"
+
+namespace application_manager {
+
+namespace request_controller {
+
+ /*
+ * @brief Typedef for active mobile request
+ *
+ */
+ typedef utils::SharedPtr<commands::Command> RequestPtr;
+ typedef utils::SharedPtr<commands::CommandRequestImpl> MobileRequestPtr;
+
+ struct RequestInfo {
+ RequestInfo(const uint64_t timeout_sec):
+ timeout_sec_(timeout_sec) {
+ start_time_ = date_time::DateTime::getCurrentTime();
+ updateEndTime();
+ }
+
+ RequestInfo(const TimevalStruct& start_time,const uint64_t timeout_sec):
+ start_time_(start_time),
+ timeout_sec_(timeout_sec) {
+ updateEndTime();
+ }
+
+ virtual ~RequestInfo(){}
+
+ virtual uint32_t requestId() = 0;
+ virtual commands::Command* request() = 0;
+
+ void updateEndTime() {
+ end_time_ = date_time::DateTime::getCurrentTime();
+ end_time_.tv_sec += timeout_sec_;
+ }
+
+ void updateTimeOut(const uint64_t& timeout_sec) {
+ timeout_sec_ = timeout_sec;
+ updateEndTime();
+ }
+
+ bool isExpired() {
+ if ( date_time::GREATER ==
+ date_time::DateTime::compareTime(end_time_, date_time::DateTime::getCurrentTime()) ) {
+ return false;
+ }
+ return true;
+ }
+ TimevalStruct start_time() {
+ return start_time_;
+ }
+ uint64_t timeout_sec() {
+ return timeout_sec_;
+ }
+
+ TimevalStruct end_time() {
+ return end_time_;
+ }
+
+ protected:
+ TimevalStruct start_time_;
+ uint64_t timeout_sec_;
+ TimevalStruct end_time_;
+ };
+
+ typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
+
+ struct RequestInfoComparator {
+ bool operator() (const RequestInfoPtr lhs, const RequestInfoPtr rhs) const {
+ date_time::TimeCompare compare_result = date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
+ return compare_result == date_time::LESS;
+ }
+ };
+
+ typedef std::set<RequestInfoPtr,RequestInfoComparator> RequestInfoSet;
+
+ struct HMIRequestInfo: public RequestInfo {
+ HMIRequestInfo(RequestPtr request, const uint64_t timeout_sec);
+ HMIRequestInfo(RequestPtr request, const TimevalStruct& start_time,const uint64_t timeout_sec);
+ RequestPtr request_;
+ uint32_t correlation_id_;
+ virtual uint32_t requestId() {
+ return correlation_id_;
+ }
+ virtual commands::Command* request() {
+ return request_.get();
+ }
+ };
+
+ struct MobileRequestInfo: public RequestInfo {
+ MobileRequestInfo(MobileRequestPtr request, const uint64_t timeout_sec);
+ MobileRequestInfo(MobileRequestPtr request, const TimevalStruct& start_time, const uint64_t timeout_sec);
+ MobileRequestPtr request_;
+ uint32_t app_id_;
+ mobile_apis::HMILevel::eType hmi_level_;
+ uint32_t mobile_correlation_id_;
+
+ virtual uint32_t requestId() {
+ return mobile_correlation_id_;
+ }
+
+ virtual commands::Command* request() {
+ return request_.get();
+ }
+ };
+
+ /**
+ * @brief Structure used in std algorithms to determine amount of request
+ * during time scale
+ */
+ struct TimeScale {
+ explicit TimeScale(const TimevalStruct& start, const TimevalStruct& end,
+ const int32_t& app_id)
+ : start_(start),
+ end_(end),
+ app_id_(app_id) {}
+
+ bool operator()(RequestInfoPtr setEntry) {
+ MobileRequestInfo* mobile_request_info = NULL;
+ RequestInfo* request = setEntry.get();
+ mobile_request_info = dynamic_cast<MobileRequestInfo*>(request);
+ if (NULL == mobile_request_info) {
+ return false;
+ }
+
+ if (mobile_request_info->app_id_ != app_id_) {
+ return false;
+ }
+
+ if (date_time::DateTime::getmSecs(mobile_request_info->start_time())
+ < date_time::DateTime::getmSecs(start_) ||
+ date_time::DateTime::getmSecs(mobile_request_info->start_time())
+ > date_time::DateTime::getmSecs(end_)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private:
+ TimevalStruct start_;
+ TimevalStruct end_;
+ uint32_t app_id_;
+ };
+
+ /**
+ * @brief Structure used in std algorithms to determine amount of request
+ * during time scale for application in defined hmi level
+ */
+ struct HMILevelTimeScale {
+ explicit HMILevelTimeScale(
+ const TimevalStruct& start, const TimevalStruct& end,
+ const uint32_t& app_id, const mobile_apis::HMILevel::eType& hmi_level)
+ : start_(start),
+ end_(end),
+ app_id_(app_id),
+ hmi_level_(hmi_level) {}
+
+ bool operator()(RequestInfoPtr setEntry) {
+ MobileRequestInfo* mobile_request_info = NULL;
+ mobile_request_info = dynamic_cast<MobileRequestInfo*>(setEntry.get());
+ if (NULL == mobile_request_info) {
+ return false;
+ }
+ if (mobile_request_info->app_id_ != app_id_) {
+ return false;
+ }
+ if (mobile_request_info->hmi_level_ != hmi_level_) {
+ return false;
+ }
+
+ if (date_time::DateTime::getSecs(mobile_request_info->start_time())
+ < date_time::DateTime::getSecs(start_) ||
+ date_time::DateTime::getSecs(mobile_request_info->start_time())
+ > date_time::DateTime::getSecs(end_)) {
+ return false;
+ }
+
+ return true;
+ }
+ private:
+ TimevalStruct start_;
+ TimevalStruct end_;
+ uint32_t app_id_;
+ mobile_apis::HMILevel::eType hmi_level_;
+ };
+
+
+
+} // namespace request_controller
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
diff --git a/src/components/application_manager/include/application_manager/resume_ctrl.h b/src/components/application_manager/include/application_manager/resume_ctrl.h
new file mode 100644
index 0000000000..463df0b867
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/resume_ctrl.h
@@ -0,0 +1,285 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+#include <set>
+#include <list>
+
+#include "json/json.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+#include "connection_handler/connection_handler_observer.h"
+#include "connection_handler/device.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/application.h"
+#include "utils/timer_thread.h"
+
+namespace application_manager {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class ApplicationManagerImpl;
+class Application;
+class ResumeCtrl: public event_engine::EventObserver {
+
+ public:
+
+ /**
+ * @brief Constructor
+ * @param app_mngr ApplicationManager pointer
+ */
+ explicit ResumeCtrl(ApplicationManagerImpl* app_mngr);
+
+ /**
+ * @brief Event, that raised if application get resumption response from HMI
+ * @param event : event object, that contains smart_object with HMI message
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Save all applications info to the file system
+ */
+ void SaveAllApplications();
+
+ /**
+ * @brief Save application persistent info for future resuming
+ * @param application is application witch need to be saved
+ */
+ void SaveApplication(ApplicationConstSharedPtr application);
+
+ /**
+ * @brief Set application HMI Level as saved
+ * @param application is application witch HMI Level is need to restore
+ * @return true if success, otherwise return false
+ */
+ bool RestoreApplicationHMILevel(ApplicationSharedPtr application);
+
+ /**
+ * @brief Set application HMI Level as stored in policy
+ * @param application is application witch HMI Level is need to setup
+ * @return true if success, otherwise return false
+ */
+ bool SetupDefaultHMILevel(ApplicationSharedPtr application);
+
+ /**
+ * @brief Setup HmiLevel for application
+ * Do routine of setting up hmi_level
+ * @param application is application witch HMI Level is need to setup
+ * @param hmi_level HMI Level is needed to setup
+ * @param hmi_level AudioStreamingState is needed to setup
+ * @param check_policy indicate if policy data consent must be verified
+ * @return true if success, otherwise return false
+ */
+ bool SetupHMILevel(ApplicationSharedPtr application,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ bool check_policy = true);
+
+ /**
+ * @brief Set application HMI Level as saved
+ * @param application is application witch HMI Level is need to restore
+ * @return true if success, otherwise return false
+ */
+ bool RestoreApplicationData(ApplicationSharedPtr application);
+
+ /**
+ * @brief Check if Resume controller have saved instance of application
+ * @param application is application witch need to be checked
+ * @return true if exist, false otherwise
+ */
+ bool ApplicationIsSaved(ApplicationConstSharedPtr application);
+
+ /**
+ * @brief Remove application from list of saved applications
+ * @param application is application witch need to be removed
+ * @return return true, if success, otherwise return false
+ */
+ bool RemoveApplicationFromSaved(ApplicationConstSharedPtr application);
+
+ /**
+ * @brief Increments ignition counter for all registered applications
+ */
+ void IgnitionOff();
+
+ /**
+ * @brief Start timer for resumption applications
+ * Restore D1-D5 data
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool StartResumption(ApplicationSharedPtr application, uint32_t hash);
+
+ /**
+ * @brief Start timer for resumption applications
+ * Does not restore D1-D5 data
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool StartResumptionOnlyHMILevel(ApplicationSharedPtr application);
+
+ /**
+ * @brief Check if there are all files need for resumption
+ * @param application that is need to be restored
+ * @return true if it all files exist, otherwise return false
+ */
+ bool CheckPersistenceFilesForResumption(ApplicationSharedPtr application);
+
+ /**
+ * @brief Check application hash
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool CheckApplicationHash(ApplicationSharedPtr application, uint32_t hash);
+
+ /**
+ * @brief Check if Resume controller have saved application with hmi app id
+ * @param hmi_app_id - hmi application id
+ * @return true if exist, false otherwise
+ */
+ bool IsHMIApplicationIdExist(uint32_t hmi_app_id);
+
+ /**
+ * @brief Check if Resume controller have saved instance of application
+ * @param mobile_app_id - mobile application id
+ * @return true if exist, false otherwise
+ */
+ bool IsApplicationSaved(const std::string& mobile_app_id);
+
+ /**
+ * @brief Function is used for application resume. HMI app ID must be
+ * the same(PASA VCA module use it for stored app info).
+ * Retrieves HMI app ID for the given mobile app ID from stored information.
+ *
+ * @param mobile_app_id - mobile application id
+ * @return HMI app ID
+ */
+ uint32_t GetHMIApplicationID(const std::string& mobile_app_id);
+
+ /**
+ * @brief Timer callback function
+ *
+ */
+ void onTimer();
+
+ void ClearResumptionInfo();
+
+ private:
+
+ typedef std::pair<uint32_t, uint32_t> application_timestamp;
+
+ /**
+ * @brief This struct need to map
+ * timestamp and application from correlationID
+ */
+ struct ResumingApp {
+ uint32_t old_session_key; // session key is the same as app_id
+ ApplicationSharedPtr app;
+ };
+
+ struct TimeStampComparator {
+ bool operator() (const application_timestamp& lhs,
+ const application_timestamp& rhs) const{
+ return lhs.second < rhs.second;
+ }
+ };
+
+ /**
+ * @brief Check device MAC address
+ *
+ * @param application that is need to be restored
+ * @param saved_device_mac Saved device MAC address
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool IsDeviceMacAddressEqual(ApplicationSharedPtr application,
+ const std::string& saved_device_mac);
+
+ Json::Value& GetSavedApplications();
+
+ void SetSavedApplication(Json::Value& apps_json);
+
+ Json::Value GetApplicationCommands(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationSubMenus(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationInteractionChoiseSets(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationGlobalProperties(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationSubscriptions(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationFiles(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationShow(
+ ApplicationConstSharedPtr application);
+
+ Json::Value JsonFromSO(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject *so);
+
+ void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params = NULL,
+ bool use_events = false);
+
+ bool ProcessHMIRequest(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* request = NULL,
+ bool use_events = false);
+
+ /**
+ * @brief Time step to check resumption TIME_OUT
+ */
+ static const uint32_t kTimeStep = 3;
+
+ /**
+ * @brief times of IGN_OFF that zombie application have to be saved.
+ */
+ static const uint32_t kApplicationLifes = 3;
+
+ /**
+ *@brief Mapping applications to time_stamps
+ * wait for timer to resume HMI Level
+ *
+ */
+ std::multiset<application_timestamp, TimeStampComparator> waiting_for_timer_;
+ mutable sync_primitives::Lock queue_lock_;
+ ApplicationManagerImpl* app_mngr_;
+ timer::TimerThread<ResumeCtrl> timer_;
+};
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
new file mode 100644
index 0000000000..1df8b21ad9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -0,0 +1,369 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
+
+namespace application_manager {
+
+namespace strings {
+
+const char params[] = "params";
+const char message_type[] = "message_type";
+const char correlation_id[] = "correlation_id";
+const char function_id[] = "function_id";
+const char protocol_version[] = "protocol_version";
+const char protocol_type[] = "protocol_type";
+const char connection_key[] = "connection_key";
+const char error[] = "error";
+const char error_msg[] = "message";
+const char default_app_id[] = "default";
+
+
+const char msg_params[] = "msg_params";
+const char info[] = "info";
+const char app_id[] = "appID";
+const char hmi_app_id[] = "hmiAppID";
+const char device_mac[] = "deviceMAC";
+const char url[] = "url";
+const char cmd_icon[] = "cmdIcon";
+const char result_code[] = "resultCode";
+const char success[] = "success";
+const char sync_msg_version[] = "syncMsgVersion";
+const char major_version[] = "majorVersion";
+const char minor_version[] = "minorVersion";
+const char app_name[] = "appName";
+const char ngn_media_screen_app_name[] = "ngnMediaScreenAppName";
+const char vr_synonyms[] = "vrSynonyms";
+const char uses_vehicle_data[] = "usesVehicleData";
+const char is_media_application[] = "isMediaApplication";
+const char language_desired[] = "languageDesired";
+const char auto_activated_id[] = "autoActivateID";
+const char app_type[] = "appType";
+const char app_hmi_type[] = "appHMIType";
+const char tts_name[] = "ttsName";
+const char binary_data[] = "binary_data";
+const char timeout_prompt[] = "timeoutPrompt";
+const char timeout[] = "timeout";
+const char vr_help_title[] = "vrHelpTitle";
+const char vr_help[] = "vrHelp";
+const char main_field_1[] = "mainField1";
+const char main_field_2[] = "mainField2";
+const char main_field_3[] = "mainField3";
+const char main_field_4[] = "mainField4";
+const char eta[] = "eta";
+const char time_to_destination[] = "timeToDestination";
+const char total_distance[] = "totalDistance";
+const char alignment[] = "alignment";
+const char graphic[] = "graphic";
+const char secondary_graphic[] = "secondaryGraphic";
+const char status_bar[] = "statusBar";
+const char media_clock[] = "mediaClock";
+const char media_track[] = "mediaTrack";
+const char properties[] = "properties";
+const char cmd_id[] = "cmdID";
+const char menu_params[] = "menuParams";
+const char menu_title[] = "menuTitle";
+const char menu_icon[] = "menuIcon";
+const char keyboard_properties[] = "keyboardProperties";
+const char vr_commands[] = "vrCommands";
+const char position[] = "position";
+const char num_ticks[] = "numTicks";
+const char slider_footer[] = "sliderFooter";
+const char menu_id[] = "menuID";
+const char menu_name[] = "menuName";
+const char interaction_choice_set_id[] = "interactionChoiceSetID";
+const char interaction_choice_set_id_list[] = "interactionChoiceSetIDList";
+const char choice_set[] = "choiceSet";
+const char choice_id[] = "choiceID";
+const char grammar_id[] = "grammarID";
+const char navigation_text_1[] = "navigationText1";
+const char navigation_text_2[] = "navigationText2";
+const char alert_text1[] = "alertText1";
+const char alert_text2[] = "alertText2";
+const char alert_text3[] = "alertText3";
+const char tts_chunks[] = "ttsChunks";
+const char initial_prompt[] = "initialPrompt";
+const char initial_text[] = "initialText";
+const char duration[] = "duration";
+const char progress_indicator[] = "progressIndicator";
+const char alert_type[] = "alertType";
+const char play_tone[] = "playTone";
+const char soft_buttons[] = "softButtons";
+const char soft_button_id[] = "softButtonID";
+const char custom_presets[] = "customPresets";
+const char audio_pass_display_text1[] = "audioPassThruDisplayText1";
+const char audio_pass_display_text2[] = "audioPassThruDisplayText2";
+const char max_duration[] = "maxDuration";
+const char sampling_rate[] = "samplingRate";
+const char bits_per_sample[] = "bitsPerSample";
+const char audio_type[] = "audioType";
+const char mute_audio[] = "muteAudio";
+const char button_name[] = "buttonName";
+const char button_event_mode[] = "buttonEventMode";
+const char button_press_mode[] = "buttonPressMode";
+const char custom_button_id[] = "customButtonID";
+const char data_type[] = "dataType";
+const char turn_list[] = "turnList";
+const char turn_icon[] = "turnIcon";
+const char next_turn_icon[] = "nextTurnIcon";
+const char value[] = "value";
+const char hmi_display_language[] = "hmiDisplayLanguage";
+const char language[] = "language";
+const char data[] = "data";
+const char start_time[] = "startTime";
+const char end_time[] = "endTime";
+const char hours[] = "hours";
+const char minutes[] = "minutes";
+const char seconds [] = "seconds";
+const char update_mode[] = "updateMode";
+const char trigger_source[] = "triggerSource";
+const char hmi_level[] = "hmiLevel";
+const char activate_app_hmi_level[] = "level";
+const char audio_streaming_state[] = "audioStreamingState";
+const char system_context[] = "systemContext";
+const char speech_capabilities[] = "speechCapabilities";
+const char vr_capabilities[] = "vrCapabilities";
+const char audio_pass_thru_capabilities[] = "audioPassThruCapabilities";
+// PutFile
+const char sync_file_name[] = "syncFileName";
+const char file_name[] = "fileName";
+const char file_type[] = "fileType";
+const char file_size[] = "fileSize";
+const char request_type[] = "requestType";
+const char persistent_file[] = "persistentFile";
+const char file_data[] = "fileData";
+const char space_available[] = "spaceAvailable";
+const char image_type[] = "imageType";
+const char image[] = "image";
+const char type[] = "type";
+const char system_file[] = "systemFile";
+const char offset[] = "offset";
+const char length[] = "length";
+const char secondary_image[] = "secondaryImage";
+const char filenames[] = "filenames";
+
+const char hmi_display_language_desired[] = "hmiDisplayLanguageDesired";
+const char ecu_name[] = "ecuName";
+const char dtc_mask[] = "dtcMask";
+const char did_location[] = "didLocation";
+const char app_list[] = "appList";
+const char device_list[] = "deviceList";
+const char device_info[] = "deviceInfo";
+const char name[] = "name";
+const char id[] = "id";
+const char isSDLAllowed[] = "isSDLAllowed";
+const char application[] = "application";
+const char applications[] = "applications";
+const char icon[] = "icon";
+const char device_name[] = "deviceName";
+const char reason[] = "reason";
+const char available[] = "available";
+const char text[] = "text";
+const char character_set[] = "characterSet";
+const char secondary_text[] = "secondaryText";
+const char tertiary_text[] = "tertiaryText";
+const char hardware[] = "hardware";
+const char firmware_rev[] = "firmwareRev";
+const char os[] = "os";
+const char os_version[] = "osVersion";
+const char carrier[] = "carrier";
+const char slider_header[] = "sliderHeader";
+
+// duplicate names from hmi_request
+const char limited_character_list[] = "limitedCharacterList";
+const char auto_complete_text[] = "autoCompleteText";
+const char navigation_text[] = "navigationText";
+
+// vehicle info
+const char gps[] = "gps";
+const char speed[] = "speed";
+const char rpm[] = "rpm";
+const char fuel_level[] = "fuelLevel";
+const char fuel_level_state[] = "fuelLevel_State";
+const char instant_fuel_consumption[] = "instantFuelConsumption";
+const char external_temp[] = "externalTemperature";
+const char vin[] = "vin";
+const char prndl[] = "prndl";
+const char tire_pressure[] = "tirePressure";
+const char odometer[] = "odometer";
+const char belt_status[] = "beltStatus";
+const char body_information[] = "bodyInformation";
+const char device_status[] = "deviceStatus";
+const char driver_braking[] = "driverBraking";
+const char wiper_status[] = "wiperStatus";
+const char head_lamp_status[] = "headLampStatus";
+const char engine_torque[] = "engineTorque";
+const char acc_pedal_pos[] = "accPedalPosition";
+const char steering_wheel_angle[] = "steeringWheelAngle";
+const char e_call_info[] = "eCallInfo";
+const char airbag_status[] = "airbagStatus";
+const char emergency_event[] = "emergencyEvent";
+const char cluster_mode_status[] = "clusterModeStatus";
+const char my_key[] = "myKey";
+const char help_prompt[] = "helpPrompt";
+const char scroll_message_body[] = "scrollableMessageBody";
+const char data_result[] = "dataResult";
+const char dtc_list[] = "dtcList";
+const char interaction_mode[] = "interactionMode";
+const char slider_position[] = "sliderPosition";
+const char system_action[] = "systemAction";
+const char prerecorded_speech[] = "prerecordedSpeech";
+const char supported_diag_modes[] = "supportedDiagModes";
+const char priority[] = "priority";
+
+//resuming
+const char application_commands[] = "applicationCommands";
+const char application_submenus[] = "applicationSubMenus";
+const char application_choise_sets[] = "applicationChoiceSets";
+const char application_global_properties[] = "globalProperties";
+const char application_vehicle_info[] = "vehicleInfo";
+const char application_buttons[] = "buttons";
+const char application_subscribtions[] = "subscribtions";
+const char application_files[] = "applicationFiles";
+const char application_show[] = "applicationShow";
+const char resumption[] = "resumption";
+const char resume_vr_grammars[] = "resumeVrGrammars";
+
+const char ign_off_count[] = "ign_off_count";
+const char connection_info[] = "connection_info";
+const char is_download_complete[] = "is_download_complete";
+
+const char hash_id[] = "hashID";
+const char time_stamp[] = "timeStamp";
+const char manual_text_entry[] = "manualTextEntry";
+const char image_type_supported[] = "imageTypeSupported";
+const char unexpected_disconnect[] = "unexpectedDisconnect";
+const char location_name[] = "locationName";
+const char location_description[] = "locationDescription";
+const char address_lines[] = "addressLines";
+const char phone_number[] = "phoneNumber";
+const char location_image[] = "locationImage";
+} // namespace strings
+
+namespace mobile_notification {
+const char state[] = "state";
+const char syncp_timeout[] = "Timeout";
+const char syncp_url[] = "URL";
+} // namespace mobile_notification
+
+namespace hmi_levels {
+const char kFull[] = "FULL";
+const char kLimited[] = "LIMITED";
+const char kBackground[] = "BACKGROUND";
+const char kNone[] = "NONE";
+}
+
+namespace hmi_request {
+const char parent_id[] = "parentID";
+const char field_name[] = "fieldName";
+const char field_text[] = "fieldText";
+const char alert_strings[] = "alertStrings";
+const char duration[] = "duration";
+const char soft_buttons[] = "softButtons";
+const char tts_chunks[] = "ttsChunks";
+const char speak_type[] = "speakType";
+const char audio_pass_display_texts[] = "audioPassThruDisplayTexts";
+const char max_duration[] = "maxDuration";
+const char reason[] = "reason";
+const char message_text[] = "messageText";
+const char initial_text[] = "initialText";
+const char navi_texts[] = "navigationTexts";
+const char navi_text[] = "navigationText";
+const char show_strings[] = "showStrings";
+const char interaction_layout[] = "interactionLayout";
+const char menu_title[] = "menuTitle";
+const char menu_icon[] = "menuIcon";
+const char keyboard_properties[] = "keyboardProperties";
+const char method_name[] = "methodName";
+const char keyboard_layout[] = "keyboardLayout";
+const char limited_character_list[] = "limitedCharacterList";
+const char auto_complete_text[] = "autoCompleteText";
+const char file[] = "file";
+const char retry[] = "retry";
+const char service[] = "service";
+} // namespace hmi_request
+
+namespace hmi_response {
+const char code[] = "code";
+const char message[] = "message";
+const char method[] = "method";
+const char try_again_time[] = "tryAgainTime";
+const char custom_button_id[] = "customButtonID";
+const char button_name[] = "name";
+const char button_mode[] = "mode";
+const char attenuated_supported[] = "attenuatedSupported";
+const char languages[] = "languages";
+const char language[] = "language";
+const char display_capabilities[] = "displayCapabilities";
+const char hmi_zone_capabilities[] = "hmiZoneCapabilities";
+const char soft_button_capabilities[] = "softButtonCapabilities";
+const char image_supported[] = "imageSupported";
+const char button_capabilities[] = "buttonCapabilities";
+const char capabilities[] = "capabilities";
+const char speech_capabilities[] = "speechCapabilities";
+const char prerecorded_speech_capabilities[] = "prerecordedSpeechCapabilities";
+const char preset_bank_capabilities[] = "presetBankCapabilities";
+const char allowed[] = "allowed";
+const char vehicle_type[] = "vehicleType";
+const char did_result[] = "didResult";
+const char result_code[] = "resultCode";
+const char dtc[] = "dtc";
+const char ecu_header[] = "ecuHeader";
+const char image_capabilities[] = "imageCapabilities";
+const char display_type[] = "displayType";
+const char text_fields[] = "textFields";
+const char media_clock_formats[] = "mediaClockFormats";
+const char graphic_supported[] = "graphicSupported";
+const char image_fields[] = "imageFields";
+const char templates_available[] = "templatesAvailable";
+const char screen_params[] = "screenParams";
+const char num_custom_presets_available[] = "numCustomPresetsAvailable";
+const char urls[] = "urls";
+const char policy_app_id[] = "policyAppId";
+} // namespace hmi_response
+
+namespace hmi_notification {
+const char prndl[] = "prndl";
+const char file_name[] = "file_name";
+const char system_context[] = "systemContext";
+const char state[] = "state";
+const char result[] = "result";
+const char statistic_type[] = "statisticType";
+const char error[] = "error";
+const char policyfile[] = "policyfile";
+
+} // namespace hmi_notification
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
diff --git a/src/components/application_manager/include/application_manager/time_metric_observer.h b/src/components/application_manager/include/application_manager/time_metric_observer.h
new file mode 100644
index 0000000000..780401f6f3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/time_metric_observer.h
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TIME_METRIC_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TIME_METRIC_OBSERVER_H_
+
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "json/json.h"
+#include "utils/shared_ptr.h"
+#include "utils/date_time.h"
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace application_manager {
+
+class AMMetricObserver {
+ public:
+ struct MessageMetric {
+ TimevalStruct begin;
+ TimevalStruct end;
+ utils::SharedPtr<smart_objects::SmartObject> message;
+ };
+ typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr;
+
+ virtual void OnMessage(MessageMetricSharedPtr) = 0;
+ virtual ~AMMetricObserver(){}
+};
+} // application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
new file mode 100644
index 0000000000..dcd57aee34
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+
+#include <string>
+#include "usage_statistics/counter.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+class UsageStatistics {
+ public:
+ UsageStatistics(const std::string& app_id,
+ utils::SharedPtr<usage_statistics::StatisticsManager>
+ statistics_manager);
+ void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level);
+ void RecordAppRegistrationGuiLanguage(
+ mobile_apis::Language::eType gui_language);
+ void RecordAppRegistrationVuiLanguage(
+ mobile_apis::Language::eType vui_language);
+ void RecordRpcSentInHMINone();
+ void RecordPolicyRejectedRpcCall();
+ void RecordAppUserSelection();
+ void RecordRunAttemptsWhileRevoked();
+ void RecordRemovalsForBadBehavior();
+
+ private:
+ usage_statistics::AppStopwatch time_in_hmi_state_;
+ usage_statistics::AppInfo app_registration_language_gui_;
+ usage_statistics::AppInfo app_registration_language_vui_;
+ usage_statistics::AppCounter count_of_rejected_rpc_calls_;
+ usage_statistics::AppCounter count_of_rpcs_sent_in_hmi_none_;
+ usage_statistics::AppCounter count_of_user_selections_;
+ usage_statistics::AppCounter count_of_run_attempts_while_revoked_;
+ usage_statistics::AppCounter count_of_removals_for_bad_behavior_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
diff --git a/src/components/application_manager/include/application_manager/vehicle_info_data.h b/src/components/application_manager/include/application_manager/vehicle_info_data.h
new file mode 100644
index 0000000000..0cac4fd8f9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/vehicle_info_data.h
@@ -0,0 +1,71 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
+
+namespace application_manager {
+ /*
+ * @brief Typedef for the vehicle data types that can
+ * be published and subscribed to
+ */
+enum VehicleDataType {
+ GPS = 0,
+ SPEED,
+ RPM,
+ FUELLEVEL,
+ FUELLEVEL_STATE,
+ FUELCONSUMPTION,
+ EXTERNTEMP,
+ VIN,
+ PRNDL,
+ TIREPRESSURE,
+ ODOMETER,
+ BELTSTATUS,
+ BODYINFO,
+ DEVICESTATUS,
+ ECALLINFO,
+ AIRBAGSTATUS,
+ EMERGENCYEVENT,
+ CLUSTERMODESTATUS,
+ MYKEY,
+ BRAKING,
+ WIPERSTATUS,
+ HEADLAMPSTATUS,
+ BATTVOLTAGE,
+ ENGINETORQUE,
+ ACCPEDAL,
+ STEERINGWHEEL
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc
new file mode 100644
index 0000000000..56fc88ffe3
--- /dev/null
+++ b/src/components/application_manager/src/application_data_impl.cc
@@ -0,0 +1,504 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_data_impl.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace application_manager {
+
+InitialApplicationDataImpl::InitialApplicationDataImpl()
+ : app_types_(NULL),
+ vr_synonyms_(NULL),
+ mobile_app_id_(NULL),
+ tts_name_(NULL),
+ ngn_media_screen_name_(NULL),
+ language_(mobile_api::Language::INVALID_ENUM),
+ ui_language_(mobile_api::Language::INVALID_ENUM) {
+}
+
+InitialApplicationDataImpl::~InitialApplicationDataImpl() {
+ if (app_types_) {
+ delete app_types_;
+ app_types_ = NULL;
+ }
+
+ if (vr_synonyms_) {
+ delete vr_synonyms_;
+ vr_synonyms_ = NULL;
+ }
+
+ if (mobile_app_id_) {
+ delete mobile_app_id_;
+ mobile_app_id_ = NULL;
+ }
+
+ if (tts_name_) {
+ delete tts_name_;
+ tts_name_ = NULL;
+ }
+
+ if (ngn_media_screen_name_) {
+ delete ngn_media_screen_name_;
+ ngn_media_screen_name_ = NULL;
+ }
+}
+
+const smart_objects::SmartObject*
+InitialApplicationDataImpl::app_types() const {
+ return app_types_;
+}
+
+const smart_objects::SmartObject*
+InitialApplicationDataImpl::vr_synonyms() const {
+ return vr_synonyms_;
+}
+
+const smart_objects::SmartObject*
+InitialApplicationDataImpl::mobile_app_id() const {
+ return mobile_app_id_;
+}
+
+const smart_objects::SmartObject* InitialApplicationDataImpl::tts_name() const {
+ return tts_name_;
+}
+
+const smart_objects::SmartObject*
+InitialApplicationDataImpl::ngn_media_screen_name() const {
+ return ngn_media_screen_name_;
+}
+
+const mobile_api::Language::eType&
+InitialApplicationDataImpl::language() const {
+ return language_;
+}
+
+const mobile_api::Language::eType&
+InitialApplicationDataImpl::ui_language() const {
+ return ui_language_;
+}
+
+void InitialApplicationDataImpl::set_app_types(
+ const smart_objects::SmartObject& app_types) {
+ if (app_types_) {
+ delete app_types_;
+ }
+
+ app_types_ = new smart_objects::SmartObject(app_types);
+}
+
+void InitialApplicationDataImpl::set_vr_synonyms(
+ const smart_objects::SmartObject& vr_synonyms) {
+ if (vr_synonyms_) {
+ delete vr_synonyms_;
+ }
+ vr_synonyms_ = new smart_objects::SmartObject(vr_synonyms);
+}
+
+void InitialApplicationDataImpl::set_mobile_app_id(
+ const smart_objects::SmartObject& mobile_app_id) {
+ if (mobile_app_id_) {
+ delete mobile_app_id_;
+ }
+ mobile_app_id_ = new smart_objects::SmartObject(mobile_app_id);
+}
+
+void InitialApplicationDataImpl::set_tts_name(
+ const smart_objects::SmartObject& tts_name) {
+ if (tts_name_) {
+ delete tts_name_;
+ }
+
+ tts_name_ = new smart_objects::SmartObject(tts_name);
+}
+
+void InitialApplicationDataImpl::set_ngn_media_screen_name(
+ const smart_objects::SmartObject& ngn_name) {
+ if (ngn_media_screen_name_) {
+ delete ngn_media_screen_name_;
+ }
+
+ ngn_media_screen_name_ = new smart_objects::SmartObject(ngn_name);
+}
+
+void InitialApplicationDataImpl::set_language(
+ const mobile_api::Language::eType& language) {
+ language_ = language;
+}
+
+void InitialApplicationDataImpl::set_ui_language(
+ const mobile_api::Language::eType& ui_language) {
+ ui_language_ = ui_language;
+}
+
+DynamicApplicationDataImpl::DynamicApplicationDataImpl()
+ : help_prompt_(NULL),
+ timeout_prompt_(NULL),
+ vr_help_title_(NULL),
+ vr_help_(NULL),
+ tbt_state_(mobile_api::TBTState::INVALID_ENUM),
+ show_command_(NULL),
+ keyboard_props_(NULL),
+ menu_title_(NULL),
+ menu_icon_(NULL),
+ tbt_show_command_(NULL),
+ commands_(),
+ sub_menu_(),
+ choice_set_map_(),
+ performinteraction_choice_set_map_(),
+ is_perform_interaction_active_(false),
+ perform_interaction_ui_corrid_(0),
+ is_reset_global_properties_active_(false),
+ perform_interaction_mode_(-1) {
+}
+
+DynamicApplicationDataImpl::~DynamicApplicationDataImpl() {
+ if (help_prompt_) {
+ delete help_prompt_;
+ help_prompt_ = NULL;
+ }
+
+ if (timeout_prompt_) {
+ delete timeout_prompt_;
+ timeout_prompt_ = NULL;
+ }
+
+ if (vr_help_title_) {
+ delete vr_help_title_;
+ vr_help_title_ = NULL;
+ }
+
+ if (vr_help_) {
+ delete vr_help_;
+ vr_help_ = NULL;
+ }
+
+ if (show_command_) {
+ delete show_command_;
+ show_command_ = NULL;
+ }
+
+ if (tbt_show_command_) {
+ delete tbt_show_command_;
+ tbt_show_command_ = NULL;
+ }
+
+ for (CommandsMap::iterator command_it = commands_.begin();
+ commands_.end() != command_it; ++command_it) {
+ delete command_it->second;
+ }
+ commands_.clear();
+
+ for (SubMenuMap::iterator sub_menu_it = sub_menu_.begin();
+ sub_menu_.end() != sub_menu_it; ++sub_menu_it) {
+ delete sub_menu_it->second;
+ }
+ sub_menu_.clear();
+
+ PerformChoiceSetMap::iterator it = performinteraction_choice_set_map_.begin();
+ for (; performinteraction_choice_set_map_.end() != it; ++it) {
+ delete it->second;
+ }
+ performinteraction_choice_set_map_.clear();
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::help_prompt() const {
+ return help_prompt_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::timeout_prompt() const {
+ return timeout_prompt_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::vr_help_title() const {
+ return vr_help_title_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::vr_help() const {
+ return vr_help_;
+}
+
+const mobile_api::TBTState::eType&
+DynamicApplicationDataImpl::tbt_state() const {
+ return tbt_state_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::show_command() const {
+ return show_command_;
+}
+
+const smart_objects::SmartObject*
+DynamicApplicationDataImpl::tbt_show_command() const {
+ return tbt_show_command_;
+}
+
+const NsSmartDeviceLink::NsSmartObjects::SmartObject *DynamicApplicationDataImpl::keyboard_props() const {
+ return keyboard_props_;
+}
+
+const NsSmartDeviceLink::NsSmartObjects::SmartObject *DynamicApplicationDataImpl::menu_title() const {
+ return menu_title_;
+}
+
+const NsSmartDeviceLink::NsSmartObjects::SmartObject* DynamicApplicationDataImpl::menu_icon() const {
+ return menu_icon_;
+}
+
+void DynamicApplicationDataImpl::set_help_prompt(
+ const smart_objects::SmartObject& help_prompt) {
+ if (help_prompt_) {
+ delete help_prompt_;
+ }
+ help_prompt_ = new smart_objects::SmartObject(help_prompt);
+}
+
+void DynamicApplicationDataImpl::set_timeout_prompt(
+ const smart_objects::SmartObject& timeout_prompt) {
+ if (timeout_prompt_) {
+ delete timeout_prompt_;
+ }
+ timeout_prompt_ = new smart_objects::SmartObject(timeout_prompt);
+}
+
+void DynamicApplicationDataImpl::set_vr_help_title(
+ const smart_objects::SmartObject& vr_help_title) {
+ if (vr_help_title_) {
+ delete vr_help_title_;
+ }
+ vr_help_title_ = new smart_objects::SmartObject(vr_help_title);
+}
+
+void DynamicApplicationDataImpl::reset_vr_help_title() {
+ if (vr_help_title_) {
+ delete vr_help_title_;
+ vr_help_title_ = NULL;
+ }
+}
+
+void DynamicApplicationDataImpl::set_vr_help(
+ const smart_objects::SmartObject& vr_help) {
+ if (vr_help_) {
+ delete vr_help_;
+ }
+ vr_help_ = new smart_objects::SmartObject(vr_help);
+}
+
+void DynamicApplicationDataImpl::reset_vr_help() {
+ if (vr_help_) {
+ delete vr_help_;
+ }
+ vr_help_ = NULL;
+}
+
+void DynamicApplicationDataImpl::set_tbt_state(
+ const mobile_api::TBTState::eType& tbt_state) {
+ tbt_state_ = tbt_state;
+}
+
+void DynamicApplicationDataImpl::set_show_command(
+ const smart_objects::SmartObject& show_command) {
+ if (show_command_) {
+ delete show_command_;
+ }
+ show_command_ = new smart_objects::SmartObject(show_command);
+}
+
+void DynamicApplicationDataImpl::set_tbt_show_command(
+ const smart_objects::SmartObject& tbt_show) {
+ if (tbt_show_command_) {
+ delete tbt_show_command_;
+ }
+ tbt_show_command_ = new smart_objects::SmartObject(tbt_show);
+}
+
+void DynamicApplicationDataImpl::set_keyboard_props(
+ const smart_objects::SmartObject& keyboard_props) {
+ if (keyboard_props_) {
+ delete keyboard_props_;
+ }
+ keyboard_props_ = new smart_objects::SmartObject(keyboard_props);
+}
+
+void DynamicApplicationDataImpl::set_menu_title(
+ const smart_objects::SmartObject& menu_title) {
+ if (menu_title_) {
+ delete menu_title_;
+ }
+ menu_title_ = new smart_objects::SmartObject(menu_title);
+}
+
+void DynamicApplicationDataImpl::set_menu_icon(
+ const smart_objects::SmartObject& menu_icon) {
+ if (menu_icon_) {
+ delete menu_icon_;
+ }
+ menu_icon_= new smart_objects::SmartObject(menu_icon);
+}
+
+
+void DynamicApplicationDataImpl::AddCommand(
+ uint32_t cmd_id, const smart_objects::SmartObject& command) {
+ commands_[cmd_id] = new smart_objects::SmartObject(command);
+}
+
+void DynamicApplicationDataImpl::RemoveCommand(uint32_t cmd_id) {
+ CommandsMap::iterator it = commands_.find(cmd_id);
+
+ if (commands_.end() != it) {
+ delete it->second;
+ commands_.erase(it);
+ }
+}
+
+smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand(
+ uint32_t cmd_id) {
+ CommandsMap::const_iterator it = commands_.find(cmd_id);
+ if (it != commands_.end()) {
+ return it->second;
+ }
+
+ return NULL;
+}
+
+// TODO(VS): Create common functions for processing collections
+void DynamicApplicationDataImpl::AddSubMenu(
+ uint32_t menu_id, const smart_objects::SmartObject& menu) {
+ sub_menu_[menu_id] = new smart_objects::SmartObject(menu);
+}
+
+void DynamicApplicationDataImpl::RemoveSubMenu(uint32_t menu_id) {
+ SubMenuMap::iterator it = sub_menu_.find(menu_id);
+
+ if (sub_menu_.end() != it) {
+ delete it->second;
+ sub_menu_.erase(menu_id);
+ }
+}
+
+smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu(
+ uint32_t menu_id) const {
+ SubMenuMap::const_iterator it = sub_menu_.find(menu_id);
+ if (it != sub_menu_.end()) {
+ return it->second;
+ }
+
+ return NULL;
+}
+
+bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist(
+ const std::string& name) {
+ for (SubMenuMap::iterator it = sub_menu_.begin();
+ sub_menu_.end() != it;
+ ++it) {
+ smart_objects::SmartObject* menu = it->second;
+ if ((*menu)[strings::menu_name] == name) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void DynamicApplicationDataImpl::AddChoiceSet(
+ uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) {
+ choice_set_map_[choice_set_id] = new smart_objects::SmartObject(choice_set);
+}
+
+void DynamicApplicationDataImpl::RemoveChoiceSet(uint32_t choice_set_id) {
+ ChoiceSetMap::iterator it = choice_set_map_.find(choice_set_id);
+
+ if (choice_set_map_.end() != it) {
+ delete it->second;
+ choice_set_map_.erase(choice_set_id);
+ }
+}
+
+smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet(
+ uint32_t choice_set_id) {
+ ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id);
+ if (it != choice_set_map_.end()) {
+ return it->second;
+ }
+
+ return NULL;
+}
+
+void DynamicApplicationDataImpl::AddPerformInteractionChoiceSet(
+ uint32_t choice_set_id, const smart_objects::SmartObject& vr_commands) {
+ performinteraction_choice_set_map_[choice_set_id] =
+ new smart_objects::SmartObject(vr_commands);
+}
+
+void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSetMap() {
+ PerformChoiceSetMap::iterator it = performinteraction_choice_set_map_.begin();
+ for (; performinteraction_choice_set_map_.end() != it; ++it) {
+ delete it->second;
+ }
+ performinteraction_choice_set_map_.clear();
+}
+
+smart_objects::SmartObject*
+DynamicApplicationDataImpl::FindPerformInteractionChoiceSet(
+ uint32_t choice_set_id) const {
+ PerformChoiceSetMap::const_iterator it = performinteraction_choice_set_map_
+ .find(choice_set_id);
+
+ if (it != performinteraction_choice_set_map_.end()) {
+ return it->second;
+ }
+
+ return NULL;
+}
+
+void DynamicApplicationDataImpl::set_perform_interaction_active(
+ uint32_t active) {
+ is_perform_interaction_active_ = active;
+}
+
+void DynamicApplicationDataImpl::set_perform_interaction_ui_corrid(
+ uint32_t corr_id) {
+ perform_interaction_ui_corrid_ = corr_id;
+}
+
+void DynamicApplicationDataImpl::set_reset_global_properties_active(
+ bool active) {
+ is_reset_global_properties_active_ = active;
+}
+
+void DynamicApplicationDataImpl::set_perform_interaction_mode(int32_t mode) {
+ perform_interaction_mode_ = mode;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
new file mode 100644
index 0000000000..2812c17ffb
--- /dev/null
+++ b/src/components/application_manager/src/application_impl.cc
@@ -0,0 +1,740 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <strings.h>
+#include <stdlib.h>
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+
+namespace {
+
+mobile_apis::FileType::eType StringToFileType(const char* str) {
+ if (0 == strcasecmp(str, "json")) {
+ return mobile_apis::FileType::JSON;
+ } else if (0 == strcasecmp(str, "bmp")) {
+ return mobile_apis::FileType::GRAPHIC_BMP;
+ } else if (0 == strcasecmp(str, "jpeg")) {
+ return mobile_apis::FileType::GRAPHIC_JPEG;
+ } else if (0 == strcasecmp(str, "png")) {
+ return mobile_apis::FileType::GRAPHIC_PNG;
+ } else if (0 == strcasecmp(str, "wave")) {
+ return mobile_apis::FileType::AUDIO_WAVE;
+ } else if ((0 == strcasecmp(str, "m4a")) ||
+ (0 == strcasecmp(str, "m4b")) ||
+ (0 == strcasecmp(str, "m4p")) ||
+ (0 == strcasecmp(str, "m4v")) ||
+ (0 == strcasecmp(str, "m4r")) ||
+ (0 == strcasecmp(str, "3gp")) ||
+ (0 == strcasecmp(str, "mp4")) ||
+ (0 == strcasecmp(str, "aac"))) {
+ return mobile_apis::FileType::AUDIO_AAC;
+ } else if (0 == strcasecmp(str, "mp3")) {
+ return mobile_apis::FileType::AUDIO_MP3;
+ } else {
+ return mobile_apis::FileType::BINARY;
+ }
+}
+}
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+
+ApplicationImpl::ApplicationImpl(uint32_t application_id,
+ const std::string& mobile_app_id,
+ const std::string& app_name,
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager)
+ : grammar_id_(0),
+ app_id_(application_id),
+ active_message_(NULL),
+ is_media_(false),
+ allowed_support_navigation_(false),
+ hmi_supports_navi_video_streaming_(false),
+ hmi_supports_navi_audio_streaming_(false),
+ is_app_allowed_(true),
+ has_been_activated_(false),
+ tts_speak_state_(false),
+ tts_properties_in_none_(false),
+ tts_properties_in_full_(false),
+ hmi_level_(mobile_api::HMILevel::HMI_NONE),
+ put_file_in_none_count_(0),
+ delete_file_in_none_count_(0),
+ list_files_in_none_count_(0),
+ system_context_(mobile_api::SystemContext::SYSCTXT_MAIN),
+ audio_streaming_state_(mobile_api::AudioStreamingState::NOT_AUDIBLE),
+ device_(0),
+ usage_report_(mobile_app_id, statistics_manager),
+ protocol_version_(ProtocolVersion::kV3),
+ is_video_stream_retry_active_(false),
+ is_audio_stream_retry_active_(false),
+ video_stream_retry_number_(0),
+ audio_stream_retry_number_(0) {
+
+ cmd_number_to_time_limits_[mobile_apis::FunctionID::ReadDIDID] =
+ {date_time::DateTime::getCurrentTime(), 0};
+ cmd_number_to_time_limits_[mobile_apis::FunctionID::GetVehicleDataID] =
+ {date_time::DateTime::getCurrentTime(), 0};
+
+
+ set_mobile_app_id(smart_objects::SmartObject(mobile_app_id));
+ set_name(app_name);
+
+ // subscribe application to custom button by default
+ SubscribeToButton(mobile_apis::ButtonName::CUSTOM_BUTTON);
+
+ // load persistent files
+ LoadPersistentFiles();
+}
+
+ApplicationImpl::~ApplicationImpl() {
+ // TODO(AK): check if this is correct assimption
+ if (active_message_) {
+ delete active_message_;
+ active_message_ = NULL;
+ }
+
+ subscribed_buttons_.clear();
+ subscribed_vehicle_info_.clear();
+ if (is_perform_interaction_active()) {
+ set_perform_interaction_active(0);
+ set_perform_interaction_mode(-1);
+ DeletePerformInteractionChoiceSetMap();
+ }
+ CleanupFiles();
+}
+
+void ApplicationImpl::CloseActiveMessage() {
+ delete active_message_;
+ active_message_ = NULL;
+}
+
+bool ApplicationImpl::IsFullscreen() const {
+ return mobile_api::HMILevel::HMI_FULL == hmi_level_;
+}
+
+bool ApplicationImpl::MakeFullscreen() {
+ hmi_level_ = mobile_api::HMILevel::HMI_FULL;
+ if (is_media_ && !tts_speak_state_) {
+ audio_streaming_state_ = mobile_api::AudioStreamingState::AUDIBLE;
+ }
+ system_context_ = mobile_api::SystemContext::SYSCTXT_MAIN;
+ if (!has_been_activated_) {
+ has_been_activated_ = true;
+ }
+ return true;
+}
+
+bool ApplicationImpl::IsAudible() const {
+ return mobile_api::HMILevel::HMI_FULL == hmi_level_
+ || mobile_api::HMILevel::HMI_LIMITED == hmi_level_;
+}
+
+void ApplicationImpl::MakeNotAudible() {
+ hmi_level_ = mobile_api::HMILevel::HMI_BACKGROUND;
+ audio_streaming_state_ = mobile_api::AudioStreamingState::NOT_AUDIBLE;
+}
+
+bool ApplicationImpl::allowed_support_navigation() const {
+ return allowed_support_navigation_;
+}
+
+void ApplicationImpl::set_allowed_support_navigation(bool allow) {
+ allowed_support_navigation_ = allow;
+}
+
+const smart_objects::SmartObject* ApplicationImpl::active_message() const {
+ return active_message_;
+}
+
+const Version& ApplicationImpl::version() const {
+ return version_;
+}
+
+void ApplicationImpl::set_hmi_application_id(uint32_t hmi_app_id) {
+ hmi_app_id_ = hmi_app_id;
+}
+
+const std::string& ApplicationImpl::name() const {
+ return app_name_;
+}
+
+const std::string ApplicationImpl::folder_name() const {
+ return name() + mobile_app_id()->asString();
+}
+
+bool ApplicationImpl::is_media_application() const {
+ return is_media_;
+}
+
+const mobile_api::HMILevel::eType& ApplicationImpl::hmi_level() const {
+ return hmi_level_;
+}
+
+const uint32_t ApplicationImpl::put_file_in_none_count() const {
+ return put_file_in_none_count_;
+}
+
+const uint32_t ApplicationImpl::delete_file_in_none_count() const {
+ return delete_file_in_none_count_;
+}
+
+const uint32_t ApplicationImpl::list_files_in_none_count() const {
+ return list_files_in_none_count_;
+}
+
+const mobile_api::SystemContext::eType&
+ApplicationImpl::system_context() const {
+ return system_context_;
+}
+
+const std::string& ApplicationImpl::app_icon_path() const {
+ return app_icon_path_;
+}
+
+connection_handler::DeviceHandle ApplicationImpl::device() const {
+ return device_;
+}
+
+void ApplicationImpl::set_version(const Version& ver) {
+ version_ = ver;
+}
+
+void ApplicationImpl::set_name(const std::string& name) {
+ app_name_ = name;
+}
+
+void ApplicationImpl::set_is_media_application(bool is_media) {
+ is_media_ = is_media;
+ // Audio streaming state for non-media application can not be different
+ // from NOT_AUDIBLE
+ if (!is_media)
+ set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
+}
+
+void ApplicationImpl::set_tts_speak_state(bool state_tts_speak) {
+ tts_speak_state_ = state_tts_speak;
+}
+
+bool ApplicationImpl::tts_speak_state() {
+ return tts_speak_state_;
+}
+
+void ApplicationImpl::set_tts_properties_in_none(
+ bool active) {
+ tts_properties_in_none_ = active;
+}
+
+bool ApplicationImpl::tts_properties_in_none() {
+ return tts_properties_in_none_;
+}
+
+void ApplicationImpl::set_tts_properties_in_full(
+ bool active) {
+ tts_properties_in_full_ = active;
+}
+
+bool ApplicationImpl::tts_properties_in_full() {
+ return tts_properties_in_full_;
+}
+
+void ApplicationImpl::set_hmi_level(
+ const mobile_api::HMILevel::eType& hmi_level) {
+ if (mobile_api::HMILevel::HMI_NONE != hmi_level_ &&
+ mobile_api::HMILevel::HMI_NONE == hmi_level) {
+ put_file_in_none_count_ = 0;
+ delete_file_in_none_count_ = 0;
+ list_files_in_none_count_ = 0;
+ }
+
+ hmi_level_ = hmi_level;
+ usage_report_.RecordHmiStateChanged(hmi_level);
+}
+
+void ApplicationImpl::set_hmi_supports_navi_video_streaming(bool supports) {
+ hmi_supports_navi_video_streaming_ = supports;
+
+ if ((!supports) && (!video_stream_retry_active())) {
+ std::pair<uint32_t, int32_t> stream_retry =
+ profile::Profile::instance()->start_stream_retry_amount();
+ set_video_stream_retry_active(true);
+ video_stream_retry_number_ = stream_retry.first;
+ video_stream_retry_timer_ =
+ utils::SharedPtr<timer::TimerThread<ApplicationImpl>>(
+ new timer::TimerThread<ApplicationImpl>(
+ "VideoStreamRetry", this, &ApplicationImpl::OnVideoStreamRetry, true));
+ // start separate pthread for timer without delays
+ video_stream_retry_timer_->start(0);
+ }
+}
+
+bool ApplicationImpl::hmi_supports_navi_video_streaming() const {
+ return hmi_supports_navi_video_streaming_;
+}
+
+void ApplicationImpl::set_hmi_supports_navi_audio_streaming(bool supports) {
+ hmi_supports_navi_audio_streaming_ = supports;
+
+ if ((!supports) && (!audio_stream_retry_active())) {
+ std::pair<uint32_t, int32_t> stream_retry =
+ profile::Profile::instance()->start_stream_retry_amount();
+ set_audio_stream_retry_active(true);
+ audio_stream_retry_number_ = stream_retry.first;
+ audio_stream_retry_timer_ =
+ utils::SharedPtr<timer::TimerThread<ApplicationImpl>>(
+ new timer::TimerThread<ApplicationImpl>(
+ "AudioStreamRetry", this, &ApplicationImpl::OnAudioStreamRetry, true));
+ // start separate pthread for timer without delays
+ audio_stream_retry_timer_->start(0);
+ }
+}
+
+bool ApplicationImpl::hmi_supports_navi_audio_streaming() const {
+ return hmi_supports_navi_audio_streaming_;
+}
+
+bool ApplicationImpl::video_stream_retry_active() const {
+ return is_video_stream_retry_active_;
+}
+
+void ApplicationImpl::set_video_stream_retry_active(bool active) {
+ is_video_stream_retry_active_ = active;
+}
+
+bool ApplicationImpl::audio_stream_retry_active() const {
+ return is_audio_stream_retry_active_;
+}
+
+void ApplicationImpl::set_audio_stream_retry_active(bool active) {
+ is_audio_stream_retry_active_ = active;
+}
+
+void ApplicationImpl::OnVideoStreamRetry() {
+ if (video_stream_retry_number_) {
+ LOG4CXX_INFO(logger_, "Send video stream retry "
+ << video_stream_retry_number_);
+
+ application_manager::MessageHelper::SendNaviStartStream(app_id());
+ --video_stream_retry_number_;
+
+ std::pair<uint32_t, int32_t> stream_retry =
+ profile::Profile::instance()->start_stream_retry_amount();
+ int32_t time_out = stream_retry.second;
+ video_stream_retry_timer_->updateTimeOut(time_out);
+ } else {
+ LOG4CXX_INFO(logger_, "Stop video streaming retry");
+ video_stream_retry_timer_.release();
+ set_video_stream_retry_active(false);
+ }
+}
+
+void ApplicationImpl::OnAudioStreamRetry() {
+ if (audio_stream_retry_number_) {
+ LOG4CXX_INFO(logger_, "Send audio streaming retry "
+ << audio_stream_retry_number_);
+
+ application_manager::MessageHelper::SendAudioStartStream(app_id());
+ --audio_stream_retry_number_;
+
+ std::pair<uint32_t, int32_t> stream_retry =
+ profile::Profile::instance()->start_stream_retry_amount();
+ int32_t time_out = stream_retry.second;
+ audio_stream_retry_timer_->updateTimeOut(time_out);
+ } else {
+ LOG4CXX_INFO(logger_, "Stop audio streaming retry");
+ audio_stream_retry_timer_.release();
+ set_audio_stream_retry_active(false);
+ }
+}
+
+void ApplicationImpl::increment_put_file_in_none_count() {
+ ++put_file_in_none_count_;
+}
+
+void ApplicationImpl::increment_delete_file_in_none_count() {
+ ++delete_file_in_none_count_;
+}
+
+void ApplicationImpl::increment_list_files_in_none_count() {
+ ++list_files_in_none_count_;
+}
+
+void ApplicationImpl::set_system_context(
+ const mobile_api::SystemContext::eType& system_context) {
+ system_context_ = system_context;
+}
+
+void ApplicationImpl::set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) {
+ if (!is_media_application()
+ && state != mobile_api::AudioStreamingState::NOT_AUDIBLE) {
+ LOG4CXX_WARN(logger_, "Trying to set audio streaming state"
+ " for non-media application to different from NOT_AUDIBLE");
+ return;
+ }
+ audio_streaming_state_ = state;
+}
+
+bool ApplicationImpl::set_app_icon_path(const std::string& path) {
+ if (app_files_.find(path) != app_files_.end()) {
+ app_icon_path_ = path;
+ return true;
+ }
+ return false;
+}
+
+void ApplicationImpl::set_app_allowed(const bool& allowed) {
+ is_app_allowed_ = allowed;
+}
+
+void ApplicationImpl::set_device(connection_handler::DeviceHandle device) {
+ device_ = device;
+}
+
+uint32_t ApplicationImpl::get_grammar_id() const {
+ return grammar_id_;
+}
+
+void ApplicationImpl::set_grammar_id(uint32_t value) {
+ grammar_id_ = value;
+}
+
+bool ApplicationImpl::has_been_activated() const {
+ return has_been_activated_;
+}
+
+void ApplicationImpl::set_protocol_version(
+ const ProtocolVersion& protocol_version) {
+ protocol_version_ = protocol_version;
+}
+
+ProtocolVersion ApplicationImpl::protocol_version() const {
+ return protocol_version_;
+}
+
+bool ApplicationImpl::AddFile(AppFile& file) {
+ if (app_files_.count(file.file_name) == 0) {
+ LOG4CXX_INFO(logger_, "AddFile file " << file.file_name
+ << " File type is " << file.file_type);
+ app_files_[file.file_name] = file;
+ return true;
+ }
+ return false;
+}
+
+bool ApplicationImpl::UpdateFile(AppFile& file) {
+ if (app_files_.count(file.file_name) != 0) {
+ LOG4CXX_INFO(logger_, "UpdateFile file " << file.file_name
+ << " File type is " << file.file_type);
+ app_files_[file.file_name] = file;
+ return true;
+ }
+ return false;
+}
+
+bool ApplicationImpl::DeleteFile(const std::string& file_name) {
+ AppFilesMap::iterator it = app_files_.find(file_name);
+ if (it != app_files_.end()) {
+ LOG4CXX_INFO(logger_, "DeleteFile file " << it->second.file_name
+ << " File type is " << it->second.file_type);
+ app_files_.erase(it);
+ return true;
+ }
+ return false;
+}
+
+const AppFilesMap& ApplicationImpl::getAppFiles() const {
+ return this->app_files_;
+}
+
+const AppFile* ApplicationImpl::GetFile(const std::string& file_name) {
+ if (app_files_.find(file_name) != app_files_.end()) {
+ return &(app_files_[file_name]);
+ }
+ return NULL;
+}
+
+bool ApplicationImpl::SubscribeToButton(mobile_apis::ButtonName::eType btn_name) {
+ size_t old_size = subscribed_buttons_.size();
+ subscribed_buttons_.insert(btn_name);
+ return (subscribed_buttons_.size() == old_size + 1);
+}
+
+bool ApplicationImpl::IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name) {
+ std::set<mobile_apis::ButtonName::eType>::iterator it = subscribed_buttons_.find(btn_name);
+ return (subscribed_buttons_.end() != it);
+}
+
+bool ApplicationImpl::UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name) {
+ size_t old_size = subscribed_buttons_.size();
+ subscribed_buttons_.erase(btn_name);
+ return (subscribed_buttons_.size() == old_size - 1);
+}
+
+bool ApplicationImpl::SubscribeToIVI(uint32_t vehicle_info_type_) {
+ size_t old_size = subscribed_vehicle_info_.size();
+ subscribed_vehicle_info_.insert(vehicle_info_type_);
+ return (subscribed_vehicle_info_.size() == old_size + 1);
+}
+
+bool ApplicationImpl::IsSubscribedToIVI(uint32_t vehicle_info_type_) {
+ std::set<uint32_t>::iterator it = subscribed_vehicle_info_.find(
+ vehicle_info_type_);
+ return (subscribed_vehicle_info_.end() != it);
+}
+
+bool ApplicationImpl::UnsubscribeFromIVI(uint32_t vehicle_info_type_) {
+ size_t old_size = subscribed_vehicle_info_.size();
+ subscribed_vehicle_info_.erase(vehicle_info_type_);
+ return (subscribed_vehicle_info_.size() == old_size - 1);
+}
+
+UsageStatistics& ApplicationImpl::usage_report() {
+ return usage_report_;
+}
+
+bool ApplicationImpl::IsCommandLimitsExceeded(
+ mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source) {
+ TimevalStruct current = date_time::DateTime::getCurrentTime();
+ switch (source) {
+ // In case of config file values there is COMMON limitations for number of
+ // commands per certain time in seconds, i.e. 5 requests per 10 seconds with
+ // any interval between them
+ case CONFIG_FILE: {
+ CommandNumberTimeLimit::iterator it =
+ cmd_number_to_time_limits_.find(cmd_id);
+ if (cmd_number_to_time_limits_.end() == it) {
+ LOG4CXX_WARN(logger_, "Limits for command id " << cmd_id
+ << "had not been set.");
+ return true;
+ }
+
+ TimeToNumberLimit& limit = it->second;
+
+ std::pair<uint32_t, int32_t> frequency_restrictions;
+
+ if (mobile_apis::FunctionID::ReadDIDID == cmd_id) {
+ frequency_restrictions =
+ profile::Profile::instance()->read_did_frequency();
+
+ } else if (mobile_apis::FunctionID::GetVehicleDataID == cmd_id) {
+ frequency_restrictions =
+ profile::Profile::instance()->get_vehicle_data_frequency();
+ } else {
+ LOG4CXX_INFO(logger_, "No restrictions for request");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "Time Info: " <<
+ "\n Current: " << current.tv_sec <<
+ "\n Limit: (" << limit.first.tv_sec << "," << limit.second << ")"
+ "\n frequency_restrictions: (" << frequency_restrictions.first << "," << frequency_restrictions.second << ")"
+ );
+ if (current.tv_sec < limit.first.tv_sec + frequency_restrictions.second) {
+ if (limit.second < frequency_restrictions.first) {
+ ++limit.second;
+ return false;
+ }
+ return true;
+ }
+
+ limit.first = current;
+ limit.second = 1;
+
+ return false;
+
+ break;
+ }
+ // In case of policy table values, there is EVEN limitation for number of
+ // commands per minute, e.g. 10 command per minute i.e. 1 command per 6 sec
+ case POLICY_TABLE: {
+ uint32_t cmd_limit = application_manager::MessageHelper::GetAppCommandLimit(
+ mobile_app_id_->asString());
+
+ if (0 == cmd_limit) {
+ return true;
+ }
+
+ const uint32_t dummy_limit = 1;
+ CommandNumberTimeLimit::iterator it =
+ cmd_number_to_time_limits_.find(cmd_id);
+ // If no command with cmd_id had been executed yet, just add to limits
+ if (cmd_number_to_time_limits_.end() == it) {
+ cmd_number_to_time_limits_[cmd_id] = {current, dummy_limit};
+ return false;
+ }
+
+ const uint32_t minute = 60;
+
+ TimeToNumberLimit& limit = it->second;
+
+ // Checking even limitation for command
+ if (static_cast<uint32_t>(current.tv_sec - limit.first.tv_sec) <
+ minute/cmd_limit) {
+ return true;
+ }
+
+ cmd_number_to_time_limits_[cmd_id] = {current, dummy_limit};
+
+ return false;
+ break;
+ }
+ default: {
+ LOG4CXX_WARN(logger_, "Limit source is not implemented.");
+ break;
+ }
+ }
+
+ return true;
+}
+
+const std::set<mobile_apis::ButtonName::eType>& ApplicationImpl::SubscribedButtons() const {
+ return subscribed_buttons_;
+}
+
+const std::set<uint32_t>& ApplicationImpl::SubscribesIVI() const {
+ return subscribed_vehicle_info_;
+}
+
+uint32_t ApplicationImpl::nextHash() {
+ hash_val_ = rand();
+ return hash_val_;
+}
+
+uint32_t ApplicationImpl::curHash() const {
+ return hash_val_;
+}
+
+uint32_t ApplicationImpl::UpdateHash() {
+ uint32_t new_hash= nextHash();
+ MessageHelper::SendHashUpdateNotification(app_id());
+ return new_hash;
+}
+
+void ApplicationImpl::CleanupFiles() {
+ std::string directory_name =
+ profile::Profile::instance()->app_storage_folder();
+ directory_name += "/" + folder_name();
+
+ if (file_system::DirectoryExists(directory_name)) {
+ std::vector<std::string> files = file_system::ListFiles(
+ directory_name);
+ AppFilesMap::const_iterator app_files_it;
+
+ std::vector<std::string>::const_iterator it = files.begin();
+ for (; it != files.end(); ++it) {
+ std::string file_name = directory_name;
+ file_name += "/";
+ file_name += *it;
+ app_files_it = app_files_.find(file_name);
+ if ((app_files_it == app_files_.end()) ||
+ (!app_files_it->second.is_persistent)) {
+ LOG4CXX_INFO(logger_, "DeleteFile file " << file_name);
+ file_system::DeleteFile(file_name);
+ }
+ }
+
+ file_system::RemoveDirectory(directory_name, false);
+ }
+ app_files_.clear();
+}
+
+void ApplicationImpl::LoadPersistentFiles() {
+ std::string directory_name =
+ profile::Profile::instance()->app_storage_folder();
+ directory_name += "/" + folder_name();
+
+ if (file_system::DirectoryExists(directory_name)) {
+ std::vector<std::string> persistent_files =
+ file_system::ListFiles(directory_name);
+
+ std::vector<std::string>::const_iterator it = persistent_files.begin();
+ for (; it != persistent_files.end(); ++it) {
+ AppFile file;
+ file.is_persistent = true;
+ file.is_download_complete = true;
+ file.file_name = directory_name;
+ file.file_name += "/";
+ file.file_name += *it;
+ file.file_type = mobile_apis::FileType::BINARY;
+ // Search file extension and convert it to the type
+ std::size_t index = it->find_last_of('.');
+ if (index != std::string::npos) {
+ std::string file_type = it->substr(++index);
+ file.file_type = StringToFileType(file_type.c_str());
+ }
+
+ LOG4CXX_INFO(logger_, "Loaded persistent file " << file.file_name
+ << " File type is " << file.file_type);
+ AddFile(file);
+ }
+ }
+}
+
+void ApplicationImpl::SubscribeToSoftButtons(int32_t cmd_id,
+ const SoftButtonID& softbuttons_id) {
+ sync_primitives::AutoLock lock(cmd_softbuttonid_lock_);
+ if (static_cast<int32_t>(mobile_apis::FunctionID::ScrollableMessageID) == cmd_id) {
+ CommandSoftButtonID::iterator it = cmd_softbuttonid_.find(cmd_id);
+ if (cmd_softbuttonid_.end() == it) {
+ cmd_softbuttonid_[cmd_id] = softbuttons_id;
+ }
+ } else {
+ cmd_softbuttonid_[cmd_id] = softbuttons_id;
+ }
+}
+
+bool ApplicationImpl::IsSubscribedToSoftButton(const uint32_t softbutton_id) {
+ sync_primitives::AutoLock lock(cmd_softbuttonid_lock_);
+ CommandSoftButtonID::iterator it = cmd_softbuttonid_.begin();
+ for (; it != cmd_softbuttonid_.end(); ++it) {
+ if((it->second).find(softbutton_id) != (it->second).end()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) {
+ sync_primitives::AutoLock lock(cmd_softbuttonid_lock_);
+ CommandSoftButtonID::iterator it = cmd_softbuttonid_.find(cmd_id);
+ if(it != cmd_softbuttonid_.end()) {
+ cmd_softbuttonid_.erase(it);
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
new file mode 100644
index 0000000000..d6beb3c497
--- /dev/null
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -0,0 +1,2338 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h> // for rand()
+
+#include <climits>
+#include <string>
+#include <fstream>
+
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mobile_command_factory.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mobile_message_handler.h"
+#include "application_manager/policies/policy_handler.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "formatters/formatter_json_rpc.h"
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+#include "formatters/CFormatterJsonSDLRPCv1.hpp"
+#include "config_profile/profile.h"
+#include "utils/threads/thread.h"
+#include "utils/file_system.h"
+#include "application_manager/application_impl.h"
+#include "usage_statistics/counter.h"
+#include <time.h>
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+
+uint32_t ApplicationManagerImpl::corelation_id_ = 0;
+const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
+
+namespace formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace jhs = NsSmartDeviceLink::NsJSONHandler::strings;
+
+ApplicationManagerImpl::ApplicationManagerImpl()
+ : applications_list_lock_(true),
+ audio_pass_thru_active_(false),
+ is_distracting_driver_(false),
+ is_vr_session_strated_(false),
+ hmi_cooperating_(false),
+ is_all_apps_allowed_(true),
+ media_manager_(NULL),
+ hmi_handler_(NULL),
+ connection_handler_(NULL),
+ protocol_handler_(NULL),
+ request_ctrl_(),
+ hmi_so_factory_(NULL),
+ mobile_so_factory_(NULL),
+ messages_from_mobile_("AM FromMobile", this),
+ messages_to_mobile_("AM ToMobile", this),
+ messages_from_hmi_("AM FromHMI", this),
+ messages_to_hmi_("AM ToHMI", this),
+ hmi_capabilities_(this),
+ unregister_reason_(mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF),
+ resume_ctrl_(this),
+#ifdef TIME_TESTER
+ metric_observer_(NULL),
+#endif // TIME_TESTER
+ application_list_update_timer_(new ApplicationListUpdateTimer(this)),
+ tts_global_properties_timer_("TTSGLPRTimer",
+ this,
+ &ApplicationManagerImpl::OnTimerSendTTSGlobalProperties,
+ true) {
+ std::srand(std::time(0));
+}
+
+ApplicationManagerImpl::~ApplicationManagerImpl() {
+ LOG4CXX_INFO(logger_, "Destructing ApplicationManager.");
+
+ SendOnSDLClose();
+ media_manager_ = NULL;
+ hmi_handler_ = NULL;
+ connection_handler_ = NULL;
+ if (hmi_so_factory_) {
+ delete hmi_so_factory_;
+ }
+ hmi_so_factory_ = NULL;
+ if (mobile_so_factory_) {
+ delete mobile_so_factory_;
+ }
+ mobile_so_factory_ = NULL;
+ protocol_handler_ = NULL;
+ media_manager_ = NULL;
+ LOG4CXX_INFO(logger_, "Destroying Policy Handler");
+ policy::PolicyHandler::destroy();
+}
+
+bool ApplicationManagerImpl::Stop() {
+ LOG4CXX_INFO(logger_, "Stop ApplicationManager.");
+ application_list_update_timer_->stop();
+ try {
+ UnregisterAllApplications();
+ } catch (...) {
+ LOG4CXX_ERROR(logger_,
+ "An error occurred during unregistering applications.");
+ }
+
+
+ // for PASA customer policy backup should happen OnExitAllApp(SUSPEND)
+ LOG4CXX_INFO(logger_, "Unloading policy library.");
+ policy::PolicyHandler::instance()->UnloadPolicyLibrary();
+
+ return true;
+}
+
+ApplicationSharedPtr ApplicationManagerImpl::application(uint32_t app_id) const {
+ sync_primitives::AutoLock lock(applications_list_lock_);
+
+ std::set<ApplicationSharedPtr>::const_iterator it =
+ application_list_.begin();
+ for (; it != application_list_.end(); ++it) {
+ if ((*it)->app_id() == app_id) {
+ return (*it);
+ }
+ }
+ return ApplicationSharedPtr();
+}
+
+ApplicationSharedPtr ApplicationManagerImpl::application_by_hmi_app(
+ uint32_t hmi_app_id) const {
+ sync_primitives::AutoLock lock(applications_list_lock_);
+
+ std::set<ApplicationSharedPtr>::const_iterator it =
+ application_list_.begin();
+ for (; it != application_list_.end(); ++it) {
+ if ((*it)->hmi_app_id() == hmi_app_id) {
+ return (*it);
+ }
+ }
+ return ApplicationSharedPtr();
+}
+
+ApplicationSharedPtr ApplicationManagerImpl::application_by_policy_id(
+ const std::string& policy_app_id) const {
+ sync_primitives::AutoLock lock(applications_list_lock_);
+
+ std::vector<ApplicationSharedPtr> result;
+ for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ application_list_.end() != it;
+ ++it) {
+ if (policy_app_id.compare((*it)->mobile_app_id()->asString()) == 0) {
+ return *it;
+ }
+ }
+ return ApplicationSharedPtr();
+}
+
+ApplicationSharedPtr ApplicationManagerImpl::active_application() const {
+ // TODO(DK) : check driver distraction
+ for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ application_list_.end() != it;
+ ++it) {
+ if ((*it)->IsFullscreen()) {
+ return *it;
+ }
+ }
+ return ApplicationSharedPtr();
+}
+
+std::vector<ApplicationSharedPtr> ApplicationManagerImpl::applications_by_button(
+ uint32_t button) {
+ std::vector<ApplicationSharedPtr> result;
+ for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ application_list_.end() != it; ++it) {
+ if ((*it)->IsSubscribedToButton(
+ static_cast<mobile_apis::ButtonName::eType>(button))) {
+ result.push_back(*it);
+ }
+ }
+ return result;
+}
+
+std::vector<utils::SharedPtr<Application>> ApplicationManagerImpl::IviInfoUpdated(
+VehicleDataType vehicle_info, int value) {
+ // Notify Policy Manager if available about info it's interested in,
+ // i.e. odometer etc
+ switch (vehicle_info) {
+ case ODOMETER:
+ policy::PolicyHandler::instance()->KmsChanged(value);
+ break;
+ default:
+ break;
+ }
+
+ std::vector<utils::SharedPtr<application_manager::Application>> result;
+ for (std::set<utils::SharedPtr<application_manager::Application>>::iterator it = application_list_.begin();
+ application_list_.end() != it; ++it) {
+ if ((*it)->IsSubscribedToIVI(static_cast<uint32_t>(vehicle_info))) {
+ result.push_back(*it);
+ }
+ }
+ return result;
+}
+
+std::vector<ApplicationSharedPtr> ApplicationManagerImpl::applications_with_navi() {
+ std::vector<ApplicationSharedPtr> result;
+ for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ application_list_.end() != it;
+ ++it) {
+ if ((*it)->allowed_support_navigation()) {
+ result.push_back(*it);
+ }
+ }
+ return result;
+}
+
+ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
+ const utils::SharedPtr<smart_objects::SmartObject>&
+ request_for_registration) {
+
+ LOG4CXX_DEBUG(logger_, "Restarting application list update timer");
+ uint32_t timeout = profile::Profile::instance()->application_list_update_timeout();
+ application_list_update_timer_->start(timeout);
+
+ smart_objects::SmartObject& message = *request_for_registration;
+ uint32_t connection_key =
+ message[strings::params][strings::connection_key].asInt();
+
+ if (false == is_all_apps_allowed_) {
+ LOG4CXX_INFO(logger_,
+ "RegisterApplication: access to app's disabled by user");
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
+ message[strings::params][strings::correlation_id].asUInt(),
+ mobile_apis::Result::DISALLOWED));
+ ManageMobileCommand(response);
+ return ApplicationSharedPtr();
+ }
+
+ // app_id is SDL "internal" ID
+ // original app_id can be gotten via ApplicationImpl::mobile_app_id()
+ uint32_t app_id = 0;
+ std::list<int32_t> sessions_list;
+ uint32_t device_id = 0;
+
+ if (connection_handler_) {
+ connection_handler::ConnectionHandlerImpl* con_handler_impl =
+ static_cast<connection_handler::ConnectionHandlerImpl*>(
+
+ connection_handler_);
+ if (con_handler_impl->GetDataOnSessionKey(connection_key, &app_id,
+ &sessions_list, &device_id)
+ == -1) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to create application: no connection info.");
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
+ message[strings::params][strings::correlation_id].asUInt(),
+ mobile_apis::Result::GENERIC_ERROR));
+ ManageMobileCommand(response);
+ return ApplicationSharedPtr();
+ }
+ }
+
+ smart_objects::SmartObject& params = message[strings::msg_params];
+
+ const std::string& mobile_app_id = params[strings::app_id].asString();
+ const std::string& app_name =
+ message[strings::msg_params][strings::app_name].asString();
+
+ ApplicationSharedPtr application(
+ new ApplicationImpl(app_id,
+ mobile_app_id, app_name,
+ policy::PolicyHandler::instance()->GetStatisticManager()));
+ if (!application) {
+ usage_statistics::AppCounter count_of_rejections_sync_out_of_memory(
+ policy::PolicyHandler::instance()->GetStatisticManager(), mobile_app_id,
+ usage_statistics::REJECTIONS_SYNC_OUT_OF_MEMORY);
+ ++count_of_rejections_sync_out_of_memory;
+
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
+ message[strings::params][strings::correlation_id].asUInt(),
+ mobile_apis::Result::OUT_OF_MEMORY));
+ ManageMobileCommand(response);
+ return ApplicationSharedPtr();
+ }
+ application->set_device(device_id);
+ application->set_grammar_id(GenerateGrammarID());
+ mobile_api::Language::eType launguage_desired =
+ static_cast<mobile_api::Language::eType>(params[strings::language_desired]
+ .asInt());
+ application->set_language(launguage_desired);
+ application->usage_report().RecordAppRegistrationVuiLanguage(
+ launguage_desired);
+
+ mobile_api::Language::eType hmi_display_language_desired =
+ static_cast<mobile_api::Language::eType>(params[strings::hmi_display_language_desired]
+ .asInt());
+ application->set_ui_language(hmi_display_language_desired);
+ application->usage_report().RecordAppRegistrationGuiLanguage(
+ hmi_display_language_desired);
+
+ Version version;
+ int32_t min_version =
+ message[strings::msg_params][strings::sync_msg_version]
+ [strings::minor_version].asInt();
+
+ /*if (min_version < APIVersion::kAPIV2) {
+ LOG4CXX_ERROR(logger_, "UNSUPPORTED_VERSION");
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
+ message[strings::params][strings::correlation_id],
+ mobile_apis::Result::UNSUPPORTED_VERSION));
+ ManageMobileCommand(response);
+ delete application;
+ return NULL;
+ }*/
+ version.min_supported_api_version = static_cast<APIVersion>(min_version);
+
+ int32_t max_version =
+ message[strings::msg_params][strings::sync_msg_version]
+ [strings::major_version].asInt();
+
+ /*if (max_version > APIVersion::kAPIV2) {
+ LOG4CXX_ERROR(logger_, "UNSUPPORTED_VERSION");
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID,
+ message[strings::params][strings::correlation_id],
+ mobile_apis::Result::UNSUPPORTED_VERSION));
+ ManageMobileCommand(response);
+ delete application;
+ return NULL;
+ }*/
+ version.max_supported_api_version = static_cast<APIVersion>(max_version);
+ application->set_version(version);
+
+ ProtocolVersion protocol_version = static_cast<ProtocolVersion>(
+ message[strings::params][strings::protocol_version].asInt());
+ application->set_protocol_version(protocol_version);
+
+ if (connection_handler_) {
+ if (ProtocolVersion::kUnknownProtocol != protocol_version) {
+ connection_handler_->BindProtocolVersionWithSession(
+ connection_key, static_cast<uint8_t>(protocol_version));
+ }
+ if (ProtocolVersion::kV3 == protocol_version) {
+ connection_handler_->StartSessionHeartBeat(connection_key);
+ }
+ }
+
+ sync_primitives::AutoLock lock(applications_list_lock_);
+
+ application_list_.insert(application);
+
+ return application;
+}
+
+bool ApplicationManagerImpl::RemoveAppDataFromHMI(ApplicationSharedPtr app) {
+ return true;
+}
+
+bool ApplicationManagerImpl::LoadAppDataToHMI(ApplicationSharedPtr app) {
+ return true;
+}
+
+bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Null-pointer application received.");
+ NOTREACHED();
+ return false;
+ }
+
+ bool is_new_app_media = app->is_media_application();
+
+ if (app->IsFullscreen()) {
+ LOG4CXX_WARN(logger_, "Application is already active.");
+ return false;
+ }
+ if (mobile_api::HMILevel::eType::HMI_LIMITED !=
+ app->hmi_level()) {
+ if (app->has_been_activated()) {
+ MessageHelper::SendAppDataToHMI(app);
+ }
+ }
+ app->MakeFullscreen();
+ for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ application_list_.end() != it;
+ ++it) {
+ ApplicationSharedPtr curr_app = *it;
+ if (app->app_id() == curr_app->app_id()) {
+ continue;
+ } else {
+ if (is_new_app_media) {
+ if (curr_app->IsAudible()) {
+ curr_app->MakeNotAudible();
+ MessageHelper::SendHMIStatusNotification(*curr_app);
+ }
+ }
+ if (curr_app->IsFullscreen()) {
+ if (true == curr_app->is_media_application()) {
+ PutApplicationInLimited(app);
+ } else {
+ app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
+ }
+ MessageHelper::SendHMIStatusNotification(*curr_app);
+ }
+ }
+ }
+ return true;
+}
+
+mobile_apis::HMILevel::eType ApplicationManagerImpl::PutApplicationInLimited(
+ ApplicationSharedPtr app) {
+ DCHECK(app.get())
+
+ mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_LIMITED;
+
+ for (std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ application_list_.end() != it;
+ ++it) {
+ ApplicationSharedPtr curr_app = *it;
+ if (app->app_id() == curr_app->app_id()) {
+ continue;
+ }
+
+ if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) {
+ result = mobile_api::HMILevel::HMI_BACKGROUND;
+ break;
+ }
+ if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_FULL) {
+ if (curr_app->is_media_application()) {
+ result = mobile_api::HMILevel::HMI_BACKGROUND;
+ break;
+ } else {
+ result = mobile_api::HMILevel::HMI_LIMITED;
+ }
+ }
+
+ }
+ app->set_hmi_level(result);
+ return result;
+}
+
+mobile_api::HMILevel::eType ApplicationManagerImpl::PutApplicationInFull(
+ ApplicationSharedPtr app) {
+ DCHECK(app.get())
+
+ bool is_new_app_media = app->is_media_application();
+ mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL;
+
+ std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ for (; application_list_.end() != it; ++it) {
+ ApplicationSharedPtr curr_app = *it;
+ if (app->app_id() == curr_app->app_id()) {
+ continue;
+ }
+
+ if (is_new_app_media) {
+ if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_FULL) {
+ if (curr_app->is_media_application()) {
+ result = mobile_api::HMILevel::HMI_BACKGROUND;
+ break;
+ } else {
+ result = mobile_api::HMILevel::HMI_LIMITED;
+ }
+ }
+ if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) {
+ result = mobile_api::HMILevel::HMI_BACKGROUND;
+ break;
+ }
+ } else {
+ if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_FULL) {
+ result = mobile_api::HMILevel::HMI_BACKGROUND;
+ break;
+ }
+ if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) {
+ result = mobile_api::HMILevel::HMI_FULL;
+ }
+ }
+ }
+
+ if (result == mobile_api::HMILevel::HMI_FULL) {
+ app->set_hmi_level(result);
+ MessageHelper::SendActivateAppToHMI(app->app_id());
+ }
+ return result;
+}
+
+void ApplicationManagerImpl::ConnectToDevice(uint32_t id) {
+ // TODO(VS): Call function from ConnectionHandler
+ if (!connection_handler_) {
+ LOG4CXX_WARN(logger_, "Connection handler is not set.");
+ return;
+ }
+
+ connection_handler_->ConnectToDevice(id);
+}
+
+void ApplicationManagerImpl::OnHMIStartedCooperation() {
+ hmi_cooperating_ = true;
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnHMIStartedCooperation()");
+
+ utils::SharedPtr<smart_objects::SmartObject> is_vr_ready(
+ MessageHelper::CreateModuleInfoSO(
+ static_cast<uint32_t>(hmi_apis::FunctionID::VR_IsReady)));
+ ManageHMICommand(is_vr_ready);
+
+ utils::SharedPtr<smart_objects::SmartObject> is_tts_ready(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady));
+ ManageHMICommand(is_tts_ready);
+
+ utils::SharedPtr<smart_objects::SmartObject> is_ui_ready(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady));
+ ManageHMICommand(is_ui_ready);
+
+ utils::SharedPtr<smart_objects::SmartObject> is_navi_ready(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::Navigation_IsReady));
+ ManageHMICommand(is_navi_ready);
+
+ utils::SharedPtr<smart_objects::SmartObject> is_ivi_ready(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_IsReady));
+ ManageHMICommand(is_ivi_ready);
+
+ utils::SharedPtr<smart_objects::SmartObject> button_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::Buttons_GetCapabilities));
+ ManageHMICommand(button_capabilities);
+
+ utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported));
+ ManageHMICommand(mixing_audio_supported_request);
+}
+
+uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() {
+ if (corelation_id_ < max_corelation_id_) {
+ corelation_id_++;
+ } else {
+ corelation_id_ = 0;
+ }
+
+ return corelation_id_;
+}
+
+bool ApplicationManagerImpl::begin_audio_pass_thru() {
+ sync_primitives::AutoLock lock(audio_pass_thru_lock_);
+ if (audio_pass_thru_active_) {
+ return false;
+ } else {
+ audio_pass_thru_active_ = true;
+ return true;
+ }
+}
+
+bool ApplicationManagerImpl::end_audio_pass_thru() {
+ sync_primitives::AutoLock lock(audio_pass_thru_lock_);
+ if (audio_pass_thru_active_) {
+ audio_pass_thru_active_ = false;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void ApplicationManagerImpl::set_driver_distraction(bool is_distracting) {
+ is_distracting_driver_ = is_distracting;
+}
+
+void ApplicationManagerImpl::set_vr_session_started(const bool& state) {
+ is_vr_session_strated_ = state;
+}
+
+void ApplicationManagerImpl::set_all_apps_allowed(const bool& allowed) {
+ is_all_apps_allowed_ = allowed;
+}
+
+void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key,
+ int32_t correlation_id, int32_t max_duration, int32_t sampling_rate,
+ int32_t bits_per_sample, int32_t audio_type) {
+ LOG4CXX_INFO(logger_, "START MICROPHONE RECORDER");
+ if (NULL != media_manager_) {
+ media_manager_->StartMicrophoneRecording(
+ session_key,
+ profile::Profile::instance()->recording_file_name(),
+ max_duration);
+ }
+}
+
+void ApplicationManagerImpl::SendAudioPassThroughNotification(
+ uint32_t session_key,
+ std::vector<uint8_t> binaryData) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (!audio_pass_thru_active_) {
+ LOG4CXX_ERROR(logger_, "Trying to send PassThroughNotification"
+ " when PassThrough is not active");
+ return;
+ }
+ smart_objects::SmartObject* on_audio_pass = NULL;
+ on_audio_pass = new smart_objects::SmartObject();
+
+ if (NULL == on_audio_pass) {
+ LOG4CXX_ERROR_EXT(logger_, "OnAudioPassThru NULL pointer");
+
+ return;
+ }
+
+ LOG4CXX_INFO_EXT(logger_, "Fill smart object");
+
+ (*on_audio_pass)[strings::params][strings::message_type] =
+ application_manager::MessageType::kNotification;
+
+ (*on_audio_pass)[strings::params][strings::connection_key] =
+ static_cast<int32_t>(session_key);
+ (*on_audio_pass)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnAudioPassThruID;
+
+ LOG4CXX_INFO_EXT(logger_, "Fill binary data");
+ // binary data
+ (*on_audio_pass)[strings::params][strings::binary_data] =
+ smart_objects::SmartObject(binaryData);
+
+ LOG4CXX_INFO_EXT(logger_, "After fill binary data");
+
+ LOG4CXX_INFO_EXT(logger_, "Send data");
+ CommandSharedPtr command (
+ MobileCommandFactory::CreateCommand(&(*on_audio_pass)));
+ command->Init();
+ command->Run();
+ command->CleanUp();
+}
+
+void ApplicationManagerImpl::StopAudioPassThru(int32_t application_key) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ sync_primitives::AutoLock lock(audio_pass_thru_lock_);
+ if (NULL != media_manager_) {
+ media_manager_->StopMicrophoneRecording(application_key);
+ }
+}
+
+std::string ApplicationManagerImpl::GetDeviceName(
+ connection_handler::DeviceHandle handle) {
+ DCHECK(connection_handler_ != 0);
+
+ std::string device_name = "";
+ connection_handler::ConnectionHandlerImpl* con_handler_impl =
+ static_cast<connection_handler::ConnectionHandlerImpl*>(
+ connection_handler_);
+ if (con_handler_impl->GetDataOnDeviceID(handle, &device_name,
+ NULL) == -1) {
+ LOG4CXX_ERROR(logger_, "Failed to extract device name for id " << handle);
+ } else {
+ LOG4CXX_INFO(logger_, "\t\t\t\t\tDevice name is " << device_name);
+ }
+
+ return device_name;
+}
+
+void ApplicationManagerImpl::OnMessageReceived(
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnMessageReceived");
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ utils::SharedPtr<Message> outgoing_message = ConvertRawMsgToMessage(message);
+
+ if (outgoing_message) {
+ messages_from_mobile_.PostMessage(
+ impl::MessageFromMobile(outgoing_message));
+ }
+}
+
+void ApplicationManagerImpl::OnMobileMessageSent(
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnMobileMessageSent");
+}
+
+void ApplicationManagerImpl::OnMessageReceived(
+ hmi_message_handler::MessageSharedPointer message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnMessageReceived");
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
+}
+
+void ApplicationManagerImpl::OnErrorSending(
+ hmi_message_handler::MessageSharedPointer message) {
+ return;
+}
+
+void ApplicationManagerImpl::OnDeviceListUpdated(
+ const connection_handler::DeviceMap& device_list) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::OnDeviceListUpdated");
+
+ smart_objects::SmartObject* update_list = new smart_objects::SmartObject;
+ smart_objects::SmartObject& so_to_send = *update_list;
+ so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] =
+ hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList;
+ so_to_send[jhs::S_PARAMS][jhs::S_MESSAGE_TYPE] =
+ hmi_apis::messageType::request;
+ so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_VERSION] = 3;
+ so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
+ so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
+ smart_objects::SmartObject* msg_params = MessageHelper::CreateDeviceListSO(
+ device_list);
+ if (!msg_params) {
+ LOG4CXX_WARN(logger_, "Failed to create sub-smart object.");
+ delete update_list;
+ return;
+ }
+ so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
+ ManageHMICommand(update_list);
+}
+
+void ApplicationManagerImpl::OnFindNewApplicationsRequest() {
+ connection_handler_->ConnectToAllDevices();
+ LOG4CXX_DEBUG(logger_, "Starting application list update timer");
+ uint32_t timeout = profile::Profile::instance()->application_list_update_timeout();
+ application_list_update_timer_->start(timeout);
+}
+
+void ApplicationManagerImpl::SendUpdateAppList(const std::list<uint32_t>& applications_ids) {
+ LOG4CXX_TRACE(logger_, "SendUpdateAppList");
+
+ LOG4CXX_DEBUG(logger_, applications_ids.size() << " applications.");
+
+ smart_objects::SmartObject* request = MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList);
+ (*request)[strings::msg_params][strings::applications] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& applications =
+ (*request)[strings::msg_params][strings::applications];
+
+ uint32_t app_count = 0;
+ for (std::list<uint32_t>::const_iterator it = applications_ids.begin();
+ it != applications_ids.end(); ++it) {
+ ApplicationSharedPtr app = application(*it);
+
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Application not found , id = " << *it);
+ continue;
+ }
+
+ smart_objects::SmartObject hmi_application(smart_objects::SmartType_Map);;
+ if (!MessageHelper::CreateHMIApplicationStruct(app, hmi_application)) {
+ LOG4CXX_ERROR(logger_, "Can't CreateHMIApplicationStruct ', id = " << *it);
+ continue;
+ }
+ applications[app_count++] = hmi_application;
+ }
+ if (app_count <= 0) {
+ LOG4CXX_WARN(logger_, "Empty applications list");
+ }
+ ManageHMICommand(request);
+}
+
+void ApplicationManagerImpl::RemoveDevice(
+ const connection_handler::DeviceHandle& device_handle) {
+ LOG4CXX_INFO(logger_, "device_handle " << device_handle);
+}
+
+bool ApplicationManagerImpl::IsAudioStreamingAllowed(uint32_t application_key) const {
+ ApplicationSharedPtr app = application(application_key);
+
+ if (!app) {
+ LOG4CXX_WARN(logger_, "An application is not registered.");
+ return false;
+ }
+
+ const mobile_api::HMILevel::eType& hmi_level = app->hmi_level();
+
+ if (mobile_api::HMILevel::HMI_FULL == hmi_level ||
+ mobile_api::HMILevel::HMI_LIMITED == hmi_level) {
+ return true;
+ }
+
+ return false;
+}
+
+bool ApplicationManagerImpl::IsVideoStreamingAllowed(uint32_t application_key) const {
+ ApplicationSharedPtr app = application(application_key);
+
+ if (!app) {
+ LOG4CXX_WARN(logger_, "An application is not registered.");
+ return false;
+ }
+
+ const mobile_api::HMILevel::eType& hmi_level = app->hmi_level();
+
+ if (mobile_api::HMILevel::HMI_FULL == hmi_level &&
+ app->hmi_supports_navi_video_streaming()) {
+ return true;
+ }
+
+ return false;
+}
+
+uint32_t ApplicationManagerImpl::GenerateGrammarID() {
+ return rand();
+}
+
+uint32_t ApplicationManagerImpl::GenerateNewHMIAppID() {
+ uint32_t hmi_app_id = rand();
+
+ while (resume_ctrl_.IsHMIApplicationIdExist(hmi_app_id)) {
+ hmi_app_id = rand();
+ }
+
+ return hmi_app_id;
+}
+
+void ApplicationManagerImpl::ReplaceMobileByHMIAppId(
+ smart_objects::SmartObject& message) {
+ MessageHelper::PrintSmartObject(message);
+ flush(std::cout);
+ if (message.keyExists(strings::app_id)) {
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(
+ message[strings::app_id].asUInt());
+ if (application.valid()) {
+ LOG4CXX_INFO(logger_, "ReplaceMobileByHMIAppId from " << message[strings::app_id].asInt()
+ << " to " << application->hmi_app_id());
+ message[strings::app_id] = application->hmi_app_id();
+ }
+ } else {
+ switch (message.getType()) {
+ case smart_objects::SmartType::SmartType_Array: {
+ smart_objects::SmartArray* message_array = message.asArray();
+ smart_objects::SmartArray::iterator it = message_array->begin();
+ for(; it != message_array->end(); ++it) {
+ ReplaceMobileByHMIAppId(*it);
+ }
+ break;
+ }
+ case smart_objects::SmartType::SmartType_Map: {
+ std::set<std::string> keys = message.enumerate();
+ std::set<std::string>::const_iterator key = keys.begin();
+ for (; key != keys.end(); ++key) {
+ std::string k = *key;
+ ReplaceMobileByHMIAppId(message[*key]);
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+}
+
+void ApplicationManagerImpl::ReplaceHMIByMobileAppId(
+ smart_objects::SmartObject& message) {
+ if (message.keyExists(strings::app_id)) {
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application_by_hmi_app(
+ message[strings::app_id].asUInt());
+
+ if (application.valid()) {
+ LOG4CXX_INFO(logger_, "ReplaceHMIByMobileAppId from " << message[strings::app_id].asInt()
+ << " to " << application->app_id());
+ message[strings::app_id] = application->app_id();
+ }
+ } else {
+ switch (message.getType()) {
+ case smart_objects::SmartType::SmartType_Array: {
+ smart_objects::SmartArray* message_array = message.asArray();
+ smart_objects::SmartArray::iterator it = message_array->begin();
+ for(; it != message_array->end(); ++it) {
+ ReplaceHMIByMobileAppId(*it);
+ }
+ break;
+ }
+ case smart_objects::SmartType::SmartType_Map: {
+ std::set<std::string> keys = message.enumerate();
+ std::set<std::string>::const_iterator key = keys.begin();
+ for (; key != keys.end(); ++key) {
+ ReplaceHMIByMobileAppId(message[*key]);
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+}
+
+bool ApplicationManagerImpl::OnServiceStartedCallback(
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type) {
+ LOG4CXX_INFO(logger_,
+ "OnServiceStartedCallback " << type << " in session " << session_key);
+ ApplicationSharedPtr app = application(session_key);
+
+ switch (type) {
+ case protocol_handler::kRpc: {
+ LOG4CXX_INFO(logger_, "RPC service is about to be started.");
+ break;
+ }
+ case protocol_handler::kMobileNav: {
+ LOG4CXX_INFO(logger_, "Video service is about to be started.");
+ if (media_manager_) {
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
+ return false;
+ }
+ if (app->allowed_support_navigation()) {
+ media_manager_->StartVideoStreaming(session_key);
+ } else {
+ return false;
+ }
+ }
+ break;
+ }
+ case protocol_handler::kAudio: {
+ LOG4CXX_INFO(logger_, "Audio service is about to be started.");
+ if (media_manager_) {
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
+ return false;
+ }
+ if (app->allowed_support_navigation()) {
+ media_manager_->StartAudioStreaming(session_key);
+ } else {
+ return false;
+ }
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_WARN(logger_, "Unknown type of service to be started.");
+ break;
+ }
+ }
+
+ return true;
+}
+
+void ApplicationManagerImpl::OnServiceEndedCallback(const int32_t& session_key,
+ const protocol_handler::ServiceType& type) {
+ LOG4CXX_INFO_EXT(
+ logger_,
+ "OnServiceEndedCallback " << type << " in session " << session_key);
+
+ switch (type) {
+ case protocol_handler::kRpc: {
+ LOG4CXX_INFO(logger_, "Remove application.");
+ /* in case it was unexpected disconnect application will be removed
+ and we will notify HMI that it was unexpected disconnect,
+ but in case it was closed by mobile we will be unable to find it in the list
+ */
+ UnregisterApplication(session_key, mobile_apis::Result::INVALID_ENUM,
+ true, true);
+ break;
+ }
+ case protocol_handler::kMobileNav: {
+ LOG4CXX_INFO(logger_, "Stop video streaming.");
+ if (media_manager_) {
+ media_manager_->StopVideoStreaming(session_key);
+ }
+ break;
+ }
+ case protocol_handler::kAudio: {
+ LOG4CXX_INFO(logger_, "Stop audio service.");
+ if (media_manager_) {
+ media_manager_->StopAudioStreaming(session_key);
+ }
+ break;
+ }
+ default:
+ LOG4CXX_WARN(logger_, "Unknown type of service to be ended." <<
+ type);
+ break;
+ }
+}
+
+void ApplicationManagerImpl::set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) {
+ hmi_handler_ = handler;
+}
+
+void ApplicationManagerImpl::set_connection_handler(
+ connection_handler::ConnectionHandler* handler) {
+ connection_handler_ = handler;
+}
+
+connection_handler::ConnectionHandler* ApplicationManagerImpl::connection_handler() {
+ return connection_handler_;
+}
+
+void ApplicationManagerImpl::set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) {
+ protocol_handler_ = handler;
+}
+
+void ApplicationManagerImpl::StartDevicesDiscovery() {
+ connection_handler::ConnectionHandlerImpl::instance()->
+ StartDevicesDiscovery();
+}
+
+void ApplicationManagerImpl::SendMessageToMobile(
+ const utils::SharedPtr<smart_objects::SmartObject>& message,
+ bool final_message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::SendMessageToMobile");
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ if (!protocol_handler_) {
+ LOG4CXX_WARN(logger_, "No Protocol Handler set");
+ return;
+ }
+
+ ApplicationSharedPtr app = application(
+ (*message)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "No application associated with connection key");
+ if ((*message)[strings::msg_params].keyExists(strings::result_code) &&
+ ((*message)[strings::msg_params][strings::result_code] ==
+ NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION)) {
+ (*message)[strings::params][strings::protocol_version] =
+ ProtocolVersion::kV1;
+ } else {
+ (*message)[strings::params][strings::protocol_version] =
+ ProtocolVersion::kV3;
+ }
+ } else {
+ (*message)[strings::params][strings::protocol_version] =
+ app->protocol_version();
+ }
+
+ mobile_so_factory().attachSchema(*message);
+ LOG4CXX_INFO(
+ logger_,
+ "Attached schema to message, result if valid: " << message->isValid());
+
+ // Messages to mobile are not yet prioritized so use default priority value
+ utils::SharedPtr<Message> message_to_send(new Message(
+ protocol_handler::MessagePriority::kDefault));
+ if (!ConvertSOtoMessage((*message), (*message_to_send))) {
+ LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string");
+ return;
+ }
+
+ smart_objects::SmartObject& msg_to_mobile = *message;
+ // If correlation_id is not present, it is from-HMI message which should be
+ // checked against policy permissions
+ if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) {
+ request_ctrl_.terminateMobileRequest(
+ msg_to_mobile[strings::params][strings::correlation_id].asInt());
+ } else if (app) {
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt());
+ RPCParams params;
+
+ const smart_objects::SmartObject& s_map = (*message)[strings::msg_params];
+ if (smart_objects::SmartType_Map == s_map.getType()) {
+ smart_objects::SmartMap::iterator iter = s_map.map_begin();
+ smart_objects::SmartMap::iterator iter_end = s_map.map_end();
+
+ for (; iter != iter_end; ++iter) {
+ params.push_back(iter->first);
+ }
+ }
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions( app->mobile_app_id()->asString(),
+ app->hmi_level(), function_id, params);
+ if (mobile_apis::Result::SUCCESS != check_result) {
+ const std::string string_functionID =
+ MessageHelper::StringifiedFunctionID(function_id);
+ LOG4CXX_WARN(logger_, "Function \"" << string_functionID << "\" (#"
+ << function_id << ") not allowed by policy");
+ return;
+ }
+
+ if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
+ policy::PolicyHandler::instance()->OnUpdateRequestSentToMobile();
+ }
+ }
+
+ messages_to_mobile_.PostMessage(impl::MessageToMobile(message_to_send,
+ final_message));
+}
+
+bool ApplicationManagerImpl::ManageMobileCommand(
+ const utils::SharedPtr<smart_objects::SmartObject>& message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ManageMobileCommand");
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "RET Null-pointer message received.");
+ NOTREACHED()
+ return false;
+ }
+
+#ifdef DEBUG
+ MessageHelper::PrintSmartObject(*message);
+#endif
+
+ LOG4CXX_INFO(logger_, "Trying to create message in mobile factory.");
+ commands::Command* command = MobileCommandFactory::CreateCommand(message);
+
+ if (!command) {
+ LOG4CXX_WARN(logger_, "RET Failed to create mobile command from smart object");
+ return false;
+ }
+
+ mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asInt());
+
+ // Notifications from HMI have no such parameter
+ uint32_t correlation_id =
+ (*message)[strings::params].keyExists(strings::correlation_id)
+ ? (*message)[strings::params][strings::correlation_id].asUInt()
+ : 0;
+
+ uint32_t connection_key =
+ (*message)[strings::params][strings::connection_key].asUInt();
+
+ int32_t protocol_type =
+ (*message)[strings::params][strings::protocol_type].asUInt();
+
+ ApplicationSharedPtr app;
+ int32_t message_type = (*message)[strings::params][strings::message_type].asInt();
+
+ if (((mobile_apis::FunctionID::RegisterAppInterfaceID != function_id) &&
+ (protocol_type == commands::CommandImpl::mobile_protocol_type_)) &&
+ (mobile_apis::FunctionID::UnregisterAppInterfaceID != function_id)) {
+ app = ApplicationManagerImpl::instance()->application(connection_key);
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "RET APPLICATION_NOT_REGISTERED");
+ smart_objects::SmartObject* response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(mobile_apis::Result::APPLICATION_NOT_REGISTERED));
+
+ SendMessageToMobile(response);
+ return false;
+ }
+
+ // Message for "CheckPermission" must be with attached schema
+ mobile_so_factory().attachSchema(*message);
+ }
+
+ if (message_type ==
+ mobile_apis::messageType::response) {
+ if (command->Init()) {
+ command->Run();
+ command->CleanUp();
+ }
+ delete command;
+ return true;
+ }
+ if (message_type ==
+ mobile_apis::messageType::notification) {
+ commands::CommandNotificationImpl* command_notify =
+ static_cast<commands::CommandNotificationImpl*>(command);
+ request_ctrl_.addNotification(command_notify);
+ if (command_notify->Init()) {
+ command_notify->Run();
+ if (command_notify->CleanUp()) {
+ request_ctrl_.removeNotification(command_notify);
+ }
+ // If CleanUp returned false notification should remove it self.
+ }
+ return true;
+ }
+
+ if (message_type ==
+ mobile_apis::messageType::request) {
+
+ commands::CommandRequestImpl* command_request =
+ static_cast<commands::CommandRequestImpl*>(command);
+ // commands will be launched from requesr_ctrl
+ mobile_apis::HMILevel::eType app_hmi_level = mobile_apis::HMILevel::INVALID_ENUM;
+ if (app) {
+ app_hmi_level = app->hmi_level();
+ }
+
+ // commands will be launched from request_ctrl
+
+ request_controller::RequestController::TResult result =
+ request_ctrl_.addMobileRequest(command_request, app_hmi_level);
+
+ if (result == request_controller::RequestController::SUCCESS) {
+ LOG4CXX_INFO(logger_, "Perform request");
+ } else if (result ==
+ request_controller::RequestController::
+ TOO_MANY_PENDING_REQUESTS) {
+ LOG4CXX_ERROR_EXT(logger_, "RET Unable top perform request: " <<
+ "TOO_MANY_PENDING_REQUESTS");
+
+ smart_objects::SmartObject* response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(mobile_apis::Result::TOO_MANY_PENDING_REQUESTS));
+
+ SendMessageToMobile(response);
+ return false;
+ } else if (result ==
+ request_controller::RequestController::TOO_MANY_REQUESTS) {
+ LOG4CXX_ERROR_EXT(logger_, "RET Unable to perform request: " <<
+ "TOO_MANY_REQUESTS");
+
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key,
+ mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS);
+
+ UnregisterApplication(connection_key,
+ mobile_apis::Result::TOO_MANY_PENDING_REQUESTS,
+ false);
+ return false;
+ } else if (result ==
+ request_controller::RequestController::
+ NONE_HMI_LEVEL_MANY_REQUESTS) {
+ LOG4CXX_ERROR_EXT(logger_, "RET Unable to perform request: " <<
+ "REQUEST_WHILE_IN_NONE_HMI_LEVEL");
+
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ connection_key, mobile_api::AppInterfaceUnregisteredReason::
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL);
+
+ application(connection_key)->usage_report().RecordRemovalsForBadBehavior();
+ UnregisterApplication(connection_key, mobile_apis::Result::INVALID_ENUM,
+ false);
+ return false;
+ } else {
+ LOG4CXX_ERROR_EXT(logger_, "RET Unable to perform request: Unknown case");
+ return false;
+ }
+ return true;
+ }
+
+ LOG4CXX_ERROR(logger_, "RET UNKNOWN MESSAGE TYPE " << message_type);
+ return false;
+}
+
+void ApplicationManagerImpl::SendMessageToHMI(
+ const utils::SharedPtr<smart_objects::SmartObject>& message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::SendMessageToHMI");
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ if (!hmi_handler_) {
+ LOG4CXX_WARN(logger_, "No HMI Handler set");
+ return;
+ }
+
+ // SmartObject |message| has no way to declare priority for now
+ utils::SharedPtr<Message> message_to_send(
+ new Message(protocol_handler::MessagePriority::kDefault));
+ if (!message_to_send) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ hmi_so_factory().attachSchema(*message);
+ LOG4CXX_INFO(
+ logger_,
+ "Attached schema to message, result if valid: " << message->isValid());
+
+
+#ifdef HMI_DBUS_API
+ message_to_send->set_smart_object(*message);
+#else
+ if (!ConvertSOtoMessage(*message, *message_to_send)) {
+ LOG4CXX_WARN(logger_,
+ "Cannot send message to HMI: failed to create string");
+ return;
+ }
+#endif // HMI_DBUS_API
+
+ messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send));
+}
+
+bool ApplicationManagerImpl::ManageHMICommand(
+ const utils::SharedPtr<smart_objects::SmartObject>& message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ManageHMICommand");
+
+ if (!message) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return false;
+ }
+
+
+ MessageHelper::PrintSmartObject(*message);
+
+ CommandSharedPtr command = HMICommandFactory::CreateCommand(message);
+ if (!command) {
+ LOG4CXX_WARN(logger_, "Failed to create command from smart object");
+ return false;
+ }
+
+ int32_t message_type = (*(message.get()))[strings::params][strings::message_type].asInt();
+
+ if (kRequest == message_type) {
+ LOG4CXX_DEBUG(logger_, "ManageHMICommand");
+ request_ctrl_.addHMIRequest(command);
+ }
+
+ if (command->Init()) {
+ command->Run();
+ if (kResponse == message_type) {
+ int32_t correlation_id = (*(message.get()))[strings::params][strings::correlation_id].asInt();
+ request_ctrl_.terminateHMIRequest(correlation_id);
+ }
+ return true;
+ }
+ return false;
+}
+
+bool ApplicationManagerImpl::Init() {
+ LOG4CXX_TRACE(logger_, "Init application manager");
+ if (policy::PolicyHandler::instance()->PolicyEnabled()) {
+ if(!policy::PolicyHandler::instance()->LoadPolicyLibrary()) {
+ LOG4CXX_ERROR(logger_, "Policy library is not loaded. Check LD_LIBRARY_PATH");
+ return false;
+ }
+ LOG4CXX_INFO(logger_, "Policy library is loaded, now initing PT");
+ if (!policy::PolicyHandler::instance()->InitPolicyTable()) {
+ LOG4CXX_ERROR(logger_, "Policy table is not initialized.");
+ return false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "System is configured to work without policy functionality.");
+ }
+ const std::string app_storage_folder =
+ profile::Profile::instance()->app_storage_folder();
+ if (!file_system::DirectoryExists(app_storage_folder)) {
+ LOG4CXX_WARN(logger_, "Storage directory doesn't exist");
+ // if storage directory doesn't exist try to create it
+ if (!file_system::CreateDirectoryRecursively(app_storage_folder)) {
+ LOG4CXX_ERROR(logger_, "Unable to create Storage directory "
+ << app_storage_folder);
+ return false;
+ }
+ }
+ if (!(file_system::IsWritingAllowed(app_storage_folder) &&
+ file_system::IsReadingAllowed(app_storage_folder))) {
+ LOG4CXX_ERROR(logger_,
+ "Storage directory doesn't have read/write permissions");
+ return false;
+ }
+
+ const std::string system_files_path =
+ profile::Profile::instance()->system_files_path();
+ if (!file_system::DirectoryExists(system_files_path)) {
+ LOG4CXX_WARN(logger_, "System files directory doesn't exist");
+ // if system directory doesn't exist try to create it
+ if (!file_system::CreateDirectoryRecursively(system_files_path)) {
+ LOG4CXX_ERROR(logger_, "Unable to create System directory "
+ << system_files_path);
+ return false;
+ }
+ }
+ if (!(file_system::IsWritingAllowed(system_files_path) &&
+ file_system::IsReadingAllowed(system_files_path))) {
+ LOG4CXX_ERROR(logger_,
+ "System directory doesn't have read/write permissions");
+ return false;
+ }
+ media_manager_ = media_manager::MediaManagerImpl::instance();
+ return true;
+}
+
+bool ApplicationManagerImpl::ConvertMessageToSO(
+ const Message& message, smart_objects::SmartObject& output) {
+ LOG4CXX_INFO(
+ logger_,
+ "\t\t\tMessage to convert: protocol " << message.protocol_version()
+ << "; json " << message.json_message());
+
+ switch (message.protocol_version()) {
+ case ProtocolVersion::kV3:
+ case ProtocolVersion::kV2: {
+ const bool conversion_result =
+ formatters::CFormatterJsonSDLRPCv2::fromString(
+ message.json_message(), output, message.function_id(),
+ message.type(), message.correlation_id());
+ if (!conversion_result
+ || !mobile_so_factory().attachSchema(output)
+ || ((output.validate() != smart_objects::Errors::OK)) ) {
+ LOG4CXX_WARN(logger_, "Failed to parse string to smart object :"
+ << message.json_message());
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ message.connection_key(), message.function_id(),
+ message.correlation_id(), mobile_apis::Result::INVALID_DATA));
+ ManageMobileCommand(response);
+ return false;
+ }
+ LOG4CXX_INFO(
+ logger_,
+ "Convertion result for sdl object is true" << " function_id "
+ << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ output[strings::params][strings::connection_key] =
+ message.connection_key();
+ output[strings::params][strings::protocol_version] =
+ message.protocol_version();
+ if (message.binary_data()) {
+ if (message.payload_size() < message.data_size()) {
+ LOG4CXX_ERROR(logger_, "Incomplete binary" <<
+ " binary size should be " << message.data_size() <<
+ " payload data size is " << message.payload_size());
+ utils::SharedPtr<smart_objects::SmartObject> response(
+ MessageHelper::CreateNegativeResponse(
+ message.connection_key(), message.function_id(),
+ message.correlation_id(), mobile_apis::Result::INVALID_DATA));
+ ManageMobileCommand(response);
+ return false;
+ }
+ output[strings::params][strings::binary_data] =
+ *(message.binary_data());
+ }
+ break;
+ }
+ case ProtocolVersion::kHMI: {
+#ifdef ENABLE_LOG
+ int32_t result =
+#endif
+ formatters::FormatterJsonRpc::FromString <
+ hmi_apis::FunctionID::eType, hmi_apis::messageType::eType > (
+ message.json_message(), output);
+ LOG4CXX_INFO(
+ logger_,
+ "Convertion result: " << result << " function id "
+ << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt());
+ if (!hmi_so_factory().attachSchema(output)) {
+ LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
+ return false;
+ }
+ if (output.validate() != smart_objects::Errors::OK) {
+ LOG4CXX_WARN(logger_, "Incorrect parameter from HMI");
+ output.erase(strings::msg_params);
+ output[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_DATA;
+ output[strings::msg_params][strings::info] =
+ std::string("Received invalid data on HMI response");
+ }
+ break;
+ }
+ case ProtocolVersion::kV1: {
+ static NsSmartDeviceLinkRPC::V1::v4_protocol_v1_2_no_extra v1_shema;
+
+ if (message.function_id() == 0 || message.type() == kUnknownType) {
+ LOG4CXX_ERROR(logger_, "Message received: UNSUPPORTED_VERSION");
+
+ int32_t conversation_result =
+ formatters::CFormatterJsonSDLRPCv1::fromString <
+ NsSmartDeviceLinkRPC::V1::FunctionID::eType,
+ NsSmartDeviceLinkRPC::V1::messageType::eType > (
+ message.json_message(), output);
+
+ if (formatters::CFormatterJsonSDLRPCv1::kSuccess
+ == conversation_result) {
+
+ smart_objects::SmartObject params = smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map);
+
+ output[strings::params][strings::message_type] =
+ NsSmartDeviceLinkRPC::V1::messageType::response;
+ output[strings::params][strings::connection_key] = message.connection_key();
+
+ output[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map);
+ output[strings::msg_params][strings::success] = false;
+ output[strings::msg_params][strings::result_code] =
+ NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION;
+
+ smart_objects::SmartObject* msg_to_send = new smart_objects::SmartObject(output);
+ v1_shema.attachSchema(*msg_to_send);
+ SendMessageToMobile(msg_to_send);
+ return false;
+ }
+ }
+
+ break;
+ }
+ default:
+ // TODO(PV):
+ // removed NOTREACHED() because some app can still have vesion 1.
+ LOG4CXX_WARN(
+ logger_,
+ "Application used unsupported protocol :" << message.protocol_version()
+ << ".");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "Successfully parsed message into smart object");
+ return true;
+}
+
+bool ApplicationManagerImpl::ConvertSOtoMessage(
+ const smart_objects::SmartObject& message, Message& output) {
+ LOG4CXX_INFO(logger_, "Message to convert");
+
+ if (smart_objects::SmartType_Null == message.getType()
+ || smart_objects::SmartType_Invalid == message.getType()) {
+ LOG4CXX_WARN(logger_, "Invalid smart object received.");
+ return false;
+ }
+
+ LOG4CXX_INFO(
+ logger_,
+ "Message with protocol: "
+ << message.getElement(jhs::S_PARAMS).getElement(jhs::S_PROTOCOL_TYPE)
+ .asInt());
+
+ std::string output_string;
+ switch (message.getElement(jhs::S_PARAMS).getElement(jhs::S_PROTOCOL_TYPE)
+ .asInt()) {
+ case 0: {
+ if (message.getElement(jhs::S_PARAMS).getElement(jhs::S_PROTOCOL_VERSION).asInt() == 1) {
+ if (!formatters::CFormatterJsonSDLRPCv1::toString(message,
+ output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(application_manager::kV1);
+ } else {
+ if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
+ output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(
+ static_cast<ProtocolVersion>(
+ message.getElement(jhs::S_PARAMS).getElement(
+ jhs::S_PROTOCOL_VERSION).asUInt()));
+ }
+
+ break;
+ }
+ case 1: {
+ if (!formatters::FormatterJsonRpc::ToString(message, output_string)) {
+ LOG4CXX_WARN(logger_, "Failed to serialize smart object");
+ return false;
+ }
+ output.set_protocol_version(application_manager::kHMI);
+ break;
+ }
+ default:
+ NOTREACHED();
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "Convertion result: " << output_string);
+
+ output.set_connection_key(
+ message.getElement(jhs::S_PARAMS).getElement(strings::connection_key)
+ .asInt());
+
+ output.set_function_id(
+ message.getElement(jhs::S_PARAMS).getElement(jhs::S_FUNCTION_ID).asInt());
+
+ output.set_correlation_id(
+ message.getElement(jhs::S_PARAMS).getElement(jhs::S_CORRELATION_ID)
+ .asInt());
+ output.set_message_type(
+ static_cast<MessageType>(message.getElement(jhs::S_PARAMS).getElement(
+ jhs::S_MESSAGE_TYPE).asInt()));
+
+ // Currently formatter creates JSON = 3 bytes for empty SmartObject.
+ // workaround for notification. JSON must be empty
+ if (mobile_apis::FunctionID::OnAudioPassThruID
+ != message.getElement(jhs::S_PARAMS).getElement(strings::function_id)
+ .asInt()) {
+ output.set_json_message(output_string);
+ }
+
+ if (message.getElement(jhs::S_PARAMS).keyExists(strings::binary_data)) {
+ application_manager::BinaryData* binaryData =
+ new application_manager::BinaryData(
+ message.getElement(jhs::S_PARAMS).getElement(strings::binary_data)
+ .asBinary());
+
+ if (NULL == binaryData) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return false;
+ }
+ output.set_binary_data(binaryData);
+ }
+
+ LOG4CXX_INFO(logger_, "Successfully parsed smart object into message");
+ return true;
+}
+
+utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
+ const RawMessagePtr message) {
+ DCHECK(message);
+ utils::SharedPtr<Message> outgoing_message;
+
+ LOG4CXX_INFO(logger_, "Service type." << message->service_type());
+
+ if (message->service_type() != protocol_handler::kRpc
+ &&
+ message->service_type() != protocol_handler::kBulk) {
+ // skip this message, not under handling of ApplicationManager
+ LOG4CXX_TRACE(logger_, "Skipping message; not the under AM handling.");
+ return outgoing_message;
+ }
+
+ Message* convertion_result = NULL;
+ if (message->protocol_version() == 1) {
+ convertion_result =
+ MobileMessageHandler::HandleIncomingMessageProtocolV1(message);
+ } else if ((message->protocol_version() == 2) ||
+ (message->protocol_version() == 3)) {
+ convertion_result =
+ MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
+ } else {
+ LOG4CXX_WARN(logger_, "Unknown protocol version.");
+ return outgoing_message;
+ }
+
+ if (convertion_result) {
+ outgoing_message = convertion_result;
+ } else {
+ LOG4CXX_ERROR(logger_, "Received invalid message");
+ }
+ return outgoing_message;
+}
+
+void ApplicationManagerImpl::ProcessMessageFromMobile(
+ const utils::SharedPtr<Message>& message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ProcessMessageFromMobile()");
+#ifdef TIME_TESTER
+ AMMetricObserver::MessageMetricSharedPtr metric(new AMMetricObserver::MessageMetric());
+ metric->begin = date_time::DateTime::getCurrentTime();
+#endif // TIME_TESTER
+ utils::SharedPtr<smart_objects::SmartObject> so_from_mobile(
+ new smart_objects::SmartObject);
+
+ if (!so_from_mobile) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+ if (!ConvertMessageToSO(*message, *so_from_mobile)) {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+#ifdef TIME_TESTER
+ metric->message = so_from_mobile;
+#endif // TIME_TESTER
+
+ if (!ManageMobileCommand(so_from_mobile)) {
+ LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
+ }
+#ifdef TIME_TESTER
+ metric->end = date_time::DateTime::getCurrentTime();
+ if (metric_observer_) {
+ metric_observer_->OnMessage(metric);
+ }
+#endif // TIME_TESTER
+}
+
+void ApplicationManagerImpl::ProcessMessageFromHMI(
+ const utils::SharedPtr<Message>& message) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::ProcessMessageFromHMI()");
+ utils::SharedPtr<smart_objects::SmartObject> smart_object(
+ new smart_objects::SmartObject);
+
+ if (!smart_object) {
+ LOG4CXX_ERROR(logger_, "Null pointer");
+ return;
+ }
+
+#ifdef HMI_DBUS_API
+ *smart_object = message->smart_object();
+#else
+ if (!ConvertMessageToSO(*message, *smart_object)) {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
+#endif // HMI_DBUS_API
+
+ LOG4CXX_INFO(logger_, "Converted message, trying to create hmi command");
+ if (!ManageHMICommand(smart_object)) {
+ LOG4CXX_ERROR(logger_, "Received command didn't run successfully");
+ }
+}
+
+hmi_apis::HMI_API& ApplicationManagerImpl::hmi_so_factory() {
+ if (!hmi_so_factory_) {
+ hmi_so_factory_ = new hmi_apis::HMI_API;
+ if (!hmi_so_factory_) {
+ LOG4CXX_ERROR(logger_, "Out of memory");
+ NOTREACHED();
+ }
+ }
+ return *hmi_so_factory_;
+}
+
+mobile_apis::MOBILE_API& ApplicationManagerImpl::mobile_so_factory() {
+ if (!mobile_so_factory_) {
+ mobile_so_factory_ = new mobile_apis::MOBILE_API;
+ if (!mobile_so_factory_) {
+ LOG4CXX_ERROR(logger_, "Out of memory.");
+ NOTREACHED();
+ }
+ }
+ return *mobile_so_factory_;
+}
+
+HMICapabilities& ApplicationManagerImpl::hmi_capabilities() {
+ return hmi_capabilities_;
+}
+
+#ifdef TIME_TESTER
+void ApplicationManagerImpl::SetTimeMetricObserver(AMMetricObserver* observer) {
+ metric_observer_ = observer;
+}
+#endif // TIME_TESTER
+
+void ApplicationManagerImpl::addNotification(const CommandSharedPtr ptr) {
+ request_ctrl_.addNotification(ptr);
+}
+
+void ApplicationManagerImpl::removeNotification(const commands::Command* notification) {
+ request_ctrl_.removeNotification(notification);
+}
+
+void ApplicationManagerImpl::updateRequestTimeout(uint32_t connection_key,
+ uint32_t mobile_correlation_id,
+ uint32_t new_timeout_value) {
+ request_ctrl_.updateRequestTimeout(connection_key, mobile_correlation_id,
+ new_timeout_value);
+}
+
+const uint32_t ApplicationManagerImpl::application_id
+(const int32_t correlation_id) {
+ // ykazakov: there is no erase for const iterator for QNX
+ std::map<const int32_t, const uint32_t>::iterator it =
+ appID_list_.find(correlation_id);
+ if (appID_list_.end() != it) {
+ const uint32_t app_id = it->second;
+ appID_list_.erase(it);
+ return app_id;
+ } else {
+ return 0;
+ }
+}
+
+void ApplicationManagerImpl::set_application_id(const int32_t correlation_id,
+ const uint32_t app_id) {
+ appID_list_.insert(std::pair<const int32_t, const uint32_t>
+ (correlation_id, app_id));
+}
+
+void ApplicationManagerImpl::SetUnregisterAllApplicationsReason(
+ mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ unregister_reason_ = reason;
+}
+
+void ApplicationManagerImpl::HeadUnitReset(
+ mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ switch (reason) {
+ case mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET: {
+ file_system::remove_directory_content(profile::Profile::instance()->app_storage_folder());
+ resume_controller().ClearResumptionInfo();
+ policy::PolicyHandler::instance()->ResetPolicyTable();
+ break;
+ }
+ case mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS: {
+ policy::PolicyHandler::instance()->ClearUserConsent();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Bad AppInterfaceUnregisteredReason");
+ return;
+ }
+ }
+}
+
+void ApplicationManagerImpl::HeadUnitSuspend() {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::HeadUnitSuspend");
+}
+
+void ApplicationManagerImpl::SendOnSDLClose() {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::SendOnSDLClose");
+
+ // must be sent to PASA HMI on shutdown synchronously
+ smart_objects::SmartObject* msg = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ (*msg)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLClose;
+ (*msg)[strings::params][strings::message_type] =
+ MessageType::kNotification;
+ (*msg)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*msg)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+
+ if (!msg) {
+ LOG4CXX_WARN(logger_, "Null-pointer message received.");
+ NOTREACHED();
+ return;
+ }
+
+ // SmartObject |message| has no way to declare priority for now
+ utils::SharedPtr<Message> message_to_send(
+ new Message(protocol_handler::MessagePriority::kDefault));
+
+ hmi_so_factory().attachSchema(*msg);
+ LOG4CXX_INFO(
+ logger_,
+ "Attached schema to message, result if valid: " << msg->isValid());
+
+
+#ifdef HMI_DBUS_API
+ message_to_send->set_smart_object(*msg);
+#else
+ if (!ConvertSOtoMessage(*msg, *message_to_send)) {
+ LOG4CXX_WARN(logger_,
+ "Cannot send message to HMI: failed to create string");
+ return;
+ }
+#endif // HMI_DBUS_API
+
+ if (!hmi_handler_) {
+ LOG4CXX_WARN(logger_, "No HMI Handler set");
+ return;
+ }
+
+ delete msg;
+ hmi_handler_->SendMessageToHMI(message_to_send);
+}
+
+void ApplicationManagerImpl::UnregisterAllApplications(bool generated_by_hmi) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::UnregisterAllApplications " <<
+ unregister_reason_);
+
+ hmi_cooperating_ = false;
+
+ bool is_ignition_off =
+ unregister_reason_ ==
+ mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF ? true : false;
+
+ bool is_unexpected_disconnect = (generated_by_hmi != true);
+
+ sync_primitives::AutoLock lock(applications_list_lock_);
+
+ std::set<ApplicationSharedPtr>::iterator it = application_list_.begin();
+ while (it != application_list_.end()) {
+ ApplicationSharedPtr app_to_remove = *it;
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app_to_remove->app_id(), unregister_reason_);
+ UnregisterApplication(app_to_remove->app_id(),
+ mobile_apis::Result::INVALID_ENUM, is_ignition_off,
+ is_unexpected_disconnect);
+
+ connection_handler_->CloseSession(app_to_remove->app_id());
+ it = application_list_.begin();
+ }
+
+ if (is_ignition_off) {
+ resume_controller().IgnitionOff();
+ }
+ request_ctrl_.terminateAllHMIRequests();
+}
+
+void ApplicationManagerImpl::UnregisterApplication(
+ const uint32_t& app_id, mobile_apis::Result::eType reason,
+ bool is_resuming, bool is_unexpected_disconnect) {
+ LOG4CXX_INFO(logger_,
+ "ApplicationManagerImpl::UnregisterApplication " << app_id);
+ //remove appID from tts_global_properties_app_list_
+ RemoveAppFromTTSGlobalPropertiesList(app_id);
+
+ sync_primitives::AutoLock lock(applications_list_lock_);
+
+ switch (reason) {
+ case mobile_apis::Result::SUCCESS:break;
+ case mobile_apis::Result::DISALLOWED: break;
+ case mobile_apis::Result::USER_DISALLOWED:break;
+ case mobile_apis::Result::INVALID_CERT: break;
+ case mobile_apis::Result::EXPIRED_CERT: break;
+ case mobile_apis::Result::TOO_MANY_PENDING_REQUESTS: {
+ application(app_id)->usage_report().RecordRemovalsForBadBehavior();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown unregister reason " << reason);
+ break;
+ }
+ }
+
+ ApplicationSharedPtr app_to_remove;
+ std::set<ApplicationSharedPtr>::const_iterator it = application_list_.begin();
+ for (; it != application_list_.end(); ++it) {
+ if ((*it)->app_id() == app_id) {
+ app_to_remove = *it;
+ break;
+ }
+ }
+ if (!app_to_remove) {
+ LOG4CXX_ERROR(logger_, "Cant find application with app_id = " << app_id);
+ return;
+ }
+ application_list_.erase(app_to_remove);
+
+ if (is_resuming) {
+ resume_ctrl_.SaveApplication(app_to_remove);
+ }
+
+ if (audio_pass_thru_active_) {
+ // May be better to put this code in MessageHelper?
+ end_audio_pass_thru();
+ StopAudioPassThru(app_id);
+ MessageHelper::SendStopAudioPathThru();
+ }
+ MessageHelper::SendOnAppUnregNotificationToHMI(app_to_remove,
+ is_unexpected_disconnect);
+
+ request_ctrl_.terminateAppRequests(app_id);
+ return;
+}
+
+
+void ApplicationManagerImpl::UnregisterRevokedApplication(
+ const uint32_t& app_id, mobile_apis::Result::eType reason) {
+ UnregisterApplication(app_id, reason);
+
+ connection_handler_->CloseSession(app_id);
+
+ if (application_list_.empty()) {
+ connection_handler_->CloseRevokedConnection(app_id);
+ }
+}
+
+void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
+ LOG4CXX_INFO(logger_, "Received message from Mobile side");
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ return;
+ }
+ ProcessMessageFromMobile(message);
+}
+
+void ApplicationManagerImpl::Handle(const impl::MessageToMobile message) {
+ protocol_handler::RawMessage* rawMessage = 0;
+ if (message->protocol_version() == application_manager::kV1) {
+ rawMessage = MobileMessageHandler::HandleOutgoingMessageProtocolV1(message);
+ } else if ((message->protocol_version() == application_manager::kV2) ||
+ (message->protocol_version() == application_manager::kV3)) {
+ rawMessage = MobileMessageHandler::HandleOutgoingMessageProtocolV2(message);
+ } else {
+ return;
+ }
+ if (!rawMessage) {
+ LOG4CXX_ERROR(logger_, "Failed to create raw message.");
+ return;
+ }
+
+ if (!protocol_handler_) {
+ LOG4CXX_WARN(logger_,
+ "Protocol Handler is not set; cannot send message to mobile.");
+ return;
+ }
+
+
+ bool is_final = message.is_final;
+ bool close_session = false;
+ if (is_final) {
+ if (1 < connection_handler_->GetConnectionSessionsCount(message->connection_key())) {
+ is_final = false;
+ close_session = true;
+ }
+ }
+
+ protocol_handler_->SendMessageToMobileApp(rawMessage, is_final);
+ LOG4CXX_INFO(logger_, "Message for mobile given away");
+
+ if (close_session) {
+ connection_handler_->CloseSession(message->connection_key());
+ }
+}
+
+void ApplicationManagerImpl::Handle(const impl::MessageFromHmi message) {
+ LOG4CXX_INFO(logger_, "Received message from hmi");
+
+ if (!message) {
+ LOG4CXX_ERROR(logger_, "Null-pointer message received.");
+ return;
+ }
+
+ ProcessMessageFromHMI(message);
+}
+
+void ApplicationManagerImpl::Handle(const impl::MessageToHmi message) {
+ LOG4CXX_INFO(logger_, "Received message to hmi");
+ if (!hmi_handler_) {
+ LOG4CXX_ERROR(logger_, "Observer is not set for HMIMessageHandler");
+ return;
+ }
+
+ hmi_handler_->SendMessageToHMI(message);
+ LOG4CXX_INFO(logger_, "Message to hmi given away.");
+}
+
+mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
+ const std::string& policy_app_id,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::FunctionID::eType function_id,
+ const RPCParams& rpc_params,
+ CommandParametersPermissions* params_permissions) {
+ LOG4CXX_INFO(logger_, "CheckPolicyPermissions");
+ // TODO(AOleynik): Remove check of policy_enable, when this flag will be
+ // unused in config file
+ if (!policy::PolicyHandler::instance()->PolicyEnabled()) {
+ return mobile_apis::Result::SUCCESS;
+ }
+
+ const std::string stringified_functionID =
+ MessageHelper::StringifiedFunctionID(function_id);
+ const std::string stringified_hmi_level =
+ MessageHelper::StringifiedHMILevel(hmi_level);
+ LOG4CXX_INFO(
+ logger_,
+ "Checking permissions for " << policy_app_id <<
+ " in " << stringified_hmi_level <<
+ " rpc " << stringified_functionID);
+ policy::CheckPermissionResult result;
+ policy::PolicyHandler::instance()->CheckPermissions(
+ policy_app_id,
+ stringified_hmi_level,
+ stringified_functionID,
+ rpc_params,
+ result);
+
+ if (NULL != params_permissions) {
+ params_permissions->allowed_params = result.list_of_allowed_params;
+ params_permissions->disallowed_params = result.list_of_disallowed_params;
+ params_permissions->undefined_params = result.list_of_undefined_params;
+ }
+
+ if (hmi_level == mobile_apis::HMILevel::HMI_NONE
+ && function_id != mobile_apis::FunctionID::UnregisterAppInterfaceID) {
+ ApplicationSharedPtr app = application_by_policy_id(policy_app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "No application for policy id " << policy_app_id);
+ return mobile_apis::Result::GENERIC_ERROR;
+ }
+ if (result.hmi_level_permitted != policy::kRpcAllowed) {
+ app->usage_report().RecordRpcSentInHMINone();
+ }
+ }
+
+ const std::string log_msg = "Application: "+ policy_app_id+
+ ", RPC: "+stringified_functionID+
+ ", HMI status: "+stringified_hmi_level;
+
+ if (result.hmi_level_permitted != policy::kRpcAllowed) {
+ LOG4CXX_WARN(logger_, "Request is blocked by policies. " << log_msg );
+
+ application_by_policy_id(policy_app_id)->
+ usage_report().RecordPolicyRejectedRpcCall();
+
+ switch (result.hmi_level_permitted) {
+ case policy::kRpcDisallowed:
+ return mobile_apis::Result::DISALLOWED;
+ case policy::kRpcUserDisallowed:
+ return mobile_apis::Result::USER_DISALLOWED;
+ default:
+ return mobile_apis::Result::INVALID_ENUM;
+ }
+ }
+ LOG4CXX_INFO(logger_, "Request is allowed by policies. "+log_msg);
+ return mobile_api::Result::SUCCESS;
+}
+
+void ApplicationManagerImpl::Mute(VRTTSSessionChanging changing_state) {
+ mobile_apis::AudioStreamingState::eType state =
+ hmi_capabilities_.attenuated_supported()
+ ? mobile_apis::AudioStreamingState::ATTENUATED
+ : mobile_apis::AudioStreamingState::NOT_AUDIBLE;
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::TAppList local_app_list = accessor.applications();
+
+ ApplicationManagerImpl::TAppListConstIt it = local_app_list.begin();
+ ApplicationManagerImpl::TAppListConstIt itEnd = local_app_list.end();
+ for (; it != itEnd; ++it) {
+ if ((*it).valid()) {
+ if ((*it)->is_media_application()) {
+ if (kTTSSessionChanging == changing_state) {
+ (*it)->set_tts_speak_state(true);
+ }
+ if ((*it)->audio_streaming_state() != state &&
+ (mobile_api::HMILevel::HMI_NONE != (*it)->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_BACKGROUND != (*it)->hmi_level())) {
+ (*it)->set_audio_streaming_state(state);
+ MessageHelper::SendHMIStatusNotification(*(*it));
+ }
+ }
+ }
+ }
+}
+
+void ApplicationManagerImpl::Unmute(VRTTSSessionChanging changing_state) {
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::TAppList local_app_list = application_list_;
+ ApplicationManagerImpl::TAppListConstIt it = local_app_list.begin();
+ ApplicationManagerImpl::TAppListConstIt itEnd = local_app_list.end();
+
+ for (; it != itEnd; ++it) {
+ if ((*it).valid()) {
+ if ((*it)->is_media_application()) {
+ if (kTTSSessionChanging == changing_state) {
+ (*it)->set_tts_speak_state(false);
+ }
+ if ((!(vr_session_started())) &&
+ (!((*it)->tts_speak_state())) &&
+ ((*it)->audio_streaming_state() !=
+ mobile_apis::AudioStreamingState::AUDIBLE) &&
+ (mobile_api::HMILevel::HMI_NONE != (*it)->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_BACKGROUND != (*it)->hmi_level())) {
+ (*it)->set_audio_streaming_state(
+ mobile_apis::AudioStreamingState::AUDIBLE);
+ MessageHelper::SendHMIStatusNotification(*(*it));
+ }
+ }
+ }
+ }
+}
+
+mobile_apis::Result::eType ApplicationManagerImpl::SaveBinary(
+ const std::vector<uint8_t>& binary_data, const std::string& file_path,
+ const std::string& file_name, const int64_t offset) {
+ LOG4CXX_INFO(logger_,
+ "SaveBinaryWithOffset binary_size = " << binary_data.size()
+ << " offset = " << offset);
+
+ if (binary_data.size() > file_system::GetAvailableDiskSpace(file_path)) {
+ LOG4CXX_ERROR(logger_, "Out of free disc space.");
+ return mobile_apis::Result::OUT_OF_MEMORY;
+ }
+
+ const std::string full_file_path = file_path + "/" + file_name;
+ int64_t file_size = file_system::FileSize(full_file_path);
+ std::ofstream* file_stream;
+ if (offset != 0) {
+ if (file_size != offset) {
+ LOG4CXX_INFO(logger_,
+ "ApplicationManagerImpl::SaveBinaryWithOffset offset"
+ << " does'n match existing file size");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ file_stream = file_system::Open(full_file_path, std::ios_base::app);
+ } else {
+ LOG4CXX_INFO(
+ logger_,
+ "ApplicationManagerImpl::SaveBinaryWithOffset offset is 0, rewrite");
+ // if offset == 0: rewrite file
+ file_stream = file_system::Open(full_file_path, std::ios_base::out);
+ }
+
+ if (!file_system::Write(file_stream, binary_data.data(),
+ binary_data.size())) {
+ file_system::Close(file_stream);
+ return mobile_apis::Result::GENERIC_ERROR;
+ }
+
+ file_system::Close(file_stream);
+ LOG4CXX_INFO(logger_, "Successfully write data to file");
+ return mobile_apis::Result::SUCCESS;
+}
+
+uint32_t ApplicationManagerImpl::GetAvailableSpaceForApp(
+ const std::string& folder_name) {
+ const uint32_t app_quota = profile::Profile::instance()->app_dir_quota();
+ std::string app_storage_path =
+ profile::Profile::instance()->app_storage_folder();
+
+ app_storage_path += "/";
+ app_storage_path += folder_name;
+
+ if (file_system::DirectoryExists(app_storage_path)) {
+ size_t size_of_directory = file_system::DirectorySize(app_storage_path);
+ if (app_quota < size_of_directory) {
+ return 0;
+ }
+
+ uint32_t current_app_quota = app_quota - size_of_directory;
+ uint32_t available_disk_space =
+ file_system::GetAvailableDiskSpace(app_storage_path);
+
+ if (current_app_quota > available_disk_space) {
+ return available_disk_space;
+ } else {
+ return current_app_quota;
+ }
+ } else {
+ return app_quota;
+ }
+}
+
+bool ApplicationManagerImpl::IsHMICooperating() const {
+ return hmi_cooperating_;
+}
+
+void ApplicationManagerImpl::OnApplicationListUpdateTimer() {
+ LOG4CXX_DEBUG(logger_, "Application list update timer finished");
+
+ std::list <uint32_t> applications_ids;
+
+ applications_list_lock_.Acquire();
+ for (std::set<ApplicationSharedPtr>::const_iterator i = application_list_.begin();
+ i != application_list_.end(); ++i) {
+ ApplicationSharedPtr application = *i;
+ uint32_t app_id = application->app_id();
+ applications_ids.push_back(app_id);
+ }
+ applications_list_lock_.Release();
+
+ SendUpdateAppList(applications_ids);
+}
+
+void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
+ std::vector<uint32_t> app_list;
+ {
+ sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
+ std::map<uint32_t, TimevalStruct>::iterator it =
+ tts_global_properties_app_list_.begin();
+ std::map<uint32_t, TimevalStruct>::iterator it_end =
+ tts_global_properties_app_list_.end();
+ date_time::TimeCompare time_comp;
+ for (; it != it_end; ++it) {
+ time_comp = date_time::DateTime::compareTime(
+ date_time::DateTime::getCurrentTime(), it->second);
+ if (date_time::GREATER == time_comp || date_time::EQUAL == time_comp) {
+ app_list.push_back(it->first);
+ }
+ }
+ }
+ if (!app_list.empty()) {
+ for (uint32_t i = 0; i < app_list.size(); ++i) {
+ LOG4CXX_INFO(logger_, "Send TTS GlobalProperties to HMI with default helpPrompt");
+ MessageHelper::SendTTSGlobalProperties(application(app_list[i]), true);
+ RemoveAppFromTTSGlobalPropertiesList(app_list[i]);
+ }
+ }
+}
+
+void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList(
+ const uint32_t app_id) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList");
+ uint16_t timeout = profile::Profile::instance()->tts_global_properties_timeout();
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ current_time.tv_sec += timeout;
+ sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
+ if (tts_global_properties_app_list_.end() ==
+ tts_global_properties_app_list_.find(app_id)) {
+ tts_global_properties_app_list_[app_id] = current_time;
+ }
+ //if add first item need to start timer on one second
+ if (1 == tts_global_properties_app_list_.size()) {
+ LOG4CXX_INFO(logger_, "Start tts_global_properties_timer_");
+ tts_global_properties_timer_.start(1);
+ }
+}
+
+void ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList(
+ const uint32_t app_id) {
+ LOG4CXX_INFO(logger_, "ApplicationManagerImpl::RemoveAppFromTTSGlobalPropertiesList");
+ sync_primitives::AutoLock lock(tts_global_properties_app_list_lock_);
+ std::map<uint32_t, TimevalStruct>::iterator it =
+ tts_global_properties_app_list_.find(app_id);
+ if (tts_global_properties_app_list_.end() != it) {
+ tts_global_properties_app_list_.erase(it);
+ if (!(tts_global_properties_app_list_.size())) {
+ LOG4CXX_INFO(logger_, "Stop tts_global_properties_timer_");
+ //if container is empty need to stop timer
+ tts_global_properties_timer_.stop();
+ }
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
new file mode 100644
index 0000000000..af666b22c4
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -0,0 +1,80 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_impl.h"
+#include "config_profile/profile.h"
+
+namespace application_manager {
+namespace commands {
+
+CREATE_LOGGERPTR_LOCAL(CommandImpl::logger_, "Commands")
+
+const int32_t CommandImpl::hmi_protocol_type_ = 1;
+const int32_t CommandImpl::mobile_protocol_type_ = 0;
+const int32_t CommandImpl::protocol_version_ = 3;
+
+CommandImpl::CommandImpl(const MessageSharedPtr& message)
+ : message_(message),
+ default_timeout_(profile::Profile::instance()->default_timeout()) {
+}
+
+CommandImpl::~CommandImpl() {
+ CleanUp();
+}
+
+bool CommandImpl::CheckPermissions(){
+ return true;
+}
+
+bool CommandImpl::Init() {
+ return true;
+}
+
+bool CommandImpl::CleanUp() {
+ return true;
+}
+
+void CommandImpl::Run() {
+}
+
+uint32_t CommandImpl::default_timeout() const {
+ return default_timeout_;
+}
+
+
+uint32_t CommandImpl::correlation_id() const {
+ return (*message_)[strings::params][strings::correlation_id].asUInt();
+}
+
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_notification_impl.cc b/src/components/application_manager/src/commands/command_notification_impl.cc
new file mode 100644
index 0000000000..c99f2d9086
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_notification_impl.cc
@@ -0,0 +1,74 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CommandNotificationImpl::CommandNotificationImpl(
+ const MessageSharedPtr& message)
+ : CommandImpl(message) {
+}
+
+CommandNotificationImpl::~CommandNotificationImpl() {
+}
+
+bool CommandNotificationImpl::Init() {
+ return true;
+}
+
+bool CommandNotificationImpl::CleanUp() {
+ return true;
+}
+
+void CommandNotificationImpl::Run() {
+}
+
+void CommandNotificationImpl::SendNotification() {
+ (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ LOG4CXX_INFO(logger_, "SendNotification");
+ MessageHelper::PrintSmartObject(*message_);
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
new file mode 100644
index 0000000000..5f8757754f
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -0,0 +1,548 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+struct DisallowedParamsInserter {
+ DisallowedParamsInserter(smart_objects::SmartObject& response,
+ mobile_apis::VehicleDataResultCode::eType code)
+ : response_(response),
+ code_(code) {
+ }
+
+ bool operator()(const std::string& param) {
+ const VehicleData& vehicle_data =
+ application_manager::MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.find(param);
+ if (vehicle_data.end() != it) {
+ smart_objects::SmartObject* disallowed_param =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*disallowed_param)[strings::data_type] = (*it).second;
+ (*disallowed_param)[strings::result_code] = code_;
+ response_[strings::msg_params][param.c_str()] = *disallowed_param;
+ return true;
+ }
+ return false;
+ }
+private:
+ smart_objects::SmartObject& response_;
+ mobile_apis::VehicleDataResultCode::eType code_;
+};
+
+CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message)
+ : CommandImpl(message),
+ current_state_(kAwaitingHMIResponse) {
+}
+
+CommandRequestImpl::~CommandRequestImpl() {
+}
+
+bool CommandRequestImpl::Init() {
+ return true;
+}
+
+bool CommandRequestImpl::CheckPermissions() {
+ return CheckAllowedParameters();
+}
+
+bool CommandRequestImpl::CleanUp() {
+ return true;
+}
+
+void CommandRequestImpl::Run() {
+}
+
+void CommandRequestImpl::onTimeOut() {
+ LOG4CXX_INFO(logger_, "CommandRequestImpl::onTimeOut");
+
+ unsubscribe_from_all_events();
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ if (kCompleted == current_state_) {
+ // don't send timeout if request completed
+ return;
+ }
+
+ current_state_ = kTimedOut;
+ }
+
+ smart_objects::SmartObject* response =
+ MessageHelper::CreateNegativeResponse(connection_key(), function_id(),
+ correlation_id(), mobile_api::Result::GENERIC_ERROR);
+
+ ApplicationManagerImpl::instance()->ManageMobileCommand(response);
+}
+
+void CommandRequestImpl::on_event(const event_engine::Event& event) {
+}
+
+void CommandRequestImpl::SendResponse(
+ const bool success, const mobile_apis::Result::eType& result_code,
+ const char* info, const NsSmart::SmartObject* response_params) {
+
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ if (kTimedOut == current_state_) {
+ // don't send response if request timeout expired
+ return;
+ }
+
+ current_state_ = kCompleted;
+ }
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& response = *result;
+
+ response[strings::params][strings::message_type] = MessageType::kResponse;
+ response[strings::params][strings::correlation_id] = correlation_id();
+ response[strings::params][strings::protocol_type] =
+ CommandImpl::mobile_protocol_type_;
+ response[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ response[strings::params][strings::connection_key] = connection_key();
+ response[strings::params][strings::function_id] = function_id();
+
+ if (response_params) {
+ response[strings::msg_params] = *response_params;
+ }
+
+ if (info) {
+ response[strings::msg_params][strings::info] = std::string(info);
+ }
+
+ // Add disallowed parameters and info from request back to response with appropriate
+ // reasons (VehicleData result codes)
+ if (result_code != mobile_apis::Result::APPLICATION_NOT_REGISTERED) {
+ const mobile_apis::FunctionID::eType& id =
+ static_cast<mobile_apis::FunctionID::eType>(function_id());
+ if ((id == mobile_apis::FunctionID::SubscribeVehicleDataID) ||
+ (id == mobile_apis::FunctionID::UnsubscribeVehicleDataID)) {
+ AddDisallowedParameters(response);
+ AddDisallowedParametersToInfo(response);
+ } else if (id == mobile_apis::FunctionID::GetVehicleDataID) {
+ AddDisallowedParametersToInfo(response);
+ }
+ }
+
+ response[strings::msg_params][strings::success] = success;
+ response[strings::msg_params][strings::result_code] = result_code;
+
+ ApplicationManagerImpl::instance()->ManageMobileCommand(result);
+}
+
+bool CommandRequestImpl::CheckSyntax(std::string str, bool allow_empty_line) {
+ if (std::string::npos != str.find_first_of("\t\n")) {
+ LOG4CXX_ERROR(logger_, "CheckSyntax failed! :" << str);
+ return false;
+ }
+ if (std::string::npos != str.find("\\n") ||
+ std::string::npos != str.find("\\t")) {
+ LOG4CXX_ERROR(logger_, "CheckSyntax failed! :" << str);
+ return false;
+ }
+ if (!allow_empty_line) {
+ if ((std::string::npos == str.find_first_not_of(' '))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+void CommandRequestImpl::SendHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject* msg_params, bool use_events) {
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ const uint32_t hmi_correlation_id =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ if (use_events) {
+ LOG4CXX_WARN(logger_, "subscribe_on_event " << function_id << " " << hmi_correlation_id);
+ subscribe_on_event(function_id, hmi_correlation_id);
+ }
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ request[strings::params][strings::function_id] = function_id;
+ request[strings::params][strings::correlation_id] = hmi_correlation_id;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ if (msg_params) {
+ request[strings::msg_params] = *msg_params;
+ }
+
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY);
+ }
+}
+
+void CommandRequestImpl::CreateHMINotification(
+ const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject& msg_params) const {
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& notify = *result;
+
+ notify[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ notify[strings::params][strings::function_id] = function_id;
+ notify[strings::msg_params] = msg_params;
+
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send HMI notification");
+ }
+}
+
+mobile_apis::Result::eType CommandRequestImpl::GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const {
+
+ mobile_apis::Result::eType mobile_result = mobile_apis::Result::GENERIC_ERROR;
+ switch (hmi_code) {
+ case hmi_apis::Common_Result::SUCCESS: {
+ mobile_result = mobile_apis::Result::SUCCESS;
+ break;
+ }
+ case hmi_apis::Common_Result::UNSUPPORTED_REQUEST: {
+ mobile_result = mobile_apis::Result::UNSUPPORTED_REQUEST;
+ break;
+ }
+ case hmi_apis::Common_Result::UNSUPPORTED_RESOURCE: {
+ mobile_result = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ break;
+ }
+ case hmi_apis::Common_Result::DISALLOWED: {
+ mobile_result = mobile_apis::Result::DISALLOWED;
+ break;
+ }
+ case hmi_apis::Common_Result::REJECTED: {
+ mobile_result = mobile_apis::Result::REJECTED;
+ break;
+ }
+ case hmi_apis::Common_Result::ABORTED: {
+ mobile_result = mobile_apis::Result::ABORTED;
+ break;
+ }
+ case hmi_apis::Common_Result::IGNORED: {
+ mobile_result = mobile_apis::Result::IGNORED;
+ break;
+ }
+ case hmi_apis::Common_Result::RETRY: {
+ mobile_result = mobile_apis::Result::RETRY;
+ break;
+ }
+ case hmi_apis::Common_Result::IN_USE: {
+ mobile_result = mobile_apis::Result::IN_USE;
+ break;
+ }
+ case hmi_apis::Common_Result::DATA_NOT_AVAILABLE: {
+ mobile_result = mobile_apis::Result::VEHICLE_DATA_NOT_AVAILABLE;
+ break;
+ }
+ case hmi_apis::Common_Result::TIMED_OUT: {
+ mobile_result = mobile_apis::Result::TIMED_OUT;
+ break;
+ }
+ case hmi_apis::Common_Result::INVALID_DATA: {
+ mobile_result = mobile_apis::Result::INVALID_DATA;
+ break;
+ }
+ case hmi_apis::Common_Result::CHAR_LIMIT_EXCEEDED: {
+ mobile_result = mobile_apis::Result::CHAR_LIMIT_EXCEEDED;
+ break;
+ }
+ case hmi_apis::Common_Result::INVALID_ID: {
+ mobile_result = mobile_apis::Result::INVALID_ID;
+ break;
+ }
+ case hmi_apis::Common_Result::DUPLICATE_NAME: {
+ mobile_result = mobile_apis::Result::DUPLICATE_NAME;
+ break;
+ }
+ case hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED: {
+ mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ break;
+ }
+ case hmi_apis::Common_Result::WRONG_LANGUAGE: {
+ mobile_result = mobile_apis::Result::WRONG_LANGUAGE;
+ break;
+ }
+ case hmi_apis::Common_Result::OUT_OF_MEMORY: {
+ mobile_result = mobile_apis::Result::OUT_OF_MEMORY;
+ break;
+ }
+ case hmi_apis::Common_Result::TOO_MANY_PENDING_REQUESTS: {
+ mobile_result = mobile_apis::Result::TOO_MANY_PENDING_REQUESTS;
+ break;
+ }
+ case hmi_apis::Common_Result::NO_APPS_REGISTERED: {
+ mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ break;
+ }
+ case hmi_apis::Common_Result::NO_DEVICES_CONNECTED: {
+ mobile_result = mobile_apis::Result::APPLICATION_NOT_REGISTERED;
+ break;
+ }
+ case hmi_apis::Common_Result::WARNINGS: {
+ mobile_result = mobile_apis::Result::WARNINGS;
+ break;
+ }
+ case hmi_apis::Common_Result::GENERIC_ERROR: {
+ mobile_result = mobile_apis::Result::GENERIC_ERROR;
+ break;
+ }
+ case hmi_apis::Common_Result::USER_DISALLOWED: {
+ mobile_result = mobile_apis::Result::USER_DISALLOWED;
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown HMI result code " << hmi_code);
+ break;
+ }
+ }
+
+ return mobile_result;
+}
+
+bool CommandRequestImpl::CheckAllowedParameters() {
+ LOG4CXX_INFO(logger_, "CheckAllowedParameters");
+
+ // RegisterAppInterface should always be allowed
+ if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
+ static_cast<mobile_apis::FunctionID::eType>(function_id())) {
+ return true;
+ }
+
+ typedef std::set<application_manager::ApplicationSharedPtr> ApplicationList;
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationList app_list = accessor.applications();
+ ApplicationList::const_iterator it_app_list = app_list.begin();
+ ApplicationList::const_iterator it_app_list_end = app_list.end();
+ for (; it_app_list != it_app_list_end; ++it_app_list) {
+ if (connection_key() == (*it_app_list).get()->app_id()) {
+
+ RPCParams params;
+
+ const smart_objects::SmartObject& s_map = (*message_)[strings::msg_params];
+ if (smart_objects::SmartType_Map == s_map.getType()) {
+ smart_objects::SmartMap::iterator iter = s_map.map_begin();
+ smart_objects::SmartMap::iterator iter_end = s_map.map_end();
+
+ for (; iter != iter_end; ++iter) {
+ params.push_back(iter->first);
+ }
+ }
+
+ CommandParametersPermissions params_permissions;
+ mobile_apis::Result::eType check_result =
+ application_manager::ApplicationManagerImpl::instance()->
+ CheckPolicyPermissions(
+ (*it_app_list).get()->mobile_app_id()->asString(),
+ (*it_app_list).get()->hmi_level(),
+ static_cast<mobile_api::FunctionID::eType>(function_id()),
+ params,
+ &params_permissions);
+
+ // Check, if RPC is allowed by policy
+ if (mobile_apis::Result::SUCCESS != check_result) {
+ smart_objects::SmartObject* response =
+ MessageHelper::CreateBlockedByPoliciesResponse(
+ static_cast<mobile_api::FunctionID::eType>(function_id()),
+ check_result, correlation_id(), (*it_app_list)->app_id());
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(response);
+ return false;
+ }
+
+ // If no parameters specified in policy table, no restriction will be
+ // applied for parameters
+ if (params_permissions.allowed_params.empty() &&
+ params_permissions.disallowed_params.empty() &&
+ params_permissions.undefined_params.empty()) {
+ return true;
+ }
+
+ RemoveDisallowedParameters(params_permissions);
+ }
+ }
+ return true;
+}
+
+void CommandRequestImpl::RemoveDisallowedParameters(
+ const CommandParametersPermissions& params_permissions) {
+ LOG4CXX_INFO(logger_, "RemoveDisallowedParameters");
+
+ smart_objects::SmartObject& params = (*message_)[strings::msg_params];
+
+ // Remove from request all disallowed parameters
+ std::vector<std::string>::const_iterator it_disallowed =
+ params_permissions.disallowed_params.begin();
+ std::vector<std::string>::const_iterator it_disallowed_end =
+ params_permissions.disallowed_params.end();
+ for (;it_disallowed != it_disallowed_end; ++it_disallowed) {
+ if (params.keyExists(*it_disallowed)) {
+ params.erase(*it_disallowed);
+ parameters_permissions_.disallowed_params.push_back(
+ *it_disallowed);
+ LOG4CXX_INFO(logger_, "Following parameter is disallowed by user: "
+ << *it_disallowed);
+ }
+ }
+
+ // Remove from request all undefined yet parameters
+ std::vector<std::string>::const_iterator it_undefined =
+ params_permissions.undefined_params.begin();
+ std::vector<std::string>::const_iterator it_undefined_end =
+ params_permissions.undefined_params.end();
+ for (;it_undefined != it_undefined_end; ++it_undefined) {
+ if (params.keyExists(*it_undefined)) {
+ params.erase(*it_undefined);
+ parameters_permissions_.undefined_params.push_back(
+ *it_undefined);
+ LOG4CXX_INFO(logger_, "Following parameter is disallowed by policy: "
+ << *it_undefined);
+ }
+ }
+
+ // Remove from request all parameters missed in allowed
+ const VehicleData& vehicle_data =
+ application_manager::MessageHelper::vehicle_data();
+
+ VehicleData::const_iterator it_vehicle_data = vehicle_data.begin();
+ VehicleData::const_iterator it_vehicle_data_end = vehicle_data.end();
+ for (;it_vehicle_data != it_vehicle_data_end; ++it_vehicle_data) {
+ const std::string key = it_vehicle_data->first;
+ if (params.keyExists(key) &&
+ params_permissions.allowed_params.end() ==
+ std::find(params_permissions.allowed_params.begin(),
+ params_permissions.allowed_params.end(),
+ key)) {
+ params.erase(key);
+ parameters_permissions_.undefined_params.push_back(key);
+ LOG4CXX_INFO(logger_,
+ "Following parameter is not found among allowed parameters '"
+ << key
+ << "' and will be treated as disallowed.");
+ }
+ }
+}
+
+void CommandRequestImpl::AddDissalowedParameterToInfoString(
+ std::string& info, const std::string& param) const {
+ // prepare disallowed params enumeration for response info string
+ if (info.empty()) {
+ info = "\'" + param + "\'";
+ } else {
+ info = info + "," + " " + "\'" + param + "\'";
+ }
+}
+
+void CommandRequestImpl::AddDisallowedParametersToInfo(
+ smart_objects::SmartObject& response) const {
+ std::string info;
+
+ std::vector<std::string>::const_iterator it =
+ parameters_permissions_.disallowed_params.begin();
+ for (; it != parameters_permissions_.disallowed_params.end(); ++it) {
+ AddDissalowedParameterToInfoString(info, (*it));
+ }
+
+ it = parameters_permissions_.undefined_params.begin();
+ for (; it != parameters_permissions_.undefined_params.end(); ++it) {
+ AddDissalowedParameterToInfoString(info, (*it));
+ }
+
+ if (!info.empty()) {
+ info += " disallowed by policies.";
+
+ if (!response[strings::msg_params][strings::info].asString().empty()) {
+ // If we already have info add info about disallowed params to it
+ response[strings::msg_params][strings::info] =
+ response[strings::msg_params][strings::info].asString() + " " + info;
+ } else {
+ response[strings::msg_params][strings::info] = info;
+ }
+ }
+}
+
+void CommandRequestImpl::AddDisallowedParameters(
+ smart_objects::SmartObject& response) {
+ DisallowedParamsInserter disallowed_inserter(
+ response,
+ mobile_apis::VehicleDataResultCode::VDRC_USER_DISALLOWED);
+ std::for_each(parameters_permissions_.disallowed_params.begin(),
+ parameters_permissions_.disallowed_params.end(),
+ disallowed_inserter);
+
+ DisallowedParamsInserter undefined_inserter(
+ response,
+ mobile_apis::VehicleDataResultCode::VDRC_DISALLOWED);
+ std::for_each(parameters_permissions_.undefined_params.begin(),
+ parameters_permissions_.undefined_params.end(),
+ undefined_inserter);
+}
+
+bool CommandRequestImpl::HasDisallowedParams() const {
+ return ((!parameters_permissions_.disallowed_params.empty()) ||
+ (!parameters_permissions_.undefined_params.empty()));
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/command_response_impl.cc b/src/components/application_manager/src/commands/command_response_impl.cc
new file mode 100644
index 0000000000..d7bd9133bf
--- /dev/null
+++ b/src/components/application_manager/src/commands/command_response_impl.cc
@@ -0,0 +1,88 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CommandResponseImpl::CommandResponseImpl(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+}
+
+CommandResponseImpl::~CommandResponseImpl() {
+}
+
+bool CommandResponseImpl::Init() {
+ return true;
+}
+
+bool CommandResponseImpl::CleanUp() {
+ return true;
+}
+
+void CommandResponseImpl::Run() {
+}
+
+void CommandResponseImpl::SendResponse(
+ bool success, const mobile_apis::Result::eType& result_code, bool final_message) {
+ LOG4CXX_INFO(logger_, "Trying to send response");
+
+ (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ (*message_)[strings::msg_params][strings::success] = success;
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::result_code)) {
+ if (mobile_apis::Result::INVALID_ENUM != result_code) {
+ (*message_)[strings::msg_params][strings::result_code] = result_code;
+ } else if ((*message_)[strings::params].keyExists(hmi_response::code)) {
+ (*message_)[strings::msg_params][strings::result_code] =
+ (*message_)[strings::params][hmi_response::code];
+ } else {
+ if (success) {
+ (*message_)[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+ } else {
+ (*message_)[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::INVALID_ENUM;
+ }
+ }
+ }
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_, final_message);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
new file mode 100644
index 0000000000..a1b17f5229
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/activate_app_request.cc
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/activate_app_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+ namespace commands {
+
+ ActivateAppRequest::ActivateAppRequest(
+ const MessageSharedPtr& message): RequestToHMI(message) {
+ }
+
+
+ ActivateAppRequest::~ActivateAppRequest() {
+ LOG4CXX_TRACE(logger_, "~ActivateAppRequest");
+ }
+
+ void ActivateAppRequest::Run() {
+ LOG4CXX_TRACE(logger_, "enter " << correlation_id());
+ uint32_t app_id = RequestToHMI::application_id();
+ ApplicationManagerImpl::instance()->set_application_id(correlation_id(), app_id);
+#ifdef ENABLE_LOG
+ mobile_apis::HMILevel::eType requested_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::activate_app_hmi_level].asInt());
+ LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level);
+#endif
+ SendRequest();
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ correlation_id());
+ LOG4CXX_TRACE(logger_, "exit");
+ }
+
+
+ void ActivateAppRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ const smart_objects::SmartObject* response = &(event.smart_object());
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*response)[strings::params][hmi_response::code].asInt());
+ if (hmi_apis::Common_Result::SUCCESS != code) {
+ LOG4CXX_ERROR(logger_, "Error ActivateApp result code " << code);
+ return;
+ }
+ int32_t correlation_id = RequestToHMI::correlation_id();
+ // Mobile id is converted to HMI id for HMI requests
+ const uint32_t hmi_app_id = ApplicationManagerImpl::instance()->
+ application_id(correlation_id);
+ mobile_apis::HMILevel::eType requested_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::activate_app_hmi_level].asInt());
+ if (0 == hmi_app_id) {
+ LOG4CXX_ERROR(logger_, "Error hmi_app_id = "<< hmi_app_id);
+ return;
+ }
+
+ ApplicationSharedPtr application = ApplicationManagerImpl::instance()->
+ application_by_hmi_app(hmi_app_id);
+ if (!application.valid()) {
+ LOG4CXX_ERROR(logger_, "Application can't be activated.");
+ return;
+ }
+ if (mobile_apis::HMILevel::HMI_FULL == requested_hmi_level) {
+ ApplicationManagerImpl::instance()->ActivateApplication(application);
+ MessageHelper::SendHMIStatusNotification(*(application.get()));
+ }
+ }
+ } // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/src/commands/hmi/activate_app_response.cc
new file mode 100644
index 0000000000..aba5886097
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/activate_app_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/activate_app_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ActivateAppResponse::ActivateAppResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+ActivateAppResponse::~ActivateAppResponse() {
+}
+
+void ActivateAppResponse::Run() {
+ LOG4CXX_TRACE(logger_, "enter");
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ event.set_smart_object(*message_);
+ event.raise();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc
new file mode 100644
index 0000000000..c11621045e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/add_statistics_info_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AddStatisticsInfoNotification::AddStatisticsInfoNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {
+}
+
+void AddStatisticsInfoNotification::Run() {
+ LOG4CXX_INFO(logger_, "AddStatisticsInfoNotification::Run");
+
+ int type = (*message_)[strings::msg_params][hmi_notification::statistic_type]
+ .asInt();
+
+ policy::PolicyHandler::instance()->AddStatisticsInfo(type);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc
new file mode 100644
index 0000000000..6ac42c7a00
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/allow_all_apps_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AllowAllAppsRequest::AllowAllAppsRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+AllowAllAppsRequest::~AllowAllAppsRequest() {
+}
+
+void AllowAllAppsRequest::Run() {
+ LOG4CXX_INFO(logger_, "AllowAllAppsRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc
new file mode 100644
index 0000000000..69c52a3269
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/allow_all_apps_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AllowAllAppsResponse::AllowAllAppsResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+AllowAllAppsResponse::~AllowAllAppsResponse() {
+}
+
+void AllowAllAppsResponse::Run() {
+ LOG4CXX_INFO(logger_, "AllowAllAppsResponse::Run");
+
+ ApplicationManagerImpl::instance()->set_all_apps_allowed(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/src/commands/hmi/allow_app_request.cc
new file mode 100644
index 0000000000..302a8c6766
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/allow_app_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/allow_app_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AllowAppRequest::AllowAppRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+AllowAppRequest::~AllowAppRequest() {
+}
+
+void AllowAppRequest::Run() {
+ LOG4CXX_INFO(logger_, "AllowAppRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/src/commands/hmi/allow_app_response.cc
new file mode 100644
index 0000000000..035e41438d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/allow_app_response.cc
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/allow_app_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AllowAppResponse::AllowAppResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+AllowAppResponse::~AllowAppResponse() {
+}
+
+void AllowAppResponse::Run() {
+ LOG4CXX_INFO(logger_, "AllowAppResponse::Run");
+
+ uint32_t connection_key =
+ (*message_)[strings::params][strings::connection_key].asInt();
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->
+ application(connection_key);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ app->set_app_allowed((*message_)[strings::msg_params][hmi_response::allowed].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc
new file mode 100644
index 0000000000..0d2bcca4f4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/basic_communication_system_request.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+BasicCommunicationSystemRequest::BasicCommunicationSystemRequest(
+ const MessageSharedPtr& message): RequestToHMI(message) {
+}
+
+BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {
+}
+
+void BasicCommunicationSystemRequest::Run() {
+ LOG4CXX_INFO(logger_, "BasicCommunicationSystemRequest::Run");
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc
new file mode 100644
index 0000000000..dd9f657adc
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/basic_communication_system_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+BasicCommunicationSystemResponse::BasicCommunicationSystemResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {
+}
+
+void BasicCommunicationSystemResponse::Run() {
+ LOG4CXX_INFO(logger_, "BasicCommunicationSystemResponse::Run");
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_SystemRequest);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc
new file mode 100644
index 0000000000..e00b3fdc5a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/button_get_capabilities_request.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {
+}
+
+void ButtonGetCapabilitiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "ButtonGetCapabilitiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc
new file mode 100644
index 0000000000..0b67234743
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/button_get_capabilities_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {
+}
+
+void ButtonGetCapabilitiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "ButtonGetCapabilitiesResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_button_capabilities(
+ (*message_)[strings::msg_params][hmi_response::capabilities]);
+
+ hmi_capabilities.set_preset_bank_capabilities(
+ (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
new file mode 100644
index 0000000000..3cc5818688
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/close_popup_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/close_popup_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ClosePopupRequest::ClosePopupRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+ClosePopupRequest::~ClosePopupRequest() {
+}
+
+void ClosePopupRequest::Run() {
+ LOG4CXX_INFO(logger_, "ClosePopupRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/src/commands/hmi/close_popup_response.cc
new file mode 100644
index 0000000000..fa98be5e02
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/close_popup_response.cc
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/close_popup_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ClosePopupResponse::ClosePopupResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+ClosePopupResponse::~ClosePopupResponse() {
+}
+
+void ClosePopupResponse::Run() {
+ LOG4CXX_INFO(logger_, "ClosePopupResponse::Run");
+
+ // TODO(VS): Process response from HMI
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/src/commands/hmi/get_system_info_request.cc
new file mode 100644
index 0000000000..53a084d23e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/get_system_info_request.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/get_system_info_request.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetSystemInfoRequest::GetSystemInfoRequest(
+ const MessageSharedPtr& message): RequestToHMI(message) {
+}
+
+GetSystemInfoRequest::~GetSystemInfoRequest() {
+}
+
+void GetSystemInfoRequest::Run() {
+ LOG4CXX_INFO(logger_, "GetSystemInfoRequest::Run");
+ uint32_t correlation_id = RequestToHMI::correlation_id();
+ uint32_t app_id = RequestToHMI::application_id();
+ ApplicationManagerImpl::instance()->set_application_id(correlation_id, app_id);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc
new file mode 100644
index 0000000000..090b04c3e3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/get_system_info_response.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetSystemInfoResponse::GetSystemInfoResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+GetSystemInfoResponse::~GetSystemInfoResponse() {
+}
+
+void GetSystemInfoResponse::Run() {
+ LOG4CXX_INFO(logger_, "GetSystemInfoResponse::Run");
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS != code) {
+ LOG4CXX_WARN(logger_, "GetSystemError returns an error code " << code);
+ return;
+ }
+ const std::string ccpu_version =
+ (*message_)[strings::msg_params]["ccpu_version"].asString();
+ const std::string wers_country_code =
+ (*message_)[strings::msg_params]["wersCountryCode"].asString();
+ uint32_t lang_code = (*message_)[strings::msg_params]["language"].asUInt();
+ const std::string language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ policy::PolicyHandler::instance()->OnGetSystemInfo(ccpu_version,
+ wers_country_code,
+ language);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc
new file mode 100644
index 0000000000..b3d0f60610
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/get_urls.cc
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/get_urls.h"
+#include "application_manager/message.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+namespace commands {
+
+GetUrls::GetUrls(const MessageSharedPtr& message)
+ : RequestFromHMI(message) {
+}
+
+GetUrls::~GetUrls() {
+}
+
+void GetUrls::Run() {
+ LOG4CXX_INFO(logger_, "GetUrls::Run");
+ smart_objects::SmartObject& object = *message_;
+ object[strings::params][strings::message_type] = MessageType::kResponse;
+ if (policy::PolicyHandler::instance()->PolicyEnabled()) {
+ policy::EndpointUrls endpoints =
+ policy::PolicyHandler::instance()->GetUpdateUrls(
+ object[strings::msg_params][hmi_request::service].asInt());
+ object[strings::msg_params].erase(hmi_request::service);
+ object[strings::msg_params][hmi_response::urls] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < endpoints.size(); ++i) {
+ std::string url = endpoints[i].url.empty() ? "" : endpoints[i].url[0];
+ object[strings::msg_params][hmi_response::urls][i][strings::url] = url;
+ if (policy::kDefaultId != endpoints[i].app_id) {
+ object[strings::msg_params][hmi_response::urls][i][hmi_response::policy_app_id] =
+ endpoints[i].app_id;
+ }
+ }
+ object[strings::params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ } else {
+ object[strings::params][hmi_response::code] = hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
+ }
+ ApplicationManagerImpl::instance()->ManageHMICommand(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/src/commands/hmi/get_urls_response.cc
new file mode 100644
index 0000000000..f8086affe3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/get_urls_response.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/get_urls_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+namespace commands {
+
+GetUrlsResponse::GetUrlsResponse(
+ const MessageSharedPtr& message): ResponseToHMI(message) {
+}
+
+GetUrlsResponse::~GetUrlsResponse() {
+}
+
+void GetUrlsResponse::Run() {
+ LOG4CXX_INFO(logger_, "GetUrlsResponse::Run");
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc
new file mode 100644
index 0000000000..9ab4bf5dbb
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+MixingAudioSupportedRequest::MixingAudioSupportedRequest(
+ const MessageSharedPtr& message) : RequestToHMI(message) {
+}
+
+MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {
+}
+
+void MixingAudioSupportedRequest::Run() {
+ LOG4CXX_INFO(logger_, "MixingAudioSupportedRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc
new file mode 100644
index 0000000000..4a4fc276de
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+MixingAudioSupportedResponse::MixingAudioSupportedResponse(
+ const MessageSharedPtr& message) : ResponseFromHMI(message) {
+}
+
+MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {
+}
+
+void MixingAudioSupportedResponse::Run() {
+ LOG4CXX_INFO(logger_, "MixingAudioSupportedResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_attenuated_supported((*message_)
+ [strings::msg_params][hmi_response::attenuated_supported].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc
new file mode 100644
index 0000000000..7128231b11
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviAlertManeuverRequest::NaviAlertManeuverRequest(
+ const MessageSharedPtr& message) : RequestToHMI(message) {
+}
+
+NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {
+}
+
+void NaviAlertManeuverRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviAlertManeuverRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc
new file mode 100644
index 0000000000..823c96211e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviAlertManeuverResponse::NaviAlertManeuverResponse(
+ const MessageSharedPtr& message) : ResponseFromHMI(message) {
+}
+
+NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {
+}
+
+void NaviAlertManeuverResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviAlertManeuverResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
new file mode 100644
index 0000000000..3c7a7d3ab5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AudioStartStreamRequest::AudioStartStreamRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+AudioStartStreamRequest::~AudioStartStreamRequest() {
+}
+
+void AudioStartStreamRequest::Run() {
+ LOG4CXX_INFO(logger_, "AudioStartStreamRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
new file mode 100644
index 0000000000..e4cc8f4cc6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AudioStartStreamResponse::AudioStartStreamResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+AudioStartStreamResponse::~AudioStartStreamResponse() {
+}
+
+void AudioStartStreamResponse::Run() {
+ LOG4CXX_INFO(logger_, "AudioStartStreamResponse::Run");
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->active_application();
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "NaviStartStreamResponse no active app!");
+ return;
+ }
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ LOG4CXX_INFO(logger_, "AudioStartStreamResponse SUCCESS");
+ app->set_hmi_supports_navi_audio_streaming(true);
+ } else {
+ LOG4CXX_INFO(logger_, "AudioStartStreamResponse NOT SUCCESS");
+ app->set_hmi_supports_navi_audio_streaming(false);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
new file mode 100644
index 0000000000..4052769d53
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AudioStopStreamRequest::AudioStopStreamRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+AudioStopStreamRequest::~AudioStopStreamRequest() {
+}
+
+void AudioStopStreamRequest::Run() {
+ LOG4CXX_INFO(logger_, "AudioStopStreamRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc
new file mode 100644
index 0000000000..81a6c62e8d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AudioStopStreamResponse::AudioStopStreamResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+AudioStopStreamResponse::~AudioStopStreamResponse() {
+}
+
+void AudioStopStreamResponse::Run() {
+ LOG4CXX_INFO(logger_, "AudioStopStreamResponse::Run");
+
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
new file mode 100644
index 0000000000..b7a1799427
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviIsReadyRequest::NaviIsReadyRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+NaviIsReadyRequest::~NaviIsReadyRequest() {
+}
+
+void NaviIsReadyRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviIsReadyRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
new file mode 100644
index 0000000000..8aef42b40d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_is_ready_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviIsReadyResponse::NaviIsReadyResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+NaviIsReadyResponse::~NaviIsReadyResponse() {
+}
+
+void NaviIsReadyResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviIsReadyResponse::Run");
+ smart_objects::SmartObject& object = *message_;
+
+ bool is_available = false;
+ if (object[strings::msg_params].keyExists(strings::available)) {
+ is_available = object[strings::msg_params][strings::available].asBool();
+ }
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_is_navi_cooperating(is_available);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc
new file mode 100644
index 0000000000..f396a24323
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_send_location_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviSendLocationRequest::NaviSendLocationRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+NaviSendLocationRequest::~NaviSendLocationRequest() {
+}
+
+void NaviSendLocationRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviSendLocationRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc
new file mode 100644
index 0000000000..944ced170c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_send_location_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviSendLocationResponse::NaviSendLocationResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+NaviSendLocationResponse::~NaviSendLocationResponse() {
+}
+
+void NaviSendLocationResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviSendLocationResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc
new file mode 100644
index 0000000000..9103e1f6c4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviShowConstantTBTRequest::NaviShowConstantTBTRequest(
+ const MessageSharedPtr& message) : RequestToHMI(message) {
+}
+
+NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {
+}
+
+void NaviShowConstantTBTRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviShowConstantTBTRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc
new file mode 100644
index 0000000000..03c70dd81b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviShowConstantTBTResponse::NaviShowConstantTBTResponse(
+ const MessageSharedPtr& message) : ResponseFromHMI(message) {
+}
+
+NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {
+}
+
+void NaviShowConstantTBTResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviShowConstantTBTResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
new file mode 100644
index 0000000000..cb9dbd61e3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_start_stream_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviStartStreamRequest::NaviStartStreamRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+NaviStartStreamRequest::~NaviStartStreamRequest() {
+}
+
+void NaviStartStreamRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviStartStreamRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc
new file mode 100644
index 0000000000..79d51dcb66
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_start_stream_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviStartStreamResponse::NaviStartStreamResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+NaviStartStreamResponse::~NaviStartStreamResponse() {
+}
+
+void NaviStartStreamResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviStartStreamResponse::Run");
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->active_application();
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "NaviStartStreamResponse no active app!");
+ return;
+ }
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS");
+ app->set_hmi_supports_navi_video_streaming(true);
+ } else {
+ LOG4CXX_INFO(logger_, "NaviStartStreamResponse NOT SUCCESS");
+ app->set_hmi_supports_navi_video_streaming(false);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
new file mode 100644
index 0000000000..2f1e14a122
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc
@@ -0,0 +1,23 @@
+#include "application_manager/commands/hmi/navi_stop_stream_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviStopStreamRequest::NaviStopStreamRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+NaviStopStreamRequest::~NaviStopStreamRequest() {
+}
+
+void NaviStopStreamRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviStopStreamRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc
new file mode 100644
index 0000000000..c368940d5b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_stop_stream_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviStopStreamResponse::NaviStopStreamResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+NaviStopStreamResponse::~NaviStopStreamResponse() {
+}
+
+void NaviStopStreamResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviStopStreamResponse::Run");
+
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc
new file mode 100644
index 0000000000..d0df9ec867
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviUpdateTurnListRequest::NaviUpdateTurnListRequest(
+ const MessageSharedPtr& message) : RequestToHMI(message) {
+}
+
+NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {
+}
+
+void NaviUpdateTurnListRequest::Run() {
+ LOG4CXX_INFO(logger_, "NaviUpdateTurnListRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc
new file mode 100644
index 0000000000..d93b67bb52
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviUpdateTurnListResponse::NaviUpdateTurnListResponse(
+ const MessageSharedPtr& message) : ResponseFromHMI(message) {
+}
+
+NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {
+}
+
+void NaviUpdateTurnListResponse::Run() {
+ LOG4CXX_INFO(logger_, "NaviUpdateTurnListResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
new file mode 100644
index 0000000000..2b7ec13c43
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc
@@ -0,0 +1,103 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NotificationFromHMI::NotificationFromHMI(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+
+ // Replace HMI app id with Mobile connection id
+ ApplicationManagerImpl::instance()->ReplaceHMIByMobileAppId(*(message.get()));
+}
+
+NotificationFromHMI::~NotificationFromHMI() {
+}
+
+bool NotificationFromHMI::Init() {
+ return true;
+}
+
+bool NotificationFromHMI::CleanUp() {
+ return true;
+}
+
+void NotificationFromHMI::Run() {
+}
+
+void NotificationFromHMI::SendNotificationToMobile(
+ const MessageSharedPtr& message) {
+ ApplicationManagerImpl::instance()->ManageMobileCommand(message);
+}
+
+void NotificationFromHMI::CreateHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const NsSmartObj::SmartObject& msg_params) const {
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ // get hmi correlation id for chaining further request from this object
+ const uint32_t hmi_correlation_id_ = ApplicationManagerImpl::instance()
+ ->GetNextHMICorrelationID();
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kRequest);
+ request[strings::params][strings::function_id] =
+ static_cast<int32_t>(function_id);
+ request[strings::params][strings::correlation_id] = hmi_correlation_id_;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ request[strings::msg_params] = msg_params;
+
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
new file mode 100644
index 0000000000..e4f8920ec9
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
@@ -0,0 +1,69 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NotificationToHMI::NotificationToHMI(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+
+ // Replace Mobile connection id with HMI app id
+ ApplicationManagerImpl::instance()->ReplaceMobileByHMIAppId(*(message.get()));
+}
+
+NotificationToHMI::~NotificationToHMI() {
+}
+
+bool NotificationToHMI::Init() {
+ return true;
+}
+
+bool NotificationToHMI::CleanUp() {
+ return true;
+}
+
+void NotificationToHMI::Run() {
+}
+
+void NotificationToHMI::SendNotification() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc
new file mode 100644
index 0000000000..020428d6c0
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {
+}
+
+void OnAllowSDLFunctionalityNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAllowSDLFunctionalityNotification::Run");
+ uint32_t device_id = 0;
+ if ((*message_)[strings::msg_params].keyExists("device")) {
+ device_id = (*message_)[strings::msg_params]["device"]["id"].asUInt();
+ }
+ policy::PolicyHandler::instance()->OnAllowSDLFunctionalityNotification(
+ (*message_)[strings::msg_params][hmi_response::allowed].asBool(),
+ device_id);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc
new file mode 100644
index 0000000000..8152244a9c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_app_activated_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAppActivatedNotification::OnAppActivatedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnAppActivatedNotification::~OnAppActivatedNotification() {
+}
+
+void OnAppActivatedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppActivatedNotification::Run");
+ uint32_t app_id = ((*message_)[strings::msg_params][strings::app_id]).asUInt();
+ MessageHelper::SendActivateAppToHMI(app_id);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc
new file mode 100644
index 0000000000..152546b24b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc
@@ -0,0 +1,140 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "config_profile/profile.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAppDeactivatedNotification::OnAppDeactivatedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {
+}
+
+void OnAppDeactivatedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppDeactivatedNotification::Run");
+ uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt();
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(app_id);
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "Application not found, id="<<app_id);
+ return;
+ }
+
+ if (!(((hmi_apis::Common_DeactivateReason::AUDIO ==
+ (*message_)[strings::msg_params][hmi_request::reason].asInt()) ||
+ (hmi_apis::Common_DeactivateReason::PHONECALL ==
+ (*message_)[strings::msg_params][hmi_request::reason].asInt())) &&
+ (app->hmi_level() == mobile_api::HMILevel::eType::HMI_LIMITED))) {
+ app = ApplicationManagerImpl::instance()->active_application();
+ if (!app.valid()) {
+ LOG4CXX_ERROR_EXT(logger_, "OnAppDeactivatedNotification no active app!");
+ return;
+ }
+ if (app_id != app->app_id()) {
+ LOG4CXX_ERROR_EXT(logger_, "Wrong application id!");
+ return;
+ }
+ }
+
+ if (mobile_api::HMILevel::eType::HMI_NONE == app->hmi_level()) {
+ return;
+ }
+
+ switch ((*message_)[strings::msg_params][hmi_request::reason].asInt()) {
+ case hmi_apis::Common_DeactivateReason::AUDIO: {
+ if (app->is_media_application()) {
+ if (profile::Profile::instance()->is_mixing_audio_supported() &&
+ (ApplicationManagerImpl::instance()->vr_session_started() ||
+ app->tts_speak_state())) {
+ app->set_audio_streaming_state(mobile_api::AudioStreamingState::ATTENUATED);
+ } else {
+ app->set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
+ }
+ }
+ // switch HMI level for all applications in FULL or LIMITED
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationManagerImpl::TAppList applications =
+ accessor.applications();
+ ApplicationManagerImpl::TAppListIt it =
+ applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (app.valid()) {
+ if (mobile_apis::HMILevel::eType::HMI_FULL == app->hmi_level() ||
+ mobile_apis::HMILevel::eType::HMI_LIMITED == app->hmi_level()) {
+ app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
+ MessageHelper::SendHMIStatusNotification(*app);
+ }
+ }
+ }
+ break;
+ }
+ case hmi_apis::Common_DeactivateReason::PHONECALL: {
+ app->set_audio_streaming_state(mobile_api::AudioStreamingState::NOT_AUDIBLE);
+ app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
+ break;
+ }
+ case hmi_apis::Common_DeactivateReason::NAVIGATIONMAP:
+ case hmi_apis::Common_DeactivateReason::PHONEMENU:
+ case hmi_apis::Common_DeactivateReason::SYNCSETTINGS:
+ case hmi_apis::Common_DeactivateReason::GENERAL: {
+ if (app->is_media_application()) {
+ if (mobile_api::HMILevel::HMI_FULL == app->hmi_level()) {
+ app->set_hmi_level(mobile_api::HMILevel::HMI_LIMITED);
+ }
+ } else {
+ app->set_hmi_level(mobile_api::HMILevel::HMI_BACKGROUND);
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR_EXT(logger_, "Unknown reason of app deactivation");
+ return;
+ }
+ }
+
+ MessageHelper::SendHMIStatusNotification(*app);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc
new file mode 100644
index 0000000000..26d580e83a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAppPermissionChangedNotification::OnAppPermissionChangedNotification(
+ const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {
+}
+
+void OnAppPermissionChangedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppPermissionChangedNotification::Run");
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc
new file mode 100644
index 0000000000..951a2ebdf1
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc
@@ -0,0 +1,92 @@
+
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAppPermissionConsentNotification::OnAppPermissionConsentNotification(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {
+}
+
+void OnAppPermissionConsentNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppPermissionConsentNotification::Run");
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ uint32_t connection_key = 0;
+
+ policy::PermissionConsent permission_consent;
+
+ // If user defined group permissions for specific app
+ if (msg_params.keyExists(strings::app_id)) {
+ connection_key = msg_params[strings::app_id].asUInt();
+ }
+
+ if (msg_params.keyExists("consentedFunctions")) {
+ smart_objects::SmartArray* user_consent =
+ msg_params["consentedFunctions"].asArray();
+
+ smart_objects::SmartArray::const_iterator it = user_consent->begin();
+ smart_objects::SmartArray::const_iterator it_end = user_consent->end();
+ for (; it != it_end; ++it) {
+ policy::FunctionalGroupPermission permissions;
+ permissions.group_id = (*it)["id"].asInt();
+ permissions.group_alias = (*it)["name"].asString();
+ if ((*it).keyExists("allowed")) {
+ permissions.state = (*it)["allowed"].asBool() ? policy::kGroupAllowed :
+ policy::kGroupDisallowed;
+ } else {
+ permissions.state = policy::kGroupUndefined;
+ }
+
+ permission_consent.group_permissions.push_back(permissions);
+ }
+
+ permission_consent.consent_source = msg_params["source"].asString();
+
+ policy::PolicyHandler::instance()->OnAppPermissionConsent(connection_key,
+ permission_consent);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc
new file mode 100644
index 0000000000..26bc396db6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_app_registered_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAppRegisteredNotification::OnAppRegisteredNotification(
+ const MessageSharedPtr& message) : NotificationToHMI(message) {
+}
+
+OnAppRegisteredNotification::~OnAppRegisteredNotification() {
+}
+
+void OnAppRegisteredNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppRegisteredNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
new file mode 100644
index 0000000000..2bedcb0631
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAppUnregisteredNotification::OnAppUnregisteredNotification(
+ const MessageSharedPtr& message) : NotificationToHMI(message) {
+}
+
+OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {
+}
+
+void OnAppUnregisteredNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppUnregisteredNotification::Run");
+
+ //sending event for delete VRCommand on PerformInteraction
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered);
+ event.set_smart_object(*message_);
+ event.raise();
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc
new file mode 100644
index 0000000000..23aceaa7d6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_button_event_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonEventNotification::OnButtonEventNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+void OnButtonEventNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnButtonEventNotification::Run");
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc
new file mode 100644
index 0000000000..83bcbd7efa
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_button_press_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/logger.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnButtonPressNotification::OnButtonPressNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+void OnButtonPressNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnButtonPressNotification::Run");
+ event_engine::Event event(hmi_apis::FunctionID::Buttons_OnButtonPress);
+ event.set_smart_object(*message_);
+ event.raise();
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID);
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc
new file mode 100644
index 0000000000..537c246f42
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_device_chosen_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnDeviceChosenNotification::OnDeviceChosenNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnDeviceChosenNotification::~OnDeviceChosenNotification() {
+}
+
+void OnDeviceChosenNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnDeviceChosenNotification::Run");
+
+ if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
+ ApplicationManagerImpl::instance()->ConnectToDevice(
+ (*message_)[strings::msg_params][strings::device_info][strings::id]
+ .asInt());
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc
new file mode 100644
index 0000000000..8af2571b55
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnDeviceStateChangedNotification::OnDeviceStateChangedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {
+}
+
+void OnDeviceStateChangedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnDeviceStateChangedNotification::Run");
+
+ if ((*message_)[strings::msg_params]["deviceState"]
+ == hmi_apis::Common_DeviceState::UNPAIRED) {
+ std::string device_id = (*message_)[strings::msg_params]["deviceInternalId"]
+ .asString();
+ if (device_id.empty()) {
+ if ((*message_)[strings::msg_params].keyExists("deviceId")) {
+ device_id = MessageHelper::GetDeviceMacAddressForHandle(
+ (*message_)[strings::msg_params]["deviceId"]["id"].asInt());
+ }
+ }
+ policy::PolicyHandler::instance()->RemoveDevice(device_id);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc
new file mode 100644
index 0000000000..d5a8edc48d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <set>
+#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnDriverDistractionNotification::OnDriverDistractionNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnDriverDistractionNotification::~OnDriverDistractionNotification() {
+}
+
+void OnDriverDistractionNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnDriverDistractionNotification::Run");
+
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ static_cast<hmi_apis::Common_DriverDistractionState::eType>(
+ (*message_)[strings::msg_params][hmi_notification::state]
+ .asInt());
+ ApplicationManagerImpl::instance()->set_driver_distraction(state);
+
+ MessageSharedPtr on_driver_distraction =
+ new smart_objects::SmartObject();
+
+ if (false == on_driver_distraction.valid()) {
+ LOG4CXX_ERROR_EXT(logger_, "NULL pointer");
+ return;
+ }
+
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ state;
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+
+ std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (app.valid()) {
+ if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
+ (*on_driver_distraction)[strings::params]
+ [strings::connection_key] = app->app_id();
+ SendNotificationToMobile(on_driver_distraction);
+ }
+ }
+ }
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
new file mode 100644
index 0000000000..3d027ff1c6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+#include "utils/signals.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnExitAllApplicationsNotification::OnExitAllApplicationsNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {
+}
+
+void OnExitAllApplicationsNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnExitAllApplicationsNotification::Run");
+
+ const hmi_apis::Common_ApplicationsCloseReason::eType reason =
+ static_cast<hmi_apis::Common_ApplicationsCloseReason::eType>(
+ (*message_)[strings::msg_params][hmi_request::reason].asInt());
+
+ mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
+ mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM;
+
+ ApplicationManagerImpl* app_manager = ApplicationManagerImpl::instance();
+
+ switch (reason) {
+ case hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS: {
+ mob_reason = mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS;
+ break;
+ }
+ case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
+ app_manager->HeadUnitSuspend();
+ SendOnSDLPersistenceComplete();
+ return;
+ }
+ default : {
+ LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason);
+ return;
+ }
+ }
+
+ app_manager->SetUnregisterAllApplicationsReason(mob_reason);
+
+ if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason ||
+ mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS == mob_reason) {
+ app_manager->HeadUnitReset(mob_reason);
+ }
+
+ threads::Thread::InterruptMainThread();
+}
+
+void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
+ LOG4CXX_INFO(logger_, ""
+ "OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete");
+
+ smart_objects::SmartObject* message =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
+ (*message)[strings::params][strings::message_type] = MessageType::kNotification;
+ (*message)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
new file mode 100644
index 0000000000..f4aed61392
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_exit_application_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnExitApplicationNotification::OnExitApplicationNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnExitApplicationNotification::~OnExitApplicationNotification() {
+}
+
+void OnExitApplicationNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnExitApplicationNotification::Run");
+
+ ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
+ ApplicationSharedPtr app_impl = app_mgr->application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+ if (!(app_impl.valid())) {
+ LOG4CXX_ERROR(logger_, "Application does not exist");
+ return;
+ }
+ hmi_apis::Common_ApplicationToNONEReason::eType reason;
+ reason = static_cast<hmi_apis::Common_ApplicationToNONEReason::eType>
+ ((*message_)[strings::msg_params][strings::reason].asInt());
+ switch (reason) {
+ case hmi_apis::Common_ApplicationToNONEReason::USER_EXIT : {
+ break;
+ }
+ default : {
+ LOG4CXX_WARN(logger_, "Unhandled reason");
+ break;
+ }
+ }
+ app_impl->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
+ app_impl->set_audio_streaming_state(mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+ app_impl->set_system_context(mobile_api::SystemContext::SYSCTXT_MAIN);
+ MessageHelper::SendHMIStatusNotification(*app_impl);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc
new file mode 100644
index 0000000000..f1a590ee04
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_file_removed_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnFileRemovedNotification::OnFileRemovedNotification(
+ const MessageSharedPtr& message) : NotificationToHMI(message) {
+}
+
+OnFileRemovedNotification::~OnFileRemovedNotification() {
+}
+
+void OnFileRemovedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnFileRemovedNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/src/commands/hmi/on_find_applications.cc
new file mode 100644
index 0000000000..bc32ab1cf0
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_find_applications.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_find_applications.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnFindApplications::OnFindApplications(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnFindApplications::~OnFindApplications() {
+}
+
+void OnFindApplications::Run() {
+ LOG4CXX_INFO(logger_, "OnFindApplications::Run");
+
+ // TODO(PV): add UpdateAppsOnDevice to ApplicationManager
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc
new file mode 100644
index 0000000000..523013734f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {
+}
+
+void OnIgnitionCycleOverNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnIgnitionCycleOverNotification::Run");
+ policy::PolicyHandler::instance()->OnIgnitionCycleOver();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc
new file mode 100644
index 0000000000..a68ae90796
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {
+}
+
+void OnNaviTBTClientStateNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnNaviTBTClientStateNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc b/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc
new file mode 100644
index 0000000000..e05b38d456
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_play_tone_notification.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_play_tone_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnPlayToneNotification::OnPlayToneNotification(const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnPlayToneNotification::~OnPlayToneNotification() {
+}
+
+void OnPlayToneNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnPlayToneNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_policy_update.cc
new file mode 100644
index 0000000000..b3f5803d44
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_policy_update.cc
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_policy_update.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+namespace commands {
+
+OnPolicyUpdate::OnPolicyUpdate(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnPolicyUpdate::~OnPolicyUpdate() {
+}
+
+void OnPolicyUpdate::Run() {
+ LOG4CXX_INFO(logger_, "OnPolicyUpdate::Run");
+ policy::PolicyHandler::instance()->OnPTExchangeNeeded();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc
new file mode 100644
index 0000000000..2fecbec9c7
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_put_file_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnPutFileNotification::OnPutFileNotification(
+ const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnPutFileNotification::~OnPutFileNotification() {
+}
+
+void OnPutFileNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnPutFileNotification::Run");
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
new file mode 100644
index 0000000000..783aa4af40
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ready_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnReadyNotification::OnReadyNotification(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnReadyNotification::~OnReadyNotification() {
+}
+
+void OnReadyNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnReadyNotification::Run");
+
+ ApplicationManagerImpl::instance()->OnHMIStartedCooperation();
+ event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
new file mode 100644
index 0000000000..1e517f35de
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "application_manager/commands/hmi/on_received_policy_update.h"
+#include "application_manager/policies/policy_handler.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnReceivedPolicyUpdate::OnReceivedPolicyUpdate(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {
+}
+
+void OnReceivedPolicyUpdate::Run() {
+ LOG4CXX_INFO(logger_, "OnReceivedPolicyUpdate::Run");
+ const std::string& file_path =
+ (*message_)[strings::msg_params][hmi_notification::policyfile].asString();
+ policy::BinaryMessage file_content;
+ if (!file_system::ReadBinaryFile(file_path, file_content)) {
+ LOG4CXX_ERROR(logger_, "Failed to read Update file.");
+ return;
+ }
+ policy::PolicyHandler::instance()->ReceiveMessageFromSDK(file_path, file_content);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc
new file mode 100644
index 0000000000..e0dae8f045
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_record_start_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnRecordStartdNotification::OnRecordStartdNotification(
+ const MessageSharedPtr& message) : NotificationToHMI(message) {
+}
+
+OnRecordStartdNotification::~OnRecordStartdNotification() {
+}
+
+void OnRecordStartdNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnRecordStartdNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc
new file mode 100644
index 0000000000..70868b826f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnResumeAudioSourceNotification::OnResumeAudioSourceNotification(
+ const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {
+}
+
+void OnResumeAudioSourceNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnResumeAudioSourceNotification::Run");
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc
new file mode 100644
index 0000000000..70240b4bf6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_sdl_close_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnSDLCloseNotification::OnSDLCloseNotification(
+ const MessageSharedPtr& message) : NotificationToHMI(message) {
+}
+
+OnSDLCloseNotification::~OnSDLCloseNotification() {
+}
+
+void OnSDLCloseNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSdlCloseNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc
new file mode 100644
index 0000000000..1fda4986e4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc
@@ -0,0 +1,56 @@
+
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnSDLConsentNeededNotification::OnSDLConsentNeededNotification(
+ const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {
+}
+
+void OnSDLConsentNeededNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSDLConsentNeededNotification::Run");
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc
new file mode 100644
index 0000000000..d71413ef85
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification(
+ const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {
+}
+
+void OnSDLPersistenceCompleteNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSDLpersistenceCompleteNotification::Run");
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc
new file mode 100644
index 0000000000..fc5ffed42c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_start_device_discovery.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnStartDeviceDiscovery::OnStartDeviceDiscovery(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {
+}
+
+void OnStartDeviceDiscovery::Run() {
+ LOG4CXX_INFO(logger_, "OnStartDeviceDiscovery::Run");
+
+ ApplicationManagerImpl::instance()->StartDevicesDiscovery();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc
new file mode 100644
index 0000000000..6e4e65987e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_status_update_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnStatusUpdateNotification::OnStatusUpdateNotification(
+ const MessageSharedPtr& message)
+ : NotificationToHMI(message) {
+}
+
+OnStatusUpdateNotification::~OnStatusUpdateNotification() {
+}
+
+void OnStatusUpdateNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnGetStatusUpdateNotification::Run");
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc
new file mode 100644
index 0000000000..5a5c12b907
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc
@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_system_context_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+namespace commands {
+
+OnSystemContextNotification::OnSystemContextNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnSystemContextNotification::~OnSystemContextNotification() {
+}
+
+void OnSystemContextNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSystemContextNotification::Run");
+
+ mobile_api::SystemContext::eType system_context =
+ static_cast<mobile_api::SystemContext::eType>(
+ (*message_)[strings::msg_params][hmi_notification::system_context].asInt());
+
+ ApplicationSharedPtr app;
+
+ if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_MENU == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) {
+ app = ApplicationManagerImpl::instance()->active_application();
+ } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) ||
+ (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) {
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ app = ApplicationManagerImpl::instance()->
+ application((*message_)[strings::msg_params][strings::app_id].asUInt());
+ }
+ }
+
+ if (app.valid() && (system_context != app->system_context()) &&
+ (system_context != mobile_api::SystemContext::INVALID_ENUM)) {
+ SendSystemContextNotification(app, system_context);
+ } else {
+ LOG4CXX_ERROR(logger_, "Ignored wrong SystemContext notification!");
+ }
+}
+
+void OnSystemContextNotification::SendSystemContextNotification(ApplicationSharedPtr app,
+ mobile_api::SystemContext::eType system_context) {
+ app->set_system_context(system_context);
+ MessageHelper::SendHMIStatusNotification(*app);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc
new file mode 100644
index 0000000000..bac3d37359
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_system_error_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnSystemErrorNotification::OnSystemErrorNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnSystemErrorNotification::~OnSystemErrorNotification() {
+}
+
+void OnSystemErrorNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSystemErrorNotification::Run");
+
+ int code = (*message_)[strings::msg_params][hmi_notification::error]
+ .asInt();
+
+ policy::PolicyHandler::instance()->OnSystemError(code);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc
new file mode 100644
index 0000000000..ec8460d581
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnSystemInfoChangedNotification::OnSystemInfoChangedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {
+}
+
+void OnSystemInfoChangedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSystemInfoChangedNotification::Run");
+ uint32_t lang_code =
+ (*message_)[strings::msg_params][strings::language].asUInt();
+ const std::string language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+
+ policy::PolicyHandler::instance()->OnSystemInfoChanged(language);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
new file mode 100644
index 0000000000..e3d0ea511d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/commands/hmi/on_system_request_notification.h"
+#include "application_manager/policies/policy_handler.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+using policy::PolicyHandler;
+
+namespace application_manager {
+
+namespace commands {
+
+OnSystemRequestNotification::OnSystemRequestNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnSystemRequestNotification::~OnSystemRequestNotification() {
+}
+
+void OnSystemRequestNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSystemRequestNotification::Run");
+
+ smart_objects::SmartObject& params = (*message_)[strings::params];
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ params[strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID);
+
+ std::string app_id = msg_params[strings::app_id].asString();
+
+ if (strings::default_app_id == app_id) {
+ PolicyHandler* policy_handler = PolicyHandler::instance();
+ uint32_t selected_app_id = policy_handler->GetAppIdForSending();
+ if (0 == selected_app_id) {
+ LOG4CXX_WARN(logger_,
+ "Can't select application to forward OnSystemRequestNotification");
+ return;
+ }
+ ApplicationManagerImpl* app_mgr = ApplicationManagerImpl::instance();
+ ApplicationSharedPtr selected_app = app_mgr->application(selected_app_id);
+ if (!selected_app.valid()) {
+ LOG4CXX_ERROR(logger_, "PolicyHandler selected invalid app_id");
+ return;
+ }
+ params[strings::connection_key] = selected_app_id;
+ } else {
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application_by_policy_id(app_id);
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Application with such id is not yet registered.");
+ return;
+ }
+ params[strings::connection_key] = app->app_id();
+ }
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc
new file mode 100644
index 0000000000..60c0dca10a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {
+}
+
+void OnTTSLanguageChangeNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnTTSLanguageChangeNotification::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_active_tts_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ /* need to clarify, because unchanged VR
+ cause WRONG_LANGUAGE on Register */
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+
+ std::set<ApplicationSharedPtr>::iterator it = applications.begin();
+ for (;applications.end() != it; ++it) {
+ ApplicationSharedPtr app = (*it);
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+
+ if (static_cast<int>(app->language())
+ != (*message_)[strings::msg_params][strings::language].asInt()) {
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+ ApplicationManagerImpl::instance()->UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc
new file mode 100644
index 0000000000..047a5d985d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc
@@ -0,0 +1,31 @@
+#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {
+}
+
+void OnTTSResetTimeoutNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnTTSResetTimeoutNotification::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc
new file mode 100644
index 0000000000..519fc290d9
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_tts_started_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnTTSStartedNotification::OnTTSStartedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnTTSStartedNotification::~OnTTSStartedNotification() {
+}
+
+void OnTTSStartedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnTTSStartedNotification::Run");
+
+ ApplicationManagerImpl::instance()->Mute(kTTSSessionChanging);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc
new file mode 100644
index 0000000000..b3e3683f32
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnTTSStoppedNotification::OnTTSStoppedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnTTSStoppedNotification::~OnTTSStoppedNotification() {
+}
+
+void OnTTSStoppedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnTTSStoppedNotification::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Stopped);
+ event.set_smart_object(*message_);
+ event.raise();
+ ApplicationManagerImpl::instance()->Unmute(kTTSSessionChanging);
+
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc
new file mode 100644
index 0000000000..4ed5839e5f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ui_command_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnUICommandNotification::OnUICommandNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnUICommandNotification::~OnUICommandNotification() {
+}
+
+void OnUICommandNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnUICommandNotification::Run");
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
+
+ (*message_)[strings::msg_params][strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU);
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc
new file mode 100644
index 0000000000..45ff7425b7
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {
+}
+
+void OnUIKeyBoardInputNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnUIKeyBoardInputNotification::Run");
+
+ //prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnKeyboardInputID;
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc
new file mode 100644
index 0000000000..5756f50eb5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnUILanguageChangeNotification::OnUILanguageChangeNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {
+}
+
+void OnUILanguageChangeNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnUILanguageChangeNotification::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_active_ui_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ (*message_)[strings::msg_params][strings::language];
+
+ (*message_)[strings::msg_params][strings::language] =
+ hmi_capabilities.active_vr_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+
+ std::set<ApplicationSharedPtr>::iterator it = applications.begin();
+ for (;applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+
+ if (app->ui_language() != (*message_)[strings::msg_params]
+ [strings::hmi_display_language].asInt()) {
+
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+ ApplicationManagerImpl::instance()->UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc
new file mode 100644
index 0000000000..357bfc4cb3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnUIResetTimeoutNotification::OnUIResetTimeoutNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {
+}
+
+void OnUIResetTimeoutNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnUIResetTimeoutNotification::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc
new file mode 100644
index 0000000000..7868e81193
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+OnUITouchEventNotification::OnUITouchEventNotification(
+ const MessageSharedPtr& message) : NotificationFromHMI(message) {
+}
+
+OnUITouchEventNotification::~OnUITouchEventNotification() {
+}
+
+void OnUITouchEventNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnUITouchEventNotification::Run");
+
+ //prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnTouchEventID;
+ SendNotificationToMobile(message_);
+}
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/src/commands/hmi/on_update_device_list.cc
new file mode 100644
index 0000000000..a5b84748ef
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_update_device_list.cc
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/on_update_device_list.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnUpdateDeviceList::OnUpdateDeviceList(const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnUpdateDeviceList::~OnUpdateDeviceList() {
+}
+
+void OnUpdateDeviceList::Run() {
+ LOG4CXX_INFO(logger_, "OnUpdateDeviceList::Run");
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
new file mode 100644
index 0000000000..be0c4ebb60
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {
+}
+
+void OnVIAccPedalPositionNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIAccPedalPositionNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc
new file mode 100644
index 0000000000..688a5c1fb1
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIBeltStatusNotification::OnVIBeltStatusNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {
+}
+
+void OnVIBeltStatusNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIBeltStatusNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc
new file mode 100644
index 0000000000..e80a2edcf3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIBodyInformationNotification::OnVIBodyInformationNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {
+}
+
+void OnVIBodyInformationNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIBodyInformationNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc
new file mode 100644
index 0000000000..4669398da1
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIDeviceStatusNotification::OnVIDeviceStatusNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {
+}
+
+void OnVIDeviceStatusNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIDeviceStatusNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc
new file mode 100644
index 0000000000..8b61d0af21
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIDriverBrakingNotification::OnVIDriverBrakingNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {
+}
+
+void OnVIDriverBrakingNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIDriverBrakingNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc
new file mode 100644
index 0000000000..1b0989b1ec
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIEngineTorqueNotification::OnVIEngineTorqueNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {
+}
+
+void OnVIEngineTorqueNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIEngineTorqueNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc
new file mode 100644
index 0000000000..f7a9213598
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {
+}
+
+void OnVIExternalTemperatureNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIExternalTemperatureNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc
new file mode 100644
index 0000000000..97d797b630
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIFuelLevelNotification::OnVIFuelLevelNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {
+}
+
+void OnVIFuelLevelNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIFuelLevelNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc
new file mode 100644
index 0000000000..0024f17a80
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {
+}
+
+void OnVIFuelLevelStateNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIFuelLevelStateNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc
new file mode 100644
index 0000000000..5b7ec72977
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIGpsDataNotification::OnVIGpsDataNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIGpsDataNotification::~OnVIGpsDataNotification() {
+}
+
+void OnVIGpsDataNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIGpsDataNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc
new file mode 100644
index 0000000000..355c00f0c9
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {
+}
+
+void OnVIHeadLampStatusNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIHeadLampStatusNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
new file mode 100644
index 0000000000..17240bce6c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIInstantFuelConsumptionNotification::~OnVIInstantFuelConsumptionNotification() {
+}
+
+void OnVIInstantFuelConsumptionNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIInstantFuelConsumptionNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc
new file mode 100644
index 0000000000..1caaecb442
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIMyKeyNotification::OnVIMyKeyNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIMyKeyNotification::~OnVIMyKeyNotification() {
+}
+
+void OnVIMyKeyNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIMyKeyNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc
new file mode 100644
index 0000000000..02127a1389
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIOdometerNotification::OnVIOdometerNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIOdometerNotification::~OnVIOdometerNotification() {
+}
+
+void OnVIOdometerNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIOdometerNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc
new file mode 100644
index 0000000000..4692191cb3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIPrndlNotification::OnVIPrndlNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIPrndlNotification::~OnVIPrndlNotification() {
+}
+
+void OnVIPrndlNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIPrndlNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc
new file mode 100644
index 0000000000..b16421903a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIRpmNotification::OnVIRpmNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIRpmNotification::~OnVIRpmNotification() {
+}
+
+void OnVIRpmNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIRpmNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc
new file mode 100644
index 0000000000..6bc1e8b2cf
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_speed_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVISpeedNotification::OnVISpeedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVISpeedNotification::~OnVISpeedNotification() {
+}
+
+void OnVISpeedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVISpeedNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
new file mode 100644
index 0000000000..853b4eeea3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {
+}
+
+void OnVISteeringWheelAngleNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVISteeringWheelAngleNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc
new file mode 100644
index 0000000000..01ac7e9f8c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVITirePressureNotification::OnVITirePressureNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVITirePressureNotification::~OnVITirePressureNotification() {
+}
+
+void OnVITirePressureNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVITirePressureNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
new file mode 100644
index 0000000000..eda88ef602
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIVehicleDataNotification::OnVIVehicleDataNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {
+}
+
+void OnVIVehicleDataNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIVehicleDataNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc
new file mode 100644
index 0000000000..546dc0d3cf
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_vin_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIVinNotification::OnVIVinNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIVinNotification::~OnVIVinNotification() {
+}
+
+void OnVIVinNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIVinNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc
new file mode 100644
index 0000000000..101427df0a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVIWiperStatusNotification::OnVIWiperStatusNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {
+}
+
+void OnVIWiperStatusNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVIWiperStatusNotification::Run");
+
+ // prepare SmartObject for mobile factory
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+
+ SendNotificationToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc
new file mode 100644
index 0000000000..99842b8524
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vr_command_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVRCommandNotification::OnVRCommandNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVRCommandNotification::~OnVRCommandNotification() {
+}
+
+void OnVRCommandNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVRCommandNotification::Run");
+
+ ApplicationSharedPtr active_app = ApplicationManagerImpl::instance()
+ ->active_application();
+ const uint32_t cmd_id = (*message_)[strings::msg_params][strings::cmd_id]
+ .asUInt();
+ uint32_t max_cmd_id = profile::Profile::instance()->max_cmd_id();
+
+ // Check if this is one of standart VR commands (i.e. "Help")
+ if (cmd_id > max_cmd_id + 1) {
+ LOG4CXX_INFO(logger_, "Switched App");
+ MessageHelper::SendActivateAppToHMI(cmd_id - max_cmd_id);
+ return;
+ }
+
+ // Check if this is "Help"
+ if (cmd_id == max_cmd_id + 1) {
+ return;
+ }
+ const uint32_t app_id = (*message_)[strings::msg_params][strings::app_id]
+ .asUInt();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ /* check if perform interaction is active
+ * if it is active we should sent to HMI DeleteCommand request
+ * and PerformInterActionResponse to mobile
+ */
+ if (0 != app->is_perform_interaction_active()) {
+ event_engine::Event event(hmi_apis::FunctionID::VR_OnCommand);
+ event.set_smart_object(*message_);
+ event.raise();
+ } else {
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID);
+
+ (*message_)[strings::msg_params][strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
+ SendNotificationToMobile(message_);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc
new file mode 100644
index 0000000000..92e7cb7b23
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVRLanguageChangeNotification::OnVRLanguageChangeNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {
+}
+
+void OnVRLanguageChangeNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVRLanguageChangeNotification::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+
+ (*message_)[strings::msg_params][strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ (*message_)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+
+ std::set<ApplicationSharedPtr>::iterator it = applications.begin();
+ for (;applications.end() != it; ++it) {
+ ApplicationSharedPtr app = (*it);
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotificationToMobile(message_);
+ if (static_cast<int32_t>(app->language())
+ != (*message_)[strings::msg_params][strings::language].asInt()) {
+ app->set_hmi_level(mobile_api::HMILevel::HMI_NONE);
+
+ MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+ ApplicationManagerImpl::instance()->UnregisterApplication(
+ app->app_id(), mobile_apis::Result::SUCCESS, false);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc
new file mode 100644
index 0000000000..72f6767e8c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vr_started_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVRStartedNotification::OnVRStartedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVRStartedNotification::~OnVRStartedNotification() {
+}
+
+void OnVRStartedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVRStartedNotification::Run");
+
+ ApplicationManagerImpl::instance()->set_vr_session_started(true);
+ ApplicationManagerImpl::instance()->Mute(kVRSessionChanging);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc
new file mode 100644
index 0000000000..46274a3b2e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVRStoppedNotification::OnVRStoppedNotification(
+ const MessageSharedPtr& message)
+ : NotificationFromHMI(message) {
+}
+
+OnVRStoppedNotification::~OnVRStoppedNotification() {
+}
+
+void OnVRStoppedNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVRStoppedNotification::Run");
+
+ ApplicationManagerImpl::instance()->set_vr_session_started(false);
+ ApplicationManagerImpl::instance()->Unmute(kVRSessionChanging);
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
new file mode 100644
index 0000000000..7b7f740904
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+
+ // Replace HMI app id with Mobile connection id
+ ApplicationManagerImpl::instance()->ReplaceHMIByMobileAppId(*(message.get()));
+}
+
+RequestFromHMI::~RequestFromHMI() {
+}
+
+bool RequestFromHMI::Init() {
+ return true;
+}
+
+bool RequestFromHMI::CleanUp() {
+ return true;
+}
+
+void RequestFromHMI::Run() {
+}
+
+} // namespace commands
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
new file mode 100644
index 0000000000..242118a417
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc
@@ -0,0 +1,70 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/application_manager_impl.h"
+#include "config_profile/profile.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RequestToHMI::RequestToHMI(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+ // Replace Mobile connection id with HMI app id
+ ApplicationManagerImpl::instance()->ReplaceMobileByHMIAppId(*(message.get()));
+}
+
+RequestToHMI::~RequestToHMI() {
+}
+
+bool RequestToHMI::Init() {
+ return true;
+}
+
+bool RequestToHMI::CleanUp() {
+ return true;
+}
+
+void RequestToHMI::Run() {
+}
+
+void RequestToHMI::SendRequest() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
new file mode 100644
index 0000000000..42bebb847d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
@@ -0,0 +1,108 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+ //If it is error response, shift info
+ if ((*message)[strings::params].keyExists(hmi_response::message)) {
+ (*message)[strings::msg_params][strings::info] =
+ (*message)[strings::params][hmi_response::message];
+ }
+
+ // Replace HMI app id with Mobile connection id
+ ApplicationManagerImpl::instance()->ReplaceHMIByMobileAppId(*(message.get()));
+}
+
+ResponseFromHMI::~ResponseFromHMI() {
+}
+
+bool ResponseFromHMI::Init() {
+ return true;
+}
+
+bool ResponseFromHMI::CleanUp() {
+ return true;
+}
+
+void ResponseFromHMI::Run() {
+}
+
+void ResponseFromHMI::SendResponseToMobile(const MessageSharedPtr& message) {
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+
+ ApplicationManagerImpl::instance()->ManageMobileCommand(message);
+}
+
+void ResponseFromHMI::CreateHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject& msg_params) const {
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+
+ if (!result) {
+ LOG4CXX_ERROR(logger_, "Memory allocation failed.");
+ return;
+ }
+
+ // get hmi correlation id for chaining further request from this object
+ const uint32_t hmi_correlation_id_ = ApplicationManagerImpl::instance()
+ ->GetNextHMICorrelationID();
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ request[strings::params][strings::function_id] = function_id;
+ request[strings::params][strings::correlation_id] = hmi_correlation_id_;
+ request[strings::params][strings::protocol_version] =
+ CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ CommandImpl::hmi_protocol_type_;
+
+ request[strings::msg_params] = msg_params;
+
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return;
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
new file mode 100644
index 0000000000..d18987428e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResponseToHMI::ResponseToHMI(const MessageSharedPtr& message)
+ : CommandImpl(message) {
+ // Replace Mobile connection id with HMI app id
+ ApplicationManagerImpl::instance()->ReplaceMobileByHMIAppId(*(message.get()));
+}
+
+ResponseToHMI::~ResponseToHMI() {
+}
+
+bool ResponseToHMI::Init() {
+ return true;
+}
+
+bool ResponseToHMI::CleanUp() {
+ return true;
+}
+
+void ResponseToHMI::Run() {
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
new file mode 100644
index 0000000000..72abf233ce
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_activate_app_request.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLActivateAppRequest::SDLActivateAppRequest(const MessageSharedPtr& message)
+ : RequestFromHMI(message) {
+}
+
+SDLActivateAppRequest::~SDLActivateAppRequest() {
+}
+
+void SDLActivateAppRequest::Run() {
+ LOG4CXX_INFO(logger_, "SDLActivateAppRequest::Run");
+ policy::PolicyHandler::instance()->OnActivateApp(
+ (*message_)[strings::msg_params][strings::app_id].asUInt(),
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc
new file mode 100644
index 0000000000..46eb402f41
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLActivateAppResponse::SDLActivateAppResponse(
+ const MessageSharedPtr& message): ResponseToHMI(message) {
+}
+
+SDLActivateAppResponse::~SDLActivateAppResponse() {
+}
+
+void SDLActivateAppResponse::Run() {
+ LOG4CXX_INFO(logger_, "SDLActivateAppResponse::Run");
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc
new file mode 100644
index 0000000000..7eb5a268ac
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest(
+ const MessageSharedPtr& message)
+ : RequestFromHMI(message) {
+}
+
+SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {
+}
+
+void SDLGetListOfPermissionsRequest::Run() {
+ LOG4CXX_INFO(logger_, "SDLGetListOfPermissionsRequest::Run");
+ uint32_t connection_key = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+ policy::PolicyHandler::instance()->OnGetListOfPermissions(
+ connection_key,
+ (*message_)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc
new file mode 100644
index 0000000000..da474cb128
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse(
+ const MessageSharedPtr& message): ResponseToHMI(message) {
+}
+
+SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {
+}
+
+void SDLGetListOfPermissionsResponse::Run() {
+ LOG4CXX_INFO(logger_, "SDLGetListOfPermissionsResponse::Run");
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc
new file mode 100644
index 0000000000..cc5fbc63ae
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest(const MessageSharedPtr& message)
+ : RequestFromHMI(message) {
+}
+
+SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {
+}
+
+void SDLGetStatusUpdateRequest::Run() {
+ LOG4CXX_INFO(logger_, "SDLGetStatusUpdateRequest::Run");
+ policy::PolicyHandler::instance()->OnGetStatusUpdate(
+ (*message_)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc
new file mode 100644
index 0000000000..08d8d315a5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse(
+ const MessageSharedPtr& message): ResponseToHMI(message) {
+}
+
+SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {
+}
+
+void SDLGetStatusUpdateResponse::Run() {
+ LOG4CXX_INFO(logger_, "SDLGetStatusUpdateResponse::Run");
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc
new file mode 100644
index 0000000000..047d6bf846
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest(
+ const MessageSharedPtr& message)
+ : RequestFromHMI(message) {
+}
+
+SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {
+}
+
+void SDLGetUserFriendlyMessageRequest::Run() {
+ LOG4CXX_INFO(logger_, "SDLGetUserFriendlyMessageRequest::Run");
+ const std::string messageCodes = "messageCodes";
+ if (!(*message_)[strings::msg_params].keyExists(messageCodes)) {
+ LOG4CXX_WARN(logger_,
+ "Mandatory parameter '"+messageCodes+"'' is missing");
+ return;
+ }
+ smart_objects::SmartArray* msg =
+ (*message_)[strings::msg_params][messageCodes].asArray();
+
+ std::vector<std::string> msg_codes;
+
+ smart_objects::SmartArray::const_iterator it = msg->begin();
+ smart_objects::SmartArray::const_iterator it_end = msg->end();
+ for (; it != it_end; ++it) {
+ msg_codes.push_back((*it).asString());
+ }
+
+ std::string required_language;
+ if ((*message_)[strings::msg_params].keyExists(strings::language)) {
+ uint32_t lang_code = (*message_)[strings::msg_params][strings::language]
+ .asUInt();
+ required_language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code));
+ } else {
+ hmi_apis::Common_Language::eType ui_language =
+ application_manager::ApplicationManagerImpl::instance()
+ ->hmi_capabilities().active_ui_language();
+
+ required_language =
+ application_manager::MessageHelper::CommonLanguageToString(ui_language);
+ }
+
+ policy::PolicyHandler::instance()->OnGetUserFriendlyMessage(
+ msg_codes, required_language,
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc
new file mode 100644
index 0000000000..c849204cc3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse(
+ const MessageSharedPtr& message): ResponseToHMI(message) {
+}
+
+SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {
+}
+
+void SDLGetUserFriendlyMessageResponse::Run() {
+ LOG4CXX_INFO(logger_, "SDLGetUserFriendlyMessageResponse::Run");
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
new file mode 100644
index 0000000000..4779e106c5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_policy_update.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SDLPolicyUpdate::SDLPolicyUpdate(
+ const MessageSharedPtr& message): RequestToHMI(message) {
+}
+
+SDLPolicyUpdate::~SDLPolicyUpdate() {
+}
+
+void SDLPolicyUpdate::Run() {
+ LOG4CXX_INFO(logger_, "SDLPolicyUpdate::Run");
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc
new file mode 100644
index 0000000000..a3db3a9047
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/sdl_policy_update_response.h"
+
+namespace application_manager {
+
+namespace commands {
+SDLPolicyUpdateResponse::SDLPolicyUpdateResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {
+}
+
+void SDLPolicyUpdateResponse::Run() {
+ LOG4CXX_INFO(logger_, "SDLPolicyUpdateResponse::Run");
+ // TODO(PV): add some logic here
+}
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc
new file mode 100644
index 0000000000..638503d162
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_change_registration_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSChangeRegistrationRequest::TTSChangeRegistrationRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {
+}
+
+void TTSChangeRegistrationRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSChangeRegistrationRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc
new file mode 100644
index 0000000000..67e48b4ed5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSChangeRegistratioResponse::TTSChangeRegistratioResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {
+}
+
+void TTSChangeRegistratioResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSChangeRegistratioResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc
new file mode 100644
index 0000000000..59cf50b38d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {
+}
+
+void TTSGetCapabilitiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSGetCapabilitiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc
new file mode 100644
index 0000000000..f7309822d8
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {
+}
+
+void TTSGetCapabilitiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSGetCapabilitiesResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ if ((*message_)[strings::msg_params].keyExists(hmi_response::speech_capabilities)) {
+ hmi_capabilities.set_speech_capabilities(
+ (*message_)[strings::msg_params][hmi_response::speech_capabilities]);
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::prerecorded_speech_capabilities)) {
+ hmi_capabilities.set_prerecorded_speech(
+ (*message_)[strings::msg_params]
+ [hmi_response::prerecorded_speech_capabilities]);
+ }
+
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc
new file mode 100644
index 0000000000..9f2fe7134a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_get_language_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSGetLanguageRequest::TTSGetLanguageRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSGetLanguageRequest::~TTSGetLanguageRequest() {
+}
+
+void TTSGetLanguageRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSGetLanguageRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc
new file mode 100644
index 0000000000..e26fa87739
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_get_language_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSGetLanguageResponse::TTSGetLanguageResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSGetLanguageResponse::~TTSGetLanguageResponse() {
+}
+
+void TTSGetLanguageResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSGetLanguageResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_active_tts_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt()));
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc
new file mode 100644
index 0000000000..08c1d82448
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {
+}
+
+void TTSGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSGetSupportedLanguagesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc
new file mode 100644
index 0000000000..aa041f66b3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {
+}
+
+void TTSGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSGetSupportedLanguagesResponse::Run");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_tts_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
new file mode 100644
index 0000000000..7733de4887
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSIsReadyRequest::TTSIsReadyRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSIsReadyRequest::~TTSIsReadyRequest() {
+}
+
+void TTSIsReadyRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSIsReadyRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
new file mode 100644
index 0000000000..fb3cb4858f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_is_ready_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSIsReadyResponse::TTSIsReadyResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSIsReadyResponse::~TTSIsReadyResponse() {
+}
+
+void TTSIsReadyResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSIsReadyResponse::Run");
+ smart_objects::SmartObject& object = *message_;
+
+ bool is_available = false;
+ if (object[strings::msg_params].keyExists(strings::available)) {
+ is_available = object[strings::msg_params][strings::available].asBool();
+ }
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_is_tts_cooperating(is_available);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc
new file mode 100644
index 0000000000..04f1380d91
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {
+}
+
+void TTSSetGlobalPropertiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSSetGlobalPropertiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc
new file mode 100644
index 0000000000..c90655186f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {
+}
+
+void TTSSetGlobalPropertiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSSetGlobalPropertiesResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
new file mode 100644
index 0000000000..9b4bd68585
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_speak_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSSpeakRequest::TTSSpeakRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSSpeakRequest::~TTSSpeakRequest() {
+}
+
+void TTSSpeakRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSSpeakRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
new file mode 100644
index 0000000000..9b9e43dbe8
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_speak_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSSpeakResponse::TTSSpeakResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSSpeakResponse::~TTSSpeakResponse() {
+}
+
+void TTSSpeakResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSSpeakResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc
new file mode 100644
index 0000000000..107cb7933b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSStopSpeakingRequest::TTSStopSpeakingRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {
+}
+
+void TTSStopSpeakingRequest::Run() {
+ LOG4CXX_INFO(logger_, "TTSStopSpeakingRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc
new file mode 100644
index 0000000000..9bd4f89660
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+TTSStopSpeakingResponse::TTSStopSpeakingResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {
+}
+
+void TTSStopSpeakingResponse::Run() {
+ LOG4CXX_INFO(logger_, "TTSStopSpeakingResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc
new file mode 100644
index 0000000000..9aa5d2e2d3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_add_command_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIAddCommandRequest::UIAddCommandRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIAddCommandRequest::~UIAddCommandRequest() {
+}
+
+void UIAddCommandRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIAddCommandRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc
new file mode 100644
index 0000000000..21b34e0637
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_add_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIAddCommandResponse::UIAddCommandResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIAddCommandResponse::~UIAddCommandResponse() {
+}
+
+void UIAddCommandResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIAddCommandResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc
new file mode 100644
index 0000000000..7a9c5c6fed
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_add_submenu_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIAddSubmenuRequest::UIAddSubmenuRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIAddSubmenuRequest::~UIAddSubmenuRequest() {
+}
+
+void UIAddSubmenuRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIAddCommandRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc
new file mode 100644
index 0000000000..af88de2b48
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_add_submenu_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIAddSubmenuResponse::UIAddSubmenuResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIAddSubmenuResponse::~UIAddSubmenuResponse() {
+}
+
+void UIAddSubmenuResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIAddSubmenuResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_AddSubMenu);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
new file mode 100644
index 0000000000..f8c9ed5708
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_alert_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIAlertRequest::UIAlertRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIAlertRequest::~UIAlertRequest() {
+}
+
+void UIAlertRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIAlertRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
new file mode 100644
index 0000000000..289b90d290
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_alert_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIAlertResponse::UIAlertResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIAlertResponse::~UIAlertResponse() {
+}
+
+void UIAlertResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIAlertResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc
new file mode 100644
index 0000000000..fbba2b4023
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_change_registration_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIChangeRegistrationRequest::UIChangeRegistrationRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {
+}
+
+void UIChangeRegistrationRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIChangeRegistrationRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc
new file mode 100644
index 0000000000..16447077dd
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIChangeRegistratioResponse::UIChangeRegistratioResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {
+}
+
+void UIChangeRegistratioResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIChangeRegistratioResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc
new file mode 100644
index 0000000000..23fb4c67f5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_delete_command_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIDeleteCommandRequest::UIDeleteCommandRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIDeleteCommandRequest::~UIDeleteCommandRequest() {
+}
+
+void UIDeleteCommandRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIDeleteCommandRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc
new file mode 100644
index 0000000000..0ac32877c4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_delete_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIDeleteCommandResponse::UIDeleteCommandResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIDeleteCommandResponse::~UIDeleteCommandResponse() {
+}
+
+void UIDeleteCommandResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIDeleteCommandResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteCommand);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc
new file mode 100644
index 0000000000..41f356b981
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIDeleteSubmenuRequest::UIDeleteSubmenuRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {
+}
+
+void UIDeleteSubmenuRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIDeleteSubmenuRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc
new file mode 100644
index 0000000000..5a3359b722
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIDeleteSubmenuResponse::UIDeleteSubmenuResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {
+}
+
+void UIDeleteSubmenuResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIDeleteSubmenuResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..4c93f9235b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIEndAudioPassThruRequest::UIEndAudioPassThruRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {
+}
+
+void UIEndAudioPassThruRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIEndAudioPassThruRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..e560ae293a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIEndAudioPassThruResponse::UIEndAudioPassThruResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {
+}
+
+void UIEndAudioPassThruResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIEndAudioPassThruResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc
new file mode 100644
index 0000000000..b9f1b6917c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIGetCapabilitiesRequest::UIGetCapabilitiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {
+}
+
+void UIGetCapabilitiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIGetCapabilitiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
new file mode 100644
index 0000000000..0663bf033e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIGetCapabilitiesResponse::UIGetCapabilitiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {
+}
+
+void UIGetCapabilitiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIGetCapabilitiesResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_display_capabilities(
+ (*message_)[strings::msg_params][hmi_response::display_capabilities]);
+
+ hmi_capabilities.set_hmi_zone_capabilities(
+ (*message_)[strings::msg_params][hmi_response::hmi_zone_capabilities]);
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::soft_button_capabilities)) {
+ hmi_capabilities.set_soft_button_capabilities(
+ (*message_)[strings::msg_params][hmi_response::soft_button_capabilities]);
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::audio_pass_thru_capabilities)) {
+
+ hmi_capabilities.set_audio_pass_thru_capabilities(
+ (*message_)[strings::msg_params][strings::audio_pass_thru_capabilities]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc
new file mode 100644
index 0000000000..ffca242d43
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_get_language_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIGetLanguageRequest::UIGetLanguageRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIGetLanguageRequest::~UIGetLanguageRequest() {
+}
+
+void UIGetLanguageRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIGetLanguageRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc
new file mode 100644
index 0000000000..20435d788b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_get_language_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIGetLanguageResponse::UIGetLanguageResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIGetLanguageResponse::~UIGetLanguageResponse() {
+}
+
+void UIGetLanguageResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIGetLanguageResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_active_ui_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt()));
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc
new file mode 100644
index 0000000000..455486ef6c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {
+}
+
+void UIGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIGetSupportedLanguagesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc
new file mode 100644
index 0000000000..8492cfca5b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {
+}
+
+void UIGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIGetSupportedLanguagesResponse::Run");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_ui_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
new file mode 100644
index 0000000000..50d0ddd95a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIIsReadyRequest::UIIsReadyRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIIsReadyRequest::~UIIsReadyRequest() {
+}
+
+void UIIsReadyRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIIsReadyRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
new file mode 100644
index 0000000000..97d11b6022
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_is_ready_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIIsReadyResponse::UIIsReadyResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIIsReadyResponse::~UIIsReadyResponse() {
+}
+
+void UIIsReadyResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIIsReadyResponse::Run");
+ smart_objects::SmartObject& object = *message_;
+
+ bool is_available = false;
+ if (object[strings::msg_params].keyExists(strings::available)) {
+ is_available = object[strings::msg_params][strings::available].asBool();
+ }
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_is_ui_cooperating(is_available);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..cf77703a9b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {
+}
+
+void UIPerformAudioPassThruRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIPerformAudioPassThruRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..36d4c507b5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {
+}
+
+void UIPerformAudioPassThruResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIPerformAudioPassThruResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc
new file mode 100644
index 0000000000..09f98ec036
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIPerformInteractionRequest::UIPerformInteractionRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIPerformInteractionRequest::~UIPerformInteractionRequest() {
+}
+
+void UIPerformInteractionRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIPerformInteractionRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc
new file mode 100644
index 0000000000..2f5f6ead57
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIPerformInteractionResponse::UIPerformInteractionResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIPerformInteractionResponse::~UIPerformInteractionResponse() {
+}
+
+void UIPerformInteractionResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIPerformInteractionResponse::Run");
+ event_engine::Event event(hmi_apis::FunctionID::UI_PerformInteraction);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc
new file mode 100644
index 0000000000..ac34dd236f
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIScrollableMessageRequest::UIScrollableMessageRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIScrollableMessageRequest::~UIScrollableMessageRequest() {
+}
+
+void UIScrollableMessageRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIScrollableMessageRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc
new file mode 100644
index 0000000000..182d512c8c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIScrollableMessageResponse::UIScrollableMessageResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIScrollableMessageResponse::~UIScrollableMessageResponse() {
+}
+
+void UIScrollableMessageResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIScrollableMessageResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc
new file mode 100644
index 0000000000..3dea853486
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest(
+ const MessageSharedPtr& message): RequestToHMI(message) {
+}
+
+UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {
+}
+
+void UiSetDisplayLayoutRequest::Run() {
+ LOG4CXX_INFO(logger_, "UiSetDisplayLayoutRequest::Run");
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc
new file mode 100644
index 0000000000..f381a4db28
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {
+}
+
+void UiSetDisplayLayoutResponse::Run() {
+ LOG4CXX_INFO(logger_, "UiSetDisplayLayoutResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc
new file mode 100644
index 0000000000..e538866c1b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {
+}
+
+void UISetGlobalPropertiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "UISetGlobalPropertiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc
new file mode 100644
index 0000000000..67023533c9
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {
+}
+
+void UISetGlobalPropertiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "UISetGlobalPropertiesResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
new file mode 100644
index 0000000000..b587a3028e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_set_icon_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISetIconRequest::UISetIconRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UISetIconRequest::~UISetIconRequest() {
+}
+
+void UISetIconRequest::Run() {
+ LOG4CXX_INFO(logger_, "UISetIconRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_icon_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_icon_response.cc
new file mode 100644
index 0000000000..f4565baaf1
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_icon_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_set_icon_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISetIconResponse::UISetIconResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UISetIconResponse::~UISetIconResponse() {
+}
+
+void UISetIconResponse::Run() {
+ LOG4CXX_INFO(logger_, "UISetIconResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetAppIcon);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc
new file mode 100644
index 0000000000..1eb218013b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISetMediaClockTimerRequest::UISetMediaClockTimerRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {
+}
+
+void UISetMediaClockTimerRequest::Run() {
+ LOG4CXX_INFO(logger_, "UISetMediaClockTimerRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc
new file mode 100644
index 0000000000..ee67862a1a
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISetMediaClockTimerResponse::UISetMediaClockTimerResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {
+}
+
+void UISetMediaClockTimerResponse::Run() {
+ LOG4CXX_INFO(logger_, "UISetMediaClockTimerResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/src/commands/hmi/ui_show_request.cc
new file mode 100644
index 0000000000..841c8a62fa
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_show_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_show_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIShowRequest::UIShowRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UIShowRequest::~UIShowRequest() {
+}
+
+void UIShowRequest::Run() {
+ LOG4CXX_INFO(logger_, "UIShowRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/src/commands/hmi/ui_show_response.cc
new file mode 100644
index 0000000000..c95cbbd2ba
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_show_response.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_show_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UIShowResponse::UIShowResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UIShowResponse::~UIShowResponse() {
+}
+
+void UIShowResponse::Run() {
+ LOG4CXX_INFO(logger_, "UIShowResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
new file mode 100644
index 0000000000..fc7203c0ea
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_slider_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISliderRequest::UISliderRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UISliderRequest::~UISliderRequest() {
+}
+
+void UISliderRequest::Run() {
+ LOG4CXX_INFO(logger_, "UISliderRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
new file mode 100644
index 0000000000..8d2522e224
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_slider_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISliderResponse::UISliderResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UISliderResponse::~UISliderResponse() {
+}
+
+void UISliderResponse::Run() {
+ LOG4CXX_INFO(logger_, "UISliderResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/src/commands/hmi/update_app_list_request.cc
new file mode 100644
index 0000000000..955f4b19c6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/update_app_list_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/update_app_list_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateAppListRequest::UpdateAppListRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UpdateAppListRequest::~UpdateAppListRequest() {
+}
+
+void UpdateAppListRequest::Run() {
+ LOG4CXX_INFO(logger_, "UpdateAppListRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/src/commands/hmi/update_app_list_response.cc
new file mode 100644
index 0000000000..d5db0b4ea8
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/update_app_list_response.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/update_app_list_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateAppListResponse::UpdateAppListResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UpdateAppListResponse::~UpdateAppListResponse() {
+}
+
+void UpdateAppListResponse::Run() {
+ LOG4CXX_INFO(logger_, "UpdateAppListResponse::Run");
+
+ // TODO(PV): add check
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+
diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/src/commands/hmi/update_device_list_request.cc
new file mode 100644
index 0000000000..1f632378b4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/update_device_list_request.cc
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/update_device_list_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "config_profile/profile.h"
+#include "interfaces/HMI_API.h"
+
+#include <unistd.h>
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateDeviceListRequest::UpdateDeviceListRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UpdateDeviceListRequest::~UpdateDeviceListRequest() {
+}
+
+void UpdateDeviceListRequest::Run() {
+ LOG4CXX_INFO(logger_, "UpdateDeviceListRequest::Run");
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
+ // Flag conditional compilation "CUSTOMER_PASA" is used in order to exclude
+ // hit code to RTC
+ if (true == profile::Profile::instance()->launch_hmi()) {
+ if (!ApplicationManagerImpl::instance()->IsHMICooperating()) {
+ LOG4CXX_INFO(logger_, "MY Wait for HMI Cooperation");
+ subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ termination_condition_.Wait(auto_lock);
+ LOG4CXX_INFO(logger_, "MY HMI Cooperation OK");
+ }
+ }
+
+ SendRequest();
+}
+
+void UpdateDeviceListRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "UpdateDeviceListRequest::on_event");
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_OnReady : {
+ LOG4CXX_INFO(logger_, "received OnReady");
+ unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ termination_condition_.Broadcast();
+ break;
+ };
+ default : {
+ LOG4CXX_ERROR(logger_, "Unknown event ");
+ break;
+ };
+ }
+}
+
+bool UpdateDeviceListRequest::CleanUp() {
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ termination_condition_.Broadcast();
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/src/commands/hmi/update_device_list_response.cc
new file mode 100644
index 0000000000..85ef57404c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/update_device_list_response.cc
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/update_device_list_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateDeviceListResponse::UpdateDeviceListResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+UpdateDeviceListResponse::~UpdateDeviceListResponse() {
+}
+
+void UpdateDeviceListResponse::Run() {
+ LOG4CXX_INFO(logger_, "UpdateDeviceListResponse::Run");
+
+ // TODO(PV): add check for correctness.
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
new file mode 100644
index 0000000000..7d47f84ce3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc
@@ -0,0 +1,58 @@
+
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/update_sdl_request.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateSDLRequest::UpdateSDLRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+UpdateSDLRequest::~UpdateSDLRequest() {
+}
+
+void UpdateSDLRequest::Run() {
+ LOG4CXX_INFO(logger_, "UpdateSDLRequest::Run");
+
+ policy::PolicyHandler::instance()->PTExchangeAtUserRequest(
+ (*message_)[strings::params][strings::correlation_id].asInt());
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
new file mode 100644
index 0000000000..d2be2c655c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/update_sdl_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateSDLResponse::UpdateSDLResponse(
+ const MessageSharedPtr& message): ResponseFromHMI(message) {
+}
+
+UpdateSDLResponse::~UpdateSDLResponse() {
+}
+
+void UpdateSDLResponse::Run() {
+ LOG4CXX_INFO(logger_, "UpdateSDLResponse::Run");
+ (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (*message_)[strings::params][strings::protocol_version] = protocol_version_;
+
+ ApplicationManagerImpl::instance()->SendMessageToHMI(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc
new file mode 100644
index 0000000000..45d44e4475
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIDiagnosticMessageRequest::VIDiagnosticMessageRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {
+}
+
+void VIDiagnosticMessageRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIDiagnosticMessageRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc
new file mode 100644
index 0000000000..d83869b279
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIDiagnosticMessageResponse::VIDiagnosticMessageResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {
+}
+
+void VIDiagnosticMessageResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIDiagnosticMessageResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc
new file mode 100644
index 0000000000..5289816fb5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIGetDTCsRequest::VIGetDTCsRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIGetDTCsRequest::~VIGetDTCsRequest() {
+}
+
+void VIGetDTCsRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIGetDTCsRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc
new file mode 100644
index 0000000000..0cacc51d6c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIGetDTCsResponse::VIGetDTCsResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIGetDTCsResponse::~VIGetDTCsResponse() {
+}
+
+void VIGetDTCsResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIGetDTCsResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc
new file mode 100644
index 0000000000..40b2ca9fed
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIGetVehicleDataRequest::VIGetVehicleDataRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {
+}
+
+void VIGetVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleDataRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc
new file mode 100644
index 0000000000..73444a19bd
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/policies/policy_handler.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIGetVehicleDataResponse::VIGetVehicleDataResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {
+}
+
+void VIGetVehicleDataResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleDataResponse::Run");
+ smart_objects::SmartObject* result_so = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!result_so) {
+ // TODO(PV): add response with out of memory.
+ LOG4CXX_ERROR(logger_,
+ "Failed to create new Smart Object on get vehicle response.");
+ return;
+ }
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+
+ smart_objects::SmartObject& result = *result_so;
+
+ if ((*message_)[strings::params][strings::message_type]
+ == static_cast<int32_t>(hmi_apis::messageType::error_response)) {
+ if ((*message_)[strings::params].keyExists(strings::data)) {
+ result[strings::msg_params] = (*message_)[strings::params][strings::data];
+ result[strings::params][hmi_response::code] =
+ (*message_)[strings::params][hmi_response::code];
+ result[strings::params][strings::correlation_id] =
+ (*message_)[strings::params][strings::correlation_id];
+ result[strings::params][strings::error_msg] =
+ (*message_)[strings::params][strings::error_msg];
+ result[strings::params][strings::message_type] =
+ (*message_)[strings::params][strings::message_type];
+ result[strings::params][strings::protocol_type] =
+ (*message_)[strings::params][strings::protocol_type];
+ result[strings::params][strings::protocol_version] =
+ (*message_)[strings::params][strings::protocol_version];
+ }
+
+
+ event.set_smart_object(*result_so);
+ } else {
+ event.set_smart_object(*message_);
+ policy::PolicyHandler::instance()->OnVehicleDataUpdated(*message_);
+ }
+
+
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc
new file mode 100644
index 0000000000..4c46de950e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIGetVehicleTypeRequest::VIGetVehicleTypeRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {
+}
+
+void VIGetVehicleTypeRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleTypeRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc
new file mode 100644
index 0000000000..18c0136d12
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIGetVehicleTypeResponse::VIGetVehicleTypeResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {
+}
+
+void VIGetVehicleTypeResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleTypeResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_vehicle_type(
+ (*message_)[strings::msg_params][hmi_response::vehicle_type]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
new file mode 100644
index 0000000000..074d6f6022
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIIsReadyRequest::VIIsReadyRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIIsReadyRequest::~VIIsReadyRequest() {
+}
+
+void VIIsReadyRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIIsReadyRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
new file mode 100644
index 0000000000..e7c9c180c2
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_is_ready_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIIsReadyResponse::VIIsReadyResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIIsReadyResponse::~VIIsReadyResponse() {
+}
+
+void VIIsReadyResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIIsReadyResponse::Run");
+ smart_objects::SmartObject& object = *message_;
+
+ bool is_available = false;
+ if (object[strings::msg_params].keyExists(strings::available)) {
+ is_available = object[strings::msg_params][strings::available].asBool();
+ }
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_is_ivi_cooperating(is_available);
+
+ policy::PolicyHandler::instance()->OnVIIsReady();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc
new file mode 100644
index 0000000000..1485b471c4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_read_did_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIReadDIDRequest::VIReadDIDRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIReadDIDRequest::~VIReadDIDRequest() {
+}
+
+void VIReadDIDRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIReadDIDRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc
new file mode 100644
index 0000000000..ddd9f3c540
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_read_did_response.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/application_manager_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+VIReadDIDResponse::VIReadDIDResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIReadDIDResponse::~VIReadDIDResponse() {
+}
+
+void VIReadDIDResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIReadDIDResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_ReadDID);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..38950a2a2b
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {
+}
+
+void VISubscribeVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "VISubscribeVehicleDataRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..bd67294fbb
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+namespace commands {
+
+VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {
+}
+
+void VISubscribeVehicleDataResponse::Run() {
+ LOG4CXX_INFO(logger_, "VISubscribeVehicleDataResponse::Run");
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData
+ );
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..0af87c2a2e
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {
+}
+
+void VIUnsubscribeVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "VIUnsubscribeVehicleDataRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..22231b4a61
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+namespace commands {
+
+VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {
+}
+
+void VIUnsubscribeVehicleDataResponse::Run() {
+ LOG4CXX_INFO(logger_, "VIUnsubscribeVehicleDataResponse::Run");
+ event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData
+ );
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc
new file mode 100644
index 0000000000..a74ece95da
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_add_command_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRAddCommandRequest::VRAddCommandRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRAddCommandRequest::~VRAddCommandRequest() {
+}
+
+void VRAddCommandRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRAddCommandRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc
new file mode 100644
index 0000000000..513ccdace2
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_add_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRAddCommandResponse::VRAddCommandResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRAddCommandResponse::~VRAddCommandResponse() {
+}
+
+void VRAddCommandResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRAddCommandResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc
new file mode 100644
index 0000000000..bd7c1e7841
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_change_registration_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRChangeRegistrationRequest::VRChangeRegistrationRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {
+}
+
+void VRChangeRegistrationRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRChangeRegistrationRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc
new file mode 100644
index 0000000000..92a36d23f6
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_change_registration_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRChangeRegistrationResponse::VRChangeRegistrationResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {
+}
+
+void VRChangeRegistrationResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRChangeRegistratioResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_ChangeRegistration);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc
new file mode 100644
index 0000000000..0241be6308
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_delete_command_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRDeleteCommandRequest::VRDeleteCommandRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRDeleteCommandRequest::~VRDeleteCommandRequest() {
+}
+
+void VRDeleteCommandRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRDeleteCommandRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc
new file mode 100644
index 0000000000..c5a13126b0
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_delete_command_response.h"
+#include "application_manager/event_engine/event.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRDeleteCommandResponse::VRDeleteCommandResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRDeleteCommandResponse::~VRDeleteCommandResponse() {
+}
+
+void VRDeleteCommandResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRDeleteCommandResponse::Run");
+
+ event_engine::Event event(hmi_apis::FunctionID::VR_DeleteCommand);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
new file mode 100644
index 0000000000..8b1d4ae0b4
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetCapabilitiesRequest::VRGetCapabilitiesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {
+}
+
+void VRGetCapabilitiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRGetCapabilitiesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
new file mode 100644
index 0000000000..de6fdd7a93
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetCapabilitiesResponse::VRGetCapabilitiesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {
+}
+
+void VRGetCapabilitiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRGetCapabilitiesResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ hmi_capabilities.set_vr_capabilities(
+ (*message_)[strings::msg_params][strings::vr_capabilities]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc
new file mode 100644
index 0000000000..9f4aeb9797
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_get_language_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetLanguageRequest::VRGetLanguageRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRGetLanguageRequest::~VRGetLanguageRequest() {
+}
+
+void VRGetLanguageRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRGetLanguageRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc
new file mode 100644
index 0000000000..acbd24fbbf
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_get_language_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetLanguageResponse::VRGetLanguageResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRGetLanguageResponse::~VRGetLanguageResponse() {
+}
+
+void VRGetLanguageResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRGetLanguageResponse::Run");
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_active_vr_language(
+ static_cast<hmi_apis::Common_Language::eType>(
+ (*message_)[strings::msg_params][hmi_response::language].asInt()));
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc
new file mode 100644
index 0000000000..e43d88430d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {
+}
+
+void VRGetSupportedLanguagesRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRGetSupportedLanguagesRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc
new file mode 100644
index 0000000000..d2cc148a09
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {
+}
+
+void VRGetSupportedLanguagesResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRGetSupportedLanguagesResponse::Run");
+
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_vr_supported_languages(
+ (*message_)[strings::msg_params][hmi_response::languages]);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
new file mode 100644
index 0000000000..944cfcbb3c
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRIsReadyRequest::VRIsReadyRequest(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRIsReadyRequest::~VRIsReadyRequest() {
+}
+
+void VRIsReadyRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRIsReadyRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
new file mode 100644
index 0000000000..8cf5e66ee7
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_is_ready_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRIsReadyResponse::VRIsReadyResponse(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRIsReadyResponse::~VRIsReadyResponse() {
+}
+
+void VRIsReadyResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRIsReadyResponse::Run");
+ smart_objects::SmartObject& object = *message_;
+
+ bool is_available = false;
+ if (object[strings::msg_params].keyExists(strings::available)) {
+ is_available = object[strings::msg_params][strings::available].asBool();
+ }
+
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ hmi_capabilities.set_is_vr_cooperating(is_available);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc
new file mode 100644
index 0000000000..6de32dc5b5
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRPerformInteractionRequest::VRPerformInteractionRequest(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+}
+
+VRPerformInteractionRequest::~VRPerformInteractionRequest() {
+}
+
+void VRPerformInteractionRequest::Run() {
+ LOG4CXX_INFO(logger_, "VRPerformInteractionRequest::Run");
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc
new file mode 100644
index 0000000000..fea09b9f29
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+VRPerformInteractionResponse::VRPerformInteractionResponse(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+}
+
+VRPerformInteractionResponse::~VRPerformInteractionResponse() {
+}
+
+void VRPerformInteractionResponse::Run() {
+ LOG4CXX_INFO(logger_, "VRPerformInteractionResponse::Run");
+ event_engine::Event event(hmi_apis::FunctionID::VR_PerformInteraction);
+ event.set_smart_object(*message_);
+ event.raise();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc
new file mode 100644
index 0000000000..35cc619895
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc
@@ -0,0 +1,414 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "application_manager/commands/mobile/add_command_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AddCommandRequest::AddCommandRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ send_ui_(false),
+ send_vr_(false),
+ is_ui_received_(false),
+ is_vr_received_(false),
+ ui_result_(hmi_apis::Common_Result::INVALID_ENUM),
+ vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+}
+
+AddCommandRequest::~AddCommandRequest() {
+}
+
+void AddCommandRequest::onTimeOut() {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::onTimeOut");
+ RemoveCommand();
+ CommandRequestImpl::onTimeOut();
+}
+
+void AddCommandRequest::Run() {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyImage((*message_)[strings::msg_params]
+ [strings::cmd_icon], app);
+
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) {
+ LOG4CXX_ERROR_EXT(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (app->FindCommand(
+ (*message_)[strings::msg_params][strings::cmd_id].asUInt())) {
+ LOG4CXX_ERROR_EXT(logger_, "INVALID_ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ bool data_exist = false;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ if (!CheckCommandName(app)) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+ if (((*message_)[strings::msg_params][strings::menu_params].keyExists(
+ hmi_request::parent_id)) && (0 != (*message_)[strings::msg_params]
+ [strings::menu_params][hmi_request::parent_id].asUInt())) {
+ if (!CheckCommandParentId(app)) {
+ SendResponse(false, mobile_apis::Result::INVALID_ID,
+ "Parent ID doesn't exist");
+ return;
+ }
+ }
+ data_exist = true;
+ }
+
+ if (((*message_)[strings::msg_params].keyExists(strings::vr_commands))
+ && ((*message_)[strings::msg_params]
+ [strings::vr_commands].length() > 0)) {
+
+ if (!CheckCommandVRSynonym(app)) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ data_exist = true;
+ }
+
+ if (!data_exist) {
+ LOG4CXX_ERROR_EXT(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming add command has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ app->AddCommand((*message_)[strings::msg_params]
+ [strings::cmd_id].asUInt(),
+ (*message_)[strings::msg_params]);
+
+ smart_objects::SmartObject ui_msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ ui_msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ ui_msg_params[strings::menu_params] =
+ (*message_)[strings::msg_params][strings::menu_params];
+
+ ui_msg_params[strings::app_id] = app->app_id();
+
+ if ( ((*message_)[strings::msg_params].keyExists(strings::cmd_icon))
+ && ((*message_)[strings::msg_params][strings::cmd_icon].keyExists(strings::value))
+ && (0 < (*message_)[strings::msg_params][strings::cmd_icon]
+ [strings::value].length())) {
+ ui_msg_params[strings::cmd_icon] =
+ (*message_)[strings::msg_params][strings::cmd_icon];
+ }
+
+ send_ui_ = true;
+ }
+
+ smart_objects::SmartObject vr_msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
+ vr_msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ vr_msg_params[strings::vr_commands] =
+ (*message_)[strings::msg_params][strings::vr_commands];
+ vr_msg_params[strings::app_id] = app->app_id();
+
+ vr_msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ vr_msg_params[strings::grammar_id] = app->get_grammar_id();
+
+ send_vr_ = true;
+ }
+
+ if (send_ui_) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
+ }
+
+ if (send_vr_) {
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
+ }
+}
+
+bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator i = commands.begin();
+ uint32_t saved_parent_id = 0;
+ uint32_t parent_id = 0;
+ if ((*message_)[strings::msg_params]
+ [strings::menu_params].keyExists(hmi_request::parent_id)) {
+ parent_id = (*message_)[strings::msg_params]
+ [strings::menu_params][hmi_request::parent_id].asUInt();
+ }
+
+ for (; commands.end() != i; ++i) {
+
+ if (!(*i->second).keyExists(strings::menu_params)) {
+ continue;
+ }
+
+ saved_parent_id = 0;
+ if ((*i->second)[strings::menu_params].keyExists(hmi_request::parent_id)) {
+ saved_parent_id = (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt();
+ }
+ if (((*i->second)[strings::menu_params][strings::menu_name].asString()
+ == (*message_)[strings::msg_params][strings::menu_params]
+ [strings::menu_name].asString()) &&
+ (saved_parent_id == parent_id)) {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandName received"
+ " command name already exist in same level menu");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+
+ if(!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ for (size_t i = 0; i < (*it->second)[strings::vr_commands].length(); ++i) {
+ for (size_t j = 0;
+ j < (*message_)[strings::msg_params][strings::vr_commands].length();
+ ++j) {
+ std::string vr_cmd_i =
+ (*it->second)[strings::vr_commands][i].asString();
+ std::string vr_cmd_j =
+ (*message_)[strings::msg_params]
+ [strings::vr_commands][j].asString();
+
+ if (0 == strcasecmp(vr_cmd_i.c_str(), vr_cmd_j.c_str())) {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandVRSynonym"
+ " received command vr synonym already exist");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return false;
+ }
+
+ const int32_t parent_id =
+ (*message_)[strings::msg_params][strings::menu_params]
+ [hmi_request::parent_id].asInt();
+ smart_objects::SmartObject* parent = app->FindSubMenu(parent_id);
+
+ if (!parent) {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandParentId received"
+ " submenu doesn't exist");
+ return false;
+ }
+ return true;
+}
+
+void AddCommandRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::on_event");
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_AddCommand: {
+ LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS != ui_result_) {
+ (*message_)[strings::msg_params].erase(strings::menu_params);
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_AddCommand: {
+ LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
+ is_vr_received_ = true;
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ if (hmi_apis::Common_Result::SUCCESS != vr_result_) {
+ (*message_)[strings::msg_params].erase(strings::vr_commands);
+ }
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (!IsPendingResponseExist()) {
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (hmi_apis::Common_Result::REJECTED == ui_result_) {
+ RemoveCommand();
+ }
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_) &&
+ (hmi_apis::Common_Result::SUCCESS == vr_result_)) ||
+ ((hmi_apis::Common_Result::SUCCESS == ui_result_) &&
+ (hmi_apis::Common_Result::INVALID_ENUM == vr_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == vr_result_)) ||
+ ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_ ) &&
+ (hmi_apis::Common_Result::SUCCESS == vr_result_));
+
+ if (!result && (hmi_apis::Common_Result::REJECTED == ui_result_)) {
+ result_code = static_cast<mobile_apis::Result::eType>(ui_result_);
+ } else {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ std::max(ui_result_, vr_result_));
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ if (true == result) {
+ application->UpdateHash();
+ }
+ }
+}
+
+bool AddCommandRequest::IsPendingResponseExist() {
+ return send_ui_ != is_ui_received_ || send_vr_ != is_vr_received_;
+}
+
+bool AddCommandRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) {
+ str = (*message_)[strings::msg_params][strings::menu_params]
+ [strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed.");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) {
+ const size_t len =
+ (*message_)[strings::msg_params][strings::vr_commands].length();
+
+ for (size_t i = 0; i < len; ++i) {
+ str = (*message_)[strings::msg_params]
+ [strings::vr_commands][i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) {
+ str = (*message_)[strings::msg_params]
+ [strings::cmd_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void AddCommandRequest::RemoveCommand() {
+ LOG4CXX_INFO(logger_, "AddCommandRequest::RemoveCommand");
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ connection_key());
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "No application associated with session key");
+ return;
+ }
+ app->RemoveCommand((*message_)[strings::msg_params]
+ [strings::cmd_id].asUInt());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_command_response.cc b/src/components/application_manager/src/commands/mobile/add_command_response.cc
new file mode 100644
index 0000000000..0c135af076
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/add_command_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/add_command_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AddCommandResponse::AddCommandResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+AddCommandResponse::~AddCommandResponse() {
+}
+
+void AddCommandResponse::Run() {
+ LOG4CXX_INFO(logger_, "AddCommandResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc
new file mode 100644
index 0000000000..ce6fa3fc51
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc
@@ -0,0 +1,146 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/add_sub_menu_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AddSubMenuRequest::AddSubMenuRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+AddSubMenuRequest::~AddSubMenuRequest() {
+}
+
+void AddSubMenuRequest::Run() {
+ LOG4CXX_INFO(logger_, "AddSubMenuRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->FindSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt())) {
+ LOG4CXX_ERROR(logger_, "INVALID_ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ if (app->IsSubMenuNameAlreadyExist(
+ (*message_)[strings::msg_params][strings::menu_name].asString())) {
+ LOG4CXX_ERROR(logger_, "DUPLICATE_NAME");
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ if (!CheckSubMenuName()) {
+ LOG4CXX_ERROR(logger_, "SubMenuName is not valid");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] =
+ (*message_)[strings::msg_params][strings::menu_id];
+ if ((*message_)[strings::msg_params].keyExists(strings::position)) {
+ msg_params[strings::menu_params][strings::position] =
+ (*message_)[strings::msg_params][strings::position];
+ }
+ msg_params[strings::menu_params][strings::menu_name] =
+ (*message_)[strings::msg_params][strings::menu_name];
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
+}
+
+void AddSubMenuRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "AddSubMenuRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_AddSubMenu: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ application->AddSubMenu((*message_)[strings::msg_params]
+ [strings::menu_id].asInt(),
+ (*message_)[strings::msg_params]);
+ }
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ application->UpdateHash();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool AddSubMenuRequest::CheckSubMenuName() {
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_INFO(logger_, "Invalid subMenu name.");
+ return false;
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc
new file mode 100644
index 0000000000..bcd7df2888
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/add_sub_menu_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AddSubMenuResponse::AddSubMenuResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+AddSubMenuResponse::~AddSubMenuResponse() {
+}
+
+void AddSubMenuResponse::Run() {
+ LOG4CXX_INFO(logger_, "AddSubMenuResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
new file mode 100644
index 0000000000..abb5bc7f3c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc
@@ -0,0 +1,232 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "application_manager/commands/mobile/alert_maneuver_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AlertManeuverRequest::AlertManeuverRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ tts_speak_result_code_(mobile_apis::Result::INVALID_ENUM),
+ navi_alert_maneuver_result_code_(mobile_apis::Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+AlertManeuverRequest::~AlertManeuverRequest() {
+}
+
+void AlertManeuverRequest::Run() {
+ LOG4CXX_INFO(logger_, "AlertManeuverRequest::Run");
+
+ if ((!(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
+ (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks))) {
+ LOG4CXX_ERROR(logger_, "AlertManeuverRequest::Request without parameters!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (NULL == app.get()) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming alert maneuver has contains \\t\\n \\\\t \\\\n"
+ "text contains only whitespace in ttsChunks");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ //ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ // Checking parameters and how many HMI requests should be sent
+ bool tts_is_ok = false;
+
+ // check TTSChunk parameter
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) {
+ pending_requests_.Add(hmi_apis::FunctionID::TTS_Speak);
+ tts_is_ok = true;
+ }
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[hmi_request::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton((*message_)[strings::msg_params],
+ app, function_id());
+ }
+
+ pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ SendHMIRequest(hmi_apis::FunctionID::Navigation_AlertManeuver,
+ &msg_params, true);
+
+ if (tts_is_ok) {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::tts_chunks] =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+
+ msg_params[strings::app_id] = app->app_id();
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+ }
+}
+
+void AlertManeuverRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "AlertManeuverRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ hmi_apis::FunctionID::eType event_id = event.id();
+ switch (event_id) {
+ case hmi_apis::FunctionID::Navigation_AlertManeuver: {
+ LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
+
+ pending_requests_.Remove(event_id);
+
+ navi_alert_maneuver_result_code_ =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+
+ pending_requests_.Remove(event_id);
+
+ tts_speak_result_code_ =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ ApplicationManagerImpl::instance()->updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ SendResponse(false, result_code, "Received unknown event");
+ return;
+ }
+ }
+
+ if (pending_requests_.IsFinal(event_id)) {
+
+ bool result = ((hmi_apis::Common_Result::SUCCESS ==
+ static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_) ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_) ||
+ (hmi_apis::Common_Result::INVALID_ENUM ==
+ static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_))) &&
+ (hmi_apis::Common_Result::SUCCESS ==
+ static_cast<hmi_apis::Common_Result::eType>(navi_alert_maneuver_result_code_))) ||
+ (hmi_apis::Common_Result::SUCCESS == static_cast<hmi_apis::Common_Result::eType>(
+ tts_speak_result_code_) && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ static_cast<hmi_apis::Common_Result::eType>(navi_alert_maneuver_result_code_));
+
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(std::max(tts_speak_result_code_,
+ navi_alert_maneuver_result_code_));
+
+ const char* return_info = NULL;
+
+ if (result && hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ static_cast<hmi_apis::Common_Result::eType>(tts_speak_result_code_)) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info =
+ std::string("Unsupported phoneme type sent in a prompt").c_str();
+ }
+
+ SendResponse(result, result_code, return_info,
+ &(message[strings::msg_params]));
+ } else {
+ LOG4CXX_INFO(logger_,
+ "There are some pending responses from HMI."
+ "AlertManeuverRequest still waiting.");
+ }
+}
+
+bool AlertManeuverRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "AlertManeuverRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ const smart_objects::SmartArray* tc_array =
+ (*message_)[strings::msg_params][strings::tts_chunks].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
+ smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
+
+ for (; it_tc != it_tc_end; ++it_tc) {
+ str = (*it_tc)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
new file mode 100644
index 0000000000..99fcde69a8
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/alert_maneuver_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AlertManeuverResponse::AlertManeuverResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+AlertManeuverResponse::~AlertManeuverResponse() {
+}
+
+void AlertManeuverResponse::Run() {
+ LOG4CXX_INFO(logger_, "AlertManeuverResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_request.cc b/src/components/application_manager/src/commands/mobile/alert_request.cc
new file mode 100644
index 0000000000..c08b7c32d7
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/alert_request.cc
@@ -0,0 +1,415 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/alert_request.h"
+
+#include <string.h>
+
+#include "application_manager/message_helper.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+AlertRequest::AlertRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ awaiting_ui_alert_response_(false),
+ awaiting_tts_speak_response_(false),
+ awaiting_tts_stop_speaking_response_(false),
+ response_success_(false),
+ flag_other_component_sent_(false),
+ response_result_(mobile_apis::Result::INVALID_ENUM),
+ tts_speak_response_(mobile_apis::Result::INVALID_ENUM) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+AlertRequest::~AlertRequest() {
+}
+
+bool AlertRequest::Init() {
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::duration)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::duration].asUInt();
+ } else {
+ const int32_t def_value = 5000;
+ default_timeout_ = def_value;
+ }
+
+ // If soft buttons are present, SDL will not use initiate timeout tracking for response.
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ LOG4CXX_INFO(logger_, "Request contains soft buttons - request timeout "
+ "will be set to 0.");
+ default_timeout_ = 0;
+ }
+
+ return true;
+}
+
+void AlertRequest::Run() {
+ LOG4CXX_INFO(logger_, "AlertRequest::Run");
+
+ uint32_t app_id = (*message_)[strings::params][strings::connection_key]
+ .asInt();
+
+ if (!Validate(app_id)) {
+ // Invalid command, abort execution
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ if (0 < (*message_)[strings::msg_params][strings::tts_chunks].length()) {
+ awaiting_tts_speak_response_ = true;
+ }
+ }
+ SendAlertRequest(app_id);
+ SendPlayToneNotification(app_id);
+ if (awaiting_tts_speak_response_) {
+ SendSpeakRequest(app_id);
+ }
+}
+
+void AlertRequest::onTimeOut() {
+ if (false == (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ CommandRequestImpl::onTimeOut();
+ return;
+ }
+ LOG4CXX_INFO(logger_, "default timeout ignored. "
+ "AlertRequest with soft buttons wait timeout on HMI side");
+}
+
+void AlertRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "AlertRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_OnResetTimeout:
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event "
+ " or TTS_OnResetTimeout event"
+ << awaiting_tts_speak_response_ << " "
+ << awaiting_tts_stop_speaking_response_ << " "
+ << awaiting_ui_alert_response_);
+ ApplicationManagerImpl::instance()->updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_Alert: {
+ LOG4CXX_INFO(logger_, "Received UI_Alert event");
+ // Unsubscribe from event to avoid unwanted messages
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
+ awaiting_ui_alert_response_ = false;
+
+ if (awaiting_tts_speak_response_) {
+ awaiting_tts_stop_speaking_response_ = true;
+ SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
+ }
+
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ // Mobile Alert request is successful when UI_Alert is successful
+ response_success_ = (mobile_apis::Result::SUCCESS == result_code ||
+ mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code);
+ response_result_ = result_code;
+ response_params_ = message[strings::msg_params];
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ // Unsubscribe from event to avoid unwanted messages
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
+ awaiting_tts_speak_response_ = false;
+ tts_speak_response_ = static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_StopSpeaking: {
+ LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event");
+ // Unsubscribe from event to avoid unwanted messages
+ unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ awaiting_tts_stop_speaking_response_ = false;
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ return;
+ }
+ }
+ if (!HasHmiResponsesToWait()) {
+ std::string response_info("");
+ if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == tts_speak_response_) &&
+ (!flag_other_component_sent_)) {
+ response_success_ = false;
+ response_result_ = mobile_apis::Result::WARNINGS;
+ response_info = "Unsupported phoneme type sent in a prompt";
+ } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE ==
+ tts_speak_response_) && (mobile_apis::Result::UNSUPPORTED_RESOURCE ==
+ response_result_)) {
+ response_result_ = mobile_apis::Result::WARNINGS;
+ response_info = "Unsupported phoneme type sent in a prompt and "
+ "unsupported image sent in soft buttons";
+ } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE ==
+ tts_speak_response_) && (mobile_apis::Result::SUCCESS ==
+ response_result_)) {
+ response_result_ = mobile_apis::Result::WARNINGS;
+ response_info = "Unsupported phoneme type sent in a prompt";
+ } else if ((mobile_apis::Result::SUCCESS == tts_speak_response_) &&
+ ((mobile_apis::Result::INVALID_ENUM == response_result_) &&
+ (!flag_other_component_sent_))) {
+ response_result_ = mobile_apis::Result::SUCCESS;
+ response_success_ = true;
+ }
+
+ // If timeout is not set, watchdog will not track request timeout and
+ // HMI is responsible for response returning. In this case, if ABORTED will
+ // be rerurned from HMI, success should be sent to mobile.
+ if (mobile_apis::Result::ABORTED == response_result_ &&
+ 0 == default_timeout_) {
+ response_success_ = true;
+ }
+
+ if (mobile_apis::Result::ABORTED == tts_speak_response_ &&
+ (!flag_other_component_sent_)) {
+ response_success_ = false;
+ response_result_ = tts_speak_response_;
+ }
+
+ SendResponse(response_success_, response_result_,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &response_params_);
+ }
+}
+
+bool AlertRequest::Validate(uint32_t app_id) {
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+
+ if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() &&
+ app->IsCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::POLICY_TABLE)) {
+ LOG4CXX_ERROR(logger_, "Alert frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return false;
+ }
+
+ if (!CheckStringsOfAlertRequest()) {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return false;
+ }
+
+ //ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return false;
+ }
+
+ // check if mandatory params(alertText1 and TTSChunk) specified
+ if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1))
+ && (!(*message_)[strings::msg_params].keyExists(strings::alert_text2))
+ && (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks)
+ && (1 > (*message_)[strings::msg_params]
+ [strings::tts_chunks].length()))) {
+ LOG4CXX_ERROR_EXT(logger_, "Mandatory parameters are missing");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "Mandatory parameters are missing");
+ return false;
+ }
+
+ return true;
+}
+
+void AlertRequest::SendAlertRequest(int32_t app_id) {
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::alert_strings] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText1;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text1];
+ index++;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText2;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text2];
+ index++;
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_name] =
+ hmi_apis::Common_TextFieldName::alertText3;
+ msg_params[hmi_request::alert_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::alert_text3];
+ }
+
+ // softButtons
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[hmi_request::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ // app_id
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::duration] = default_timeout_;
+
+ // NAVI platform progressIndicator
+ if ((*message_)[strings::msg_params].keyExists(strings::progress_indicator)) {
+ msg_params[strings::progress_indicator] =
+ (*message_)[strings::msg_params][strings::progress_indicator];
+ }
+
+ // PASA Alert type
+ msg_params[strings::alert_type] = hmi_apis::Common_AlertType::UI;
+ if (awaiting_tts_speak_response_) {
+ msg_params[strings::alert_type] = hmi_apis::Common_AlertType::BOTH;
+ }
+
+ // check out if there are alert strings or soft buttons
+ if (msg_params[hmi_request::alert_strings].length() > 0 ||
+ msg_params.keyExists(hmi_request::soft_buttons)) {
+
+ awaiting_ui_alert_response_ = true;
+ flag_other_component_sent_ = true;
+ SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true);
+ }
+}
+
+void AlertRequest::SendSpeakRequest(int32_t app_id) {
+
+ // crate HMI speak request
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::tts_chunks] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ msg_params[hmi_request::tts_chunks] =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ msg_params[strings::app_id] = app_id;
+ msg_params[hmi_request::speak_type] =
+ hmi_apis::Common_SpeakType::ALERT;
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+}
+
+void AlertRequest::SendPlayToneNotification(int32_t app_id) {
+ LOG4CXX_INFO(logger_, "AlertRequest::SendPlayToneNotification");
+
+ // check playtone parameter
+ if ((*message_)[strings::msg_params].keyExists(strings::play_tone)) {
+ if ((*message_)[strings::msg_params][strings::play_tone].asBool()) {
+ // crate HMI basic communication playtone request
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_PlayTone,
+ msg_params);
+ }
+ }
+}
+
+bool AlertRequest::CheckStringsOfAlertRequest() {
+ LOG4CXX_INFO(logger_, "AlertRequest::CheckStringsOfAlertRequest");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) {
+ str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) {
+ str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alert_text3)) {
+ str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ smart_objects::SmartObject& tts_chunks_array =
+ (*message_)[strings::msg_params][strings::tts_chunks];
+ for (size_t i = 0; i < tts_chunks_array.length(); ++i) {
+ str = tts_chunks_array[i][strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks text syntax check failed");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+bool AlertRequest::HasHmiResponsesToWait() {
+ return awaiting_ui_alert_response_ || awaiting_tts_speak_response_
+ || awaiting_tts_stop_speaking_response_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/alert_response.cc b/src/components/application_manager/src/commands/mobile/alert_response.cc
new file mode 100644
index 0000000000..5b8cd6557b
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/alert_response.cc
@@ -0,0 +1,59 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/alert_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+AlertResponse::AlertResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+AlertResponse::~AlertResponse() {
+}
+
+void AlertResponse::Run() {
+ LOG4CXX_INFO(logger_, "AlertResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/src/commands/mobile/change_registration_request.cc
new file mode 100644
index 0000000000..9780aad7bb
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/change_registration_request.cc
@@ -0,0 +1,433 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <algorithm>
+#include "application_manager/commands/mobile/change_registration_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ChangeRegistrationRequest::ChangeRegistrationRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ ui_result_(hmi_apis::Common_Result::INVALID_ENUM),
+ vr_result_(hmi_apis::Common_Result::INVALID_ENUM),
+ tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+}
+
+ChangeRegistrationRequest::~ChangeRegistrationRequest() {
+}
+
+void ChangeRegistrationRequest::Run() {
+ LOG4CXX_INFO(logger_, "ChangeRegistrationRequest::Run");
+
+ ApplicationManagerImpl* instance = ApplicationManagerImpl::instance();
+ const HMICapabilities& hmi_capabilities = instance->hmi_capabilities();
+
+ ApplicationSharedPtr app = instance->application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming request contains \t\n \\t \\n or whitespace");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (mobile_apis::Result::SUCCESS != CheckCoincidence()) {
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME);
+ return;
+ }
+
+ if (!hmi_capabilities.is_ui_cooperating()) {
+ ui_result_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ }
+
+ if (!hmi_capabilities.is_vr_cooperating()) {
+ vr_result_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ }
+
+ if (!hmi_capabilities.is_tts_cooperating()) {
+ tts_result_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ }
+
+ const int32_t hmi_language =
+ (*message_)[strings::msg_params][strings::hmi_display_language].asInt();
+
+ const int32_t language =
+ (*message_)[strings::msg_params][strings::language].asInt();
+
+ if (false ==
+ (IsLanguageSupportedByUI(hmi_language) &&
+ IsLanguageSupportedByVR(language) &&
+ IsLanguageSupportedByTTS(language))) {
+ LOG4CXX_ERROR(logger_, "Language is not supported");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ pending_requests_.Add(hmi_apis::FunctionID::UI_ChangeRegistration);
+ pending_requests_.Add(hmi_apis::FunctionID::VR_ChangeRegistration);
+ pending_requests_.Add(hmi_apis::FunctionID::TTS_ChangeRegistration);
+
+ // UI processing
+ smart_objects::SmartObject ui_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ ui_params[strings::language] = hmi_language;
+ ui_params[strings::app_id] = app->app_id();
+ if ((*message_)[strings::msg_params].keyExists(strings::app_name)) {
+ ui_params[strings::app_name] =
+ (*message_)[strings::msg_params][strings::app_name];
+ app->set_name((*message_)[strings::msg_params][strings::app_name].asString());
+ }
+ if ((*message_)[strings::msg_params].keyExists(
+ strings::ngn_media_screen_app_name)) {
+ ui_params[strings::ngn_media_screen_app_name] =
+ (*message_)[strings::msg_params][strings::ngn_media_screen_app_name];
+ app->set_ngn_media_screen_name((*message_)[strings::msg_params]
+ [strings::ngn_media_screen_app_name]);
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_ChangeRegistration,
+ &ui_params, true);
+
+ // VR processing
+ smart_objects::SmartObject vr_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ vr_params[strings::language] =
+ (*message_)[strings::msg_params][strings::language];
+
+ vr_params[strings::app_id] = app->app_id();
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ vr_params[strings::vr_synonyms] = (*message_)[strings::msg_params]
+ [strings::vr_synonyms];
+ app -> set_vr_synonyms((*message_)[strings::msg_params][strings::vr_synonyms]);
+ }
+ SendHMIRequest(hmi_apis::FunctionID::VR_ChangeRegistration,
+ &vr_params, true);
+
+ // TTS processing
+ smart_objects::SmartObject tts_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ tts_params[strings::language] =
+ (*message_)[strings::msg_params][strings::language];
+
+ tts_params[strings::app_id] = app->app_id();
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ tts_params[strings::tts_name] = (*message_)[strings::msg_params]
+ [strings::tts_name];
+ app->set_tts_name((*message_)[strings::msg_params][strings::tts_name]);
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::TTS_ChangeRegistration,
+ &tts_params, true);
+}
+
+bool ChangeRegistrationRequest::WasAnySuccess(
+ const hmi_apis::Common_Result::eType ui,
+ const hmi_apis::Common_Result::eType vr,
+ const hmi_apis::Common_Result::eType tts) {
+
+ return
+ hmi_apis::Common_Result::SUCCESS == ui ||
+ hmi_apis::Common_Result::SUCCESS == vr ||
+ hmi_apis::Common_Result::SUCCESS == tts;
+}
+
+void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ChangeRegistrationRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ hmi_apis::FunctionID::eType event_id = event.id();
+
+ switch (event_id) {
+ case hmi_apis::FunctionID::UI_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event");
+ pending_requests_.Remove(event_id);
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ case hmi_apis::FunctionID::VR_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event");
+ pending_requests_.Remove(event_id);
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_ChangeRegistration: {
+ LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event");
+ pending_requests_.Remove(event_id);
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event_id);
+ return;
+ }
+ }
+
+ if (pending_requests_.IsFinal(event_id)) {
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_) {
+ application->set_ui_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::hmi_display_language].asInt()));
+ }
+
+ if (hmi_apis::Common_Result::SUCCESS == vr_result_
+ || hmi_apis::Common_Result::SUCCESS == tts_result_) {
+ application->set_language(static_cast<mobile_api::Language::eType>(
+ (*message_)[strings::msg_params][strings::language].asInt()));
+ }
+
+ int32_t greates_result_code = std::max(std::max(ui_result_, vr_result_),
+ tts_result_);
+
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::eType::ChangeRegistrationID;
+
+ SendResponse(WasAnySuccess(ui_result_, vr_result_, tts_result_),
+ static_cast<mobile_apis::Result::eType>(greates_result_code),
+ NULL, &(message[strings::msg_params]));
+ } else {
+ LOG4CXX_INFO(logger_,
+ "There are some pending responses from HMI."
+ "ChangeRegistrationRequest still waiting.");
+ }
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByUI(
+ const int32_t& hmi_display_lang) {
+
+ const HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ const smart_objects::SmartObject* ui_languages =
+ hmi_capabilities.ui_supported_languages();
+
+ if (!ui_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < ui_languages->length(); ++i) {
+ if (hmi_display_lang == ui_languages->getElement(i).asInt()) {
+ return true;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by UI");
+
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByVR(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ const smart_objects::SmartObject* vr_languages =
+ hmi_capabilities.vr_supported_languages();
+
+ if (!vr_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < vr_languages->length(); ++i) {
+ if (hmi_display_lang == vr_languages->getElement(i).asInt()) {
+ return true;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by VR");
+
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsLanguageSupportedByTTS(
+ const int32_t& hmi_display_lang) {
+ const HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ const smart_objects::SmartObject* tts_languages =
+ hmi_capabilities.tts_supported_languages();
+
+ if (!tts_languages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return false;
+ }
+
+ for (size_t i = 0; i < tts_languages->length(); ++i) {
+ if (hmi_display_lang == tts_languages->getElement(i).asInt()) {
+ return true;
+ break;
+ }
+ }
+
+ LOG4CXX_ERROR(logger_, "Language isn't supported by TTS");
+ return false;
+}
+
+bool ChangeRegistrationRequest::IsWhiteSpaceExist() {
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_name)) {
+ str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ const smart_objects::SmartArray* tn_array =
+ (*message_)[strings::msg_params][strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
+ smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
+
+ for (; it_tn != it_tn_end; ++it_tn) {
+ str = (*it_tn)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].
+ keyExists(strings::ngn_media_screen_app_name)) {
+ str = (*message_)[strings::msg_params]
+ [strings::ngn_media_screen_app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid ngn_media_screen_app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ const smart_objects::SmartArray* vs_array =
+ (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
+ smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
+
+ for (; it_vs != it_vs_end; ++it_vs) {
+ str = (*it_vs).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() {
+ LOG4CXX_INFO(logger_, "ChangeRegistrationRequest::CheckCoincidence");
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+ std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ std::string app_name;
+ uint32_t app_id = connection_key();
+ if (msg_params.keyExists(strings::app_name)) {
+ app_name = msg_params[strings::app_name].asString();
+ }
+
+ for (; applications.end() != it; ++it) {
+ if (app_id == (*it)->app_id()) {
+ continue;
+ }
+
+ const std::string& cur_name = (*it)->name();
+ if (msg_params.keyExists(strings::app_name)) {
+ if (!strcasecmp(app_name.c_str(), cur_name.c_str())) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
+ const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
+ if (NULL != vr) {
+ curr_vr = vr->asArray();
+ CoincidencePredicateVR v(app_name);
+
+ if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+ }
+
+ // vr check
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ const std::vector<smart_objects::SmartObject>* new_vr =
+ msg_params[strings::vr_synonyms].asArray();
+
+ CoincidencePredicateVR v(cur_name);
+ if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // end vr check
+ } // application for end
+ return mobile_apis::Result::SUCCESS;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/src/commands/mobile/change_registration_response.cc
new file mode 100644
index 0000000000..13c926ec82
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/change_registration_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/change_registration_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ChangeRegistrationResponse::ChangeRegistrationResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+ChangeRegistrationResponse::~ChangeRegistrationResponse() {
+}
+
+void ChangeRegistrationResponse::Run() {
+ LOG4CXX_INFO(logger_, "ChangeRegistrationResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc
new file mode 100644
index 0000000000..583f0a0460
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc
@@ -0,0 +1,343 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <string>
+#include <algorithm>
+#include <vector>
+#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
+}
+
+void CreateInteractionChoiceSetRequest::Run() {
+ LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ for (uint32_t i = 0;
+ i < (*message_)[strings::msg_params][strings::choice_set].length();
+ ++i) {
+ mobile_apis::Result::eType verification_result_image =
+ mobile_apis::Result::SUCCESS;
+ mobile_apis::Result::eType verification_result_secondary_image =
+ mobile_apis::Result::SUCCESS;
+ if ((*message_)[strings::msg_params]
+ [strings::choice_set][i].keyExists(strings::image)) {
+ verification_result_image = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::choice_set]
+ [i][strings::image], app);
+ }
+ if ((*message_)[strings::msg_params]
+ [strings::choice_set][i].keyExists(strings::secondary_image)) {
+ verification_result_secondary_image = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::choice_set]
+ [i][strings::secondary_image], app);
+ }
+ if (verification_result_image == mobile_apis::Result::INVALID_DATA ||
+ verification_result_secondary_image == mobile_apis::Result::INVALID_DATA) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ const int32_t choice_set_id = (*message_)[strings::msg_params]
+ [strings::interaction_choice_set_id].asInt();
+
+ if (app->FindChoiceSet(choice_set_id)) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ mobile_apis::Result::eType result = CheckChoiceSet(app);
+ if (mobile_apis::Result::SUCCESS != result) {
+ SendResponse(false, result);
+ return;
+ }
+ uint32_t grammar_id = ApplicationManagerImpl::instance()->GenerateGrammarID();
+ (*message_)[strings::msg_params][strings::grammar_id] = grammar_id;
+ app->AddChoiceSet(choice_set_id, (*message_)[strings::msg_params]);
+ SendVRAddCommandRequest(app);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ app->UpdateHash();
+}
+
+mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetRequest::CheckChoiceSet");
+
+ const smart_objects::SmartArray* new_choice_set_array =
+ (*message_)[strings::msg_params][strings::choice_set].asArray();
+
+ smart_objects::SmartArray::const_iterator it_array =
+ new_choice_set_array->begin();
+
+ smart_objects::SmartArray::const_iterator it_array_end =
+ new_choice_set_array->end();
+
+ // Self check of new choice set for params coincidence
+ for (; it_array != it_array_end; ++it_array) {
+ const smart_objects::SmartArray* vr_array =
+ (*it_array)[strings::vr_commands].asArray();
+
+ CoincidencePredicateChoiceID c((*it_array)[strings::choice_id].asInt());
+ if (1 != std::count_if(
+ new_choice_set_array->begin(),
+ new_choice_set_array->end(),
+ c)) {
+
+ LOG4CXX_ERROR(logger_, "Incoming choice set has duplicate IDs.");
+ return mobile_apis::Result::INVALID_ID;
+ }
+
+ // Check new choice set params along with already registered choice sets
+ const ChoiceSetMap& app_choice_set_map = app->choice_set_map();
+ ChoiceSetMap::const_iterator it = app_choice_set_map.begin();
+ ChoiceSetMap::const_iterator itEnd = app_choice_set_map.end();
+ for (; it != itEnd; ++it) {
+ const smart_objects::SmartObject* app_choice_set = it->second;
+ if (NULL != app_choice_set) {
+
+ const smart_objects::SmartArray* curr_choice_set =
+ (*app_choice_set)[strings::choice_set].asArray();
+
+ if (0 != std::count_if(
+ curr_choice_set->begin(),
+ curr_choice_set->end(),
+ c)) {
+ LOG4CXX_ERROR(logger_, "Incoming choice ID already exists.");
+ return mobile_apis::Result::INVALID_ID;
+ }
+ }
+ }
+
+ CoincidencePredicateMenuName m((*it_array)[strings::menu_name].asString());
+ if (1 != std::count_if(
+ new_choice_set_array->begin(),
+ new_choice_set_array->end(),
+ m)) {
+
+ LOG4CXX_ERROR(logger_, "Incoming choice set has duplicate menu names.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ // Check coincidence inside the current choice
+
+ smart_objects::SmartArray::const_iterator it_vr = vr_array->begin();
+ smart_objects::SmartArray::const_iterator it_vr_end = vr_array->end();
+
+ for (; it_vr != it_vr_end; ++it_vr) {
+ CoincidencePredicateVRCommands v((*it_vr));
+ if (1 != std::count_if(vr_array->begin(), vr_array->end(), v)) {
+
+ LOG4CXX_ERROR(logger_,
+ "Incoming choice set has duplicate VR command(s)");
+
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+
+ // Check along with VR commands in other choices in the new set
+ smart_objects::SmartArray::const_iterator it_same_array =
+ new_choice_set_array->begin();
+
+ smart_objects::SmartArray::const_iterator it_same_array_end =
+ new_choice_set_array->end();
+
+ for (; it_same_array != it_same_array_end; ++it_same_array) {
+
+ // Skip check for itself
+ if ((*it_array)[strings::choice_id] ==
+ (*it_same_array)[strings::choice_id]) {
+
+ continue;
+ }
+
+ if (compareSynonyms((*it_array), (*it_same_array))) {
+
+ LOG4CXX_ERROR(logger_,
+ "Incoming choice set has duplicate VR command(s).");
+
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+
+ if (IsWhiteSpaceExist((*it_array))) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming choice set has contains \t\n \\t \\n");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ }
+
+ return mobile_apis::Result::SUCCESS;
+}
+
+bool CreateInteractionChoiceSetRequest::compareSynonyms(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) {
+
+ smart_objects::SmartArray* vr_cmds_1 =
+ choice1[strings::vr_commands].asArray();
+ DCHECK(vr_cmds_1 != NULL);
+ smart_objects::SmartArray* vr_cmds_2 =
+ choice2[strings::vr_commands].asArray();
+ DCHECK(vr_cmds_2 != NULL);
+
+ smart_objects::SmartArray::iterator it;
+ it = std::find_first_of(vr_cmds_1->begin(), vr_cmds_1->end(),
+ vr_cmds_2->begin(), vr_cmds_2->end(),
+ CreateInteractionChoiceSetRequest::compareStr);
+
+
+ if (it != vr_cmds_1->end()) {
+ LOG4CXX_INFO(logger_, "Incoming choice set has duplicated VR synonyms "
+ << it->asString());
+ return true;
+ }
+
+ return false;
+}
+
+bool CreateInteractionChoiceSetRequest::compareStr(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) {
+
+ return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray());
+}
+
+bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist(
+ const smart_objects::SmartObject& choice_set) {
+ LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ str = choice_set[strings::menu_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed");
+ return true;
+ }
+
+ if (choice_set.keyExists(strings::secondary_text)) {
+ str = choice_set[strings::secondary_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid secondary_text syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::tertiary_text)) {
+ str = choice_set[strings::tertiary_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tertiary_text syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::vr_commands)) {
+ const size_t len =
+ choice_set[strings::vr_commands].length();
+
+ for (size_t i = 0; i < len; ++i) {
+ str = choice_set[strings::vr_commands][i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (choice_set.keyExists(strings::image)) {
+ str = choice_set[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid image value syntax check failed");
+ return true;
+ }
+ }
+
+ if (choice_set.keyExists(strings::secondary_image)) {
+ str = choice_set[strings::secondary_image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid secondary_image value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void CreateInteractionChoiceSetRequest::SendVRAddCommandRequest(
+ application_manager::ApplicationSharedPtr const app) {
+
+ smart_objects::SmartObject* choice_set = &(*message_)[strings::msg_params];
+
+ for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::cmd_id] =
+ (*choice_set)[strings::choice_set][j][strings::choice_id];
+ msg_params[strings::vr_commands] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ msg_params[strings::vr_commands] =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params);
+ }
+
+}
+
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc
new file mode 100644
index 0000000000..8d6ea1b348
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc
@@ -0,0 +1,68 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {
+}
+
+void CreateInteractionChoiceSetResponse::Run() {
+ LOG4CXX_INFO(logger_, "CreateInteractionChoiceSetResponse::Run");
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/src/commands/mobile/delete_command_request.cc
new file mode 100644
index 0000000000..3c3ee88203
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_command_request.cc
@@ -0,0 +1,183 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_command_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteCommandRequest::DeleteCommandRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ is_ui_send_(false),
+ is_vr_send_(false),
+ is_ui_received_(false),
+ is_vr_received_(false),
+ ui_result_(hmi_apis::Common_Result::INVALID_ENUM),
+ vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+}
+
+DeleteCommandRequest::~DeleteCommandRequest() {
+}
+
+void DeleteCommandRequest::Run() {
+ LOG4CXX_INFO(logger_, "DeleteCommandRequest::Run");
+
+ ApplicationSharedPtr application = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ smart_objects::SmartObject* command = application->FindCommand(
+ (*message_)[strings::msg_params][strings::cmd_id].asInt());
+
+ if (!command) {
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::cmd_id] =
+ (*message_)[strings::msg_params][strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ // we should specify amount of required responses in the 1st request
+ uint32_t chaining_counter = 0;
+ if ((*command).keyExists(strings::menu_params)) {
+ ++chaining_counter;
+ }
+
+ if ((*command).keyExists(strings::vr_commands)) {
+ ++chaining_counter;
+ }
+
+ if ((*command).keyExists(strings::menu_params)) {
+ is_ui_send_ = true;
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
+ }
+ // check vr params
+ if ((*command).keyExists(strings::vr_commands)) {
+ is_vr_send_ = true;
+
+ // VR params
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
+ }
+}
+
+void DeleteCommandRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "DeleteCommandRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ LOG4CXX_INFO(logger_, "Received UI_DeleteCommand event");
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ break;
+ }
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ LOG4CXX_INFO(logger_, "Received VR_DeleteCommand event");
+ is_vr_received_ = true;
+ vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (!IsPendingResponseExist()) {
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ smart_objects::SmartObject* command = application->FindCommand(
+ (*message_)[strings::msg_params][strings::cmd_id].asInt());
+
+ if (command) {
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_) &&
+ (hmi_apis::Common_Result::SUCCESS == vr_result_)) ||
+ ((hmi_apis::Common_Result::SUCCESS == ui_result_) &&
+ (hmi_apis::Common_Result::INVALID_ENUM == vr_result_)) ||
+ ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_) &&
+ (hmi_apis::Common_Result::SUCCESS == vr_result_));
+
+ if (result) {
+ application->RemoveCommand(
+ (*message_)[strings::msg_params][strings::cmd_id].asInt());
+ }
+
+ if (!result && (hmi_apis::Common_Result::REJECTED == ui_result_)) {
+ result_code = static_cast<mobile_apis::Result::eType>(vr_result_);
+ } else {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ std::max(ui_result_, vr_result_));
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ }
+ }
+}
+
+bool DeleteCommandRequest::IsPendingResponseExist() {
+ return is_ui_send_ != is_ui_received_ || is_vr_send_ != is_vr_received_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/src/commands/mobile/delete_command_response.cc
new file mode 100644
index 0000000000..812e587430
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_command_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_command_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteCommandResponse::DeleteCommandResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+DeleteCommandResponse::~DeleteCommandResponse() {
+}
+
+void DeleteCommandResponse::Run() {
+ LOG4CXX_INFO(logger_, "DeleteCommandResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/src/commands/mobile/delete_file_request.cc
new file mode 100644
index 0000000000..ca5a4395fc
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_file_request.cc
@@ -0,0 +1,115 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_file_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteFileRequest::DeleteFileRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+DeleteFileRequest::~DeleteFileRequest() {
+}
+
+void DeleteFileRequest::Run() {
+ LOG4CXX_INFO(logger_, "DeleteFileRequest::Run");
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ (profile::Profile::instance()->delete_file_in_none() <=
+ application->delete_file_in_none_count())) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // DeleteFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_, "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ const std::string& sync_file_name =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ std::string full_file_path =
+ profile::Profile::instance()->app_storage_folder() + "/";
+ full_file_path += application->folder_name();
+ full_file_path += "/";
+ full_file_path += sync_file_name;
+
+ if (file_system::FileExists(full_file_path)) {
+ if (file_system::DeleteFile(full_file_path)) {
+ const AppFile* file = application->GetFile(full_file_path);
+ if (file) {
+ SendFileRemovedNotification(file);
+ }
+
+ application->DeleteFile(full_file_path);
+ application->increment_delete_file_in_none_count();
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ } else {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ }
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void DeleteFileRequest::SendFileRemovedNotification(
+ const AppFile* file) const {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = connection_key();
+ msg_params[strings::file_name] = file->file_name;
+ msg_params[strings::file_type] = file->file_type;
+
+ CreateHMINotification(
+ hmi_apis::FunctionID::BasicCommunication_OnFileRemoved, msg_params);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
new file mode 100644
index 0000000000..81470ccf6b
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_file_response.cc
@@ -0,0 +1,69 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_file_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+DeleteFileResponse::~DeleteFileResponse() {
+}
+
+void DeleteFileResponse::Run() {
+ LOG4CXX_INFO(logger_, "DeleteFileResponse::Run");
+ uint32_t app_id = (*message_)[strings::params][strings::connection_key]
+ .asUInt();
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::space_available] =
+ static_cast<int32_t>(
+ ApplicationManagerImpl::instance()->GetAvailableSpaceForApp(app->name()));
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc
new file mode 100644
index 0000000000..1fcd4b33d8
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc
@@ -0,0 +1,138 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_interaction_choice_set_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/message_helper.h"
+namespace application_manager {
+
+namespace commands {
+
+DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {
+}
+
+void DeleteInteractionChoiceSetRequest::Run() {
+ LOG4CXX_INFO(logger_, "DeleteInteractionChoiceSetRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const int32_t choise_set_id =
+ (*message_)[strings::msg_params]
+ [strings::interaction_choice_set_id].asInt();
+
+ if (!app->FindChoiceSet(choise_set_id)) {
+ LOG4CXX_ERROR_EXT(logger_, "INVALID_ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+
+ if (ChoiceSetInUse(app)) {
+ LOG4CXX_ERROR_EXT(logger_, "Choice set currently in use");
+ SendResponse(false, mobile_apis::Result::IN_USE);
+ return;
+ }
+ SendVrDeleteCommand(app);
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::interaction_choice_set_id] = choise_set_id;
+ msg_params[strings::app_id] = app->app_id();
+
+ app->RemoveChoiceSet(choise_set_id);
+
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+ /*CreateHMIRequest(hmi_apis::FunctionID::UI_DeleteInteractionChoiceSet,
+ msg_params, true);*/
+}
+
+bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(ApplicationConstSharedPtr app) {
+ if (app->is_perform_interaction_active()) {
+ // retrieve stored choice sets for perform interaction
+ const PerformChoiceSetMap& choice_set_map = app
+ ->performinteraction_choice_set_map();
+
+ PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
+ for (; choice_set_map.end() != it; ++it) {
+ if (it->first
+ == (*message_)[strings::msg_params]
+ [strings::interaction_choice_set_id].asUInt()) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "DeleteInteractionChoiceSetRequest::ChoiceSetInUse");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand(
+ application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::SendVrDeleteCommand");
+
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet((*message_)[strings::msg_params]
+ [strings::interaction_choice_set_id].asInt());
+
+ if (choice_set) {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id];
+ choice_set = &((*choice_set)[strings::choice_set]);
+ for (uint32_t i = 0; i < (*choice_set).length() ; ++i) {
+ msg_params[strings::cmd_id] = (*choice_set)[i][strings::choice_id];
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc
new file mode 100644
index 0000000000..d260add7cc
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc
@@ -0,0 +1,77 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_interaction_choice_set_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {
+}
+
+void DeleteInteractionChoiceSetResponse::Run() {
+ LOG4CXX_INFO(logger_, "DeleteInteractionChoiceSetResponse::Run");
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ const int32_t code =
+ (*message_)[strings::msg_params][strings::result_code].asInt();
+
+ if (hmi_apis::Common_Result::SUCCESS == code) {
+ SendResponse(true);
+ } else {
+ // TODO(DK): Some logic
+ SendResponse(false);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
new file mode 100644
index 0000000000..d91e742687
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc
@@ -0,0 +1,179 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_sub_menu_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteSubMenuRequest::DeleteSubMenuRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+DeleteSubMenuRequest::~DeleteSubMenuRequest() {
+}
+
+void DeleteSubMenuRequest::Run() {
+ LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (!app->FindSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt())) {
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] =
+ (*message_)[strings::msg_params][strings::menu_id];
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
+}
+
+void DeleteSubMenuRequest::DeleteSubMenuVRCommands(ApplicationConstSharedPtr app) {
+ LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::DeleteSubMenuVRCommands");
+
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ if ((*message_)[strings::msg_params][strings::menu_id].asInt()
+ == (*it->second)[strings::menu_params]
+ [hmi_request::parent_id].asInt()) {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::grammar_id] = app->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params);
+ }
+ }
+}
+
+void DeleteSubMenuRequest::DeleteSubMenuUICommands(ApplicationSharedPtr const app) {
+ LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::DeleteSubMenuUICommands");
+
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator it = commands.begin();
+
+ while (commands.end() != it) {
+
+ if (!(*it->second).keyExists(strings::menu_params)) {
+ continue;
+ }
+
+ if ((*message_)[strings::msg_params][strings::menu_id].asInt()
+ == (*it->second)[strings::menu_params]
+ [hmi_request::parent_id].asInt()) {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
+
+ app->RemoveCommand((*it->second)[strings::cmd_id].asInt());
+
+ it = commands.begin(); // Can not relay on
+ // iterators after erase was called
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params);
+ } else {
+ ++it;
+ }
+ }
+}
+
+void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "DeleteSubMenuRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (result) {
+ // delete sub menu items from SDL and HMI
+ DeleteSubMenuVRCommands(application);
+ DeleteSubMenuUICommands(application);
+ application->RemoveSubMenu(
+ (*message_)[strings::msg_params][strings::menu_id].asInt());
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc
new file mode 100644
index 0000000000..0a25a11610
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/delete_sub_menu_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DeleteSubMenuResponse::DeleteSubMenuResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+DeleteSubMenuResponse::~DeleteSubMenuResponse() {
+}
+
+void DeleteSubMenuResponse::Run() {
+ LOG4CXX_INFO(logger_, "DeleteSubMenuResponse::Run");
+
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
new file mode 100644
index 0000000000..75016c05fb
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/diagnostic_message_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DiagnosticMessageRequest::DiagnosticMessageRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+DiagnosticMessageRequest::~DiagnosticMessageRequest() {
+}
+
+void DiagnosticMessageRequest::Run() {
+ LOG4CXX_INFO(logger_, "DiagnosticMessageRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ // Add app_id for HMI request
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
+ &(*message_)[strings::msg_params], true);
+
+}
+
+void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "DiagnosticMessageRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
new file mode 100644
index 0000000000..2a8b234fff
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/diagnostic_message_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DiagnosticMessageResponse::DiagnosticMessageResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+DiagnosticMessageResponse::~DiagnosticMessageResponse() {
+}
+
+void DiagnosticMessageResponse::Run() {
+ LOG4CXX_INFO(logger_, "DiagnosticMessageResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/src/commands/mobile/dial_number_request.cc
new file mode 100644
index 0000000000..140f43128d
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/dial_number_request.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/dial_number_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+DialNumberRequest::~DialNumberRequest() {
+}
+
+void DialNumberRequest::Run() {
+ LOG4CXX_INFO(logger_, "DialNumberRequest::Run");
+
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_REQUEST);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..eedc9f813e
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+EndAudioPassThruRequest::EndAudioPassThruRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+EndAudioPassThruRequest::~EndAudioPassThruRequest() {
+}
+
+void EndAudioPassThruRequest::Run() {
+ LOG4CXX_INFO(logger_, "EndAudioPassThruRequest::Run");
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
+}
+
+void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "EndAudioPassThruRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ mobile_apis::Result::eType mobile_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ bool result = mobile_apis::Result::SUCCESS == mobile_code;
+
+ if (result) {
+ bool ended_successfully =
+ ApplicationManagerImpl::instance()->end_audio_pass_thru();
+ if (ended_successfully) {
+ ApplicationManagerImpl::instance()->StopAudioPassThru(
+ connection_key());
+ }
+ }
+
+ SendResponse(result, mobile_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..128d921f9f
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/end_audio_pass_thru_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+EndAudioPassThruResponse::EndAudioPassThruResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+EndAudioPassThruResponse::~EndAudioPassThruResponse() {
+}
+
+void EndAudioPassThruResponse::Run() {
+ LOG4CXX_INFO(logger_, "EndAudioPassThruResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/generic_response.cc b/src/components/application_manager/src/commands/mobile/generic_response.cc
new file mode 100644
index 0000000000..69c841b2f1
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/generic_response.cc
@@ -0,0 +1,65 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/generic_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+void GenericResponse::Run() {
+ /*NsSmartDeviceLink::NsSmartObjects::SmartObject response;
+
+ response[strings::params][strings::correlation_id] =
+ (*message_)[strings::params][strings::correlation_id];
+ response[strings::params][strings::protocol_version] =
+ (*message_)[strings::params][strings::protocol_version];
+ response[strings::params][strings::connection_key] =
+ (*message_)[strings::params][strings::connection_key];
+
+ response[strings::msg_params][strings::success] = false;
+ */
+
+ (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message_)[strings::msg_params][strings::success] = false;
+ (*message_)[strings::msg_params][strings::result_code] =
+ mobile_apis::Result::INVALID_DATA;
+
+ SendResponse(false);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
new file mode 100644
index 0000000000..9a81f94db1
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc
@@ -0,0 +1,108 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/get_dtcs_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetDTCsRequest::GetDTCsRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+GetDTCsRequest::~GetDTCsRequest() {
+}
+
+void GetDTCsRequest::Run() {
+ LOG4CXX_INFO(logger_, "GetDTCsRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ LOG4CXX_ERROR(logger_, "App has not been activated");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::ecu_name] =
+ (*message_)[strings::msg_params][strings::ecu_name];
+
+ if ((*message_)[strings::msg_params].keyExists(strings::dtc_mask)) {
+ msg_params[strings::dtc_mask] =
+ (*message_)[strings::msg_params][strings::dtc_mask];
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true);
+}
+
+void GetDTCsRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetDTCsRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
new file mode 100644
index 0000000000..2ed7a92952
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/get_dtcs_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetDTCsResponse::GetDTCsResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+GetDTCsResponse::~GetDTCsResponse() {
+}
+
+void GetDTCsResponse::Run() {
+ LOG4CXX_INFO(logger_, "GetDTCsResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
new file mode 100644
index 0000000000..a3d08a15ff
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
@@ -0,0 +1,302 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "application_manager/commands/mobile/get_vehicle_data_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace str = strings;
+
+#ifdef HMI_DBUS_API
+GetVehicleDataRequest::GetVehicleDataRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+GetVehicleDataRequest::~GetVehicleDataRequest() {
+}
+
+void GetVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "GetVehicleDataRequest::Run");
+
+ int32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ LOG4CXX_ERROR(logger_, "app in HMI level HMI_NONE");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[str::msg_params].keyExists(it->first)
+ && true == (*message_)[str::msg_params][it->first].asBool()) {
+ SendRequestsToHmi(app->app_id());
+ return;
+ }
+ }
+
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+}
+
+namespace {
+ struct Subrequest {
+ hmi_apis::FunctionID::eType func_id;
+ const char* str;
+ };
+ Subrequest subrequests[] = {
+ { hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps},
+ { hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed},
+ { hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm},
+ { hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level},
+ { hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState, str::fuel_level_state},
+ { hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption, str::instant_fuel_consumption},
+ { hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature, str::external_temp},
+ { hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin},
+ { hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl},
+ { hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure},
+ { hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer},
+ { hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status},
+ { hmi_apis::FunctionID::VehicleInfo_GetBodyInformation, str::body_information},
+ { hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status},
+ { hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking},
+ { hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status},
+ { hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus, str::head_lamp_status},
+ { hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque},
+ { hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos},
+ { hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle, str::steering_wheel_angle},
+ { hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info},
+ { hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status},
+ { hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event},
+ { hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus, str::cluster_mode_status},
+ { hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key},
+ };
+}
+
+void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) {
+ smart_objects::SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app_id;
+
+ for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
+ const Subrequest& sr = subrequests[i];
+ if (true == (*message_)[str::msg_params].keyExists(sr.str)
+ && true == (*message_)[str::msg_params][sr.str].asBool()) {
+ HmiRequest hmi_request;
+ hmi_request.str = sr.str;
+ hmi_request.func_id = sr.func_id;
+ hmi_request.complete = false;
+ hmi_requests_.push_back(hmi_request);
+ }
+ }
+
+ LOG4CXX_INFO(logger_,
+ hmi_requests_.size() << " requests are going to be sent to HMI");
+
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ SendHMIRequest(it->func_id, &msg_params, true);
+ }
+}
+
+void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event " << event.id());
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ for (HmiRequests::iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ HmiRequest & hmi_request = *it;
+ if (hmi_request.func_id == event.id()) {
+ hmi_request.status =
+ static_cast<hmi_apis::Common_Result::eType>(message[strings::params][hmi_response::code]
+ .asInt());
+ if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
+ hmi_request.value = message[str::msg_params][hmi_request.str];
+ hmi_request.complete = true;
+ break;
+ }
+ }
+
+ bool all_complete = true;
+ bool any_arg_success = false;
+ mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ if (!it->complete) {
+ all_complete = false;
+ break;
+ }
+ if (hmi_apis::Common_Result::SUCCESS != it->status) {
+ if (mobile_api::Result::SUCCESS == status) {
+ status = static_cast<mobile_apis::Result::eType>(it->status);
+ } else if (status
+ != static_cast<mobile_apis::Result::eType>(it->status)) {
+ status = mobile_api::Result::eType::GENERIC_ERROR;
+ }
+ LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status << ", so response status become " << status);
+ } else {
+ any_arg_success = true;
+ }
+ }
+
+ if (all_complete) {
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ if (any_arg_success) {
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ response_params[it->str] = it->value;
+ }
+ }
+ LOG4CXX_INFO(
+ logger_, "All HMI requests are complete");
+ const char *info = NULL;
+ std::string error_message;
+ if (true == message[strings::params].keyExists(strings::error_msg)) {
+ error_message = message[strings::params][strings::error_msg].asString();
+ info = error_message.c_str();
+ }
+ SendResponse( any_arg_success, status, info, &response_params);
+ }
+}
+#else
+GetVehicleDataRequest::GetVehicleDataRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+GetVehicleDataRequest::~GetVehicleDataRequest() {
+}
+
+void GetVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "GetVehicleDataRequest::Run");
+
+ int32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ LOG4CXX_ERROR(logger_, "app in HMI level HMI_NONE.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ if (app->IsCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::CONFIG_FILE)) {
+ LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ const uint32_t min_length_msg_params = 1;
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[str::msg_params].keyExists(it->first)
+ && true == (*message_)[str::msg_params][it->first].asBool()) {
+ msg_params[it->first] = (*message_)[strings::msg_params][it->first];
+ }
+ }
+ if (msg_params.length() > min_length_msg_params) {
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
+ &msg_params, true);
+ return;
+ } else if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetVehicleDataRequest::on_event");
+ smart_objects::SmartObject message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool result = false;
+ if (mobile_apis::Result::SUCCESS == result_code ||
+ (hmi_apis::Common_Result::DATA_NOT_AVAILABLE ==
+ static_cast<hmi_apis::Common_Result::eType>(result_code)
+ && message[strings::msg_params].length() > 1)) {
+ result = true;
+ }
+ const char *info = NULL;
+ std::string error_message;
+ if (true ==
+ message[strings::msg_params].keyExists(hmi_response::method)) {
+ message[strings::msg_params].erase(hmi_response::method);
+ }
+ if (true == message[strings::params].keyExists(strings::error_msg)) {
+ error_message = message[strings::params][strings::error_msg].asString();
+ info = error_message.c_str();
+ }
+ SendResponse(result, result_code, info, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+#endif // #ifdef HMI_DBUS_API
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc
new file mode 100644
index 0000000000..d9087fdc61
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/get_vehicle_data_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetVehicleDataResponse::GetVehicleDataResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+GetVehicleDataResponse::~GetVehicleDataResponse() {
+}
+
+void GetVehicleDataResponse::Run() {
+ LOG4CXX_INFO(logger_, "GetVehicleDataResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/list_files_request.cc b/src/components/application_manager/src/commands/mobile/list_files_request.cc
new file mode 100644
index 0000000000..d0fa71d466
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/list_files_request.cc
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/list_files_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "config_profile/profile.h"
+#include "application_manager/mobile_command_factory.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+ListFilesRequest::~ListFilesRequest() {
+}
+
+void ListFilesRequest::Run() {
+ LOG4CXX_INFO(logger_, "ListFilesRequest::Run");
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) &&
+ (profile::Profile::instance()->list_files_in_none() <=
+ application->list_files_in_none_count())) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // DeleteFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_, "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ application->increment_list_files_in_none_count();
+
+ (*message_)[strings::msg_params][strings::space_available] =
+ static_cast<int32_t>(ApplicationManagerImpl::instance()->
+ GetAvailableSpaceForApp(application->folder_name()));
+ int32_t i = 0;
+ const AppFilesMap& app_files = application->getAppFiles();
+ for (AppFilesMap::const_iterator it = app_files.begin();
+ it != app_files.end(); ++it) {
+ //In AppFile to application stored full path to file. In message required
+ //to write only name file.
+ //Plus one required for move to next letter after '/'.
+ (*message_)[strings::msg_params][strings::filenames][i++] =
+ it->first.substr(it->first.find_last_of('/') + 1);
+ }
+ (*message_)[strings::params][strings::message_type] =
+ application_manager::MessageType::kResponse;
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL,
+ &(*message_)[strings::msg_params]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/list_files_response.cc b/src/components/application_manager/src/commands/mobile/list_files_response.cc
new file mode 100644
index 0000000000..6ffbec1ac4
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/list_files_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/list_files_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ListFilesResponse::ListFilesResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+ListFilesResponse::~ListFilesResponse() {
+}
+
+void ListFilesResponse::Run() {
+ LOG4CXX_INFO(logger_, "ListFilesResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc
new file mode 100644
index 0000000000..ebd0d6aac1
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc
@@ -0,0 +1,55 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+namespace commands {
+
+OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnAppInterfaceUnregisteredNotification::~OnAppInterfaceUnregisteredNotification() {
+}
+
+void OnAppInterfaceUnregisteredNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAppInterfaceUnregisteredNotification::Run");
+
+ SendNotification();
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc
new file mode 100644
index 0000000000..2515f591b1
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc
@@ -0,0 +1,53 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
+
+namespace application_manager {
+namespace commands {
+
+OnAudioPassThruNotification::OnAudioPassThruNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnAudioPassThruNotification::~OnAudioPassThruNotification() {
+}
+
+void OnAudioPassThruNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnAudioPassThruNotification::Run");
+
+ SendNotification();
+}
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc
new file mode 100644
index 0000000000..55b9b8818d
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc
@@ -0,0 +1,163 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_button_event_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnButtonEventNotification::OnButtonEventNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnButtonEventNotification::~OnButtonEventNotification() {
+}
+
+void OnButtonEventNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnButtonEventNotification::Run");
+
+ const uint32_t btn_id =
+ static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ // CUSTOM_BUTTON notification
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ // app_id is mandatory for CUSTOM_BUTTON notification
+ if (false == (*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ LOG4CXX_ERROR_EXT(logger_, "CUSTOM_BUTTON OnButtonEvent without app_id.");
+ return;
+ }
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (false == (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "CUSTOM_BUTTON OnButtonEvent without custom_button_id.");
+ return;
+ }
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
+ if (false == app.valid()) {
+ LOG4CXX_ERROR_EXT(logger_, "Application doesn't exist.");
+ return;
+ }
+
+ uint32_t custom_btn_id = 0;
+ custom_btn_id = (*message_)[strings::msg_params]
+ [hmi_response::custom_button_id].asUInt();
+
+ if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ SendButtonEvent(app);
+ return;
+ }
+
+ const std::vector<ApplicationSharedPtr>& subscribedApps =
+ ApplicationManagerImpl::instance()->applications_by_button(btn_id);
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = subscribedApps.begin();
+ for (; subscribedApps.end() != it; ++it) {
+ ApplicationSharedPtr subscribed_app = *it;
+ if (!subscribed_app) {
+ LOG4CXX_WARN_EXT(logger_, "Null pointer to subscribed app.");
+ continue;
+ }
+
+ //Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ LOG4CXX_WARN_EXT(logger_, "OnButtonEvent in HMI_BACKGROUND or NONE");
+ continue;
+ }
+
+ //Send ButtonEvent notification for OK button only in HMI_FULL mode
+ if ((static_cast<uint32_t>(mobile_apis::ButtonName::OK) == btn_id) &&
+ (mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level())) {
+ continue;
+ }
+
+ SendButtonEvent(subscribed_app);
+ }
+}
+
+void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) {
+ smart_objects::SmartObject* on_btn_event = new smart_objects::SmartObject();
+
+ if (!on_btn_event) {
+ LOG4CXX_ERROR_EXT(logger_, "OnButtonEvent NULL pointer");
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "OnButtonEvent NULL pointer");
+ return;
+ }
+
+ (*on_btn_event)[strings::params][strings::connection_key] = app->app_id();
+
+ (*on_btn_event)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID);
+
+ (*on_btn_event)[strings::msg_params][strings::button_name] =
+ (*message_)[strings::msg_params][hmi_response::button_name];
+ (*on_btn_event)[strings::msg_params][strings::button_event_mode] =
+ (*message_)[strings::msg_params][hmi_response::button_mode];
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ (*on_btn_event)[strings::msg_params][strings::custom_button_id] =
+ (*message_)[strings::msg_params][strings::custom_button_id];
+ }
+
+ message_.reset(on_btn_event);
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
new file mode 100644
index 0000000000..cfafc7af1c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
@@ -0,0 +1,163 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_button_press_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnButtonPressNotification::OnButtonPressNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnButtonPressNotification::~OnButtonPressNotification() {
+}
+
+void OnButtonPressNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnButtonPressNotification::Run");
+
+ const uint32_t btn_id =
+ static_cast<uint32_t>(
+ (*message_)[strings::msg_params][hmi_response::button_name].asInt());
+
+ // CUSTOM_BUTTON notification
+ if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
+ // app_id is mandatory for CUSTOM_BUTTON notification
+ if (false == (*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ LOG4CXX_ERROR_EXT(logger_, "CUSTOM_BUTTON OnButtonPress without app_id.");
+ return;
+ }
+
+ // custom_button_id is mandatory for CUSTOM_BUTTON notification
+ if (false == (*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "CUSTOM_BUTTON OnButtonPress without custom_button_id.");
+ return;
+ }
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
+ if (false == app.valid()) {
+ LOG4CXX_ERROR_EXT(logger_, "Application doesn't exist.");
+ return;
+ }
+
+ uint32_t custom_btn_id = 0;
+ custom_btn_id = (*message_)[strings::msg_params]
+ [hmi_response::custom_button_id].asUInt();
+
+ if (false == app->IsSubscribedToSoftButton(custom_btn_id)) {
+ LOG4CXX_ERROR_EXT(logger_,
+ "Application doesn't subscribed to this custom_button_id.");
+ return;
+ }
+
+ SendButtonPress(app);
+ return;
+ }
+
+ const std::vector<ApplicationSharedPtr>& subscribedApps =
+ ApplicationManagerImpl::instance()->applications_by_button(btn_id);
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = subscribedApps.begin();
+ for (; subscribedApps.end() != it; ++it) {
+ ApplicationSharedPtr subscribed_app = *it;
+ if (!subscribed_app) {
+ LOG4CXX_WARN_EXT(logger_, "Null pointer to subscribed app.");
+ continue;
+ }
+
+ //Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) {
+ LOG4CXX_WARN_EXT(logger_, "OnButtonPress in HMI_BACKGROUND or NONE");
+ continue;
+ }
+
+ //Send ButtonPress notification for OK button only in HMI_FULL mode
+ if ((static_cast<uint32_t>(mobile_apis::ButtonName::OK) == btn_id) &&
+ (mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level())) {
+ continue;
+ }
+
+ SendButtonPress(subscribed_app);
+ }
+}
+
+void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
+ smart_objects::SmartObject* on_btn_press = new smart_objects::SmartObject();
+
+ if (!on_btn_press) {
+ LOG4CXX_ERROR_EXT(logger_, "OnButtonPress NULL pointer");
+ return;
+ }
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "OnButtonPress NULL pointer");
+ return;
+ }
+
+ (*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
+
+ (*on_btn_press)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonPressID);
+
+ (*on_btn_press)[strings::msg_params][strings::button_name] =
+ (*message_)[strings::msg_params][hmi_response::button_name];
+ (*on_btn_press)[strings::msg_params][strings::button_press_mode] =
+ (*message_)[strings::msg_params][hmi_response::button_mode];
+
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_response::custom_button_id)) {
+ (*on_btn_press)[strings::msg_params][strings::custom_button_id] =
+ (*message_)[strings::msg_params][strings::custom_button_id];
+ }
+
+ message_.reset(on_btn_press);
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/src/commands/mobile/on_command_notification.cc
new file mode 100644
index 0000000000..8342d05a45
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_command_notification.cc
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_command_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnCommandNotification::OnCommandNotification(const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnCommandNotification::~OnCommandNotification() {
+}
+
+void OnCommandNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnCommandNotification::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::msg_params][strings::app_id].asInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "No application associated with session key");
+ return;
+ }
+
+ const uint32_t cmd_id = (*message_)[strings::msg_params][strings::cmd_id]
+ .asUInt();
+
+ if (!app->FindCommand(cmd_id)) {
+ LOG4CXX_ERROR_EXT(logger_,
+ " No applications found for the command " << cmd_id);
+ return;
+ }
+
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ // remove app_id from notification
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ (*message_)[strings::msg_params].erase(strings::app_id);
+ }
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc
new file mode 100644
index 0000000000..fc92c17e94
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc
@@ -0,0 +1,63 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnDriverDistractionNotification::OnDriverDistractionNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnDriverDistractionNotification::~OnDriverDistractionNotification() {
+}
+
+void OnDriverDistractionNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnDriverDistractionNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc
new file mode 100644
index 0000000000..b9ee1339bb
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc
@@ -0,0 +1,75 @@
+
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_hash_change_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include <string>
+#include <sstream>
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnHashChangeNotification::OnHashChangeNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnHashChangeNotification::~OnHashChangeNotification() {
+}
+
+void OnHashChangeNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnHashChangeNotification::Run");
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ int32_t app_id;
+ app_id = (*message_)[strings::params][strings::connection_key].asInt();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ std::stringstream stream;
+ stream << app->curHash();
+ (*message_)[strings::msg_params][strings::hash_id] = stream.str();
+ SendNotification();
+}
+
+} //namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc
new file mode 100644
index 0000000000..9c03c0f623
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc
@@ -0,0 +1,87 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_hmi_status_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+namespace commands {
+
+OnHMIStatusNotification::OnHMIStatusNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnHMIStatusNotification::~OnHMIStatusNotification() {
+}
+
+void OnHMIStatusNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnHMIStatusNotification::Run");
+
+ (*message_)[strings::params][strings::message_type] = static_cast<int32_t> (
+ application_manager::MessageType::kNotification);
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+ if (!app.valid()) {
+ LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist");
+ return;
+ }
+ mobile_apis::HMILevel::eType hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*message_)[strings::msg_params][strings::hmi_level].asInt());
+ if ((mobile_apis::HMILevel::HMI_BACKGROUND == hmi_level) ||
+ (mobile_apis::HMILevel::HMI_NONE == hmi_level)) {
+ if (!(app->tts_properties_in_none())) {
+ app->set_tts_properties_in_none(true);
+ LOG4CXX_INFO(logger_, "OnHMIStatusNotification::Send TTS GlobalProperties"
+ " with empty array to HMI");
+ MessageHelper::SendTTSGlobalProperties(app, false);
+ }
+ } else if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) ||
+ (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) {
+ if (!(app->tts_properties_in_full())) {
+ app->set_tts_properties_in_full(true);
+ LOG4CXX_INFO(logger_, "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList");
+ ApplicationManagerImpl::instance()->AddAppToTTSGlobalPropertiesList(
+ app->app_id());
+ }
+ }
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc
new file mode 100644
index 0000000000..969885ab16
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnKeyBoardInputNotification::OnKeyBoardInputNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnKeyBoardInputNotification::~OnKeyBoardInputNotification() {
+}
+
+void OnKeyBoardInputNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnKeyBoardInputNotification::Run");
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ ApplicationManagerImpl::instance()->applications_with_navi();
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc
new file mode 100644
index 0000000000..f550df8748
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_language_change_notification.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnLanguageChangeNotification::OnLanguageChangeNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnLanguageChangeNotification::~OnLanguageChangeNotification() {
+}
+
+void OnLanguageChangeNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnLanguageChangeNotification::Run");
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
new file mode 100644
index 0000000000..37c81085eb
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc
@@ -0,0 +1,61 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_permissions_change_notification.h"
+#include "application_manager/message.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnPermissionsChangeNotification::OnPermissionsChangeNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {
+}
+
+void OnPermissionsChangeNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnPermissionsChangeNotification::Run");
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ SendNotification();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
new file mode 100644
index 0000000000..ebf98cd7e8
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_system_request_notification.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnSystemRequestNotification::OnSystemRequestNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnSystemRequestNotification::~OnSystemRequestNotification() {
+}
+
+void OnSystemRequestNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnSystemRequestNotification::Run");
+
+ mobile_apis::RequestType::eType request_type = static_cast<mobile_apis::RequestType::eType>
+ ((*message_)[strings::msg_params][strings::request_type].asInt());
+
+ if (mobile_apis::RequestType::PROPRIETARY == request_type) {
+ std::string filename = (*message_)[strings::msg_params][strings::file_name].asString();
+
+ std::vector<uint8_t> binary_data;
+ file_system::ReadBinaryFile(filename, binary_data);
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+ (*message_)[strings::msg_params][strings::file_type] =
+ mobile_apis::FileType::JSON;
+ } else if (mobile_apis::RequestType::HTTP == request_type) {
+ (*message_)[strings::msg_params][strings::file_type] =
+ mobile_apis::FileType::BINARY;
+ // TODO(PV): if needed for HTTP HMI case to be changed.
+ //(*message_)[strings::params][strings::binary_data] = binary_data;
+ }
+
+ SendNotification();
+}
+
+} //namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc
new file mode 100644
index 0000000000..05494c6144
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnTBTClientStateNotification::OnTBTClientStateNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnTBTClientStateNotification::~OnTBTClientStateNotification() {
+}
+
+void OnTBTClientStateNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnTBTClientStateNotification::Run");
+
+ (*message_)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ ApplicationManagerImpl::instance()->applications_with_navi();
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
new file mode 100644
index 0000000000..250faa8f38
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_touch_event_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+OnTouchEventNotification::OnTouchEventNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnTouchEventNotification::~OnTouchEventNotification() {
+}
+
+void OnTouchEventNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnTouchEventNotification::Run");
+
+ const std::vector<ApplicationSharedPtr>& applications =
+ ApplicationManagerImpl::instance()->applications_with_navi();
+
+ std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ ApplicationSharedPtr app = *it;
+ if (mobile_apis::HMILevel::HMI_FULL == app->hmi_level()) {
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+ SendNotification();
+ }
+ }
+}
+
+} // namespace mobile
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc
new file mode 100644
index 0000000000..420c42f30c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc
@@ -0,0 +1,89 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnVehicleDataNotification::OnVehicleDataNotification(
+ const MessageSharedPtr& message)
+ : CommandNotificationImpl(message) {
+}
+
+OnVehicleDataNotification::~OnVehicleDataNotification() {
+}
+
+void OnVehicleDataNotification::Run() {
+ LOG4CXX_INFO(logger_, "OnVehicleDataNotification::Run");
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (true == (*message_)[strings::msg_params].keyExists(it->first)) {
+ const std::vector<utils::SharedPtr<Application>>& applications =
+ ApplicationManagerImpl::instance()->IviInfoUpdated(it->second,
+ (*message_)[strings::msg_params][it->first].asInt());
+
+ std::vector<utils::SharedPtr<Application>>::const_iterator it = applications.begin();
+ for (; applications.end() != it; ++it) {
+ utils::SharedPtr<Application> app = *it;
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "NULL pointer");
+ continue;
+ }
+
+ LOG4CXX_INFO(
+ logger_,
+ "Send OnVehicleData PRNDL notification to " << app->name()
+ << " application id " << app->app_id());
+
+ (*message_)[strings::params][strings::connection_key] = app->app_id();
+
+ SendNotification();
+ }
+
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
new file mode 100644
index 0000000000..c5f269fc48
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc
@@ -0,0 +1,316 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace str = strings;
+
+PerformAudioPassThruRequest::PerformAudioPassThruRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ is_active_tts_speak_(false),
+ result_tts_speak_(mobile_apis::Result::SUCCESS) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {
+}
+
+void PerformAudioPassThruRequest::onTimeOut() {
+ LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::onTimeOut");
+
+ if (ApplicationManagerImpl::instance()->end_audio_pass_thru()) {
+ ApplicationManagerImpl::instance()->StopAudioPassThru(connection_key());
+ }
+
+ FinishTTSSpeak();
+
+ CommandRequestImpl::onTimeOut();
+}
+
+bool PerformAudioPassThruRequest::Init() {
+ default_timeout_ += (((*message_)[str::msg_params][str::max_duration].asInt())/1000);
+ return true;
+}
+
+void PerformAudioPassThruRequest::Run() {
+ LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::Run");
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ LOG4CXX_ERROR(logger_, "application isn't activated");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming perform audio pass thru has contains \\t\\n \\\\t \\\\n"
+ " text contains only whitespace in initialPrompt");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
+ (0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
+ // In case TTS Speak, subscribe on notification
+ SendSpeakRequest();
+ SendPerformAudioPassThruRequest();
+ } else {
+ SendPerformAudioPassThruRequest();
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+ }
+}
+
+void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
+
+ mobile_apis::Result::eType mobile_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ // in case perform audio is started by other request skip stopping
+ if (mobile_apis::Result::REJECTED == mobile_code) {
+ LOG4CXX_ERROR(logger_, "Request was rejected");
+ SendResponse(false, mobile_code, NULL, &(message[strings::msg_params]));
+ return;
+ }
+
+ if (ApplicationManagerImpl::instance()->end_audio_pass_thru()) {
+ ApplicationManagerImpl::instance()->StopAudioPassThru(connection_key());
+ }
+
+ FinishTTSSpeak();
+
+ std::string return_info;
+ bool result = mobile_apis::Result::SUCCESS == mobile_code ||
+ mobile_apis::Result::RETRY == mobile_code;
+
+ if ((mobile_apis::Result::SUCCESS == mobile_code) &&
+ (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_tts_speak_)) {
+ mobile_code = mobile_apis::Result::WARNINGS;
+ return_info = "Unsupported phoneme type sent in a prompt";
+ }
+
+ SendResponse(result, mobile_code, return_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ result_tts_speak_ = GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+ is_active_tts_speak_ = false;
+ SendRecordStartNotification();
+ StartMicrophoneRecording();
+ ApplicationManagerImpl::instance()->
+ updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ ApplicationManagerImpl::instance()->updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void PerformAudioPassThruRequest::SendSpeakRequest() {
+ // crate HMI TTS speak request
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
+ (0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
+ for (uint32_t i = 0;
+ i < (*message_)[str::msg_params][str::initial_prompt].length();
+ ++i) {
+ msg_params[hmi_request::tts_chunks][i][str::text] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::text];
+ msg_params[hmi_request::tts_chunks][i][str::type] =
+ (*message_)[str::msg_params][str::initial_prompt][i][str::type];
+ }
+ // app_id
+ msg_params[strings::app_id] = connection_key();
+ is_active_tts_speak_ = true;
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
+ }
+}
+
+void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[str::app_id] = connection_key();
+
+ // duration
+ msg_params[hmi_request::max_duration] =
+ (*message_)[str::msg_params][str::max_duration];
+
+ msg_params[hmi_request::audio_pass_display_texts] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text1)) {
+ msg_params[hmi_request::audio_pass_display_texts]
+ [0][hmi_request::field_name] = static_cast<int32_t>
+ (hmi_apis::Common_TextFieldName::audioPassThruDisplayText1);
+ msg_params[hmi_request::audio_pass_display_texts]
+ [0][hmi_request::field_text] =
+ (*message_)[str::msg_params][str::audio_pass_display_text1];
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text2)) {
+ msg_params[hmi_request::audio_pass_display_texts]
+ [1][hmi_request::field_name] = static_cast<int32_t>
+ (hmi_apis::Common_TextFieldName::audioPassThruDisplayText2);
+ msg_params[hmi_request::audio_pass_display_texts]
+ [1][hmi_request::field_text] =
+ (*message_)[str::msg_params][str::audio_pass_display_text2];
+ }
+
+ if ((*message_)[str::msg_params].keyExists(str::mute_audio)) {
+ msg_params[str::mute_audio] =
+ (*message_)[str::msg_params][str::mute_audio].asBool();
+ } else {
+ // If omitted, the value is set to true
+ msg_params[str::mute_audio] = true;
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_PerformAudioPassThru,
+ &msg_params, true);
+}
+
+void PerformAudioPassThruRequest::SendRecordStartNotification() {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = connection_key();
+
+ CreateHMINotification(hmi_apis::FunctionID::UI_OnRecordStart, msg_params);
+}
+
+void PerformAudioPassThruRequest::StartMicrophoneRecording() {
+ ApplicationManagerImpl::instance()->begin_audio_pass_thru();
+
+ ApplicationManagerImpl::instance()->StartAudioPassThruThread(
+ connection_key(), correlation_id(),
+ (*message_)[str::msg_params][str::max_duration].asInt(),
+ (*message_)[str::msg_params][str::sampling_rate].asInt(),
+ (*message_)[str::msg_params][str::bits_per_sample].asInt(),
+ (*message_)[str::msg_params][str::audio_type].asInt());
+}
+
+bool PerformAudioPassThruRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ const smart_objects::SmartArray* ip_array =
+ (*message_)[strings::msg_params][strings::initial_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
+ smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
+
+ for (; it_ip != it_ip_end; ++it_ip) {
+ str = (*it_ip)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].
+ keyExists(strings::audio_pass_display_text1)) {
+
+ str = (*message_)[strings::msg_params]
+ [strings::audio_pass_display_text1].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid audio_pass_display_text1 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].
+ keyExists(strings::audio_pass_display_text2)) {
+
+ str = (*message_)[strings::msg_params]
+ [strings::audio_pass_display_text2].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid audio_pass_display_text2 value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+void PerformAudioPassThruRequest::FinishTTSSpeak(){
+ if (is_active_tts_speak_) {
+ is_active_tts_speak_ = false;
+ SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc
new file mode 100644
index 0000000000..a10eaac9f3
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc
@@ -0,0 +1,58 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/perform_audio_pass_thru_response.h"
+#include "application_manager/application_manager_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+PerformAudioPassThruResponse::PerformAudioPassThruResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {
+}
+
+void PerformAudioPassThruResponse::Run() {
+ LOG4CXX_INFO(logger_, "PerformAudioPassThruResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
new file mode 100644
index 0000000000..12514626a6
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
@@ -0,0 +1,870 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <string>
+#include "application_manager/commands/mobile/perform_interaction_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+PerformInteractionRequest::PerformInteractionRequest(
+ const MessageSharedPtr& message)
+: CommandRequestImpl(message),
+ timer_("PerformInteractionReq", this, &PerformInteractionRequest::onTimer),
+ vr_perform_interaction_code_(mobile_apis::Result::INVALID_ENUM),
+ interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM),
+ ui_response_recived(false),
+ vr_response_recived(false) {
+
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand);
+ subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress);
+}
+
+PerformInteractionRequest::~PerformInteractionRequest() {
+}
+
+void PerformInteractionRequest::onTimer() {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::onTimer");
+}
+
+bool PerformInteractionRequest::Init() {
+
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ }
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ default_timeout_ *= 2;
+ }
+ return true;
+}
+
+void PerformInteractionRequest::Run() {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::Run");
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ mobile_apis::LayoutMode::eType interaction_layout =
+ mobile_apis::LayoutMode::INVALID_ENUM;
+ if ((*message_)[strings::msg_params].keyExists(
+ hmi_request::interaction_layout)) {
+ interaction_layout = static_cast<mobile_apis::LayoutMode::eType>(
+ (*message_)[strings::msg_params][hmi_request::interaction_layout].asInt());
+ }
+
+ if ((mobile_apis::InteractionMode::VR_ONLY ==
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt())) &&
+ (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "PerformInteraction contains InteractionMode = VR_ONLY and "
+ "interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((0 == (*message_)
+ [strings::msg_params][strings::interaction_choice_set_id_list].length()) &&
+ (mobile_apis::InteractionMode::BOTH ==
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt()))) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "interactionChoiceSetIDList is empty and InteractionMode=BOTH");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((0 == (*message_)
+ [strings::msg_params][strings::interaction_choice_set_id_list].length()) &&
+ (mobile_apis::LayoutMode::KEYBOARD != interaction_layout)) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "interactionChoiceSetIDList is empty and without parameter"
+ "interactionLayout=KEYBOARD");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImageVrHelpItems(
+ (*message_)[strings::msg_params][strings::vr_help], app)) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "MessageHelper::VerifyImageVrHelpItems return INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ if (!app->FindChoiceSet(choice_list[i].asInt())) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return;
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming perform interaction has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ int32_t mode =
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt();
+
+ app->set_perform_interaction_mode(mode);
+
+ interaction_mode_ = static_cast<mobile_apis::InteractionMode::eType>(mode);
+
+ switch (interaction_mode_) {
+ case mobile_apis::InteractionMode::BOTH: {
+ LOG4CXX_INFO(logger_, "Interaction Mode: BOTH");
+ if (!CheckChoiceSetVRSynonyms(app)) {
+ return;
+ }
+
+ if (!CheckChoiceSetMenuNames(app)) {
+ return;
+ }
+
+ if (!CheckVrHelpItemPositions(app)) {
+ return;
+ }
+
+ app->set_perform_interaction_active(correlation_id());
+ SendVRPerformInteractionRequest(app);
+ SendUIPerformInteractionRequest(app);
+ break;
+ }
+ case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ LOG4CXX_INFO(logger_, "Interaction Mode: MANUAL_ONLY");
+
+ if (!CheckChoiceSetVRSynonyms(app)) {
+ return;
+ }
+
+ if (!CheckChoiceSetMenuNames(app)) {
+ return;
+ }
+
+ if (!CheckVrHelpItemPositions(app)) {
+ return;
+ }
+
+ app->set_perform_interaction_active(correlation_id());
+ SendVRPerformInteractionRequest(app);
+ SendUIPerformInteractionRequest(app);
+ break;
+ }
+ case mobile_apis::InteractionMode::VR_ONLY: {
+ LOG4CXX_INFO(logger_, "Interaction Mode: VR_ONLY");
+ if (!CheckChoiceSetVRSynonyms(app)) {
+ return;
+ }
+
+ if (!CheckVrHelpItemPositions(app)) {
+ return;
+ }
+
+ // TODO(DK): need to implement timeout
+ app->set_perform_interaction_active(correlation_id());
+ SendVRPerformInteractionRequest(app);
+ SendUIPerformInteractionRequest(app);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown interaction mode");
+ return;
+ }
+ }
+
+ // TODO(DK): need to implement timeout TTS speak request.
+}
+
+void PerformInteractionRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::on_event");
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_PerformInteraction: {
+ LOG4CXX_INFO(logger_, "Received UI_PerformInteraction event");
+ ProcessPerformInteractionResponse(event.smart_object());
+ break;
+ }
+ case hmi_apis::FunctionID::VR_PerformInteraction: {
+ LOG4CXX_INFO(logger_, "Received TTS_PerformInteraction");
+ ProcessVRResponse(event.smart_object());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+void PerformInteractionRequest::onTimeOut() {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::onTimeOut");
+
+ switch (interaction_mode_) {
+ case mobile_apis::InteractionMode::BOTH: {
+ if (true == vr_response_recived) {
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ } else {
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ }
+ break;
+ }
+ case mobile_apis::InteractionMode::VR_ONLY: {
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ break;
+ }
+ case mobile_apis::InteractionMode::MANUAL_ONLY: {
+ unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
+ DisablePerformInteraction();
+ CommandRequestImpl::onTimeOut();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "INVALID ENUM");
+ return;
+ }
+ };
+}
+
+
+void PerformInteractionRequest::ProcessVRResponse(
+ const smart_objects::SmartObject& message) {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::ProcessVRResponse");
+ const uint32_t app_id = connection_key();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ if (!app.get()) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ vr_response_recived = true;
+ vr_perform_interaction_code_ = static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ if (mobile_apis::Result::ABORTED == vr_perform_interaction_code_ ||
+ mobile_apis::Result::TIMED_OUT == vr_perform_interaction_code_) {
+ LOG4CXX_INFO(logger_, "VR response aborted");
+ if (mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) {
+ LOG4CXX_INFO(logger_, "Aborted or Timeout Send Close Popup");
+ TerminatePerformInteraction();
+ SendResponse(false, vr_perform_interaction_code_);
+ return;
+ } else {
+ LOG4CXX_INFO(logger_, "Update timeout for UI");
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ return;
+ }
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject* ptr_msg_params = NULL;
+ if (message[strings::msg_params].keyExists(strings::choice_id)) {
+ if (CheckChoiceIDFromResponse(
+ app, message[strings::msg_params][strings::choice_id].asInt())) {
+ msg_params[strings::choice_id] =
+ message[strings::msg_params][strings::choice_id].asInt();
+ ptr_msg_params = &msg_params;
+ } else {
+ LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
+ TerminatePerformInteraction();
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR,
+ "Wrong choiceID was received from HMI");
+ return;
+ }
+ }
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ if (mobile_apis::Result::UNSUPPORTED_RESOURCE ==
+ vr_perform_interaction_code_) {
+ LOG4CXX_INFO(logger_, "VR response WARNINGS");
+ result_code = mobile_apis::Result::WARNINGS;
+ } else {
+ LOG4CXX_INFO(logger_, "VR response SUCCESS");
+ result_code = mobile_apis::Result::SUCCESS;
+ msg_params[strings::trigger_source] =
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR);
+ ptr_msg_params = &msg_params;
+ }
+ TerminatePerformInteraction();
+ SendResponse(true, result_code, NULL, ptr_msg_params);
+}
+
+void PerformInteractionRequest::ProcessPerformInteractionResponse(
+ const smart_objects::SmartObject& message) {
+ LOG4CXX_INFO(logger_,
+ "PerformInteractionRequest::ProcessPerformInteractionResponse");
+ const uint32_t app_id = connection_key();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ if (!app.get()) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+ ui_response_recived = true;
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params = message[strings::msg_params];
+ bool result = false;
+
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ if ((mobile_apis::Result::SUCCESS == result_code) ||
+ (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code)) {
+ if (message[strings::msg_params].keyExists(strings::choice_id) &&
+ !(CheckChoiceIDFromResponse(
+ app, message[strings::msg_params][strings::choice_id].asInt()))) {
+ DisablePerformInteraction();
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR,
+ "Wrong choiceID was received from HMI");
+ return;
+ }
+ if (message[strings::msg_params].keyExists(strings::manual_text_entry)) {
+ msg_params[strings::trigger_source] = mobile_apis::TriggerSource::TS_KEYBOARD;
+ } else {
+ msg_params[strings::trigger_source] = mobile_apis::TriggerSource::TS_MENU;
+ }
+ DisablePerformInteraction();
+ result = true;
+ } else if (mobile_apis::Result::REJECTED == result_code) {
+ LOG4CXX_ERROR(logger_, "Request was rejected");
+ }
+
+ const char* return_info = NULL;
+ if (result) {
+ if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info =
+ std::string("Unsupported phoneme type sent in any item").c_str();
+ }
+ }
+
+ if (mobile_apis::Result::TIMED_OUT == result_code) {
+ DisablePerformInteraction();
+ }
+
+ SendResponse(result, result_code, return_info, &(msg_params));
+}
+
+void PerformInteractionRequest::SendUIPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app) {
+ smart_objects::SmartObject& choice_set_id_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[hmi_request::initial_text][hmi_request::field_name] =
+ static_cast<int32_t>(
+ hmi_apis::Common_TextFieldName::initialInteractionText);
+ msg_params[hmi_request::initial_text][hmi_request::field_text] =
+ (*message_)[strings::msg_params][hmi_request::initial_text];
+ }
+ bool is_vr_help_item = false;
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != mode) {
+ msg_params[strings::vr_help_title] =
+ (*message_)[strings::msg_params][strings::initial_text].asString();
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ is_vr_help_item = true;
+ msg_params[strings::vr_help] =
+ (*message_)[strings::msg_params][strings::vr_help];
+ }
+ }
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ msg_params[strings::timeout] = default_timeout_/2;
+ } else {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+ msg_params[strings::app_id] = app->app_id();
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[strings::choice_set] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ }
+ int32_t index_array_of_vr_help = 0;
+ for (size_t i = 0; i < choice_set_id_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set = app->FindChoiceSet(
+ choice_set_id_list[i].asInt());
+ if (choice_set) {
+ // save perform interaction choice set
+ app->AddPerformInteractionChoiceSet(choice_set_id_list[i].asInt(),
+ *choice_set);
+ for (size_t j = 0; j < (*choice_set)[strings::choice_set].length(); ++j) {
+ if (mobile_apis::InteractionMode::VR_ONLY != mode) {
+ size_t index = msg_params[strings::choice_set].length();
+ msg_params[strings::choice_set][index] =
+ (*choice_set)[strings::choice_set][j];
+ // vrCommands should be added via VR.AddCommand only
+ msg_params[strings::choice_set][index].erase(strings::vr_commands);
+ }
+ if (mobile_apis::InteractionMode::MANUAL_ONLY !=
+ mode && !is_vr_help_item) {
+ smart_objects::SmartObject& vr_commands =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+ if (0 < vr_commands.length()) {
+ // copy only first synonym
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = vr_commands[0].asString();
+ item[strings::position] = index_array_of_vr_help + 1;
+ msg_params[strings::vr_help][index_array_of_vr_help++] = item;
+ }
+ }
+ }
+ }
+ }
+ if ((*message_)[strings::msg_params]
+ .keyExists(hmi_request::interaction_layout)
+ && mobile_apis::InteractionMode::VR_ONLY != mode) {
+ msg_params[hmi_request::interaction_layout] =
+ (*message_)[strings::msg_params][hmi_request::interaction_layout].
+ asInt();
+ }
+ CreateUIPerformInteraction(msg_params, app);
+}
+
+void PerformInteractionRequest::CreateUIPerformInteraction(
+ const smart_objects::SmartObject& msg_params,
+ application_manager::ApplicationSharedPtr const app) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_PerformInteraction,
+ &msg_params, true);
+}
+
+void PerformInteractionRequest::SendVRPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app) {
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ if (mobile_apis::InteractionMode::MANUAL_ONLY != interaction_mode_) {
+ msg_params[strings::grammar_id] = smart_objects::SmartObject(smart_objects::SmartType_Array);
+ int32_t grammar_id_index = 0;
+ for (uint32_t i = 0; i < choice_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+ if (!choice_set) {
+ LOG4CXX_WARN(logger_, "Couldn't found choiset");
+ continue;
+ }
+ msg_params[strings::grammar_id][grammar_id_index++]=
+ (*choice_set)[strings::grammar_id].asUInt();
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
+
+ msg_params[strings::help_prompt] =
+ (*message_)[strings::msg_params][strings::help_prompt];
+
+ } else {
+ if (choice_list.length() != 0) {
+ msg_params[strings::help_prompt] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ }
+ int32_t index = 0;
+ for (uint32_t i = 0; i < choice_list.length(); ++i) {
+ smart_objects::SmartObject* choice_set =
+ app->FindChoiceSet(choice_list[i].asInt());
+
+ if (choice_set) {
+ for (uint32_t j = 0;
+ j < (*choice_set)[strings::choice_set].length();
+ ++j) {
+ smart_objects::SmartObject& vr_commands =
+ (*choice_set)[strings::choice_set][j][strings::vr_commands];
+ if (0 < vr_commands.length()) {
+ // copy only first synonym
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ // Since there is no custom data from application side, SDL should
+ // construct prompt and append delimiter to each item
+ item[strings::text] = vr_commands[0].asString() +
+ profile::Profile::instance()->tts_delimiter();
+ msg_params[strings::help_prompt][index++] = item;
+ }
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Can't found choiceSet!");
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
+ msg_params[strings::timeout_prompt] =
+ (*message_)[strings::msg_params][strings::timeout_prompt];
+ } else {
+ if (msg_params.keyExists(strings::help_prompt)) {
+ msg_params[strings::timeout_prompt] = msg_params[strings::help_prompt];
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ msg_params[strings::initial_prompt] =
+ (*message_)[strings::msg_params][strings::initial_prompt];
+ }
+
+ mobile_apis::InteractionMode::eType mode =
+ static_cast<mobile_apis::InteractionMode::eType>(
+ (*message_)[strings::msg_params][strings::interaction_mode].asInt());
+
+ if (mobile_apis::InteractionMode::BOTH == mode ||
+ mobile_apis::InteractionMode::MANUAL_ONLY == mode) {
+ msg_params[strings::timeout] = default_timeout_/2;
+ } else {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::VR_PerformInteraction, &msg_params,
+ true);
+}
+
+bool PerformInteractionRequest::CheckChoiceSetMenuNames(
+ application_manager::ApplicationSharedPtr const app) {
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ // choice_set contains SmartObject msg_params
+ smart_objects::SmartObject* i_choice_set = app->FindChoiceSet(
+ choice_list[i].asInt());
+
+ for (size_t j = 0; j < choice_list.length(); ++j) {
+ smart_objects::SmartObject* j_choice_set = app->FindChoiceSet(
+ choice_list[j].asInt());
+
+ if (i == j) {
+ // skip check the same element
+ continue;
+ }
+
+ if (!i_choice_set || !j_choice_set) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ size_t ii = 0;
+ size_t jj = 0;
+ for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
+ for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ std::string ii_menu_name =
+ (*i_choice_set)[strings::choice_set][ii][strings::menu_name]
+ .asString();
+ std::string jj_menu_name =
+ (*j_choice_set)[strings::choice_set][jj][strings::menu_name]
+ .asString();
+
+ if (ii_menu_name == jj_menu_name) {
+ LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name");
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME,
+ "Choice set has duplicated menu name");
+ return false;
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
+ application_manager::ApplicationSharedPtr const app) {
+ smart_objects::SmartObject& choice_list =
+ (*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
+
+ for (size_t i = 0; i < choice_list.length(); ++i) {
+ // choice_set contains SmartObject msg_params
+ smart_objects::SmartObject* i_choice_set = app->FindChoiceSet(
+ choice_list[i].asInt());
+
+ for (size_t j = 0; j < choice_list.length(); ++j) {
+ smart_objects::SmartObject* j_choice_set = app->FindChoiceSet(
+ choice_list[j].asInt());
+
+ if (i == j) {
+ // skip check the same element
+ continue;
+ }
+
+ if ((!i_choice_set) || (!j_choice_set)) {
+ LOG4CXX_ERROR(logger_, "Invalid ID");
+ SendResponse(false, mobile_apis::Result::INVALID_ID);
+ return false;
+ }
+
+ size_t ii = 0;
+ size_t jj = 0;
+ for (; ii < (*i_choice_set)[strings::choice_set].length(); ++ii) {
+ for (; jj < (*j_choice_set)[strings::choice_set].length(); ++jj) {
+ // choice_set pointer contains SmartObject msg_params
+ smart_objects::SmartObject& ii_vr_commands =
+ (*i_choice_set)[strings::choice_set][ii][strings::vr_commands];
+
+ smart_objects::SmartObject& jj_vr_commands =
+ (*j_choice_set)[strings::choice_set][jj][strings::vr_commands];
+
+ for (size_t iii = 0; iii < ii_vr_commands.length(); ++iii) {
+ for (size_t jjj = 0; jjj < jj_vr_commands.length(); ++jjj) {
+ std::string vr_cmd_i = ii_vr_commands[iii].asString();
+ std::string vr_cmd_j = jj_vr_commands[jjj].asString();
+ if (0 == strcasecmp(vr_cmd_i.c_str(), vr_cmd_j.c_str())) {
+ LOG4CXX_ERROR(logger_, "Choice set has duplicated VR synonym");
+ SendResponse(false, mobile_apis::Result::DUPLICATE_NAME,
+ "Choice set has duplicated VR synonym");
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool PerformInteractionRequest::CheckVrHelpItemPositions(
+ application_manager::ApplicationSharedPtr const app) {
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ LOG4CXX_INFO(logger_, ""
+ "PerformInteractionRequest::CheckVrHelpItemPositions vr_help omitted");
+ return true;
+ }
+
+ smart_objects::SmartObject& vr_help =
+ (*message_)[strings::msg_params][strings::vr_help];
+
+ int32_t position = 1;
+ for (size_t i = 0; i < vr_help.length(); ++i) {
+ if (position != vr_help[i][strings::position].asInt()) {
+ LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position");
+ SendResponse(false, mobile_apis::Result::REJECTED,
+ "Non-sequential vrHelp item position");
+ return false;
+ }
+ ++position;
+ }
+ return true;
+}
+
+void PerformInteractionRequest::DisablePerformInteraction() {
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ if (app->is_perform_interaction_active()) {
+ app->set_perform_interaction_active(0);
+ app->set_perform_interaction_mode(-1);
+ app->DeletePerformInteractionChoiceSetMap();
+ }
+}
+
+bool PerformInteractionRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::initial_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed");
+ return true;
+ }
+
+
+ if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) {
+ const smart_objects::SmartArray* ip_array =
+ (*message_)[strings::msg_params][strings::initial_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_ip = ip_array->begin();
+ smart_objects::SmartArray::const_iterator it_ip_end = ip_array->end();
+
+ for (; it_ip != it_ip_end; ++it_ip) {
+ str = (*it_ip)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid initial_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::help_prompt)) {
+ const smart_objects::SmartArray* hp_array =
+ (*message_)[strings::msg_params][strings::help_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
+ smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
+
+ for (; it_hp != it_hp_end; ++it_hp) {
+ str = (*it_hp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) {
+ const smart_objects::SmartArray* tp_array =
+ (*message_)[strings::msg_params][strings::timeout_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
+ smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
+
+ for (; it_tp != it_tp_end; ++it_tp) {
+ str = (*it_tp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ const smart_objects::SmartArray* vh_array =
+ (*message_)[strings::msg_params][strings::vr_help].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
+ smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
+
+ for (; it_vh != it_vh_end; ++it_vh) {
+ str = (*it_vh)[strings::text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help syntax check failed");
+ return true;
+ }
+
+ if ((*it_vh).keyExists(strings::image)) {
+ str = (*it_vh)[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid vr_help image value syntax check failed");
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+void PerformInteractionRequest::TerminatePerformInteraction() {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[hmi_request::method_name] = "UI.PerformInteraction";
+ SendHMIRequest(hmi_apis::FunctionID::UI_ClosePopUp, &msg_params);
+ DisablePerformInteraction();
+}
+
+bool PerformInteractionRequest::CheckChoiceIDFromResponse(
+ ApplicationSharedPtr app, int32_t choice_id) {
+ LOG4CXX_INFO(logger_, "PerformInteractionRequest::CheckChoiceIDFromResponse");
+ const PerformChoiceSetMap& choice_set_map = app
+ ->performinteraction_choice_set_map();
+
+ for (PerformChoiceSetMap::const_iterator it = choice_set_map.begin();
+ choice_set_map.end() != it; ++it) {
+ const smart_objects::SmartObject& choice_set = (*it->second).getElement(
+ strings::choice_set);
+ for (size_t j = 0; j < choice_set.length(); ++j) {
+ if (choice_id ==
+ choice_set.getElement(j).getElement(strings::choice_id).asInt()) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
new file mode 100644
index 0000000000..4ceb4ce3b3
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/perform_interaction_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+PerformInteractionResponse::PerformInteractionResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+PerformInteractionResponse::~PerformInteractionResponse() {
+}
+
+void PerformInteractionResponse::Run() {
+ LOG4CXX_INFO(logger_, "PerformInteractionResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/put_file_request.cc b/src/components/application_manager/src/commands/mobile/put_file_request.cc
new file mode 100644
index 0000000000..8bb83888d6
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/put_file_request.cc
@@ -0,0 +1,250 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/put_file_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_impl.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+PutFileRequest::PutFileRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message)
+ , offset_(0)
+ , sync_file_name_()
+ , length_(0)
+ , file_type_(mobile_apis::FileType::INVALID_ENUM)
+ , is_persistent_file_(false) {
+}
+
+PutFileRequest::~PutFileRequest() {
+}
+
+void PutFileRequest::Run() {
+ LOG4CXX_INFO(logger_, "PutFileRequest::Run");
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+ smart_objects::SmartObject response_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() &&
+ profile::Profile::instance()->put_file_in_none() <=
+ application->put_file_in_none_count()) {
+ // If application is in the HMI_NONE level the quantity of allowed
+ // PutFile request is limited by the configuration profile
+ LOG4CXX_ERROR(logger_,
+ "Too many requests from the app with HMILevel HMI_NONE ");
+ SendResponse(false, mobile_apis::Result::REJECTED,
+ "Too many requests from the app with HMILevel HMI_NONE",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::params].keyExists(strings::binary_data)) {
+ LOG4CXX_ERROR(logger_, "Binary data empty");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "Binary data empty",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) {
+ LOG4CXX_ERROR(logger_, "No file name");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "No file name",
+ &response_params);
+ return;
+ }
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) {
+ LOG4CXX_ERROR(logger_, "No file type");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "No file type",
+ &response_params);
+ return;
+ }
+ sync_file_name_ =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+ file_type_ =
+ static_cast<mobile_apis::FileType::eType>(
+ (*message_)[strings::msg_params][strings::file_type].asInt());
+ const std::vector<uint8_t> binary_data =
+ (*message_)[strings::params][strings::binary_data].asBinary();
+
+ // Policy table update in json format is currently to be received via PutFile
+ // TODO(PV): after latest discussion has to be changed
+ if (mobile_apis::FileType::JSON == file_type_) {
+ policy::PolicyHandler::instance()->ReceiveMessageFromSDK(sync_file_name_, binary_data);
+ }
+
+ offset_ = 0;
+ is_persistent_file_ = false;
+ bool is_system_file = false;
+ length_ = binary_data.size();
+ bool is_download_compleate = true;
+ bool offset_exist =
+ (*message_)[strings::msg_params].keyExists(strings::offset);
+
+ if (offset_exist) {
+ offset_ = (*message_)[strings::msg_params][strings::offset].asInt64();
+ }
+
+ if ((*message_)[strings::msg_params].
+ keyExists(strings::persistent_file)) {
+ is_persistent_file_ =
+ (*message_)[strings::msg_params][strings::persistent_file].asBool();
+ }
+ if ((*message_)[strings::msg_params].
+ keyExists(strings::system_file)) {
+ is_system_file =
+ (*message_)[strings::msg_params][strings::system_file].asBool();
+ }
+
+ std::string file_path;
+
+ if (is_system_file) {
+ response_params[strings::space_available] = 0;
+ file_path = profile::Profile::instance()->system_files_path();
+ } else {
+ file_path = profile::Profile::instance()->app_storage_folder();
+ file_path += "/" + application->folder_name();
+
+ if (binary_data.size() >
+ ApplicationManagerImpl::instance()->GetAvailableSpaceForApp(application->name())) {
+ LOG4CXX_ERROR(logger_, "Out of memory");
+ SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY,
+ "Out of memory", &response_params);
+ return;
+ }
+ }
+
+ if (!file_system::CreateDirectoryRecursively(file_path)) {
+ LOG4CXX_ERROR(logger_, "Cann't create folder");
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR,
+ "Cann't create folder.", &response_params);
+ return;
+ }
+
+ mobile_apis::Result::eType save_result =
+ ApplicationManagerImpl::instance()->SaveBinary(binary_data, file_path,
+ sync_file_name_, offset_);
+ if (!is_system_file) {
+ response_params[strings::space_available] = static_cast<int32_t>(
+ ApplicationManagerImpl::instance()->GetAvailableSpaceForApp(application->folder_name()));
+ }
+
+ sync_file_name_ = file_path + "/" + sync_file_name_;
+ switch (save_result) {
+ case mobile_apis::Result::SUCCESS: {
+
+ if (!is_system_file) {
+ AppFile file(sync_file_name_, is_persistent_file_,
+ is_download_compleate, file_type_);
+
+ if (0 == offset_) {
+ LOG4CXX_INFO(logger_, "New file downloading");
+ if (!application->AddFile(file)) {
+
+ LOG4CXX_INFO(logger_,
+ "Couldn't add file to application (File already Exist"
+ << " in application and was rewritten on FS)");
+ /* It can be first part of new big file, so we need to update
+ information about it's downloading status and persistence */
+ if (!application->UpdateFile(file)) {
+ LOG4CXX_INFO(logger_, "Couldn't update file");
+ /* If it is impossible to update file, application doesn't
+ know about existing this file */
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "Couldn't update file",
+ &response_params);
+ return;
+ }
+ } else {
+ /* if file added - increment it's count
+ ( may be application->AddFile have to incapsulate it? )
+ Any way now this method evals not only in "none"*/
+ application->increment_put_file_in_none_count();
+ }
+ }
+ }
+
+ SendResponse(true, save_result, "File was downloaded", &response_params);
+ if (is_system_file) {
+ SendOnPutFileNotification();
+ }
+ break;
+ }
+ default:
+ LOG4CXX_INFO(logger_, "Save in unsuccessful. Result = " << save_result);
+ SendResponse(false, save_result, "Can't save file", &response_params);
+ break;
+ }
+}
+
+void PutFileRequest::SendOnPutFileNotification() {
+ LOG4CXX_INFO(logger_, "SendOnPutFileNotification" );
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& message = *notification;
+ message[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnPutFile;
+
+ message[strings::params][strings::message_type] = MessageType::kNotification;
+ message[strings::msg_params][strings::app_id] = connection_key();
+ message[strings::msg_params][strings::sync_file_name] = sync_file_name_;
+ message[strings::msg_params][strings::offset] = offset_;
+ if (0 == offset_) {
+ message[strings::msg_params][strings::file_size] =
+ (*message_)[strings::msg_params][strings::length];
+ }
+ message[strings::msg_params][strings::length] = length_;
+ message[strings::msg_params][strings::persistent_file] = is_persistent_file_;
+ message[strings::msg_params][strings::file_type] = file_type_;
+ ApplicationManagerImpl::instance()->ManageHMICommand(&message);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/put_file_response.cc b/src/components/application_manager/src/commands/mobile/put_file_response.cc
new file mode 100644
index 0000000000..4ab950d7a8
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/put_file_response.cc
@@ -0,0 +1,67 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/put_file_response.h"
+#include "utils/file_system.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+PutFileResponse::PutFileResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+PutFileResponse::~PutFileResponse() {
+}
+
+void PutFileResponse::Run() {
+ LOG4CXX_INFO(logger_, "PutFileResponse::Run");
+ uint32_t app_id = (*message_)[strings::params][strings::connection_key]
+ .asUInt();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/read_did_request.cc b/src/components/application_manager/src/commands/mobile/read_did_request.cc
new file mode 100644
index 0000000000..1de080df4c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/read_did_request.cc
@@ -0,0 +1,122 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/read_did_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ReadDIDRequest::ReadDIDRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+ReadDIDRequest::~ReadDIDRequest() {
+}
+
+void ReadDIDRequest::Run() {
+ LOG4CXX_INFO(logger_, "ReadDIDRequest::Run");
+
+ uint32_t app_id = (*message_)[strings::params][strings::connection_key]
+ .asUInt();
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+ LOG4CXX_INFO(logger_, "Correlation_id :" << (*message_)[strings::params][strings::correlation_id]
+ .asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "An application is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) {
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ LOG4CXX_ERROR(logger_, "Rejected");
+ return;
+ }
+
+ if (app->IsCommandLimitsExceeded(
+ static_cast<mobile_apis::FunctionID::eType>(function_id()),
+ application_manager::TLimitSource::CONFIG_FILE)) {
+ LOG4CXX_ERROR(logger_, "ReadDID frequency is too high.");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params][strings::did_location].empty()) {
+ LOG4CXX_ERROR_EXT(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::ecu_name] =
+ (*message_)[strings::msg_params][strings::ecu_name];
+ msg_params[strings::did_location] =
+ (*message_)[strings::msg_params][strings::did_location];
+
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true);
+}
+
+void ReadDIDRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ReadDIDRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/read_did_response.cc b/src/components/application_manager/src/commands/mobile/read_did_response.cc
new file mode 100644
index 0000000000..888b590758
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/read_did_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/read_did_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ReadDIDResponse::ReadDIDResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+ReadDIDResponse::~ReadDIDResponse() {
+}
+
+void ReadDIDResponse::Run() {
+ LOG4CXX_INFO(logger_, "ReadDIDResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
new file mode 100644
index 0000000000..d33a99a0a9
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc
@@ -0,0 +1,881 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/register_app_interface_request.h"
+
+#include <unistd.h>
+#include <algorithm>
+#include <string.h>
+
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace {
+
+mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
+ if ("DEFAULT" == str) {
+ return mobile_apis::AppHMIType::DEFAULT;
+ } else if ("COMMUNICATION" == str) {
+ return mobile_apis::AppHMIType::COMMUNICATION;
+ } else if ("MEDIA" == str) {
+ return mobile_apis::AppHMIType::MEDIA;
+ } else if ("MESSAGING" == str) {
+ return mobile_apis::AppHMIType::MESSAGING;
+ } else if ("NAVIGATION" == str) {
+ return mobile_apis::AppHMIType::NAVIGATION;
+ } else if ("INFORMATION" == str) {
+ return mobile_apis::AppHMIType::INFORMATION;
+ } else if ("SOCIAL" == str) {
+ return mobile_apis::AppHMIType::SOCIAL;
+ } else if ("BACKGROUND_PROCESS" == str) {
+ return mobile_apis::AppHMIType::BACKGROUND_PROCESS;
+ } else if ("TESTING" == str) {
+ return mobile_apis::AppHMIType::TESTING;
+ } else if ("SYSTEM" == str) {
+ return mobile_apis::AppHMIType::SYSTEM;
+ } else {
+ return mobile_apis::AppHMIType::INVALID_ENUM;
+ }
+}
+
+struct AppHMITypeInserter {
+ AppHMITypeInserter(smart_objects::SmartObject& so_array)
+ : index_(0),
+ so_array_(so_array) {
+ }
+
+ bool operator()(const std::string& app_hmi_type) {
+ so_array_[index_] = StringToAppHMIType(app_hmi_type);
+ ++index_;
+ return true;
+ }
+
+ private:
+ uint32_t index_;
+ smart_objects::SmartObject& so_array_;
+};
+
+struct CheckMissedTypes {
+ CheckMissedTypes(const policy::StringArray& policy_app_types,
+ std::string& log)
+ : policy_app_types_(policy_app_types),
+ log_(log) {
+ }
+
+ bool operator()(const smart_objects::SmartArray::value_type& value) {
+ std::string app_type_str = value.asString();
+ policy::StringArray::const_iterator it = policy_app_types_.begin();
+ policy::StringArray::const_iterator it_end = policy_app_types_.end();
+ for (; it != it_end; ++it) {
+ if (app_type_str == *it) {
+ return true;
+ }
+ }
+
+ log_ += app_type_str;
+ log_ += ",";
+
+ return true;
+ }
+
+ private:
+ const policy::StringArray& policy_app_types_;
+ std::string& log_;
+};
+}
+
+namespace application_manager {
+
+namespace commands {
+
+RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {
+}
+
+bool RegisterAppInterfaceRequest::Init() {
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::Init");
+ return true;
+}
+
+void RegisterAppInterfaceRequest::Run() {
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::Run " << connection_key());
+
+ // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA.
+ // Flag conditional compilation "CUSTOMER_PASA" is used in order to exclude hit code
+ // to RTC
+ if (true == profile::Profile::instance()->launch_hmi()) {
+ // wait till HMI started
+ while (!ApplicationManagerImpl::instance()->IsHMICooperating()) {
+ sleep(1);
+ // TODO(DK): timer_->StartWait(1);
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ }
+ }
+
+ std::string mobile_app_id = (*message_)[strings::msg_params][strings::app_id]
+ .asString();
+ if (policy::PolicyHandler::instance()->IsApplicationRevoked(mobile_app_id)) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (application) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
+ return;
+ }
+
+ mobile_apis::Result::eType policy_result = CheckWithPolicyData();
+ if (mobile_apis::Result::SUCCESS != policy_result
+ && mobile_apis::Result::WARNINGS != policy_result) {
+ SendResponse(false, policy_result);
+ return;
+ }
+
+ mobile_apis::Result::eType coincidence_result = CheckCoincidence();
+
+ if (mobile_apis::Result::SUCCESS != coincidence_result) {
+ LOG4CXX_ERROR_EXT(logger_, "Coincidence check failed.");
+ if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) {
+ usage_statistics::AppCounter count_of_rejections_duplicate_name(
+ policy::PolicyHandler::instance()->GetStatisticManager(), mobile_app_id,
+ usage_statistics::REJECTIONS_DUPLICATE_NAME);
+ ++count_of_rejections_duplicate_name;
+ }
+ SendResponse(false, coincidence_result);
+ return;
+ }
+
+ if (IsApplicationWithSameAppIdRegistered()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ return;
+ }
+
+ mobile_apis::Result::eType restriction_result = CheckRestrictions();
+ if (mobile_apis::Result::SUCCESS != restriction_result) {
+ LOG4CXX_ERROR_EXT(logger_, "Param names restrictions check failed.");
+ SendResponse(false, restriction_result);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_INFO(logger_,
+ "Incoming register app interface has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->RegisterApplication(message_);
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "Application " <<
+ msg_params[strings::app_name].asString() <<
+ " hasn't been registered!");
+ } else {
+
+ // For resuming application need to restore hmi_app_id from resumeCtrl
+ const std::string mobile_app_id = msg_params[strings::app_id].asString();
+ ResumeCtrl& resumer = ApplicationManagerImpl::instance()->resume_controller();
+
+ // there is side affect with 2 mobile app with the same mobile app_id
+ if (resumer.IsApplicationSaved(mobile_app_id)) {
+ app->set_hmi_application_id(resumer.GetHMIApplicationID(mobile_app_id));
+ } else {
+ app->set_hmi_application_id(
+ ApplicationManagerImpl::instance()->GenerateNewHMIAppID());
+ }
+
+ app->set_is_media_application(
+ msg_params[strings::is_media_application].asBool());
+
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ }
+
+ if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
+ app->set_ngn_media_screen_name(
+ msg_params[strings::ngn_media_screen_app_name]);
+ }
+
+ if (msg_params.keyExists(strings::tts_name)) {
+ app->set_tts_name(msg_params[strings::tts_name]);
+ }
+
+ if (msg_params.keyExists(strings::app_hmi_type)) {
+ app->set_app_types(msg_params[strings::app_hmi_type]);
+
+ // check if app is NAVI
+ const int32_t is_navi_type = mobile_apis::AppHMIType::NAVIGATION;
+ const smart_objects::SmartObject& app_type =
+ msg_params.getElement(strings::app_hmi_type);
+
+ for (size_t i = 0; i < app_type.length(); ++i) {
+ if (is_navi_type == app_type.getElement(i).asInt()) {
+ app->set_allowed_support_navigation(true);
+ }
+ }
+ }
+
+ const connection_handler::DeviceHandle handle = app->device();
+ // Add device to policy table and set device info, if any
+ std::string device_mac_address =
+ application_manager::MessageHelper::GetDeviceMacAddressForHandle(handle);
+ policy::DeviceParams dev_params;
+ application_manager::MessageHelper::GetDeviceInfoForHandle(handle,
+ &dev_params);
+ policy::DeviceInfo device_info;
+ device_info.connection_type = dev_params.device_connection_type;
+ if (msg_params.keyExists(strings::device_info)) {
+ FillDeviceInfo(&device_info);
+ }
+
+ policy::PolicyHandler::instance()->SetDeviceInfo(device_mac_address,
+ device_info);
+
+ SendRegisterAppInterfaceResponseToMobile();
+ policy::PolicyHandler::instance()->PTExchangeAtRegistration(mobile_app_id);
+ }
+}
+
+void RegisterAppInterfaceRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::on_event");
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_Speak: {
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ mobile_apis::Result::eType tts_result =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ SendRegisterAppInterfaceResponseToMobile(tts_result);
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
+ mobile_apis::Result::eType result) {
+ smart_objects::SmartObject* params = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ ApplicationManagerImpl* app_manager = ApplicationManagerImpl::instance();
+ const HMICapabilities& hmi_capabilities = app_manager->hmi_capabilities();
+ const uint32_t key = connection_key();
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(key);
+
+ if (!application.valid()) {
+ LOG4CXX_ERROR(logger_, "There is no application for such connection key" <<
+ key);
+ return;
+ }
+
+ smart_objects::SmartObject& response_params = *params;
+
+ response_params[strings::sync_msg_version][strings::major_version] =
+ APIVersion::kAPIV3;
+ response_params[strings::sync_msg_version][strings::minor_version] =
+ APIVersion::kAPIV0;
+
+ response_params[strings::language] = hmi_capabilities.active_vr_language();
+ response_params[strings::hmi_display_language] =
+ hmi_capabilities.active_ui_language();
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params[strings::language_desired].asInt() !=
+ hmi_capabilities.active_vr_language() ||
+ msg_params[strings::hmi_display_language_desired].asInt() !=
+ hmi_capabilities.active_ui_language()) {
+
+ LOG4CXX_WARN_EXT(
+ logger_,
+ "Wrong language on registering application " << application->name());
+
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "vr "
+ << msg_params[strings::language_desired].asInt()
+ << " - "
+ << hmi_capabilities.active_vr_language()
+ << "ui "
+ << msg_params[strings::hmi_display_language_desired].asInt()
+ << " - "
+ << hmi_capabilities.active_ui_language());
+
+ result = mobile_apis::Result::WRONG_LANGUAGE;
+ }
+
+ if (hmi_capabilities.display_capabilities()) {
+ response_params[hmi_response::display_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& display_caps =
+ response_params[hmi_response::display_capabilities];
+
+ display_caps[hmi_response::display_type] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::display_type);
+
+ display_caps[hmi_response::text_fields] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::text_fields);
+
+ display_caps[hmi_response::image_fields] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::image_fields);
+
+ display_caps[hmi_response::media_clock_formats] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::media_clock_formats);
+
+ display_caps[hmi_response::templates_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::templates_available);
+
+ display_caps[hmi_response::screen_params] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::screen_params);
+
+ display_caps[hmi_response::num_custom_presets_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::num_custom_presets_available);
+
+ if (hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::image_capabilities).length() > 0) {
+ display_caps[hmi_response::graphic_supported] = true;
+ } else {
+ display_caps[hmi_response::graphic_supported] = false;
+ }
+
+ display_caps[hmi_response::templates_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::templates_available);
+
+ display_caps[hmi_response::screen_params] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::screen_params);
+
+ display_caps[hmi_response::num_custom_presets_available] =
+ hmi_capabilities.display_capabilities()->getElement(
+ hmi_response::num_custom_presets_available);
+ }
+
+ if (hmi_capabilities.button_capabilities()) {
+ response_params[hmi_response::button_capabilities] =
+ *hmi_capabilities.button_capabilities();
+ }
+ if (hmi_capabilities.soft_button_capabilities()) {
+ response_params[hmi_response::soft_button_capabilities] =
+ *hmi_capabilities.soft_button_capabilities();
+ }
+ if (hmi_capabilities.preset_bank_capabilities()) {
+ response_params[hmi_response::preset_bank_capabilities] =
+ *hmi_capabilities.preset_bank_capabilities();
+ }
+ if (hmi_capabilities.hmi_zone_capabilities()) {
+ response_params[hmi_response::hmi_zone_capabilities] =
+ *hmi_capabilities.hmi_zone_capabilities();
+ }
+ if (hmi_capabilities.speech_capabilities()) {
+ response_params[strings::speech_capabilities] =
+ *hmi_capabilities.speech_capabilities();
+ }
+ if (hmi_capabilities.vr_capabilities()) {
+ response_params[strings::vr_capabilities] =
+ *hmi_capabilities.vr_capabilities();
+ }
+ if (hmi_capabilities.audio_pass_thru_capabilities()) {
+ response_params[strings::audio_pass_thru_capabilities] =
+ *hmi_capabilities.audio_pass_thru_capabilities();
+ }
+ if (hmi_capabilities.vehicle_type()) {
+ response_params[hmi_response::vehicle_type] =
+ *hmi_capabilities.vehicle_type();
+ }
+ if (hmi_capabilities.prerecorded_speech()) {
+ response_params[strings::prerecorded_speech] =
+ *(hmi_capabilities.prerecorded_speech());
+ }
+
+ const std::vector<uint32_t>& diag_modes =
+ profile::Profile::instance()->supported_diag_modes();
+ if (!diag_modes.empty()) {
+ std::vector<uint32_t>::const_iterator it = diag_modes.begin();
+ uint32_t index = 0;
+ for (; it != diag_modes.end(); ++it) {
+ response_params[strings::supported_diag_modes][index] = *it;
+ ++index;
+ }
+ }
+
+ ResumeCtrl& resumer = ApplicationManagerImpl::instance()->resume_controller();
+ uint32_t hash_id = 0;
+
+ const char* add_info = "";
+ bool resumption = (*message_)[strings::msg_params].keyExists(strings::hash_id);
+ if (resumption) {
+ hash_id = (*message_)[strings::msg_params][strings::hash_id].asUInt();
+ if (!resumer.CheckApplicationHash(application, hash_id)) {
+ LOG4CXX_WARN(logger_, "Hash does not matches");
+ result = mobile_apis::Result::RESUME_FAILED;
+ add_info = "Hash does not matches";
+ resumption = false;
+ } else if (!resumer.CheckPersistenceFilesForResumption(application)) {
+ LOG4CXX_WARN(logger_, "Persistent data is missed");
+ result = mobile_apis::Result::RESUME_FAILED;
+ add_info = "Persistent data is missed";
+ resumption = false;
+ } else {
+ add_info = " Resume Succeed";
+ }
+ }
+
+ SendResponse(true, result, add_info, params);
+
+ MessageHelper::SendOnAppRegisteredNotificationToHMI(*(application.get()),
+ resumption);
+
+ MessageHelper::SendChangeRegistrationRequestToHMI(application);
+
+ if (result != mobile_apis::Result::RESUME_FAILED) {
+ resumer.StartResumption(application, hash_id);
+ } else {
+ resumer.StartResumptionOnlyHMILevel(application);
+ }
+}
+
+mobile_apis::Result::eType
+RegisterAppInterfaceRequest::CheckCoincidence() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+
+ std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ const std::string app_name = msg_params[strings::app_name].asString();
+
+ for (; applications.end() != it; ++it) {
+
+ // name check
+ const std::string& cur_name = (*it)->name();
+ if (!strcasecmp(app_name.c_str(), cur_name.c_str())) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+
+ const smart_objects::SmartObject* vr = (*it)->vr_synonyms();
+ const std::vector<smart_objects::SmartObject>* curr_vr = NULL;
+ if (NULL != vr) {
+ curr_vr = vr->asArray();
+ CoincidencePredicateVR v(app_name);
+
+ if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "Application name is known already.");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
+
+ // vr check
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ const std::vector<smart_objects::SmartObject>* new_vr =
+ msg_params[strings::vr_synonyms].asArray();
+
+ CoincidencePredicateVR v(cur_name);
+ if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) {
+ LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name .");
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ } // end vr check
+
+ } // application for end
+
+ return mobile_apis::Result::SUCCESS;
+} // method end
+
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
+ LOG4CXX_INFO(logger_, "CheckWithPolicyData");
+ // TODO(AOleynik): Check is necessary to allow register application in case
+ // of disabled policy
+ // Remove this check, when HMI will support policy
+ if (!policy::PolicyHandler::instance()->PolicyEnabled()) {
+ return mobile_apis::Result::WARNINGS;
+ }
+
+ smart_objects::SmartObject& message = *message_;
+ policy::StringArray app_nicknames;
+ policy::StringArray app_hmi_types;
+
+ std::string mobile_app_id = message[strings::msg_params][strings::app_id].asString();
+ const bool init_result = policy::PolicyHandler::instance()->GetInitialAppData(
+ mobile_app_id, &app_nicknames, &app_hmi_types);
+
+ if (!init_result) {
+ LOG4CXX_ERROR(logger_, "Error during initial application data check.");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ if (!app_nicknames.empty()) {
+ policy::StringArray::const_iterator it = std::find(
+ app_nicknames.begin(), app_nicknames.end(),
+ message[strings::msg_params][strings::app_name].asString());
+ if (app_nicknames.end() == it) {
+ LOG4CXX_WARN(logger_,
+ "Application name was not found in nicknames list.");
+ //App should be unregistered, if its name is not present in nicknames list
+ usage_statistics::AppCounter count_of_rejections_nickname_mismatch(
+ policy::PolicyHandler::instance()->GetStatisticManager(), mobile_app_id,
+ usage_statistics::REJECTIONS_NICKNAME_MISMATCH);
+ ++count_of_rejections_nickname_mismatch;
+ return mobile_apis::Result::DISALLOWED;
+ }
+ }
+
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS;
+
+ // If AppHMIType is not included in policy - allow any type
+ if (!app_hmi_types.empty()) {
+ if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
+ // If AppHMITypes are partially same, the system should allow those listed
+ // in the policy table and send warning info on missed values
+ smart_objects::SmartArray app_types =
+ *(message[strings::msg_params][strings::app_hmi_type].asArray());
+
+ std::string log;
+ CheckMissedTypes checker(app_hmi_types, log);
+ std::for_each(app_types.begin(), app_types.end(), checker);
+ if (!log.empty()) {
+ response_info_ = "Following AppHMITypes are not present in policy "
+ "table:" + log;
+ result = mobile_apis::Result::WARNINGS;
+ }
+ }
+ // Replace AppHMITypes in request with values allowed by policy table
+ message[strings::msg_params][strings::app_hmi_type] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& app_hmi_type =
+ message[strings::msg_params][strings::app_hmi_type];
+
+ AppHMITypeInserter inserter(app_hmi_type);
+ std::for_each(app_hmi_types.begin(), app_hmi_types.end(), inserter);
+ }
+
+ return result;
+}
+
+void RegisterAppInterfaceRequest::FillDeviceInfo(
+ policy::DeviceInfo* device_info) {
+ const std::string hardware = "hardware";
+ const std::string firmware_rev = "firmwareRev";
+ const std::string os = "os";
+ const std::string os_ver = "osVersion";
+ const std::string carrier = "carrier";
+ const std::string max_number_rfcom_ports = "maxNumberRFCOMMPorts";
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ const smart_objects::SmartObject& device_info_so =
+ msg_params[strings::device_info];
+
+ if (device_info_so.keyExists(hardware)) {
+ device_info->hardware = msg_params[strings::device_info][hardware].asString();
+ }
+ if (device_info_so.keyExists(firmware_rev)) {
+ device_info->firmware_rev = msg_params[strings::device_info][firmware_rev].asString();
+ }
+ if (device_info_so.keyExists(os)) {
+ device_info->os = device_info_so[os].asString();
+ }
+ if (device_info_so.keyExists(os_ver)) {
+ device_info->os_ver = device_info_so[os_ver].asString();
+ }
+ if (device_info_so.keyExists(carrier)) {
+ device_info->carrier = device_info_so[carrier].asString();
+ }
+ if (device_info_so.keyExists(max_number_rfcom_ports)) {
+ device_info->max_number_rfcom_ports =
+ device_info_so[max_number_rfcom_ports].asInt();
+ }
+}
+
+mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckRestrictions() const {
+
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::CheckRestrictions");
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ const std::string& app_name = msg_params[strings::app_name].asString();
+
+ if (ClearParamName(app_name).empty()) {
+ printf("Application name is empty.\n");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ if ((app_name[0] == '\n') ||
+ ((app_name[0] == '\\') && (app_name[1] == 'n'))) {
+
+ printf("Application name has invalid characters.");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ if (msg_params.keyExists(strings::tts_name)) {
+
+ const smart_objects::SmartArray* tts =
+ msg_params[strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it = tts->begin();
+ smart_objects::SmartArray::const_iterator it_end = tts->end();
+
+ for (; it != it_end; ++it) {
+
+ const std::string& tts_name = (*it)[strings::text].asString();
+
+ if (ClearParamName(tts_name).empty()) {
+ printf("TTS value is empty.");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ if ((tts_name[0] == '\n') ||
+ ((tts_name[0] == '\\') && (tts_name[1] == 'n'))) {
+
+ printf("TTS value(s) has invalid characters.");
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ }
+ }
+
+ return mobile_apis::Result::SUCCESS;
+}
+
+std::string
+RegisterAppInterfaceRequest::ClearParamName(std::string param_name) const {
+
+ // Expecting for chars different from newlines and spaces in the appName
+ //
+ // There is an agreement, that "\n" is not allowed symbols, so we have to
+ // check for this case also
+
+ std::string newline = "\\n";
+ while (std::string::npos != param_name.find(newline)) {
+ param_name.erase(param_name.find(newline), newline.length());
+ }
+
+ std::string::iterator param_name_new_end =
+ std::remove_if(param_name.begin(), param_name.end(), ::isspace);
+
+ return std::string(param_name.begin(), param_name_new_end);
+}
+
+bool RegisterAppInterfaceRequest::IsApplicationWithSameAppIdRegistered() {
+
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::"
+ "IsApplicationWithSameAppIdRegistered");
+
+ const std::string mobile_app_id = (*message_)[strings::msg_params]
+ [strings::app_id].asString();
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> applications = accessor.applications();
+
+ std::set<ApplicationSharedPtr>::const_iterator it = applications.begin();
+ std::set<ApplicationSharedPtr>::const_iterator it_end = applications.end();
+
+ for (; it != it_end; ++it) {
+ if (mobile_app_id == (*it)->mobile_app_id()->asString()) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::app_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed");
+ return true;
+ }
+
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_name)) {
+ const smart_objects::SmartArray* tn_array =
+ (*message_)[strings::msg_params][strings::tts_name].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tn = tn_array->begin();
+ smart_objects::SmartArray::const_iterator it_tn_end = tn_array->end();
+
+ for (; it_tn != it_tn_end; ++it_tn) {
+ str = (*it_tn)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_name syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].
+ keyExists(strings::ngn_media_screen_app_name)) {
+ str = (*message_)[strings::msg_params]
+ [strings::ngn_media_screen_app_name].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid ngn_media_screen_app_name syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_synonyms)) {
+ const smart_objects::SmartArray* vs_array =
+ (*message_)[strings::msg_params][strings::vr_synonyms].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vs = vs_array->begin();
+ smart_objects::SmartArray::const_iterator it_vs_end = vs_array->end();
+
+ for (; it_vs != it_vs_end; ++it_vs) {
+ str = (*it_vs).asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_synonyms syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
+ str = (*message_)[strings::msg_params][strings::hash_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid hash_id syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::device_info)) {
+
+ if ((*message_)[strings::msg_params][strings::device_info].
+ keyExists(strings::hardware)) {
+ str = (*message_)[strings::msg_params]
+ [strings::device_info][strings::hardware].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info hardware syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].
+ keyExists(strings::firmware_rev)) {
+ str = (*message_)[strings::msg_params]
+ [strings::device_info][strings::firmware_rev].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info firmware_rev syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].
+ keyExists(strings::os)) {
+ str = (*message_)[strings::msg_params]
+ [strings::device_info][strings::os].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info os syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].
+ keyExists(strings::os_version)) {
+ str = (*message_)[strings::msg_params]
+ [strings::device_info][strings::os_version].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info os_version syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params][strings::device_info].
+ keyExists(strings::carrier)) {
+ str = (*message_)[strings::msg_params]
+ [strings::device_info][strings::carrier].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid device_info carrier syntax check failed");
+ return true;
+ }
+ }
+
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::app_id)) {
+ str = (*message_)[strings::msg_params][strings::app_id].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
new file mode 100644
index 0000000000..fe6f3a925a
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
@@ -0,0 +1,93 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/register_app_interface_response.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/application_manager_impl.h"
+#include "connection_handler/connection_handler.h"
+
+namespace application_manager {
+
+namespace commands {
+
+void RegisterAppInterfaceResponse::Run() {
+ LOG4CXX_INFO(logger_, "RegisterAppInterfaceResponse::Run");
+
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ bool success = (*message_)[strings::msg_params][strings::success].asBool();
+ bool last_message = !success;
+ // Do not close connection in case of APPLICATION_NOT_REGISTERED despite it is an error
+ if (!success && (*message_)[strings::msg_params].keyExists(strings::result_code)) {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ (*message_)[strings::msg_params][strings::result_code].asInt());
+ if (result_code == mobile_apis::Result::APPLICATION_REGISTERED_ALREADY) {
+ last_message = false;
+ }
+ }
+
+ SendResponse(success, result_code, last_message);
+
+ // Add registered application to the policy db right after response sent to
+ // mobile to be able to check all other API according to app permissions
+ uint32_t connection_key =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+ application_manager::ApplicationConstSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()->
+ application(connection_key);
+ if (app.valid()) {
+ policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
+ std::string mobile_app_id = app->mobile_app_id()->asString();
+ policy_handler->AddApplication(mobile_app_id);
+ SetHeartBeatTimeout(connection_key, mobile_app_id);
+ }
+}
+
+void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
+ uint32_t connection_key, const std::string& mobile_app_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
+ if (policy_handler->PolicyEnabled()) {
+ const int32_t timeout = policy_handler->HeartBeatTimeout(mobile_app_id);
+ if (timeout > 0) {
+ application_manager::ApplicationManagerImpl::instance()->
+ connection_handler()->SetHeartBeatTimeout(connection_key, timeout);
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Policy is turn off");
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc
new file mode 100644
index 0000000000..5e62b789d8
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc
@@ -0,0 +1,302 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/reset_global_properties_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ is_ui_send_(false),
+ is_tts_send_(false),
+ is_ui_received_(false),
+ is_tts_received_(false),
+ ui_result_(hmi_apis::Common_Result::INVALID_ENUM),
+ tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+}
+
+ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {
+}
+
+void ResetGlobalPropertiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "ResetGlobalPropertiesRequest::Run");
+
+ uint32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt();
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ size_t obj_length = (*message_)[strings::msg_params][strings::properties]
+ .length();
+ //if application waits for sending ttsGlobalProperties need to remove this
+ //application from tts_global_properties_app_list_
+ LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
+ ApplicationManagerImpl::instance()->RemoveAppFromTTSGlobalPropertiesList(
+ app_id);
+
+ bool helpt_promt = false;
+ bool timeout_prompt = false;
+ bool vr_help_title_items = false;
+ bool menu_name = false;
+ bool menu_icon = false;
+ bool is_key_board_properties = false;
+ int number_of_reset_vr = 0;
+ mobile_apis::GlobalProperty::eType global_property =
+ mobile_apis::GlobalProperty::INVALID_ENUM;
+
+ for (size_t i = 0; i < obj_length; ++i) {
+ global_property = static_cast<mobile_apis::GlobalProperty::eType>(
+ (*message_)[strings::msg_params][strings::properties][i].asInt());
+
+ if (mobile_apis::GlobalProperty::HELPPROMPT == global_property) {
+ helpt_promt = ResetHelpPromt(app);
+ } else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) {
+ timeout_prompt = ResetTimeoutPromt(app);
+ } else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) ||
+ (mobile_apis::GlobalProperty::VRHELPITEMS == global_property)) &&
+ (0 == number_of_reset_vr)) {
+ ++number_of_reset_vr;
+ vr_help_title_items = ResetVrHelpTitleItems(app);
+ } else if (mobile_apis::GlobalProperty::MENUNAME == global_property) {
+ menu_name = true;
+ } else if (mobile_apis::GlobalProperty::MENUICON == global_property) {
+ menu_icon = true;
+ } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES == global_property) {
+ is_key_board_properties = true;
+ }
+ }
+
+ if (vr_help_title_items || menu_name || menu_icon || is_key_board_properties) {
+ is_ui_send_ = true;
+ }
+
+ if (timeout_prompt || helpt_promt) {
+ is_tts_send_ = true;
+ }
+
+ app->set_reset_global_properties_active(true);
+
+ if (vr_help_title_items || menu_name || menu_icon || is_key_board_properties) {
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (vr_help_title_items) {
+ smart_objects::SmartObject* vr_help = MessageHelper::CreateAppVrHelp(app);
+ if (!vr_help) {
+ return;
+ }
+ msg_params = *vr_help;
+ }
+ if (menu_name) {
+ msg_params[hmi_request::menu_title] = "";
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ //TODO(DT): clarify the sending parameter menuIcon
+ //if (menu_icon) {
+ //}
+ if (is_key_board_properties) {
+ smart_objects::SmartObject key_board_properties = smart_objects::
+ SmartObject(smart_objects::SmartType_Map);
+ key_board_properties[strings::language] = static_cast<int32_t>
+ (hmi_apis::Common_Language::EN_US);
+ key_board_properties[hmi_request::keyboard_layout] = static_cast<int32_t>
+ (hmi_apis::Common_KeyboardLayout::QWERTY);
+
+ // Look for APPLINK-4432 for details.
+ /*smart_objects::SmartObject limited_character_list = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ limited_character_list[0] = "";
+ key_board_properties[hmi_request::limited_character_list] =
+ limited_character_list;*/
+
+ key_board_properties[hmi_request::auto_complete_text] = "";
+ msg_params[hmi_request::keyboard_properties] = key_board_properties;
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetGlobalProperties,
+ &msg_params, true);
+ }
+
+ if (timeout_prompt || helpt_promt) {
+ // create ui request
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (helpt_promt) {
+ msg_params[strings::help_prompt] = (*app->help_prompt());
+ }
+
+ if (timeout_prompt) {
+ msg_params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::TTS_SetGlobalProperties,
+ &msg_params, true);
+ }
+}
+
+bool ResetGlobalPropertiesRequest::ResetHelpPromt(
+ application_manager::ApplicationSharedPtr app) {
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+ smart_objects::SmartObject so_help_prompt = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ app->set_help_prompt(so_help_prompt);
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::ResetTimeoutPromt(
+ application_manager::ApplicationSharedPtr const app) {
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+
+ const std::vector<std::string>& time_out_promt = profile::Profile::instance()
+ ->time_out_promt();
+
+ smart_objects::SmartObject so_time_out_promt = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ for (uint32_t i = 0; i < time_out_promt.size(); ++i) {
+ smart_objects::SmartObject timeoutPrompt = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ timeoutPrompt[strings::text] = time_out_promt[i];
+ timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ so_time_out_promt[i] = timeoutPrompt;
+ }
+
+ app->set_timeout_prompt(so_time_out_promt);
+
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::ResetVrHelpTitleItems(
+ application_manager::ApplicationSharedPtr const app) {
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "Null pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return false;
+ }
+ app->reset_vr_help_title();
+ app->reset_vr_help();
+
+ return true;
+}
+
+void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ResetGlobalPropertiesRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ is_tts_received_ = true;
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (!IsPendingResponseExist()) {
+ bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
+ || ((hmi_apis::Common_Result::SUCCESS == ui_result_)
+ && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
+ || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_));
+
+ mobile_apis::Result::eType result_code;
+ const char* return_info = NULL;
+
+ if (result) {
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info = std::string("Unsupported phoneme type sent in a prompt").c_str();
+ } else {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ std::max(ui_result_, tts_result_));
+ }
+ } else {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ std::max(ui_result_, tts_result_));
+ }
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+ SendResponse(result, static_cast<mobile_apis::Result::eType>(result_code),
+ return_info, &(message[strings::msg_params]));
+ application->UpdateHash();
+ }
+}
+
+bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
+ return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc
new file mode 100644
index 0000000000..aeacabf9d5
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/reset_global_properties_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {
+}
+
+void ResetGlobalPropertiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "ResetGlobalPropertiesResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
new file mode 100644
index 0000000000..5b3cfa67ac
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc
@@ -0,0 +1,155 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "application_manager/commands/mobile/scrollable_message_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ScrollableMessageRequest::ScrollableMessageRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+ScrollableMessageRequest::~ScrollableMessageRequest() {
+}
+
+bool ScrollableMessageRequest::Init() {
+
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ } else {
+ const int32_t def_value = 30000;
+ default_timeout_ = def_value;
+ }
+
+ return true;
+}
+
+void ScrollableMessageRequest::Run() {
+ LOG4CXX_INFO(logger_, "ScrollableMessageRequest::Run");
+
+ ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
+ ->application((*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ //ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[hmi_request::message_text][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::scrollableMessageBody);
+ msg_params[hmi_request::message_text][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::scroll_message_body];
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::timeout] = default_timeout_;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[strings::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true);
+}
+
+void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ScrollableMessageRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ break;
+ }
+ case hmi_apis::FunctionID::UI_ScrollableMessage: {
+ LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
+
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>
+ (message[strings::params][hmi_response::code].asInt());
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ bool result = false;
+ if (mobile_apis::Result::SUCCESS == result_code ||
+ mobile_apis::Result::ABORTED == result_code) {
+ result = true;
+ } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) &&
+ hmi_capabilities.is_ui_cooperating()) {
+ result = true;
+ }
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+} // namespace commands
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
new file mode 100644
index 0000000000..d9692359d0
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc
@@ -0,0 +1,64 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/scrollable_message_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ScrollableMessageResponse::ScrollableMessageResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+void ScrollableMessageResponse::Run() {
+ LOG4CXX_INFO(logger_, "ScrollableMessageResponse::Run");
+ mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>(
+ (*message_)[strings::msg_params][strings::result_code].asInt());
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asInt());
+ if ((mobile_apis::Result::REJECTED != result_code) && application) {
+ application->UnsubscribeFromSoftButtons(
+ (*message_)[strings::params][strings::function_id].asInt());
+ }
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_request.cc b/src/components/application_manager/src/commands/mobile/send_location_request.cc
new file mode 100644
index 0000000000..b5c2e8a9a5
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/send_location_request.cc
@@ -0,0 +1,166 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/mobile/send_location_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SendLocationRequest::SendLocationRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SendLocationRequest::~SendLocationRequest() {
+}
+
+void SendLocationRequest::Run() {
+ LOG4CXX_INFO(logger_, "SendLocationRequest::Run");
+
+ ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
+ ->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(
+ logger_, "An application " << app->name() << " is not registered.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Strings contain invalid characters");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::location_image)) {
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::SUCCESS;
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::Navigation_SendLocation,
+ &((*message_)[strings::msg_params]),
+ true);
+}
+
+void SendLocationRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SendLocationRquest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_SendLocation: {
+ LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
+ mobile_apis::Result::eType result_code = GetMobileResultCode(
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool SendLocationRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "SendLocationRquest::IsWhiteSpaceExist");
+ const char* str;
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params.keyExists(strings::location_name)) {
+ str = msg_params[strings::location_name].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "parameter locationName contains invalid character");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::location_description)) {
+ str = msg_params[strings::location_description].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "parameter locationDescription contains invalid character");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::address_lines)) {
+ const smart_objects::SmartArray* al_array =
+ msg_params[strings::address_lines].asArray();
+ smart_objects::SmartArray::const_iterator it_al = al_array->begin();
+ smart_objects::SmartArray::const_iterator it_al_end = al_array->end();
+ for (; it_al != it_al_end; ++it_al) {
+ str = (*it_al).asCharArray();
+ if(!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "parameter address_lines contains invalid character");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::phone_number)) {
+ str = msg_params[strings::phone_number].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "parameter phoneNumber contains invalid character");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::location_image)) {
+ str = msg_params[strings::location_image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "parameter value in locationImage contains invalid character");
+ return true;
+ }
+ }
+
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_response.cc b/src/components/application_manager/src/commands/mobile/send_location_response.cc
new file mode 100644
index 0000000000..a13b67dc06
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/send_location_response.cc
@@ -0,0 +1,58 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/send_location_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SendLocationResponse::SendLocationResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SendLocationResponse::~SendLocationResponse() {
+}
+
+void SendLocationResponse::Run() {
+ LOG4CXX_INFO(logger_, "SendLocationResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc
new file mode 100644
index 0000000000..60a2583287
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc
@@ -0,0 +1,123 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_display_layout_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+SetDisplayLayoutRequest::SetDisplayLayoutRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {
+}
+
+void SetDisplayLayoutRequest::Run() {
+ LOG4CXX_INFO(logger_, "SetDisplayLayoutRequest::Run");
+ ApplicationConstSharedPtr app = ApplicationManagerImpl::instance()
+ ->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout,
+ &((*message_)[strings::msg_params]), true);
+
+}
+
+void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SetDisplayLayoutRequest::on_event");
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetDisplayLayout: {
+ LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event");
+
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool response_success = mobile_apis::Result::SUCCESS == result_code;
+ if (response_success) {
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ if (message[strings::msg_params].keyExists(hmi_response::display_capabilities)) {
+ hmi_capabilities.set_display_capabilities(
+ message[strings::msg_params][hmi_response::display_capabilities]);
+ }
+
+ if (message[strings::msg_params].keyExists(
+ hmi_response::soft_button_capabilities)) {
+ if (message[strings::msg_params][hmi_response::soft_button_capabilities].getType() ==
+ smart_objects::SmartType_Array) {
+ hmi_capabilities.set_soft_button_capabilities(
+ message[strings::msg_params][hmi_response::soft_button_capabilities][0]);
+ } else {
+ hmi_capabilities.set_soft_button_capabilities(
+ message[strings::msg_params][hmi_response::soft_button_capabilities]);
+ }
+ }
+
+ if (message[strings::msg_params].keyExists(hmi_response::button_capabilities)) {
+ hmi_capabilities.set_button_capabilities(
+ message[strings::msg_params][hmi_response::button_capabilities]);
+ }
+
+ if (message[strings::msg_params].keyExists(hmi_response::preset_bank_capabilities)) {
+ hmi_capabilities.set_preset_bank_capabilities(
+ message[strings::msg_params][hmi_response::preset_bank_capabilities]);
+ }
+
+ }
+ SendResponse(response_success, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc
new file mode 100644
index 0000000000..51f8c1f35b
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc
@@ -0,0 +1,59 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_display_layout_response.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetDisplayLayoutResponse::SetDisplayLayoutResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {
+}
+
+void SetDisplayLayoutResponse::Run() {
+ LOG4CXX_INFO(logger_, "SetDisplayLayoutResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
new file mode 100644
index 0000000000..f7216c818c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc
@@ -0,0 +1,515 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include <algorithm>
+#include "application_manager/commands/mobile/set_global_properties_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetGlobalPropertiesRequest::SetGlobalPropertiesRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message),
+ is_ui_send_(false),
+ is_tts_send_(false),
+ is_ui_received_(false),
+ is_tts_received_(false),
+ ui_result_(hmi_apis::Common_Result::INVALID_ENUM),
+ tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {
+}
+
+SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {
+}
+
+void SetGlobalPropertiesRequest::Run() {
+ LOG4CXX_INFO(logger_, "SetGlobalPropertiesRequest::Run");
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ uint32_t app_id =
+ (*message_)[strings::params][strings::connection_key].asUInt();
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id);
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "No application associated with session key");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (!ValidateConditionalMandatoryParameters(msg_params)) {
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ "There are no parameters present in request.");
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::menu_icon], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "MessageHelper::VerifyImage return " << verification_result);
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+ // Check for image file(s) in vrHelpItem
+ if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) {
+ if (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImageVrHelpItems(
+ (*message_)[strings::msg_params][strings::vr_help], app)) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "MessageHelper::VerifyImage return INVALID_DATA!" );
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ //if application waits for sending ttsGlobalProperties need to remove this
+ //application from tts_global_properties_app_list_
+ LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList");
+ ApplicationManagerImpl::instance()->RemoveAppFromTTSGlobalPropertiesList(
+ app_id);
+ bool is_help_prompt_present = msg_params.keyExists(strings::help_prompt);
+ bool is_timeout_prompt_present = msg_params.keyExists(
+ strings::timeout_prompt);
+ bool is_vr_help_title_present = msg_params.keyExists(strings::vr_help_title);
+ bool is_vr_help_present = msg_params.keyExists(strings::vr_help);
+ bool is_menu_title_present = msg_params.keyExists(hmi_request::menu_title);
+ bool is_menu_icon_present = msg_params.keyExists(hmi_request::menu_icon);
+ bool is_keyboard_props_present =
+ msg_params.keyExists(hmi_request::keyboard_properties);
+
+ // Media-only applications support API v2.1 with less parameters
+ // Code deleted according to APPLINK-6119 APPLINK-6133
+ // Not sure that it is right
+
+// if (!app->allowed_support_navigation() &&
+// (is_keyboard_props_present ||
+// is_menu_icon_present ||
+// is_menu_title_present)
+// ) {
+// const std::string app_type =
+// app->is_media_application() ? "media" : "non-media";
+
+// const std::string message =
+// "There are too many parameters for "+app_type+" application.";
+// SendResponse(false,
+// mobile_apis::Result::INVALID_DATA,
+// message.c_str());
+// return;
+// }
+
+ if ((is_vr_help_title_present && is_vr_help_present) ||
+ (!is_vr_help_title_present && !is_vr_help_present)) {
+ is_ui_send_ = true;
+ }
+
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ is_tts_send_ = true;
+ }
+
+ if (is_vr_help_title_present && is_vr_help_present) {
+ // check vrhelpitem position index
+ if (!CheckVrHelpItemsOrder()) {
+ LOG4CXX_ERROR(logger_, "Request rejected");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ app->set_vr_help_title(
+ msg_params.getElement(strings::vr_help_title));
+ app->set_vr_help(
+ msg_params.getElement(strings::vr_help));
+
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ params[strings::vr_help_title] = (*app->vr_help_title());
+ params[strings::vr_help] = (*app->vr_help());
+ params[strings::app_id] = app->app_id();
+ if (is_menu_title_present) {
+
+ params[hmi_request::menu_title] =
+ msg_params[hmi_request::menu_title].asString();
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ if (is_menu_icon_present) {
+
+ params[hmi_request::menu_icon] =
+ msg_params[hmi_request::menu_icon];
+ app->set_menu_icon(msg_params[hmi_request::menu_icon]);
+ }
+ if (is_keyboard_props_present) {
+
+ params[hmi_request::keyboard_properties] =
+ msg_params[hmi_request::keyboard_properties];
+ app->set_keyboard_props(msg_params[hmi_request::keyboard_properties]);
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetGlobalProperties,
+ &params, true);
+ } else if (!is_vr_help_title_present && !is_vr_help_present) {
+ const CommandsMap& cmdMap = app->commands_map();
+ CommandsMap::const_iterator command_it = cmdMap.begin();
+
+ int32_t index = 0;
+ smart_objects::SmartObject vr_help_items;
+ for (; cmdMap.end() != command_it; ++command_it) {
+ if (false == (*command_it->second).keyExists(strings::vr_commands)) {
+ LOG4CXX_ERROR(logger_, "VR synonyms are empty");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ // use only first
+ vr_help_items[index][strings::position] = (index + 1);
+ vr_help_items[index++][strings::text] =
+ (*command_it->second)[strings::vr_commands][0];
+ }
+
+ app->set_vr_help_title(smart_objects::SmartObject(app->name()));
+
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ params[strings::vr_help_title] = (*app->vr_help_title());
+ if (vr_help_items.length() > 0) {
+ app->set_vr_help(vr_help_items);
+ params[strings::vr_help] = (*app->vr_help());
+ }
+ params[strings::app_id] = app->app_id();
+ if (is_menu_title_present) {
+
+ params[hmi_request::menu_title] =
+ msg_params[hmi_request::menu_title].asString();
+ app->set_menu_title(msg_params[hmi_request::menu_title]);
+ }
+ if (is_menu_icon_present) {
+
+ params[hmi_request::menu_icon] =
+ msg_params[hmi_request::menu_icon];
+ app->set_menu_icon(msg_params[hmi_request::menu_icon]);
+ }
+ if (is_keyboard_props_present) {
+
+ params[hmi_request::keyboard_properties] =
+ msg_params[hmi_request::keyboard_properties];
+ app->set_keyboard_props(msg_params[hmi_request::keyboard_properties]);
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetGlobalProperties,
+ &params, true);
+ } else {
+ LOG4CXX_ERROR(logger_, "Request rejected");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+
+ // check TTS params
+ if (is_help_prompt_present || is_timeout_prompt_present) {
+ smart_objects::SmartObject params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (is_help_prompt_present) {
+ app->set_help_prompt(
+ msg_params.getElement(strings::help_prompt));
+ params[strings::help_prompt] = (*app->help_prompt());
+ }
+
+ if (is_timeout_prompt_present) {
+ app->set_timeout_prompt(
+ msg_params.getElement(strings::timeout_prompt));
+ params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+
+ params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::TTS_SetGlobalProperties,
+ &params, true);
+ }
+}
+
+bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder() {
+ const smart_objects::SmartObject vr_help = (*message_)[strings::msg_params]
+ .getElement(strings::vr_help);
+
+ // vr help item start position must be 1
+ const uint32_t vr_help_item_start_position = 1;
+
+ if (vr_help_item_start_position !=
+ vr_help.getElement(0).getElement(strings::position).asUInt()) {
+ LOG4CXX_ERROR(logger_, "VR help items start position is wrong");
+ return false;
+ }
+
+ // Check if VR Help Items contains sequential positionss
+ size_t i = 0;
+ for (size_t j = 1; j < vr_help.length(); ++i, ++j) {
+ if ((vr_help.getElement(i).getElement(strings::position).asInt() + 1)
+ != vr_help.getElement(j).getElement(strings::position).asInt()) {
+ LOG4CXX_ERROR(logger_, "VR help items order is wrong");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SetGlobalPropertiesRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(CommandRequestImpl::connection_key());
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ is_ui_received_ = true;
+ ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ is_tts_received_ = true;
+ tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+
+ if (!IsPendingResponseExist()) {
+ bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_))
+ || ((hmi_apis::Common_Result::SUCCESS == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
+ && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_))
+ || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_ ||
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == ui_result_)
+ && (hmi_apis::Common_Result::SUCCESS == tts_result_));
+
+ mobile_apis::Result::eType result_code;
+ const char* return_info = NULL;
+
+ if (result) {
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info =
+ std::string("Unsupported phoneme type sent in a prompt").c_str();
+ } else {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ std::max(ui_result_, tts_result_));
+ }
+ } else {
+ result_code = static_cast<mobile_apis::Result::eType>(
+ std::max(ui_result_, tts_result_));
+ }
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+ SendResponse(result, static_cast<mobile_apis::Result::eType>(result_code),
+ return_info, &(message[strings::msg_params]));
+ application->UpdateHash();
+ }
+}
+
+bool SetGlobalPropertiesRequest::IsPendingResponseExist() {
+
+ return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
+}
+
+bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params) {
+ return params.keyExists(strings::help_prompt)
+ || params.keyExists(strings::timeout_prompt)
+ || params.keyExists(strings::vr_help_title)
+ || params.keyExists(strings::vr_help)
+ || params.keyExists(strings::menu_title)
+ || params.keyExists(strings::menu_icon)
+ || params.keyExists(strings::keyboard_properties);
+}
+
+bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "SetGlobalPropertiesRequest::IsWhiteSpaceExist");
+ const char* str;
+
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ if (msg_params.keyExists(strings::help_prompt)) {
+ const smart_objects::SmartArray* hp_array =
+ msg_params[strings::help_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
+ smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();
+
+ for (; it_hp != it_hp_end; ++it_hp) {
+ str = (*it_hp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid help_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::timeout_prompt)) {
+ const smart_objects::SmartArray* tp_array =
+ msg_params[strings::timeout_prompt].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
+ smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();
+
+ for (; it_tp != it_tp_end; ++it_tp) {
+ str = (*it_tp)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid timeout_prompt syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params.keyExists(strings::vr_help)) {
+ const smart_objects::SmartArray* vh_array =
+ msg_params[strings::vr_help].asArray();
+
+ smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
+ smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();
+
+ for (; it_vh != it_vh_end; ++it_vh) {
+ str = (*it_vh)[strings::text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help text syntax check failed");
+ return true;
+ }
+
+ if ((*it_vh).keyExists(strings::image)) {
+ str = (*it_vh)[strings::image][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid vr_help image value syntax check failed");
+ return true;
+ }
+ }
+
+ }
+ }
+
+ if (msg_params.keyExists(strings::menu_icon)) {
+ str = msg_params[strings::menu_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::vr_help_title)) {
+ str = msg_params[strings::vr_help_title].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed");
+ return true;
+ }
+ }
+
+ if (msg_params.keyExists(strings::menu_title)) {
+ str = msg_params[strings::menu_title].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed");
+ return true;
+ }
+ }
+
+
+ if (msg_params.keyExists(strings::keyboard_properties)) {
+ if (msg_params[strings::keyboard_properties].
+ keyExists(strings::limited_character_list)) {
+
+ const smart_objects::SmartArray* lcl_array =
+ msg_params[strings::keyboard_properties]
+ [strings::limited_character_list].asArray();
+
+ smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
+ smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();
+
+ for (; it_lcl != it_lcl_end; ++it_lcl) {
+ str = (*it_lcl).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid keyboard_properties "
+ "limited_character_list syntax check failed");
+ return true;
+ }
+ }
+ }
+
+ if (msg_params[strings::keyboard_properties].
+ keyExists(strings::auto_complete_text)) {
+
+ str = msg_params[strings::keyboard_properties]
+ [strings::auto_complete_text].asCharArray();
+
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid keyboard_properties "
+ "auto_complete_text syntax check failed");
+ return true;
+ }
+ }
+
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc
new file mode 100644
index 0000000000..5f0b62fb4d
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc
@@ -0,0 +1,58 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_global_properties_response.h"
+#include "application_manager/application_manager_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+SetGlobalPropertiesResponse::SetGlobalPropertiesResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {
+}
+
+void SetGlobalPropertiesResponse::Run() {
+ LOG4CXX_INFO(logger_, "SetGlobalPropertiesResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_icon_request.cc
new file mode 100644
index 0000000000..4b78833057
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_icon_request.cc
@@ -0,0 +1,141 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_icon_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "config_profile/profile.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetIconRequest::SetIconRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SetIconRequest::~SetIconRequest() {
+}
+
+void SetIconRequest::Run() {
+ LOG4CXX_INFO(logger_, "SetIconRequest::Run");
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const std::string& sync_file_name =
+ (*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ std::string full_file_path =
+ profile::Profile::instance()->app_storage_folder() + "/";
+ full_file_path += app->folder_name();
+ full_file_path += "/";
+ full_file_path += sync_file_name;
+
+ if (!file_system::FileExists(full_file_path)) {
+ LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+ msg_params[strings::sync_file_name] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+// Requires unchanged path value without encoded special characters
+ const std::string full_file_path_for_hmi = file_system::ConvertPathForURL(
+ full_file_path);
+
+ msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
+
+ // TODO(VS): research why is image_type hardcoded
+ msg_params[strings::sync_file_name][strings::image_type] =
+ static_cast<int32_t> (SetIconRequest::ImageType::DYNAMIC);
+
+ // for further use in on_event function
+ (*message_)[strings::msg_params][strings::sync_file_name] =
+ msg_params[strings::sync_file_name];
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
+}
+
+void SetIconRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SetIconRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ if (result) {
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ const std::string path = (*message_)[strings::msg_params]
+ [strings::sync_file_name]
+ [strings::value].asString();
+ app->set_app_icon_path(path);
+
+ LOG4CXX_INFO(logger_,
+ "Icon path was set to '" << app->app_icon_path() << "'");
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_icon_response.cc
new file mode 100644
index 0000000000..f1580823d1
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_icon_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_icon_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetIconResponse::SetIconResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SetIconResponse::~SetIconResponse() {
+}
+
+void SetIconResponse::Run() {
+ LOG4CXX_INFO(logger_, "SetIconResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc
new file mode 100644
index 0000000000..c9b2eb5ef5
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc
@@ -0,0 +1,152 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetMediaClockRequest::SetMediaClockRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SetMediaClockRequest::~SetMediaClockRequest() {
+}
+
+void SetMediaClockRequest::Run() {
+ LOG4CXX_INFO(logger_, "SetMediaClockRequest::Run");
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (!app->is_media_application()) {
+ LOG4CXX_ERROR(logger_, "Application is not media application");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (isDataValid()) {
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ // copy entirely msg
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = app->app_id();
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_SetMediaClockTimer,
+ &msg_params, true);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void SetMediaClockRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SetMediaClockRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+bool SetMediaClockRequest::isDataValid() {
+ smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
+ mobile_apis::UpdateMode::eType update_mode =
+ static_cast<mobile_apis::UpdateMode::eType>(
+ msg_params[strings::update_mode].asUInt());
+
+ if (update_mode == mobile_apis::UpdateMode::COUNTUP ||
+ update_mode == mobile_apis::UpdateMode::COUNTDOWN) {
+
+ if (!msg_params.keyExists(strings::start_time)) {
+ LOG4CXX_INFO(logger_, "Invalid data");
+ return false;
+ }
+
+ if (msg_params.keyExists(strings::end_time)) {
+ unsigned int start_time_in_seconds = 0;
+ start_time_in_seconds =
+ (msg_params[strings::start_time][strings::hours].asUInt()) * 3600;
+ start_time_in_seconds +=
+ (msg_params[strings::start_time][strings::minutes].asUInt()) * 60;
+ start_time_in_seconds +=
+ (msg_params[strings::start_time][strings::seconds].asUInt());
+
+ unsigned int end_time_in_seconds = 0;
+ end_time_in_seconds =
+ (msg_params[strings::end_time][strings::hours].asUInt()) * 3600;
+ end_time_in_seconds +=
+ (msg_params[strings::end_time][strings::minutes].asUInt()) * 60;
+ end_time_in_seconds +=
+ (msg_params[strings::end_time][strings::seconds].asUInt());
+
+ if (((end_time_in_seconds > start_time_in_seconds) &&
+ (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) ||
+ ((end_time_in_seconds < start_time_in_seconds) &&
+ (update_mode == mobile_apis::UpdateMode::COUNTUP))) {
+ LOG4CXX_INFO(logger_, "Invalid data");
+ return false;
+ }
+ }
+ }
+
+ LOG4CXX_INFO(logger_, "Data is valid");
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc
new file mode 100644
index 0000000000..73923b0021
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/set_media_clock_timer_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SetMediaClockTimerResponse::SetMediaClockTimerResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {
+}
+
+void SetMediaClockTimerResponse::Run() {
+ LOG4CXX_INFO(logger_, "SetMediaClockTimerResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc
new file mode 100644
index 0000000000..f4e70c53ac
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc
@@ -0,0 +1,283 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "application_manager/commands/mobile/show_constant_tbt_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ShowConstantTBTRequest::ShowConstantTBTRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+ShowConstantTBTRequest::~ShowConstantTBTRequest() {
+}
+
+void ShowConstantTBTRequest::Run() {
+ LOG4CXX_INFO(logger_, "ShowConstantTBTRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+ // SDLAQ-CRS-664, VC3.1
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming show constant TBT has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ //ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons(msg_params, app);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::SUCCESS;
+ if (msg_params.keyExists(strings::turn_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ msg_params[strings::turn_icon], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if (msg_params.keyExists(strings::next_turn_icon)) {
+ verification_result = MessageHelper::VerifyImage(
+ msg_params[strings::next_turn_icon], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ msg_params[hmi_request::navi_texts] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if (msg_params.keyExists(strings::navigation_text_1)) {
+ // erase useless parametr
+ msg_params.erase(strings::navigation_text_1);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText1);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::navigation_text_1];
+ }
+
+ if (msg_params.keyExists(strings::navigation_text_2)) {
+ // erase useless param
+ msg_params.erase(strings::navigation_text_2);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::navigationText2);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::navigation_text_2];
+ }
+
+ if (msg_params.keyExists(strings::eta)) {
+ // erase useless param
+ msg_params.erase(strings::eta);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::ETA);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::eta];
+ }
+
+ if (msg_params.keyExists(strings::total_distance)) {
+ // erase useless param
+ msg_params.erase(strings::total_distance);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::totalDistance);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::total_distance];
+ }
+
+ if (msg_params.keyExists(strings::time_to_destination)) {
+ // erase useless param
+ msg_params.erase(strings::time_to_destination);
+ msg_params[hmi_request::navi_texts][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination);
+ msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::time_to_destination];
+ }
+
+ if (msg_params.keyExists(strings::soft_buttons)) {
+ MessageHelper::SubscribeApplicationToSoftButton(msg_params, app, function_id());
+ }
+
+ app->set_tbt_show_command(msg_params);
+ SendHMIRequest(hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params,
+ true);
+}
+
+
+void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ShowConstantTBTRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
+ LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
+
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt()));
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+ bool result = false;
+ if (mobile_apis::Result::SUCCESS == result_code) {
+ result = true;
+ } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) &&
+ hmi_capabilities.is_ui_cooperating()) {
+ result = true;
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool ShowConstantTBTRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "ShowConstantTBTRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) {
+ str = (*message_)[strings::msg_params]
+ [strings::turn_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) {
+ str = (*message_)[strings::msg_params]
+ [strings::next_turn_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid next_turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_1)) {
+ str = (*message_)[strings::msg_params]
+ [strings::navigation_text_1].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid navigation_text_1 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_2)) {
+ str = (*message_)[strings::msg_params]
+ [strings::navigation_text_2].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid navigation_text_2 value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::eta)) {
+ str = (*message_)[strings::msg_params][strings::eta].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid eta value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::total_distance)) {
+ str = (*message_)[strings::msg_params]
+ [strings::total_distance].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid total_distance value syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::time_to_destination)) {
+ str = (*message_)[strings::msg_params]
+ [strings::time_to_destination].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid time_to_destination value syntax check failed");
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc
new file mode 100644
index 0000000000..d5539d148c
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc
@@ -0,0 +1,58 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/show_constant_tbt_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ShowConstantTBTResponse::ShowConstantTBTResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+ShowConstantTBTResponse::~ShowConstantTBTResponse() {
+}
+
+void ShowConstantTBTResponse::Run() {
+ LOG4CXX_INFO(logger_, "ShowConstantTBTResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc
new file mode 100644
index 0000000000..eeef60101e
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/show_request.cc
@@ -0,0 +1,341 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/mobile/show_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "utils/file_system.h"
+
+#include <string.h>
+
+namespace application_manager {
+
+namespace commands {
+
+ShowRequest::ShowRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+ShowRequest::~ShowRequest() {
+}
+
+void ShowRequest::Run() {
+ LOG4CXX_INFO(logger_, "ShowRequest::Run");
+
+ ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
+ ->application(
+ (*message_)[strings::params][strings::connection_key].asInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(
+ logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+ //SDLAQ-CRS-494, VC3.1
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (!CheckStringsOfShowRequest()) {
+ LOG4CXX_ERROR(logger_, "Incorrect characters in string");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ //ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result = mobile_apis::Result::SUCCESS;
+ if(((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) &&
+ ((*message_)[strings::msg_params][strings::soft_buttons].length() > 0)) {
+ processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app);
+ }
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ mobile_apis::Result::eType verification_result =
+ mobile_apis::Result::SUCCESS;
+ if (((*message_)[strings::msg_params].keyExists(strings::graphic)) &&
+ ((*message_)[strings::msg_params]
+ [strings::graphic][strings::value].asString()).length()) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::graphic], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ verification_result = MessageHelper::VerifyImage(
+ (*message_)[strings::msg_params][strings::secondary_graphic], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!");
+ SendResponse(false, verification_result);
+ return;
+ }
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app->app_id();
+
+ msg_params[hmi_request::show_strings] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ int32_t index = 0;
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField1);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_1];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField2);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_2];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField3);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_3];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField4);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::main_field_4];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::media_clock];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaTrack);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::media_track];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
+ msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
+ static_cast<int32_t>(hmi_apis::Common_TextFieldName::statusBar);
+ msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
+ (*message_)[strings::msg_params][strings::status_bar];
+ ++index;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::alignment)) {
+ msg_params[strings::alignment] =
+ (*message_)[strings::msg_params][strings::alignment];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
+ msg_params[strings::graphic] =
+ (*message_)[strings::msg_params][strings::graphic];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ msg_params[strings::secondary_graphic] =
+ (*message_)[strings::msg_params][strings::secondary_graphic];
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ msg_params[strings::soft_buttons] =
+ (*message_)[strings::msg_params][strings::soft_buttons];
+ if ((*message_)[strings::msg_params][strings::soft_buttons].length() == 0) {
+ app->UnsubscribeFromSoftButtons(function_id());
+ } else {
+ MessageHelper::SubscribeApplicationToSoftButton(
+ (*message_)[strings::msg_params], app, function_id());
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
+ msg_params[strings::custom_presets] =
+ (*message_)[strings::msg_params][strings::custom_presets];
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
+
+ MessageSharedPtr persistentData = new smart_objects::SmartObject(msg_params);
+ app->set_show_command(*persistentData);
+}
+
+void ShowRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ShowRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_Show: {
+ LOG4CXX_INFO(logger_, "Received UI_Show event");
+ std::string response_info("");
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result = false;
+
+ if (mobile_apis::Result::SUCCESS == result_code) {
+ result = true;
+ } else if (mobile_apis::Result::WARNINGS == result_code) {
+ result = true;
+ if (message[strings::params].keyExists(hmi_response::message)) {
+ response_info = message[strings::params][hmi_response::message].asString();
+ }
+ }
+
+ SendResponse(result, result_code,
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool ShowRequest::CheckStringsOfShowRequest() {
+ LOG4CXX_INFO(logger_, "ShowRequest::CheckStringsOfShowRequest");
+ const char* str;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
+ str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
+ str = (*message_)[strings::msg_params][strings::main_field_3].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_3 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
+ str = (*message_)[strings::msg_params][strings::main_field_2].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_2 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
+ str = (*message_)[strings::msg_params][strings::main_field_1].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid main_field_1 syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::status_bar)) {
+ str = (*message_)[strings::msg_params][strings::status_bar].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid status_bar syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
+ str = (*message_)[strings::msg_params][strings::media_clock].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid media_clock syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::media_track)) {
+ str = (*message_)[strings::msg_params][strings::media_track].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid media_track syntax check failed");
+ return false;
+ }
+ }
+ if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) {
+ smart_objects::SmartObject& custom_presets_array =
+ (*message_)[strings::msg_params][strings::custom_presets];
+ for (size_t i = 0; i < custom_presets_array.length(); ++i) {
+ str = custom_presets_array[i].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed");
+ return false;
+ }
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::graphic)) {
+ str = (*message_)[strings::msg_params]
+ [strings::graphic][strings::value].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed");
+ return false;
+ }
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) {
+ str = (*message_)[strings::msg_params]
+ [strings::secondary_graphic][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid secondary_graphic value syntax check failed");
+ return false;
+ }
+ }
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/show_response.cc b/src/components/application_manager/src/commands/mobile/show_response.cc
new file mode 100644
index 0000000000..1f9c59c6fc
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/show_response.cc
@@ -0,0 +1,58 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/show_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+ShowResponse::ShowResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+ShowResponse::~ShowResponse() {
+}
+
+void ShowResponse::Run() {
+ LOG4CXX_INFO(logger_, "ShowResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc
new file mode 100644
index 0000000000..bf200d72d3
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/slider_request.cc
@@ -0,0 +1,185 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/slider_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SliderRequest::SliderRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
+
+SliderRequest::~SliderRequest() {
+}
+
+bool SliderRequest::Init() {
+
+ /* Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.*/
+ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ default_timeout_ =
+ (*message_)[strings::msg_params][strings::timeout].asUInt();
+ }
+
+ return true;
+}
+
+void SliderRequest::Run() {
+ LOG4CXX_INFO(logger_, "SliderRequest::Run");
+
+ ApplicationSharedPtr application =
+ application_manager::ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params][strings::num_ticks].asInt()
+ < (*message_)[strings::msg_params][strings::position].asInt()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
+ if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) {
+ if ((*message_)[strings::msg_params][strings::num_ticks].asUInt()
+ != (*message_)[strings::msg_params]
+ [strings::slider_footer].length()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_, "Incoming slider has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::app_id] = application->app_id();
+
+ if (!(*message_)[strings::msg_params].keyExists(strings::timeout)) {
+ msg_params[strings::timeout] = default_timeout_;
+ }
+
+ SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
+}
+
+void SliderRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SliderRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ const event_engine::Event::EventID event_id = event.id();
+ if (event_id == hmi_apis::FunctionID::UI_OnResetTimeout) {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
+ correlation_id(),
+ default_timeout());
+ return;
+ }
+ if (event_id != hmi_apis::FunctionID::UI_Slider) {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+
+ //event_id == hmi_apis::FunctionID::UI_Slider:
+ LOG4CXX_INFO(logger_, "Received UI_Slider event");
+
+ const int response_code =
+ message[strings::params][hmi_response::code].asInt();
+
+ smart_objects::SmartObject response_msg_params = message[strings::msg_params];
+ if (response_code == hmi_apis::Common_Result::ABORTED) {
+ //Copy slider_position info to msg_params section
+ response_msg_params[strings::slider_position] =
+ message[strings::params][strings::data][strings::slider_position];
+ }
+
+ const bool is_response_success =
+ (mobile_apis::Result::SUCCESS == response_code) ||
+ //Aborted has slider_position data
+ (mobile_apis::Result::ABORTED == response_code) ||
+ //according with SDLAQ-CRS-2904
+ (mobile_apis::Result::TIMED_OUT == response_code);
+
+ SendResponse(is_response_success,
+ mobile_apis::Result::eType(response_code),
+ 0,
+ &response_msg_params);
+}
+
+bool SliderRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "PerformAudioPassThruRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ str = (*message_)[strings::msg_params][strings::slider_header].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed");
+ return true;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) {
+ const smart_objects::SmartArray* sf_array =
+ (*message_)[strings::msg_params][strings::slider_footer].asArray();
+
+ smart_objects::SmartArray::const_iterator it_sf = sf_array->begin();
+ smart_objects::SmartArray::const_iterator it_sf_end = sf_array->end();
+
+ for (; it_sf != it_sf_end; ++it_sf) {
+ str = (*it_sf).asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid slider_footer syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+} // namespace application_manager
+
diff --git a/src/components/application_manager/src/commands/mobile/slider_response.cc b/src/components/application_manager/src/commands/mobile/slider_response.cc
new file mode 100644
index 0000000000..bfb6b0a1e6
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/slider_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/slider_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SliderResponse::SliderResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SliderResponse::~SliderResponse() {
+}
+
+void SliderResponse::Run() {
+ LOG4CXX_INFO(logger_, "SliderResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc
new file mode 100644
index 0000000000..de37e8b49e
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/speak_request.cc
@@ -0,0 +1,160 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+#include "application_manager/commands/mobile/speak_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SpeakRequest::SpeakRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+ subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+}
+
+SpeakRequest::~SpeakRequest() {
+}
+
+void SpeakRequest::Run() {
+ LOG4CXX_INFO(logger_, "SpeakRequest::Run");
+
+ ApplicationSharedPtr app = application_manager::ApplicationManagerImpl::instance()
+ ->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming speak has contains \\t\\n \\\\t \\\\n "
+ " text contains only whitespace in ttsChunks");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ (*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ (*message_)[strings::msg_params][hmi_request::speak_type] =
+ hmi_apis::Common_SpeakType::SPEAK;
+ SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
+ &message_->getElement(strings::msg_params), true);
+}
+
+void SpeakRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SpeakRequest::on_event");
+ switch (event.id()) {
+ case hmi_apis::FunctionID::TTS_Speak: {
+ LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+
+ ProcessTTSSpeakResponse(event.smart_object());
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received TTS_OnResetTimeout event");
+
+ ApplicationManagerImpl::instance()->updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+void SpeakRequest::ProcessTTSSpeakResponse(
+ const smart_objects::SmartObject& message) {
+ LOG4CXX_INFO(logger_, "SpeakRequest::ProcessTTSSpeakResponse");
+ ApplicationSharedPtr application = ApplicationManagerImpl::instance()->application(
+ connection_key());
+
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ bool result = false;
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ if (hmi_apis::Common_Result::SUCCESS ==
+ static_cast<hmi_apis::Common_Result::eType>(result_code)) {
+ result = true;
+ }
+ (*message_)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::SpeakID;
+
+ const char* return_info = NULL;
+
+ if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
+ static_cast<hmi_apis::Common_Result::eType>(result_code)) {
+ result_code = mobile_apis::Result::WARNINGS;
+ return_info = std::string(
+ "Unsupported phoneme type sent in a prompt").c_str();
+ }
+
+ SendResponse(result, static_cast<mobile_apis::Result::eType>(result_code),
+ return_info, &(message[strings::msg_params]));
+}
+
+bool SpeakRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "SpeakRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
+ const smart_objects::SmartArray* tc_array =
+ (*message_)[strings::msg_params][strings::tts_chunks].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
+ smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
+
+ for (; it_tc != it_tc_end; ++it_tc) {
+ str = (*it_tc)[strings::text].asCharArray();
+ if (strlen(str) && !CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/speak_response.cc b/src/components/application_manager/src/commands/mobile/speak_response.cc
new file mode 100644
index 0000000000..92b85bbb84
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/speak_response.cc
@@ -0,0 +1,58 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/speak_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SpeakResponse::SpeakResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SpeakResponse::~SpeakResponse() {
+}
+
+void SpeakResponse::Run() {
+ LOG4CXX_INFO(logger_, "SpeakResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
new file mode 100644
index 0000000000..b6a4d8a28e
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc
@@ -0,0 +1,101 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/subscribe_button_request.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace str = strings;
+
+SubscribeButtonRequest::SubscribeButtonRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SubscribeButtonRequest::~SubscribeButtonRequest() {
+}
+
+void SubscribeButtonRequest::Run() {
+ LOG4CXX_INFO(logger_, "SubscribeButtonRequest::Run");
+
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asUInt());
+
+ if (!IsSubscribtionAllowed(app, btn_id)) {
+ LOG4CXX_ERROR_EXT(logger_, "Subscribe on button " << btn_id
+ << " isn't allowed");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
+ }
+
+ if (app->IsSubscribedToButton(btn_id)) {
+ LOG4CXX_ERROR_EXT(logger_, "Already subscribed to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ app->SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+
+ app->UpdateHash();
+}
+
+bool SubscribeButtonRequest::IsSubscribtionAllowed(
+ ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) {
+
+ if (!app->is_media_application() &&
+ ((mobile_apis::ButtonName::SEEKLEFT == btn_id) ||
+ (mobile_apis::ButtonName::SEEKRIGHT == btn_id)||
+ (mobile_apis::ButtonName::TUNEUP == btn_id) ||
+ (mobile_apis::ButtonName::TUNEDOWN == btn_id))) {
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
new file mode 100644
index 0000000000..6253f8ca3d
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/subscribe_button_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SubscribeButtonResponse::SubscribeButtonResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SubscribeButtonResponse::~SubscribeButtonResponse() {
+}
+
+void SubscribeButtonResponse::Run() {
+ LOG4CXX_INFO(logger_, "SubscribeButtonResponse::Run");
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..35595c2df6
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -0,0 +1,283 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/subscribe_vehicle_data_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+namespace commands {
+
+SubscribeVehicleDataRequest::SubscribeVehicleDataRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {
+}
+
+#ifdef HMI_DBUS_API
+namespace {
+ struct Subrequest {
+ hmi_apis::FunctionID::eType func_id;
+ const char* str;
+ };
+ Subrequest subrequests[] = {
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State, strings::fuel_level_state},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption, strings::instant_fuel_consumption},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature, strings::external_temp},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure, strings::tire_pressure},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus, strings::belt_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation, strings::body_information},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus, strings::device_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking, strings::driver_braking},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus, strings::wiper_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus, strings::head_lamp_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque, strings::engine_torque},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition, strings::acc_pedal_pos},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle, strings::steering_wheel_angle},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo, strings::e_call_info},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus, strings::airbag_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent, strings::emergency_event},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus, strings::cluster_mode_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
+ };
+}
+#endif // #ifdef HMI_DBUS_API
+
+void SubscribeVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "SubscribeVehicleDataRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ // counter for items to subscribe
+ int32_t items_to_subscribe = 0;
+ // counter for subscribed items by application
+ int32_t subscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject response_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+
+ for (; vehicle_data.end() != it; ++it) {
+ std::string key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_subscribe;
+ msg_params[key_name] = is_key_enabled;
+
+ VehicleDataType key_type = it->second;
+ if (app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
+ ++subscribed_items;
+ } else {
+ response_params[key_name][strings::data_type] = key_type;
+ response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ }
+ }
+ }
+ }
+
+ if (0 == items_to_subscribe) {
+ if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "No data in the request");
+ }
+ return;
+ } else if (0 == subscribed_items) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Already subscribed on provided VehicleData.",
+ &response_params);
+ return;
+ }
+
+#ifdef HMI_DBUS_API
+ //Generate list of subrequests
+ for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
+ const Subrequest& sr = subrequests[i];
+ if (true == (*message_)[strings::msg_params].keyExists(sr.str)
+ && true == (*message_)[strings::msg_params][sr.str].asBool()) {
+ HmiRequest hmi_request;
+ hmi_request.str = sr.str;
+ hmi_request.func_id = sr.func_id;
+ hmi_request.complete = false;
+ hmi_requests_.push_back(hmi_request);
+ }
+ }
+ LOG4CXX_INFO(logger_, hmi_requests_.size() << " requests are going to be sent to HMI");
+
+ //Send subrequests
+ for (HmiRequests::const_iterator it = hmi_requests_.begin(); it != hmi_requests_.end(); ++it)
+ SendHMIRequest(it->func_id, &msg_params, true);
+#else
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ &msg_params, true);
+#endif // #ifdef HMI_DBUS_API
+}
+
+void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "SubscribeVehicleDataRequest::on_event");
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ CommandRequestImpl::connection_key());
+
+#ifdef HMI_DBUS_API
+ for (HmiRequests::iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ HmiRequest & hmi_request = *it;
+ if (hmi_request.func_id == event.id()) {
+ hmi_request.status =
+ static_cast<hmi_apis::Common_Result::eType>(message[strings::params][hmi_response::code]
+ .asInt());
+ if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
+ hmi_request.value = message[strings::msg_params][hmi_request.str];
+ hmi_request.complete = true;
+ break;
+ }
+ }
+ bool all_complete = true;
+ bool any_arg_success = false;
+ mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ if (!it->complete) {
+ all_complete = false;
+ break;
+ }
+ if (hmi_apis::Common_Result::SUCCESS != it->status) {
+ if (mobile_api::Result::SUCCESS == status) {
+ status = static_cast<mobile_apis::Result::eType>(it->status);
+ } else if (status
+ != static_cast<mobile_apis::Result::eType>(it->status)) {
+ status = mobile_api::Result::eType::GENERIC_ERROR;
+ }
+ LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status <<
+ ", so response status become " << status);
+ } else {
+ any_arg_success = true;
+ }
+ }
+
+ if (all_complete) {
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ if (any_arg_success) {
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ response_params[it->str] = it->value;
+ }
+ }
+ LOG4CXX_INFO(logger_, "All HMI requests are complete");
+ SendResponse(any_arg_success, status, NULL, &response_params);
+ app->UpdateHash();
+ }
+#else
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result =
+ hmi_result == hmi_apis::Common_Result::SUCCESS;
+
+ mobile_apis::Result::eType result_code =
+ hmi_result == hmi_apis::Common_Result::SUCCESS
+ ? mobile_apis::Result::SUCCESS
+ : static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ const char* return_info = NULL;
+ if (result) {
+ if (IsAnythingAlreadySubscribed(message[strings::msg_params])) {
+ result_code = mobile_apis::Result::IGNORED;
+ return_info =
+ std::string("Already subscribed on some provided VehicleData.").c_str();
+ }
+ }
+
+ SendResponse(result,
+ result_code,
+ return_info,
+ &(message[strings::msg_params]));
+ app->UpdateHash();
+#endif // #ifdef HMI_DBUS_API
+}
+
+bool SubscribeVehicleDataRequest::IsAnythingAlreadySubscribed(
+ const smart_objects::SmartObject& msg_params) const {
+ LOG4CXX_INFO(logger_, "IsAnythingAlreadySubscribed");
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (msg_params.keyExists(it->first)) {
+ if (msg_params[it->first][strings::result_code].asInt() ==
+ hmi_apis::Common_VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..972a654188
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/subscribe_vehicle_data_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+namespace commands {
+
+SubscribeVehicleDataResponse::SubscribeVehicleDataResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {
+}
+
+void SubscribeVehicleDataResponse::Run() {
+ LOG4CXX_INFO(logger_, "SubscribeVehicleDataResponse::Run");
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc
new file mode 100644
index 0000000000..2765aad8d7
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/system_request.cc
@@ -0,0 +1,168 @@
+/*
+
+Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <vector>
+#include <string>
+#include <stdio.h>
+#include "application_manager/commands/mobile/system_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+
+namespace application_manager {
+
+namespace commands {
+
+uint32_t SystemRequest::index = 0;
+
+SystemRequest::SystemRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+SystemRequest::~SystemRequest() {
+}
+
+void SystemRequest::Run() {
+ LOG4CXX_INFO(logger_, "SystemRequest::Run");
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!(application.valid())) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message_)[strings::msg_params][strings::request_type].asInt());
+
+ if (!(*message_)[strings::params].keyExists(strings::binary_data) &&
+ mobile_apis::RequestType::PROPRIETARY == request_type) {
+ LOG4CXX_ERROR(logger_, "Binary data empty");
+
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ std::vector<uint8_t> binary_data;
+ if ((*message_)[strings::params].keyExists(strings::binary_data)) {
+ binary_data = (*message_)[strings::params][strings::binary_data].asBinary();
+ }
+
+ std::string file_path = profile::Profile::instance()->system_files_path();
+ if (!file_system::CreateDirectoryRecursively(file_path)) {
+ LOG4CXX_ERROR(logger_, "Cann't create folder.");
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+
+ std::string file_name = "SYNC";
+ if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
+ file_name = (*message_)[strings::msg_params][strings::file_name].asString();
+ }
+
+ // to avoid override existing file
+ const uint8_t max_size = 255;
+ char buf[max_size] = {'\0'};
+ snprintf(buf, sizeof(buf)/sizeof(buf[0]), "%d%s", index++, file_name.c_str());
+ file_name = buf;
+
+ std::string full_file_path = file_path + "/" + file_name;
+ if (binary_data.size()) {
+ if (mobile_apis::Result::SUCCESS !=
+ (ApplicationManagerImpl::instance()->SaveBinary(
+ binary_data, file_path, file_name, 0))) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+ } else {
+ if (!(file_system::CreateFile(full_file_path))) {
+ SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
+ return;
+ }
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (std::string::npos != file_name.find("IVSU")) {
+ msg_params[strings::file_name] = file_name.c_str();
+ } else {
+ msg_params[strings::file_name] = full_file_path;
+ }
+
+ if (mobile_apis::RequestType::PROPRIETARY != request_type) {
+ msg_params[strings::app_id] = (application->mobile_app_id())->asString();
+ }
+ msg_params[strings::request_type] =
+ (*message_)[strings::msg_params][strings::request_type];
+ SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
+ &msg_params, true);
+
+}
+
+void SystemRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "AddSubMenuRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+ bool result = mobile_apis::Result::SUCCESS == result_code;
+
+ ApplicationSharedPtr application =
+ ApplicationManagerImpl::instance()->application(connection_key());
+
+ if (!(application.valid())) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ return;
+ }
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_response.cc b/src/components/application_manager/src/commands/mobile/system_response.cc
new file mode 100644
index 0000000000..e77ab08450
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/system_response.cc
@@ -0,0 +1,56 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/system_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SystemResponse::SystemResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+SystemResponse::~SystemResponse() {
+}
+
+void SystemResponse::Run() {
+ LOG4CXX_INFO(logger_, "SystemResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc
new file mode 100644
index 0000000000..a07cfcd8f0
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc
@@ -0,0 +1,60 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/unregister_app_interface_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+void UnregisterAppInterfaceRequest::Run() {
+ LOG4CXX_INFO(logger_, "UnregisterAppInterfaceRequest::Run");
+
+ ApplicationManagerImpl* app_manager = ApplicationManagerImpl::instance();
+
+ if (!app_manager->application(connection_key())) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ app_manager->UnregisterApplication(connection_key(),
+ mobile_apis::Result::SUCCESS);
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc
new file mode 100644
index 0000000000..8ef0eb3ed0
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/unregister_app_interface_response.cc
@@ -0,0 +1,47 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/unregister_app_interface_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+void UnregisterAppInterfaceResponse::Run() {
+ LOG4CXX_INFO(logger_, "UnregisterAppInterfaceResponse::Run");
+
+ SendResponse((*message_)[strings::msg_params][strings::success].asBool());
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
new file mode 100644
index 0000000000..f22d1c0a2f
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/unsubscribe_button_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace str = strings;
+
+UnsubscribeButtonRequest::UnsubscribeButtonRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {
+}
+
+void UnsubscribeButtonRequest::Run() {
+ LOG4CXX_INFO(logger_, "UnsubscribeButtonRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[str::params][str::connection_key].asUInt());
+
+ if (!app) {
+ LOG4CXX_ERROR_EXT(logger_, "APPLICATION_NOT_REGISTERED");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ const uint32_t btn_id = (*message_)[str::msg_params][str::button_name]
+ .asUInt();
+
+ if (!app->IsSubscribedToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
+ LOG4CXX_ERROR_EXT(logger_, "App doesn't subscibe to button " << btn_id);
+ SendResponse(false, mobile_apis::Result::IGNORED);
+ return;
+ }
+
+ app->UnsubscribeFromButton(static_cast<mobile_apis::ButtonName::eType>(btn_id));
+ SendResponse(true, mobile_apis::Result::SUCCESS);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
new file mode 100644
index 0000000000..1331eac27f
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc
@@ -0,0 +1,69 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/unsubscribe_button_response.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UnsubscribeButtonResponse::UnsubscribeButtonResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {
+}
+
+void UnsubscribeButtonResponse::Run() {
+ LOG4CXX_INFO(logger_, "UnsubscribeButtonResponse::Run");
+
+ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
new file mode 100644
index 0000000000..fc7145078f
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -0,0 +1,279 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace application_manager {
+namespace commands {
+
+UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest(
+ const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {
+}
+
+#ifdef HMI_DBUS_API
+namespace {
+ struct Subrequest {
+ hmi_apis::FunctionID::eType func_id;
+ const char* str;
+ };
+ Subrequest subrequests[] = {
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel, strings::fuel_level},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State, strings::fuel_level_state},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption, strings::instant_fuel_consumption},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature, strings::external_temp},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure, strings::tire_pressure},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus, strings::belt_status},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation, strings::body_information},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus, strings::device_status},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking, strings::driver_braking},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus, strings::wiper_status},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus, strings::head_lamp_status},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque, strings::engine_torque},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition, strings::acc_pedal_pos},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle, strings::steering_wheel_angle},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo, strings::e_call_info},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus, strings::airbag_status},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent, strings::emergency_event},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus, strings::cluster_mode_status},
+ { hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key},
+ };
+}
+#endif // #ifdef HMI_DBUS_API
+
+void UnsubscribeVehicleDataRequest::Run() {
+ LOG4CXX_INFO(logger_, "UnsubscribeVehicleDataRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ // counter for items to subscribe
+ int32_t items_to_unsubscribe = 0;
+ // counter for subscribed items by application
+ int32_t unsubscribed_items = 0;
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject response_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = app->app_id();
+
+ for (; vehicle_data.end() != it; ++it) {
+ std::string key_name = it->first;
+ if ((*message_)[strings::msg_params].keyExists(key_name)) {
+ bool is_key_enabled = (*message_)[strings::msg_params][key_name].asBool();
+ if (is_key_enabled) {
+ ++items_to_unsubscribe;
+ msg_params[key_name] = is_key_enabled;
+
+ VehicleDataType key_type = it->second;
+ if (app->UnsubscribeFromIVI(static_cast<uint32_t>(key_type))) {
+ ++unsubscribed_items;
+ } else {
+ response_params[key_name][strings::data_type] = key_type;
+ response_params[key_name][strings::result_code] =
+ mobile_apis::VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED;
+ }
+ }
+ }
+ }
+
+ if (0 == items_to_unsubscribe) {
+ if (HasDisallowedParams()) {
+ SendResponse(false, mobile_apis::Result::DISALLOWED);
+ } else {
+ SendResponse(false, mobile_apis::Result::INVALID_DATA,
+ "No data in the request.");
+ }
+ return;
+ } else if (0 == unsubscribed_items) {
+ SendResponse(false, mobile_apis::Result::IGNORED,
+ "Was not subscribed on any VehicleData.", &response_params);
+ return;
+ }
+
+#ifdef HMI_DBUS_API
+ //Generate list of subrequests
+ for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) {
+ const Subrequest& sr = subrequests[i];
+ if (true == (*message_)[strings::msg_params].keyExists(sr.str)
+ && true == (*message_)[strings::msg_params][sr.str].asBool()) {
+ HmiRequest hmi_request;
+ hmi_request.str = sr.str;
+ hmi_request.func_id = sr.func_id;
+ hmi_request.complete = false;
+ hmi_requests_.push_back(hmi_request);
+ }
+ }
+ LOG4CXX_INFO(logger_,
+ hmi_requests_.size() << " requests are going to be sent to HMI");
+
+ //Send subrequests
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it)
+ SendHMIRequest(it->func_id, &msg_params, true);
+#else
+ SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
+ &msg_params, true);
+#endif // #ifdef HMI_DBUS_API
+}
+
+void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "UnsubscribeVehicleDataRequest::on_event");
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+#ifdef HMI_DBUS_API
+ for (HmiRequests::iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ HmiRequest & hmi_request = *it;
+ if (hmi_request.func_id == event.id()) {
+ hmi_request.status =
+ static_cast<hmi_apis::Common_Result::eType>(message[strings::params][hmi_response::code]
+ .asInt());
+ if (hmi_apis::Common_Result::SUCCESS == hmi_request.status)
+ hmi_request.value = message[strings::msg_params][hmi_request.str];
+ hmi_request.complete = true;
+ break;
+ }
+ }
+ bool all_complete = true;
+ bool any_arg_success = false;
+ mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS;
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ if (!it->complete) {
+ all_complete = false;
+ break;
+ }
+ if (hmi_apis::Common_Result::SUCCESS != it->status) {
+ if (mobile_api::Result::SUCCESS == status) {
+ status = static_cast<mobile_apis::Result::eType>(it->status);
+ } else if (status
+ != static_cast<mobile_apis::Result::eType>(it->status)) {
+ status = mobile_api::Result::eType::GENERIC_ERROR;
+ } LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status <<
+ ", so response status become " << status);
+ } else {
+ any_arg_success = true;
+ }
+ }
+ if (all_complete) {
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ if (any_arg_success) {
+ for (HmiRequests::const_iterator it = hmi_requests_.begin();
+ it != hmi_requests_.end(); ++it) {
+ response_params[it->str] = it->value;
+ }
+ }
+ LOG4CXX_INFO(logger_, "All HMI requests are complete");
+ SendResponse(any_arg_success, status, NULL, &response_params);
+ }
+#else
+ hmi_apis::Common_Result::eType hmi_result =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ bool result =
+ hmi_result == hmi_apis::Common_Result::SUCCESS;
+
+ mobile_apis::Result::eType result_code =
+ hmi_result == hmi_apis::Common_Result::SUCCESS
+ ? mobile_apis::Result::SUCCESS
+ : static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+
+ const char* return_info = NULL;
+
+ if (result) {
+ if (IsAnythingAlreadyUnsubscribed(message[strings::msg_params])) {
+ result_code = mobile_apis::Result::IGNORED;
+ return_info =
+ std::string("Some provided VehicleData was not subscribed.").c_str();
+ }
+ }
+
+ SendResponse(result, result_code, return_info,
+ &(message[strings::msg_params]));
+#endif // #ifdef HMI_DBUS_API
+}
+
+bool UnsubscribeVehicleDataRequest::IsAnythingAlreadyUnsubscribed(
+ const smart_objects::SmartObject& msg_params) const {
+ LOG4CXX_INFO(logger_, "IsAnythingAlreadyUnsubscribed");
+
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data();
+ VehicleData::const_iterator it = vehicle_data.begin();
+
+ for (; vehicle_data.end() != it; ++it) {
+ if (msg_params.keyExists(it->first)) {
+ if (msg_params[it->first][strings::result_code].asInt() ==
+ hmi_apis::Common_VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
new file mode 100644
index 0000000000..60f7077da7
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
@@ -0,0 +1,66 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
+
+namespace application_manager {
+namespace commands {
+
+UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse(
+ const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {
+}
+
+void UnsubscribeVehicleDataResponse::Run() {
+ LOG4CXX_INFO(logger_, "UnsubscribeVehicleDataResponse::Run");
+
+ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+ // check if response false
+ if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
+ if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
+ LOG4CXX_ERROR(logger_, "Success = false");
+ SendResponse(false);
+ return;
+ }
+ }
+
+ // TODO(DK): Some logic
+ SendResponse(true);
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
new file mode 100644
index 0000000000..9447772568
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
@@ -0,0 +1,227 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "application_manager/commands/mobile/update_turn_list_request.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateTurnListRequest::UpdateTurnListRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+}
+
+UpdateTurnListRequest::~UpdateTurnListRequest() {
+}
+
+void UpdateTurnListRequest::Run() {
+ LOG4CXX_INFO(logger_, "UpdateTurnListRequest::Run");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ (*message_)[strings::params][strings::connection_key].asUInt());
+
+ if (!app) {
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ return;
+ }
+
+ if (IsWhiteSpaceExist()) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming update turn list has contains \t\n \\t \\n");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ //ProcessSoftButtons checks strings on the contents incorrect character
+
+ mobile_apis::Result::eType processing_result =
+ MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app);
+
+ if (mobile_apis::Result::SUCCESS != processing_result) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, processing_result);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ smart_objects::SmartObject& turn_list_array =
+ ((*message_)[strings::msg_params][strings::turn_list]);
+ for (uint32_t i = 0; i < turn_list_array.length(); ++i) {
+ if((turn_list_array[i].keyExists(strings::turn_icon)) &&
+ (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImage(
+ turn_list_array[i][strings::turn_icon], app))) {
+ LOG4CXX_ERROR_EXT(
+ logger_,
+ "MessageHelper::VerifyImage return INVALID_DATA");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ }
+ }
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params = (*message_)[strings::msg_params];
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ if (!CheckTurnListArray()) {
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ for (uint32_t i = 0; i < msg_params[strings::turn_list].length(); ++i) {
+ if (msg_params[strings::turn_list][i].keyExists(hmi_request::navi_text)) {
+ std::string navigation_text =
+ msg_params[strings::turn_list][i][hmi_request::navi_text].asString();
+ msg_params[strings::turn_list][i].erase(hmi_request::navi_text);
+ msg_params[strings::turn_list]
+ [i][hmi_request::navi_text][hmi_request::field_name] =
+ static_cast<int>(hmi_apis::Common_TextFieldName::turnText);
+ msg_params[strings::turn_list]
+ [i][hmi_request::navi_text][hmi_request::field_text] =
+ navigation_text;
+ }
+ }
+ }
+
+ msg_params[strings::app_id] = app->app_id();
+
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ MessageHelper::SubscribeApplicationToSoftButton((*message_)[strings::msg_params],
+ app, function_id());
+ }
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list) ||
+ (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ SendHMIRequest(hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params,
+ true);
+ } else {
+ // conditional mandatory
+ LOG4CXX_ERROR(logger_, "INVALID_DATA!");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ }
+}
+
+void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "UpdateTurnListRequest::on_event");
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
+ LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
+
+ mobile_apis::Result::eType result_code =
+ static_cast<mobile_apis::Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ HMICapabilities& hmi_capabilities =
+ ApplicationManagerImpl::instance()->hmi_capabilities();
+
+ bool result = (mobile_apis::Result::SUCCESS == result_code) ||
+ ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) &&
+ (hmi_capabilities.is_ui_cooperating()));
+
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_,"Received unknown event" << event.id());
+ break;
+ }
+ }
+}
+
+bool UpdateTurnListRequest::CheckTurnListArray() {
+ int32_t length =
+ (*message_)[strings::msg_params][strings::turn_list].length();
+ if (0 == length) {
+ return false;
+ }
+
+ for (int32_t i = 0; i < length; ++i) {
+ if (!((*message_)[strings::msg_params][strings::turn_list][i].
+ keyExists(hmi_request::navi_text)) &&
+ !((*message_)[strings::msg_params][strings::turn_list][i].
+ keyExists(strings::turn_icon))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool UpdateTurnListRequest::IsWhiteSpaceExist() {
+ LOG4CXX_INFO(logger_, "UpdateTurnListRequest::IsWhiteSpaceExist");
+ const char* str = NULL;
+
+ if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) {
+ const smart_objects::SmartArray* tl_array =
+ (*message_)[strings::msg_params][strings::turn_list].asArray();
+
+ smart_objects::SmartArray::const_iterator it_tl = tl_array->begin();
+ smart_objects::SmartArray::const_iterator it_tl_end = tl_array->end();
+
+ for (; it_tl != it_tl_end; ++it_tl) {
+ if ((*it_tl).keyExists(strings::navigation_text)) {
+ str = (*it_tl)[strings::navigation_text].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid turn_list navigation_text text syntax check failed");
+ return true;
+ }
+ }
+
+ if ((*it_tl).keyExists(strings::turn_icon)) {
+ str = (*it_tl)[strings::turn_icon][strings::value].asCharArray();
+ if (!CheckSyntax(str)) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid turn_list turn_icon value syntax check failed");
+ return true;
+ }
+ }
+
+ }
+ }
+ return false;
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc
new file mode 100644
index 0000000000..ec1e0bce8a
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc
@@ -0,0 +1,57 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/update_turn_list_response.h"
+#include "application_manager/application_manager_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UpdateTurnListResponse::UpdateTurnListResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+}
+
+UpdateTurnListResponse::~UpdateTurnListResponse() {
+}
+
+void UpdateTurnListResponse::Run() {
+ LOG4CXX_INFO(logger_, "UpdateTurnListResponse::Run");
+
+ ApplicationManagerImpl::instance()->SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/pending.cc b/src/components/application_manager/src/commands/pending.cc
new file mode 100644
index 0000000000..0c04464af3
--- /dev/null
+++ b/src/components/application_manager/src/commands/pending.cc
@@ -0,0 +1,67 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/pending.h"
+
+namespace application_manager {
+
+namespace commands {
+
+
+Pending::Pending()
+: last_(hmi_apis::FunctionID::INVALID_ENUM) {
+}
+
+Pending::~Pending() {
+}
+
+void Pending::Add(hmi_apis::FunctionID::eType id) {
+ sync_primitives::AutoLock L(lock_);
+ pending_.insert(id);
+}
+
+void Pending::Remove(hmi_apis::FunctionID::eType id) {
+ sync_primitives::AutoLock L(lock_);
+ pending_.erase(id);
+
+ if (pending_.empty()) {
+ last_ = id;
+ }
+}
+
+bool Pending::IsFinal(hmi_apis::FunctionID::eType id) {
+ return id == last_;
+}
+
+} // namespace commands
+} // namespace application_manager
diff --git a/src/components/application_manager/src/event_engine/event.cc b/src/components/application_manager/src/event_engine/event.cc
new file mode 100644
index 0000000000..e454025df1
--- /dev/null
+++ b/src/components/application_manager/src/event_engine/event.cc
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace application_manager {
+namespace event_engine {
+
+Event::Event(const EventID& id)
+: id_(id)
+, response_so_() {
+}
+
+Event::~Event() {
+}
+
+void Event::raise() {
+ EventDispatcher::instance()->raise_event(*this);
+}
+
+void Event::set_smart_object(smart_objects::SmartObject& so) {
+ response_so_ = so;
+}
+
+}
+}
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher.cc b/src/components/application_manager/src/event_engine/event_dispatcher.cc
new file mode 100644
index 0000000000..a552ef6228
--- /dev/null
+++ b/src/components/application_manager/src/event_engine/event_dispatcher.cc
@@ -0,0 +1,123 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "interfaces/HMI_API.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace application_manager {
+namespace event_engine {
+using namespace sync_primitives;
+
+EventDispatcher::EventDispatcher()
+ : observers_() {
+}
+
+EventDispatcher::~EventDispatcher() {
+}
+
+void EventDispatcher::raise_event(const Event& event) {
+ // create local list
+ ObserverList list;
+ {
+ AutoLock auto_lock(state_lock_);
+ // check if event is notification
+ if (hmi_apis::messageType::notification == event.smart_object_type()) {
+
+ //ObserversMap iterator
+ ObserversMap::iterator it = observers_[event.id()].begin();
+ for (; observers_[event.id()].end() != it; ++it) {
+ list = it->second;
+ }
+ }
+
+ if (hmi_apis::messageType::response == event.smart_object_type()
+ || hmi_apis::messageType::error_response == event.smart_object_type()) {
+ list = observers_[event.id()][event.smart_object_correlation_id()];
+ }
+ }
+
+ // Call observers
+ ObserverList::iterator observers = list.begin();
+ for (; list.end() != observers; ++observers) {
+ (*observers)->on_event(event);
+ }
+}
+
+void EventDispatcher::add_observer(const Event::EventID& event_id,
+ int32_t hmi_correlation_id,
+ EventObserver* const observer) {
+ AutoLock auto_lock(state_lock_);
+ observers_[event_id][hmi_correlation_id].push_back(observer);
+}
+
+void EventDispatcher::remove_observer(const Event::EventID& event_id,
+ EventObserver* const observer) {
+ AutoLock auto_lock(state_lock_);
+ ObserversMap::iterator it = observers_[event_id].begin();
+ for (; observers_[event_id].end() != it; ++it) {
+
+ //ObserverList iterator
+ ObserverList::iterator observer_it = it->second.begin();
+ while (it->second.end() != observer_it) {
+ if (observer->id() == (*observer_it)->id()) {
+ observer_it = it->second.erase(observer_it);
+ } else {
+ ++observer_it;
+ }
+ }
+ }
+}
+
+void EventDispatcher::remove_observer(EventObserver* const observer) {
+ AutoLock auto_lock(state_lock_);
+ EventObserverMap::iterator event_map = observers_.begin();
+ for (; observers_.end() != event_map; ++event_map) {
+
+ ObserversMap::iterator it = event_map->second.begin();
+ for (; event_map->second.end() != it; ++it) {
+
+ //ObserverList iterator
+ ObserverList::iterator observer_it = it->second.begin();
+ while (it->second.end() != observer_it) {
+ if (observer->id() == (*observer_it)->id()) {
+ observer_it = it->second.erase(observer_it);
+ } else {
+ ++observer_it;
+ }
+ }
+ }
+ }
+}
+
+}
+}
diff --git a/src/components/application_manager/src/event_engine/event_observer.cc b/src/components/application_manager/src/event_engine/event_observer.cc
new file mode 100644
index 0000000000..c6d81529f9
--- /dev/null
+++ b/src/components/application_manager/src/event_engine/event_observer.cc
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_observer.h"
+
+namespace application_manager {
+namespace event_engine {
+
+EventObserver::EventObserver()
+ : id_(0) {
+ //Get unique id based on this
+ id_ = reinterpret_cast<unsigned long>(this);
+}
+
+EventObserver::~EventObserver() {
+ unsubscribe_from_all_events();
+}
+
+void EventObserver::subscribe_on_event(const Event::EventID& event_id,
+ int32_t hmi_correlation_id) {
+ EventDispatcher::instance()->add_observer(event_id, hmi_correlation_id, this);
+}
+
+void EventObserver::unsubscribe_from_event(const Event::EventID& event_id) {
+ EventDispatcher::instance()->remove_observer(event_id, this);
+}
+
+void EventObserver::unsubscribe_from_all_events() {
+ EventDispatcher::instance()->remove_observer(this);
+}
+
+}
+}
diff --git a/src/components/application_manager/src/hmi_capabilities.cc b/src/components/application_manager/src/hmi_capabilities.cc
new file mode 100644
index 0000000000..5c67492b48
--- /dev/null
+++ b/src/components/application_manager/src/hmi_capabilities.cc
@@ -0,0 +1,874 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/hmi_capabilities.h"
+
+#include <map>
+
+#include "json/json.h"
+#include "utils/file_system.h"
+#include "interfaces/HMI_API.h"
+#include "config_profile/profile.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "formatters/CFormatterJsonBase.hpp"
+
+namespace application_manager {
+namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMICapabilities")
+
+std::map<std::string, hmi_apis::Common_Language::eType> languages_enum_values =
+{
+ {"EN_US", hmi_apis::Common_Language::EN_US},
+ {"ES_MX", hmi_apis::Common_Language::ES_MX},
+ {"FR_CA", hmi_apis::Common_Language::FR_CA},
+ {"DE_DE", hmi_apis::Common_Language::DE_DE},
+ {"ES_ES", hmi_apis::Common_Language::ES_ES},
+ {"EN_GB", hmi_apis::Common_Language::EN_GB},
+ {"RU_RU", hmi_apis::Common_Language::RU_RU},
+ {"TR_TR", hmi_apis::Common_Language::TR_TR},
+ {"PL_PL", hmi_apis::Common_Language::PL_PL},
+ {"FR_FR", hmi_apis::Common_Language::FR_FR},
+ {"IT_IT", hmi_apis::Common_Language::IT_IT},
+ {"SV_SE", hmi_apis::Common_Language::SV_SE},
+ {"PT_PT", hmi_apis::Common_Language::PT_PT},
+ {"NL_NL", hmi_apis::Common_Language::NL_NL},
+ {"EN_AU", hmi_apis::Common_Language::EN_AU},
+ {"ZH_CN", hmi_apis::Common_Language::ZH_CN},
+ {"ZH_TW", hmi_apis::Common_Language::ZH_TW},
+ {"JA_JP", hmi_apis::Common_Language::JA_JP},
+ {"AR_SA", hmi_apis::Common_Language::AR_SA},
+ {"KO_KR", hmi_apis::Common_Language::KO_KR},
+ {"PT_BR", hmi_apis::Common_Language::PT_BR},
+ {"CS_CZ", hmi_apis::Common_Language::CS_CZ},
+ {"DA_DK", hmi_apis::Common_Language::DA_DK},
+ {"NO_NO", hmi_apis::Common_Language::NO_NO}
+};
+
+std::map<std::string, hmi_apis::Common_VrCapabilities::eType> vr_enum_capabilities =
+{
+ {"TEXT", hmi_apis::Common_VrCapabilities::VR_TEXT}
+};
+
+std::map<std::string, hmi_apis::Common_ButtonName::eType> button_enum_name =
+{
+ {"OK" , hmi_apis::Common_ButtonName::OK},
+ {"SEEKLEFT" , hmi_apis::Common_ButtonName::SEEKLEFT},
+ {"SEEKRIGHT" , hmi_apis::Common_ButtonName::SEEKRIGHT},
+ {"TUNEUP" , hmi_apis::Common_ButtonName::TUNEUP},
+ {"TUNEDOWN" , hmi_apis::Common_ButtonName::TUNEDOWN},
+ {"PRESET_0" , hmi_apis::Common_ButtonName::PRESET_0},
+ {"PRESET_1" , hmi_apis::Common_ButtonName::PRESET_1},
+ {"PRESET_2" , hmi_apis::Common_ButtonName::PRESET_2},
+ {"PRESET_3" , hmi_apis::Common_ButtonName::PRESET_3},
+ {"PRESET_4" , hmi_apis::Common_ButtonName::PRESET_4},
+ {"PRESET_5" , hmi_apis::Common_ButtonName::PRESET_5},
+ {"PRESET_6" , hmi_apis::Common_ButtonName::PRESET_6},
+ {"PRESET_7" , hmi_apis::Common_ButtonName::PRESET_7},
+ {"PRESET_8" , hmi_apis::Common_ButtonName::PRESET_8},
+ {"PRESET_9" , hmi_apis::Common_ButtonName::PRESET_9},
+ {"CUSTOM_BUTTON" , hmi_apis::Common_ButtonName::CUSTOM_BUTTON},
+ {"SEARCH" , hmi_apis::Common_ButtonName::SEARCH},
+
+};
+
+std::map<std::string, hmi_apis::Common_TextFieldName::eType> text_fields_enum_name =
+{
+ {"mainField1", hmi_apis::Common_TextFieldName::mainField1},
+ {"mainField2", hmi_apis::Common_TextFieldName::mainField2},
+ {"mainField3", hmi_apis::Common_TextFieldName::mainField3},
+ {"mainField4", hmi_apis::Common_TextFieldName::mainField4},
+ {"statusBar" , hmi_apis::Common_TextFieldName::statusBar},
+ {"mediaClock", hmi_apis::Common_TextFieldName::mediaClock},
+ {"mediaTrack", hmi_apis::Common_TextFieldName::mediaTrack},
+ {"alertText1", hmi_apis::Common_TextFieldName::alertText1},
+ {"alertText2", hmi_apis::Common_TextFieldName::alertText2},
+ {"alertText3", hmi_apis::Common_TextFieldName::alertText3},
+ {"scrollableMessageBody" , hmi_apis::Common_TextFieldName::scrollableMessageBody},
+ {"initialInteractionText", hmi_apis::Common_TextFieldName::initialInteractionText},
+ {"navigationText1" , hmi_apis::Common_TextFieldName::navigationText1},
+ {"navigationText2" , hmi_apis::Common_TextFieldName::navigationText2},
+ {"ETA" , hmi_apis::Common_TextFieldName::ETA},
+ {"totalDistance" , hmi_apis::Common_TextFieldName::totalDistance},
+ {"audioPassThruDisplayText1", hmi_apis::Common_TextFieldName::audioPassThruDisplayText1},
+ {"audioPassThruDisplayText2", hmi_apis::Common_TextFieldName::audioPassThruDisplayText2},
+ {"sliderHeader" , hmi_apis::Common_TextFieldName::sliderHeader},
+ {"sliderFooter" , hmi_apis::Common_TextFieldName::sliderFooter},
+ {"notificationText" , hmi_apis::Common_TextFieldName::notificationText},
+ {"menuName" , hmi_apis::Common_TextFieldName::menuName},
+ {"secondaryText" , hmi_apis::Common_TextFieldName::secondaryText},
+ {"tertiaryText" , hmi_apis::Common_TextFieldName::tertiaryText},
+ {"timeToDestination", hmi_apis::Common_TextFieldName::timeToDestination},
+ {"turnText" , hmi_apis::Common_TextFieldName::turnText},
+ {"menuTitle" , hmi_apis::Common_TextFieldName::menuTitle},
+};
+
+std::map<std::string, hmi_apis::Common_MediaClockFormat::eType> media_clock_enum_name =
+{
+ {"CLOCK1" , hmi_apis::Common_MediaClockFormat::CLOCK1},
+ {"CLOCK2" , hmi_apis::Common_MediaClockFormat::CLOCK2},
+ {"CLOCK3" , hmi_apis::Common_MediaClockFormat::CLOCK3},
+ {"CLOCKTEXT1", hmi_apis::Common_MediaClockFormat::CLOCKTEXT1},
+ {"CLOCKTEXT2", hmi_apis::Common_MediaClockFormat::CLOCKTEXT2},
+ {"CLOCKTEXT3", hmi_apis::Common_MediaClockFormat::CLOCKTEXT3},
+ {"CLOCKTEXT4", hmi_apis::Common_MediaClockFormat::CLOCKTEXT4},
+};
+
+std::map<std::string, hmi_apis::Common_ImageType::eType> image_type_enum =
+{
+ {"STATIC" , hmi_apis::Common_ImageType::STATIC},
+ {"DYNAMIC", hmi_apis::Common_ImageType::DYNAMIC}
+};
+
+std::map<std::string, hmi_apis::Common_SamplingRate::eType> sampling_rate_enum =
+{
+ {"8KHZ" , hmi_apis::Common_SamplingRate::RATE_8KHZ},
+ {"16KHZ", hmi_apis::Common_SamplingRate::RATE_16KHZ},
+ {"22KHZ", hmi_apis::Common_SamplingRate::RATE_22KHZ},
+ {"44KHZ", hmi_apis::Common_SamplingRate::RATE_44KHZ}
+};
+
+std::map<std::string, hmi_apis::Common_BitsPerSample::eType> bit_per_sample_enum =
+{
+ {"RATE_8_BIT", hmi_apis::Common_BitsPerSample::RATE_8_BIT},
+ {"RATE_16_BIT", hmi_apis::Common_BitsPerSample::RATE_16_BIT}
+};
+
+std::map<std::string, hmi_apis::Common_AudioType::eType> audio_type_enum =
+{
+ {"PCM", hmi_apis::Common_AudioType::PCM}
+};
+
+std::map<std::string, hmi_apis::Common_HmiZoneCapabilities::eType> hmi_zone_enum =
+{
+ {"FRONT", hmi_apis::Common_HmiZoneCapabilities::FRONT},
+ {"BACK", hmi_apis::Common_HmiZoneCapabilities::BACK},
+};
+
+const std::map<std::string, hmi_apis::Common_ImageFieldName::eType>
+image_field_name_enum =
+{
+ {"softButtonImage", hmi_apis::Common_ImageFieldName::softButtonImage},
+ {"choiceImage", hmi_apis::Common_ImageFieldName::choiceImage},
+ {"choiceSecondaryImage", hmi_apis::Common_ImageFieldName::choiceSecondaryImage},
+ {"vrHelpItem", hmi_apis::Common_ImageFieldName::vrHelpItem},
+ {"turnIcon", hmi_apis::Common_ImageFieldName::turnIcon},
+ {"menuIcon", hmi_apis::Common_ImageFieldName::menuIcon},
+ {"cmdIcon", hmi_apis::Common_ImageFieldName::cmdIcon},
+ {"appIcon", hmi_apis::Common_ImageFieldName::appIcon},
+ {"graphic", hmi_apis::Common_ImageFieldName::graphic},
+ {"showConstantTBTIcon", hmi_apis::Common_ImageFieldName::showConstantTBTIcon},
+ {"showConstantTBTNextTurnIcon",
+ hmi_apis::Common_ImageFieldName::showConstantTBTNextTurnIcon}
+};
+
+const std::map<std::string, hmi_apis::Common_FileType::eType> file_type_enum =
+{
+ {"GRAPHIC_BMP", hmi_apis::Common_FileType::GRAPHIC_BMP},
+ {"GRAPHIC_JPEG", hmi_apis::Common_FileType::GRAPHIC_JPEG},
+ {"GRAPHIC_PNG", hmi_apis::Common_FileType::GRAPHIC_PNG},
+ {"AUDIO_WAVE", hmi_apis::Common_FileType::AUDIO_WAVE},
+ {"AUDIO_MP3", hmi_apis::Common_FileType::AUDIO_MP3},
+ {"AUDIO_AAC", hmi_apis::Common_FileType::AUDIO_AAC},
+ {"BINARY", hmi_apis::Common_FileType::BINARY},
+ {"JSON", hmi_apis::Common_FileType::JSON}
+};
+
+const std::map<std::string, hmi_apis::Common_DisplayType::eType> display_type_enum =
+{
+ {"CID", hmi_apis::Common_DisplayType::CID},
+ {"TYPE2", hmi_apis::Common_DisplayType::TYPE2},
+ {"TYPE5", hmi_apis::Common_DisplayType::TYPE5},
+ {"NGN", hmi_apis::Common_DisplayType::NGN},
+ {"GEN2_8_DMA", hmi_apis::Common_DisplayType::GEN2_8_DMA},
+ {"GEN2_6_DMA", hmi_apis::Common_DisplayType::GEN2_6_DMA},
+ {"MFD3", hmi_apis::Common_DisplayType::MFD3},
+ {"MFD4", hmi_apis::Common_DisplayType::MFD4},
+ {"MFD5", hmi_apis::Common_DisplayType::MFD5},
+ {"GEN3_8_INCH", hmi_apis::Common_DisplayType::GEN3_8_INCH}
+};
+
+const std::map<std::string, hmi_apis::Common_CharacterSet::eType> character_set_enum =
+{
+ {"TYPE2SET" , hmi_apis::Common_CharacterSet::TYPE2SET},
+ {"TYPE5SET" , hmi_apis::Common_CharacterSet::TYPE5SET},
+ {"CID1SET" , hmi_apis::Common_CharacterSet::CID1SET},
+ {"CID2SET" , hmi_apis::Common_CharacterSet::CID2SET}
+};
+
+HMICapabilities::HMICapabilities(ApplicationManagerImpl* const app_mngr)
+ : is_vr_cooperating_(false),
+ is_tts_cooperating_(false),
+ is_ui_cooperating_(false),
+ is_navi_cooperating_(false),
+ is_ivi_cooperating_(false),
+ is_vr_ready_response_recieved_(false),
+ is_tts_ready_response_recieved_(false),
+ is_ui_ready_response_recieved_(false),
+ is_navi_ready_response_recieved_(false),
+ is_ivi_ready_response_recieved_(false),
+ attenuated_supported_(false),
+ ui_language_(hmi_apis::Common_Language::INVALID_ENUM),
+ vr_language_(hmi_apis::Common_Language::INVALID_ENUM),
+ tts_language_(hmi_apis::Common_Language::INVALID_ENUM),
+ vehicle_type_(NULL),
+ ui_supported_languages_(NULL),
+ tts_supported_languages_(NULL),
+ vr_supported_languages_(NULL),
+ display_capabilities_(NULL),
+ hmi_zone_capabilities_(NULL),
+ soft_buttons_capabilities_(NULL),
+ button_capabilities_(NULL),
+ preset_bank_capabilities_(NULL),
+ vr_capabilities_(NULL),
+ speech_capabilities_(NULL),
+ audio_pass_thru_capabilities_(NULL),
+ prerecorded_speech_(NULL),
+ app_mngr_(app_mngr) {
+
+ if (false == load_capabilities_from_file()) {
+ LOG4CXX_ERROR(logger_, "file hmi_capabilities.json was not loaded");
+ } else {
+ LOG4CXX_INFO(logger_, "file hmi_capabilities.json was loaded");
+ }
+ if (false == profile::Profile::instance()->launch_hmi()) {
+ is_vr_ready_response_recieved_ = true;
+ is_tts_ready_response_recieved_ = true;
+ is_ui_ready_response_recieved_ = true;
+ is_navi_ready_response_recieved_ = true;
+ is_ivi_ready_response_recieved_ = true;
+
+ is_vr_cooperating_ = true;
+ is_tts_cooperating_ = true;
+ is_ui_cooperating_ = true;
+ is_navi_cooperating_ = true;
+ is_ivi_cooperating_ = true;
+ }
+}
+
+HMICapabilities::~HMICapabilities() {
+ delete vehicle_type_;
+ delete ui_supported_languages_;
+ delete tts_supported_languages_;
+ delete vr_supported_languages_;
+ delete display_capabilities_;
+ delete hmi_zone_capabilities_;
+ delete soft_buttons_capabilities_;
+ delete button_capabilities_;
+ delete preset_bank_capabilities_;
+ delete vr_capabilities_;
+ delete speech_capabilities_;
+ delete audio_pass_thru_capabilities_;
+ delete prerecorded_speech_;
+ app_mngr_ = NULL;
+}
+
+bool HMICapabilities::is_hmi_capabilities_initialized() const {
+ bool result = true;
+
+ if (is_vr_ready_response_recieved_ && is_tts_ready_response_recieved_
+ && is_ui_ready_response_recieved_ && is_navi_ready_response_recieved_
+ && is_ivi_ready_response_recieved_) {
+ if (is_vr_cooperating_) {
+ if ((!vr_supported_languages_) ||
+ (hmi_apis::Common_Language::INVALID_ENUM == vr_language_)) {
+ result = false;
+ }
+ }
+
+ if (is_tts_cooperating_) {
+ if ((!tts_supported_languages_) ||
+ (hmi_apis::Common_Language::INVALID_ENUM == tts_language_)) {
+ result = false;
+ }
+ }
+
+ if (is_ui_cooperating_) {
+ if ((!ui_supported_languages_) ||
+ (hmi_apis::Common_Language::INVALID_ENUM == ui_language_)) {
+ result = false;
+ }
+ }
+
+ if (is_ivi_cooperating_) {
+ if (!vehicle_type_) {
+ result = false;
+ }
+ }
+ } else {
+ result = false;
+ }
+
+ return result;
+}
+
+bool HMICapabilities::VerifyImageType(int32_t image_type) const {
+ if (!display_capabilities_) {
+ return false;
+ }
+
+ if (display_capabilities_->keyExists(hmi_response::image_capabilities)) {
+ const smart_objects::SmartObject& image_caps = display_capabilities_
+ ->getElement(hmi_response::image_capabilities);
+ for (uint32_t i = 0; i < image_caps.length(); ++i) {
+ if (image_caps.getElement(i).asInt() == image_type) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void HMICapabilities::set_is_vr_cooperating(bool value) {
+ is_vr_ready_response_recieved_ = true;
+ is_vr_cooperating_ = value;
+ if (is_vr_cooperating_) {
+ utils::SharedPtr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage));
+ app_mngr_->ManageHMICommand(get_language);
+ utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages));
+ app_mngr_->ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities));
+ app_mngr_->ManageHMICommand(get_capabilities);
+ }
+}
+
+void HMICapabilities::set_is_tts_cooperating(bool value) {
+ is_tts_ready_response_recieved_ = true;
+ is_tts_cooperating_ = value;
+ if (is_tts_cooperating_) {
+ utils::SharedPtr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetLanguage));
+ app_mngr_->ManageHMICommand(get_language);
+ utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetSupportedLanguages));
+ app_mngr_->ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::TTS_GetCapabilities));
+ app_mngr_->ManageHMICommand(get_capabilities);
+ }
+}
+
+void HMICapabilities::set_is_ui_cooperating(bool value) {
+ is_ui_ready_response_recieved_ = true;
+ is_ui_cooperating_ = value;
+ if (is_ui_cooperating_) {
+ utils::SharedPtr<smart_objects::SmartObject> get_language(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetLanguage));
+ app_mngr_->ManageHMICommand(get_language);
+ utils::SharedPtr<smart_objects::SmartObject> get_all_languages(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetSupportedLanguages));
+ app_mngr_->ManageHMICommand(get_all_languages);
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::UI_GetCapabilities));
+ app_mngr_->ManageHMICommand(get_capabilities);
+ }
+}
+
+void HMICapabilities::set_is_navi_cooperating(bool value) {
+ is_navi_ready_response_recieved_ = true;
+ is_navi_cooperating_ = value;
+}
+
+void HMICapabilities::set_is_ivi_cooperating(bool value) {
+ is_ivi_ready_response_recieved_ = true;
+ is_ivi_cooperating_ = value;
+ if (is_ivi_cooperating_) {
+ utils::SharedPtr<smart_objects::SmartObject> get_type(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleType));
+ app_mngr_->ManageHMICommand(get_type);
+ }
+}
+
+void HMICapabilities::set_attenuated_supported(bool state) {
+ attenuated_supported_ = state;
+}
+
+void HMICapabilities::set_active_ui_language(
+ const hmi_apis::Common_Language::eType& language) {
+ ui_language_ = language;
+}
+
+void HMICapabilities::set_active_vr_language(
+ const hmi_apis::Common_Language::eType& language) {
+ vr_language_ = language;
+}
+
+void HMICapabilities::set_active_tts_language(
+ const hmi_apis::Common_Language::eType& language) {
+ tts_language_ = language;
+}
+
+void HMICapabilities::set_ui_supported_languages(
+ const smart_objects::SmartObject& supported_languages) {
+ if (ui_supported_languages_) {
+ delete ui_supported_languages_;
+ }
+ ui_supported_languages_ = new smart_objects::SmartObject(supported_languages);
+}
+
+void HMICapabilities::set_tts_supported_languages(
+ const smart_objects::SmartObject& supported_languages) {
+ if (tts_supported_languages_) {
+ delete tts_supported_languages_;
+ }
+ tts_supported_languages_ = new smart_objects::SmartObject(
+ supported_languages);
+}
+
+void HMICapabilities::set_vr_supported_languages(
+ const smart_objects::SmartObject& supported_languages) {
+ if (vr_supported_languages_) {
+ delete vr_supported_languages_;
+ }
+ vr_supported_languages_ = new smart_objects::SmartObject(supported_languages);
+}
+
+void HMICapabilities::set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities) {
+ if (display_capabilities_) {
+ delete display_capabilities_;
+ }
+ display_capabilities_ = new smart_objects::SmartObject(display_capabilities);
+}
+
+void HMICapabilities::set_hmi_zone_capabilities(
+ const smart_objects::SmartObject& hmi_zone_capabilities) {
+ if (hmi_zone_capabilities_) {
+ delete hmi_zone_capabilities_;
+ }
+ hmi_zone_capabilities_ = new smart_objects::SmartObject(
+ hmi_zone_capabilities);
+}
+
+void HMICapabilities::set_soft_button_capabilities(
+ const smart_objects::SmartObject& soft_button_capabilities) {
+ if (soft_buttons_capabilities_) {
+ delete soft_buttons_capabilities_;
+ }
+ soft_buttons_capabilities_ = new smart_objects::SmartObject(
+ soft_button_capabilities);
+}
+
+void HMICapabilities::set_button_capabilities(
+ const smart_objects::SmartObject& button_capabilities) {
+ if (button_capabilities_) {
+ delete button_capabilities_;
+ }
+ button_capabilities_ = new smart_objects::SmartObject(button_capabilities);
+}
+
+void HMICapabilities::set_vr_capabilities(
+ const smart_objects::SmartObject& vr_capabilities) {
+ if (vr_capabilities_) {
+ delete vr_capabilities_;
+ }
+ vr_capabilities_ = new smart_objects::SmartObject(vr_capabilities);
+}
+
+void HMICapabilities::set_speech_capabilities(
+ const smart_objects::SmartObject& speech_capabilities) {
+ if (speech_capabilities_) {
+ delete speech_capabilities_;
+ }
+ speech_capabilities_ = new smart_objects::SmartObject(speech_capabilities);
+}
+
+void HMICapabilities::set_audio_pass_thru_capabilities(
+ const smart_objects::SmartObject& audio_pass_thru_capabilities) {
+ if (audio_pass_thru_capabilities_) {
+ delete audio_pass_thru_capabilities_;
+ }
+ audio_pass_thru_capabilities_ = new smart_objects::SmartObject(
+ audio_pass_thru_capabilities);
+}
+
+void HMICapabilities::set_preset_bank_capabilities(
+ const smart_objects::SmartObject& preset_bank_capabilities) {
+ if (preset_bank_capabilities_) {
+ delete preset_bank_capabilities_;
+ }
+ preset_bank_capabilities_ = new smart_objects::SmartObject(
+ preset_bank_capabilities);
+}
+
+void HMICapabilities::set_vehicle_type(
+ const smart_objects::SmartObject& vehicle_type) {
+ if (vehicle_type_) {
+ delete vehicle_type_;
+ }
+ vehicle_type_ = new smart_objects::SmartObject(vehicle_type);
+}
+
+void HMICapabilities::set_prerecorded_speech(
+ const smart_objects::SmartObject& prerecorded_speech) {
+ if (prerecorded_speech_) {
+ delete prerecorded_speech_;
+ prerecorded_speech_ = NULL;
+ }
+ prerecorded_speech_ = new smart_objects::SmartObject(prerecorded_speech);
+}
+
+bool HMICapabilities::load_capabilities_from_file() {
+ std::string json_string;
+ std::string file_name =
+ profile::Profile::instance()->hmi_capabilities_file_name();
+
+ if (!file_system::FileExists(file_name)) {
+ return false;
+ }
+
+ if (!file_system::ReadFile(file_name, json_string)) {
+ return false;
+ }
+
+ try {
+
+ Json::Reader reader_;
+ Json::Value root_json;
+
+ bool result = reader_.parse(json_string, root_json, false);
+ if (!result) {
+ return false;
+ }
+ // UI
+ if (check_existing_json_member(root_json, "UI")) {
+ Json::Value ui = root_json.get("UI", "");
+
+ if (check_existing_json_member(ui, "language")) {
+ set_active_ui_language(
+ languages_enum_values.find(ui.get("language", "").asString())->second);
+ }
+
+ if (check_existing_json_member(ui, "languages")) {
+ smart_objects::SmartObject ui_languages_so(
+ smart_objects::SmartType_Array);
+ Json::Value languages_ui = ui.get("languages", "");
+ convert_json_languages_to_obj(languages_ui, ui_languages_so);
+ set_ui_supported_languages(ui_languages_so);
+ }
+
+ if (check_existing_json_member(ui, "displayCapabilities")) {
+ smart_objects::SmartObject display_capabilities_so;
+ Json::Value display_capabilities = ui.get("displayCapabilities", "");
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ display_capabilities, display_capabilities_so);
+
+ if (display_capabilities_so.keyExists(hmi_response::display_type)) {
+ std::map<std::string, hmi_apis::Common_DisplayType::eType>
+ ::const_iterator it = display_type_enum.find(
+ (display_capabilities_so[hmi_response::display_type]).asString());
+ display_capabilities_so.erase(hmi_response::display_type);
+ if (display_type_enum.end() != it) {
+ display_capabilities_so[hmi_response::display_type] = it->second;
+ }
+ }
+
+ if (display_capabilities_so.keyExists(hmi_response::text_fields)) {
+ uint32_t len =
+ display_capabilities_so[hmi_response::text_fields].length();
+
+ for (uint32_t i = 0; i < len; ++i) {
+
+ if ((display_capabilities_so
+ [hmi_response::text_fields][i]).keyExists(strings::name)) {
+ std::map<std::string, hmi_apis::Common_TextFieldName::eType>
+ ::const_iterator it_text_field_name = text_fields_enum_name.find(
+ display_capabilities_so[hmi_response::text_fields]
+ [i][strings::name].asString());
+ display_capabilities_so[hmi_response::text_fields][i].erase(strings::name);
+ if (text_fields_enum_name.end() != it_text_field_name) {
+ display_capabilities_so[hmi_response::text_fields]
+ [i][strings::name] = it_text_field_name->second;
+ }
+ }
+ if ((display_capabilities_so
+ [hmi_response::text_fields][i]).keyExists(strings::character_set)) {
+ std::map<std::string, hmi_apis::Common_CharacterSet::eType>
+ ::const_iterator it_characte_set = character_set_enum.find(
+ display_capabilities_so[hmi_response::text_fields]
+ [i][strings::character_set].asString());
+ display_capabilities_so
+ [hmi_response::text_fields][i].erase(strings::character_set);
+ if (character_set_enum.end() != it_characte_set) {
+ display_capabilities_so
+ [hmi_response::text_fields][i][strings::character_set] =
+ it_characte_set->second;
+ }
+ }
+ }
+ }
+
+ if (display_capabilities_so.keyExists(hmi_response::image_fields)) {
+ smart_objects::SmartObject& array_image_fields =
+ display_capabilities_so[hmi_response::image_fields];
+ for (uint32_t i = 0; i < array_image_fields.length(); ++i) {
+ if (array_image_fields[i].keyExists(strings::name)) {
+ std::map<std::string, hmi_apis::Common_ImageFieldName::eType>
+ ::const_iterator it = image_field_name_enum.find(
+ (array_image_fields[i][strings::name]).asString());
+ array_image_fields[i].erase(strings::name);
+ if (image_field_name_enum.end() != it) {
+ array_image_fields[i][strings::name] = it->second;
+ }
+ }
+ if (array_image_fields[i].keyExists(strings::image_type_supported)) {
+ smart_objects::SmartObject& image_type_supported_array =
+ array_image_fields[i][strings::image_type_supported];
+ smart_objects::SmartObject image_type_supported_enum(
+ smart_objects::SmartType_Array);
+ for (uint32_t k = 0, j = 0; k < image_type_supported_array.length(); ++k) {
+ std::map<std::string, hmi_apis::Common_FileType::eType>
+ ::const_iterator it = file_type_enum.find(
+ (image_type_supported_array[k]).asString());
+ if (file_type_enum.end() != it) {
+ image_type_supported_enum[j++] = it->second;
+ }
+ }
+ array_image_fields[i].erase(strings::image_type_supported);
+ array_image_fields[i][strings::image_type_supported] =
+ image_type_supported_enum;
+ }
+ }
+ }
+ if (display_capabilities_so.keyExists(hmi_response::media_clock_formats)) {
+ smart_objects::SmartObject& media_clock_formats_array =
+ display_capabilities_so[hmi_response::media_clock_formats];
+ smart_objects::SmartObject media_clock_formats_enum(
+ smart_objects::SmartType_Array);
+ for (uint32_t i = 0, j = 0; i < media_clock_formats_array.length(); ++i) {
+ std::map<std::string, hmi_apis::Common_MediaClockFormat::eType>
+ ::const_iterator it = media_clock_enum_name.find(
+ (media_clock_formats_array[i]).asString());
+ if (media_clock_enum_name.end() != it) {
+ media_clock_formats_enum[j++] = it->second;
+ }
+ }
+ display_capabilities_so.erase(hmi_response::media_clock_formats);
+ display_capabilities_so[hmi_response::media_clock_formats] =
+ media_clock_formats_enum;
+ }
+
+ if (display_capabilities_so.keyExists(hmi_response::image_capabilities)) {
+ smart_objects::SmartObject& image_capabilities_array =
+ display_capabilities_so[hmi_response::image_capabilities];
+ smart_objects::SmartObject image_capabilities_enum(
+ smart_objects::SmartType_Array);
+ for (uint32_t i = 0, j = 0; i < image_capabilities_array.length(); ++i) {
+ std::map<std::string, hmi_apis::Common_ImageType::eType>
+ ::const_iterator it = image_type_enum.find(
+ (image_capabilities_array[i]).asString());
+ if (image_type_enum.end() != it) {
+ image_capabilities_enum[j++] = it->second;
+ }
+ }
+ display_capabilities_so.erase(hmi_response::image_capabilities);
+ display_capabilities_so[hmi_response::image_capabilities] =
+ image_capabilities_enum;
+ }
+ set_display_capabilities(display_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "audioPassThruCapabilities")) {
+ Json::Value audio_capabilities = ui.get("audioPassThruCapabilities", "");
+ smart_objects::SmartObject audio_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ int32_t i = 0;
+ audio_capabilities_so[i] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (check_existing_json_member(audio_capabilities, "samplingRate")) {
+ audio_capabilities_so[i]["samplingRate"] =
+ sampling_rate_enum.find(
+ audio_capabilities.get("samplingRate", "").asString())->second;
+ }
+ if (check_existing_json_member(audio_capabilities, "bitsPerSample")) {
+ audio_capabilities_so[i]["bitsPerSample"] =
+ bit_per_sample_enum.find(
+ audio_capabilities.get("bitsPerSample", "").asString())->second;
+ }
+ if (check_existing_json_member(audio_capabilities, "audioType")) {
+ audio_capabilities_so[i]["audioType"] =
+ audio_type_enum.find(
+ audio_capabilities.get("audioType", "").asString())->second;
+ }
+ set_audio_pass_thru_capabilities(audio_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "hmiZoneCapabilities")) {
+ smart_objects::SmartObject hmi_zone_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ int32_t index = 0;
+ hmi_zone_capabilities_so[index] =
+ hmi_zone_enum.find(ui.get("hmiZoneCapabilities", "").asString())->second;
+ set_hmi_zone_capabilities(hmi_zone_capabilities_so);
+ }
+
+ if (check_existing_json_member(ui, "softButtonCapabilities")) {
+ Json::Value soft_button_capabilities = ui.get(
+ "softButtonCapabilities", "");
+ smart_objects::SmartObject soft_button_capabilities_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ soft_button_capabilities, soft_button_capabilities_so);
+ set_soft_button_capabilities(soft_button_capabilities_so);
+ }
+ } //UI end
+
+ // VR
+ if (check_existing_json_member(root_json, "VR")) {
+ Json::Value vr = root_json.get("VR", "");
+ if (check_existing_json_member(vr, "language")) {
+ set_active_vr_language(
+ languages_enum_values.find(vr.get("language", "").asString())->second);
+ }
+
+ if (check_existing_json_member(vr, "languages")) {
+ Json::Value languages_vr = vr.get("languages", "");
+ smart_objects::SmartObject vr_languages_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ convert_json_languages_to_obj(languages_vr, vr_languages_so);
+ set_vr_supported_languages(vr_languages_so);
+ }
+
+ if (check_existing_json_member(vr, "capabilities")) {
+ Json::Value capabilities = vr.get("capabilities", "");
+ smart_objects::SmartObject vr_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (uint32_t i = 0; i < capabilities.size(); ++i) {
+ vr_capabilities_so[i] =
+ vr_enum_capabilities.find(capabilities[i].asString())->second;
+ }
+ set_vr_capabilities(vr_capabilities_so);
+ }
+ }//VR end
+
+ //TTS
+ if (check_existing_json_member(root_json, "TTS")) {
+ Json::Value tts = root_json.get("TTS", "");
+
+ if (check_existing_json_member(tts, "language")) {
+ set_active_tts_language(
+ languages_enum_values.find(tts.get("language", "").asString())->second);
+ }
+
+ if (check_existing_json_member(tts, "languages")) {
+ Json::Value languages_tts = tts.get("languages", "");
+ smart_objects::SmartObject tts_languages_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ convert_json_languages_to_obj(languages_tts, tts_languages_so);
+ set_tts_supported_languages(tts_languages_so);
+ }
+
+ if (check_existing_json_member(tts, "capabilities")) {
+ set_speech_capabilities(
+ smart_objects::SmartObject(tts.get("capabilities", "").asString()));
+ }
+ } //TTS end
+
+ // Buttons
+ if (check_existing_json_member(root_json, "Buttons")) {
+ Json::Value buttons = root_json.get("Buttons", "");
+ if (check_existing_json_member(buttons, "capabilities")) {
+ Json::Value bt_capabilities = buttons.get("capabilities", "");
+ smart_objects::SmartObject buttons_capabilities_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ bt_capabilities, buttons_capabilities_so);
+
+ for (uint32_t i = 0; i < buttons_capabilities_so.length(); ++i) {
+ if ((buttons_capabilities_so[i]).keyExists(strings::name)) {
+ std::map<std::string, hmi_apis::Common_ButtonName::eType>
+ ::const_iterator it = button_enum_name.find(
+ (buttons_capabilities_so[i][strings::name]).asString());
+ buttons_capabilities_so[i].erase(strings::name);
+ if (button_enum_name.end() != it) {
+ buttons_capabilities_so[i][strings::name] = it->second;
+ }
+ }
+ }
+ set_button_capabilities(buttons_capabilities_so);
+ }
+ if (check_existing_json_member(buttons, "presetBankCapabilities")) {
+ Json::Value presetBank = buttons.get("presetBankCapabilities", "");
+ smart_objects::SmartObject preset_bank_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ presetBank, preset_bank_so);
+ set_preset_bank_capabilities(preset_bank_so);
+ }
+ } //Buttons end
+
+ //VehicleType
+ if (check_existing_json_member(root_json, "VehicleInfo")) {
+ Json::Value vehicle_info = root_json.get("VehicleInfo", "");
+ smart_objects::SmartObject vehicle_type_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ vehicle_info, vehicle_type_so);
+ set_vehicle_type(vehicle_type_so);
+ }// VehicleType end
+
+
+ } catch (...) {
+ return false;
+ }
+ return true;
+}
+
+bool HMICapabilities::check_existing_json_member(
+ const Json::Value& json_member, const char* name_of_member) {
+ return json_member.isMember(name_of_member);
+}
+
+void HMICapabilities::convert_json_languages_to_obj(Json::Value& json_languages,
+ smart_objects::SmartObject& languages) {
+ for (uint32_t i = 0, j = 0; i < json_languages.size(); ++i) {
+ std::map<std::string, hmi_apis::Common_Language::eType>::const_iterator it =
+ languages_enum_values.find(json_languages[i].asString());
+ if (languages_enum_values.end() != it) {
+ languages[j++] = it->second;
+ }
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
new file mode 100644
index 0000000000..1416b6c0fa
--- /dev/null
+++ b/src/components/application_manager/src/hmi_command_factory.cc
@@ -0,0 +1,2043 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/hmi_command_factory.h"
+
+#include "application_manager/message.h"
+#include "interfaces/HMI_API.h"
+
+#include "application_manager/commands/hmi/update_device_list_request.h"
+#include "application_manager/commands/hmi/update_device_list_response.h"
+#include "application_manager/commands/hmi/on_update_device_list.h"
+#include "application_manager/commands/hmi/on_start_device_discovery.h"
+#include "application_manager/commands/hmi/update_app_list_request.h"
+#include "application_manager/commands/hmi/update_app_list_response.h"
+#include "application_manager/commands/hmi/on_find_applications.h"
+#include "application_manager/commands/hmi/allow_all_apps_request.h"
+#include "application_manager/commands/hmi/allow_all_apps_response.h"
+#include "application_manager/commands/hmi/allow_app_request.h"
+#include "application_manager/commands/hmi/allow_app_response.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/commands/hmi/on_status_update_notification.h"
+#include "application_manager/commands/hmi/update_sdl_request.h"
+#include "application_manager/commands/hmi/update_sdl_response.h"
+#include "application_manager/commands/hmi/activate_app_request.h"
+#include "application_manager/commands/hmi/activate_app_response.h"
+#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
+#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
+#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
+#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
+#include "application_manager/commands/hmi/on_app_activated_notification.h"
+#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
+#include "application_manager/commands/hmi/on_exit_application_notification.h"
+#include "application_manager/commands/hmi/on_put_file_notification.h"
+#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
+#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/commands/hmi/get_system_info_request.h"
+#include "application_manager/commands/hmi/get_system_info_response.h"
+#include "application_manager/commands/hmi/close_popup_request.h"
+#include "application_manager/commands/hmi/close_popup_response.h"
+#include "application_manager/commands/hmi/button_get_capabilities_request.h"
+#include "application_manager/commands/hmi/button_get_capabilities_response.h"
+#include "application_manager/commands/hmi/ui_add_command_request.h"
+#include "application_manager/commands/hmi/ui_add_command_response.h"
+#include "application_manager/commands/hmi/ui_delete_command_request.h"
+#include "application_manager/commands/hmi/ui_delete_command_response.h"
+#include "application_manager/commands/hmi/ui_add_submenu_request.h"
+#include "application_manager/commands/hmi/ui_add_submenu_response.h"
+#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
+#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
+#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
+#include "application_manager/commands/hmi/ui_get_language_request.h"
+#include "application_manager/commands/hmi/ui_get_language_response.h"
+#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
+#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
+#include "application_manager/commands/hmi/ui_change_registration_request.h"
+#include "application_manager/commands/hmi/ui_change_registration_response.h"
+#include "application_manager/commands/hmi/ui_show_request.h"
+#include "application_manager/commands/hmi/ui_show_response.h"
+#include "application_manager/commands/hmi/ui_alert_request.h"
+#include "application_manager/commands/hmi/ui_alert_response.h"
+#include "application_manager/commands/hmi/ui_is_ready_request.h"
+#include "application_manager/commands/hmi/ui_is_ready_response.h"
+#include "application_manager/commands/hmi/ui_slider_request.h"
+#include "application_manager/commands/hmi/ui_slider_response.h"
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
+#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
+#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
+#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
+#include "application_manager/commands/hmi/ui_set_icon_request.h"
+#include "application_manager/commands/hmi/ui_set_icon_response.h"
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
+#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
+#include "application_manager/commands/hmi/vr_is_ready_request.h"
+#include "application_manager/commands/hmi/vr_is_ready_response.h"
+#include "application_manager/commands/hmi/vr_add_command_request.h"
+#include "application_manager/commands/hmi/vr_add_command_response.h"
+#include "application_manager/commands/hmi/vr_delete_command_request.h"
+#include "application_manager/commands/hmi/vr_delete_command_response.h"
+#include "application_manager/commands/hmi/vr_change_registration_request.h"
+#include "application_manager/commands/hmi/vr_change_registration_response.h"
+#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
+#include "application_manager/commands/hmi/vr_get_language_request.h"
+#include "application_manager/commands/hmi/vr_get_language_response.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
+#include "application_manager/commands/hmi/tts_is_ready_request.h"
+#include "application_manager/commands/hmi/tts_is_ready_response.h"
+#include "application_manager/commands/hmi/tts_change_registration_request.h"
+#include "application_manager/commands/hmi/tts_change_registration_response.h"
+#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
+#include "application_manager/commands/hmi/tts_get_language_request.h"
+#include "application_manager/commands/hmi/tts_get_language_response.h"
+#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
+#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
+#include "application_manager/commands/hmi/tts_speak_request.h"
+#include "application_manager/commands/hmi/tts_speak_response.h"
+#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
+#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
+#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
+#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
+#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
+#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
+#include "application_manager/commands/hmi/vi_is_ready_request.h"
+#include "application_manager/commands/hmi/vi_is_ready_response.h"
+#include "application_manager/commands/hmi/vi_read_did_request.h"
+#include "application_manager/commands/hmi/vi_read_did_response.h"
+#include "application_manager/commands/hmi/sdl_activate_app_request.h"
+#include "application_manager/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
+
+#ifdef HMI_DBUS_API
+#include "application_manager/commands/hmi/vi_get_vehicle_data_request_template.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_data_response_template.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h"
+#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
+#include "application_manager/commands/hmi/on_vi_speed_notification.h"
+#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
+#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
+#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
+#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
+#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
+#include "application_manager/commands/hmi/on_vi_vin_notification.h"
+#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
+#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
+#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
+#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
+#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
+#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
+#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
+#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
+#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
+#else
+#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
+#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#endif // #ifdef HMI_DBUS_API
+
+#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
+#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
+#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
+#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
+#include "application_manager/commands/hmi/navi_is_ready_request.h"
+#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
+#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
+#include "application_manager/commands/hmi/navi_is_ready_response.h"
+#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
+#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
+#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
+#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
+#include "application_manager/commands/hmi/on_ready_notification.h"
+#include "application_manager/commands/hmi/on_device_chosen_notification.h"
+#include "application_manager/commands/hmi/on_file_removed_notification.h"
+#include "application_manager/commands/hmi/on_system_context_notification.h"
+#include "application_manager/commands/hmi/on_app_registered_notification.h"
+#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
+#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
+#include "application_manager/commands/hmi/on_play_tone_notification.h"
+#include "application_manager/commands/hmi/on_tts_started_notification.h"
+#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
+#include "application_manager/commands/hmi/on_vr_started_notification.h"
+#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
+#include "application_manager/commands/hmi/on_vr_command_notification.h"
+#include "application_manager/commands/hmi/on_ui_command_notification.h"
+#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
+#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
+#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
+#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
+#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "application_manager/commands/hmi/on_button_event_notification.h"
+#include "application_manager/commands/hmi/on_button_press_notification.h"
+#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
+#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/commands/hmi/navi_start_stream_request.h"
+#include "application_manager/commands/hmi/navi_start_stream_response.h"
+#include "application_manager/commands/hmi/navi_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_stop_stream_response.h"
+#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
+#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
+#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
+#include "application_manager/commands/hmi/on_system_request_notification.h"
+#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
+#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
+#include "application_manager/commands/hmi/on_sdl_close_notification.h"
+#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "application_manager/commands/hmi/on_record_start_notification.h"
+#include "application_manager/commands/hmi/add_statistics_info_notification.h"
+#include "application_manager/commands/hmi/on_system_error_notification.h"
+#include "application_manager/commands/hmi/basic_communication_system_request.h"
+#include "application_manager/commands/hmi/basic_communication_system_response.h"
+#include "application_manager/commands/hmi/sdl_policy_update.h"
+#include "application_manager/commands/hmi/sdl_policy_update_response.h"
+#include "application_manager/commands/hmi/on_received_policy_update.h"
+#include "application_manager/commands/hmi/on_policy_update.h"
+#include "application_manager/commands/hmi/get_urls.h"
+#include "application_manager/commands/hmi/get_urls_response.h"
+#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
+#include "application_manager/commands/hmi/navi_send_location_request.h"
+#include "application_manager/commands/hmi/navi_send_location_response.h"
+#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+
+CommandSharedPtr HMICommandFactory::CreateCommand(
+ const MessageSharedPtr& message) {
+ const int function_id = (*message)[strings::params][strings::function_id]
+ .asInt();
+ LOG4CXX_INFO(logger_,
+ "HMICommandFactory::CreateCommand function_id: " << function_id);
+
+ CommandSharedPtr command(
+ new application_manager::commands::CommandImpl(message));
+
+ bool is_response = false;
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ is_response = true;
+ LOG4CXX_INFO(logger_, "HMICommandFactory::CreateCommand response");
+ } else if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kErrorResponse)) {
+ is_response = true;
+ LOG4CXX_INFO(logger_, "HMICommandFactory::CreateCommand error response");
+ } else {
+ LOG4CXX_INFO(logger_, "HMICommandFactory::CreateCommand request");
+ }
+
+ switch (function_id) {
+ case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: {
+ command.reset(new commands::OnStartDeviceDiscovery(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: {
+ if (is_response) {
+ command.reset(new commands::UpdateDeviceListResponse(message));
+ } else {
+ command.reset(new commands::UpdateDeviceListRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_ActivateApp: {
+ if (is_response) {
+ command.reset(new commands::ActivateAppResponse(message));
+ } else {
+ command.reset(new commands::ActivateAppRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
+ if (is_response) {
+ command.reset(new commands::GetSystemInfoResponse(message));
+ } else {
+ command.reset(new commands::GetSystemInfoRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_ActivateApp: {
+ if (is_response) {
+ command.reset(new commands::SDLActivateAppResponse(message));
+ } else {
+ command.reset(new commands::SDLActivateAppRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: {
+ if (is_response) {
+ command.reset(new commands::SDLPolicyUpdateResponse(message));
+ } else {
+ command.reset(new commands::SDLPolicyUpdate(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_GetURLS: {
+ if (is_response) {
+ command.reset(new commands::GetUrlsResponse(message));
+ } else {
+ command.reset(new commands::GetUrls(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: {
+ command.reset(new commands::OnAppPermissionChangedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_GetListOfPermissions: {
+ if (is_response) {
+ command.reset(new commands::SDLGetListOfPermissionsResponse(message));
+ } else {
+ command.reset(new commands::SDLGetListOfPermissionsRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: {
+ if (is_response) {
+ command.reset(new commands::SDLGetUserFriendlyMessageResponse(message));
+ } else {
+ command.reset(new commands::SDLGetUserFriendlyMessageRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_GetStatusUpdate: {
+ if (is_response) {
+ command.reset(new commands::SDLGetStatusUpdateResponse(message));
+ } else {
+ command.reset(new commands::SDLGetStatusUpdateRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnStatusUpdate: {
+ command.reset(new commands::OnStatusUpdateNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: {
+ command.reset(new commands::OnAppPermissionConsentNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: {
+ if (is_response) {
+ command.reset(new commands::MixingAudioSupportedResponse(message));
+ } else {
+ command.reset(new commands::MixingAudioSupportedRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: {
+ command.reset(new commands::OnExitAllApplicationsNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_AddCommand: {
+ if (is_response) {
+ command.reset(new commands::UIAddCommandResponse(message));
+ } else {
+ command.reset(new commands::UIAddCommandRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_DeleteCommand: {
+ if (is_response) {
+ command.reset(new commands::UIDeleteCommandResponse(message));
+ } else {
+ command.reset(new commands::UIDeleteCommandRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_AddSubMenu: {
+ if (is_response) {
+ command.reset(new commands::UIAddSubmenuResponse(message));
+ } else {
+ command.reset(new commands::UIAddSubmenuRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ if (is_response) {
+ command.reset(new commands::UIDeleteSubmenuResponse(message));
+ } else {
+ command.reset(new commands::UIDeleteSubmenuRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ if (is_response) {
+ command.reset(new commands::UISetMediaClockTimerResponse(message));
+ } else {
+ command.reset(new commands::UISetMediaClockTimerRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_PerformInteraction: {
+ if (is_response) {
+ command.reset(new commands::UIPerformInteractionResponse(message));
+ } else {
+ command.reset(new commands::UIPerformInteractionRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetGlobalProperties: {
+ if (is_response) {
+ command.reset(new commands::UISetGlobalPropertiesResponse(message));
+ } else {
+ command.reset(new commands::UISetGlobalPropertiesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_ScrollableMessage: {
+ if (is_response) {
+ command.reset(new commands::UIScrollableMessageResponse(message));
+ } else {
+ command.reset(new commands::UIScrollableMessageRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetAppIcon: {
+ if (is_response) {
+ command.reset(new commands::UISetIconResponse(message));
+ } else {
+ command.reset(new commands::UISetIconRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_GetSupportedLanguages: {
+ if (is_response) {
+ command.reset(new commands::UIGetSupportedLanguagesResponse(message));
+ } else {
+ command.reset(new commands::UIGetSupportedLanguagesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_GetLanguage: {
+ if (is_response) {
+ command.reset(new commands::UIGetLanguageResponse(message));
+ } else {
+ command.reset(new commands::UIGetLanguageRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::UIGetCapabilitiesResponse(message));
+ } else {
+ command.reset(new commands::UIGetCapabilitiesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_ChangeRegistration: {
+ if (is_response) {
+ command.reset(new commands::UIChangeRegistratioResponse(message));
+ } else {
+ command.reset(new commands::UIChangeRegistrationRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
+ if (is_response) {
+ command.reset(new commands::UIPerformAudioPassThruResponse(message));
+ } else {
+ command.reset(new commands::UIPerformAudioPassThruRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ if (is_response) {
+ command.reset(new commands::UIEndAudioPassThruResponse(message));
+ } else {
+ command.reset(new commands::UIEndAudioPassThruRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_Alert: {
+ if (is_response) {
+ command.reset(new commands::UIAlertResponse(message));
+ } else {
+ command.reset(new commands::UIAlertRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_IsReady: {
+ if (is_response) {
+ command.reset(new commands::VRIsReadyResponse(message));
+ } else {
+ command.reset(new commands::VRIsReadyRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_AddCommand: {
+ if (is_response) {
+ command.reset(new commands::VRAddCommandResponse(message));
+ } else {
+ command.reset(new commands::VRAddCommandRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_DeleteCommand: {
+ if (is_response) {
+ command.reset(new commands::VRDeleteCommandResponse(message));
+ } else {
+ command.reset(new commands::VRDeleteCommandRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_ChangeRegistration: {
+ if (is_response) {
+ command.reset(new commands::VRChangeRegistrationResponse(message));
+ } else {
+ command.reset(new commands::VRChangeRegistrationRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_GetSupportedLanguages: {
+ if (is_response) {
+ command.reset(new commands::VRGetSupportedLanguagesResponse(message));
+ } else {
+ command.reset(new commands::VRGetSupportedLanguagesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_GetLanguage: {
+ if (is_response) {
+ command.reset(new commands::VRGetLanguageResponse(message));
+ } else {
+ command.reset(new commands::VRGetLanguageRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::VRGetCapabilitiesResponse(message));
+ } else {
+ command.reset(new commands::VRGetCapabilitiesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_IsReady: {
+ if (is_response) {
+ command.reset(new commands::TTSIsReadyResponse(message));
+ } else {
+ command.reset(new commands::TTSIsReadyRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_ChangeRegistration: {
+ if (is_response) {
+ command.reset(new commands::TTSChangeRegistratioResponse(message));
+ } else {
+ command.reset(new commands::TTSChangeRegistrationRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_GetSupportedLanguages: {
+ if (is_response) {
+ command.reset(new commands::TTSGetSupportedLanguagesResponse(message));
+ } else {
+ command.reset(new commands::TTSGetSupportedLanguagesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_StopSpeaking: {
+ if (is_response) {
+ command.reset(new commands::TTSStopSpeakingResponse(message));
+ } else {
+ command.reset(new commands::TTSStopSpeakingRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_GetLanguage: {
+ if (is_response) {
+ command.reset(new commands::TTSGetLanguageResponse(message));
+ } else {
+ command.reset(new commands::TTSGetLanguageRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Speak: {
+ if (is_response) {
+ command.reset(new commands::TTSSpeakResponse(message));
+ } else {
+ command.reset(new commands::TTSSpeakRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
+ if (is_response) {
+ command.reset(new commands::TTSSetGlobalPropertiesResponse(message));
+ } else {
+ command.reset(new commands::TTSSetGlobalPropertiesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::TTSGetCapabilitiesResponse(message));
+ } else {
+ command.reset(new commands::TTSGetCapabilitiesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Started: {
+ command.reset(new commands::OnTTSStartedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_Stopped: {
+ command.reset(new commands::OnTTSStoppedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: {
+ command.reset(new commands::OnAppActivatedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: {
+ command.reset(new commands::OnExitApplicationNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_Show: {
+ if (is_response) {
+ command.reset(new commands::UIShowResponse(message));
+ } else {
+ command.reset(new commands::UIShowRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_Slider: {
+ if (is_response) {
+ command.reset(new commands::UISliderResponse(message));
+ } else {
+ command.reset(new commands::UISliderRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_ClosePopUp: {
+ if (is_response) {
+ command.reset(new commands::ClosePopupResponse(message));
+ } else {
+ command.reset(new commands::ClosePopupRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_IsReady: {
+ if (is_response) {
+ command.reset(new commands::UIIsReadyResponse(message));
+ } else {
+ command.reset(new commands::UIIsReadyRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_IsReady: {
+ if (is_response) {
+ command.reset(new commands::VIIsReadyResponse(message));
+ } else {
+ command.reset(new commands::VIIsReadyRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
+ if (is_response) {
+ command.reset(new commands::VIReadDIDResponse(message));
+ } else {
+ command.reset(new commands::VIReadDIDRequest(message));
+ }
+ break;
+ }
+#ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::VehicleInfo_GetGpsData: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetGpsData > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetGpsData > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetSpeed: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetSpeed > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetSpeed > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetRpm: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetRpm > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetRpm > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevel > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevel > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption > (
+ message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature > (
+ message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetPrndl: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetPrndl > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetPrndl > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetVin: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetVin > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetVin > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetTirePressure > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetTirePressure > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetOdometer > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetOdometer > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetBeltStatus > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetBeltStatus > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetBodyInformation > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetBodyInformation > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetDriverBraking > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetDriverBraking > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetWiperStatus > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetWiperStatus > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetEngineTorque > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetEngineTorque > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition > (
+ message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle > (
+ message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetECallInfo > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetECallInfo > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetMyKey: {
+ if (is_response)
+ command.reset(
+ new commands::VIGetVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetMyKey > (message));
+ else
+ command.reset(
+ new commands::VIGetVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_GetMyKey > (message));
+ break;
+ }
+#else
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
+ if (is_response) {
+ command.reset(new commands::VIGetVehicleDataResponse(message));
+ } else {
+ command.reset(new commands::VIGetVehicleDataRequest(message));
+ }
+ break;
+ }
+#endif // #ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
+ if (is_response) {
+ command.reset(new commands::VIGetDTCsResponse(message));
+ } else {
+ command.reset(new commands::VIGetDTCsRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
+ if (is_response) {
+ command.reset(new commands::VIDiagnosticMessageResponse(message));
+ } else {
+ command.reset(new commands::VIDiagnosticMessageRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleType: {
+ if (is_response) {
+ command.reset(new commands::VIGetVehicleTypeResponse(message));
+ } else {
+ command.reset(new commands::VIGetVehicleTypeRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_IsReady: {
+ if (is_response) {
+ command.reset(new commands::NaviIsReadyResponse(message));
+ } else {
+ command.reset(new commands::NaviIsReadyRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_AlertManeuver: {
+ if (is_response) {
+ command.reset(new commands::NaviAlertManeuverResponse(message));
+ } else {
+ command.reset(new commands::NaviAlertManeuverRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
+ if (is_response) {
+ command.reset(new commands::NaviUpdateTurnListResponse(message));
+ } else {
+ command.reset(new commands::NaviUpdateTurnListRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
+ if (is_response) {
+ command.reset(new commands::NaviShowConstantTBTResponse(message));
+ } else {
+ command.reset(new commands::NaviShowConstantTBTRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Buttons_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::ButtonGetCapabilitiesResponse(message));
+ } else {
+ command.reset(new commands::ButtonGetCapabilitiesRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: {
+ command.reset(new commands::OnAllowSDLFunctionalityNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: {
+ command.reset(new commands::OnSDLConsentNeededNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_UpdateSDL: {
+ if (is_response) {
+ command.reset(new commands::UpdateSDLResponse(message));
+ } else {
+ command.reset(new commands::UpdateSDLRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: {
+ command.reset(new commands::OnIgnitionCycleOverNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: {
+ command.reset(new commands::OnSystemInfoChangedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_PlayTone: {
+ command.reset(new commands::OnPlayToneNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnReady: {
+ command.reset(new commands::OnReadyNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: {
+ command.reset(new commands::OnDeviceChosenNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnSystemContext: {
+ command.reset(new commands::OnSystemContextNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnDriverDistraction: {
+ command.reset(
+ new commands::hmi::OnDriverDistractionNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: {
+ command.reset(new commands::OnUpdateDeviceList(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: {
+ command.reset(new commands::OnAppRegisteredNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: {
+ command.reset(new commands::OnAppUnregisteredNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: {
+ command.reset(new commands::OnFindApplications(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: {
+ if (is_response) {
+ command.reset(new commands::UpdateAppListResponse(message));
+ } else {
+ command.reset(new commands::UpdateAppListRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_Started: {
+ command.reset(new commands::OnVRStartedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VR_Stopped: {
+ command.reset(new commands::OnVRStoppedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VR_OnCommand: {
+ command.reset(new commands::OnVRCommandNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnCommand: {
+ command.reset(new commands::OnUICommandNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: {
+ command.reset(new commands::OnAppDeactivatedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnLanguageChange: {
+ command.reset(new commands::OnUILanguageChangeNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VR_OnLanguageChange: {
+ command.reset(new commands::OnVRLanguageChangeNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnLanguageChange: {
+ command.reset(new commands::OnTTSLanguageChangeNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonEvent: {
+ command.reset(new commands::hmi::OnButtonEventNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::Buttons_OnButtonPress: {
+ command.reset(new commands::hmi::OnButtonPressNotification(message));
+ break;
+ }
+#ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeGps > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeGps > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeRpm > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeRpm > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribePrndl > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribePrndl > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVin > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVin > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: {
+ if (is_response)
+ command.reset(
+ new commands::VISubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey > (message));
+ else
+ command.reset(
+ new commands::VISubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey > (message));
+ break;
+ }
+#else
+ case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: {
+ if (is_response) {
+ command.reset(new commands::VISubscribeVehicleDataResponse(message));
+ } else {
+ command.reset(new commands::VISubscribeVehicleDataRequest(message));
+ }
+ break;
+ }
+#endif // #ifdef HMI_DBUS_API
+#ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps > (message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed > (message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm > (message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl > (message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin > (message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin > (message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus > (
+ message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus > (
+ message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: {
+ if (is_response)
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataResponseTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey > (message));
+ else
+ command.reset(
+ new commands::VIUnsubscribeVehicleDataRequestTemplate <
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey > (message));
+ break;
+ }
+#else
+ case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData: {
+ if (is_response) {
+ command.reset(new commands::VIUnsubscribeVehicleDataResponse(message));
+ } else {
+ command.reset(new commands::VIUnsubscribeVehicleDataRequest(message));
+ }
+ break;
+ }
+#endif // #ifdef HMI_DBUS_API
+#ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::VehicleInfo_OnGpsData: {
+ command.reset(new commands::OnVIGpsDataNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnSpeed: {
+ command.reset(new commands::OnVISpeedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnRpm: {
+ command.reset(new commands::OnVIRpmNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: {
+ command.reset(new commands::OnVIFuelLevelNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: {
+ command.reset(new commands::OnVIFuelLevelStateNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: {
+ command.reset(
+ new commands::OnVIInstantFuelConsumptionNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: {
+ command.reset(new commands::OnVIExternalTemperatureNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnVin: {
+ command.reset(new commands::OnVIVinNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnPrndl: {
+ command.reset(new commands::OnVIPrndlNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: {
+ command.reset(new commands::OnVITirePressureNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnOdometer: {
+ command.reset(new commands::OnVIOdometerNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: {
+ command.reset(new commands::OnVIBeltStatusNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: {
+ command.reset(new commands::OnVIBodyInformationNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: {
+ command.reset(new commands::OnVIDeviceStatusNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: {
+ command.reset(new commands::OnVIDriverBrakingNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: {
+ command.reset(new commands::OnVIWiperStatusNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: {
+ command.reset(new commands::OnVIHeadLampStatusNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: {
+ command.reset(new commands::OnVIEngineTorqueNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: {
+ command.reset(new commands::OnVIAccPedalPositionNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: {
+ command.reset(new commands::OnVISteeringWheelAngleNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::VehicleInfo_OnMyKey: {
+ command.reset(new commands::OnVIMyKeyNotification(message));
+ break;
+ }
+#else
+ case hmi_apis::FunctionID::VehicleInfo_OnVehicleData: {
+ command.reset(new commands::OnVIVehicleDataNotification(message));
+ break;
+ }
+#endif // #ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::Navigation_OnTBTClientState: {
+ command.reset(new commands::OnNaviTBTClientStateNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnKeyboardInput: {
+ command.reset(new commands::hmi::OnUIKeyBoardInputNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnTouchEvent: {
+ command.reset(new commands::hmi::OnUITouchEventNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ command.reset(new commands::hmi::OnUIResetTimeoutNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_StartStream: {
+ if (is_response) {
+ command.reset(new commands::NaviStartStreamResponse(message));
+ } else {
+ command.reset(new commands::NaviStartStreamRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_StopStream: {
+ if (is_response) {
+ command.reset(new commands::NaviStopStreamResponse(message));
+ } else {
+ command.reset(new commands::NaviStopStreamRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_StartAudioStream: {
+ if (is_response) {
+ command.reset(new commands::AudioStartStreamResponse(message));
+ } else {
+ command.reset(new commands::AudioStartStreamRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_StopAudioStream: {
+ if (is_response) {
+ command.reset(new commands::AudioStopStreamResponse(message));
+ } else {
+ command.reset(new commands::AudioStopStreamRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::VR_PerformInteraction: {
+ if (is_response) {
+ command.reset(new commands::VRPerformInteractionResponse(message));
+ } else {
+ command.reset(new commands::VRPerformInteractionRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: {
+ command.reset(new commands::OnSystemRequestNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnPutFile: {
+ command.reset(new commands::OnPutFileNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: {
+ command.reset(new commands::OnResumeAudioSourceNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SetDisplayLayout: {
+ if (is_response) {
+ command.reset(new commands::UiSetDisplayLayoutResponse(message));
+ } else {
+ command.reset(new commands::UiSetDisplayLayoutRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: {
+ command.reset(new commands::OnSDLCloseNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: {
+ command.reset(new commands::OnSDLPersistenceCompleteNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: {
+ command.reset(new commands::OnFileRemovedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::UI_OnRecordStart: {
+ command.reset(new commands::OnRecordStartdNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ if (is_response) {
+ command.reset(new commands::BasicCommunicationSystemResponse(message));
+ } else {
+ command.reset(new commands::BasicCommunicationSystemRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::Navigation_SendLocation: {
+ if (is_response) {
+ command.reset(new commands::NaviSendLocationResponse(message));
+ } else {
+ command.reset(new commands::NaviSendLocationRequest(message));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_AddStatisticsInfo: {
+ command.reset(new commands::AddStatisticsInfoNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnSystemError: {
+ command.reset(new commands::OnSystemErrorNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: {
+ command.reset(new commands::OnReceivedPolicyUpdate(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnPolicyUpdate: {
+ command.reset(new commands::OnPolicyUpdate(message));
+ break;
+ }
+ case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: {
+ command.reset(new commands::OnDeviceStateChangedNotification(message));
+ break;
+ }
+ case hmi_apis::FunctionID::TTS_OnResetTimeout: {
+ command.reset(new commands::hmi::OnTTSResetTimeoutNotification(message));
+ break;
+ }
+ }
+
+ return command;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
new file mode 100644
index 0000000000..832016e874
--- /dev/null
+++ b/src/components/application_manager/src/message.cc
@@ -0,0 +1,209 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/message.h"
+
+namespace {
+bool BinaryDataPredicate(uint8_t i, uint8_t j) {
+ return (i == j);
+}
+}
+
+namespace application_manager {
+
+MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type) {
+ switch (rpc_type) {
+ case protocol_handler::kRpcTypeRequest:
+ return kRequest;
+ case protocol_handler::kRpcTypeResponse:
+ return kResponse;
+ case protocol_handler::kRpcTypeNotification:
+ return kNotification;
+ case protocol_handler::kRpcTypeReserved:
+ default:
+ DCHECK(false);
+ return kUnknownType;
+ }
+}
+
+Message::Message(protocol_handler::MessagePriority priority)
+ : function_id_(0),
+ correlation_id_(0),
+ type_(kUnknownType),
+ priority_(priority),
+ connection_key_(0),
+ binary_data_(NULL),
+ data_size_(0),
+ payload_size_(0),
+ version_(kUnknownProtocol) {
+}
+
+Message::Message(const Message& message)
+ : priority_(message.priority_) {
+ *this = message;
+}
+
+Message& Message::operator=(const Message& message) {
+ set_function_id(message.function_id_);
+ set_correlation_id(message.correlation_id_);
+ set_connection_key(message.connection_key_);
+ set_message_type(message.type_);
+ set_data_size(message.data_size_);
+ set_payload_size(message.payload_size_);
+ if (message.binary_data_) {
+ set_binary_data(message.binary_data_);
+ }
+ set_json_message(message.json_message_);
+ set_protocol_version(message.protocol_version());
+ priority_ = message.priority_;
+
+ return *this;
+}
+
+bool Message::operator==(const Message& message) {
+ bool function_id = function_id_ == message.function_id_;
+ bool correlation_id = correlation_id_ == message.correlation_id_;
+ bool connection_key = connection_key_ == message.connection_key_;
+ bool type = type_ == message.type_;
+ bool json_message = json_message_ == message.json_message_;
+ bool version = version_ == message.version_;
+ bool data_size = data_size_ == message.data_size_;
+ bool payload_size = payload_size_ == message.payload_size_;
+
+
+ bool binary_data = std::equal(binary_data_->begin(), binary_data_->end(),
+ message.binary_data_->begin(),
+ BinaryDataPredicate);
+
+ return function_id && correlation_id && connection_key && type && binary_data
+ && json_message && version && data_size && payload_size;
+}
+
+Message::~Message() {
+ if (binary_data_) {
+ delete binary_data_;
+ }
+}
+
+int32_t Message::function_id() const {
+ return function_id_;
+}
+
+int32_t Message::correlation_id() const {
+ return correlation_id_;
+}
+
+int32_t Message::connection_key() const {
+ return connection_key_;
+}
+
+MessageType Message::type() const {
+ return type_;
+}
+
+ProtocolVersion Message::protocol_version() const {
+ return version_;
+}
+
+const std::string& Message::json_message() const {
+ return json_message_;
+}
+
+const BinaryData* Message::binary_data() const {
+ return binary_data_;
+}
+
+bool Message::has_binary_data() const {
+ return (binary_data_ != NULL);
+}
+
+size_t Message::data_size() const {
+ return data_size_;
+}
+
+size_t Message::payload_size() const {
+ return payload_size_;
+}
+
+void Message::set_function_id(int32_t id) {
+ function_id_ = id;
+}
+
+void Message::set_correlation_id(int32_t id) {
+ correlation_id_ = id;
+}
+
+void Message::set_connection_key(int32_t key) {
+ connection_key_ = key;
+}
+
+void Message::set_message_type(MessageType type) {
+ type_ = type;
+}
+
+void Message::set_binary_data(BinaryData* data) {
+ if (NULL == data) {
+ NOTREACHED();
+ return;
+ }
+
+ if (binary_data_) {
+ delete binary_data_;
+ }
+
+ binary_data_ = data;
+}
+
+void Message::set_json_message(const std::string& json_message) {
+ json_message_ = json_message;
+}
+
+void Message::set_protocol_version(ProtocolVersion version) {
+ version_ = version;
+}
+
+const smart_objects::SmartObject &Message::smart_object() const {
+ return smart_object_;
+}
+
+void Message::set_smart_object(const smart_objects::SmartObject& object) {
+ smart_object_ = object;
+}
+
+void Message::set_data_size(size_t data_size) {
+ data_size_ = data_size;
+}
+
+void Message::set_payload_size(size_t payload_size) {
+ payload_size_ = payload_size;
+}
+} // namespace application_manager
diff --git a/src/components/application_manager/src/message_helper.cc b/src/components/application_manager/src/message_helper.cc
new file mode 100644
index 0000000000..b97b01c0d6
--- /dev/null
+++ b/src/components/application_manager/src/message_helper.cc
@@ -0,0 +1,2357 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+#undef __STDC_FORMAT_MACROS
+
+#include <set>
+#include <string>
+#include <algorithm>
+#include <utility>
+#include <map>
+
+#include "application_manager/application.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/policies/policy_handler.h"
+#include "config_profile/profile.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/enum_schema_item.h"
+#include "utils/file_system.h"
+#include "utils/macro.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+
+namespace {
+
+hmi_apis::Common_Language::eType ToCommonLanguage(
+ mobile_apis::Language::eType mobile_language) {
+ // Update this check if mobile_api::Language
+ // or hmi_apis::Common_Language changes.
+ // Or, better, generate functions like this from XML
+ long lang_val = long(mobile_language);
+ long max_common_lang_val = long(hmi_apis::Common_Language::NO_NO);
+ long max_mobile_lang = long(mobile_apis::Language::NO_NO);
+ if (max_common_lang_val != max_mobile_lang) {
+ LOG4CXX_ERROR(logger_, "Mapping between Common_Language and Language"
+ " has changed! Please update converter function");
+ }
+ if (lang_val > max_common_lang_val) {
+ LOG4CXX_ERROR(logger_, "Non-convertable language ID");
+ }
+ return hmi_apis::Common_Language::eType(lang_val);
+}
+
+typedef
+std::map<std::string, hmi_apis::Common_AppPriority::eType> CommonAppPriorityMap;
+
+CommonAppPriorityMap app_priority_values = {
+ {"NORMAL", hmi_apis::Common_AppPriority::NORMAL},
+ {"COMMUNICATION", hmi_apis::Common_AppPriority::COMMUNICATION},
+ {"EMERGENCY", hmi_apis::Common_AppPriority::EMERGENCY},
+ {"NAVIGATION", hmi_apis::Common_AppPriority::NAVIGATION},
+ {"NONE", hmi_apis::Common_AppPriority::NONE},
+ {"VOICECOM", hmi_apis::Common_AppPriority::VOICE_COMMUNICATION},
+ {"INVALID_ENUM", hmi_apis::Common_AppPriority::INVALID_ENUM}
+};
+
+const uint32_t GetPriorityCode(const std::string& priority) {
+ CommonAppPriorityMap::const_iterator it = app_priority_values.find(priority);
+ if (app_priority_values.end() != it) {
+ return static_cast<uint32_t>((*it).second);
+ }
+ return static_cast<uint32_t>(hmi_apis::Common_AppPriority::INVALID_ENUM);
+}
+
+bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) {
+ using namespace smart_objects;
+ for (size_t i = 0; i < soft_buttons.length(); ++i) {
+ SmartObject& button = soft_buttons[i];
+
+ // Check if image parameter is valid
+ if (button.keyExists(strings::image)) {
+ SmartObject& buttonImage = button[strings::image];
+
+ // Image name must not be empty and must not contain incorrect
+ //character
+ if (false == MessageHelper::VerifySoftButtonString(
+ buttonImage[strings::value].asString())) {
+ return false;
+ }
+ }
+ }
+ return true;
+} // namespace
+
+}
+std::pair<std::string, VehicleDataType> kVehicleDataInitializer[] = {
+ std::make_pair(strings::gps, VehicleDataType::GPS), std::make_pair(
+ strings::speed, VehicleDataType::SPEED), std::make_pair(
+ strings::rpm, VehicleDataType::RPM), std::make_pair(
+ strings::fuel_level, VehicleDataType::FUELLEVEL), std::make_pair(
+ strings::fuel_level_state, VehicleDataType::FUELLEVEL_STATE),
+ std::make_pair(strings::instant_fuel_consumption,
+ VehicleDataType::FUELCONSUMPTION), std::make_pair(
+ strings::external_temp, VehicleDataType::EXTERNTEMP), std::make_pair(
+ strings::vin, VehicleDataType::VIN), std::make_pair(
+ strings::prndl, VehicleDataType::PRNDL), std::make_pair(
+ strings::tire_pressure, VehicleDataType::TIREPRESSURE), std::make_pair(
+ strings::odometer, VehicleDataType::ODOMETER), std::make_pair(
+ strings::belt_status, VehicleDataType::BELTSTATUS), std::make_pair(
+ strings::body_information, VehicleDataType::BODYINFO), std::make_pair(
+ strings::device_status, VehicleDataType::DEVICESTATUS), std::make_pair(
+ strings::driver_braking, VehicleDataType::BRAKING), std::make_pair(
+ strings::wiper_status, VehicleDataType::WIPERSTATUS), std::make_pair(
+ strings::head_lamp_status, VehicleDataType::HEADLAMPSTATUS),
+ std::make_pair(strings::e_call_info, VehicleDataType::ECALLINFO),
+ std::make_pair(strings::airbag_status, VehicleDataType::AIRBAGSTATUS),
+ std::make_pair(strings::emergency_event, VehicleDataType::EMERGENCYEVENT),
+ std::make_pair(strings::cluster_mode_status,
+ VehicleDataType::CLUSTERMODESTATUS), std::make_pair(
+ strings::my_key, VehicleDataType::MYKEY),
+ /*
+ NOT DEFINED in mobile API
+ std::make_pair(strings::gps, VehicleDataType::BATTVOLTAGE),
+ */
+ std::make_pair(strings::engine_torque, VehicleDataType::ENGINETORQUE),
+ std::make_pair(strings::acc_pedal_pos, VehicleDataType::ACCPEDAL),
+ std::make_pair(strings::steering_wheel_angle,
+ VehicleDataType::STEERINGWHEEL),
+};
+
+const VehicleData MessageHelper::vehicle_data_(
+ kVehicleDataInitializer, kVehicleDataInitializer +
+ ARRAYSIZE(kVehicleDataInitializer));
+
+#ifdef HMI_DBUS_API
+namespace {
+struct VehicleInfo_Requests {
+ hmi_apis::FunctionID::eType func_id;
+ const char* str;
+};
+static VehicleInfo_Requests ivi_subrequests[] = {
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State, strings::fuel_level_state},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption, strings::instant_fuel_consumption},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature, strings::external_temp},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure, strings::tire_pressure},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus, strings::belt_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation, strings::body_information},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus, strings::device_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking, strings::driver_braking},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus, strings::wiper_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus, strings::head_lamp_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque, strings::engine_torque},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition, strings::acc_pedal_pos},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle, strings::steering_wheel_angle},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo, strings::e_call_info},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus, strings::airbag_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent, strings::emergency_event},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus, strings::cluster_mode_status},
+ { hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key},
+};
+}
+#endif // #ifdef HMI_DBUS_API
+
+std::string MessageHelper::CommonLanguageToString(
+ hmi_apis::Common_Language::eType language) {
+ switch (language) {
+ case hmi_apis::Common_Language::EN_US:
+ return "en-us";
+ case hmi_apis::Common_Language::ES_MX:
+ return "es-mx";
+ case hmi_apis::Common_Language::FR_CA:
+ return "fr-ca";
+ case hmi_apis::Common_Language::DE_DE:
+ return "de-de";
+ case hmi_apis::Common_Language::ES_ES:
+ return "es-es";
+ case hmi_apis::Common_Language::EN_GB:
+ return "en-gb";
+ case hmi_apis::Common_Language::RU_RU:
+ return "ru-ru";
+ case hmi_apis::Common_Language::TR_TR:
+ return "tr-tr";
+ case hmi_apis::Common_Language::PL_PL:
+ return "pl-pl";
+ case hmi_apis::Common_Language::FR_FR:
+ return "fr-fr";
+ case hmi_apis::Common_Language::IT_IT:
+ return "it-it";
+ case hmi_apis::Common_Language::SV_SE:
+ return "sv-se";
+ case hmi_apis::Common_Language::PT_PT:
+ return "pt-pt";
+ case hmi_apis::Common_Language::NL_NL:
+ return "nl-nl";
+ case hmi_apis::Common_Language::EN_AU:
+ return "en-au";
+ case hmi_apis::Common_Language::ZH_CN:
+ return "zh-cn";
+ case hmi_apis::Common_Language::ZH_TW:
+ return "zh-tw";
+ case hmi_apis::Common_Language::JA_JP:
+ return "ja-jp";
+ case hmi_apis::Common_Language::AR_SA:
+ return "as-sa";
+ case hmi_apis::Common_Language::KO_KR:
+ return "ko-kr";
+ case hmi_apis::Common_Language::PT_BR:
+ return "pt-br";
+ case hmi_apis::Common_Language::CS_CZ:
+ return "cs-cz";
+ case hmi_apis::Common_Language::DA_DK:
+ return "da-dk";
+ case hmi_apis::Common_Language::NO_NO:
+ return "no-no";
+ default:
+ return "";
+ }
+}
+
+uint32_t MessageHelper::GetAppCommandLimit(const std::string& policy_app_id) {
+
+ std::string priority;
+ policy::PolicyHandler::instance()->GetPriority(policy_app_id, &priority);
+ return policy::PolicyHandler::instance()->GetNotificationsNumber(priority);
+}
+
+void MessageHelper::SendHMIStatusNotification(
+ const Application& application_impl) {
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject;
+ if (!notification) {
+ // TODO(VS): please add logger.
+ return;
+ }
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_api::FunctionID::OnHMIStatusID);
+
+ message[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ message[strings::params][strings::connection_key] =
+ static_cast<int32_t>(application_impl.app_id());
+
+ message[strings::msg_params][strings::hmi_level] =
+ static_cast<int32_t>(application_impl.hmi_level());
+
+ message[strings::msg_params][strings::audio_streaming_state] =
+ static_cast<int32_t>(application_impl.audio_streaming_state());
+
+ message[strings::msg_params][strings::system_context] =
+ static_cast<int32_t>(application_impl.system_context());
+
+ ApplicationManagerImpl::instance()->ManageMobileCommand(notification);
+}
+
+void MessageHelper::SendOnAppRegisteredNotificationToHMI(
+ const Application& application_impl, bool resumption) {
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject;
+ if (!notification) {
+ // TODO(VS): please add logger.
+ return;
+ }
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ static_cast<int32_t>(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+
+ message[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ message[strings::msg_params][strings::application][strings::app_name] =
+ application_impl.name();
+
+ const smart_objects::SmartObject* ngn_media_screen_name = application_impl
+ .ngn_media_screen_name();
+
+ if (resumption) {
+ message[strings::msg_params][strings::resume_vr_grammars] = true;
+ }
+
+ if (ngn_media_screen_name) {
+ message[strings::msg_params][strings::application][strings::ngn_media_screen_app_name] =
+ *ngn_media_screen_name;
+ }
+
+ message[strings::msg_params][strings::application][strings::icon] =
+ application_impl.app_icon_path();
+
+ std::string dev_name = ApplicationManagerImpl::instance()->GetDeviceName(
+ application_impl.device());
+ message[strings::msg_params][strings::application][strings::device_name] =
+ dev_name;
+
+ message[strings::msg_params][strings::application][strings::app_id] =
+ application_impl.app_id();
+
+ message[strings::msg_params][strings::application][strings::hmi_display_language_desired] =
+ static_cast<int32_t>(application_impl.ui_language());
+
+ message[strings::msg_params][strings::application][strings::is_media_application] =
+ application_impl.is_media_application();
+
+ const smart_objects::SmartObject* app_type = application_impl.app_types();
+
+ if (app_type) {
+ message[strings::msg_params][strings::application][strings::app_type] =
+ *app_type;
+ }
+ if (application_impl.vr_synonyms()) {
+ message[strings::msg_params][strings::vr_synonyms] = *(application_impl
+ .vr_synonyms());
+ }
+ if (application_impl.tts_name()) {
+ message[strings::msg_params][strings::tts_name] = *(application_impl
+ .tts_name());
+ }
+ std::string priority;
+
+ policy::PolicyHandler::instance()->GetPriority(
+ application_impl.mobile_app_id()->asString(), &priority);
+ if (!priority.empty()) {
+ message[strings::msg_params][strings::priority] = GetPriorityCode(priority);
+ }
+
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(notification));
+}
+
+smart_objects::SmartObject* MessageHelper::GetHashUpdateNotification(
+ const uint32_t app_id) {
+
+ LOG4CXX_INFO(logger_, "GetHashUpdateNotification" << app_id);
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ app_id);
+
+ smart_objects::SmartObject* message = NULL;
+ if (NULL == app.get()) {
+ return message;
+ }
+
+ message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnHashChangeID;
+ (*message)[strings::params][strings::connection_key] = app_id;
+ (*message)[strings::params][strings::message_type] =
+ static_cast<int32_t>(kNotification);;
+
+ return message;
+}
+
+void MessageHelper::SendHashUpdateNotification(const uint32_t app_id) {
+ LOG4CXX_INFO(logger_, "SendHashUpdateNotification");
+
+ smart_objects::SmartObject* so = GetHashUpdateNotification(app_id);
+ if (so) {
+ PrintSmartObject(*so);
+ if (!ApplicationManagerImpl::instance()->ManageMobileCommand(so)) {
+ LOG4CXX_ERROR_EXT(logger_, "Failed to send HashUpdate notification.");
+ }
+ }
+}
+
+void MessageHelper::SendOnAppInterfaceUnregisteredNotificationToMobile(
+ int32_t connection_key,
+ mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject;
+ if (!notification) {
+ // TODO(VS): please add logger.
+ return;
+ }
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_api::FunctionID::OnAppInterfaceUnregisteredID);
+
+ message[strings::params][strings::message_type] =
+ static_cast<int32_t>(kNotification);
+
+ message[strings::params][strings::connection_key] = connection_key;
+
+ message[strings::msg_params][strings::reason] = static_cast<int32_t>(reason);
+
+ DCHECK(ApplicationManagerImpl::instance()->ManageMobileCommand(notification));
+}
+
+const VehicleData& MessageHelper::vehicle_data() {
+ return vehicle_data_;
+}
+
+mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
+ const std::string& hmi_level) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ mobile_apis::HMILevel::eType value;
+ if (EnumConversionHelper<mobile_apis::HMILevel::eType>::StringToEnum(
+ hmi_level, &value)) {
+ return value;
+ }
+ return mobile_apis::HMILevel::INVALID_ENUM;
+}
+
+std::string MessageHelper::StringifiedHMILevel(
+ mobile_apis::HMILevel::eType hmi_level) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ const char* str = 0;
+ if (EnumConversionHelper<mobile_apis::HMILevel::eType>::EnumToCString(
+ hmi_level, &str)) {
+ return str;
+ }
+ return std::string();
+}
+
+std::string MessageHelper::StringifiedFunctionID(
+ mobile_apis::FunctionID::eType function_id) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ const char* str = 0;
+ if (EnumConversionHelper<mobile_apis::FunctionID::eType>::EnumToCString(
+ function_id, &str)) {
+ const std::string enum_name = str;
+ // Strip 'ID' suffix from value name
+ DCHECK(enum_name.length() > 2
+ && enum_name.substr(enum_name.length() - 2) == "ID");
+ return enum_name.substr(0, enum_name.length() - 2);
+ }
+ return std::string();
+}
+
+#ifdef HMI_DBUS_API
+namespace {
+const std::map<std::string, uint16_t> create_get_vehicle_data_args() {
+ std::map<std::string, uint16_t> rc;
+ rc.insert(std::make_pair(strings::gps, hmi_apis::FunctionID::VehicleInfo_GetGpsData));
+ rc.insert(std::make_pair(strings::speed, hmi_apis::FunctionID::VehicleInfo_GetSpeed));
+ rc.insert(std::make_pair(strings::rpm, hmi_apis::FunctionID::VehicleInfo_GetRpm));
+ rc.insert(std::make_pair(strings::fuel_level, hmi_apis::FunctionID::VehicleInfo_GetFuelLevel));
+ rc.insert(std::make_pair(strings::fuel_level_state, hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState));
+ rc.insert(std::make_pair(strings::instant_fuel_consumption, hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption));
+ rc.insert(std::make_pair(strings::external_temp, hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature));
+ rc.insert(std::make_pair(strings::vin, hmi_apis::FunctionID::VehicleInfo_GetVin));
+ rc.insert(std::make_pair(strings::prndl, hmi_apis::FunctionID::VehicleInfo_GetPrndl));
+ rc.insert(std::make_pair(strings::tire_pressure, hmi_apis::FunctionID::VehicleInfo_GetTirePressure));
+ rc.insert(std::make_pair(strings::odometer, hmi_apis::FunctionID::VehicleInfo_GetOdometer));
+ rc.insert(std::make_pair(strings::belt_status, hmi_apis::FunctionID::VehicleInfo_GetBeltStatus));
+ rc.insert(std::make_pair(strings::body_information, hmi_apis::FunctionID::VehicleInfo_GetBodyInformation));
+ rc.insert(std::make_pair(strings::device_status, hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus));
+ rc.insert(std::make_pair(strings::driver_braking, hmi_apis::FunctionID::VehicleInfo_GetDriverBraking));
+ rc.insert(std::make_pair(strings::wiper_status, hmi_apis::FunctionID::VehicleInfo_GetWiperStatus));
+ rc.insert(std::make_pair(strings::head_lamp_status, hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus));
+ rc.insert(std::make_pair(strings::engine_torque, hmi_apis::FunctionID::VehicleInfo_GetEngineTorque));
+ rc.insert(std::make_pair(strings::acc_pedal_pos, hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition));
+ rc.insert(std::make_pair(strings::steering_wheel_angle, hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle));
+ rc.insert(std::make_pair(strings::e_call_info, hmi_apis::FunctionID::VehicleInfo_GetECallInfo));
+ rc.insert(std::make_pair(strings::airbag_status, hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus));
+ rc.insert(std::make_pair(strings::emergency_event, hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent));
+ rc.insert(std::make_pair(strings::cluster_mode_status, hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus));
+ rc.insert(std::make_pair(strings::my_key, hmi_apis::FunctionID::VehicleInfo_GetMyKey));
+ return rc;
+}
+static std::map<std::string, uint16_t> vehicle_data_args = create_get_vehicle_data_args();
+}
+#endif
+
+void MessageHelper::CreateGetVehicleDataRequest(uint32_t correlation_id, const std::vector<std::string>& params) {
+#ifdef HMI_DBUS_API
+ for (std::vector<std::string>::const_iterator it = params.begin();
+ it != params.end(); it++) {
+ smart_objects::SmartObject* request = new smart_objects::SmartObject;
+
+ (*request)[strings::params][strings::message_type] = static_cast<int>(kRequest);
+ (*request)[strings::params][strings::correlation_id] = correlation_id;
+ (*request)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*request)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*request)[strings::params][strings::function_id] =
+ static_cast<int>(vehicle_data_args[*it]);
+ ApplicationManagerImpl::instance()->ManageHMICommand(request);
+ }
+#else
+ smart_objects::SmartObject* request = new smart_objects::SmartObject;
+
+ (*request)[strings::params][strings::message_type] = static_cast<int>(kRequest);
+ (*request)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ (*request)[strings::params][strings::correlation_id] = correlation_id;
+ (*request)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*request)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*request)[strings::msg_params] = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ for (std::vector<std::string>::const_iterator it = params.begin();
+ it != params.end(); it++) {
+ (*request)[strings::msg_params][*it] = true;
+ }
+ ApplicationManagerImpl::instance()->ManageHMICommand(request);
+#endif
+}
+
+smart_objects::SmartObject* MessageHelper::CreateBlockedByPoliciesResponse(
+ mobile_apis::FunctionID::eType function_id,
+ mobile_apis::Result::eType result, uint32_t correlation_id,
+ uint32_t connection_key) {
+ smart_objects::SmartObject* response = new smart_objects::SmartObject;
+ if (!response) {
+ return NULL;
+ }
+
+ (*response)[strings::params][strings::function_id] =
+ static_cast<int>(function_id);
+ (*response)[strings::params][strings::message_type] =
+ static_cast<int>(kResponse);
+ (*response)[strings::msg_params][strings::success] = false;
+ (*response)[strings::msg_params][strings::result_code] =
+ static_cast<int>(result);
+ (*response)[strings::params][strings::correlation_id] = correlation_id;
+ (*response)[strings::params][strings::connection_key] = connection_key;
+ (*response)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ (*response)[strings::params][strings::protocol_version] =
+ static_cast<int>(kV2);
+ return response;
+}
+
+smart_objects::SmartObject* MessageHelper::CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices) {
+ smart_objects::SmartObject* device_list_so = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (NULL == device_list_so) {
+ return NULL;
+ }
+
+ (*device_list_so)[strings::device_list] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ smart_objects::SmartObject& list_so = (*device_list_so)[strings::device_list];
+
+ int32_t index = 0;
+ for (connection_handler::DeviceMap::const_iterator it = devices.begin();
+ devices.end() != it; ++it) {
+ const connection_handler::Device& d =
+ static_cast<connection_handler::Device>(it->second);
+ list_so[index][strings::name] = d.user_friendly_name();
+ list_so[index][strings::id] = it->second.device_handle();
+
+ const policy::DeviceConsent device_consent =
+ policy::PolicyHandler::instance()->GetUserConsentForDevice(it->second.mac_address());
+ list_so[index][strings::isSDLAllowed] =
+ policy::DeviceConsent::kDeviceAllowed == device_consent;
+ }
+ ++index;
+ return device_list_so;
+}
+
+smart_objects::SmartObject* MessageHelper::CreateModuleInfoSO(
+ uint32_t function_id) {
+ smart_objects::SmartObject* module_info = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& object = *module_info;
+ object[strings::params][strings::message_type] = static_cast<int>(kRequest);
+ object[strings::params][strings::function_id] = static_cast<int>(function_id);
+ object[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ object[strings::msg_params] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ return module_info;
+}
+
+smart_objects::SmartObject* MessageHelper::CreateSetAppIcon(
+ const std::string& path_to_icon, uint32_t app_id) {
+ smart_objects::SmartObject* set_icon = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!set_icon) {
+ return NULL;
+ }
+
+ smart_objects::SmartObject& object = *set_icon;
+ object[strings::sync_file_name][strings::value] = path_to_icon;
+ // TODO(PV): need to store actual image type
+ object[strings::sync_file_name][strings::image_type] =
+ static_cast<int>(mobile_api::ImageType::DYNAMIC);
+ object[strings::app_id] = app_id;
+
+ return set_icon;
+}
+
+bool MessageHelper::SendIVISubscribtions(const uint32_t app_id) {
+ LOG4CXX_INFO(logger_, " MessageHelper::SendIVISubscribtions ");
+
+ bool succes = true;
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ app_id);
+ DCHECK(app.get());
+
+ SmartObjectList requests = GetIVISubscribtionRequests(app_id);
+ for (SmartObjectList::const_iterator it = requests.begin();
+ it != requests.end(); ++it) {
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(*it)) {
+ succes = false;
+ }
+ }
+ return succes;
+}
+
+MessageHelper::SmartObjectList MessageHelper::GetIVISubscribtionRequests(
+ const uint32_t app_id) {
+ LOG4CXX_INFO(logger_, " MessageHelper::GetIVISubscribtionRequests ");
+
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(
+ app_id);
+ DCHECK(app);
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = app_id;
+ const VehicleData& vehicle_data = MessageHelper::vehicle_data_;
+ VehicleData::const_iterator ivi_it = vehicle_data.begin();
+ const std::set<uint32_t>& subscribes = app->SubscribesIVI();
+
+ for (; vehicle_data.end() != ivi_it; ++ivi_it) {
+ uint32_t type_id = static_cast<int>(ivi_it->second);
+ if (subscribes.end() != subscribes.find(type_id)) {
+ std::string key_name = ivi_it->first;
+ msg_params[key_name] = true;
+ }
+ }
+
+ SmartObjectList hmi_requests;
+#ifdef HMI_JSON_API
+ smart_objects::SmartObject* request = MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData);
+ (*request)[strings::msg_params] = msg_params;
+ hmi_requests.push_back(request);
+#endif // #ifdef HMI_JSON_API
+#ifdef HMI_DBUS_API
+ //Generate list of ivi_subrequests
+ for (size_t i = 0; i < sizeof(ivi_subrequests) / sizeof(ivi_subrequests[0]); ++i) {
+ const VehicleInfo_Requests& sr = ivi_subrequests[i];
+ if (true == msg_params.keyExists(sr.str)
+ && true == msg_params[sr.str].asBool()) {
+ smart_objects::SmartObject* request = MessageHelper::CreateModuleInfoSO(
+ sr.func_id);
+ (*request)[strings::msg_params] = msg_params;
+ hmi_requests.push_back(request);
+ }
+ }
+#endif // #ifdef HMI_DBUS_API
+ return hmi_requests;
+}
+
+void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app) {
+ uint32_t id = app->app_id();
+
+ utils::SharedPtr<smart_objects::SmartObject> set_app_icon(
+ new smart_objects::SmartObject);
+ if (set_app_icon) {
+ smart_objects::SmartObject& so_to_send = *set_app_icon;
+ so_to_send[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::UI_SetAppIcon);
+ so_to_send[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ so_to_send[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ so_to_send[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ so_to_send[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ so_to_send[strings::msg_params] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject* msg_params = MessageHelper::CreateSetAppIcon(
+ app->app_icon_path(), id);
+
+ if (msg_params) {
+ so_to_send[strings::msg_params] = *msg_params;
+ }
+ // TODO(PV): appropriate handling of result
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(set_app_icon));
+ }
+
+ SendGlobalPropertiesToHMI(app);
+ SendShowRequestToHMI(app);
+}
+
+void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app) {
+ DCHECK(app.get());
+
+ SmartObjectList requests = CreateGlobalPropertiesRequestsToHMI(app);
+ for (SmartObjectList::const_iterator it = requests.begin();
+ it != requests.end(); ++it) {
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it))
+ }
+}
+
+MessageHelper::SmartObjectList MessageHelper::CreateGlobalPropertiesRequestsToHMI(
+ ApplicationConstSharedPtr app) {
+
+ SmartObjectList requests;
+ DCHECK(app.get());
+
+ // UI global properties
+
+ if (app->vr_help_title() || app->vr_help()) {
+ smart_objects::SmartObject* ui_global_properties =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (!ui_global_properties) {
+ return requests;
+ }
+
+ (*ui_global_properties)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ (*ui_global_properties)[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ (*ui_global_properties)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*ui_global_properties)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*ui_global_properties)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject ui_msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (app->vr_help_title()) {
+ ui_msg_params[strings::vr_help_title] = (*app->vr_help_title());
+ }
+ if (app->vr_help()) {
+ ui_msg_params[strings::vr_help] = (*app->vr_help());
+ }
+ if (app->keyboard_props()) {
+ ui_msg_params[strings::keyboard_properties] = (*app->keyboard_props());
+ }
+ if (app->menu_title()) {
+ ui_msg_params[strings::menu_title] = (*app->menu_title());
+ }
+ if (app->menu_icon()) {
+ ui_msg_params[strings::menu_icon] = (*app->menu_icon());
+ }
+ ui_msg_params[strings::app_id] = app->app_id();
+
+ (*ui_global_properties)[strings::msg_params] = ui_msg_params;
+
+ requests.push_back(ui_global_properties);
+ }
+
+ // TTS global properties
+ if (app->help_prompt() || app->timeout_prompt()) {
+ smart_objects::SmartObject* tts_global_properties =
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ if (!tts_global_properties) {
+ return requests;
+ }
+
+ (*tts_global_properties)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*tts_global_properties)[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ (*tts_global_properties)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*tts_global_properties)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*tts_global_properties)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject tts_msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (app->help_prompt()) {
+ tts_msg_params[strings::help_prompt] = (*app->help_prompt());
+ }
+ if (app->timeout_prompt()) {
+ tts_msg_params[strings::timeout_prompt] = (*app->timeout_prompt());
+ }
+ tts_msg_params[strings::app_id] = app->app_id();
+
+ (*tts_global_properties)[strings::msg_params] = tts_msg_params;
+
+ requests.push_back(tts_global_properties);
+ }
+ return requests;
+}
+
+void MessageHelper::SendTTSGlobalProperties(
+ ApplicationSharedPtr app, bool default_help_prompt) {
+ if (!app.valid()) {
+ return;
+ }
+ utils::SharedPtr<smart_objects::SmartObject> tts_global_properties(
+ new smart_objects::SmartObject);
+ if (tts_global_properties) {
+ smart_objects::SmartObject& so_to_send = *tts_global_properties;
+ so_to_send[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ so_to_send[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ so_to_send[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ so_to_send[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ so_to_send[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::help_prompt] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ if (default_help_prompt) {
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator it = commands.begin();
+ uint32_t index = 0;
+ for (; commands.end() != it; ++it) {
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ if ((*it->second).keyExists(strings::menu_params)){
+ item[strings::text] = (*it->second)[strings::menu_params][strings::menu_name].asString();
+ item[strings::type] = mobile_apis::SpeechCapabilities::SC_TEXT;
+ } else {
+ continue;
+ }
+ msg_params[strings::help_prompt][index++] = item;
+ }
+ }
+ app->set_help_prompt(msg_params[strings::help_prompt]);
+ msg_params[strings::app_id] = app->app_id();
+ so_to_send[strings::msg_params] = msg_params;
+ ApplicationManagerImpl::instance()->ManageHMICommand(tts_global_properties);
+ }
+}
+
+smart_objects::SmartObject* MessageHelper::CreateAppVrHelp(
+ ApplicationConstSharedPtr app) {
+ smart_objects::SmartObject* result = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!result) {
+ return NULL;
+ }
+ smart_objects::SmartObject& vr_help = *result;
+ vr_help[strings::vr_help_title] = app->name();
+
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> apps = accessor.applications();
+
+ int32_t index = 0;
+ std::set<ApplicationSharedPtr>::const_iterator it_app = apps.begin();
+ for (; apps.end() != it_app; ++it_app) {
+ if ((*it_app)->vr_synonyms()) {
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = (*((*it_app)->vr_synonyms())).getElement(0);
+ item[strings::position] = index + 1;
+ vr_help[strings::vr_help][index++] = item;
+ }
+ }
+
+ // copy all app VR commands
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ smart_objects::SmartObject item(smart_objects::SmartType_Map);
+ item[strings::text] = (*it->second)[strings::vr_commands][0].asString();
+ item[strings::position] = index + 1;
+ vr_help[strings::vr_help][index++] = item;
+ }
+ return result;
+}
+
+MessageHelper::SmartObjectList MessageHelper::CreateShowRequestToHMI(
+ ApplicationConstSharedPtr app) {
+ DCHECK(app.get());
+
+ SmartObjectList requests;
+ smart_objects::SmartObject* ui_show = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (app->show_command()) {
+ (*ui_show)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::UI_Show);
+ (*ui_show)[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ (*ui_show)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*ui_show)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*ui_show)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*ui_show)[strings::msg_params] = (*app->show_command());
+ requests.push_back(ui_show);
+ }
+ return requests;
+}
+
+void MessageHelper::SendShowRequestToHMI(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return;
+ }
+ SmartObjectList shows = CreateShowRequestToHMI(app);
+
+ for (SmartObjectList::const_iterator it = shows.begin(); it != shows.end();
+ ++it) {
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it));
+ }
+
+}
+
+void MessageHelper::SendShowConstantTBTRequestToHMI(
+ ApplicationConstSharedPtr app) {
+ if (!app) {
+ return;
+ }
+
+ smart_objects::SmartObject* navi_show_tbt = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!navi_show_tbt) {
+ return;
+ }
+
+ if (app->tbt_show_command()) {
+ (*navi_show_tbt)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::Navigation_ShowConstantTBT);
+ (*navi_show_tbt)[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ (*navi_show_tbt)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*navi_show_tbt)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*navi_show_tbt)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*navi_show_tbt)[strings::msg_params] = (*app->tbt_show_command());
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(navi_show_tbt));
+ }
+}
+
+void MessageHelper::SendAddCommandRequestToHMI(ApplicationConstSharedPtr app) {
+ if (!app) {
+ return;
+ }
+ SmartObjectList requests = CreateAddCommandRequestToHMI(app);
+ for (SmartObjectList::iterator it = requests.begin(); it != requests.end();
+ ++it) {
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it));
+ }
+}
+
+MessageHelper::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
+ ApplicationConstSharedPtr app) {
+ DCHECK(app.get());
+
+ SmartObjectList requests;
+ const CommandsMap& commands = app->commands_map();
+ CommandsMap::const_iterator i = commands.begin();
+ for (; commands.end() != i; ++i) {
+ // UI Interface
+ if ((*i->second).keyExists(strings::menu_params)) {
+ smart_objects::SmartObject* ui_command = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!ui_command) {
+ return requests;
+ }
+
+ (*ui_command)[strings::params][strings::function_id] =
+ static_cast<int>(hmi_apis::FunctionID::UI_AddCommand);
+ (*ui_command)[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ (*ui_command)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*ui_command)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*ui_command)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = i->first;
+ msg_params[strings::menu_params] = (*i->second)[strings::menu_params];
+ msg_params[strings::app_id] = app->app_id();
+
+ if (((*i->second)[strings::cmd_icon].keyExists(strings::value))
+ && (0 < (*i->second)[strings::cmd_icon][strings::value].length())) {
+ msg_params[strings::cmd_icon] = (*i->second)[strings::cmd_icon];
+ msg_params[strings::cmd_icon][strings::value] =
+ (*i->second)[strings::cmd_icon][strings::value].asString();
+ }
+ (*ui_command)[strings::msg_params] = msg_params;
+ requests.push_back(ui_command);
+ }
+
+ // VR Interface
+ if ((*i->second).keyExists(strings::vr_commands)) {
+ SendAddVRCommandToHMI(i->first, (*i->second)[strings::vr_commands],
+ app->app_id());
+ }
+ }
+ return requests;
+}
+
+smart_objects::SmartObject* MessageHelper::CreateChangeRegistration(
+ int32_t function_id, int32_t language, uint32_t app_id) {
+ smart_objects::SmartObject* command = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!command) {
+ return NULL;
+ }
+ smart_objects::SmartObject& params = *command;
+
+ params[strings::params][strings::message_type] =
+ static_cast<int>(hmi_apis::messageType::request);
+ params[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ params[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+
+ params[strings::params][strings::function_id] = function_id;
+
+ params[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ msg_params[strings::language] = language;
+ msg_params[strings::app_id] = app_id;
+
+ params[strings::msg_params] = msg_params;
+ return command;
+}
+
+void MessageHelper::SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app) {
+ if (!app.valid()) {
+ return;
+ }
+ if (mobile_apis::Language::INVALID_ENUM != app->language()) {
+ smart_objects::SmartObject* vr_command = CreateChangeRegistration(
+ hmi_apis::FunctionID::VR_ChangeRegistration, app->language(),
+ app->app_id());
+
+ if (vr_command) {
+ ApplicationManagerImpl::instance()->ManageHMICommand(vr_command);
+ }
+ }
+
+ if (mobile_apis::Language::INVALID_ENUM != app->language()) {
+ smart_objects::SmartObject* tts_command = CreateChangeRegistration(
+ hmi_apis::FunctionID::TTS_ChangeRegistration, app->language(),
+ app->app_id());
+
+ if (tts_command) {
+ ApplicationManagerImpl::instance()->ManageHMICommand(tts_command);
+ }
+ }
+
+ if (mobile_apis::Language::INVALID_ENUM != app->ui_language()) {
+ smart_objects::SmartObject* ui_command = CreateChangeRegistration(
+ hmi_apis::FunctionID::UI_ChangeRegistration, app->ui_language(),
+ app->app_id());
+
+ if (ui_command) {
+ ApplicationManagerImpl::instance()->ManageHMICommand(ui_command);
+ }
+
+ }
+}
+
+void MessageHelper::SendAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id) {
+ smart_objects::SmartObject* request = CreateAddVRCommandToHMI(cmd_id,
+ vr_commands,
+ app_id);
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(request));
+}
+
+smart_objects::SmartObject* MessageHelper::CreateAddVRCommandToHMI(
+ uint32_t cmd_id,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& vr_commands,
+ uint32_t app_id) {
+ smart_objects::SmartObject* vr_command = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!vr_command) {
+ return NULL;
+ }
+
+ (*vr_command)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_AddCommand;
+ (*vr_command)[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ (*vr_command)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*vr_command)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*vr_command)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (0 != cmd_id) {
+ msg_params[strings::cmd_id] = cmd_id;
+ }
+ msg_params[strings::vr_commands] = vr_commands;
+ if (0 < app_id) {
+ msg_params[strings::app_id] = app_id;
+ }
+ msg_params[strings::grammar_id] =
+ ApplicationManagerImpl::instance()->application(app_id)->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ (*vr_command)[strings::msg_params] = msg_params;
+
+ return vr_command;
+}
+
+bool MessageHelper::CreateHMIApplicationStruct(ApplicationConstSharedPtr app,
+ smart_objects::SmartObject& output) {
+
+ if (false == app.valid()) {
+ return false;
+ }
+
+ const smart_objects::SmartObject* app_types = app->app_types();
+ const smart_objects::SmartObject* ngn_media_screen_name = app->ngn_media_screen_name();
+ const connection_handler::DeviceHandle handle = app->device();
+ std::string device_name = ApplicationManagerImpl::instance()->GetDeviceName(handle);
+
+ output = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ output[strings::app_name] = app->name();
+ output[strings::icon] = app->app_icon_path();
+ output[strings::device_name] = device_name;
+ output[strings::app_id] = app->app_id();
+ output[strings::hmi_display_language_desired] = app->ui_language();
+ output[strings::is_media_application] = app->is_media_application();
+
+ if (NULL != ngn_media_screen_name) {
+ output[strings::ngn_media_screen_app_name] = ngn_media_screen_name->asString();
+ }
+ if (NULL != app_types) {
+ output[strings::app_type] = *app_types;
+ }
+ return true;
+}
+
+void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app) {
+ DCHECK(app.get());
+ SmartObjectList requests = CreateAddSubMenuRequestToHMI(app);
+ for (SmartObjectList::iterator it = requests.begin(); it != requests.end();
+ ++it) {
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(*it));
+ }
+}
+
+MessageHelper::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
+ ApplicationConstSharedPtr app) {
+ SmartObjectList requsets;
+ const SubMenuMap& sub_menu = app->sub_menu_map();
+ SubMenuMap::const_iterator i = sub_menu.begin();
+ for (; sub_menu.end() != i; ++i) {
+ smart_objects::SmartObject* ui_sub_menu = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!ui_sub_menu) {
+ return requsets;
+ }
+
+ (*ui_sub_menu)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_AddSubMenu;
+ (*ui_sub_menu)[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ (*ui_sub_menu)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*ui_sub_menu)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*ui_sub_menu)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] = i->first;
+ msg_params[strings::menu_params][strings::position] =
+ (*i->second)[strings::position];
+ msg_params[strings::menu_params][strings::menu_name] =
+ (*i->second)[strings::menu_name];
+ msg_params[strings::app_id] = app->app_id();
+ (*ui_sub_menu)[strings::msg_params] = msg_params;
+ requsets.push_back(ui_sub_menu);
+ }
+ return requsets;
+}
+
+void MessageHelper::SendOnAppUnregNotificationToHMI(
+ ApplicationConstSharedPtr app, bool is_unexpected_disconnect) {
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!notification) {
+ return;
+ }
+
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered;
+
+ message[strings::params][strings::message_type] = MessageType::kNotification;
+ // we put hmi_app_id because applicaton list does not contain application on this momment
+ // and ReplaceHMIByMobileAppId function will be unable to replace app_id to hmi_app_id
+ message[strings::msg_params][strings::app_id] = app->hmi_app_id();
+ message[strings::msg_params][strings::unexpected_disconnect] =
+ is_unexpected_disconnect;
+ ApplicationManagerImpl::instance()->ManageHMICommand(&message);
+}
+
+void MessageHelper::SendActivateAppToHMI(uint32_t const app_id,
+ hmi_apis::Common_HMILevel::eType level) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ application_manager::ApplicationConstSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application(app_id);
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id);
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp;
+ (*message)[strings::params][strings::message_type] = MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*message)[strings::msg_params][strings::app_id] = app_id;
+
+ std::string priority;
+ // TODO(KKolodiy): need remove method policy_manager
+
+ policy::PolicyHandler::instance()->GetPriority(
+ app->mobile_app_id()->asString(), &priority);
+ // According SDLAQ-CRS-2794
+ // SDL have to send ActivateApp without "proirity" parameter to HMI.
+ // in case of unconsented device
+ std::string mac_adress;
+ connection_handler::DeviceHandle device_handle = app->device();
+ connection_handler::ConnectionHandlerImpl::instance()->
+ GetDataOnDeviceID(device_handle, NULL, NULL, &mac_adress, NULL);
+
+ policy::DeviceConsent consent =
+ policy::PolicyHandler::instance()->GetUserConsentForDevice(mac_adress);
+ if (!priority.empty() && (policy::DeviceConsent::kDeviceAllowed == consent)) {
+ (*message)[strings::msg_params]["priority"] = GetPriorityCode(priority);
+ }
+
+ if (hmi_apis::Common_HMILevel::INVALID_ENUM != level) {
+ (*message)[strings::msg_params][strings::activate_app_hmi_level] = level;
+ }
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id) {
+ LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id);
+
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ application_manager::ApplicationConstSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application(app_id);
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id);
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource;
+ (*message)[strings::params][strings::message_type] = MessageType::kNotification;
+ (*message)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*message)[strings::msg_params][strings::app_id] = app_id;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+std::string MessageHelper::GetDeviceMacAddressForHandle(
+ const uint32_t device_handle) {
+
+ std::string device_mac_address = "";
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnDeviceID(
+ device_handle, NULL, NULL, &device_mac_address);
+
+ return device_mac_address;
+}
+
+void MessageHelper::GetDeviceInfoForHandle(const uint32_t device_handle,
+ policy::DeviceParams* device_info) {
+ if (!device_info) {
+ return;
+ }
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnDeviceID(
+ device_handle, &device_info->device_name, NULL,
+ &device_info->device_mac_address, &device_info->device_connection_type);
+}
+
+void MessageHelper::GetDeviceInfoForApp(uint32_t connection_key,
+ policy::DeviceParams* device_info) {
+ if (!device_info) {
+ return;
+ }
+
+ device_info->device_handle = ApplicationManagerImpl::instance()->application(
+ connection_key)->device();
+
+ GetDeviceInfoForHandle(device_info->device_handle, device_info);
+}
+
+void MessageHelper::SendSDLActivateAppResponse(policy::AppPermissions& permissions,
+ uint32_t correlation_id) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_ActivateApp;
+ (*message)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*message)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*message)[strings::params][hmi_response::code] = 0;
+
+ (*message)[strings::msg_params]["isSDLAllowed"] = permissions.isSDLAllowed;
+ if (!permissions.isSDLAllowed) {
+ (*message)[strings::msg_params]["device"]["name"] = permissions.deviceInfo
+ .device_name;
+ (*message)[strings::msg_params]["device"]["id"] = permissions.deviceInfo
+ .device_handle;
+ }
+
+ (*message)[strings::msg_params]["isAppRevoked"] = permissions.appRevoked;
+ (*message)[strings::msg_params]["isAppPermissionsRevoked"] = permissions
+ .isAppPermissionsRevoked;
+
+ if (permissions.isAppPermissionsRevoked) {
+ FillAppRevokedPermissions(permissions, *message);
+ }
+
+ (*message)[strings::msg_params]["isPermissionsConsentNeeded"] = permissions
+ .appPermissionsConsentNeeded;
+
+ if (!permissions.priority.empty()) {
+ (*message)[strings::msg_params]["priority"] = GetPriorityCode(
+ permissions.priority);
+ }
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+
+ // If application is revoked it should not be activated
+ if (permissions.appRevoked || !permissions.isSDLAllowed) {
+ return;
+ }
+
+ // Send HMI status notification to mobile
+ ApplicationSharedPtr app = ApplicationManagerImpl::instance()
+ ->application_by_policy_id(permissions.application_id);
+ if (app) {
+ ApplicationManagerImpl::instance()->ActivateApplication(app);
+ } else {
+ LOG4CXX_WARN(logger_, "Unable to find app_id: " << permissions.application_id);
+ }
+}
+
+void MessageHelper::SendOnSDLConsentNeeded(
+ const policy::DeviceParams& device_info) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_OnSDLConsentNeeded;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kNotification;
+
+ (*message)[strings::msg_params]["device"]["id"] = device_info.device_handle;
+ (*message)[strings::msg_params]["device"]["name"] = device_info.device_name;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+void MessageHelper::SendPolicyUpdate(
+ const std::string& file_path,
+ int timeout,
+ const std::vector<int>& retries) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_PolicyUpdate;
+ object[strings::params][strings::message_type] = MessageType::kRequest;
+ object[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ object[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ object[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+
+ object[strings::msg_params][hmi_request::file] = file_path;
+ object[strings::msg_params][strings::timeout] = timeout;
+ object[strings::msg_params][hmi_request::retry] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ for (size_t i = 0; i < retries.size(); ++i) {
+ object[strings::msg_params][hmi_request::retry][i] = retries[i];
+ }
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+void MessageHelper::SendGetUserFriendlyMessageResponse(
+ const std::vector<policy::UserFriendlyMessage>& msg,
+ uint32_t correlation_id) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_GetUserFriendlyMessage;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kResponse;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::params][hmi_response::code] = 0;
+
+ // If no any messages found - skip sending of "messages" param
+ if (msg.empty()) {
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+ }
+
+ const std::string messages = "messages";
+ (*message)[strings::msg_params][messages] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& user_friendly_messages =
+ (*message)[strings::msg_params][messages];
+
+
+ const std::string tts = "ttsString";
+ const std::string label = "label";
+ const std::string line1 = "line1";
+ const std::string line2 = "line2";
+ const std::string textBody = "textBody";
+ const std::string message_code = "messageCode";
+
+ std::vector<policy::UserFriendlyMessage>::const_iterator it = msg.begin();
+ std::vector<policy::UserFriendlyMessage>::const_iterator it_end = msg.end();
+ for (uint32_t index = 0; it != it_end; ++it, ++index) {
+ user_friendly_messages[index] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& obj = user_friendly_messages[index];
+ obj[message_code] = it->message_code;
+
+ if (!it->tts.empty()) {
+ obj[tts] = it->tts;
+ }
+ if (!it->label.empty()) {
+ obj[label] = it->label;
+ }
+ if (!it->line1.empty()) {
+ obj[line1] = it->line1;
+ }
+ if (!it->line2.empty()) {
+ obj[line2] = it->line2;
+ }
+ if (!it->text_body.empty()) {
+ obj[textBody] = it->text_body;
+ }
+ }
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+void MessageHelper::SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ uint32_t correlation_id) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_GetListOfPermissions;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kResponse;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::params][hmi_response::code] = 0;
+
+ const std::string allowed_functions = "allowedFunctions";
+ (*message)[strings::msg_params][allowed_functions] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& allowed_functions_array =
+ (*message)[strings::msg_params][allowed_functions];
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permissions.begin();
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it_end =
+ permissions.end();
+ for (uint32_t index = 0; it != it_end; ++it, ++index) {
+ allowed_functions_array[index] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& item = allowed_functions_array[index];
+ item[strings::name] = (*it).group_alias;
+ item[strings::id] = (*it).group_id;
+ policy::GroupConsent permission_state = (*it).state;
+ // If state undefined, 'allowed' parameter should be absent
+ if (policy::kGroupUndefined != permission_state) {
+ item["allowed"] = policy::kGroupAllowed == permission_state;
+ }
+ }
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+smart_objects::SmartObject* MessageHelper::CreateNegativeResponse(
+ uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
+ int32_t result_code) {
+ smart_objects::SmartObject* response = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& response_data = *response;
+ response_data[strings::params][strings::function_id] = function_id;
+ response_data[strings::params][strings::message_type] =
+ mobile_apis::messageType::response;
+ response_data[strings::params][strings::correlation_id] = correlation_id;
+ response_data[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ response_data[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ response_data[strings::msg_params][strings::result_code] = result_code;
+ response_data[strings::msg_params][strings::success] = false;
+ response_data[strings::params][strings::connection_key] = connection_key;
+
+ return response;
+}
+
+void MessageHelper::SendNaviStartStream(int32_t connection_key) {
+ LOG4CXX_INFO(logger_, "MessageHelper::SendNaviStartStream");
+ smart_objects::SmartObject* start_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!start_stream) {
+ return;
+ }
+
+ (*start_stream)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Navigation_StartStream;
+ (*start_stream)[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ (*start_stream)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*start_stream)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*start_stream)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ uint32_t app_id = 0;
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnSessionKey(
+ connection_key, &app_id);
+
+ char url[100] = {'\0'};
+ if ("socket" == profile::Profile::instance()->video_server_type()) {
+ snprintf(url, sizeof(url) / sizeof(url[0]), "http://%s:%d",
+ profile::Profile::instance()->server_address().c_str(),
+ profile::Profile::instance()->video_streaming_port());
+ } else if ("pipe" == profile::Profile::instance()->video_server_type()) {
+ snprintf(url, sizeof(url) / sizeof(url[0]), "%s",
+ profile::Profile::instance()->named_video_pipe_path().c_str());
+ } else {
+ int snprintf_result;
+ snprintf_result = snprintf(url, sizeof(url) / sizeof(url[0]), "%s",
+ profile::Profile::instance()->video_stream_file().c_str());
+ DCHECK(snprintf_result);
+ }
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::url] = url;
+
+ (*start_stream)[strings::msg_params] = msg_params;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(start_stream);
+}
+
+void MessageHelper::SendNaviStopStream(int32_t connection_key) {
+ smart_objects::SmartObject* stop_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!stop_stream) {
+ return;
+ }
+
+ (*stop_stream)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Navigation_StopStream;
+ (*stop_stream)[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ (*stop_stream)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*stop_stream)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*stop_stream)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ uint32_t app_id = 0;
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnSessionKey(
+ connection_key, &app_id);
+
+ msg_params[strings::app_id] = app_id;
+
+ (*stop_stream)[strings::msg_params] = msg_params;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(stop_stream);
+}
+
+void MessageHelper::SendAudioStartStream(int32_t connection_key) {
+
+ smart_objects::SmartObject* start_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!start_stream) {
+ return;
+ }
+
+ (*start_stream)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Navigation_StartAudioStream;
+ (*start_stream)[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ (*start_stream)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*start_stream)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*start_stream)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ uint32_t app_id = 0;
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnSessionKey(
+ connection_key, &app_id);
+
+ char url[100] = {'\0'};
+ if ("socket" == profile::Profile::instance()->audio_server_type()) {
+ snprintf(url, sizeof(url) / sizeof(url[0]), "http://%s:%d",
+ profile::Profile::instance()->server_address().c_str(),
+ profile::Profile::instance()->audio_streaming_port());
+ } else if ("pipe" == profile::Profile::instance()->audio_server_type()) {
+ snprintf(url, sizeof(url) / sizeof(url[0]), "%s",
+ profile::Profile::instance()->named_audio_pipe_path().c_str());
+ } else {
+ int snprintf_result;
+ snprintf_result = snprintf(url, sizeof(url) / sizeof(url[0]), "%s",
+ profile::Profile::instance()->audio_stream_file().c_str());
+ DCHECK(snprintf_result);
+ }
+
+ msg_params[strings::app_id] = app_id;
+ msg_params[strings::url] = url;
+
+ (*start_stream)[strings::msg_params] = msg_params;
+
+ DCHECK(ApplicationManagerImpl::instance()->ManageHMICommand(start_stream));
+}
+
+void MessageHelper::SendAudioStopStream(int32_t connection_key) {
+ smart_objects::SmartObject* stop_stream = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ if (!stop_stream) {
+ return;
+ }
+
+ (*stop_stream)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Navigation_StopAudioStream;
+ (*stop_stream)[strings::params][strings::message_type] =
+ hmi_apis::messageType::request;
+ (*stop_stream)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*stop_stream)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ (*stop_stream)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ smart_objects::SmartObject msg_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ uint32_t app_id = 0;
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnSessionKey(
+ connection_key, &app_id);
+
+ msg_params[strings::app_id] = app_id;
+
+ (*stop_stream)[strings::msg_params] = msg_params;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(stop_stream);
+}
+
+bool MessageHelper::SendStopAudioPathThru() {
+ LOG4CXX_INFO(logger_, "MessageHelper::SendAudioStopAudioPathThru");
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ new NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ const uint32_t hmi_correlation_id = ApplicationManagerImpl::instance()
+ ->GetNextHMICorrelationID();
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
+ request[strings::params][strings::message_type] = MessageType::kRequest;
+ request[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_EndAudioPassThru;
+ request[strings::params][strings::correlation_id] = hmi_correlation_id;
+ request[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ request[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+ return ApplicationManagerImpl::instance()->ManageHMICommand(result);
+}
+
+void MessageHelper::SendPolicySnapshotNotification(
+ unsigned int connection_key, const std::vector<uint8_t>& policy_data,
+ const std::string& url, int timeout) {
+ smart_objects::SmartObject* pt_notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& content = *pt_notification;
+ ;
+ content[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnSystemRequestID;
+ content[strings::params][strings::message_type] =
+ mobile_apis::messageType::notification;
+ content[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ content[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ content[strings::params][strings::connection_key] = connection_key;
+ if (!url.empty()) {
+ content[strings::msg_params][mobile_notification::syncp_url] = url;
+ }
+ content[strings::msg_params][strings::file_type] =
+ mobile_apis::FileType::BINARY;
+ content[strings::msg_params][strings::request_type] =
+ mobile_apis::RequestType::HTTP;
+ /*if (-1 != timeout) {
+ content[strings::msg_params][mobile_notification::syncp_timeout] = timeout;
+ }*/
+ content[strings::params][strings::binary_data] = smart_objects::SmartObject(
+ policy_data);
+ ApplicationManagerImpl::instance()->ManageMobileCommand(pt_notification);
+}
+
+void MessageHelper::SendOnPermissionsChangeNotification(
+ uint32_t connection_key, const policy::Permissions& permissions) {
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& content = *notification;
+ ;
+ content[strings::params][strings::function_id] =
+ mobile_apis::FunctionID::OnPermissionsChangeID;
+ content[strings::params][strings::message_type] =
+ mobile_apis::messageType::notification;
+ content[strings::params][strings::protocol_type] =
+ commands::CommandImpl::mobile_protocol_type_;
+ content[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ content[strings::params][strings::connection_key] = connection_key;
+
+ smart_objects::SmartObject* p_msg_params = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& msg_params = *p_msg_params;
+
+ content[strings::msg_params] = msg_params;
+
+ //content[strings::msg_params][strings::app_id] = connection_key;
+
+ content[strings::msg_params]["permissionItem"] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& permissions_item_array =
+ content[strings::msg_params]["permissionItem"];
+
+ policy::Permissions::const_iterator it_permissions = permissions.begin();
+ policy::Permissions::const_iterator it_permissions_end = permissions.end();
+
+ for (size_t index_pi = 0; it_permissions != it_permissions_end;
+ ++it_permissions, ++index_pi) {
+
+ permissions_item_array[index_pi] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& permission_item =
+ permissions_item_array[index_pi];
+
+ // Filling the rpcName of PermissionItem
+ permission_item["rpcName"] = (*it_permissions).first;
+ const policy::RpcPermissions& rpc_permissions = (*it_permissions).second;
+
+ // Creating SO for hmiPermissions
+ permission_item["hmiPermissions"] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& hmi_permissions =
+ permission_item["hmiPermissions"];
+
+ policy::HMIPermissions::const_iterator it_hmi_permissions = rpc_permissions
+ .hmi_permissions.begin();
+ policy::HMIPermissions::const_iterator it_hmi_permissions_end =
+ rpc_permissions.hmi_permissions.end();
+
+ // Filling the hmiPermissions of PermissionItem
+ for (; it_hmi_permissions != it_hmi_permissions_end; ++it_hmi_permissions) {
+ // Possible key names are "allowed", "userDisallowed"
+ hmi_permissions[(*it_hmi_permissions).first] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& hmi_levels =
+ hmi_permissions[(*it_hmi_permissions).first];
+
+ std::set<policy::HMILevel>::const_iterator it_hmi_levels =
+ (*it_hmi_permissions).second.begin();
+ std::set<policy::HMILevel>::const_iterator it_hmi_levels_end =
+ (*it_hmi_permissions).second.end();
+
+ for (size_t index_hmi_levels = 0; it_hmi_levels != it_hmi_levels_end;
+ ++it_hmi_levels, ++index_hmi_levels) {
+ hmi_levels[index_hmi_levels] = *it_hmi_levels;
+ }
+ }
+
+ // Creating SO for parameterPermissions
+ permission_item["parameterPermissions"] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& parameter_permissions =
+ permission_item["parameterPermissions"];
+
+ policy::ParameterPermissions::const_iterator it_parameter_permissions =
+ rpc_permissions.parameter_permissions.begin();
+ policy::ParameterPermissions::const_iterator it_parameter_permissions_end =
+ rpc_permissions.parameter_permissions.end();
+
+ // Filling the parameterPermissions of PermissionItem
+ for (; it_parameter_permissions != it_parameter_permissions_end;
+ ++it_parameter_permissions) {
+ // Possible key names are "allowed", "userDisallowed"
+ parameter_permissions[(*it_parameter_permissions).first] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObject& parameters =
+ parameter_permissions[(*it_parameter_permissions).first];
+
+ std::set<policy::Parameter>::const_iterator it_parameters =
+ (*it_parameter_permissions).second.begin();
+ std::set<policy::Parameter>::const_iterator it_parameters_end =
+ (*it_parameter_permissions).second.end();
+
+ for (size_t index_parameters = 0; it_parameters != it_parameters_end;
+ ++it_parameters, ++index_parameters) {
+ parameters[index_parameters] = *it_parameters;
+ }
+ }
+ }
+
+ ApplicationManagerImpl::instance()->ManageMobileCommand(notification);
+}
+
+void MessageHelper::FillAppRevokedPermissions(
+ const policy::AppPermissions& permissions,
+ smart_objects::SmartObject& message) {
+
+ message[strings::msg_params]["appRevokedPermissions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ smart_objects::SmartObject& revoked_permission_items =
+ message[strings::msg_params]["appRevokedPermissions"];
+ for (size_t i = 0; i < permissions.appRevokedPermissions.size(); ++i) {
+ revoked_permission_items[i] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ smart_objects::SmartObject& permission_item = revoked_permission_items[i];
+ permission_item["name"] = permissions.appRevokedPermissions[i].
+ group_alias;
+
+ permission_item["id"] = permissions.appRevokedPermissions[i].group_id;
+
+ if (policy::kGroupUndefined !=
+ permissions.appRevokedPermissions[i].state) {
+ permission_item["allowed"] =
+ policy::kGroupAllowed == permissions.appRevokedPermissions[i].state
+ ? true : false;
+ }
+ }
+}
+
+void MessageHelper::SendOnAppPermissionsChangedNotification(
+ uint32_t connection_key, const policy::AppPermissions& permissions) {
+ smart_objects::SmartObject* notification = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!notification) {
+ return;
+ }
+
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_OnAppPermissionChanged;
+
+ message[strings::params][strings::message_type] = MessageType::kNotification;
+ message[strings::msg_params][strings::app_id] = connection_key;
+
+ // TODO(AOleynik): Add other parameters processing from incoming struct
+ if (permissions.appRevoked) {
+ message[strings::msg_params]["appRevoked"] = permissions.appRevoked;
+ }
+ if (permissions.isAppPermissionsRevoked) {
+ message[strings::msg_params]["isAppPermissionsRevoked"] = permissions
+ .isAppPermissionsRevoked;
+
+ FillAppRevokedPermissions(permissions, message);
+ }
+
+ if (permissions.appPermissionsConsentNeeded) {
+ message[strings::msg_params]["appPermissionsConsentNeeded"] = permissions
+ .appPermissionsConsentNeeded;
+ }
+ if (permissions.appUnauthorized) {
+ message[strings::msg_params]["appUnauthorized"] = permissions
+ .appUnauthorized;
+ }
+ if (!permissions.priority.empty()) {
+ message[strings::msg_params]["priority"] = GetPriorityCode(
+ permissions.priority);
+ }
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(&message);
+}
+
+void MessageHelper::SendGetStatusUpdateResponse(const std::string& status,
+ uint32_t correlation_id) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_GetStatusUpdate;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kResponse;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::params][hmi_response::code] = 0;
+
+ (*message)[strings::msg_params]["status"] = status;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+void MessageHelper::SendUpdateSDLResponse(const std::string& result, uint32_t correlation_id) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_UpdateSDL;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kResponse;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::params][hmi_response::code] = 0;
+
+ (*message)[strings::msg_params]["result"] = result;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+
+
+void MessageHelper::SendOnStatusUpdate(const std::string& status) {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_OnStatusUpdate;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kNotification;
+
+ (*message)[strings::msg_params]["status"] = status;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+void MessageHelper::SendGetSystemInfoRequest() {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_GetSystemInfo;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*message)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*message)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
+ smart_objects::SmartObject& message, ApplicationConstSharedPtr app) {
+ if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == message.getType()) {
+ for (uint32_t i = 0; i < message.length(); ++i) {
+ mobile_apis::Result::eType res = VerifyImageFiles(message[i], app);
+ if (mobile_apis::Result::SUCCESS != res) {
+ return res;
+ }
+ }
+ } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map
+ == message.getType()) {
+ if (message.keyExists(strings::image_type)) {
+ mobile_apis::Result::eType verification_result = VerifyImage(message,
+ app);
+
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ return verification_result; // exit point
+ }
+ } else {
+ std::set<std::string> keys = message.enumerate();
+
+ for (std::set<std::string>::const_iterator key = keys.begin();
+ key != keys.end(); ++key) {
+ if (strings::soft_buttons != (*key)) {
+ mobile_apis::Result::eType res = VerifyImageFiles(message[*key], app);
+ if (mobile_apis::Result::SUCCESS != res) {
+ return res;
+ }
+ }
+ }
+ }
+ } // all other types shoudn't be processed
+
+ return mobile_apis::Result::SUCCESS;
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyImage(
+ smart_objects::SmartObject& image, ApplicationConstSharedPtr app) {
+ // Checking image type first: if STATIC - skip existence check, since it is
+ // HMI related file and it should know it location
+ const uint32_t image_type = image[strings::image_type].asUInt();
+ mobile_apis::ImageType::eType type =
+ static_cast<mobile_apis::ImageType::eType>(image_type);
+ if (mobile_apis::ImageType::STATIC == type) {
+ return mobile_apis::Result::SUCCESS;
+ }
+
+ const std::string& file_name = image[strings::value].asString();
+
+ std::string str = file_name;
+ str.erase(remove(str.begin(), str.end(), ' '), str.end());
+ if (0 == str.size()) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ std::string full_file_path =
+ profile::Profile::instance()->app_storage_folder() + "/";
+
+ if (file_name.size() > 0 && file_name[0] == '/') {
+ full_file_path = file_name;
+ } else {
+
+ full_file_path += app->folder_name();
+ full_file_path += "/";
+ full_file_path += file_name;
+ }
+
+ if (!file_system::FileExists(full_file_path)) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ image[strings::value] = full_file_path;
+
+ return mobile_apis::Result::SUCCESS;
+}
+
+mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
+ smart_objects::SmartObject& message, ApplicationConstSharedPtr app) {
+ mobile_apis::Result::eType verification_result_image =
+ mobile_apis::Result::SUCCESS;
+ for (uint32_t i = 0; i < message.length(); ++i) {
+ if (message[i].keyExists(strings::image)) {
+ verification_result_image = VerifyImage(message[i][strings::image], app);
+ if (mobile_apis::Result::SUCCESS != verification_result_image) {
+ return verification_result_image;
+ }
+ }
+ }
+ return mobile_apis::Result::SUCCESS;
+}
+
+bool MessageHelper::VerifySoftButtonString(const std::string& str) {
+
+ if ((std::string::npos != str.find_first_of("\t\n")) ||
+ (std::string::npos != str.find("\\n")) ||
+ (std::string::npos != str.find("\\t")) ||
+ (std::string::npos == str.find_first_not_of(' '))) {
+ LOG4CXX_ERROR(logger_, "MessageHelper::VerifySoftButtonString"
+ "string contains incorrect character");
+ return false;
+ }
+ return true;
+}
+
+mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(
+ smart_objects::SmartObject& message_params, ApplicationConstSharedPtr app) {
+ if (!message_params.keyExists(strings::soft_buttons)) {
+ return mobile_apis::Result::SUCCESS;
+ }
+
+ const HMICapabilities& hmi_capabilities = ApplicationManagerImpl::instance()
+ ->hmi_capabilities();
+ const smart_objects::SmartObject* soft_button_capabilities = hmi_capabilities
+ .soft_button_capabilities();
+ bool image_supported = false;
+ if (soft_button_capabilities) {
+ image_supported = (*soft_button_capabilities)[hmi_response::image_supported]
+ .asBool();
+ }
+
+ smart_objects::SmartObject& request_soft_buttons =
+ message_params[strings::soft_buttons];
+
+ // Check whether soft buttons request is well-formed
+ if (!ValidateSoftButtons(request_soft_buttons)) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ smart_objects::SmartObject soft_buttons = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+
+ policy::PolicyHandler* policy_handler = policy::PolicyHandler::instance();
+ std::string app_mobile_id = app->mobile_app_id()->asString();
+
+ uint32_t j = 0;
+ size_t size = request_soft_buttons.length();
+ for (uint32_t i = 0; i < size; ++i) {
+ int system_action = request_soft_buttons[i][strings::system_action].asInt();
+ if (!policy_handler->CheckKeepContext(system_action, app_mobile_id) ||
+ !policy_handler->CheckStealFocus(system_action, app_mobile_id)) {
+ return mobile_apis::Result::DISALLOWED;
+ }
+
+ switch (request_soft_buttons[i][strings::type].asInt()) {
+ case mobile_apis::SoftButtonType::SBT_IMAGE: {
+ if (!image_supported) {
+ continue;
+ }
+ //Any text value for type "IMAGE" should be ignored.
+ if (request_soft_buttons[i].keyExists(strings::text)) {
+ request_soft_buttons[i].erase(strings::text);
+ }
+ if (request_soft_buttons[i].keyExists(strings::image)) {
+ mobile_apis::Result::eType verification_result = VerifyImage(
+ request_soft_buttons[i][strings::image], app);
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ } else {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ break;
+ }
+ case mobile_apis::SoftButtonType::SBT_TEXT: {
+ if ((!request_soft_buttons[i].keyExists(strings::text)) ||
+ (!VerifySoftButtonString(
+ request_soft_buttons[i][strings::text].asString()))) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ break;
+ }
+ case mobile_apis::SoftButtonType::SBT_BOTH: {
+
+ if ((!request_soft_buttons[i].keyExists(strings::text)) ||
+ ((request_soft_buttons[i][strings::text].length())
+ && (!VerifySoftButtonString(
+ request_soft_buttons[i][strings::text].asString())))) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+
+ bool image_exist = false;
+ if (image_supported) {
+ image_exist = request_soft_buttons[i].keyExists(strings::image);
+ if (!image_exist) {
+ return mobile_apis::Result::INVALID_DATA;
+ }
+ }
+ if (image_exist) {
+ mobile_apis::Result::eType verification_result = VerifyImage(
+ request_soft_buttons[i][strings::image], app);
+
+ if (mobile_apis::Result::SUCCESS != verification_result) {
+ return mobile_apis::Result::INVALID_DATA;
+
+ }
+ }
+ break;
+ }
+ default: {
+ continue;
+ break;
+ }
+ }
+
+ soft_buttons[j] = request_soft_buttons[i];
+ ++j;
+ }
+
+ request_soft_buttons = soft_buttons;
+
+ if (0 == request_soft_buttons.length()) {
+ message_params.erase(strings::soft_buttons);
+ }
+ return mobile_apis::Result::SUCCESS;
+}
+
+void MessageHelper::SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params, ApplicationSharedPtr app,
+ int32_t function_id) {
+ SoftButtonID softbuttons_id;
+ smart_objects::SmartObject& soft_buttons = message_params[strings::soft_buttons];
+ unsigned int length = soft_buttons.length();
+ for(unsigned int i = 0; i < length; ++i) {
+ softbuttons_id.insert(soft_buttons[i][strings::soft_button_id].asUInt());
+ }
+ app->SubscribeToSoftButtons(function_id, softbuttons_id);
+}
+
+// TODO(AK): change printf to logger
+bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
+ return true;
+#ifdef ENABLE_LOG
+ static uint32_t tab = 0;
+ std::string tab_buffer;
+
+ if (tab == 0) {
+ printf("\n-------------------------------------------------------------");
+ }
+
+ for (uint32_t i = 0; i < tab; ++i) {
+ tab_buffer += "\t";
+ }
+
+ switch (object.getType()) {
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_Array: {
+ for (size_t i = 0; i < object.length(); i++) {
+ ++tab;
+
+ printf("\n%s%zu: ", tab_buffer.c_str(), i);
+ if (!PrintSmartObject(object.getElement(i))) {
+ printf("\n");
+ return false;
+ }
+ }
+ break;
+ }
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_Map: {
+ std::set<std::string> keys = object.enumerate();
+
+ for (std::set<std::string>::const_iterator key = keys.begin();
+ key != keys.end(); key++) {
+ ++tab;
+
+ printf("\n%s%s: ", tab_buffer.c_str(), (*key).c_str());
+ if (!PrintSmartObject(object[(*key).c_str()])) {
+ printf("\n");
+ return false;
+ }
+ }
+ break;
+ }
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean:
+ object.asBool() ? printf("true\n") : printf("false\n");
+ break;
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_Double: {
+ printf("%f", object.asDouble());
+ break;
+ }
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_Integer:
+ printf("%" PRId64 "\n", object.asInt64());
+ break;
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_String:
+ printf("%s", object.asString().c_str());
+ break;
+ case NsSmartDeviceLink::NsSmartObjects::SmartType_Character:
+ printf("%c", object.asChar());
+ break;
+ default:
+ printf("PrintSmartObject - default case\n");
+ break;
+ }
+
+ if (0 != tab) {
+ --tab;
+ } else {
+ printf("\n-------------------------------------------------------------\n");
+ }
+#endif
+ return true;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc
new file mode 100644
index 0000000000..2d2e31f735
--- /dev/null
+++ b/src/components/application_manager/src/mobile_command_factory.cc
@@ -0,0 +1,549 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/mobile_command_factory.h"
+#include "application_manager/commands/mobile/add_command_request.h"
+#include "application_manager/commands/mobile/add_command_response.h"
+#include "application_manager/commands/mobile/delete_command_request.h"
+#include "application_manager/commands/mobile/delete_command_response.h"
+#include "application_manager/commands/mobile/add_sub_menu_request.h"
+#include "application_manager/commands/mobile/add_sub_menu_response.h"
+#include "application_manager/commands/mobile/alert_request.h"
+#include "application_manager/commands/mobile/alert_response.h"
+#include "application_manager/commands/mobile/alert_maneuver_request.h"
+#include "application_manager/commands/mobile/alert_maneuver_response.h"
+#include "application_manager/commands/mobile/change_registration_request.h"
+#include "application_manager/commands/mobile/change_registration_response.h"
+#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
+#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
+#include "application_manager/commands/mobile/delete_file_request.h"
+#include "application_manager/commands/mobile/delete_file_response.h"
+#include "application_manager/commands/mobile/delete_interaction_choice_set_request.h"
+#include "application_manager/commands/mobile/delete_interaction_choice_set_response.h"
+#include "application_manager/commands/mobile/delete_sub_menu_request.h"
+#include "application_manager/commands/mobile/delete_sub_menu_response.h"
+#include "application_manager/commands/mobile/dial_number_request.h"
+#include "application_manager/commands/mobile/end_audio_pass_thru_request.h"
+#include "application_manager/commands/mobile/end_audio_pass_thru_response.h"
+#include "application_manager/commands/mobile/generic_response.h"
+#include "application_manager/commands/mobile/get_dtcs_request.h"
+#include "application_manager/commands/mobile/get_dtcs_response.h"
+#include "application_manager/commands/mobile/get_vehicle_data_request.h"
+#include "application_manager/commands/mobile/get_vehicle_data_response.h"
+#include "application_manager/commands/mobile/list_files_request.h"
+#include "application_manager/commands/mobile/list_files_response.h"
+#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
+#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
+#include "application_manager/commands/mobile/on_button_event_notification.h"
+#include "application_manager/commands/mobile/on_button_press_notification.h"
+#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
+#include "application_manager/commands/mobile/on_hmi_status_notification.h"
+#include "application_manager/commands/mobile/on_language_change_notification.h"
+#include "application_manager/commands/mobile/on_command_notification.h"
+#include "application_manager/commands/mobile/on_permissions_change_notification.h"
+#include "application_manager/commands/mobile/on_tbt_client_state_notification.h"
+#include "application_manager/commands/mobile/on_vehicle_data_notification.h"
+#include "application_manager/commands/mobile/on_hash_change_notification.h"
+#include "application_manager/commands/mobile/perform_audio_pass_thru_request.h"
+#include "application_manager/commands/mobile/perform_audio_pass_thru_response.h"
+#include "application_manager/commands/mobile/perform_interaction_request.h"
+#include "application_manager/commands/mobile/perform_interaction_response.h"
+#include "application_manager/commands/mobile/put_file_request.h"
+#include "application_manager/commands/mobile/put_file_response.h"
+#include "application_manager/commands/mobile/read_did_request.h"
+#include "application_manager/commands/mobile/read_did_response.h"
+#include "application_manager/commands/mobile/register_app_interface_request.h"
+#include "application_manager/commands/mobile/register_app_interface_response.h"
+#include "application_manager/commands/mobile/reset_global_properties_request.h"
+#include "application_manager/commands/mobile/reset_global_properties_response.h"
+#include "application_manager/commands/mobile/scrollable_message_request.h"
+#include "application_manager/commands/mobile/scrollable_message_response.h"
+#include "application_manager/commands/mobile/set_display_layout_request.h"
+#include "application_manager/commands/mobile/set_display_layout_response.h"
+#include "application_manager/commands/mobile/set_global_properties_request.h"
+#include "application_manager/commands/mobile/set_global_properties_response.h"
+#include "application_manager/commands/mobile/set_icon_request.h"
+#include "application_manager/commands/mobile/set_icon_response.h"
+#include "application_manager/commands/mobile/set_media_clock_timer_request.h"
+#include "application_manager/commands/mobile/set_media_clock_timer_response.h"
+#include "application_manager/commands/mobile/show_constant_tbt_request.h"
+#include "application_manager/commands/mobile/show_constant_tbt_response.h"
+#include "application_manager/commands/mobile/show_request.h"
+#include "application_manager/commands/mobile/show_response.h"
+#include "application_manager/commands/mobile/slider_request.h"
+#include "application_manager/commands/mobile/slider_response.h"
+#include "application_manager/commands/mobile/speak_request.h"
+#include "application_manager/commands/mobile/speak_response.h"
+#include "application_manager/commands/mobile/subscribe_button_request.h"
+#include "application_manager/commands/mobile/subscribe_button_response.h"
+#include "application_manager/commands/mobile/subscribe_vehicle_data_request.h"
+#include "application_manager/commands/mobile/subscribe_vehicle_data_response.h"
+#include "application_manager/commands/mobile/unregister_app_interface_request.h"
+#include "application_manager/commands/mobile/unregister_app_interface_response.h"
+#include "application_manager/commands/mobile/unsubscribe_button_request.h"
+#include "application_manager/commands/mobile/unsubscribe_button_response.h"
+#include "application_manager/commands/mobile/unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
+#include "application_manager/commands/mobile/update_turn_list_request.h"
+#include "application_manager/commands/mobile/update_turn_list_response.h"
+#include "application_manager/commands/mobile/system_request.h"
+#include "application_manager/commands/mobile/system_response.h"
+#include "application_manager/commands/mobile/on_keyboard_input_notification.h"
+#include "application_manager/commands/mobile/on_touch_event_notification.h"
+#include "application_manager/commands/mobile/on_system_request_notification.h"
+#include "application_manager/commands/mobile/diagnostic_message_request.h"
+#include "application_manager/commands/mobile/diagnostic_message_response.h"
+#include "application_manager/commands/mobile/send_location_request.h"
+#include "application_manager/commands/mobile/send_location_response.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+commands::Command *MobileCommandFactory::CreateCommand(
+ const MessageSharedPtr& message) {
+
+ switch ((*message)[strings::params][strings::function_id].asInt()) {
+ case mobile_apis::FunctionID::RegisterAppInterfaceID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kRequest)) {
+ return new commands::RegisterAppInterfaceRequest(message);
+ } else {
+ return new commands::RegisterAppInterfaceResponse(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::UnregisterAppInterfaceID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kRequest)) {
+ return new commands::UnregisterAppInterfaceRequest(message);
+ } else {
+ return new commands::UnregisterAppInterfaceResponse(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SetGlobalPropertiesID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SetGlobalPropertiesResponse(message);
+ } else {
+ return new commands::SetGlobalPropertiesRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ResetGlobalPropertiesID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ResetGlobalPropertiesResponse(message);
+ } else {
+ return new commands::ResetGlobalPropertiesRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::AddCommandID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::AddCommandResponse(message);
+ } else {
+ return new commands::AddCommandRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::DeleteCommandID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::DeleteCommandResponse(message);
+ } else {
+ return new commands::DeleteCommandRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::AddSubMenuID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::AddSubMenuResponse(message);
+ } else {
+ return new commands::AddSubMenuRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::DeleteSubMenuID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::DeleteSubMenuResponse(message);
+ } else {
+ return new commands::DeleteSubMenuRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return
+ new commands::DeleteInteractionChoiceSetResponse(message);
+ } else {
+ return new commands::DeleteInteractionChoiceSetRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::AlertID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::AlertResponse(message);
+ } else {
+ return new commands::AlertRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SpeakID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SpeakResponse(message);
+ } else {
+ return new commands::SpeakRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SliderID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SliderResponse(message);
+ } else {
+ return new commands::SliderRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::PerformAudioPassThruID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::PerformAudioPassThruResponse(message);
+ } else {
+ return new commands::PerformAudioPassThruRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::CreateInteractionChoiceSetID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return
+ new commands::CreateInteractionChoiceSetResponse(message);
+ } else {
+ return new commands::CreateInteractionChoiceSetRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::PerformInteractionID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::PerformInteractionResponse(message);
+ } else {
+ return new commands::PerformInteractionRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::EndAudioPassThruID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::EndAudioPassThruResponse(message);
+ } else {
+ return new commands::EndAudioPassThruRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::PutFileID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::PutFileResponse(message);
+ } else {
+ return new commands::PutFileRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::DeleteFileID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::DeleteFileResponse(message);
+ } else {
+ return new commands::DeleteFileRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ListFilesID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ListFilesResponse(message);
+ } else {
+ return new commands::ListFilesRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SubscribeButtonID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SubscribeButtonResponse(message);
+ } else {
+ return new commands::SubscribeButtonRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::UnsubscribeButtonID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::UnsubscribeButtonResponse(message);
+ } else {
+ return new commands::UnsubscribeButtonRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ShowConstantTBTID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ShowConstantTBTResponse(message);
+ } else {
+ return new commands::ShowConstantTBTRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ShowID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ShowResponse(message);
+ } else {
+ return new commands::ShowRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SubscribeVehicleDataID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SubscribeVehicleDataResponse(message);
+ } else {
+ return new commands::SubscribeVehicleDataRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::UnsubscribeVehicleDataID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::UnsubscribeVehicleDataResponse(message);
+ } else {
+ return new commands::UnsubscribeVehicleDataRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ReadDIDID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ReadDIDResponse(message);
+ } else {
+ return new commands::ReadDIDRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::GetVehicleDataID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::GetVehicleDataResponse(message);
+ } else {
+ return new commands::GetVehicleDataRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ScrollableMessageID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ScrollableMessageResponse(message);
+ } else {
+ return new commands::ScrollableMessageRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::AlertManeuverID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::AlertManeuverResponse(message);
+ } else {
+ return new commands::AlertManeuverRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SetAppIconID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SetIconResponse(message);
+ } else {
+ return new commands::SetIconRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SetDisplayLayoutID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SetDisplayLayoutResponse(message);
+ } else {
+ return new commands::SetDisplayLayoutRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::UpdateTurnListID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::UpdateTurnListResponse(message);
+ } else {
+ return new commands::UpdateTurnListRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::ChangeRegistrationID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::ChangeRegistrationResponse(message);
+ } else {
+ return new commands::ChangeRegistrationRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::GetDTCsID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::GetDTCsResponse(message);
+ } else {
+ return new commands::GetDTCsRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::DiagnosticMessageID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::DiagnosticMessageResponse(message);
+ } else {
+ return new commands::DiagnosticMessageRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SetMediaClockTimerID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SetMediaClockTimerResponse(message);
+ } else {
+ return new commands::SetMediaClockRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SystemRequestID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SystemResponse(message);
+ } else {
+ return new commands::SystemRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::SendLocationID: {
+ if ((*message)[strings::params][strings::message_type]
+ == static_cast<int>(application_manager::MessageType::kResponse)) {
+ return new commands::SendLocationResponse(message);
+ } else {
+ return new commands::SendLocationRequest(message);
+ }
+ break;
+ }
+ case mobile_apis::FunctionID::OnButtonEventID: {
+ return new commands::mobile::OnButtonEventNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnButtonPressID: {
+ return new commands::mobile::OnButtonPressNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnAudioPassThruID: {
+ return new commands::OnAudioPassThruNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnVehicleDataID: {
+ return new commands::OnVehicleDataNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: {
+ return
+ new commands::OnAppInterfaceUnregisteredNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnCommandID: {
+ return new commands::OnCommandNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnTBTClientStateID: {
+ return new commands::OnTBTClientStateNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnDriverDistractionID: {
+ return
+ new commands::mobile::OnDriverDistractionNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnLanguageChangeID: {
+ return new commands::OnLanguageChangeNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnPermissionsChangeID: {
+ return new commands::OnPermissionsChangeNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnHMIStatusID: {
+ return new commands::OnHMIStatusNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnKeyboardInputID: {
+ return new commands::mobile::OnKeyBoardInputNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnTouchEventID: {
+ return new commands::mobile::OnTouchEventNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnSystemRequestID: {
+ return new commands::mobile::OnSystemRequestNotification(message);
+ break;
+ }
+ case mobile_apis::FunctionID::OnHashChangeID: {
+ return new commands::mobile::OnHashChangeNotification(message);
+ break;
+ }
+ default: {
+ (*message)[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::GenericResponseID);
+ return new commands::GenericResponse(message);
+ }
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
new file mode 100644
index 0000000000..e2293e3816
--- /dev/null
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string.h>
+
+#include "utils/macro.h"
+#include "application_manager/mobile_message_handler.h"
+#include "protocol_handler/protocol_payload.h"
+#include "protocol_handler/protocol_packet.h"
+#include "utils/bitstream.h"
+#include "utils/logger.h"
+
+#include <stdint.h>
+#include <memory>
+
+namespace {
+const uint8_t kRequest = 0x0;
+const uint8_t kResponse = 0x1;
+const uint8_t kNotification = 0x2;
+const uint8_t kUnknown = 0xF;
+}
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "MobileMessageHandler")
+
+
+application_manager::Message*
+MobileMessageHandler::HandleIncomingMessageProtocolV1(
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger_,
+ "MobileMessageHandler HandleIncomingMessageProtocolV1()");
+ application_manager::Message* outgoing_message =
+ new application_manager::Message(
+ protocol_handler::MessagePriority::FromServiceType(
+ message->service_type())
+ );
+ if (!message) {
+ NOTREACHED();
+ return NULL;
+ }
+
+ outgoing_message->set_connection_key(message->connection_key());
+ outgoing_message->set_protocol_version(
+ static_cast<application_manager::ProtocolVersion>(message
+ ->protocol_version()));
+ outgoing_message->set_json_message(
+ std::string(reinterpret_cast<const char*>(message->data()),
+ message->data_size()));
+
+ if (outgoing_message->json_message().empty()) {
+ return NULL;
+ }
+
+ return outgoing_message;
+}
+
+application_manager::Message*
+MobileMessageHandler::HandleIncomingMessageProtocolV2(
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger_,
+ "MobileMessageHandler HandleIncomingMessageProtocolV2()");
+
+ utils::BitStream message_bytestream(message->data(), message->data_size());
+ protocol_handler::ProtocolPayloadV2 payload;
+ protocol_handler::Extract(&message_bytestream, &payload,
+ message->data_size());
+
+ // Silently drop message if it wasn't parsed correctly
+ if (message_bytestream.IsBad()) {
+ LOG4CXX_WARN(logger_,
+ "Drop ill-formed message from mobile, partially parsed: "
+ << payload);
+ return NULL;
+ }
+
+ std::auto_ptr<application_manager::Message> outgoing_message(
+ new application_manager::Message(
+ protocol_handler::MessagePriority::FromServiceType(
+ message->service_type())));
+
+ outgoing_message->set_json_message(payload.json);
+ outgoing_message->set_function_id(payload.header.rpc_function_id);
+ outgoing_message->set_message_type(
+ MessageTypeFromRpcType(payload.header.rpc_type));
+ outgoing_message->set_correlation_id(int32_t(payload.header.corellation_id));
+ outgoing_message->set_connection_key(message->connection_key());
+ outgoing_message->set_protocol_version(
+ static_cast<application_manager::ProtocolVersion>(message
+ ->protocol_version()));
+ outgoing_message->set_data_size(message->data_size());
+ outgoing_message->set_payload_size(message->payload_size());
+
+ if (!payload.data.empty()) {
+ outgoing_message->set_binary_data(
+ new application_manager::BinaryData(payload.data));
+ }
+ return outgoing_message.release();
+}
+
+protocol_handler::RawMessage*
+MobileMessageHandler::HandleOutgoingMessageProtocolV1(
+ const MobileMessage& message) {
+ LOG4CXX_INFO(logger_,
+ "MobileMessageHandler HandleOutgoingMessageProtocolV1()");
+ std::string messageString = message->json_message();
+ if (messageString.length() == 0) {
+ LOG4CXX_INFO(logger_,
+ "Drop ill-formed message from mobile");
+ return NULL;
+ }
+
+ uint8_t* rawMessage = new uint8_t[messageString.length() + 1];
+ memcpy(rawMessage, messageString.c_str(), messageString.length() + 1);
+
+ protocol_handler::RawMessage* result = new protocol_handler::RawMessage(
+ message->connection_key(), 1, rawMessage, messageString.length() + 1);
+
+ return result;
+}
+
+protocol_handler::RawMessage*
+MobileMessageHandler::HandleOutgoingMessageProtocolV2(
+ const MobileMessage& message) {
+ LOG4CXX_INFO(logger_,
+ "MobileMessageHandler HandleOutgoingMessageProtocolV2()");
+ if (message->json_message().length() == 0) {
+ LOG4CXX_ERROR(logger_, "json string is empty.");
+ }
+ uint32_t jsonSize = message->json_message().length();
+ uint32_t binarySize = 0;
+ if (message->has_binary_data()) {
+ binarySize = message->binary_data()->size();
+ }
+
+ const size_t dataForSendingSize =
+ protocol_handler::PROTOCOL_HEADER_V2_SIZE + jsonSize + binarySize;
+ uint8_t* dataForSending = new uint8_t[dataForSendingSize];
+ uint8_t offset = 0;
+
+ uint8_t rpcTypeFlag = 0;
+ switch (message->type()) {
+ case application_manager::kRequest:
+ rpcTypeFlag = kRequest;
+ break;
+ case application_manager::kResponse:
+ rpcTypeFlag = kResponse;
+ break;
+ case application_manager::kNotification:
+ rpcTypeFlag = kNotification;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+
+ uint32_t functionId = message->function_id();
+ dataForSending[offset++] = ((rpcTypeFlag << 4) & 0xF0) | (functionId >> 24);
+ dataForSending[offset++] = functionId >> 16;
+ dataForSending[offset++] = functionId >> 8;
+ dataForSending[offset++] = functionId;
+
+ uint32_t correlationId = message->correlation_id();
+ dataForSending[offset++] = correlationId >> 24;
+ dataForSending[offset++] = correlationId >> 16;
+ dataForSending[offset++] = correlationId >> 8;
+ dataForSending[offset++] = correlationId;
+
+ dataForSending[offset++] = jsonSize >> 24;
+ dataForSending[offset++] = jsonSize >> 16;
+ dataForSending[offset++] = jsonSize >> 8;
+ dataForSending[offset++] = jsonSize;
+
+ memcpy(dataForSending + offset, message->json_message().c_str(), jsonSize);
+
+ if (message->has_binary_data()) {
+ const std::vector<uint8_t>& binaryData = *(message->binary_data());
+ uint8_t* currentPointer = dataForSending + offset + jsonSize;
+ for (uint32_t i = 0; i < binarySize; ++i) {
+ currentPointer[i] = binaryData[i];
+ }
+ }
+
+ protocol_handler::RawMessage* msgToProtocolHandler =
+ new protocol_handler::RawMessage(message->connection_key(),
+ message->protocol_version(),
+ dataForSending,
+ dataForSendingSize);
+
+ return msgToProtocolHandler;
+}
+} // namespace application_manager
diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc
new file mode 100644
index 0000000000..e7b259e6b5
--- /dev/null
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -0,0 +1,104 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/policies/policy_event_observer.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/date_time.h"
+#include "policy/policy_manager.h"
+#include "smart_objects/smart_object.h"
+
+namespace policy {
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+using namespace application_manager;
+
+PolicyEventObserver::PolicyEventObserver(utils::SharedPtr<PolicyManager> policy_manager)
+ : policy_manager_(policy_manager) {
+}
+
+void PolicyEventObserver::on_event(const event_engine::Event& event) {
+ if (policy_manager_.valid()) {
+ return;
+ }
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+#ifdef HMI_DBUS_API
+ case hmi_apis::FunctionID::VehicleInfo_GetOdometer: {
+ ProcessOdometerEvent(message);
+ break;
+ }
+ default: {
+ break;
+ }
+ unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer);
+#else
+ case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
+ ProcessOdometerEvent(message);
+ unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ break;
+ }
+ case hmi_apis::FunctionID::BasicCommunication_OnReady: {
+ policy_manager_->OnSystemReady();
+ unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
+ break;
+ }
+ default: {
+ break;
+ }
+#endif
+ }
+}
+
+void PolicyEventObserver::ProcessOdometerEvent(const smart_objects::SmartObject& message) {
+ if (hmi_apis::Common_Result::SUCCESS
+ == static_cast<hmi_apis::Common_Result::eType>(message[strings::params][hmi_response::code]
+ .asInt())) {
+
+ if (message[strings::msg_params].keyExists(strings::odometer)) {
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+
+ if(policy_manager_) {
+ policy_manager_->PTUpdatedAt(
+ message[strings::msg_params][strings::odometer].asInt(),
+ days_after_epoch);
+ }
+ }
+ }
+}
+
+void PolicyEventObserver::subscribe_on_event(
+ const event_engine::Event::EventID& event_id, int32_t hmi_correlation_id) {
+ event_engine::EventObserver::subscribe_on_event(event_id, hmi_correlation_id);
+}
+} // namespace policy
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
new file mode 100644
index 0000000000..ea1045247a
--- /dev/null
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -0,0 +1,1319 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include <dlfcn.h>
+#include <algorithm>
+#include <vector>
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/pt_exchange_handler_impl.h"
+#include "application_manager/policies/pt_exchange_handler_ext.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/message_helper.h"
+#include "policy/policy_manager_impl.h"
+#include "connection_handler/connection_handler.h"
+#include "utils/macro.h"
+#include "utils/date_time.h"
+#include "json/value.h"
+#include "json/writer.h"
+#include "config_profile/profile.h"
+#include "application_manager/usage_statistics.h"
+#include "policy/policy_types.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace policy {
+
+#define POLICY_LIB_CHECK(return_value) {\
+ if (!policy_manager_) {\
+ LOG4CXX_WARN(logger_, "The shared library of policy is not loaded");\
+ return return_value;\
+ }\
+}
+
+#define POLICY_LIB_CHECK_VOID() {\
+ if (!policy_manager_) {\
+ LOG4CXX_WARN(logger_, "The shared library of policy is not loaded");\
+ return;\
+ }\
+}
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+
+typedef std::set<application_manager::ApplicationSharedPtr> ApplicationList;
+
+struct DeactivateApplication {
+ explicit DeactivateApplication(
+ const connection_handler::DeviceHandle& device_id)
+ : device_id_(device_id) {}
+
+ void operator()(const application_manager::ApplicationSharedPtr& app) {
+ if (device_id_ == app->device()) {
+ app->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
+ application_manager::MessageHelper::SendActivateAppToHMI(
+ app->app_id(), hmi_apis::Common_HMILevel::NONE);
+ }
+ }
+
+ private:
+ connection_handler::DeviceHandle device_id_;
+};
+
+struct SDLAlowedNotification {
+ explicit SDLAlowedNotification(
+ const connection_handler::DeviceHandle& device_id,
+ utils::SharedPtr<PolicyManager> policy_manager)
+ : device_id_(device_id),
+ policy_manager_(policy_manager){}
+
+ void operator()(const application_manager::ApplicationSharedPtr& app) {
+ if (!policy_manager_) {
+ return;
+ }
+ if (device_id_ == app->device()) {
+ std::string hmi_level;
+ hmi_apis::Common_HMILevel::eType default_hmi;
+ mobile_apis::HMILevel::eType default_mobile_hmi;
+ policy_manager_->GetDefaultHmi(app->mobile_app_id()->asString(), &hmi_level);
+ if ("BACKGROUND" == hmi_level) {
+ default_hmi = hmi_apis::Common_HMILevel::BACKGROUND;
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == hmi_level) {
+ default_hmi = hmi_apis::Common_HMILevel::FULL;
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL;
+ } else if ("LIMITED" == hmi_level) {
+ default_hmi = hmi_apis::Common_HMILevel::LIMITED;
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED;
+ } else if ("NONE" == hmi_level) {
+ default_hmi = hmi_apis::Common_HMILevel::NONE;
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE;
+ } else {
+ return ;
+ }
+ if (app->hmi_level() == default_mobile_hmi) {
+ LOG4CXX_INFO(logger_, "Application already in default hmi state.");
+ } else {
+ app->set_hmi_level(default_mobile_hmi);
+ application_manager::MessageHelper::SendHMIStatusNotification(*app);
+ }
+ application_manager::MessageHelper::SendActivateAppToHMI(app->app_id(), default_hmi);
+ }
+ }
+ private:
+ connection_handler::DeviceHandle device_id_;
+ utils::SharedPtr<PolicyManager> policy_manager_;
+};
+
+struct LinkAppToDevice {
+ explicit LinkAppToDevice(
+ std::map<std::string, std::string>& app_to_device_link)
+ : app_to_device_link_(app_to_device_link) {
+ app_to_device_link_.clear();
+ }
+
+ void operator()(const application_manager::ApplicationSharedPtr& app) {
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Invalid pointer to application was passed."
+ "Skip current application.");
+ return;
+ }
+ DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForApp(
+ app->app_id(),
+ &device_params);
+ const std::string app_id = app->mobile_app_id()->asString();
+ if (device_params.device_mac_address.empty()) {
+ LOG4CXX_WARN(logger_, "Couldn't find device, which hosts application "
+ << app_id);
+ return;
+ }
+ app_to_device_link_[app_id] = device_params.device_mac_address;
+ }
+
+private:
+ std::map<std::string, std::string>& app_to_device_link_;
+};
+
+struct PermissionsConsolidator {
+ void Consolidate(
+ const std::vector<policy::FunctionalGroupPermission>& permissions) {
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permissions.begin();
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it_end =
+ permissions.end();
+ for (;it != it_end; ++it) {
+ std::vector<policy::FunctionalGroupPermission>::iterator it_consolidated =
+ std::find(consolidated_permissions_.begin(),
+ consolidated_permissions_.end(),
+ *it);
+
+ // If found, consolidate states
+ if (consolidated_permissions_.end() != it_consolidated) {
+ if (policy::kGroupAllowed == it->state ||
+ policy::kGroupAllowed == it_consolidated->state) {
+ it_consolidated->state = policy::kGroupAllowed;
+ } else if (policy::kGroupDisallowed == it->state ||
+ policy::kGroupDisallowed == it_consolidated->state) {
+ it_consolidated->state = policy::kGroupDisallowed;
+ }
+ continue;
+ }
+
+ // If not found, add permissions
+ consolidated_permissions_.push_back(*it);
+ }
+ }
+
+ const std::vector<policy::FunctionalGroupPermission>&
+ GetConsolidatedPermissions() const {
+ return consolidated_permissions_;
+ }
+
+private:
+ std::vector<policy::FunctionalGroupPermission> consolidated_permissions_;
+};
+
+PolicyHandler* PolicyHandler::instance_ = NULL;
+const std::string PolicyHandler::kLibrary = "libPolicy.so";
+
+PolicyHandler::PolicyHandler()
+ : dl_handle_(0),
+// EXTENDED_POLICY
+ exchange_handler_(new PTExchangeHandlerImpl(this)),
+ on_ignition_check_done_(false),
+ last_activated_app_id_(0),
+ registration_in_progress(false),
+ is_user_requested_policy_table_update_(false) {
+}
+
+PolicyHandler::~PolicyHandler() {
+
+}
+
+bool PolicyHandler::LoadPolicyLibrary() {
+ if (!PolicyEnabled()) {
+ LOG4CXX_WARN(logger_, "System is configured to work without policy "
+ "functionality.");
+ policy_manager_ = NULL;
+ return NULL;
+ }
+ dl_handle_ = dlopen(kLibrary.c_str(), RTLD_LAZY);
+
+ char* error_string = dlerror();
+ if (error_string == NULL) {
+ if (CreateManager()) {
+ policy_manager_->set_listener(this);
+ event_observer_= new PolicyEventObserver(policy_manager_);
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, error_string);
+ }
+
+ return policy_manager_.valid();
+}
+
+bool PolicyHandler::PolicyEnabled() {
+ return profile::Profile::instance()->enable_policy();
+}
+
+bool PolicyHandler::CreateManager() {
+ typedef PolicyManager* (*CreateManager)();
+ CreateManager create_manager = reinterpret_cast<CreateManager>(dlsym(dl_handle_, "CreateManager"));
+ char* error_string = dlerror();
+ if (error_string == NULL) {
+ policy_manager_ = create_manager();
+ } else {
+ LOG4CXX_WARN(logger_, error_string);
+ }
+ return policy_manager_;
+}
+
+bool PolicyHandler::InitPolicyTable() {
+ LOG4CXX_TRACE(logger_, "Init policy table from preloaded.");
+ POLICY_LIB_CHECK(false);
+ // Subscribing to notification for system readiness to be able to get system
+ // info necessary for policy table
+ event_observer_.get()->subscribe_on_event(
+ hmi_apis::FunctionID::BasicCommunication_OnReady);
+ std::string preloaded_file =
+ profile::Profile::instance()->preloaded_pt_file();
+ return policy_manager_->InitPT(preloaded_file);
+}
+
+bool PolicyHandler::ResetPolicyTable() {
+ LOG4CXX_TRACE(logger_, "Reset policy table.");
+ POLICY_LIB_CHECK(false);
+ std::string preloaded_file =
+ profile::Profile::instance()->preloaded_pt_file();
+ return policy_manager_->ResetPT(preloaded_file);
+}
+
+bool PolicyHandler::ClearUserConsent() {
+ LOG4CXX_INFO(logger_, "Removing user consent records in policy table.");
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->ResetUserConsent();
+}
+
+uint32_t PolicyHandler::GetAppIdForSending() {
+ // Get app.list
+ application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const ApplicationList app_list = accessor.applications();
+
+ if (app_list.empty()) {
+ return 0;
+ }
+
+ // Choose application
+ uint32_t selected_app_id = 0;
+ AppIds app_ids_last_resort;
+ AppIds app_ids_preferred;
+
+ ApplicationList::const_iterator it_app_list = app_list.begin();
+ ApplicationList::const_iterator it_app_list_end = app_list.end();
+ for (; it_app_list != it_app_list_end; ++it_app_list) {
+ switch ((*it_app_list)->hmi_level()) {
+ case mobile_apis::HMILevel::HMI_NONE:
+ app_ids_last_resort.push_back((*it_app_list)->app_id());
+ break;
+ default:
+ app_ids_preferred.push_back((*it_app_list)->app_id());
+ break;
+ }
+ }
+
+ AppIds& app_ids_to_use =
+ app_ids_preferred.empty() ? app_ids_last_resort : app_ids_preferred;
+
+ // Checking, if some of currently known apps was not used already
+ std::sort(last_used_app_ids_.begin(), last_used_app_ids_.end());
+ std::sort(app_ids_to_use.begin(), app_ids_to_use.end());
+
+ bool is_all_used = std::includes(last_used_app_ids_.begin(),
+ last_used_app_ids_.end(),
+ app_ids_to_use.begin(),
+ app_ids_to_use.end());
+
+ if (is_all_used) {
+ last_used_app_ids_.clear();
+ }
+
+ // Leave only unused apps
+ AppIds::iterator it_apps_to_use = app_ids_to_use.begin();
+ AppIds::iterator it_apps_to_use_end = app_ids_to_use.end();
+
+ AppIds::const_iterator it_last_used_app_ids = last_used_app_ids_.begin();
+ AppIds::const_iterator it_last_used_app_ids_end = last_used_app_ids_.end();
+
+ for (; it_last_used_app_ids != it_last_used_app_ids_end;
+ ++it_last_used_app_ids) {
+
+ std::remove(it_apps_to_use, it_apps_to_use_end, *it_last_used_app_ids);
+ }
+
+ // Random selection of filtered apps
+ std::srand(time(0));
+ selected_app_id =
+ *(app_ids_to_use.begin() + (rand() % app_ids_to_use.size()));
+
+ last_used_app_ids_.push_back(selected_app_id);
+ return selected_app_id;
+}
+
+DeviceConsent PolicyHandler::GetDeviceForSending(DeviceParams& device_params) {
+ POLICY_LIB_CHECK(kDeviceDisallowed);
+ uint32_t app_id = 0;
+ uint32_t app_id_previous = 0;
+ while (true) {
+ app_id = GetAppIdForSending();
+ if (!app_id) {
+ LOG4CXX_WARN(logger_,
+ "There is no appropriate application for sending PTS.");
+ return kDeviceDisallowed;
+ }
+
+ // If only one application is available, return its device params
+ if (app_id == app_id_previous) {
+ return kDeviceDisallowed;
+ }
+
+ app_id_previous = app_id;
+ application_manager::MessageHelper::GetDeviceInfoForApp(app_id,
+ &device_params);
+
+ DeviceConsent consent = policy_manager_->GetUserConsentForDevice(
+ device_params.device_mac_address);
+ switch (consent) {
+ case kDeviceAllowed:
+ return consent;
+ case kDeviceDisallowed:
+ continue;
+ case kDeviceHasNoConsent:
+ return consent;
+ default:
+ LOG4CXX_WARN(logger_, "Consent result is not impelemented.");
+ return consent;
+ }
+ }
+ return kDeviceDisallowed;
+}
+
+const std::string PolicyHandler::ConvertUpdateStatus(PolicyTableStatus status) {
+ switch (status) {
+ case policy::StatusUpdatePending:
+ return "UPDATING";
+ case policy::StatusUpdateRequired:
+ return "UPDATE_NEEDED";
+ case policy::StatusUpToDate:
+ return "UP_TO_DATE";
+ default: {
+ return "UNKNOWN";
+ }
+ }
+}
+
+void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
+ bool is_allowed) {
+ POLICY_LIB_CHECK_VOID();
+ connection_handler::DeviceHandle device_handle;
+ application_manager::ApplicationManagerImpl::instance()->connection_handler()
+ ->GetDeviceID(device_id, &device_handle);
+ // In case of changed consent for device, related applications will be
+ // limited to pre_DataConsent permissions, if device disallowed, or switch
+ // back to their own permissions, if device allowed again, and must be
+ // notified about these changes
+
+ application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
+ ApplicationList app_list = accessor.applications();
+ ApplicationList::const_iterator it_app_list = app_list.begin();
+ ApplicationList::const_iterator it_app_list_end = app_list.end();
+ for (; it_app_list != it_app_list_end; ++it_app_list) {
+ if (device_handle == (*it_app_list).get()->device()) {
+
+ const std::string policy_app_id =
+ (*it_app_list)->mobile_app_id()->asString();
+
+ // If app has predata policy, which is assigned without device consent or
+ // with negative data consent, there no necessity to change smth and send
+ // notification for such app in case of device consent is not allowed
+ if (policy_manager_->IsPredataPolicy(policy_app_id) &&
+ !is_allowed) {
+ continue;
+ }
+
+ policy_manager_->ReactOnUserDevConsentForApp(policy_app_id,
+ is_allowed);
+
+ policy_manager_->SendNotificationOnPermissionsUpdated(policy_app_id);
+ }
+ }
+}
+
+void PolicyHandler::AddApplication(const std::string& application_id) {
+ // TODO (AGaliuzov): remove this workaround during refactoring.
+ registration_in_progress = true;
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->AddApplication(application_id);
+}
+
+void PolicyHandler::SetDeviceInfo(std::string& device_id,
+ const DeviceInfo& device_info) {
+ LOG4CXX_INFO(logger_, "SetDeviceInfo");
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->SetDeviceInfo(device_id, device_info);
+}
+
+void PolicyHandler::OnAppPermissionConsent(const uint32_t connection_key,
+ PermissionConsent &permissions) {
+ LOG4CXX_INFO(logger_, "OnAppPermissionConsent");
+ POLICY_LIB_CHECK_VOID();
+ if (connection_key) {
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application(connection_key);
+
+ if (app.valid()) {
+ permissions.policy_app_id = app->mobile_app_id()->asString();
+ policy::DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForHandle(
+ app->device(),
+ &device_params);
+
+ permissions.device_id = device_params.device_mac_address;
+ }
+
+ if (!permissions.policy_app_id.empty()) {
+ policy_manager_->SetUserConsentForApp(permissions);
+ }
+
+ return;
+ }
+
+ if (!app_to_device_link_.size()) {
+ LOG4CXX_WARN(logger_, "There are no applications previously stored for "
+ "setting common permissions.");
+ return;
+ }
+
+ std::map<std::string, std::string>::const_iterator it =
+ app_to_device_link_.begin();
+ std::map<std::string, std::string>::const_iterator it_end =
+ app_to_device_link_.end();
+ for (;it != it_end; ++it) {
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()->
+ application_by_policy_id(it->first);
+
+ // If list of apps sent to HMI for user consents is not the same as current,
+ // permissions should be set only for coincident to registered apps
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Invalid pointer to application was passed."
+ "Permissions setting skipped.");
+ continue;
+ }
+
+ policy::DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForHandle(
+ app->device(),
+ &device_params);
+
+ if (device_params.device_mac_address != it->second) {
+ LOG4CXX_WARN(logger_, "Device_id of application is changed."
+ "Permissions setting skipped.");
+ continue;
+ }
+
+ permissions.policy_app_id = it->first;
+ permissions.device_id = it->second;
+ policy_manager_->SetUserConsentForApp(permissions);
+ }
+}
+
+void PolicyHandler::OnGetUserFriendlyMessage(
+ const std::vector<std::string>& message_codes, const std::string& language,
+ uint32_t correlation_id) {
+ LOG4CXX_INFO(logger_, "OnGetUserFriendlyMessage");
+ POLICY_LIB_CHECK_VOID();
+ std::vector<UserFriendlyMessage> result = policy_manager_
+ ->GetUserFriendlyMessages(message_codes, language);
+ // Send response to HMI with gathered data
+ application_manager::MessageHelper::SendGetUserFriendlyMessageResponse(
+ result, correlation_id);
+}
+
+void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
+ const uint32_t correlation_id) {
+ LOG4CXX_INFO(logger_, "OnGetListOfPermissions");
+ POLICY_LIB_CHECK_VOID();
+ // If no specific app was passed, get permissions for all currently registered
+ // applications
+ if (!connection_key) {
+ LinkAppToDevice linker(app_to_device_link_);
+ application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const ApplicationList app_list = accessor.applications();
+ std::set<application_manager::ApplicationSharedPtr>::const_iterator it_app =
+ app_list.begin();
+ std::set<application_manager::ApplicationSharedPtr>::const_iterator
+ it_app_end = app_list.end();
+
+ // Add all currently registered applications
+ std::for_each(it_app, it_app_end, linker);
+
+ PermissionsConsolidator consolidator;
+ std::vector<policy::FunctionalGroupPermission> group_permissions;
+ std::map<std::string, std::string>::const_iterator it =
+ app_to_device_link_.begin();
+ for (;it != app_to_device_link_.end(); ++it) {
+ policy_manager_->GetUserConsentForApp(it->second, it->first,
+ group_permissions);
+ consolidator.Consolidate(group_permissions);
+ }
+
+ application_manager::MessageHelper::SendGetListOfPermissionsResponse(
+ consolidator.GetConsolidatedPermissions(), correlation_id);
+
+ return;
+ }
+
+ // Single app only
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()->application(
+ connection_key);
+
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Connection key '" << connection_key << "' "
+ "not found within registered applications.");
+ return;
+ }
+
+ DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForApp(connection_key,
+ &device_params);
+ std::vector<FunctionalGroupPermission> group_permissions;
+ if (device_params.device_mac_address.empty()) {
+ LOG4CXX_WARN(logger_, "Couldn't find device, which hosts application.");
+ } else if (!app) {
+ LOG4CXX_WARN(logger_, "Couldn't find application to get permissions.");
+ } else {
+ policy_manager_->GetUserConsentForApp(device_params.device_mac_address,
+ app->mobile_app_id()->asString(),
+ group_permissions);
+
+ application_manager::MessageHelper::SendGetListOfPermissionsResponse(
+ group_permissions, correlation_id);
+ }
+}
+
+void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) {
+ LOG4CXX_INFO(logger_, "OnGetStatusUpdate");
+ POLICY_LIB_CHECK_VOID();
+ policy::PolicyTableStatus status = policy_manager_->GetPolicyTableStatus();
+ application_manager::MessageHelper::SendGetStatusUpdateResponse(
+ ConvertUpdateStatus(status), correlation_id);
+}
+
+void PolicyHandler::OnUpdateStatusChanged(PolicyTableStatus status) {
+ LOG4CXX_INFO(logger_, "OnUpdateStatusChanged");
+ application_manager::MessageHelper::SendOnStatusUpdate(
+ ConvertUpdateStatus(status));
+}
+
+std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired(
+ const std::string& policy_app_id) {
+ LOG4CXX_INFO(logger_, "OnCurrentDeviceIdUpdateRequired");
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
+
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Application with id '" << policy_app_id << "' "
+ "not found within registered applications.");
+ return "";
+ }
+ DeviceParams device_param;
+ application_manager::MessageHelper::GetDeviceInfoForApp(app->app_id(),
+ &device_param);
+ return device_param.device_mac_address;
+}
+
+void PolicyHandler::OnSystemInfoChanged(const std::string& language) {
+ LOG4CXX_INFO(logger_, "OnSystemInfoChanged");
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->SetSystemLanguage(language);
+}
+
+void PolicyHandler::OnGetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) {
+ LOG4CXX_INFO(logger_, "OnGetSystemInfo");
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->SetSystemInfo(ccpu_version, wers_country_code, language);
+}
+
+void PolicyHandler::OnSystemInfoUpdateRequired() {
+ LOG4CXX_INFO(logger_, "OnSystemInfoUpdateRequired");
+ POLICY_LIB_CHECK_VOID();
+ application_manager::MessageHelper::SendGetSystemInfoRequest();
+}
+
+void PolicyHandler::OnVIIsReady() {
+ const uint32_t correlation_id = application_manager::
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+
+ std::vector<std::string> params;
+ params.push_back(application_manager::strings::vin);
+
+ application_manager::MessageHelper::CreateGetVehicleDataRequest(
+ correlation_id, params);
+
+}
+
+void PolicyHandler::OnVehicleDataUpdated(
+ const smart_objects::SmartObject& message) {
+ POLICY_LIB_CHECK_VOID();
+}
+
+void PolicyHandler::OnAppRevoked(const std::string& policy_app_id) {
+ LOG4CXX_TRACE(logger_, "OnAppRevoked with policy_app_id " << policy_app_id << " is revoked.");
+ POLICY_LIB_CHECK_VOID();
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
+ if (app.valid()) {
+ DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForApp(app->app_id(),
+ &device_params);
+ AppPermissions permissions = policy_manager_->GetAppPermissionsChanges(
+ device_params.device_mac_address,
+ policy_app_id);
+ permissions.appRevoked = true;
+ application_manager::MessageHelper::SendOnAppPermissionsChangedNotification(
+ app->app_id(), permissions);
+ application_manager::MessageHelper::
+ SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
+
+ application_manager::ApplicationManagerImpl::instance()->
+ UnregisterRevokedApplication(app->app_id(),
+ mobile_apis::Result::INVALID_ENUM);
+ app->set_hmi_level(mobile_apis::HMILevel::HMI_NONE);
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ return;
+ }
+}
+
+void PolicyHandler::OnPendingPermissionChange(
+ const std::string& policy_app_id) {
+ LOG4CXX_INFO(logger_, "PolicyHandler::OnPendingPermissionChange for "
+ << policy_app_id);
+ POLICY_LIB_CHECK_VOID();
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_,
+ "No app found for " << policy_app_id << " policy app id.");
+ return;
+ }
+
+ DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForApp(app->app_id(),
+ &device_params);
+ AppPermissions permissions = policy_manager_->GetAppPermissionsChanges(
+ device_params.device_mac_address,
+ policy_app_id);
+
+ mobile_apis::HMILevel::eType app_hmi_level = app->hmi_level();
+
+ switch (app_hmi_level) {
+ case mobile_apis::HMILevel::HMI_FULL:
+ case mobile_apis::HMILevel::HMI_LIMITED: {
+ if (permissions.appPermissionsConsentNeeded) {
+ application_manager::MessageHelper::
+ SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
+
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ }
+ break;
+ }
+ case mobile_apis::HMILevel::HMI_BACKGROUND: {
+ if (permissions.isAppPermissionsRevoked) {
+ application_manager::MessageHelper::
+ SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
+
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (permissions.appUnauthorized) {
+ if (mobile_apis::HMILevel::HMI_FULL == app_hmi_level ||
+ mobile_apis::HMILevel::HMI_LIMITED == app_hmi_level) {
+ application_manager::MessageHelper::
+ SendOnAppPermissionsChangedNotification(app->app_id(), permissions);
+ }
+ application_manager::MessageHelper::
+ SendOnAppInterfaceUnregisteredNotificationToMobile(
+ app->app_id(),
+ mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
+
+ application_manager::ApplicationManagerImpl::instance()->
+ UnregisterRevokedApplication(app->app_id(),
+ mobile_apis::Result::INVALID_ENUM);
+
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ }
+}
+
+bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string) {
+ LOG4CXX_INFO(logger_, "PolicyHandler::SendMessageToSDK");
+ POLICY_LIB_CHECK(false);
+
+ std::string url;
+ uint32_t app_id = last_used_app_ids_.back();
+
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application(app_id);
+
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "There is no registered application with "
+ "connection key '" << app_id << "'");
+ return false;
+ }
+
+ const std::string& mobile_app_id = app->mobile_app_id()->asString();
+ if (mobile_app_id.empty()) {
+ LOG4CXX_WARN(logger_, "Application with connection key '" << app_id << "'"
+ " has no application id.");
+ return false;
+ }
+ url = policy_manager_->GetUpdateUrl(PolicyServiceTypes::POLICY);
+
+ LOG4CXX_INFO(logger_, "Update url is " << url << " for application "
+ << application_manager::ApplicationManagerImpl::instance()
+ ->application(app_id)->name());
+
+ application_manager::MessageHelper::SendPolicySnapshotNotification(app_id,
+ pt_string,
+ url, 0);
+
+ return true;
+}
+
+bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
+ const BinaryMessage& pt_string) {
+ POLICY_LIB_CHECK(false);
+
+ if (policy_manager_->GetPolicyTableStatus() !=
+ PolicyTableStatus::StatusUpdatePending) {
+ LOG4CXX_WARN(logger_, "PTU processing skipped, since current status is "
+ "different from pending.");
+ return false;
+ }
+
+ bool ret = policy_manager_->LoadPT(file, pt_string);
+ LOG4CXX_INFO(logger_, "Policy table is saved: " << std::boolalpha << ret);
+ if (ret) {
+ LOG4CXX_INFO(logger_, "PTU was successful.");
+ exchange_handler_->Stop();
+ policy_manager_->CleanupUnpairedDevices();
+ int32_t correlation_id =
+ application_manager::ApplicationManagerImpl::instance()
+ ->GetNextHMICorrelationID();
+
+ event_observer_.get()->subscribe_on_event(
+#ifdef HMI_DBUS_API
+ hmi_apis::FunctionID::VehicleInfo_GetOdometer, correlation_id
+#else
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData, correlation_id
+#endif
+ );
+ std::vector<std::string> vehicle_data_args;
+ vehicle_data_args.push_back(application_manager::strings::odometer);
+ application_manager::MessageHelper::CreateGetVehicleDataRequest(
+ correlation_id, vehicle_data_args);
+ } else {
+ LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one.");
+ OnPTExchangeNeeded();
+ }
+ return ret;
+}
+
+bool PolicyHandler::UnloadPolicyLibrary() {
+ LOG4CXX_TRACE(logger_, "enter. policy_manager_ = " << policy_manager_);
+ bool ret = true;
+ if (policy_manager_) {
+ policy_manager_.release();
+ }
+ if (dl_handle_) {
+ ret = (dlclose(dl_handle_) == 0);
+ dl_handle_ = 0;
+ }
+ exchange_handler_->Stop();
+ LOG4CXX_TRACE(logger_, "exit");
+ return ret;
+}
+
+void PolicyHandler::StartPTExchange(bool skip_device_selection) {
+ LOG4CXX_INFO(logger_, "PolicyHandler::StartPTExchange");
+ POLICY_LIB_CHECK_VOID();
+
+ if (policy_manager_->GetPolicyTableStatus() ==
+ PolicyTableStatus::StatusUpdatePending) {
+ LOG4CXX_INFO(logger_, "Starting exchange skipped, since another exchange "
+ "is in progress.");
+ return;
+ }
+
+ if (!skip_device_selection) {
+ DeviceParams device_params;
+ DeviceConsent consent = GetDeviceForSending(device_params);
+ switch (consent) {
+ case kDeviceHasNoConsent:
+ // Send OnSDLConsentNeeded to HMI for user consent on device usage
+ pending_device_handles_.push_back(device_params.device_handle);
+ application_manager::MessageHelper::SendOnSDLConsentNeeded(
+ device_params);
+ return;
+ case kDeviceDisallowed:
+ return;
+ default:
+ break;
+ }
+ }
+
+ exchange_handler_->Start();
+}
+
+void PolicyHandler::OnAllowSDLFunctionalityNotification(bool is_allowed,
+ uint32_t device_id) {
+ LOG4CXX_INFO(logger_, "OnAllowSDLFunctionalityNotification");
+ POLICY_LIB_CHECK_VOID();
+ // Device ids, need to be changed
+ std::set<uint32_t> device_ids;
+ bool device_specific = device_id != 0;
+ // Common devices consents change
+ if (!device_specific) {
+ application_manager::ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<application_manager::ApplicationSharedPtr> app_list =
+ accessor.applications();
+
+ std::set<application_manager::ApplicationSharedPtr>::const_iterator
+ it_app_list = app_list.begin();
+ std::set<application_manager::ApplicationSharedPtr>::const_iterator
+ it_app_end = app_list.end();
+
+ for (;it_app_list != it_app_end; ++it_app_list) {
+ if (!(*it_app_list).valid()) {
+ continue;
+ }
+ device_ids.insert(it_app_list->get()->device());
+ }
+ } else {
+ device_ids.insert(device_id);
+ }
+
+ std::set<uint32_t>::const_iterator it_ids = device_ids.begin();
+ std::set<uint32_t>::const_iterator it_ids_end = device_ids.end();
+ for (;it_ids != it_ids_end; ++it_ids) {
+ const uint32_t device_id = *it_ids;
+
+ DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForHandle(device_id,
+ &device_params);
+ device_params.device_handle = device_id;
+ if (kDefaultDeviceMacAddress == device_params.device_mac_address) {
+ LOG4CXX_WARN(logger_, "Device with handle " << device_id
+ << " wasn't found.");
+ return;
+ }
+ policy_manager_->SetUserConsentForDevice(device_params.device_mac_address,
+ is_allowed);
+
+ }
+
+ // Case, when specific device was changed
+ if (device_id) {
+ DeviceHandles::iterator it = std::find(pending_device_handles_.begin(),
+ pending_device_handles_.end(),
+ device_id);
+ // If consent done from HMI menu
+ if (it == pending_device_handles_.end()) {
+ return;
+ }
+
+ pending_device_handles_.erase(it);
+ }
+
+// EXTENDED_POLICY
+ // Skip device selection, since user already consented device usage
+ StartPTExchange(true);
+}
+
+void PolicyHandler::OnIgnitionCycleOver() {
+ LOG4CXX_INFO(logger_, "OnIgnitionCycleOver");
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->IncrementIgnitionCycles();
+}
+
+void PolicyHandler::KmsChanged(int kms) {
+ LOG4CXX_INFO(logger_, "PolicyHandler::KmsChanged " << kms << " kilometers");
+ POLICY_LIB_CHECK_VOID();
+ PTExchangeAtOdometer(kms);
+}
+
+void PolicyHandler::OnActivateApp(uint32_t connection_key,
+ uint32_t correlation_id) {
+ LOG4CXX_INFO(logger_, "OnActivateApp");
+
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()->application(
+ connection_key);
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_, "Activated App failed: no app found.");
+ return;
+ }
+ std::string policy_app_id = app->mobile_app_id()->asString();
+
+ AppPermissions permissions(policy_app_id);
+
+ if (!policy_manager_) {
+ LOG4CXX_WARN(logger_, "The shared library of policy is not loaded");
+ if (!PolicyEnabled()) {
+ permissions.isSDLAllowed = true;
+ }
+ } else {
+ DeviceParams device_params;
+ application_manager::MessageHelper::GetDeviceInfoForApp(connection_key,
+ &device_params);
+ permissions = policy_manager_->GetAppPermissionsChanges(
+ device_params.device_mac_address,
+ policy_app_id);
+
+ permissions.isSDLAllowed = true;
+
+ if (permissions.isSDLAllowed &&
+ PolicyTableStatus::StatusUpdateRequired ==
+ policy_manager_->GetPolicyTableStatus()) {
+ StartPTExchange();
+ }
+ policy_manager_->RemovePendingPermissionChanges(policy_app_id);
+ }
+
+ bool is_app_activated = false;
+ // If application is revoked it should not be activated
+ // In this case we need to activate application
+ if (false == permissions.appRevoked && true == permissions.isSDLAllowed) {
+ is_app_activated =
+ application_manager::ApplicationManagerImpl::instance()->
+ ActivateApplication(app);
+ }
+
+ last_activated_app_id_ = connection_key;
+ application_manager::MessageHelper::SendSDLActivateAppResponse(permissions,
+ correlation_id);
+ if (is_app_activated) {
+ application_manager::MessageHelper::SendHMIStatusNotification(*app.get());
+ }
+}
+
+void PolicyHandler::PTExchangeAtRegistration(const std::string& app_id) {
+ LOG4CXX_INFO(logger_, "PTExchangeAtIgnition");
+ POLICY_LIB_CHECK_VOID();
+
+ if (policy_manager_->IsAppInUpdateList(app_id)) {
+ StartPTExchange();
+ } else if (false == on_ignition_check_done_) { // TODO(AG): add cond. var to handle this case.
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ int days = current_time.tv_sec / kSecondsInDay;
+
+ LOG4CXX_INFO(
+ logger_,
+ "\nIgnition cycles exceeded: " << std::boolalpha <<
+ policy_manager_->ExceededIgnitionCycles()
+ << "\nDays exceeded: " << std::boolalpha
+ << policy_manager_->ExceededDays(days)
+ << "\nStatusUpdateRequired: " << std::boolalpha
+ << (policy_manager_->GetPolicyTableStatus() == StatusUpdateRequired));
+ if (policy_manager_->ExceededIgnitionCycles()
+ || policy_manager_->ExceededDays(days)
+ || policy_manager_->GetPolicyTableStatus() == StatusUpdateRequired) {
+ StartPTExchange();
+ }
+ }
+ on_ignition_check_done_ = true;
+}
+
+void PolicyHandler::PTExchangeAtOdometer(int kilometers) {
+ POLICY_LIB_CHECK_VOID();
+ if (policy_manager_->ExceededKilometers(kilometers)) {
+ LOG4CXX_INFO(logger_, "Enough kilometers passed to send for PT update.");
+ StartPTExchange();
+ }
+}
+
+void PolicyHandler::PTExchangeAtUserRequest(uint32_t correlation_id) {
+ LOG4CXX_TRACE(logger_, "PT exchange at user request");
+ POLICY_LIB_CHECK_VOID();
+ policy::PolicyTableStatus status = policy_manager_->GetPolicyTableStatus();
+ if (status != policy::StatusUpdatePending) {
+ OnPTExchangeNeeded();
+ status = policy::StatusUpdatePending;
+ } else {
+ is_user_requested_policy_table_update_ = true;
+ }
+ application_manager::MessageHelper::SendUpdateSDLResponse(
+ ConvertUpdateStatus(status), correlation_id);
+}
+
+void PolicyHandler::OnPTExchangeNeeded() {
+ StartPTExchange();
+}
+
+void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions,
+ const HMILevel& default_hmi) {
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
+
+ if (!app.valid()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Connection_key not found for application_id:" << policy_app_id);
+ return;
+ }
+
+ application_manager::MessageHelper::SendOnPermissionsChangeNotification(
+ app->app_id(), permissions);
+
+ LOG4CXX_INFO(
+ logger_,
+ "Notification sent for application_id:" << policy_app_id
+ << " and connection_key " << app->app_id());
+
+ // The application currently not running (i.e. in NONE) should change HMI
+ // level to default
+ mobile_apis::HMILevel::eType current_hmi_level = app->hmi_level();
+ mobile_apis::HMILevel::eType hmi_level =
+ application_manager::MessageHelper::StringToHMILevel(default_hmi);
+
+ if (mobile_apis::HMILevel::INVALID_ENUM == hmi_level) {
+ LOG4CXX_WARN(logger_, "Couldn't convert default hmi level "
+ << default_hmi << " to enum.");
+ return;
+ }
+ if (current_hmi_level == hmi_level) {
+ LOG4CXX_INFO(logger_, "Application already in default hmi state.");
+ return;
+ }
+ switch (current_hmi_level) {
+ case mobile_apis::HMILevel::HMI_NONE: {
+ LOG4CXX_INFO(logger_, "Changing hmi level of application "
+ << policy_app_id
+ << " to default hmi level " << default_hmi);
+ // If default is FULL, send request to HMI. Notification to mobile will be
+ // sent on response receiving.
+ if (mobile_apis::HMILevel::HMI_FULL == hmi_level) {
+ application_manager::MessageHelper::SendActivateAppToHMI(app->app_id());
+ break;
+ }
+
+ // Set application hmi level
+ app->set_hmi_level(hmi_level);
+
+ // Send notification to mobile
+ application_manager::MessageHelper::SendHMIStatusNotification(*app.get());
+ }
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Application " << policy_app_id << " is running."
+ "HMI level won't be changed.");
+ break;
+ }
+}
+
+bool PolicyHandler::GetPriority(const std::string& policy_app_id,
+ std::string* priority) {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->GetPriority(policy_app_id, priority);
+}
+
+void PolicyHandler::CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->CheckPermissions(app_id, hmi_level, rpc, rpc_params, result);
+}
+
+uint32_t PolicyHandler::GetNotificationsNumber(const std::string& priority) {
+ POLICY_LIB_CHECK(0);
+ return policy_manager_->GetNotificationsNumber(priority);
+}
+
+DeviceConsent PolicyHandler::GetUserConsentForDevice(
+ const std::string& device_id) {
+ POLICY_LIB_CHECK(kDeviceDisallowed);
+ return policy_manager_->GetUserConsentForDevice(device_id);
+}
+
+bool PolicyHandler::GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->GetDefaultHmi(policy_app_id, default_hmi);
+}
+
+bool PolicyHandler::GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames,
+ StringArray* app_hmi_types) {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->GetInitialAppData(application_id, nicknames, app_hmi_types);
+}
+
+EndpointUrls PolicyHandler::GetUpdateUrls(int service_type) {
+ POLICY_LIB_CHECK(EndpointUrls());
+ return policy_manager_->GetUpdateUrls(service_type);
+}
+
+void PolicyHandler::ResetRetrySequence() {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->ResetRetrySequence();
+}
+
+int PolicyHandler::NextRetryTimeout() {
+ POLICY_LIB_CHECK(0);
+ return policy_manager_->NextRetryTimeout();
+}
+
+int PolicyHandler::TimeoutExchange() {
+ POLICY_LIB_CHECK(0);
+ return policy_manager_->TimeoutExchange();
+}
+
+void PolicyHandler::OnExceededTimeout() {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->OnExceededTimeout();
+}
+
+BinaryMessageSptr PolicyHandler::RequestPTUpdate() {
+ POLICY_LIB_CHECK(BinaryMessageSptr());
+ return policy_manager_->RequestPTUpdate();
+}
+
+const std::vector<int> PolicyHandler::RetrySequenceDelaysSeconds() {
+ POLICY_LIB_CHECK(std::vector<int>());
+ return policy_manager_->RetrySequenceDelaysSeconds();
+}
+
+utils::SharedPtr<usage_statistics::StatisticsManager>
+PolicyHandler::GetStatisticManager() {
+ return utils::SharedPtr<PolicyManager>::
+ static_pointer_cast<usage_statistics::StatisticsManager>(policy_manager_);
+}
+
+void PolicyHandler::AddStatisticsInfo(int type) {
+ POLICY_LIB_CHECK_VOID();
+ switch (static_cast<hmi_apis::Common_StatisticsType::eType>(type)) {
+ case hmi_apis::Common_StatisticsType::iAPP_BUFFER_FULL: {
+ usage_statistics::GlobalCounter count_of_iap_buffer_full(
+ GetStatisticManager(), usage_statistics::IAP_BUFFER_FULL);
+ ++count_of_iap_buffer_full;
+ break;
+ }
+ default: {
+ LOG4CXX_WARN(logger_, "Type of statistics is unknown");
+ }
+ }
+}
+
+void PolicyHandler::OnSystemError(int code) {
+ POLICY_LIB_CHECK_VOID();
+ switch (static_cast<hmi_apis::Common_SystemError::eType>(code)) {
+ case hmi_apis::Common_SystemError::SYNC_REBOOTED: {
+ usage_statistics::GlobalCounter count_of_sync_reboots(
+ GetStatisticManager(), usage_statistics::SYNC_REBOOTS);
+ ++count_of_sync_reboots;
+ break;
+ }
+ case hmi_apis::Common_SystemError::SYNC_OUT_OF_MEMMORY: {
+ usage_statistics::GlobalCounter count_sync_out_of_memory(
+ GetStatisticManager(), usage_statistics::SYNC_OUT_OF_MEMORY);
+ ++count_sync_out_of_memory;
+ break;
+ }
+ default: {
+ LOG4CXX_WARN(logger_, "System error is unknown");
+ }
+ }
+}
+
+std::string PolicyHandler::GetAppName(const std::string& policy_app_id) {
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()
+ ->application_by_policy_id(policy_app_id);
+
+ if (!app.valid()) {
+ LOG4CXX_WARN(
+ logger_,
+ "Connection_key not found for application_id:" << policy_app_id);
+ return "";
+ }
+ return app->name();
+}
+
+void PolicyHandler::OnUserRequestedUpdateCheckRequired() {
+ LOG4CXX_INFO(logger_, "OnUserRequestedUpdateCheckRequired");
+ POLICY_LIB_CHECK_VOID();
+ policy::PolicyTableStatus status = policy_manager_->GetPolicyTableStatus();
+ if (is_user_requested_policy_table_update_ &&
+ status != policy::StatusUpdatePending) {
+ is_user_requested_policy_table_update_ = false;
+ OnPTExchangeNeeded();
+ return;
+ }
+ LOG4CXX_WARN(logger_, "There is another pending update is present."
+ "User-requested update is postponed.");
+}
+
+void PolicyHandler::RemoveDevice(const std::string& device_id) {
+ LOG4CXX_INFO(logger_, "PolicyHandler::RemoveDevice");
+ POLICY_LIB_CHECK_VOID();
+
+ policy_manager_->MarkUnpairedDevice(device_id);
+
+}
+
+bool PolicyHandler::IsApplicationRevoked(const std::string& app_id) {
+ LOG4CXX_TRACE(logger_, "PolicyHandler::IsApplicationRevoked");
+ POLICY_LIB_CHECK(false);
+
+ return policy_manager_->IsApplicationRevoked(app_id);
+}
+
+void PolicyHandler::OnUpdateRequestSentToMobile() {
+ LOG4CXX_INFO(logger_, "OnUpdateRequestSentToMobile");
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->OnUpdateStarted();
+}
+
+bool PolicyHandler::CheckKeepContext(int system_action,
+ const std::string& policy_app_id) {
+ POLICY_LIB_CHECK(false);
+ const bool keep_context = system_action
+ == mobile_apis::SystemAction::KEEP_CONTEXT;
+ const bool allowed = policy_manager_->CanAppKeepContext(policy_app_id);
+ return !(keep_context && !allowed);
+}
+
+bool PolicyHandler::CheckStealFocus(int system_action,
+ const std::string& policy_app_id) {
+ POLICY_LIB_CHECK(false);
+ const bool steal_focus = system_action
+ == mobile_apis::SystemAction::STEAL_FOCUS;
+ const bool allowed = policy_manager_->CanAppStealFocus(policy_app_id);
+ return !(steal_focus && !allowed);
+}
+
+uint16_t PolicyHandler::HeartBeatTimeout(const std::string& app_id) const {
+ POLICY_LIB_CHECK(0);
+ return policy_manager_->HeartBeatTimeout(app_id);
+}
+
+} // namespace policy
+
diff --git a/src/components/application_manager/src/policies/policy_retry_sequence.cc b/src/components/application_manager/src/policies/policy_retry_sequence.cc
new file mode 100644
index 0000000000..e1b47a0d96
--- /dev/null
+++ b/src/components/application_manager/src/policies/policy_retry_sequence.cc
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/policies/policy_retry_sequence.h"
+
+#include <unistd.h>
+
+#include "application_manager/policies/policy_handler.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+
+RetrySequence::RetrySequence(PolicyHandler* const policy_handler)
+ // TODO (Risk copy of PolicyHandler Pointer)
+ : policy_handler_(policy_handler) {
+}
+
+void RetrySequence::threadMain() {
+ StartNextRetry();
+}
+
+void RetrySequence::StartNextRetry() {
+ LOG4CXX_TRACE(logger_, "Start next retry of exchanging PT");
+ DCHECK(policy_handler_);
+ // TODO(Ezamakhov): inverstigate StartNextRetry on unload policy lib
+
+ BinaryMessageSptr pt_snapshot = policy_handler_
+ ->RequestPTUpdate();
+ if (pt_snapshot) {
+ policy_handler_->SendMessageToSDK(*pt_snapshot);
+
+ const int timeout = policy_handler_->TimeoutExchange();
+ const int seconds = policy_handler_->NextRetryTimeout();
+ LOG4CXX_DEBUG(logger_,
+ "Timeout response: " << timeout << " Next try: " << seconds);
+ if (timeout > 0) {
+ sleep(timeout);
+ policy_handler_->OnExceededTimeout();
+ }
+ if (seconds > 0) {
+ sleep(seconds);
+ StartNextRetry();
+ } else {
+ LOG4CXX_INFO(logger_, "End retry sequence. Update PT was not received");
+ }
+ }
+}
+
+} // namespace policy
+
diff --git a/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc b/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc
new file mode 100644
index 0000000000..eba808f406
--- /dev/null
+++ b/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc
@@ -0,0 +1,88 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/policies/pt_exchange_handler_ext.h"
+
+#include <fstream>
+#include <string>
+
+#include "application_manager/message_helper.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+
+using application_manager::MessageHelper;
+using profile::Profile;
+using std::string;
+
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+
+PTExchangeHandlerExt::PTExchangeHandlerExt(PolicyHandler* policy_handler)
+ : PTExchangeHandler(),
+ policy_handler_(policy_handler) {
+ DCHECK(policy_handler_);
+}
+
+PTExchangeHandlerExt::~PTExchangeHandlerExt() {
+}
+
+void PTExchangeHandlerExt::Start() {
+ LOG4CXX_TRACE(logger_, "Start exchange PT");
+
+ const string policy_snapshot_file_name =
+ Profile::instance()->policies_snapshot_file_name();
+ const std::string system_files_path =
+ Profile::instance()->system_files_path();
+ const std::string policy_snapshot_full_path = system_files_path + '/' +
+ policy_snapshot_file_name;
+ BinaryMessageSptr pt_snapshot = policy_handler_->RequestPTUpdate();
+ if (pt_snapshot.valid()) {
+ if (file_system::CreateDirectoryRecursively(system_files_path) &&
+ file_system::WriteBinaryFile(policy_snapshot_full_path, *pt_snapshot)) {
+ MessageHelper::SendPolicyUpdate(policy_snapshot_full_path,
+ policy_handler_->TimeoutExchange(),
+ policy_handler_->RetrySequenceDelaysSeconds());
+ } else {
+ LOG4CXX_ERROR(logger_, "Failed to write snapshot file to " << policy_snapshot_file_name);
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Failed to obtain policy table snapshot");
+ }
+}
+
+void PTExchangeHandlerExt::Stop() {
+ // Nothing doing
+}
+
+} // namespace policy
diff --git a/src/components/application_manager/src/policies/pt_exchange_handler_impl.cc b/src/components/application_manager/src/policies/pt_exchange_handler_impl.cc
new file mode 100644
index 0000000000..e28455aa33
--- /dev/null
+++ b/src/components/application_manager/src/policies/pt_exchange_handler_impl.cc
@@ -0,0 +1,76 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/policies/pt_exchange_handler_impl.h"
+
+#include "utils/logger.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/policy_retry_sequence.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+
+PTExchangeHandlerImpl::PTExchangeHandlerImpl(PolicyHandler* handler)
+ : policy_handler_(handler),
+ retry_sequence_("RetrySequence", new RetrySequence(handler)) {
+ DCHECK(policy_handler_);
+ LOG4CXX_INFO(logger_, "Exchan created");
+}
+
+PTExchangeHandlerImpl::~PTExchangeHandlerImpl() {
+ Stop();
+ policy_handler_ = NULL;
+}
+
+void PTExchangeHandlerImpl::Start() {
+ sync_primitives::AutoLock locker(retry_sequence_lock_);
+ LOG4CXX_INFO(logger_, "Exchan started");
+
+ if (retry_sequence_.is_running()) {
+ retry_sequence_.stop();
+ }
+
+ if (policy_handler_) {
+ policy_handler_->ResetRetrySequence();
+ }
+ retry_sequence_.start();
+}
+
+void PTExchangeHandlerImpl::Stop() {
+ sync_primitives::AutoLock locker(retry_sequence_lock_);
+ if (retry_sequence_.is_running()) {
+ retry_sequence_.stop();
+ }
+}
+
+} // namespace policy
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
new file mode 100644
index 0000000000..48fee42920
--- /dev/null
+++ b/src/components/application_manager/src/request_controller.cc
@@ -0,0 +1,508 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include "utils/logger.h"
+#include "config_profile/profile.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace request_controller {
+
+using namespace sync_primitives;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RequestController");
+
+RequestController::RequestController()
+ : pool_state_(UNDEFINED),
+ pool_size_(profile::Profile::instance()->thread_pool_size()),
+ pending_request_set_lock_(true),
+ timer_("RequestCtrlTimer", this, &RequestController::onTimer, true)
+{
+ LOG4CXX_INFO(logger_, "RequestController::RequestController()");
+ InitializeThreadpool();
+ timer_.start(dafault_sleep_time_);
+ LOG4CXX_DEBUG(logger_," Create timer thread ; timer thread = " << timer_.thread_->thread_handle());
+}
+
+RequestController::~RequestController() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (pool_state_ != TPoolState::STOPPED) {
+ DestroyThreadpool();
+ }
+
+ pool_.clear();
+ mobile_request_list_.clear();
+ pending_request_set_.clear();
+}
+
+void RequestController::InitializeThreadpool()
+{
+ LOG4CXX_TRACE_ENTER(logger_);
+ // TODO: Consider lazy loading threads instead of creating all at once
+ pool_state_ = TPoolState::STARTED;
+ for (uint32_t i = 0; i < pool_size_; i++) {
+ char name [50];
+ snprintf(name, sizeof(name)/sizeof(name[0]),
+ "AM Pool %d", i);
+ pool_.push_back(ThreadSharedPtr(new Thread(name, new Worker(this))));
+ pool_[i]->start();
+ LOG4CXX_INFO(logger_, "Request thread initialized: " << name);
+ }
+}
+
+void RequestController::DestroyThreadpool() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ {
+ sync_primitives::AutoLock auto_lock (mobile_request_list_lock_);
+ pool_state_ = TPoolState::STOPPED;
+ LOG4CXX_INFO(logger_, "Broadcasting STOP signal to all threads...");
+ cond_var_.Broadcast(); // notify all threads we are shutting down
+ }
+ for (uint32_t i = 0; i < pool_size_; i++) {
+ pool_[i]->stop();
+ }
+ LOG4CXX_INFO(logger_, "Threads exited from the thread pool " << pool_size_);
+}
+
+RequestController::TResult RequestController::addMobileRequest(
+ const MobileRequestPtr& request,
+ const mobile_apis::HMILevel::eType& hmi_level) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (!request.valid()) {
+ LOG4CXX_INFO(logger_, "Null Pointer request");
+ LOG4CXX_TRACE_EXIT(logger_);
+ cond_var_.NotifyOne();
+ return INVALID_DATA;
+ }
+
+ TResult result = SUCCESS;
+ const commands::CommandRequestImpl* request_impl =
+ static_cast<commands::CommandRequestImpl*>(request.get());
+ LOG4CXX_DEBUG(logger_, "addMobileRequest " << request_impl->correlation_id());
+ const uint32_t& app_hmi_level_none_time_scale =
+ profile::Profile::instance()->app_hmi_level_none_time_scale();
+
+ const uint32_t& app_hmi_level_none_max_request_per_time_scale =
+ profile::Profile::instance()->app_hmi_level_none_time_scale_max_requests();
+
+ const uint32_t& app_time_scale =
+ profile::Profile::instance()->app_time_scale();
+
+ const uint32_t& max_request_per_time_scale =
+ profile::Profile::instance()->app_time_scale_max_requests();
+
+ const uint32_t& pending_requests_amount =
+ profile::Profile::instance()->pending_requests_amount();
+
+ if (!checkHMILevelTimeScaleMaxRequest(mobile_apis::HMILevel::HMI_NONE,
+ request_impl->connection_key(), app_hmi_level_none_time_scale,
+ app_hmi_level_none_max_request_per_time_scale)) {
+ LOG4CXX_ERROR(logger_, "Too many application requests in hmi level NONE");
+ result = RequestController::NONE_HMI_LEVEL_MANY_REQUESTS;
+ } else if (!checkTimeScaleMaxRequest(
+ request_impl->connection_key(),
+ app_time_scale, max_request_per_time_scale)) {
+ LOG4CXX_ERROR(logger_, "Too many application requests");
+ result = RequestController::TOO_MANY_REQUESTS;
+ } else if (pending_requests_amount == mobile_request_list_.size()) {
+ LOG4CXX_ERROR(logger_, "Too many pending request");
+ result = RequestController::TOO_MANY_PENDING_REQUESTS;
+ }
+ {
+ AutoLock auto_lock(mobile_request_list_lock_);
+
+ mobile_request_list_.push_back(request);
+ LOG4CXX_INFO(logger_, "mobile_request_list_ size is "
+ << mobile_request_list_.size()
+ << " pending_request_set_ size is "
+ << pending_request_set_.size()
+ );
+ }
+
+ // wake up one thread that is waiting for a task to be available
+ cond_var_.NotifyOne();
+ LOG4CXX_TRACE_EXIT(logger_);
+ return result;
+}
+
+RequestController::TResult RequestController::addHMIRequest(
+ const RequestPtr& request) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ DCHECK(request.valid());
+ LOG4CXX_DEBUG(logger_, "addHMIRequest " << request->correlation_id());
+ RequestInfoPtr request_info_ptr = new HMIRequestInfo(request, request->default_timeout());
+
+
+ if (0 != request->default_timeout()) {
+ pending_request_set_lock_.Acquire();
+ pending_request_set_.insert(request_info_ptr);
+ LOG4CXX_INFO(logger_, "pending_request_set_ size is "
+ << pending_request_set_.size());
+ UpdateTimer();
+ pending_request_set_lock_.Release();
+ } else {
+ LOG4CXX_INFO(logger_, "Default timeout was set to 0."
+ "RequestController will not track timeout of this request.");
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RequestController::SUCCESS;
+}
+
+void RequestController::addNotification(const RequestPtr ptr) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ notification_list_.push_back(ptr);
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void RequestController::removeNotification(const commands::Command* notification) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ std::list<RequestPtr>::iterator it = notification_list_.begin();
+ for (; notification_list_.end() != it; ++it) {
+ if (it->get() == notification) {
+ notification_list_.erase(it);
+ break;
+ }
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void RequestController::terminateMobileRequest(
+ const uint32_t& mobile_correlation_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ AutoLock auto_lock(pending_request_set_lock_);
+ RequestInfoSet::iterator it = pending_request_set_.begin();
+ for (; pending_request_set_.end() != it; ++it) {
+ MobileRequestInfo* mobile_request_info = dynamic_cast<MobileRequestInfo*>(it->get());
+ if (NULL == mobile_request_info) {
+ continue;
+ }
+ if (mobile_correlation_id == mobile_request_info->mobile_correlation_id_) {
+ mobile_request_info->request_->CleanUp();
+ pending_request_set_.erase(it);
+ LOG4CXX_INFO(logger_, "Mobile request terminated: " << mobile_correlation_id);
+ UpdateTimer();
+ LOG4CXX_TRACE_EXIT(logger_);
+ return;
+ }
+ }
+ LOG4CXX_INFO(logger_, "Mobile request NOT terminated: " << mobile_correlation_id <<
+ " pending_request_set_ size : " << pending_request_set_.size());
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void RequestController::terminateHMIRequest(const uint32_t &correlation_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ AutoLock auto_lock(pending_request_set_lock_);
+ RequestInfoSet::iterator it = pending_request_set_.begin();
+ for (; pending_request_set_.end() != it; ++it) {
+ HMIRequestInfo* hmi_request_info = dynamic_cast<HMIRequestInfo*>(it->get());
+ if (NULL == hmi_request_info) {
+ continue;
+ }
+ if (correlation_id == hmi_request_info->requestId()) {
+ hmi_request_info->request_->CleanUp();
+ pending_request_set_.erase(it);
+ LOG4CXX_DEBUG(logger_, "HMI request terminated: " << correlation_id);
+ UpdateTimer();
+ LOG4CXX_TRACE_EXIT(logger_);
+ return;
+ }
+ }
+ LOG4CXX_INFO(logger_, "HMI request NOT terminated: " << correlation_id <<
+ " pending_request_set_ size : " << pending_request_set_.size());
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void RequestController::terminateAppRequests(
+ const uint32_t& app_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ AutoLock auto_lock(pending_request_set_lock_);
+ RequestInfoSet::iterator it = pending_request_set_.begin();
+ while (pending_request_set_.end() != it) {
+ MobileRequestInfo* mobile_request_info = dynamic_cast<MobileRequestInfo*>(it->get());
+ if (NULL == mobile_request_info) {
+ ++it;
+ continue;
+ }
+
+ if (mobile_request_info->app_id_ == app_id) {
+ mobile_request_info->request_->CleanUp();
+ pending_request_set_.erase(it++);
+ LOG4CXX_INFO(logger_, "terminated all app requests : " << app_id);
+ } else {
+ ++it;
+ }
+ }
+ UpdateTimer();
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void RequestController::terminateAllHMIRequests() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ AutoLock auto_lock(pending_request_set_lock_);
+ RequestInfoSet::iterator it = pending_request_set_.begin();
+ while (pending_request_set_.end() != it) {
+ HMIRequestInfo* hmi_request_info = dynamic_cast<HMIRequestInfo*>(it->get());
+ if (NULL == hmi_request_info) {
+ ++it;
+ continue;
+ }
+ hmi_request_info->request_->CleanUp();
+ pending_request_set_.erase(it++);
+ LOG4CXX_INFO(logger_, "HMI request terminated: ");
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void RequestController::updateRequestTimeout(
+ const uint32_t& app_id,
+ const uint32_t& mobile_correlation_id,
+ const uint32_t& new_timeout) {
+
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ AutoLock auto_lock(pending_request_set_lock_);
+ RequestInfoSet::iterator it = pending_request_set_.begin();
+ MobileRequestInfo* mobile_request_info = NULL;
+ RequestInfoPtr request_info;
+ for (; pending_request_set_.end() != it; ++it) {
+ request_info = *it;
+ if (false == request_info.valid()) {
+ LOG4CXX_ERROR(logger_, "Invalid request, can't update timeout");
+ continue;
+ }
+ mobile_request_info = dynamic_cast<MobileRequestInfo*>(request_info.get());
+ if (NULL == mobile_request_info) {
+ continue;
+ }
+ if (app_id == mobile_request_info->app_id_ &&
+ mobile_correlation_id == mobile_request_info->mobile_correlation_id_) {
+ break;
+ }
+ }
+
+ if (it != pending_request_set_.end()) {
+ DCHECK(mobile_request_info);
+ DCHECK(request_info.valid());
+
+ mobile_request_info->updateTimeOut(new_timeout);
+ pending_request_set_.erase(it);
+ pending_request_set_.insert(request_info);
+ // erase and insert need to update ordering of set
+ UpdateTimer();
+ LOG4CXX_ERROR(logger_, "Timeout updated for "
+ << " app_id " << app_id
+ << " mobile_correlation_id " << mobile_correlation_id
+ << " new_timeout " << new_timeout);
+ } else {
+ LOG4CXX_ERROR(logger_, "Cant find request with "
+ << " app_id " << app_id
+ << " mobile_correlation_id " << mobile_correlation_id );
+ }
+}
+
+void RequestController::onTimer() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ AutoLock auto_lock(pending_request_set_lock_);
+ RequestInfoSet::iterator probably_expired = pending_request_set_.begin();
+ while (pending_request_set_.end() != probably_expired) {
+ RequestInfoPtr request = *probably_expired;
+ if (request->timeout_sec() == 0) {
+ LOG4CXX_INFO(logger_, "Ignore " << request->requestId());
+ ++probably_expired;
+ // This request should not be observed for TIME_OUT
+ continue;
+ }
+ if (request->isExpired()) {
+ pending_request_set_.erase(probably_expired);
+ commands::CommandRequestImpl* mobile_expired_request =
+ dynamic_cast<commands::CommandRequestImpl*>(request->request());
+ if (mobile_expired_request) {
+
+ mobile_expired_request->onTimeOut();
+ }
+ request->request()->CleanUp();
+ LOG4CXX_INFO(logger_, "Timeout for request id " << request->requestId() << " expired");
+ probably_expired = pending_request_set_.begin();
+ break;
+ }
+ }
+ UpdateTimer();
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+RequestController::Worker::Worker(RequestController* requestController)
+ : request_controller_(requestController)
+ , stop_flag_(false) {
+}
+
+RequestController::Worker::~Worker() {
+}
+
+void RequestController::Worker::threadMain() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ sync_primitives::AutoLock auto_lock(thread_lock_);
+ while (!stop_flag_) {
+ // Try to pick a request
+ sync_primitives::AutoLock auto_lock(request_controller_->mobile_request_list_lock_);
+
+ while ((request_controller_->pool_state_ != TPoolState::STOPPED) &&
+ (request_controller_->mobile_request_list_.empty())) {
+ // Wait until there is a task in the queue
+ // Unlock mutex while wait, then lock it back when signaled
+ LOG4CXX_INFO(logger_, "Unlocking and waiting");
+ request_controller_->cond_var_.Wait(auto_lock);
+ LOG4CXX_INFO(logger_, "Signaled and locking");
+ }
+
+ // If the thread was shutdown, return from here
+ if (request_controller_->pool_state_ == TPoolState::STOPPED) {
+ break;
+ }
+
+ MobileRequestPtr request(request_controller_->mobile_request_list_.front());
+
+ request_controller_->mobile_request_list_.pop_front();
+ bool init_res = request->Init(); // to setup specific default timeout
+ RequestInfoPtr request_info_ptr(new MobileRequestInfo(request, request->default_timeout()));
+
+ request_controller_->pending_request_set_lock_.Acquire();
+ request_controller_->pending_request_set_.insert(request_info_ptr);
+ //pending_request_list_.Acquire();
+ if (0 != request->default_timeout()) {
+ LOG4CXX_INFO(logger_, "Add Request " << request_info_ptr->requestId() <<
+ "with timeout: " << request->default_timeout());
+ request_controller_->UpdateTimer();
+ } else {
+ LOG4CXX_INFO(logger_, "Default timeout was set to 0."
+ "RequestController will not track timeout of this request.");
+ }
+ request_controller_->pending_request_set_lock_.Release();
+ AutoUnlock unlock(auto_lock);
+
+ // execute
+ if (request->CheckPermissions() && init_res) {
+ request->Run();
+ }
+ }
+
+}
+
+bool RequestController::Worker::exitThreadMain() {
+ stop_flag_ = true;
+ sync_primitives::AutoLock auto_lock(thread_lock_);
+ // setup stop flag and whit while threadMain will be finished correctly
+ return true;
+}
+
+bool RequestController::checkTimeScaleMaxRequest(
+ const uint32_t& app_id,
+ const uint32_t& app_time_scale,
+ const uint32_t& max_request_per_time_scale) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ {
+ AutoLock auto_lock(pending_request_set_lock_);
+ TimevalStruct end = date_time::DateTime::getCurrentTime();
+ TimevalStruct start;
+ start.tv_sec = end.tv_sec - app_time_scale;
+
+ TimeScale scale(start, end, app_id);
+ uint32_t count = 0;
+
+ count = count_if (pending_request_set_.begin(), pending_request_set_.end(), scale);
+ if (count == max_request_per_time_scale ) {
+ LOG4CXX_ERROR(logger_, "Requests count " << count <<
+ " exceed application limit " << max_request_per_time_scale);
+ return true;
+ }
+ }
+ return true;
+}
+
+bool RequestController::checkHMILevelTimeScaleMaxRequest(
+ const mobile_apis::HMILevel::eType& hmi_level,
+ const uint32_t& app_id,
+ const uint32_t& app_time_scale,
+ const uint32_t& max_request_per_time_scale) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ {
+ AutoLock auto_lock(pending_request_set_lock_);
+ TimevalStruct end = date_time::DateTime::getCurrentTime();
+ TimevalStruct start;
+ start.tv_sec = end.tv_sec - app_time_scale;
+
+ HMILevelTimeScale scale(start, end, app_id, hmi_level);
+ uint32_t count = 0;
+
+ count = count_if (pending_request_set_.begin(), pending_request_set_.end(), scale);
+ if (count == max_request_per_time_scale ) {
+ LOG4CXX_ERROR(logger_, "Requests count " << count
+ << " exceed application limit " << max_request_per_time_scale
+ << " in hmi level " << hmi_level);
+ return false;
+ }
+ }
+ return true;
+}
+
+void RequestController::UpdateTimer() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ uint32_t sleep_time = dafault_sleep_time_;
+ RequestInfoSet::iterator it = pending_request_set_.begin();
+
+ while (it != pending_request_set_.end()) {
+ RequestInfoPtr request = *it;
+ DCHECK(request.valid());
+ if (0 == request->timeout_sec()) {
+ ++it;
+ // This request should not be observed for TIME_OUT
+ continue;
+ }
+ sleep_time = request->end_time().tv_sec -
+ date_time::DateTime::getCurrentTime().tv_sec;
+ break;
+ }
+ timer_.updateTimeOut(sleep_time);
+ LOG4CXX_INFO(logger_, "Sleep for: " << sleep_time);
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+
+} // namespace request_controller
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
new file mode 100644
index 0000000000..58b939f857
--- /dev/null
+++ b/src/components/application_manager/src/request_info.cc
@@ -0,0 +1,83 @@
+/**
+* \file request_info.h
+* \brief request information structure source file.
+*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "application_manager/request_info.h"
+namespace application_manager {
+
+namespace request_controller {
+
+HMIRequestInfo::HMIRequestInfo(
+ RequestPtr request,
+ const uint64_t timeout_sec):
+ RequestInfo(timeout_sec),
+ request_(request) {
+ correlation_id_ = request_->correlation_id();
+}
+
+HMIRequestInfo::HMIRequestInfo(
+ RequestPtr request,
+ const TimevalStruct &start_time,
+ const uint64_t timeout_sec):
+ RequestInfo(start_time, timeout_sec),
+ request_(request) {
+ correlation_id_ = request_->correlation_id();
+}
+
+MobileRequestInfo::MobileRequestInfo(
+ MobileRequestPtr request,
+ const uint64_t timeout_sec):
+ RequestInfo(timeout_sec),
+ request_(request) {
+ commands::CommandRequestImpl* request_from_mobile =
+ static_cast<commands::CommandRequestImpl*>(request_.get());
+ mobile_correlation_id_ = request_from_mobile->correlation_id();
+ app_id_ = request_from_mobile->connection_key();
+}
+
+MobileRequestInfo::MobileRequestInfo(
+ MobileRequestPtr request,
+ const TimevalStruct &start_time,
+ const uint64_t timeout_sec):
+ RequestInfo(start_time, timeout_sec),
+ request_(request) {
+ commands::CommandRequestImpl* request_to_hmi =
+ static_cast<commands::CommandRequestImpl*>(request_.get());
+ mobile_correlation_id_ = request_to_hmi->correlation_id();
+ app_id_ = request_to_hmi->connection_key();
+}
+
+} // namespace request_controller
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/resume_ctrl.cpp b/src/components/application_manager/src/resume_ctrl.cpp
new file mode 100644
index 0000000000..dff90a6383
--- /dev/null
+++ b/src/components/application_manager/src/resume_ctrl.cpp
@@ -0,0 +1,941 @@
+#include <fstream>
+
+#include "application_manager/resume_ctrl.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+#include "connection_handler/connection_handler_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "smart_objects/smart_object.h"
+#include "connection_handler/connection.h"
+#include "formatters/CFormatterJsonBase.hpp"
+#include "application_manager/commands/command_impl.h"
+#include "resumption/last_state.h"
+#include "policy/policy_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ResumeCtrl")
+
+namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+
+ResumeCtrl::ResumeCtrl(ApplicationManagerImpl* app_mngr)
+ : app_mngr_(app_mngr),
+ timer_("ResumeCtrl", this, &ResumeCtrl::onTimer) {
+}
+
+void ResumeCtrl::SaveAllApplications() {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::SaveApplications()");
+ DCHECK(app_mngr_);
+
+ std::set<ApplicationSharedPtr>::iterator it =
+ app_mngr_->application_list_.begin();
+ std::set<ApplicationSharedPtr>::iterator it_end =
+ app_mngr_->application_list_.end();
+ for (; it != it_end; ++it) {
+ SaveApplication(*it);
+ }
+}
+
+void ResumeCtrl::SaveApplication(ApplicationConstSharedPtr application) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::SaveApplication");
+
+ DCHECK(application.get());
+
+ Json::Value* json_app = NULL;
+
+ const std::string& m_app_id = application->mobile_app_id()->asString();
+ Json::Value::iterator it = GetSavedApplications().begin();
+ for (; it != GetSavedApplications().end(); ++it) {
+ if (m_app_id == (*it)[strings::app_id].asString()) {
+ json_app = &(*it);
+ LOG4CXX_INFO(logger_, "ResumeCtrl Application with this id "
+ "already exist ( update info )."
+ "mobile app_id = " << m_app_id);
+ break;
+ }
+ }
+
+ if (json_app == NULL) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl Application with this ID does not"
+ "exist. Add new. mobile app_id = " << m_app_id);
+ json_app = &(GetSavedApplications().append(Json::Value()));
+ }
+
+ uint32_t hash = application->curHash();
+ uint32_t grammar_id = application->get_grammar_id();
+
+ LOG4CXX_INFO(logger_, "Hash = " << hash);
+ (*json_app)[strings::device_mac] =
+ MessageHelper::GetDeviceMacAddressForHandle(application->device());
+ (*json_app)[strings::app_id] = m_app_id;
+ (*json_app)[strings::grammar_id] = grammar_id;
+ (*json_app)[strings::connection_key] = application->app_id();
+ (*json_app)[strings::hmi_app_id] = application->hmi_app_id();
+ (*json_app)[strings::hmi_level] =
+ static_cast<int32_t> (application->hmi_level());
+ (*json_app)[strings::ign_off_count] = 0;
+ (*json_app)[strings::hash_id] = hash;
+ (*json_app)[strings::application_commands] =
+ GetApplicationCommands(application);
+ (*json_app)[strings::application_submenus] =
+ GetApplicationSubMenus(application);
+ (*json_app)[strings::application_choise_sets] =
+ GetApplicationInteractionChoiseSets(application);
+ (*json_app)[strings::application_global_properties] =
+ GetApplicationGlobalProperties(application);
+ (*json_app)[strings::application_subscribtions] =
+ GetApplicationSubscriptions(application);
+ (*json_app)[strings::application_files] = GetApplicationFiles(application);
+ (*json_app)[strings::time_stamp] = (uint32_t)time(NULL);
+ (*json_app)[strings::audio_streaming_state] = application->audio_streaming_state();
+}
+
+void ResumeCtrl::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::on_event ");
+}
+
+bool ResumeCtrl::RestoreApplicationHMILevel(ApplicationSharedPtr application) {
+ if (false == application.valid()) {
+ LOG4CXX_ERROR(logger_, " RestoreApplicationHMILevel() application pointer in invalid");
+ return false;
+ }
+ Json::Value::iterator it = GetSavedApplications().begin();
+ for (;it != GetSavedApplications().end(); ++it) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+
+ if (saved_m_app_id == application->mobile_app_id()->asString()) {
+
+ mobile_apis::HMILevel::eType saved_hmi_level;
+ //mobile_apis::HMILevel::eType restored_hmi_level;
+
+ mobile_apis::AudioStreamingState::eType audio_streaming_state =
+ static_cast<mobile_apis::AudioStreamingState::eType>
+ ((*it)[strings::audio_streaming_state].asInt());
+ application->set_audio_streaming_state(audio_streaming_state);
+ saved_hmi_level = static_cast<mobile_apis::HMILevel::eType>(
+ (*it)[strings::hmi_level].asInt());
+
+ return SetupHMILevel(application, saved_hmi_level, audio_streaming_state);
+ }
+ }
+ LOG4CXX_INFO(logger_, "Failed to restore application HMILevel");
+ return false;
+}
+
+bool ResumeCtrl::SetupDefaultHMILevel(ApplicationSharedPtr application) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (false == application.valid()) {
+ LOG4CXX_ERROR(logger_, "SetupDefaultHMILevel application pointer is invalid");
+ return false;
+ }
+
+ mobile_apis::HMILevel::eType default_hmi = mobile_apis::HMILevel::HMI_NONE;
+
+ if (policy::PolicyHandler::instance()->PolicyEnabled()) {
+ std::string policy_app_id = application->mobile_app_id()->asString();
+ std::string default_hmi_string = "";
+ bool result_get_hmi = policy::PolicyHandler::instance()->GetDefaultHmi(
+ policy_app_id, &default_hmi_string);
+ if (true == result_get_hmi) {
+ if ("BACKGROUND" == default_hmi_string) {
+ default_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == default_hmi_string) {
+ default_hmi = mobile_apis::HMILevel::HMI_FULL;
+ } else if ("LIMITED" == default_hmi_string) {
+ default_hmi = mobile_apis::HMILevel::HMI_LIMITED;
+ } else if ("NONE" == default_hmi_string) {
+ default_hmi = mobile_apis::HMILevel::HMI_NONE;
+ } else {
+ LOG4CXX_ERROR(logger_, "Unable to convert " + default_hmi_string + "to HMILevel");
+ return false;
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "SetupDefaultHMILevel() unable to get default hmi_level for "
+ << policy_app_id);
+ }
+ }
+
+ return SetupHMILevel(application, default_hmi,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE, false);
+}
+
+bool ResumeCtrl::SetupHMILevel(ApplicationSharedPtr application,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ bool check_policy) {
+
+ if (false == application.valid()) {
+ LOG4CXX_ERROR(logger_, "SetupHMILevel() application pointer in invalid");
+ return false;
+ }
+#ifdef ENABLE_LOG
+ bool seted_up_hmi_level = hmi_level;
+#endif
+
+ const std::string device_id =
+ MessageHelper::GetDeviceMacAddressForHandle(application->device());
+
+ if (check_policy &&
+ policy::PolicyHandler::instance()->GetUserConsentForDevice(device_id)
+ != policy::DeviceConsent::kDeviceAllowed) {
+ LOG4CXX_ERROR(logger_, "Resumption abort. Data consent wasn't allowed");
+ SetupDefaultHMILevel(application);
+ return false;
+ }
+
+
+ if ((hmi_level == application->hmi_level()) &&
+ (hmi_level != mobile_apis::HMILevel::HMI_NONE)) {
+ LOG4CXX_WARN(logger_, "Hmi level " << hmi_level << " should not be set to "
+ << application->mobile_app_id()->asString() << " " << application->hmi_level());
+
+ return false;
+ }
+
+ if (hmi_level == mobile_apis::HMILevel::HMI_FULL) {
+#ifdef ENABLE_LOG
+ seted_up_hmi_level = app_mngr_->PutApplicationInFull(application);
+#else
+ app_mngr_->PutApplicationInFull(application);
+#endif
+ } else if (hmi_level == mobile_apis::HMILevel::HMI_LIMITED) {
+#ifdef ENABLE_LOG
+ seted_up_hmi_level = app_mngr_->PutApplicationInLimited(application);
+#else
+ app_mngr_->PutApplicationInLimited(application);
+#endif
+ if (audio_streaming_state == mobile_apis::AudioStreamingState::AUDIBLE) {
+ //implemented SDLAQ-CRS-839
+ //checking the existence of application with AudioStreamingState=AUDIBLE
+ //notification resumeAudioSource is sent if only resumed application has
+ //AudioStreamingState=AUDIBLE
+ bool application_exist_with_audible_state = false;
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ const std::set<ApplicationSharedPtr> app_list = accessor.applications();
+ std::set<ApplicationSharedPtr>::const_iterator app_list_it = app_list.begin();
+ uint32_t app_id = application->app_id();
+ for (; app_list.end() != app_list_it; ++app_list_it) {
+ if (((*app_list_it)->audio_streaming_state() ==
+ mobile_apis::AudioStreamingState::AUDIBLE) &&
+ ((*app_list_it))->app_id() != app_id) {
+ application_exist_with_audible_state = true;
+ break;
+ }
+ }
+ if (application_exist_with_audible_state) {
+ application->set_audio_streaming_state(
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE);
+ } else {
+ MessageHelper::SendOnResumeAudioSourceToHMI(application->app_id());
+ }
+ }
+ }
+ application->set_hmi_level(hmi_level);
+ if (hmi_level != mobile_apis::HMILevel::HMI_FULL) {
+ //APPLINK-7244
+ MessageHelper::SendHMIStatusNotification(*(application.get()));
+ }
+
+ LOG4CXX_INFO(logger_, "Set up application "
+ << application->mobile_app_id()->asString()
+ << " to HMILevel " << seted_up_hmi_level);
+ return true;
+}
+
+bool ResumeCtrl::RestoreApplicationData(ApplicationSharedPtr application) {
+ LOG4CXX_INFO(logger_, "RestoreApplicationData");
+ DCHECK(application.get());
+
+ Json::Value::iterator it = GetSavedApplications().begin();
+ for (; it != GetSavedApplications().end(); ++it) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+ if (saved_m_app_id == application->mobile_app_id()->asString()) {
+ break;
+ }
+ }
+
+ if (it == GetSavedApplications().end()) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return false;
+ }
+
+ Json::Value& saved_app = *it;
+ MessageHelper::SmartObjectList requests;
+
+ LOG4CXX_INFO(logger_, saved_app.toStyledString());
+ Json::Value& app_commands = saved_app[strings::application_commands];
+ Json::Value& app_submenus = saved_app[strings::application_submenus];
+ Json::Value& app_choise_sets = saved_app[strings::application_choise_sets];
+ Json::Value& global_properties = saved_app[strings::application_global_properties];
+ Json::Value& subscribtions = saved_app[strings::application_subscribtions];
+ Json::Value& application_files = saved_app[strings::application_files];
+ uint32_t app_grammar_id = saved_app[strings::grammar_id].asUInt();
+ application->set_grammar_id(app_grammar_id);
+
+
+ // files
+ for (Json::Value::iterator json_it = application_files.begin();
+ json_it != application_files.end(); ++json_it) {
+ Json::Value& file_data = *json_it;
+
+ bool is_persistent = file_data[strings::persistent_file].asBool();
+ if (is_persistent) {
+ AppFile file;
+ file.is_persistent = is_persistent;
+ file.is_download_complete = file_data[strings::is_download_complete].asBool();
+ file.file_name = file_data[strings::sync_file_name].asString();
+ file.file_type = static_cast<mobile_apis::FileType::eType> (
+ file_data[strings::file_type].asInt());
+ LOG4CXX_INFO(logger_, "RestoreApplicationData file " << file.file_name);
+ application->AddFile(file);
+ }
+ }
+
+ //add submenus
+ for (Json::Value::iterator json_it = app_submenus.begin();
+ json_it != app_submenus.end(); ++json_it) {
+ Json::Value& json_submenu = *json_it;
+ smart_objects::SmartObject message = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_submenu, message);
+ application->AddSubMenu(message[strings::menu_id].asUInt(), message);
+ }
+ requests = MessageHelper::CreateAddSubMenuRequestToHMI(application);
+
+ for (MessageHelper::SmartObjectList::iterator it = requests.begin();
+ it != requests.end(); ++it) {
+ ProcessHMIRequest(*it, true);
+ }
+
+ //add commands
+ for (Json::Value::iterator json_it = app_commands.begin();
+ json_it != app_commands.end(); ++json_it) {
+ Json::Value& json_command = *json_it;
+ smart_objects::SmartObject message = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_command, message);
+ application->AddCommand(message[strings::cmd_id].asUInt(), message);
+ }
+
+ requests = MessageHelper::CreateAddCommandRequestToHMI(application);
+
+ for (MessageHelper::SmartObjectList::iterator it = requests.begin();
+ it != requests.end(); ++it) {
+ ProcessHMIRequest(*it, true);
+ }
+
+ //add choisets
+ for (Json::Value::iterator json_it = app_choise_sets.begin();
+ json_it != app_choise_sets.end(); ++json_it) {
+ Json::Value& json_choiset = *json_it;
+ smart_objects::SmartObject msg_param = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_choiset , msg_param);
+ const int32_t choice_set_id = msg_param
+ [strings::interaction_choice_set_id].asInt();
+ uint32_t choice_grammar_id = msg_param[strings::grammar_id].asUInt();
+ application->AddChoiceSet(choice_set_id, msg_param);
+
+ for (size_t j = 0; j < msg_param[strings::choice_set].length(); ++j) {
+ smart_objects::SmartObject choise_params = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ choise_params[strings::app_id] = application->app_id();
+ choise_params[strings::cmd_id] =
+ msg_param[strings::choice_set][j][strings::choice_id];
+ choise_params[strings::vr_commands] = smart_objects::SmartObject(
+ smart_objects::SmartType_Array);
+ choise_params[strings::vr_commands] =
+ msg_param[strings::choice_set][j][strings::vr_commands];
+
+ choise_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ choise_params[strings::grammar_id] = choice_grammar_id;
+ SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &choise_params);
+ }
+ }
+
+ //setglobal properties
+ if (!global_properties.isNull()) {
+ smart_objects::SmartObject properties_so = smart_objects::SmartObject(
+ smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(global_properties , properties_so);
+
+ const smart_objects::SmartObject& vr_help_title =
+ properties_so.getElement(strings::vr_help_title);
+ if (vr_help_title.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ vr_help_title.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_vr_help_title(vr_help_title);
+ }
+
+ const smart_objects::SmartObject& vr_help =
+ properties_so.getElement(strings::vr_help);
+ if (vr_help.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ vr_help.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_vr_help(vr_help);
+ }
+
+ const smart_objects::SmartObject& timeout_prompt =
+ properties_so.getElement(strings::timeout_prompt);
+ if (timeout_prompt.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ timeout_prompt.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_timeout_prompt(timeout_prompt);
+ }
+
+ const smart_objects::SmartObject& help_prompt =
+ properties_so.getElement(strings::help_prompt);
+ if (help_prompt.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ help_prompt.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_help_prompt(help_prompt);
+ }
+
+ const smart_objects::SmartObject& keyboard_properties =
+ properties_so.getElement(strings::keyboard_properties);
+ if (keyboard_properties.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ keyboard_properties.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_keyboard_props(keyboard_properties);
+ }
+
+ const smart_objects::SmartObject& menu_title =
+ properties_so.getElement(strings::menu_title);
+ if (menu_title.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ menu_title.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_menu_title(menu_title);
+ }
+
+ const smart_objects::SmartObject& menu_icon =
+ properties_so.getElement(strings::menu_icon);
+ if (menu_icon.getType() != smart_objects::SmartType::SmartType_Invalid &&
+ menu_icon.getType() != smart_objects::SmartType::SmartType_Null) {
+ application->set_menu_icon(menu_icon);
+ }
+
+ MessageHelper::SendGlobalPropertiesToHMI(application);
+ }
+
+ //subscribes
+ if (!subscribtions.isNull()) {
+ Json::Value& subscribtions_buttons = subscribtions[strings::application_buttons];
+ Json::Value& subscribtions_ivi= subscribtions[strings::application_vehicle_info];
+ for (Json::Value::iterator json_it = subscribtions_buttons.begin();
+ json_it != subscribtions_buttons.end(); ++json_it) {
+ mobile_apis::ButtonName::eType btn;
+ btn = static_cast<mobile_apis::ButtonName::eType>((*json_it).asInt());
+ application->SubscribeToButton(btn);
+ }
+
+ for (Json::Value::iterator json_it = subscribtions_ivi.begin();
+ json_it != subscribtions_ivi.end(); ++json_it) {
+ VehicleDataType ivi;
+ ivi = static_cast<VehicleDataType>((*json_it).asInt());
+ LOG4CXX_INFO(logger_, "VehicleDataType :" << ivi);
+#ifdef ENABLE_LOG
+ bool result =
+#endif
+ application->SubscribeToIVI(ivi);
+ LOG4CXX_INFO(logger_, "result = :" << result);
+ }
+ requests = MessageHelper::GetIVISubscribtionRequests(application->app_id());
+
+ for (MessageHelper::SmartObjectList::iterator it = requests.begin();
+ it != requests.end(); ++it) {
+ ProcessHMIRequest(*it,true);
+ }
+ }
+ return true;
+}
+
+bool ResumeCtrl::IsHMIApplicationIdExist(uint32_t hmi_app_id) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::IsHMIApplicationIdExist " << hmi_app_id);
+
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ if ((*it)[strings::hmi_app_id].asUInt() == hmi_app_id) {
+ return true;
+ }
+ }
+
+ std::set<ApplicationSharedPtr>::iterator it =
+ app_mngr_->application_list_.begin();
+ std::set<ApplicationSharedPtr>::iterator it_end =
+ app_mngr_->application_list_.end();
+ for (;it != it_end; ++it) {
+ if (hmi_app_id == (*it)->hmi_app_id()) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool ResumeCtrl::IsApplicationSaved(const std::string& mobile_app_id) {
+ bool result = false;
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ if ((*it)[strings::app_id].asString() == mobile_app_id) {
+ result = true;
+ }
+ }
+ LOG4CXX_INFO(logger_, "IsApplicationSaved " << mobile_app_id << " : " << (result?"true":"false"));
+ return result;
+}
+
+uint32_t ResumeCtrl::GetHMIApplicationID(const std::string& mobile_app_id) {
+ uint32_t hmi_app_id = 0;
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ if ((*it)[strings::app_id].asString() == mobile_app_id) {
+ hmi_app_id = (*it)[strings::hmi_app_id].asUInt();
+ }
+ }
+
+ return hmi_app_id;
+}
+
+bool ResumeCtrl::RemoveApplicationFromSaved(ApplicationConstSharedPtr application) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::RemoveApplicationFromSaved ");
+ DCHECK(application.get());
+
+ bool result = false;
+ std::vector<Json::Value> temp;
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+
+ if (saved_m_app_id != application->mobile_app_id()->asString()) {
+ temp.push_back((*it));
+ } else {
+ result = true;
+ }
+ }
+
+ if (false == result) {
+ return result;
+ }
+
+ GetSavedApplications().clear();
+ for (std::vector<Json::Value>::iterator it = temp.begin();
+ it != temp.end(); ++it) {
+ GetSavedApplications().append((*it));
+ }
+ return result;
+}
+
+void ResumeCtrl::IgnitionOff() {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::IgnitionOff()");
+
+ Json::Value to_save;
+ for (Json::Value::iterator it = GetSavedApplications().begin();
+ it != GetSavedApplications().end(); ++it) {
+ uint32_t ign_off_count = (*it)[strings::ign_off_count].asUInt();
+ if (ign_off_count < kApplicationLifes) {
+ ign_off_count++;
+ (*it)[strings::ign_off_count] = ign_off_count;
+ to_save.append(*it);
+ }
+ }
+ SetSavedApplication(to_save);
+}
+
+bool ResumeCtrl::StartResumption(ApplicationSharedPtr application,
+ uint32_t hash) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::StartResumption");
+ if (!application.valid()) {
+ LOG4CXX_WARN(logger_, "Application not exist");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, " app_id = " << application->app_id()
+ << " hmi_app_id = " << application->hmi_app_id()
+ << " mobile_id = "
+ << application->mobile_app_id()->asString());
+
+ Json::Value::iterator it = GetSavedApplications().begin();
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ for (; it != GetSavedApplications().end(); ++it) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+
+ if (saved_m_app_id == application->mobile_app_id()->asString()) {
+
+ uint32_t saved_hash = (*it)[strings::hash_id].asUInt();
+ uint32_t time_stamp= (*it)[strings::time_stamp].asUInt();
+
+ if (hash == saved_hash) {
+ RestoreApplicationData(application);
+ }
+
+ application->UpdateHash();
+ if (!timer_.isRunning() && accessor.applications().size() > 1) {
+ RestoreApplicationHMILevel(application);
+ RemoveApplicationFromSaved(application);
+ } else {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ SetupDefaultHMILevel(application);
+ waiting_for_timer_.insert(std::make_pair(application->app_id(),
+ time_stamp));
+ timer_.start(kTimeStep);
+ }
+ return true;
+ }
+ }
+
+ LOG4CXX_INFO(logger_, "ResumeCtrl::Application wasn't saved");
+ MessageHelper::SendHMIStatusNotification(*application);
+ return false;
+}
+
+bool ResumeCtrl::StartResumptionOnlyHMILevel(ApplicationSharedPtr application) {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::StartResumptionOnlyHMILevel");
+ if (!application.valid()) {
+ LOG4CXX_WARN(logger_, "Application not exist");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "app_id = " << application->app_id()
+ << "mobile_id = "
+ << application->mobile_app_id()->asString());
+
+ Json::Value::iterator it = GetSavedApplications().begin();
+ ApplicationManagerImpl::ApplicationListAccessor accessor;
+ for (; it != GetSavedApplications().end(); ++it) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+ if (saved_m_app_id == application->mobile_app_id()->asString()) {
+ uint32_t time_stamp= (*it)[strings::time_stamp].asUInt();
+ if (!timer_.isRunning() && accessor.applications().size() > 1) {
+ // resume in case there is already registered app
+ RestoreApplicationHMILevel(application);
+ RemoveApplicationFromSaved(application);
+ } else {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ SetupDefaultHMILevel(application);
+ waiting_for_timer_.insert(std::make_pair(application->app_id(),
+ time_stamp));
+ // woun't start timer if it is active already
+ timer_.start(kTimeStep);
+ }
+ return true;
+ }
+ }
+
+ LOG4CXX_INFO(logger_, "ResumeCtrl::Application wasn't saved");
+ MessageHelper::SendHMIStatusNotification(*application);
+ return false;
+}
+
+bool ResumeCtrl::CheckPersistenceFilesForResumption(ApplicationSharedPtr application) {
+ LOG4CXX_INFO(logger_, "CheckPersistenceFilesForResumption");
+ DCHECK(application.get());
+
+ Json::Value::iterator it = GetSavedApplications().begin();
+ for (; it != GetSavedApplications().end(); ++it) {
+ const std::string& saved_m_app_id = (*it)[strings::app_id].asString();
+
+ if (saved_m_app_id == application->mobile_app_id()->asString()) {
+ break;
+ }
+ }
+
+ if (it == GetSavedApplications().end()) {
+ LOG4CXX_WARN(logger_, "Application not saved");
+ return false;
+ }
+
+ Json::Value& saved_app = *it;
+ MessageHelper::SmartObjectList requests;
+
+ LOG4CXX_INFO(logger_, saved_app.toStyledString());
+ Json::Value& app_commands = saved_app[strings::application_commands];
+ Json::Value& app_choise_sets = saved_app[strings::application_choise_sets];
+
+ //add commands
+ for (Json::Value::iterator json_it = app_commands.begin();
+ json_it != app_commands.end(); ++json_it) {
+ Json::Value& json_command = *json_it;
+ smart_objects::SmartObject message =
+ smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_command, message);
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyImageFiles(message, application);
+ if (verification_result == mobile_apis::Result::INVALID_DATA) {
+ LOG4CXX_WARN(logger_, "app_commands missed icons");
+ return false;
+ }
+ }
+
+ //add choice sets
+ for (Json::Value::iterator json_it = app_choise_sets.begin();
+ json_it != app_choise_sets.end(); ++json_it) {
+ Json::Value& json_choiset = *json_it;
+ smart_objects::SmartObject msg_param =
+ smart_objects::SmartObject(smart_objects::SmartType::SmartType_Map);
+ Formatters::CFormatterJsonBase::jsonValueToObj(json_choiset , msg_param);
+ mobile_apis::Result::eType verification_result =
+ MessageHelper::VerifyImageFiles(msg_param, application);
+ if (verification_result == mobile_apis::Result::INVALID_DATA) {
+ LOG4CXX_WARN(logger_, "app_choise_sets missed icons");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool ResumeCtrl::CheckApplicationHash(ApplicationSharedPtr application,
+ uint32_t hash) {
+ Json::Value::iterator it = GetSavedApplications().begin();
+ for (; it != GetSavedApplications().end(); ++it) {
+ std::string saved_m_app_id = (*it)[strings::app_id].asString();
+
+ if (saved_m_app_id == application->mobile_app_id()->asString()) {
+ uint32_t saved_hash = (*it)[strings::hash_id].asUInt();
+ LOG4CXX_INFO(logger_, "received hash = " << hash);
+ LOG4CXX_INFO(logger_, "saved hash = " << saved_hash);
+ if (hash == saved_hash) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+void ResumeCtrl::onTimer() {
+ LOG4CXX_INFO(logger_, "ResumeCtrl::onTimer() size is "
+ << waiting_for_timer_.size());
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+
+ std::multiset<application_timestamp, TimeStampComparator>::iterator it=
+ waiting_for_timer_.begin();
+
+ for (; it != waiting_for_timer_.end(); ++it) {
+ ApplicationSharedPtr app =
+ ApplicationManagerImpl::instance()->application((*it).first);
+ if (!app.get()) {
+ LOG4CXX_ERROR(logger_, "Invalid app_id = " << (*it).first);
+ continue;
+ }
+
+ RestoreApplicationHMILevel(app);
+ RemoveApplicationFromSaved(app);
+ }
+
+ waiting_for_timer_.clear();
+}
+
+bool ResumeCtrl::IsDeviceMacAddressEqual(ApplicationSharedPtr application,
+ const std::string& saved_device_mac) {
+ const std::string device_mac =
+ MessageHelper::GetDeviceMacAddressForHandle(application->device());
+
+ return device_mac == saved_device_mac;
+}
+
+Json::Value& ResumeCtrl::GetSavedApplications() {
+ return resumption::LastState::instance()->dictionary[strings::resumption];
+}
+
+void ResumeCtrl::SetSavedApplication(Json::Value& apps_json) {
+ resumption::LastState::instance()->dictionary[strings::resumption] = apps_json ;
+}
+
+void ResumeCtrl::ClearResumptionInfo() {
+ Json::Value empty_json;
+
+ SetSavedApplication(empty_json);
+ resumption::LastState::instance()->SaveToFileSystem();
+}
+
+Json::Value ResumeCtrl::GetApplicationCommands(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationCommands "
+ << application->app_id());
+
+ Json::Value result;
+ const CommandsMap& commands = application->commands_map();
+ CommandsMap::const_iterator it = commands.begin();
+ for (;it != commands.end(); ++it) {
+ smart_objects::SmartObject* so = it->second;
+ Json::Value curr;
+ Formatters::CFormatterJsonBase::objToJsonValue(*so, curr);
+ result.append(curr);
+ LOG4CXX_INFO(logger_, "Converted:" << curr.toStyledString());
+ }
+ return result;
+}
+
+Json::Value ResumeCtrl::GetApplicationSubMenus(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationCommands "
+ << application->app_id());
+
+ Json::Value result;
+ const SubMenuMap& sub_menus = application->sub_menu_map();
+ SubMenuMap::const_iterator it = sub_menus.begin();
+ for (;it != sub_menus.end(); ++it) {
+ smart_objects::SmartObject* so = it->second;
+ Json::Value curr;
+ Formatters::CFormatterJsonBase::objToJsonValue(*so, curr);
+ result.append(curr);
+ LOG4CXX_INFO(logger_, "Converted:" << curr.toStyledString());
+ }
+ return result;
+}
+
+Json::Value ResumeCtrl::GetApplicationInteractionChoiseSets(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationInteractionChoiseSets "
+ << application->app_id());
+
+ Json::Value result;
+ const ChoiceSetMap& choices = application->choice_set_map();
+ ChoiceSetMap::const_iterator it = choices.begin();
+ for ( ;it != choices.end(); ++it) {
+ smart_objects::SmartObject* so = it->second;
+ Json::Value curr;
+ Formatters::CFormatterJsonBase::objToJsonValue(*so, curr);
+ result.append(curr);
+ LOG4CXX_INFO(logger_, "Converted:" << curr.toStyledString());
+ }
+ return result;
+}
+
+Json::Value ResumeCtrl::GetApplicationGlobalProperties(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationGlobalProperties "
+ << application->app_id());
+
+ Json::Value result;
+ const smart_objects::SmartObject* help_promt = application->help_prompt();
+ const smart_objects::SmartObject* timeout_prompt = application->timeout_prompt();
+ const smart_objects::SmartObject* vr_help = application->vr_help();
+ const smart_objects::SmartObject* vr_help_title = application->vr_help_title();
+ const smart_objects::SmartObject* vr_synonyms = application->vr_synonyms();
+ const smart_objects::SmartObject* keyboard_props = application->keyboard_props();
+ const smart_objects::SmartObject* menu_title = application->menu_title();
+ const smart_objects::SmartObject* menu_icon = application->menu_icon();
+
+ Json::Value sgp;
+ sgp[strings::help_prompt] = JsonFromSO(help_promt);
+ sgp[strings::timeout_prompt] = JsonFromSO(timeout_prompt);
+ sgp[strings::vr_help] = JsonFromSO(vr_help);
+ sgp[strings::vr_help_title] = JsonFromSO(vr_help_title);
+ sgp[strings::vr_synonyms] = JsonFromSO(vr_synonyms);
+ sgp[strings::keyboard_properties] = JsonFromSO(keyboard_props);
+ sgp[strings::menu_title] = JsonFromSO(menu_title);
+ sgp[strings::menu_icon] = JsonFromSO(menu_icon);
+
+ return sgp;
+}
+
+Json::Value ResumeCtrl::GetApplicationSubscriptions(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationSubscriptions "
+ << application->app_id());
+
+ Json::Value result;
+ std::set<mobile_apis::ButtonName::eType>::iterator it_button ;
+ std::set<uint32_t>::iterator it_vehicle;
+
+ for (it_button = application->SubscribedButtons().begin() ;
+ it_button != application->SubscribedButtons().end(); ++it_button) {
+ result[strings::application_buttons].append(*it_button);
+ }
+ for (it_vehicle = application->SubscribesIVI().begin();
+ it_vehicle != application->SubscribesIVI().end(); ++it_vehicle) {
+ result[strings::application_vehicle_info].append(*it_vehicle);
+ }
+ return result;
+}
+
+Json::Value ResumeCtrl::GetApplicationFiles(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationFiles "
+ << application->app_id());
+
+ Json::Value result;
+ const AppFilesMap& app_files = application->getAppFiles();
+ for(AppFilesMap::const_iterator file_it = app_files.begin();
+ file_it != app_files.end(); file_it++) {
+ const AppFile& file = file_it->second;
+ if (file.is_persistent) {
+ Json::Value file_data;
+ file_data[strings::persistent_file] = file.is_persistent;
+ file_data[strings::is_download_complete] = file.is_download_complete;
+ file_data[strings::sync_file_name] = file.file_name;
+ file_data[strings::file_type] = file.file_type;
+ result.append(file_data);
+ }
+ }
+ return result;
+}
+
+Json::Value ResumeCtrl::GetApplicationShow(
+ ApplicationConstSharedPtr application) {
+ DCHECK(application.get());
+ LOG4CXX_INFO(logger_, "ResumeCtrl::GetApplicationShow "
+ << application->app_id());
+
+ Json::Value result;
+ const smart_objects::SmartObject* show_so = application->show_command();
+ if (!show_so) {
+ return result;
+ }
+ result = JsonFromSO(show_so);
+ return result;
+}
+
+Json::Value ResumeCtrl::JsonFromSO(const smart_objects::SmartObject *so) {
+ Json::Value temp;
+ if (so) {
+ Formatters::CFormatterJsonBase::objToJsonValue(*so, temp);
+ }
+ return temp;
+}
+
+bool ResumeCtrl::ProcessHMIRequest(smart_objects::SmartObject* request,
+ bool use_events) {
+ if (use_events) {
+ const hmi_apis::FunctionID::eType function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*request)[strings::function_id].asInt());
+
+ const int32_t hmi_correlation_id =
+ (*request)[strings::correlation_id].asInt();
+ subscribe_on_event(function_id, hmi_correlation_id);
+ }
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(request)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ return true;
+ }
+ return false;
+}
+
+void ResumeCtrl::SendHMIRequest(
+ const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params, bool use_events) {
+
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* result =
+ MessageHelper::CreateModuleInfoSO(function_id);
+ int32_t hmi_correlation_id =
+ (*result)[strings::params][strings::correlation_id].asInt();
+ if (use_events) {
+ subscribe_on_event(function_id, hmi_correlation_id);
+ }
+
+ if (msg_params) {
+ (*result)[strings::msg_params] = *msg_params;
+ }
+
+ if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
+ }
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
new file mode 100644
index 0000000000..44ab164538
--- /dev/null
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -0,0 +1,125 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/usage_statistics.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/enum_schema_item.h"
+#include "usage_statistics/statistics_manager.h"
+#include "utils/macro.h"
+
+using namespace mobile_apis;
+using namespace NsSmartDeviceLink::NsSmartObjects;
+using namespace usage_statistics;
+
+namespace application_manager {
+
+namespace {
+
+std::string LanguageIdToString(Language::eType lang_id) {
+ const char* str;
+ const bool ok = EnumConversionHelper<Language::eType>::EnumToCString(lang_id, &str);
+ return ok ? str : "unknown";
+}
+
+} // namespace
+
+UsageStatistics::UsageStatistics(const std::string& app_id,
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager)
+ : time_in_hmi_state_(statistics_manager, app_id),
+ app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI),
+ app_registration_language_vui_(statistics_manager, app_id, LANGUAGE_VUI),
+ count_of_rejected_rpc_calls_(statistics_manager, app_id,
+ REJECTED_RPC_CALLS),
+ count_of_rpcs_sent_in_hmi_none_(statistics_manager, app_id,
+ RPCS_IN_HMI_NONE),
+ count_of_user_selections_(statistics_manager, app_id, USER_SELECTIONS),
+ count_of_run_attempts_while_revoked_(statistics_manager, app_id,
+ RUN_ATTEMPTS_WHILE_REVOKED),
+ count_of_removals_for_bad_behavior_(statistics_manager, app_id,
+ REMOVALS_MISBEHAVED) {
+ time_in_hmi_state_.Start(SECONDS_HMI_NONE);
+}
+
+void UsageStatistics::RecordHmiStateChanged(HMILevel::eType new_hmi_level) {
+ using namespace mobile_apis::HMILevel;
+ AppStopwatchId next_stopwatch = SECONDS_HMI_NONE;
+ switch (new_hmi_level) {
+ case HMI_FULL:
+ next_stopwatch = SECONDS_HMI_FULL;
+ break;
+ case HMI_LIMITED:
+ next_stopwatch = SECONDS_HMI_LIMITED;
+ break;
+ case HMI_BACKGROUND:
+ next_stopwatch = SECONDS_HMI_BACKGROUND;
+ break;
+ case HMI_NONE:
+ next_stopwatch = SECONDS_HMI_NONE;
+ break;
+ default:
+ NOTREACHED();
+ }
+ time_in_hmi_state_.Switch(next_stopwatch);
+}
+
+void UsageStatistics::RecordAppRegistrationGuiLanguage(
+ Language::eType gui_language) {
+ app_registration_language_gui_.Update(LanguageIdToString(gui_language));
+}
+
+void UsageStatistics::RecordAppRegistrationVuiLanguage(
+ Language::eType vui_language) {
+ app_registration_language_gui_.Update(LanguageIdToString(vui_language));
+}
+
+void UsageStatistics::RecordRpcSentInHMINone() {
+ ++count_of_rpcs_sent_in_hmi_none_;
+}
+
+void UsageStatistics::RecordPolicyRejectedRpcCall() {
+ ++count_of_rejected_rpc_calls_;
+}
+
+void UsageStatistics::RecordAppUserSelection() {
+ ++count_of_user_selections_;
+}
+
+void UsageStatistics::RecordRunAttemptsWhileRevoked() {
+ ++count_of_run_attempts_while_revoked_;
+}
+
+void UsageStatistics::RecordRemovalsForBadBehavior() {
+ ++count_of_removals_for_bad_behavior_;
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
new file mode 100644
index 0000000000..d3dee343d5
--- /dev/null
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -0,0 +1,107 @@
+#Replace include for mocking singltone
+get_property(the_include_dirs DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES)
+set(class_to_mock ${CMAKE_SOURCE_DIR}/src/components/application_manager/include)
+list(FIND the_include_dirs ${class_to_mock} find_idx)
+if(find_idx GREATER -1)
+ LIST_REPLACE(the_include_dirs ${find_idx} ${AM_MOCK_DIR}/include)
+endif()
+set_property(DIRECTORY "" PROPERTY INCLUDE_DIRECTORIES ${the_include_dirs})
+
+include_directories (
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include
+)
+
+set(testSources
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/src/gmock_main.cc
+ ${AM_TEST_DIR}/command_impl_test.cc
+)
+set (mockedSources
+ ${AM_MOCK_DIR}/src/application_manager_impl.cc
+)
+
+set (AM_SOURCES
+ ${AM_SOURCE_DIR}/src/policies/policy_handler.cc
+ ${AM_SOURCE_DIR}/src/policies/policy_event_observer.cc
+
+ ${AM_SOURCE_DIR}/src/commands/command_impl.cc
+ ${AM_SOURCE_DIR}/src/commands/command_request_impl.cc
+ ${AM_SOURCE_DIR}/src/commands/command_response_impl.cc
+ ${AM_SOURCE_DIR}/src/commands/command_notification_impl.cc
+ ${AM_SOURCE_DIR}/src/commands/pending.cc
+
+ ${AM_SOURCE_DIR}/src/usage_statistics.cc
+ ${AM_SOURCE_DIR}/src/request_info.cc
+ ${AM_SOURCE_DIR}/src/message.cc
+ ${AM_SOURCE_DIR}/src/application_impl.cc
+ ${AM_SOURCE_DIR}/src/mobile_command_factory.cc
+ ${AM_SOURCE_DIR}/src/message_helper.cc
+ ${AM_SOURCE_DIR}/src/hmi_command_factory.cc
+ ${AM_SOURCE_DIR}/src/hmi_capabilities.cc
+ ${AM_SOURCE_DIR}/src/application_data_impl.cc
+ ${AM_SOURCE_DIR}/src/request_controller.cc
+ ${AM_SOURCE_DIR}/src/resume_ctrl.cpp
+ ${AM_SOURCE_DIR}/src/mobile_message_handler.cc
+)
+
+if (EXTENDED_POLICY_FLAG)
+ include_directories(
+ ${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct_ext
+ )
+ list(APPEND AM_SOURCES
+ ${COMPONENTS_DIR}/src/policies/pt_exchange_handler_ext.cc
+ )
+else ()
+ include_directories(
+ ${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct
+ )
+ list(APPEND AM_SOURCES
+ ${COMPONENTS_DIR}/application_manager/src/policies/pt_exchange_handler_impl.cc
+ ${COMPONENTS_DIR}/application_manager/src/policies/policy_retry_sequence.cc
+ )
+endif ()
+
+set(testLibraries
+ gmock
+ gtest
+ gmock
+ gmock_main
+ UsageStatistics
+ dl
+ ProtocolLibrary
+ )
+
+set(test_exec_libraries
+ HMI_API
+ MOBILE_API
+ v4_protocol_v1_2_no_extra
+ SmartObjects
+ formatters
+ ProtocolHandler
+ connectionHandler
+ HMIMessageHandler
+ Utils
+ jsoncpp
+ ConfigProfile
+ MediaManager
+ Resumption
+)
+IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
+ list(REMOVE_ITEM test_exec_libraries dl)
+endif()
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
+endif()
+
+add_library("ApplicationManagerTest" ${mockedSources} ${testSources} ${AM_SOURCES})
+target_link_libraries("ApplicationManagerTest" ${testLibraries} AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ AMEventEngine
+ AMPolicyLibrary)
+
+add_executable(application_manager_test ${testSources})
+target_link_libraries(application_manager_test ApplicationManagerTest ${test_exec_libraries})
diff --git a/src/components/application_manager/test/command_impl_test.cc b/src/components/application_manager/test/command_impl_test.cc
new file mode 100644
index 0000000000..40b16b5c28
--- /dev/null
+++ b/src/components/application_manager/test/command_impl_test.cc
@@ -0,0 +1,45 @@
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+
+using ::testing::Return;
+using ::testing::Truly;
+
+
+bool MessageResultCodeIsGENERIC_ERROR(const utils::SharedPtr<smart_objects::SmartObject>& message) {
+ if (!message) {
+ return false;
+ }
+ const smart_objects::SmartObject& so = *(message.get());
+ int32_t result_code = so[application_manager::strings::msg_params]
+ [application_manager::strings::result_code].asInt();
+ if (mobile_apis::Result::GENERIC_ERROR
+ == static_cast<mobile_apis::Result::eType>(result_code)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+TEST(ApplicationManagerTest, SingltoneTestCheckWork) {
+ application_manager::ApplicationManagerImpl* am = application_manager::ApplicationManagerImpl::instance();
+ application_manager::ApplicationManagerImpl* am2 = application_manager::ApplicationManagerImpl::instance();
+ ASSERT_TRUE(am == am2);
+ EXPECT_CALL((*am), GetNextHMICorrelationID()).WillRepeatedly(Return(1));
+ smart_objects::SmartObject* so = application_manager::MessageHelper::CreateModuleInfoSO(0);
+ delete so;
+ application_manager::ApplicationManagerImpl::destroy();
+}
+
+TEST(MobileCommandsTest, CommandImplTimeOut) {
+ application_manager::ApplicationManagerImpl* am = application_manager::ApplicationManagerImpl::instance();
+ smart_objects::SmartObject* so = application_manager::MessageHelper::CreateModuleInfoSO(0);
+ application_manager::commands::CommandRequestImpl request(so);
+ EXPECT_CALL((*am), ManageMobileCommand(Truly(MessageResultCodeIsGENERIC_ERROR)));
+ request.onTimeOut();
+ application_manager::ApplicationManagerImpl::destroy();
+}
diff --git a/src/components/application_manager/test/mock/include/application_manager/application.h b/src/components/application_manager/test/mock/include/application_manager/application.h
new file mode 100644
index 0000000000..636b0aaa41
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/application.h
@@ -0,0 +1,549 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
+
+#include <string>
+#include <map>
+#include "utils/shared_ptr.h"
+#include "interfaces/MOBILE_API.h"
+#include "connection_handler/device.h"
+#include "application_manager/message.h"
+#include <set>
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace mobile_api = mobile_apis;
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+typedef int32_t ErrorCode;
+
+class UsageStatistics;
+
+enum APIVersion {
+ kUnknownAPI = -1,
+ kAPIV0 = 0,
+ kAPIV1 = 1,
+ kAPIV2 = 2,
+ kAPIV3 = 3
+};
+
+enum TLimitSource {
+ POLICY_TABLE = 0,
+ CONFIG_FILE
+};
+
+
+struct Version {
+ APIVersion min_supported_api_version;
+ APIVersion max_supported_api_version;
+
+ Version()
+ : min_supported_api_version(APIVersion::kUnknownAPI),
+ max_supported_api_version(APIVersion::kUnknownAPI) {
+ }
+};
+
+struct AppFile {
+ // need to use in std::map;
+ AppFile() {
+ }
+ AppFile(const std::string& name, bool persistent, bool download_complete,
+ mobile_apis::FileType::eType type)
+ : file_name(name),
+ is_persistent(persistent),
+ is_download_complete(download_complete),
+ file_type(type){
+ }
+ std::string file_name;
+ bool is_persistent;
+ bool is_download_complete;
+ mobile_apis::FileType::eType file_type;
+};
+typedef std::map<std::string, AppFile> AppFilesMap;
+class InitialApplicationData {
+ public:
+ virtual ~InitialApplicationData() {
+ }
+
+ virtual const smart_objects::SmartObject* app_types() const = 0;
+ virtual const smart_objects::SmartObject* vr_synonyms() const = 0;
+ virtual const smart_objects::SmartObject* mobile_app_id() const = 0;
+ virtual const smart_objects::SmartObject* tts_name() const = 0;
+ virtual const smart_objects::SmartObject* ngn_media_screen_name() const = 0;
+ virtual const mobile_api::Language::eType& language() const = 0;
+ virtual const mobile_api::Language::eType& ui_language() const = 0;
+ virtual void set_app_types(const smart_objects::SmartObject& app_types) = 0;
+ virtual void set_vr_synonyms(
+ const smart_objects::SmartObject& vr_synonyms) = 0;
+ virtual void set_mobile_app_id(
+ const smart_objects::SmartObject& mobile_app_id) = 0;
+ virtual void set_tts_name(const smart_objects::SmartObject& tts_name) = 0;
+ virtual void set_ngn_media_screen_name(
+ const smart_objects::SmartObject& ngn_name) = 0;
+ virtual void set_language(const mobile_api::Language::eType& language) = 0;
+ virtual void set_ui_language(
+ const mobile_api::Language::eType& ui_language) = 0;
+};
+
+/*
+ * @brief Typedef for supported commands in application menu
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> CommandsMap;
+
+/*
+ * @brief Typedef for supported sub menu in application menu
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> SubMenuMap;
+
+/*
+ * @brief Typedef for interaction choice set
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> ChoiceSetMap;
+
+/*
+ * @brief Typedef for perform interaction choice set
+ */
+typedef std::map<uint32_t, smart_objects::SmartObject*> PerformChoiceSetMap;
+
+/**
+ * @brief Defines id of SoftButton
+ */
+typedef std::set<uint32_t> SoftButtonID;
+
+class DynamicApplicationData {
+ public:
+ virtual ~DynamicApplicationData() {
+ }
+ virtual const smart_objects::SmartObject* help_prompt() const = 0;
+ virtual const smart_objects::SmartObject* timeout_prompt() const = 0;
+ virtual const smart_objects::SmartObject* vr_help_title() const = 0;
+ virtual const smart_objects::SmartObject* vr_help() const = 0;
+ virtual const mobile_api::TBTState::eType& tbt_state() const = 0;
+ virtual const smart_objects::SmartObject* show_command() const = 0;
+ virtual const smart_objects::SmartObject* tbt_show_command() const = 0;
+ virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const = 0;
+ virtual const std::set<uint32_t>& SubscribesIVI() const = 0;
+ virtual const smart_objects::SmartObject* keyboard_props() const = 0;
+ virtual const smart_objects::SmartObject* menu_title() const = 0;
+ virtual const smart_objects::SmartObject* menu_icon() const = 0;
+
+ virtual void set_help_prompt(
+ const smart_objects::SmartObject& help_prompt) = 0;
+ virtual void set_timeout_prompt(
+ const smart_objects::SmartObject& timeout_prompt) = 0;
+ virtual void set_vr_help_title(
+ const smart_objects::SmartObject& vr_help_title) = 0;
+ virtual void reset_vr_help_title() = 0;
+ virtual void set_vr_help(const smart_objects::SmartObject& vr_help) = 0;
+ virtual void reset_vr_help() = 0;
+ virtual void set_tbt_state(const mobile_api::TBTState::eType& tbt_state) = 0;
+ virtual void set_show_command(
+ const smart_objects::SmartObject& show_command) = 0;
+ virtual void set_tbt_show_command(
+ const smart_objects::SmartObject& tbt_show) = 0;
+ virtual void set_keyboard_props(
+ const smart_objects::SmartObject& keyboard_props) = 0;
+ virtual void set_menu_title(
+ const smart_objects::SmartObject& menu_title) = 0;
+ virtual void set_menu_icon(
+ const smart_objects::SmartObject& menu_icon) = 0;
+ /*
+ * @brief Adds a command to the in application menu
+ */
+ virtual void AddCommand(uint32_t cmd_id,
+ const smart_objects::SmartObject& command) = 0;
+
+ /*
+ * @brief Deletes all commands from the application
+ * menu with the specified command id
+ */
+ virtual void RemoveCommand(uint32_t cmd_id) = 0;
+
+ /*
+ * @brief Finds command with the specified command id
+ */
+ virtual smart_objects::SmartObject* FindCommand(uint32_t cmd_id) = 0;
+
+ /*
+ * @brief Adds a menu to the application
+ */
+ virtual void AddSubMenu(uint32_t menu_id,
+ const smart_objects::SmartObject& menu) = 0;
+
+ /*
+ * @brief Deletes menu from the application menu
+ */
+ virtual void RemoveSubMenu(uint32_t menu_id) = 0;
+
+ /*
+ * @brief Finds menu with the specified id
+ */
+ virtual smart_objects::SmartObject* FindSubMenu(
+ uint32_t menu_id) const = 0;
+
+ /*
+ * @brief Returns true if sub menu with such name already exist
+ */
+ virtual bool IsSubMenuNameAlreadyExist(const std::string& name) = 0;
+
+ /*
+ * @brief Adds a interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represent choice set
+ */
+ virtual void AddChoiceSet(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set) = 0;
+
+ /*
+ * @brief Deletes choice set from the application
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ virtual void RemoveChoiceSet(uint32_t choice_set_id) = 0;
+
+ /*
+ * @brief Finds choice set with the specified choice_set_id id
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ virtual smart_objects::SmartObject* FindChoiceSet(
+ uint32_t choice_set_id) = 0;
+
+ /*
+ * @brief Adds perform interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represents choice set
+ */
+ virtual void AddPerformInteractionChoiceSet(
+ uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set) = 0;
+
+ /*
+ * @brief Deletes entirely perform interaction choice set map
+ *
+ */
+ virtual void DeletePerformInteractionChoiceSetMap() = 0;
+
+ /*
+ * @brief Retrieves entirely ChoiceSet - VR commands map
+ *
+ * @return ChoiceSet map that is currently in use
+ */
+ virtual const PerformChoiceSetMap&
+ performinteraction_choice_set_map() const = 0;
+
+ /*
+ * @brief Retrieves choice set that is currently in use by perform
+ * interaction
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ *
+ * @return SmartObject that represents choice set
+ */
+ virtual smart_objects::SmartObject* FindPerformInteractionChoiceSet(
+ uint32_t choice_set_id) const = 0;
+
+ /*
+ * @brief Retrieve application commands
+ */
+ virtual const CommandsMap& commands_map() const = 0;
+
+ /*
+ * @brief Retrieve application sub menus
+ */
+ virtual const SubMenuMap& sub_menu_map() const = 0;
+
+ /*
+ * @brief Retrieve application choice set map
+ */
+ virtual const ChoiceSetMap& choice_set_map() const = 0;
+
+ /*
+ * @brief Sets perform interaction state
+ *
+ * @param active Current state of the perform interaction
+ */
+ virtual void set_perform_interaction_active(uint32_t active) = 0;
+
+ /*
+ * @brief Retrieves perform interaction state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ virtual uint32_t is_perform_interaction_active() const = 0;
+
+ /*
+ * @brief Sets the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @param choice Choice that was selected
+ */
+ virtual void set_perform_interaction_ui_corrid(uint32_t choice) = 0;
+
+ /*
+ * @brief Retrieve the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @return Choice that was selected in response to PerformInteraction
+ */
+ virtual uint32_t perform_interaction_ui_corrid() const = 0;
+
+ /*
+ * @brief Sets the mode for perform interaction: UI/VR/BOTH
+ *
+ * @param mode Mode that was selected (MENU; VR; BOTH)
+ */
+ virtual void set_perform_interaction_mode(int32_t mode) = 0;
+
+ /*
+ * @brief Retrieve the mode that was PerformInteraction sent in
+ *
+ * @return mode of PerformInteraction
+ */
+ virtual int32_t perform_interaction_mode() const = 0;
+
+ /*
+ * @brief Sets reset global properties state
+ *
+ * @param active Current state of the reset global properties
+ */
+ virtual void set_reset_global_properties_active(bool active) = 0;
+
+ /*
+ * @brief Retrieves reset global properties state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ virtual bool is_reset_global_properties_active() const = 0;
+};
+
+class Application : public virtual InitialApplicationData,
+ public virtual DynamicApplicationData {
+ public:
+ virtual ~Application() {
+ }
+
+ /**
+ * @brief Returns message belonging to the application
+ * that is currently executed (i.e. on HMI).
+ * @return smart_objects::SmartObject * Active message
+ */
+ virtual const smart_objects::SmartObject* active_message() const = 0;
+
+ /**
+ * @brief Change Hash value and return it
+ * @return next Hash value
+ */
+ virtual uint32_t nextHash() = 0;
+
+ /**
+ * @brief returns cuurent hash value
+ * @return current Hash value
+ */
+ virtual uint32_t curHash() const = 0;
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
+ virtual uint32_t UpdateHash() = 0;
+
+ virtual void CloseActiveMessage() = 0;
+ virtual bool IsFullscreen() const = 0;
+ virtual bool MakeFullscreen() = 0;
+ virtual bool IsAudible() const = 0;
+ virtual void MakeNotAudible() = 0;
+
+ virtual bool allowed_support_navigation() const = 0;
+ virtual void set_allowed_support_navigation(bool allow) = 0;
+ virtual bool hmi_supports_navi_video_streaming() const = 0;
+ virtual void set_hmi_supports_navi_video_streaming(bool supports) = 0;
+ virtual bool hmi_supports_navi_audio_streaming() const = 0;
+ virtual void set_hmi_supports_navi_audio_streaming(bool supports) = 0;
+
+ virtual bool app_allowed() const = 0;
+ virtual bool has_been_activated() const = 0;
+
+ virtual const Version& version() const = 0;
+ virtual void set_hmi_application_id(uint32_t hmi_app_id) = 0;
+ virtual uint32_t hmi_app_id() const = 0;
+ virtual uint32_t app_id() const = 0;
+ virtual const std::string& name() const = 0;
+ virtual const std::string folder_name() const = 0;
+ virtual bool is_media_application() const = 0;
+ virtual const mobile_api::HMILevel::eType& hmi_level() const = 0;
+ virtual const uint32_t put_file_in_none_count() const = 0;
+ virtual const uint32_t delete_file_in_none_count() const = 0;
+ virtual const uint32_t list_files_in_none_count() const = 0;
+ virtual const mobile_api::SystemContext::eType& system_context() const = 0;
+ virtual const mobile_api::AudioStreamingState::eType&
+ audio_streaming_state() const = 0;
+ virtual const std::string& app_icon_path() const = 0;
+ virtual connection_handler::DeviceHandle device() const = 0;
+ virtual void set_tts_speak_state(bool state_tts_speak) = 0;
+ virtual bool tts_speak_state() = 0;
+ /**
+ * @brief sets true if application has sent TTS GlobalProperties
+ * request with empty array help_prompt to HMI with level
+ * NONE BACKGROUND
+ * @param active contains state of sending TTS GlobalProperties
+ */
+ virtual void set_tts_properties_in_none(
+ bool active) = 0;
+ /**
+ * @brief returns true if application has sent TTS GlobalProperties
+ * otherwise return false
+ * @return flag tts_properties_in_none
+ */
+ virtual bool tts_properties_in_none() = 0;
+ /**
+ * @brief sets true if application has sent TTS GlobalProperties
+ * request with default array help_prompt to HMI with level
+ * FULL LIMITED
+ * @param active contains state of sending TTS GlobalProperties
+ */
+ virtual void set_tts_properties_in_full(
+ bool active) = 0;
+ /**
+ * @brief returns true if application has sent TTS GlobalProperties
+ * otherwise return false
+ * @return flag tts_properties_in_full
+ */
+ virtual bool tts_properties_in_full() = 0;
+ virtual void set_version(const Version& version) = 0;
+ virtual void set_name(const std::string& name) = 0;
+ virtual void set_is_media_application(bool is_media) = 0;
+ virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
+ virtual void increment_put_file_in_none_count() = 0;
+ virtual void increment_delete_file_in_none_count() = 0;
+ virtual void increment_list_files_in_none_count() = 0;
+ virtual void set_system_context(
+ const mobile_api::SystemContext::eType& system_context) = 0;
+ virtual void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) = 0;
+ virtual bool set_app_icon_path(const std::string& file_name) = 0;
+ virtual void set_app_allowed(const bool& allowed) = 0;
+ virtual void set_device(connection_handler::DeviceHandle device) = 0;
+ virtual uint32_t get_grammar_id() const = 0 ;
+ virtual void set_grammar_id(uint32_t value) = 0;
+
+ virtual void set_protocol_version(
+ const ProtocolVersion& protocol_version) = 0;
+ virtual ProtocolVersion protocol_version() const = 0;
+
+ virtual bool AddFile(AppFile& file) = 0;
+ virtual const AppFilesMap& getAppFiles() const = 0;
+
+ /**
+ * @brief Updates fields of existing file
+ * @param file_name File name, that need to update
+ * @param is_persistent Bollean describes is file persistent?
+ * @param is_download_complete Bollean describes is file downloaded fully on need to finish downloading?
+ * @return TRUE if file exist and updated sucsesfuly, othervise return false
+ */
+ virtual bool UpdateFile(AppFile& file) = 0;
+ virtual bool DeleteFile(const std::string& file_name) = 0;
+ virtual const AppFile* GetFile(const std::string& file_name) = 0;
+
+ virtual bool SubscribeToButton(mobile_apis::ButtonName::eType btn_name) = 0;
+ virtual bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name) = 0;
+ virtual bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name) = 0;
+
+ virtual bool SubscribeToIVI(uint32_t vehicle_info_type_) = 0;
+ virtual bool IsSubscribedToIVI(uint32_t vehicle_info_type_) = 0;
+ virtual bool UnsubscribeFromIVI(uint32_t vehicle_info_type_) = 0;
+
+ /**
+ * @brief Check, if limits for command number per time is exceeded
+ * @param cmd_id Unique command id from mobile API
+ * @param source Limits source, e.g. policy table, config file etc.
+ * @return true, if - excedeed, otherwise - false
+ */
+ virtual bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source) = 0;
+
+ /**
+ * Returns object for recording statistics
+ * @return object for recording statistics
+ */
+ virtual UsageStatistics& usage_report() = 0;
+
+ /**
+ * @brief Keeps id of softbuttons which is created in commands:
+ * Alert, Show, ScrollableMessage, ShowConstantTBT, AlertManeuver, UpdateTurnList
+ * @param cmd_id Unique command id from mobile API
+ * @param list of softbuttons were created by command.
+ */
+ virtual void SubscribeToSoftButtons(int32_t cmd_id,
+ const SoftButtonID& softbuttons_id) = 0;
+
+ /**
+ * @brief Determine the existence of softbutton
+ * @param Softbutton_id contains id of softbutton
+ * @return Returns true if application contains softbutton id otherwise returns false.
+ */
+ virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id) = 0;
+
+ /**
+ * @brief Removes list of softbuttons which is created in commands
+ * @param cmd_id Unique command id from mobile API
+ */
+ virtual void UnsubscribeFromSoftButtons(int32_t cmd_id) = 0;
+
+ protected:
+
+ // interfaces for NAVI retry sequence
+ virtual bool video_stream_retry_active() const = 0;
+ virtual void set_video_stream_retry_active(bool active) = 0;
+ virtual bool audio_stream_retry_active() const = 0;
+ virtual void set_audio_stream_retry_active(bool active) = 0;
+ virtual void OnVideoStreamRetry() = 0;
+ virtual void OnAudioStreamRetry() = 0;
+};
+
+typedef utils::SharedPtr<Application> ApplicationSharedPtr;
+typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
new file mode 100644
index 0000000000..556eee4349
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/application_data_impl.h
@@ -0,0 +1,328 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
+
+#include <string>
+#include "smart_objects/smart_object.h"
+#include "application_manager/application.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace mobile_api = mobile_apis;
+
+class InitialApplicationDataImpl : public virtual Application {
+ public:
+ InitialApplicationDataImpl();
+ ~InitialApplicationDataImpl();
+
+ const smart_objects::SmartObject* app_types() const;
+ const smart_objects::SmartObject* vr_synonyms() const;
+ const smart_objects::SmartObject* mobile_app_id() const;
+ const smart_objects::SmartObject* tts_name() const;
+ const smart_objects::SmartObject* ngn_media_screen_name() const;
+ const mobile_api::Language::eType& language() const;
+ const mobile_api::Language::eType& ui_language() const;
+ void set_app_types(const smart_objects::SmartObject& app_types);
+ void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms);
+ void set_mobile_app_id(const smart_objects::SmartObject& mobile_app_id);
+ void set_tts_name(const smart_objects::SmartObject& tts_name);
+ void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name);
+ void set_language(const mobile_api::Language::eType& language);
+ void set_ui_language(const mobile_api::Language::eType& ui_language);
+
+ protected:
+ smart_objects::SmartObject* app_types_;
+ smart_objects::SmartObject* vr_synonyms_;
+ smart_objects::SmartObject* mobile_app_id_;
+ smart_objects::SmartObject* tts_name_;
+ smart_objects::SmartObject* ngn_media_screen_name_;
+ mobile_api::Language::eType language_;
+ mobile_api::Language::eType ui_language_;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl);
+};
+
+class DynamicApplicationDataImpl : public virtual Application {
+ public:
+ DynamicApplicationDataImpl();
+ ~DynamicApplicationDataImpl();
+ const smart_objects::SmartObject* help_prompt() const;
+ const smart_objects::SmartObject* timeout_prompt() const;
+ const smart_objects::SmartObject* vr_help_title() const;
+ const smart_objects::SmartObject* vr_help() const;
+ const mobile_api::TBTState::eType& tbt_state() const;
+ const smart_objects::SmartObject* show_command() const;
+ const smart_objects::SmartObject* tbt_show_command() const;
+ const smart_objects::SmartObject* keyboard_props() const;
+ const smart_objects::SmartObject* menu_title() const;
+ const smart_objects::SmartObject* menu_icon() const;
+
+ void set_help_prompt(const smart_objects::SmartObject& help_prompt);
+ void set_timeout_prompt(const smart_objects::SmartObject& timeout_prompt);
+ void set_vr_help_title(const smart_objects::SmartObject& vr_help_title);
+ void reset_vr_help_title();
+ void set_vr_help(const smart_objects::SmartObject& vr_help);
+ void reset_vr_help();
+ void set_tbt_state(const mobile_api::TBTState::eType& tbt_state);
+ void set_show_command(const smart_objects::SmartObject& show_command);
+ void set_tbt_show_command(const smart_objects::SmartObject& tbt_show);
+ void set_keyboard_props(const smart_objects::SmartObject& keyboard_props);
+ void set_menu_title(const smart_objects::SmartObject& menu_title);
+ void set_menu_icon(const smart_objects::SmartObject& menu_icon);
+ /*
+ * @brief Adds a command to the in application menu
+ */
+ void AddCommand(uint32_t cmd_id,
+ const smart_objects::SmartObject& command);
+
+ /*
+ * @brief Deletes all commands from the application menu with the specified command id
+ */
+ void RemoveCommand(uint32_t cmd_id);
+
+ /*
+ * @brief Finds command with the specified command id
+ */
+ smart_objects::SmartObject* FindCommand(uint32_t cmd_id);
+
+ /*
+ * @brief Adds a menu to the application
+ */
+ void AddSubMenu(uint32_t menu_id, const smart_objects::SmartObject& menu);
+
+ /*
+ * @brief Deletes menu from the application menu
+ */
+ void RemoveSubMenu(uint32_t menu_id);
+
+ /*
+ * @brief Finds menu with the specified id
+ */
+ smart_objects::SmartObject* FindSubMenu(uint32_t menu_id) const;
+
+ /*
+ * @brief Returns true if sub menu with such name already exist
+ */
+ bool IsSubMenuNameAlreadyExist(const std::string& name);
+
+ /*
+ * @brief Adds a interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represent choice set
+ */
+ void AddChoiceSet(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set);
+
+ /*
+ * @brief Deletes choice set from the application
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ void RemoveChoiceSet(uint32_t choice_set_id);
+
+ /*
+ * @brief Finds choice set with the specified choice_set_id id
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ */
+ smart_objects::SmartObject* FindChoiceSet(uint32_t choice_set_id);
+
+ /*
+ * @brief Adds perform interaction choice set to the application
+ *
+ * @param choice_set_id Unique ID used for this interaction choice set
+ * @param choice_set SmartObject that represents choice set
+ */
+ void AddPerformInteractionChoiceSet(
+ uint32_t choice_set_id, const smart_objects::SmartObject& choice_set);
+
+ /*
+ * @brief Deletes entirely perform interaction choice set map
+ *
+ */
+ void DeletePerformInteractionChoiceSetMap();
+
+ /*
+ * @brief Retrieves entirely ChoiceSet - VR commands map
+ *
+ * @return ChoiceSet map that is currently in use
+ */
+ inline const PerformChoiceSetMap& performinteraction_choice_set_map() const;
+
+ /*
+ * @brief Retrieves choice set that is currently in use by perform
+ * interaction
+ *
+ * @param choice_set_id Unique ID of the interaction choice set
+ *
+ * @return SmartObject that represents choice set
+ */
+ smart_objects::SmartObject* FindPerformInteractionChoiceSet(
+ uint32_t choice_set_id) const;
+
+ /*
+ * @brief Retrieve application commands
+ */
+ inline const CommandsMap& commands_map() const;
+
+ /*
+ * @brief Retrieve application sub menus
+ */
+ inline const SubMenuMap& sub_menu_map() const;
+
+ /*
+ * @brief Retrieve application choice set map
+ */
+ inline const ChoiceSetMap& choice_set_map() const;
+
+ /*
+ * @brief Sets perform interaction state
+ *
+ * @param active Current state of the perform interaction
+ */
+ void set_perform_interaction_active(uint32_t active);
+
+ /*
+ * @brief Retrieves perform interaction state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ inline uint32_t is_perform_interaction_active() const;
+
+ /*
+ * @brief Sets the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @param choice Choice that was selected
+ */
+ void set_perform_interaction_ui_corrid(uint32_t corr_id);
+
+ /*
+ * @brief Retrieve the choice that was selected in
+ * response to PerformInteraction
+ *
+ * @return Choice that was selected in response to PerformInteraction
+ */
+ inline uint32_t perform_interaction_ui_corrid() const;
+ /*
+ * @brief Sets the mode for perform interaction: UI/VR/BOTH
+ *
+ * @param mode Mode that was selected (MENU; VR; BOTH)
+ */
+ void set_perform_interaction_mode(int32_t mode);
+
+ /*
+ * @brief Retrieve the mode that was PerformInteraction sent in
+ *
+ * @return mode of PerformInteraction
+ */
+ inline int32_t perform_interaction_mode() const;
+
+ /*
+ * @brief Sets reset global properties state
+ *
+ * @param active Current state of the reset global properties
+ */
+ void set_reset_global_properties_active(bool active);
+
+ /*
+ * @brief Retrieves reset global properties state
+ *
+ * @return TRUE if perform interaction active, otherwise FALSE
+ */
+ inline bool is_reset_global_properties_active() const;
+
+ protected:
+ smart_objects::SmartObject* help_prompt_;
+ smart_objects::SmartObject* timeout_prompt_;
+ smart_objects::SmartObject* vr_help_title_;
+ smart_objects::SmartObject* vr_help_;
+ mobile_api::TBTState::eType tbt_state_;
+ smart_objects::SmartObject* show_command_;
+ smart_objects::SmartObject* keyboard_props_;
+ smart_objects::SmartObject* menu_title_;
+ smart_objects::SmartObject* menu_icon_;
+ smart_objects::SmartObject* tbt_show_command_;
+
+
+ CommandsMap commands_;
+ SubMenuMap sub_menu_;
+ ChoiceSetMap choice_set_map_;
+ PerformChoiceSetMap performinteraction_choice_set_map_;
+ uint32_t is_perform_interaction_active_;
+ uint32_t perform_interaction_ui_corrid_;
+ bool is_reset_global_properties_active_;
+ int32_t perform_interaction_mode_;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl);
+};
+
+const CommandsMap& DynamicApplicationDataImpl::commands_map() const {
+ return commands_;
+}
+
+const SubMenuMap& DynamicApplicationDataImpl::sub_menu_map() const {
+ return sub_menu_;
+}
+
+const ChoiceSetMap& DynamicApplicationDataImpl::choice_set_map() const {
+ return choice_set_map_;
+}
+
+uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const {
+ return is_perform_interaction_active_;
+}
+
+uint32_t DynamicApplicationDataImpl::perform_interaction_ui_corrid() const {
+ return perform_interaction_ui_corrid_;
+}
+
+bool DynamicApplicationDataImpl::is_reset_global_properties_active() const {
+ return is_reset_global_properties_active_;
+}
+
+const PerformChoiceSetMap&
+DynamicApplicationDataImpl::performinteraction_choice_set_map() const {
+ return performinteraction_choice_set_map_;
+}
+
+inline int32_t DynamicApplicationDataImpl::perform_interaction_mode() const {
+ return perform_interaction_mode_;
+}
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_impl.h
new file mode 100644
index 0000000000..0a056df92b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/application_impl.h
@@ -0,0 +1,275 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
+
+#include <map>
+#include <set>
+#include <vector>
+#include <utility>
+
+#include "utils/date_time.h"
+#include "application_manager/application_data_impl.h"
+#include "application_manager/usage_statistics.h"
+#include "connection_handler/device.h"
+#include "utils/timer_thread.h"
+#include "utils/lock.h"
+
+namespace usage_statistics {
+class StatisticsManager;
+} // namespace usage_statistics
+
+namespace application_manager {
+namespace mobile_api = mobile_apis;
+
+class ApplicationImpl : public virtual InitialApplicationDataImpl,
+ public virtual DynamicApplicationDataImpl {
+ public:
+ ApplicationImpl(uint32_t application_id,
+ const std::string& mobile_app_id,
+ const std::string& app_name,
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager);
+
+ ~ApplicationImpl();
+
+ /**
+ * @brief Returns message belonging to the application
+ * that is currently executed (i.e. on HMI).
+ * @return smart_objects::SmartObject * Active message
+ */
+ const smart_objects::SmartObject* active_message() const;
+ void CloseActiveMessage();
+ bool IsFullscreen() const;
+ bool MakeFullscreen();
+ bool IsAudible() const;
+ void MakeNotAudible();
+
+ // navi
+ bool allowed_support_navigation() const;
+ void set_allowed_support_navigation(bool allow);
+ bool hmi_supports_navi_video_streaming() const;
+ void set_hmi_supports_navi_video_streaming(bool supports);
+ bool hmi_supports_navi_audio_streaming() const;
+ void set_hmi_supports_navi_audio_streaming(bool supports);
+
+ inline bool app_allowed() const;
+ bool has_been_activated() const;
+
+ const Version& version() const;
+ void set_hmi_application_id(uint32_t hmi_app_id);
+ inline uint32_t hmi_app_id() const;
+ inline uint32_t app_id() const;
+ const std::string& name() const;
+ const std::string folder_name() const;
+ bool is_media_application() const;
+ const mobile_api::HMILevel::eType& hmi_level() const;
+ const uint32_t put_file_in_none_count() const;
+ const uint32_t delete_file_in_none_count() const;
+ const uint32_t list_files_in_none_count() const;
+ const mobile_api::SystemContext::eType& system_context() const;
+ inline const mobile_api::AudioStreamingState::eType&
+ audio_streaming_state() const;
+ const std::string& app_icon_path() const;
+ connection_handler::DeviceHandle device() const;
+ void set_tts_speak_state(bool state_tts_speak);
+ bool tts_speak_state();
+ void set_tts_properties_in_none(bool active);
+ bool tts_properties_in_none();
+ void set_tts_properties_in_full(bool active);
+ bool tts_properties_in_full();
+ void set_version(const Version& ver);
+ void set_name(const std::string& name);
+ void set_is_media_application(bool is_media);
+ void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level);
+ void increment_put_file_in_none_count();
+ void increment_delete_file_in_none_count();
+ void increment_list_files_in_none_count();
+ void set_system_context(
+ const mobile_api::SystemContext::eType& system_context);
+ void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state);
+ bool set_app_icon_path(const std::string& path);
+ void set_app_allowed(const bool& allowed);
+ void set_device(connection_handler::DeviceHandle device);
+ virtual uint32_t get_grammar_id() const;
+ virtual void set_grammar_id(uint32_t value);
+
+ virtual void set_protocol_version(const ProtocolVersion& protocol_version);
+ virtual ProtocolVersion protocol_version() const;
+
+ bool AddFile(AppFile& file);
+ bool UpdateFile(AppFile& file);
+
+ bool DeleteFile(const std::string& file_name);
+ virtual const AppFilesMap& getAppFiles() const;
+
+ virtual const AppFile* GetFile(const std::string& file_name);
+
+ bool SubscribeToButton(mobile_apis::ButtonName::eType btn_name);
+ bool IsSubscribedToButton(mobile_apis::ButtonName::eType btn_name);
+ bool UnsubscribeFromButton(mobile_apis::ButtonName::eType btn_name);
+
+ bool SubscribeToIVI(uint32_t vehicle_info_type_);
+ bool IsSubscribedToIVI(uint32_t vehicle_info_type_);
+ bool UnsubscribeFromIVI(uint32_t vehicle_info_type_);
+
+ virtual const std::set<mobile_apis::ButtonName::eType>& SubscribedButtons() const;
+ virtual const std::set<uint32_t>& SubscribesIVI() const;
+
+ virtual uint32_t nextHash();
+ virtual uint32_t curHash() const;
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
+ virtual uint32_t UpdateHash();
+
+ UsageStatistics& usage_report();
+
+ bool IsCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source);
+ virtual void SubscribeToSoftButtons(int32_t cmd_id,
+ const SoftButtonID& softbuttons_id);
+ virtual bool IsSubscribedToSoftButton(const uint32_t softbutton_id);
+
+ virtual void UnsubscribeFromSoftButtons(int32_t cmd_id);
+
+ protected:
+
+ /**
+ * @brief Clean up application folder. Persistent files will stay
+ */
+ void CleanupFiles();
+
+ /**
+ * @brief Load persistent files from application folder.
+ */
+ void LoadPersistentFiles();
+
+ private:
+
+ // interfaces for NAVI retry sequence
+ bool video_stream_retry_active() const;
+ void set_video_stream_retry_active(bool active);
+ bool audio_stream_retry_active() const;
+ void set_audio_stream_retry_active(bool active);
+ void OnVideoStreamRetry();
+ void OnAudioStreamRetry();
+
+ uint32_t hash_val_;
+ uint32_t grammar_id_;
+
+
+ Version version_;
+ std::string app_name_;
+ uint32_t hmi_app_id_;
+ uint32_t app_id_;
+ smart_objects::SmartObject* active_message_;
+ bool is_media_;
+ bool allowed_support_navigation_;
+ bool hmi_supports_navi_video_streaming_;
+ bool hmi_supports_navi_audio_streaming_;
+ bool is_app_allowed_;
+ bool has_been_activated_;
+ bool tts_speak_state_;
+ bool tts_properties_in_none_;
+ bool tts_properties_in_full_;
+ mobile_api::HMILevel::eType hmi_level_;
+ uint32_t put_file_in_none_count_;
+ uint32_t delete_file_in_none_count_;
+ uint32_t list_files_in_none_count_;
+ mobile_api::SystemContext::eType system_context_;
+ mobile_api::AudioStreamingState::eType audio_streaming_state_;
+ std::string app_icon_path_;
+ connection_handler::DeviceHandle device_;
+
+ AppFilesMap app_files_;
+ std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
+ std::set<uint32_t> subscribed_vehicle_info_;
+ UsageStatistics usage_report_;
+ ProtocolVersion protocol_version_;
+
+ // NAVI retry stream
+ volatile bool is_video_stream_retry_active_;
+ volatile bool is_audio_stream_retry_active_;
+ uint32_t video_stream_retry_number_;
+ uint32_t audio_stream_retry_number_;
+ utils::SharedPtr<timer::TimerThread<ApplicationImpl>> video_stream_retry_timer_;
+ utils::SharedPtr<timer::TimerThread<ApplicationImpl>> audio_stream_retry_timer_;
+
+
+ /**
+ * @brief Defines number per time in seconds limits
+ */
+ typedef std::pair<TimevalStruct, uint32_t> TimeToNumberLimit;
+
+ /**
+ * @brief Defines specific command number per time in seconds limits
+ */
+ typedef std::map<mobile_apis::FunctionID::eType, TimeToNumberLimit>
+ CommandNumberTimeLimit;
+
+ /**
+ * @brief Defines id of SoftButton which is related from name of command
+ */
+ typedef std::map<int32_t, SoftButtonID>
+ CommandSoftButtonID;
+ CommandNumberTimeLimit cmd_number_to_time_limits_;
+ CommandSoftButtonID cmd_softbuttonid_;
+ // Lock for command soft button id
+ sync_primitives::Lock cmd_softbuttonid_lock_;
+ DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
+};
+
+uint32_t ApplicationImpl::hmi_app_id() const {
+ return hmi_app_id_;
+}
+
+uint32_t ApplicationImpl::app_id() const {
+ return app_id_;
+}
+
+const mobile_api::AudioStreamingState::eType&
+ApplicationImpl::audio_streaming_state() const {
+ return audio_streaming_state_;
+}
+
+bool ApplicationImpl::app_allowed() const {
+ return is_app_allowed_;
+}
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager.h b/src/components/application_manager/test/mock/include/application_manager/application_manager.h
new file mode 100644
index 0000000000..6ca85a5d3f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/application_manager.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+
+// Other compomnents class declaration
+namespace hmi_message_handler {
+ class HMIMessageHandler;
+}
+namespace protocol_handler {
+ class ProtocolHandler;
+}
+namespace connection_handler {
+ class ConnectionHandler;
+}
+
+namespace application_manager {
+
+class Application;
+class HMIMatrix;
+
+class ApplicationManager {
+ public:
+ virtual ~ApplicationManager() {
+ }
+
+ /**
+ * Inits application manager
+ */
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Stop work.
+ *
+ * @return TRUE on success otherwise FALSE.
+ **/
+ virtual bool Stop() = 0;
+
+ virtual void set_hmi_message_handler(
+ hmi_message_handler::HMIMessageHandler* handler) = 0;
+ virtual void set_protocol_handler(
+ protocol_handler::ProtocolHandler* handler) = 0;
+ virtual void set_connection_handler(
+ connection_handler::ConnectionHandler* handler) = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
new file mode 100644
index 0000000000..dbee738564
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+#include <set>
+#include "application_manager/hmi_command_factory.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/message.h"
+#include "application_manager/request_controller.h"
+#include "application_manager/resume_ctrl.h"
+#include "application_manager/vehicle_info_data.h"
+#include "protocol_handler/protocol_observer.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_sender.h"
+
+#include "media_manager/media_manager_impl.h"
+
+#include "connection_handler/connection_handler_observer.h"
+#include "connection_handler/device.h"
+
+#include "formatters/CSmartFactory.hpp"
+
+#include "interfaces/HMI_API.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+
+#include "interfaces/v4_protocol_v1_2_no_extra.h"
+#include "interfaces/v4_protocol_v1_2_no_extra_schema.h"
+#ifdef TIME_TESTER
+#include "time_metric_observer.h"
+#endif // TIME_TESTER
+
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "utils/message_queue.h"
+#include "utils/prioritized_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/lock.h"
+#include "utils/singleton.h"
+
+namespace application_manager {
+ enum VRTTSSessionChanging {
+ kVRSessionChanging = 0,
+ kTTSSessionChanging = 1
+ };
+
+namespace impl {
+
+struct MessageFromMobile: public utils::SharedPtr<Message> {
+ explicit MessageFromMobile(const utils::SharedPtr<Message>& message)
+ : utils::SharedPtr<Message>(message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+struct MessageToMobile: public utils::SharedPtr<Message> {
+ explicit MessageToMobile(const utils::SharedPtr<Message>& message,
+ bool final_message)
+ : utils::SharedPtr<Message>(message),
+ is_final(final_message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+ // Signals if connection to mobile must be closed after sending this message
+ bool is_final;
+};
+
+struct MessageFromHmi: public utils::SharedPtr<Message> {
+ explicit MessageFromHmi(const utils::SharedPtr<Message>& message)
+ : utils::SharedPtr<Message>(message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+struct MessageToHmi: public utils::SharedPtr<Message> {
+ explicit MessageToHmi(const utils::SharedPtr<Message>& message)
+ : utils::SharedPtr<Message>(message) {
+ }
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return (*this)->Priority().OrderingValue();
+ }
+};
+
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> > FromMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> > ToMobileQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> > FromHmiQueue;
+typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> > ToHmiQueue;
+
+}
+typedef std::vector<std::string> RPCParams;
+
+class ApplicationManagerImpl : public ApplicationManager,
+ public hmi_message_handler::HMIMessageObserver,
+ public protocol_handler::ProtocolObserver,
+ public connection_handler::ConnectionHandlerObserver,
+ public impl::FromMobileQueue::Handler, public impl::ToMobileQueue::Handler,
+ public impl::FromHmiQueue::Handler, public impl::ToHmiQueue::Handler,
+ public utils::Singleton<ApplicationManagerImpl> {
+
+ friend class ResumeCtrl;
+ friend class CommandImpl;
+
+ public:
+ ApplicationManagerImpl() {
+ std::cout << "ApplicationManagerImpl Mock created " << std::endl;
+ }
+
+ MOCK_METHOD0(Init, bool());
+ MOCK_METHOD0(Stop, bool());
+ MOCK_METHOD1(OnMessageReceived, void (utils::SharedPtr<application_manager::Message>));
+ MOCK_METHOD1(OnErrorSending, void (utils::SharedPtr<application_manager::Message>));
+ MOCK_METHOD1(OnMessageReceived, void (const RawMessagePtr));
+ MOCK_METHOD1(OnMobileMessageSent, void (const RawMessagePtr));
+ MOCK_METHOD1(OnDeviceListUpdated, void (const connection_handler::DeviceMap&));
+ MOCK_METHOD0(OnFindNewApplicationsRequest, void ());
+ MOCK_METHOD1(RemoveDevice, void (const connection_handler::DeviceHandle&));
+ MOCK_METHOD3(OnServiceStartedCallback, bool (const connection_handler::DeviceHandle&,
+ const int32_t&,
+ const protocol_handler::ServiceType&));
+ MOCK_METHOD2(OnServiceEndedCallback, void (const int32_t&,
+ const protocol_handler::ServiceType&));
+ MOCK_METHOD1(Handle, void (const impl::MessageFromMobile));
+ MOCK_METHOD1(Handle, void (const impl::MessageToMobile));
+ MOCK_METHOD1(Handle, void (const impl::MessageFromHmi));
+ MOCK_METHOD1(Handle, void (const impl::MessageToHmi));
+
+ //ApplicationManager methods
+ MOCK_METHOD1(set_hmi_message_handler, void (hmi_message_handler::HMIMessageHandler*));
+ MOCK_METHOD1(set_protocol_handler, void (protocol_handler::ProtocolHandler*));
+ MOCK_METHOD1(set_connection_handler, void (connection_handler::ConnectionHandler*));
+
+ //ApplicationManagerImpl methods:
+
+ MOCK_METHOD1(SetTimeMetricObserver, void(AMMetricObserver*));
+ MOCK_METHOD1(RegisterApplication,
+ ApplicationSharedPtr(const utils::SharedPtr<smart_objects::SmartObject>&));
+ MOCK_METHOD0(hmi_capabilities, HMICapabilities& ());
+ MOCK_METHOD1(ManageHMICommand, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
+ MOCK_METHOD1(ManageMobileCommand, bool (const utils::SharedPtr<smart_objects::SmartObject>& message));
+ MOCK_METHOD1(SendMessageToHMI, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
+ MOCK_METHOD2(SendMessageToMobile, bool (const utils::SharedPtr<smart_objects::SmartObject>&,
+ bool));
+ MOCK_METHOD1(SendMessageToMobile, bool (const utils::SharedPtr<smart_objects::SmartObject>&));
+ MOCK_METHOD1(GetDeviceName, std::string (connection_handler::DeviceHandle));
+ MOCK_METHOD1(application, ApplicationSharedPtr (uint32_t));
+ MOCK_METHOD1(application_by_policy_id, ApplicationSharedPtr (const std::string&));
+ MOCK_METHOD1(RemoveAppDataFromHMI, bool(ApplicationSharedPtr));
+ MOCK_METHOD1(HeadUnitReset, void(mobile_api::AppInterfaceUnregisteredReason::eType));
+ MOCK_METHOD0(HeadUnitSuspend, void());
+ MOCK_METHOD1(LoadAppDataToHMI, bool(ApplicationSharedPtr));
+ MOCK_METHOD1(ActivateApplication, bool (ApplicationSharedPtr));
+ MOCK_METHOD1(PutApplicationInLimited, mobile_api::HMILevel::eType (ApplicationSharedPtr));
+ MOCK_METHOD1(PutApplicationInFull, mobile_api::HMILevel::eType (ApplicationSharedPtr));
+ MOCK_METHOD2(UnregisterRevokedApplication, void(uint32_t, mobile_apis::Result::eType));
+ MOCK_METHOD1(SetUnregisterAllApplicationsReason, void(mobile_api::AppInterfaceUnregisteredReason::eType));
+ MOCK_METHOD1(UnregisterAllApplications, void(bool));
+ MOCK_METHOD0(connection_handler, connection_handler::ConnectionHandler*());
+ MOCK_METHOD0(protocol_handler, protocol_handler::ProtocolHandler*());
+ MOCK_METHOD0(hmi_message_handler, hmi_message_handler::HMIMessageHandler*());
+ MOCK_METHOD5(CheckPolicyPermissions, mobile_apis::Result::eType(const std::string&,
+ mobile_apis::HMILevel::eType,
+ mobile_apis::FunctionID::eType,
+ const RPCParams&,
+ CommandParametersPermissions*));
+ MOCK_METHOD3(updateRequestTimeout, void(uint32_t, uint32_t, uint32_t));
+ MOCK_METHOD0(GenerateGrammarID, uint32_t());
+ MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
+ MOCK_METHOD1(GetAvailableSpaceForApp, uint32_t(const std::string&));
+ MOCK_METHOD0(begin_audio_pass_thru, bool ());
+ MOCK_METHOD0(end_audio_pass_thru, uint32_t());
+ MOCK_METHOD1(StopAudioPassThru, void(uint32_t));
+ MOCK_METHOD1(applications_by_button, std::vector<ApplicationSharedPtr>(uint32_t));
+ MOCK_METHOD0(applications_with_navi, std::vector<ApplicationSharedPtr>());
+ MOCK_METHOD1(applications_by_ivi, std::vector<ApplicationSharedPtr>(uint32_t));
+ MOCK_METHOD2(IviInfoUpdated, std::vector<utils::SharedPtr<Application>> (VehicleDataType,
+ int));
+ MOCK_METHOD6(StartAudioPassThruThread, void(uint32_t, uint32_t, uint32_t,
+ uint32_t, uint32_t, uint32_t));
+ MOCK_METHOD4(SaveBinary, mobile_apis::Result::eType(const std::vector<uint8_t>&,
+ const std::string&,
+ const std::string&,
+ const int64_t));
+ MOCK_METHOD1(ReplaceHMIByMobileAppId, void(smart_objects::SmartObject&));
+ MOCK_METHOD1(ReplaceMobileByHMIAppId, void(smart_objects::SmartObject&));
+ MOCK_METHOD0(resume_controller, ResumeCtrl&());
+ MOCK_METHOD1(IsVideoStreamingAllowed, bool(uint32_t));
+ MOCK_METHOD1(IsAudioStreamingAllowed, bool(uint32_t));
+ MOCK_METHOD1(Unmute, void(VRTTSSessionChanging));
+ MOCK_METHOD1(Mute, void(VRTTSSessionChanging));
+ MOCK_METHOD2(set_application_id, void(const int32_t, const uint32_t));
+ MOCK_METHOD1(application_id, uint32_t(const int32_t));
+ MOCK_METHOD1(removeNotification, void(const commands::Command*));
+ MOCK_METHOD1(addNotification, void(const CommandSharedPtr ));
+ MOCK_METHOD0(StartDevicesDiscovery, void());
+ MOCK_METHOD2(SendAudioPassThroughNotification, void(uint32_t, std::vector<uint8_t>));
+ MOCK_METHOD1(set_all_apps_allowed, void(const bool));
+ MOCK_CONST_METHOD0(all_apps_allowed, bool());
+ MOCK_METHOD1(set_vr_session_started, void(const bool));
+ MOCK_CONST_METHOD0(vr_session_started, bool());
+ MOCK_METHOD1(set_driver_distraction, void(const bool));
+ MOCK_CONST_METHOD0(driver_distraction, bool());
+ MOCK_METHOD1(ConnectToDevice, void(uint32_t));
+ MOCK_METHOD0(OnHMIStartedCooperation, void());
+ MOCK_METHOD0(GetNextHMICorrelationID, uint32_t ());
+ MOCK_CONST_METHOD0(IsHMICooperating, bool());
+ MOCK_METHOD0(OnTimerSendTTSGlobalProperties, void());
+ MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t));
+ MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList, void(const uint32_t));
+ MOCK_METHOD1(application_by_hmi_app, ApplicationSharedPtr(uint32_t));
+ MOCK_METHOD2(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType));
+ MOCK_METHOD3(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType,
+ bool));
+ MOCK_METHOD4(UnregisterApplication, void(const uint32_t,mobile_apis::Result::eType,
+ bool, bool));
+ MOCK_CONST_METHOD0(active_application, ApplicationSharedPtr ());
+ MOCK_METHOD0(OnApplicationListUpdateTimer, void());
+
+ typedef const std::set<ApplicationSharedPtr> TAppList;
+ typedef std::set<ApplicationSharedPtr>::iterator TAppListIt;
+ typedef std::set<ApplicationSharedPtr>::const_iterator TAppListConstIt;
+ class ApplicationListUpdateTimer : public timer::TimerThread<ApplicationManagerImpl> {
+ public:
+ ApplicationListUpdateTimer(ApplicationManagerImpl* callee) :
+ timer::TimerThread<ApplicationManagerImpl>("AM ListUpdater",
+ callee, &ApplicationManagerImpl::OnApplicationListUpdateTimer
+ ) {
+ }
+ };
+ typedef utils::SharedPtr<ApplicationListUpdateTimer> ApplicationListUpdateTimerSptr;
+
+ class ApplicationListAccessor {
+ public:
+ MOCK_METHOD0(applications, TAppList());
+ private:
+ };
+ friend class ApplicationListAccessor;
+
+ private:
+ //FIXME(AKutsan) In resume_controller is is nessesery to change realisation for remove using application_list_
+ std::set<ApplicationSharedPtr> application_list_;
+ FRIEND_BASE_SINGLETON_CLASS(ApplicationManagerImpl);
+};
+
+} //application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command.h b/src/components/application_manager/test/mock/include/application_manager/commands/command.h
new file mode 100644
index 0000000000..28c77b6229
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command.h
@@ -0,0 +1,99 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace application_manager {
+/**
+ * @brief SmartObject type
+ **/
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+typedef utils::SharedPtr<smart_objects::SmartObject> MessageSharedPtr;
+
+namespace commands {
+
+/**
+ * @brief Base command class
+ **/
+class Command {
+ public:
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ virtual bool CheckPermissions() = 0;
+
+ /**
+ * @brief Command initialization function
+ **/
+ virtual bool Init() = 0;
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() = 0;
+
+ /**
+ * @brief Free resources
+ **/
+ virtual bool CleanUp() = 0;
+
+ /**
+ * \brief Command class destructor
+ **/
+ virtual ~Command() {}
+
+ /**
+ * @brief Retrieves request default timeout.
+ * If request has a custom timeout, request_timeout_ should be reassign to it
+ *
+ * @return Request default timeout
+ */
+ virtual uint32_t default_timeout() const = 0;
+
+ /*
+ * @brief Retrieves correlation ID
+ */
+ virtual uint32_t correlation_id() const = 0;
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
new file mode 100644
index 0000000000..06637d7d84
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_impl.h
@@ -0,0 +1,123 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
+
+#include "application_manager/commands/command.h"
+#include "utils/logger.h"
+
+namespace application_manager {
+
+/**
+ * @brief Contains command parameters permissions (if any) defined in policy
+ * table
+ */
+struct CommandParametersPermissions {
+ std::vector<std::string> allowed_params;
+ std::vector<std::string> disallowed_params;
+ std::vector<std::string> undefined_params;
+};
+
+namespace commands {
+
+/**
+ * @brief Class is intended to encapsulate RPC as an object
+ **/
+class CommandImpl : public Command {
+ public:
+ /**
+ * @brief CommandImpl class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CommandImpl(const MessageSharedPtr& message);
+
+ /**
+ * @brief CommandImpl class destructor
+ *
+ **/
+ virtual ~CommandImpl();
+
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ virtual bool CheckPermissions();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Cleanup all resources used by command
+ **/
+ virtual bool CleanUp();
+
+ /**
+ * @brief Execute corresponding command by calling the action on reciever
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Retrieves request default timeout.
+ * If request has a custom timeout, request_timeout_ should be reassign to it
+ *
+ * @return Request default timeout
+ */
+ virtual uint32_t default_timeout() const;
+
+ /*
+ * @brief Retrieves correlation ID
+ */
+ virtual uint32_t correlation_id() const;
+
+ // members
+ static const int32_t hmi_protocol_type_;
+ static const int32_t mobile_protocol_type_;
+ static const int32_t protocol_version_;
+
+ protected:
+ MessageSharedPtr message_;
+ uint32_t default_timeout_;
+
+#ifdef ENABLE_LOG
+ static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandImpl);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
new file mode 100644
index 0000000000..7d0d11af89
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_notification_impl.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandNotificationImpl : public CommandImpl {
+ public:
+ explicit CommandNotificationImpl(const MessageSharedPtr& message);
+ virtual ~CommandNotificationImpl();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandNotificationImpl);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_NOTIFICATION_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
new file mode 100644
index 0000000000..fb14078961
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_request_impl.h
@@ -0,0 +1,209 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/lock.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+namespace commands {
+
+namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+class CommandRequestImpl : public CommandImpl,
+ public event_engine::EventObserver {
+ public:
+
+ enum RequestState {
+ kAwaitingHMIResponse = 0,
+ kTimedOut,
+ kCompleted
+ };
+
+ explicit CommandRequestImpl(const MessageSharedPtr& message);
+ virtual ~CommandRequestImpl();
+ virtual bool CheckPermissions();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ /*
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Default EvenObserver's pure virtual method implementation
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /*
+ * @brief Retrieves request ID
+ */
+ inline int32_t function_id() const;
+
+ /*
+ * @brief Retrieves connection key
+ */
+ inline uint32_t connection_key() const;
+
+ /*
+ * @brief Creates Mobile response
+ *
+ * @param success true if successful; false, if failed
+ * @param result_code Result code (SUCCESS, INVALID_DATA, e.t.c)
+ * @param info Provides additional human readable info regarding the result
+ * @param response_params Additional params in response
+ */
+ void SendResponse(const bool success,
+ const mobile_apis::Result::eType& result_code,
+ const char* info = NULL,
+ const NsSmart::SmartObject* response_params = NULL);
+
+ /**
+ * @brief Check syntax of string from mobile
+ * @param str - string that need to be checked
+ * @param allow_empty_string if true methods allow empty sting
+ * @return true if success otherwise return false
+ */
+ bool CheckSyntax(std::string str, bool allow_empty_line = false);
+
+ /*
+ * @brief Sends HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ * @param use_events true if we need subscribe on event(HMI request)
+ *
+ */
+ void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject* msg_params = NULL,
+ bool use_events = false);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMINotification(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject& msg_params) const;
+
+ /**
+ * @brief Converts HMI result code to Mobile result code
+ *
+ * @param hmi_code HMI result code
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const;
+
+protected:
+
+ /**
+ * @brief Checks message permissions and parameters according to policy table
+ * permissions
+ */
+ bool CheckAllowedParameters();
+
+ /**
+ * @brief Remove from current message parameters disallowed by policy table
+ * @param params_permissions Parameters permissions from policy table
+ */
+ void RemoveDisallowedParameters(
+ const CommandParametersPermissions& params_permissions);
+
+ /**
+ * @brief Adds disallowed parameters back to response with appropriate
+ * reasons
+ * @param response Response message, which should be extended with blocked
+ * parameters reasons
+ */
+ void AddDisallowedParameters(smart_objects::SmartObject& response);
+
+ /**
+ * @brief Checks if any request param was marked as disallowed by policy
+ * @return true if any param was marked as disallowed
+ */
+ bool HasDisallowedParams() const;
+
+ protected:
+ RequestState current_state_;
+ sync_primitives::Lock state_lock_;
+ CommandParametersPermissions parameters_permissions_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
+
+
+ /**
+ * @brief Adds param to disallowed parameters enumeration
+ * @param info string with disallowed params enumeration
+ * @param param disallowed param
+ */
+ void AddDissalowedParameterToInfoString(std::string& info,
+ const std::string& param) const;
+
+ /**
+ * @brief Adds disallowed parameters to response info
+ * @param response Response message, which info should be extended
+ */
+ void AddDisallowedParametersToInfo(smart_objects::SmartObject& response) const;
+};
+
+int32_t CommandRequestImpl::function_id() const {
+ return (*message_)[strings::params][strings::function_id].asInt();
+}
+
+uint32_t CommandRequestImpl::connection_key() const {
+ return (*message_)[strings::params][strings::connection_key].asUInt();
+}
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
new file mode 100644
index 0000000000..0c93bf54d4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/command_response_impl.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+class CommandResponseImpl : public CommandImpl {
+ public:
+ explicit CommandResponseImpl(const MessageSharedPtr& message);
+ virtual ~CommandResponseImpl();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendResponse(bool successe,
+ const mobile_apis::Result::eType& result_code =
+ mobile_apis::Result::INVALID_ENUM,
+ bool final_message = false);
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CommandResponseImpl);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
new file mode 100644
index 0000000000..3495ce1377
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_request.h
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ActivateAppRequest command class
+ **/
+class ActivateAppRequest : public RequestToHMI, event_engine::EventObserver {
+ public:
+ /**
+ * @brief ActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ActivateAppRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief Calback for response
+ *
+ * @param event - event response
+ **/
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief ActivateAppRequest class destructor
+ **/
+ virtual ~ActivateAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
new file mode 100644
index 0000000000..1df9bc095a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/activate_app_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ActivateAppResponse command class
+ **/
+class ActivateAppResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief ActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ActivateAppResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ActivateAppResponse class destructor
+ **/
+ virtual ~ActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
new file mode 100644
index 0000000000..1569af434d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/add_statistics_info_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddStatisticsInfoNotification command class
+ **/
+class AddStatisticsInfoNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief AddStatisticsInfoNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddStatisticsInfoNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddStatisticsInfoNotification class destructor
+ **/
+ virtual ~AddStatisticsInfoNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddStatisticsInfoNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
new file mode 100644
index 0000000000..6c2db489ce
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsRequest command class
+ **/
+class AllowAllAppsRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AllowAllAppsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAllAppsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAllAppsRequest class destructor
+ **/
+ virtual ~AllowAllAppsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
new file mode 100644
index 0000000000..0eb8184fa8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_all_apps_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAllAppsResponse command class
+ **/
+class AllowAllAppsResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAllAppsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAllAppsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAllAppsResponse class destructor
+ **/
+ virtual ~AllowAllAppsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAllAppsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
new file mode 100644
index 0000000000..91228440a2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAppRequest command class
+ **/
+class AllowAppRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AllowAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAppRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAppRequest class destructor
+ **/
+ virtual ~AllowAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
new file mode 100644
index 0000000000..5a24ac1a74
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/allow_app_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AllowAppResponse command class
+ **/
+class AllowAppResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AllowAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AllowAppResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AllowAppResponse class destructor
+ **/
+ virtual ~AllowAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AllowAppResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
new file mode 100644
index 0000000000..d066df813e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemRequest command class
+ **/
+class BasicCommunicationSystemRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit BasicCommunicationSystemRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief BasicCommunicationSystemRequest class destructor
+ **/
+ virtual ~BasicCommunicationSystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
new file mode 100644
index 0000000000..1948211c48
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/basic_communication_system_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief BasicCommunicationSystemResponse command class
+ **/
+class BasicCommunicationSystemResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief BasicCommunicationSystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit BasicCommunicationSystemResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief BasicCommunicationSystemResponse class destructor
+ **/
+ virtual ~BasicCommunicationSystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
new file mode 100644
index 0000000000..3c9fbac684
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class ButtonGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ButtonGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ButtonGetCapabilitiesRequest class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
new file mode 100644
index 0000000000..067954537d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/button_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesResponse command class
+ **/
+class ButtonGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief ButtonGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ButtonGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ButtonGetCapabilitiesResponse class destructor
+ **/
+ virtual ~ButtonGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ButtonGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
new file mode 100644
index 0000000000..72ff8a2c5b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ClosePopupRequest command class
+ **/
+class ClosePopupRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief ClosePopupRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ClosePopupRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ClosePopupRequest class destructor
+ **/
+ virtual ~ClosePopupRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
new file mode 100644
index 0000000000..05318e3cb9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/close_popup_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ClosePopupResponse command class
+ **/
+class ClosePopupResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief ClosePopupResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ClosePopupResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ClosePopupResponse class destructor
+ **/
+ virtual ~ClosePopupResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClosePopupResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
new file mode 100644
index 0000000000..8cb34718a1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetSystemInfoRequest command class
+ **/
+class GetSystemInfoRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief GetSystemInfoRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetSystemInfoRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetSystemInfoRequest class destructor
+ **/
+ virtual ~GetSystemInfoRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
new file mode 100644
index 0000000000..f10c07c52f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_system_info_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetSystemInfoResponse command class
+ **/
+class GetSystemInfoResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief GetSystemInfoResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetSystemInfoResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetSystemInfoResponse class destructor
+ **/
+ virtual ~GetSystemInfoResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
new file mode 100644
index 0000000000..9241446676
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls.h
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief GetUrls command class
+ **/
+class GetUrls : public RequestFromHMI {
+ public:
+ /**
+ * @brief GetUrls class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetUrls(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetUrls class destructor
+ **/
+ virtual ~GetUrls();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetUrls);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
new file mode 100644
index 0000000000..6b025142e2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/get_urls_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+class GetUrlsResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief GetUrlsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetUrlsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetUrlsResponse class destructor
+ **/
+ virtual ~GetUrlsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
new file mode 100644
index 0000000000..905b5b3836
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedRequest command class
+ **/
+class MixingAudioSupportedRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit MixingAudioSupportedRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief MixingAudioSupportedRequest class destructor
+ **/
+ virtual ~MixingAudioSupportedRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
new file mode 100644
index 0000000000..c8bfe4e156
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/mixing_audio_supported_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief MixingAudioSupportedResponse command class
+ **/
+class MixingAudioSupportedResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief MixingAudioSupportedResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit MixingAudioSupportedResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief MixingAudioSupportedResponse class destructor
+ **/
+ virtual ~MixingAudioSupportedResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MixingAudioSupportedResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
new file mode 100644
index 0000000000..1e2a39df94
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverRequest command class
+ **/
+class NaviAlertManeuverRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviAlertManeuverRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviAlertManeuverRequest class destructor
+ **/
+ virtual ~NaviAlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
new file mode 100644
index 0000000000..41e0f623f1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_alert_maneuver_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviAlertManeuverResponse command class
+ **/
+class NaviAlertManeuverResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviAlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviAlertManeuverResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviAlertManeuverResponse class destructor
+ **/
+ virtual ~NaviAlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviAlertManeuverResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
new file mode 100644
index 0000000000..a321d32dd9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamRequest command class
+ **/
+class AudioStartStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AudioStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStartStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~AudioStartStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
new file mode 100644
index 0000000000..01992eb3b7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_start_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AudioStartStreamResponse command class
+ **/
+class AudioStartStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStartStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AudioStartStreamResponse class destructor
+ **/
+ virtual ~AudioStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
new file mode 100644
index 0000000000..04bba8b752
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AudioStopStreamRequest command class
+ **/
+class AudioStopStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief AudioStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStopStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviStopStreamRequest class destructor
+ **/
+ virtual ~AudioStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
new file mode 100644
index 0000000000..7275ac34d8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class AudioStopStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief AudioStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AudioStopStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~AudioStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
new file mode 100644
index 0000000000..a31efc7fe4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyRequest command class
+ **/
+class NaviIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviIsReadyRequest class destructor
+ **/
+ virtual ~NaviIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVIGATION_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
new file mode 100644
index 0000000000..0fbad35154
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviIsReadyResponse command class
+ **/
+class NaviIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviIsReadyResponse class destructor
+ **/
+ virtual ~NaviIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
new file mode 100644
index 0000000000..9c91df648a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationRequest command class
+ */
+class NaviSendLocationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviSendLocationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ explicit NaviSendLocationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviSendLocationRequest class destructor
+ */
+ virtual ~NaviSendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
new file mode 100644
index 0000000000..029d903192
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_send_location_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviSendLocationResponse command class
+ */
+class NaviSendLocationResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSendLocationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ */
+ explicit NaviSendLocationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviSendLocationResponse class destructor
+ */
+ virtual ~NaviSendLocationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSendLocationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
new file mode 100644
index 0000000000..5da47e580b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTRequest command class
+ **/
+class NaviShowConstantTBTRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviShowConstantTBTRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviShowConstantTBTRequest class destructor
+ **/
+ virtual ~NaviShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
new file mode 100644
index 0000000000..4a26b26b09
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviShowConstantTBTResponse command class
+ **/
+class NaviShowConstantTBTResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviShowConstantTBTResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviShowConstantTBTResponse class destructor
+ **/
+ virtual ~NaviShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviShowConstantTBTResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
new file mode 100644
index 0000000000..f43b992219
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamRequest command class
+ **/
+class NaviStartStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviStartStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStartStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStartStreamRequest class destructor
+ **/
+ virtual ~NaviStartStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
new file mode 100644
index 0000000000..c94b6f219c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_start_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStartStreamResponse command class
+ **/
+class NaviStartStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStartStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStartStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviStartStreamResponse class destructor
+ **/
+ virtual ~NaviStartStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStartStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
new file mode 100644
index 0000000000..86b0981c22
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_request.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamRequest command class
+ **/
+class NaviStopStreamRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviStopStreamRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStopStreamRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviStopStreamRequest class destructor
+ **/
+ virtual ~NaviStopStreamRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
new file mode 100644
index 0000000000..6f4986e4c7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_stop_stream_response.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviStopStreamResponse command class
+ **/
+class NaviStopStreamResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviStopStreamResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviStopStreamResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviStopStreamResponse class destructor
+ **/
+ virtual ~NaviStopStreamResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviStopStreamResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
new file mode 100644
index 0000000000..61beef1b3b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListRequest command class
+ **/
+class NaviUpdateTurnListRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviUpdateTurnListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviUpdateTurnListRequest class destructor
+ **/
+ virtual ~NaviUpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
new file mode 100644
index 0000000000..9e711b8be9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/navi_update_turn_list_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviUpdateTurnListResponse command class
+ **/
+class NaviUpdateTurnListResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviUpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit NaviUpdateTurnListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief NaviUpdateTurnListResponse class destructor
+ **/
+ virtual ~NaviUpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviUpdateTurnListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
new file mode 100644
index 0000000000..219306d375
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_from_hmi.h
@@ -0,0 +1,69 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class CSmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+namespace NsSmartObj = NsSmartDeviceLink::NsSmartObjects;
+
+class NotificationFromHMI : public CommandImpl {
+ public:
+ explicit NotificationFromHMI(const MessageSharedPtr& message);
+ virtual ~NotificationFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotificationToMobile(const MessageSharedPtr& message);
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmartObj::SmartObject& msg_params) const;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_FROM_HMI_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
new file mode 100644
index 0000000000..2372754b63
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/notification_to_hmi.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class NotificationToHMI : public CommandImpl {
+ public:
+ explicit NotificationToHMI(const MessageSharedPtr& message);
+ virtual ~NotificationToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendNotification();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NotificationToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NOTIFICATION_TO_HMI_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
new file mode 100644
index 0000000000..aa549638e4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAllowSDLFunctionalityNotification command class
+ **/
+class OnAllowSDLFunctionalityNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAllowSDLFunctionalityNotification class destructor
+ **/
+ virtual ~OnAllowSDLFunctionalityNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
new file mode 100644
index 0000000000..a8bdeb6c91
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_activated_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppActivatedNotification command class
+ **/
+class OnAppActivatedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppActivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppActivatedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppActivatedNotification class destructor
+ **/
+ virtual ~OnAppActivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
new file mode 100644
index 0000000000..4c56dc4158
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_deactivated_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppDeactivatedNotification command class
+ **/
+class OnAppDeactivatedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppDeactivatedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppDeactivatedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppDeactivatedNotification class destructor
+ **/
+ virtual ~OnAppDeactivatedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppDeactivatedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
new file mode 100644
index 0000000000..034efb7a8c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionChangedNotification command class
+ **/
+class OnAppPermissionChangedNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppPermissionChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppPermissionChangedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppPermissionChangedNotification class destructor
+ **/
+ virtual ~OnAppPermissionChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
new file mode 100644
index 0000000000..a5037820cc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppPermissionConsentNotification command class
+ **/
+class OnAppPermissionConsentNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAppPermissionConsentNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppPermissionConsentNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppPermissionConsentNotification class destructor
+ **/
+ virtual ~OnAppPermissionConsentNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
new file mode 100644
index 0000000000..4364aa9a35
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_registered_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppRegisteredNotification command class
+ **/
+class OnAppRegisteredNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppRegisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppRegisteredNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppRegisteredNotification class destructor
+ **/
+ virtual ~OnAppRegisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppRegisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
new file mode 100644
index 0000000000..d8470af396
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_app_unregistered_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppUnregisteredNotification command class
+ **/
+class OnAppUnregisteredNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnAppUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppUnregisteredNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppUnregisteredNotification class destructor
+ **/
+ virtual ~OnAppUnregisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
new file mode 100644
index 0000000000..a4657ea24e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_event_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonEventNotification command class
+ **/
+class OnButtonEventNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
new file mode 100644
index 0000000000..065cdc4a72
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_button_press_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnButtonPressNotification command class
+ **/
+class OnButtonPressNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonPressNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
new file mode 100644
index 0000000000..e980bfe41b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_chosen_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnDeviceChosenNotification command class
+ **/
+class OnDeviceChosenNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceChosenNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDeviceChosenNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDeviceChosenNotification class destructor
+ **/
+ virtual ~OnDeviceChosenNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceChosenNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
new file mode 100644
index 0000000000..5c12bdfd9f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_device_state_changed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnDeviceStateChangedNotification command class
+ **/
+class OnDeviceStateChangedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDeviceStateChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDeviceStateChangedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDeviceStateChangedNotification class destructor
+ **/
+ virtual ~OnDeviceStateChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..77da5cf3b2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_driver_distraction_notification.h
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnDriverDistractionNotification command class
+ **/
+class OnDriverDistractionNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDriverDistractionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
new file mode 100644
index 0000000000..c913509e5e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnExitAllApplicationsNotification command class
+ **/
+class OnExitAllApplicationsNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitAllApplicationsNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnExitAllApplicationsNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnExitAllApplicationsNotification class destructor
+ **/
+ virtual ~OnExitAllApplicationsNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /**
+ * @brief Notify's HMI that SDL stored all data required for resumption
+ **/
+ void SendOnSDLPersistenceComplete();
+
+ DISALLOW_COPY_AND_ASSIGN(OnExitAllApplicationsNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
new file mode 100644
index 0000000000..b78c0e2afe
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_exit_application_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnExitApplicationNotification command class
+ **/
+class OnExitApplicationNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnExitApplicationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnExitApplicationNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnExitApplicationNotification class destructor
+ **/
+ virtual ~OnExitApplicationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnExitApplicationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
new file mode 100644
index 0000000000..b6b46041f8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_file_removed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnFileRemovedNotification command class
+ **/
+class OnFileRemovedNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnFileRemovedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnFileRemovedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnFileRemovedNotification class destructor
+ **/
+ virtual ~OnFileRemovedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFileRemovedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
new file mode 100644
index 0000000000..2499129b2c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_find_applications.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnFindApplications command class
+ **/
+class OnFindApplications : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnFindApplications class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnFindApplications(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnFindApplications class destructor
+ **/
+ virtual ~OnFindApplications();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnFindApplications);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
new file mode 100644
index 0000000000..ed0638f3cc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnIgnitionCycleOverNotification command class
+ **/
+class OnIgnitionCycleOverNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnIgnitionCycleOverNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnIgnitionCycleOverNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnIgnitionCycleOverNotification class destructor
+ **/
+ virtual ~OnIgnitionCycleOverNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
new file mode 100644
index 0000000000..6e42e1a0cd
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnNaviTBTClientStateNotification command class
+ **/
+class OnNaviTBTClientStateNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnNaviTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnNaviTBTClientStateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnNaviTBTClientStateNotification class destructor
+ **/
+ virtual ~OnNaviTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnNaviTBTClientStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
new file mode 100644
index 0000000000..8e463c3276
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_play_tone_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnPlayToneNotification command class
+ **/
+class OnPlayToneNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnPlayToneNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPlayToneNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPlayToneNotification class destructor
+ **/
+ virtual ~OnPlayToneNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPlayToneNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PLAY_TONE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
new file mode 100644
index 0000000000..f71de540e5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_policy_update.h
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+class OnPolicyUpdate : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPolicyUpdate(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPolicyUpdate class destructor
+ **/
+ virtual ~OnPolicyUpdate();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate);
+};
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
new file mode 100644
index 0000000000..839af785be
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_put_file_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnPutFileNotification command class
+ **/
+class OnPutFileNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnPutFileNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPutFileNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPutFileNotification class destructor
+ **/
+ virtual ~OnPutFileNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
new file mode 100644
index 0000000000..a3e2dd731d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ready_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnReadyNotification command class
+ **/
+class OnReadyNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReadyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnReadyNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnReadyNotification class destructor
+ **/
+ virtual ~OnReadyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReadyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_READY_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
new file mode 100644
index 0000000000..38a4470d22
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_received_policy_update.h
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class OnReceivedPolicyUpdate : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnReceivedPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnReceivedPolicyUpdate(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnReceivedPolicyUpdate class destructor
+ **/
+ virtual ~OnReceivedPolicyUpdate();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
new file mode 100644
index 0000000000..81f0b5bdda
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_record_start_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnRecordStartdNotification command class
+ **/
+class OnRecordStartdNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnRecordStartdNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnRecordStartdNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnRecordStartdNotification class destructor
+ **/
+ virtual ~OnRecordStartdNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnRecordStartdNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
new file mode 100644
index 0000000000..c27e2e5ee8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_resume_audio_source_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnResumeAudioSourceNotification command class
+ **/
+class OnResumeAudioSourceNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnResumeAudioSourceNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnResumeAudioSourceNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnResumeAudioSourceNotification class destructor
+ **/
+ virtual ~OnResumeAudioSourceNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
new file mode 100644
index 0000000000..e6b4418d6d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_close_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSDLCloseNotification command class
+ **/
+class OnSDLCloseNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLCloseNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSDLCloseNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSdlCloseNotification class destructor
+ **/
+ virtual ~OnSDLCloseNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLCloseNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
new file mode 100644
index 0000000000..c9b93a4dcf
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSDLConsentNeededNotification command class
+ **/
+class OnSDLConsentNeededNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLConsentNeededNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSDLConsentNeededNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSDLConsentNeededNotification class destructor
+ **/
+ virtual ~OnSDLConsentNeededNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
new file mode 100644
index 0000000000..5da06ef34c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSDLPersistenceCompleteNotification command class
+ **/
+class OnSDLPersistenceCompleteNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSDLPersistenceCompleteNotification class destructor
+ **/
+ virtual ~OnSDLPersistenceCompleteNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
new file mode 100644
index 0000000000..3e4dc1daf4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_start_device_discovery.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnStartDeviceDiscovery command class
+ **/
+class OnStartDeviceDiscovery : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnStartDeviceDiscovery class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnStartDeviceDiscovery(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnStartDeviceDiscovery class destructor
+ **/
+ virtual ~OnStartDeviceDiscovery();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStartDeviceDiscovery);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
new file mode 100644
index 0000000000..ae85d13713
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_status_update_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnGetStatusUpdateNotification command class
+ **/
+class OnStatusUpdateNotification : public NotificationToHMI {
+ public:
+ /**
+ * @brief OnGetStatusUpdateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnStatusUpdateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnGetStatusUpdateNotification class destructor
+ **/
+ virtual ~OnStatusUpdateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
new file mode 100644
index 0000000000..b16df6069e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_context_notification.h
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile_api = mobile_apis;
+/**
+ * @brief OnSystemContextNotification command class
+ **/
+class OnSystemContextNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemContextNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemContextNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemContextNotification class destructor
+ **/
+ virtual ~OnSystemContextNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void SendSystemContextNotification(ApplicationSharedPtr app,
+ mobile_api::SystemContext::eType system_context);
+
+ DISALLOW_COPY_AND_ASSIGN(OnSystemContextNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
new file mode 100644
index 0000000000..cb3fc12017
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_error_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSystemErrorNotification command class
+ **/
+class OnSystemErrorNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemErrorNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemErrorNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemErrorNotification class destructor
+ **/
+ virtual ~OnSystemErrorNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemErrorNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
new file mode 100644
index 0000000000..d0bcadfaac
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_info_changed_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSystemInfoChangedNotification command class
+ **/
+class OnSystemInfoChangedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemInfoChangedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemInfoChangedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemInfoChangedNotification class destructor
+ **/
+ virtual ~OnSystemInfoChangedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
new file mode 100644
index 0000000000..6e3a0eea7f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_system_request_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnSystemRequestNotification command class
+ **/
+class OnSystemRequestNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemRequestNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemRequestNotification class destructor
+ **/
+ virtual ~OnSystemRequestNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
new file mode 100644
index 0000000000..d9b55ac0c1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_language_change_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTTSLanguageChangeNotification command class
+ **/
+class OnTTSLanguageChangeNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTTSLanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSLanguageChangeNotification class destructor
+ **/
+ virtual ~OnTTSLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
new file mode 100644
index 0000000000..3bafc920b7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnTTSResetTimeoutNotification command class
+ **/
+class OnTTSResetTimeoutNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTTSResetTimeoutNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSResetTimeoutNotification class destructor
+ **/
+ virtual ~OnTTSResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
new file mode 100644
index 0000000000..8cb6256074
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_started_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTTSStartedNotification command class
+ **/
+class OnTTSStartedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTTSStartedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSStartedNotification class destructor
+ **/
+ virtual ~OnTTSStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
new file mode 100644
index 0000000000..31fb6fb31c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_tts_stopped_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTTSStoppedNotification command class
+ **/
+class OnTTSStoppedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnTTSStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject OnTTSStartedNotificationmessage
+ **/
+ explicit OnTTSStoppedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTTSStoppedNotification class destructor
+ **/
+ virtual ~OnTTSStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTTSStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
new file mode 100644
index 0000000000..1d0aaf3078
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_command_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnUICommandNotification command class
+ **/
+class OnUICommandNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUICommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUICommandNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUICommandNotification class destructor
+ **/
+ virtual ~OnUICommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUICommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
new file mode 100644
index 0000000000..bb0a6a72d3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIKeyBoardInputNotification command class
+ **/
+class OnUIKeyBoardInputNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUIKeyBoardInputNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUIKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnUIKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIKeyBoardInputNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
new file mode 100644
index 0000000000..85b8f60c4d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_language_change_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnUILanguageChangeNotification command class
+ **/
+class OnUILanguageChangeNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUILanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUILanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUILanguageChangeNotification class destructor
+ **/
+ virtual ~OnUILanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUILanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
new file mode 100644
index 0000000000..511606d077
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUIResetTimeoutNotification command class
+ **/
+class OnUIResetTimeoutNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUIResetTimeoutNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUIResetTimeoutNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUIResetTimeoutNotification class destructor
+ **/
+ virtual ~OnUIResetTimeoutNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
new file mode 100644
index 0000000000..3231d1ca29
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_ui_touch_event_notification.h
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace hmi {
+
+/**
+ * @brief OnUITouchEventNotification command class
+ **/
+class OnUITouchEventNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUITouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUITouchEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUITouchEventNotification class destructor
+ **/
+ virtual ~OnUITouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUITouchEventNotification);
+};
+
+} // namespace hmi
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
new file mode 100644
index 0000000000..c0d355c925
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_update_device_list.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnUpdateDeviceList command class
+ **/
+class OnUpdateDeviceList : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnUpdateDeviceList class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnUpdateDeviceList(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnUpdateDeviceList class destructor
+ **/
+ virtual ~OnUpdateDeviceList();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnUpdateDeviceList);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
new file mode 100644
index 0000000000..04bb3e54bc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIAccPedalPositionNotification command class
+ **/
+class OnVIAccPedalPositionNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIAccPedalPositionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIAccPedalPositionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIAccPedalPositionNotification class destructor
+ **/
+ virtual ~OnVIAccPedalPositionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIAccPedalPositionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
new file mode 100644
index 0000000000..3cfb048cdc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_belt_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIBeltStatusNotification command class
+ **/
+class OnVIBeltStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBeltStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIBeltStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIBeltStatusNotification class destructor
+ **/
+ virtual ~OnVIBeltStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBeltStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
new file mode 100644
index 0000000000..b9ecf5a34b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_body_information_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIBodyInformationNotification command class
+ **/
+class OnVIBodyInformationNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIBodyInformationNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIBodyInformationNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIBodyInformationNotification class destructor
+ **/
+ virtual ~OnVIBodyInformationNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIBodyInformationNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
new file mode 100644
index 0000000000..925989e8c6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_device_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIDeviceStatusNotification command class
+ **/
+class OnVIDeviceStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDeviceStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIDeviceStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIDeviceStatusNotification class destructor
+ **/
+ virtual ~OnVIDeviceStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDeviceStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
new file mode 100644
index 0000000000..7baea90651
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIDriverBrakingNotification command class
+ **/
+class OnVIDriverBrakingNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIDriverBrakingNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIDriverBrakingNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIDriverBrakingNotification class destructor
+ **/
+ virtual ~OnVIDriverBrakingNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIDriverBrakingNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
new file mode 100644
index 0000000000..33dd824c6e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIEngineTorqueNotification command class
+ **/
+class OnVIEngineTorqueNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIEngineTorqueNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIEngineTorqueNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIEngineTorqueNotification class destructor
+ **/
+ virtual ~OnVIEngineTorqueNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIEngineTorqueNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
new file mode 100644
index 0000000000..207302a373
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIExternalTemperatureNotification command class
+ **/
+class OnVIExternalTemperatureNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIExternalTemperatureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIExternalTemperatureNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIExternalTemperatureNotification class destructor
+ **/
+ virtual ~OnVIExternalTemperatureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIExternalTemperatureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
new file mode 100644
index 0000000000..535758db25
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelNotification command class
+ **/
+class OnVIFuelLevelNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIFuelLevelNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIFuelLevelNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
new file mode 100644
index 0000000000..92dffd89b3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIFuelLevelStateNotification command class
+ **/
+class OnVIFuelLevelStateNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIFuelLevelStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIFuelLevelStateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIFuelLevelStateNotification class destructor
+ **/
+ virtual ~OnVIFuelLevelStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIFuelLevelStateNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
new file mode 100644
index 0000000000..d8f2a768fc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_gps_data_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIGpsDataNotification command class
+ **/
+class OnVIGpsDataNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIGpsDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIGpsDataNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIGpsDataNotification class destructor
+ **/
+ virtual ~OnVIGpsDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIGpsDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
new file mode 100644
index 0000000000..47802e97eb
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIHeadLampStatusNotification command class
+ **/
+class OnVIHeadLampStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIHeadLampStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIHeadLampStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIHeadLampStatusNotification class destructor
+ **/
+ virtual ~OnVIHeadLampStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIHeadLampStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
new file mode 100644
index 0000000000..fe38412980
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIInstantFuelConsumptionNotification command class
+ **/
+class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIInstantFuelConsumptionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIInstantFuelConsumptionNotification class destructor
+ **/
+ virtual ~OnVIInstantFuelConsumptionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIInstantFuelConsumptionNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
new file mode 100644
index 0000000000..d636b6e779
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_my_key_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIMyKeyNotification command class
+ **/
+class OnVIMyKeyNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIMyKeyNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIMyKeyNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIMyKeyNotification class destructor
+ **/
+ virtual ~OnVIMyKeyNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIMyKeyNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
new file mode 100644
index 0000000000..1cf4c25878
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_odometer_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIOdometerNotification command class
+ **/
+class OnVIOdometerNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIOdometerNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIOdometerNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIOdometerNotification class destructor
+ **/
+ virtual ~OnVIOdometerNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIOdometerNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
new file mode 100644
index 0000000000..5a3a136374
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_prndl_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIPrndlNotification command class
+ **/
+class OnVIPrndlNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIPrndlNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIPrndlNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIPrndlNotification class destructor
+ **/
+ virtual ~OnVIPrndlNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIPrndlNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
new file mode 100644
index 0000000000..80dea2a6e2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_rpm_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIRpmNotification command class
+ **/
+class OnVIRpmNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIRpmNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIRpmNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIRpmNotification class destructor
+ **/
+ virtual ~OnVIRpmNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIRpmNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
new file mode 100644
index 0000000000..19bffabf4f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_speed_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVISpeedNotification command class
+ **/
+class OnVISpeedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISpeedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVISpeedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVISpeedNotification class destructor
+ **/
+ virtual ~OnVISpeedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISpeedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
new file mode 100644
index 0000000000..0826cb6c6f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVISteeringWheelAngleNotification command class
+ **/
+class OnVISteeringWheelAngleNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVISteeringWheelAngleNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVISteeringWheelAngleNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVISteeringWheelAngleNotification class destructor
+ **/
+ virtual ~OnVISteeringWheelAngleNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVISteeringWheelAngleNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
new file mode 100644
index 0000000000..ba8eceefc3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVITirePressureNotification command class
+ **/
+class OnVITirePressureNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVITirePressureNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVITirePressureNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVITirePressureNotification class destructor
+ **/
+ virtual ~OnVITirePressureNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVITirePressureNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
new file mode 100644
index 0000000000..30ad9d6acc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIVehicleDataNotification command class
+ * Sent by HMI for the periodic and non periodic vehicle data
+ **/
+class OnVIVehicleDataNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIVehicleDataNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIVehicleDataNotification class destructor
+ **/
+ virtual ~OnVIVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVehicleDataNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
new file mode 100644
index 0000000000..0cb5fb17d2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_vin_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIVinNotification command class
+ **/
+class OnVIVinNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIVinNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIVinNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIVinNotification class destructor
+ **/
+ virtual ~OnVIVinNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIVinNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
new file mode 100644
index 0000000000..c7a1a6bd62
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVIWiperStatusNotification command class
+ **/
+class OnVIWiperStatusNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVIWiperStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVIWiperStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVIWiperStatusNotification class destructor
+ **/
+ virtual ~OnVIWiperStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVIWiperStatusNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
new file mode 100644
index 0000000000..677bc26727
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_command_notification.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+#include "application_manager/application_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRCommandNotification command class
+ **/
+class OnVRCommandNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRCommandNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRCommandNotification class destructor
+ **/
+ virtual ~OnVRCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
new file mode 100644
index 0000000000..24c60c32d9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_language_change_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRLanguageChangeNotification command class
+ **/
+class OnVRLanguageChangeNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRLanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRLanguageChangeNotification class destructor
+ **/
+ virtual ~OnVRLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRLanguageChangeNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
new file mode 100644
index 0000000000..cc78f010b6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_started_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRStartedNotification command class
+ **/
+class OnVRStartedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStartedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRStartedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRStartedNotification class destructor
+ **/
+ virtual ~OnVRStartedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStartedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
new file mode 100644
index 0000000000..2ee8ad429e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/on_vr_stopped_notification.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVRStoppedNotification command class
+ **/
+class OnVRStoppedNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnVRStoppedNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVRStoppedNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVRStoppedNotification class destructor
+ **/
+ virtual ~OnVRStoppedNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnVRStoppedNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
new file mode 100644
index 0000000000..39ebd95819
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_from_hmi.h
@@ -0,0 +1,66 @@
+ /**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
+ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
+
+ #include "application_manager/commands/command_impl.h"
+ #include "interfaces/HMI_API.h"
+
+ namespace NsSmartDeviceLink {
+ namespace NsSmartObjects {
+ class SmartObject;
+ }
+ }
+
+ namespace application_manager {
+
+ namespace commands {
+
+ namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+ class RequestFromHMI : public CommandImpl {
+ public:
+ explicit RequestFromHMI(const MessageSharedPtr& message);
+ virtual ~RequestFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
+ };
+
+ } // namespace commands
+ } // namespace application_manager
+
+ #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
new file mode 100644
index 0000000000..3a9de4b7b5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/request_to_hmi.h
@@ -0,0 +1,67 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+
+class RequestToHMI : public CommandImpl {
+ public:
+ explicit RequestToHMI(const MessageSharedPtr& message);
+ virtual ~RequestToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendRequest();
+
+ /*
+ * @brief Retrieves application ID
+ */
+ inline uint32_t application_id() const {
+ return (*message_)[strings::msg_params][strings::app_id].asUInt();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestToHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_TO_HMI_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
new file mode 100644
index 0000000000..21497a1335
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_from_hmi.h
@@ -0,0 +1,77 @@
+/**
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+class ResponseFromHMI : public CommandImpl {
+ public:
+ explicit ResponseFromHMI(const MessageSharedPtr& message);
+ virtual ~ResponseFromHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+ void SendResponseToMobile(const MessageSharedPtr& message);
+
+ /*
+ * @brief Creates HMI request
+ *
+ * @param function_id HMI request ID
+ * @param msg_params HMI request msg params
+ */
+ void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const NsSmart::SmartObject& msg_params) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseFromHMI);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_FROM_HMI_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
new file mode 100644
index 0000000000..ce9e9469d0
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/response_to_hmi.h
@@ -0,0 +1,67 @@
+
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
+
+#include "application_manager/commands/command_impl.h"
+#include "interfaces/HMI_API.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+
+namespace commands {
+
+namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
+
+class ResponseToHMI : public CommandImpl {
+ public:
+ explicit ResponseToHMI(const MessageSharedPtr& message);
+ virtual ~ResponseToHMI();
+ virtual bool Init();
+ virtual bool CleanUp();
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResponseToHMI);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RESPONSE_TO_HMI_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
new file mode 100644
index 0000000000..db4a93b0b5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppRequest command class
+ **/
+class SDLActivateAppRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLActivateAppRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLActivateAppRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLActivateAppRequest class destructor
+ **/
+ virtual ~SDLActivateAppRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
new file mode 100644
index 0000000000..63adc6c0d3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_activate_app_response.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLActivateAppResponse command class
+ **/
+class SDLActivateAppResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLActivateAppResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLActivateAppResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLActivateAppResponse class destructor
+ **/
+ virtual ~SDLActivateAppResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
new file mode 100644
index 0000000000..5da473b1a7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsRequest command class
+ **/
+class SDLGetListOfPermissionsRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetListOfPermissionsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetListOfPermissionsRequest class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
new file mode 100644
index 0000000000..5de9fc0ea8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetListOfPermissionsResponse command class
+ **/
+class SDLGetListOfPermissionsResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetListOfPermissionsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetListOfPermissionsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetListOfPermissionsResponse class destructor
+ **/
+ virtual ~SDLGetListOfPermissionsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
new file mode 100644
index 0000000000..a098e0a113
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateRequest command class
+ **/
+class SDLGetStatusUpdateRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetStatusUpdateRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetStatusUpdateRequest class destructor
+ **/
+ virtual ~SDLGetStatusUpdateRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
new file mode 100644
index 0000000000..6299cde630
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_status_update_response.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetStatusUpdateResponse command class
+ **/
+class SDLGetStatusUpdateResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetStatusUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetStatusUpdateResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetStatusUpdateResponse class destructor
+ **/
+ virtual ~SDLGetStatusUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
new file mode 100644
index 0000000000..b729a16170
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageRequest command class
+ **/
+class SDLGetUserFriendlyMessageRequest : public RequestFromHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetUserFriendlyMessageRequest class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
new file mode 100644
index 0000000000..bb7a7f8e20
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SDLGetUserFriendlyMessageResponse command class
+ **/
+class SDLGetUserFriendlyMessageResponse : public ResponseToHMI {
+ public:
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLGetUserFriendlyMessageResponse class destructor
+ **/
+ virtual ~SDLGetUserFriendlyMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
new file mode 100644
index 0000000000..ee2b9865c8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update.h
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class SDLPolicyUpdate : public RequestToHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLPolicyUpdate(const MessageSharedPtr& message);
+ virtual ~SDLPolicyUpdate();
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
new file mode 100644
index 0000000000..b6ab925fd6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/sdl_policy_update_response.h
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class SDLPolicyUpdateResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief SDLPolicyUpdateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SDLPolicyUpdateResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SDLPolicyUpdateResponse class destructor
+ **/
+ virtual ~SDLPolicyUpdateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
new file mode 100644
index 0000000000..a587af950b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistrationRequest command class
+ **/
+class TTSChangeRegistrationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSChangeRegistrationRequest class destructor
+ **/
+ virtual ~TTSChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
new file mode 100644
index 0000000000..3a9e9fda51
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_change_registration_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSChangeRegistratioResponse command class
+ **/
+class TTSChangeRegistratioResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSChangeRegistratioResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSChangeRegistratioResponse class destructor
+ **/
+ virtual ~TTSChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
new file mode 100644
index 0000000000..73edd9de73
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesRequest command class
+ **/
+class TTSGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetCapabilitiesRequest class destructor
+ **/
+ virtual ~TTSGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
new file mode 100644
index 0000000000..71f85d68e3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetCapabilitiesResponse command class
+ **/
+class TTSGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetCapabilitiesResponse class destructor
+ **/
+ virtual ~TTSGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
new file mode 100644
index 0000000000..94e38ec473
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageRequest command class
+ **/
+class TTSGetLanguageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetLanguageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetLanguageRequest class destructor
+ **/
+ virtual ~TTSGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
new file mode 100644
index 0000000000..bd67d64f32
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_language_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetLanguageResponse command class
+ **/
+class TTSGetLanguageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetLanguageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetLanguageResponse class destructor
+ **/
+ virtual ~TTSGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
new file mode 100644
index 0000000000..ff80dd2389
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesRequest command class
+ **/
+class TTSGetSupportedLanguagesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
new file mode 100644
index 0000000000..244f223460
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_get_supported_languages_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSGetSupportedLanguagesResponse command class
+ **/
+class TTSGetSupportedLanguagesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~TTSGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
new file mode 100644
index 0000000000..dc58d852ea
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyRequest command class
+ **/
+class TTSIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSIsReadyRequest class destructor
+ **/
+ virtual ~TTSIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
new file mode 100644
index 0000000000..375e5a5d1f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSIsReadyResponse command class
+ **/
+class TTSIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSIsReadyResponse class destructor
+ **/
+ virtual ~TTSIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
new file mode 100644
index 0000000000..b398e0b2d2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesRequest command class
+ **/
+class TTSSetGlobalPropertiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
new file mode 100644
index 0000000000..adf0b70276
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_set_global_properties_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSetGlobalPropertiesResponse command class
+ **/
+class TTSSetGlobalPropertiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~TTSSetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
new file mode 100644
index 0000000000..326c638f4d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_request.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakRequest command class
+ **/
+class TTSSpeakRequest
+ : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSSpeakRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSpeakRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSpeakRequest class destructor
+ **/
+ virtual ~TTSSpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
new file mode 100644
index 0000000000..e22c549871
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_speak_response.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSSpeakResponse command class
+ **/
+class TTSSpeakResponse
+ : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSSpeakResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSSpeakResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSSpeakResponse class destructor
+ **/
+ virtual ~TTSSpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSSpeakResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
new file mode 100644
index 0000000000..0d82121fd7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingRequest command class
+ **/
+class TTSStopSpeakingRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSStopSpeakingRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSStopSpeakingRequest class destructor
+ **/
+ virtual ~TTSStopSpeakingRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
new file mode 100644
index 0000000000..b9055bfbe5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/tts_stop_speaking_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSStopSpeakingResponse command class
+ **/
+class TTSStopSpeakingResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSStopSpeakingResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit TTSStopSpeakingResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSStopSpeakingResponse class destructor
+ **/
+ virtual ~TTSStopSpeakingResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TTSStopSpeakingResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
new file mode 100644
index 0000000000..ffd6eeeefd
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandRequest command class
+ **/
+class UIAddCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddCommandRequest class destructor
+ **/
+ virtual ~UIAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
new file mode 100644
index 0000000000..f84b71d0f1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddCommandResponse command class
+ **/
+class UIAddCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddCommandResponse class destructor
+ **/
+ virtual ~UIAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
new file mode 100644
index 0000000000..1227de0463
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIAddSubmenuRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddSubmenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddSubmenuRequest class destructor
+ **/
+ virtual ~UIAddSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
new file mode 100644
index 0000000000..1b3a10729e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_add_submenu_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuResponse command class
+ **/
+class UIAddSubmenuResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAddSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAddSubmenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAddSubmenuResponse class destructor
+ **/
+ virtual ~UIAddSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAddSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
new file mode 100644
index 0000000000..7395eb19e1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAlertRequest command class
+ **/
+class UIAlertRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIAlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAlertRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAlertRequest class destructor
+ **/
+ virtual ~UIAlertRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
new file mode 100644
index 0000000000..1d17d98095
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_alert_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAlertResponse command class
+ **/
+class UIAlertResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIAlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIAlertResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIAlertResponse class destructor
+ **/
+ virtual ~UIAlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIAlertResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
new file mode 100644
index 0000000000..51276b7b0f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistrationRequest command class
+ **/
+class UIChangeRegistrationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIChangeRegistrationRequest class destructor
+ **/
+ virtual ~UIChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
new file mode 100644
index 0000000000..edb7574e8d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_change_registration_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIChangeRegistratioResponse command class
+ **/
+class UIChangeRegistratioResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIChangeRegistratioResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIChangeRegistratioResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIChangeRegistratioResponse class destructor
+ **/
+ virtual ~UIChangeRegistratioResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIChangeRegistratioResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
new file mode 100644
index 0000000000..398f78c28f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandRequest command class
+ **/
+class UIDeleteCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteCommandRequest class destructor
+ **/
+ virtual ~UIDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
new file mode 100644
index 0000000000..bb19811908
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIDeleteCommandResponse command class
+ **/
+class UIDeleteCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteCommandResponse class destructor
+ **/
+ virtual ~UIDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
new file mode 100644
index 0000000000..1b3747234b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIAddSubmenuRequest command class
+ **/
+class UIDeleteSubmenuRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteSubmenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteSubmenuRequest class destructor
+ **/
+ virtual ~UIDeleteSubmenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
new file mode 100644
index 0000000000..8bbab99468
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_delete_submenu_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIDeleteSubmenuResponse command class
+ **/
+class UIDeleteSubmenuResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIDeleteSubmenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIDeleteSubmenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIDeleteSubmenuResponse class destructor
+ **/
+ virtual ~UIDeleteSubmenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIDeleteSubmenuResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..9e8e11c1ad
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruRequest command class
+ * When this request is invoked, the audio capture stops
+ **/
+class UIEndAudioPassThruRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIEndAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIEndAudioPassThruRequest class destructor
+ **/
+ virtual ~UIEndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..740fc5501d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIEndAudioPassThruResponse command class
+ **/
+class UIEndAudioPassThruResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIEndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIEndAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIEndAudioPassThruResponse class destructor
+ **/
+ virtual ~UIEndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIEndAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
new file mode 100644
index 0000000000..2d0469d6a6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesRequest command class
+ **/
+class UIGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetCapabilitiesRequest class destructor
+ **/
+ virtual ~UIGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
new file mode 100644
index 0000000000..dc6052e049
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetCapabilitiesResponse command class
+ **/
+class UIGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetCapabilitiesResponse class destructor
+ **/
+ virtual ~UIGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
new file mode 100644
index 0000000000..4fca4826be
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageRequest command class
+ **/
+class UIGetLanguageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetLanguageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetLanguageRequest class destructor
+ **/
+ virtual ~UIGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
new file mode 100644
index 0000000000..ea43e3856d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_language_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetLanguageResponse command class
+ **/
+class UIGetLanguageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetLanguageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetLanguageResponse class destructor
+ **/
+ virtual ~UIGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
new file mode 100644
index 0000000000..cc0e70feae
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesRequest command class
+ **/
+class UIGetSupportedLanguagesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetSupportedLanguagesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
new file mode 100644
index 0000000000..15e400687f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_get_supported_languages_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIGetSupportedLanguagesResponse command class
+ **/
+class UIGetSupportedLanguagesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIGetSupportedLanguagesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~UIGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
new file mode 100644
index 0000000000..5e2cb7ef9f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyRequest command class
+ **/
+class UIIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIIsReadyRequest class destructor
+ **/
+ virtual ~UIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
new file mode 100644
index 0000000000..bc7210f2a8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIIsReadyResponse command class
+ **/
+class UIIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIIsReadyResponse class destructor
+ **/
+ virtual ~UIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..94bc4827a9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruRequest command class
+ **/
+class UIPerformAudioPassThruRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformAudioPassThruRequest class destructor
+ **/
+ virtual ~UIPerformAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..04afedfba0
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformAudioPassThruResponse command class
+ **/
+class UIPerformAudioPassThruResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformAudioPassThruResponse class destructor
+ **/
+ virtual ~UIPerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformAudioPassThruResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
new file mode 100644
index 0000000000..0d63139437
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionRequest command class
+ **/
+class UIPerformInteractionRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformInteractionRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformInteractionRequest class destructor
+ **/
+ virtual ~UIPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CREATE_INTERACTION_SET_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
new file mode 100644
index 0000000000..32a87c73c2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_perform_interaction_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIPerformInteractionResponse command class
+ **/
+class UIPerformInteractionResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIPerformInteractionResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIPerformInteractionResponse class destructor
+ **/
+ virtual ~UIPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
new file mode 100644
index 0000000000..6f23d3b21c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageRequest command class
+ **/
+class UIScrollableMessageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIScrollableMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIScrollableMessageRequest class destructor
+ **/
+ virtual ~UIScrollableMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
new file mode 100644
index 0000000000..7bf15a0511
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_scrollable_message_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIScrollableMessageResponse command class
+ **/
+class UIScrollableMessageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIScrollableMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIScrollableMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIScrollableMessageResponse class destructor
+ **/
+ virtual ~UIScrollableMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIScrollableMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
new file mode 100644
index 0000000000..7e67912f53
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_request.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutRequest command class
+ **/
+class UiSetDisplayLayoutRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UiSetDisplayLayoutRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UiSetDisplayLayoutRequest class destructor
+ **/
+ virtual ~UiSetDisplayLayoutRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
new file mode 100644
index 0000000000..74df2030e5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_display_layout_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UiSetDisplayLayoutResponse command class
+ **/
+class UiSetDisplayLayoutResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UiSetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UiSetDisplayLayoutResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UiSetDisplayLayoutResponse class destructor
+ **/
+ virtual ~UiSetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
new file mode 100644
index 0000000000..f3f7d0e733
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesRequest command class
+ **/
+class UISetGlobalPropertiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIShowRequest class destructor
+ **/
+ virtual ~UISetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
new file mode 100644
index 0000000000..bc00397e37
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_global_properties_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetGlobalPropertiesResponse command class
+ **/
+class UISetGlobalPropertiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~UISetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
new file mode 100644
index 0000000000..1541aada6b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetIconRequest command class
+ **/
+class UISetIconRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetIconRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetIconRequest class destructor
+ **/
+ virtual ~UISetIconRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetIconRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
new file mode 100644
index 0000000000..f125f64282
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_icon_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetIconResponse command class
+ **/
+class UISetIconResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetIconResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetIconResponse class destructor
+ **/
+ virtual ~UISetIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetIconResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
new file mode 100644
index 0000000000..44cbbbfcf9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerRequest command class
+ **/
+class UISetMediaClockTimerRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetMediaClockTimerRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetMediaClockTimerRequest class destructor
+ **/
+ virtual ~UISetMediaClockTimerRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
new file mode 100644
index 0000000000..dd46f128d9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISetMediaClockTimerResponse command class
+ **/
+class UISetMediaClockTimerResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISetMediaClockTimerResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISetMediaClockTimerResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISetMediaClockTimerResponse class destructor
+ **/
+ virtual ~UISetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISetMediaClockTimerResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
new file mode 100644
index 0000000000..6f22263e61
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIShowRequest command class
+ **/
+class UIShowRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UIShowRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIShowRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIShowRequest class destructor
+ **/
+ virtual ~UIShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
new file mode 100644
index 0000000000..a6391fa6c9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_show_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UIShowResponse command class
+ **/
+class UIShowResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UIShowResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UIShowResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UIShowResponse class destructor
+ **/
+ virtual ~UIShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIShowResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
new file mode 100644
index 0000000000..5cb31b4a95
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ButtonGetCapabilitiesRequest command class
+ **/
+class UISliderRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISliderRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISliderRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISliderRequest class destructor
+ **/
+ virtual ~UISliderRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
new file mode 100644
index 0000000000..aae5408e21
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/ui_slider_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISliderResponse command class
+ **/
+class UISliderResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISliderResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UISliderResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UISliderResponse class destructor
+ **/
+ virtual ~UISliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISliderResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
new file mode 100644
index 0000000000..d2307232e3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_request.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListRequest command class
+ **/
+class UpdateAppListRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UpdateAppListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateAppListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateAppListRequest class destructor
+ **/
+ virtual ~UpdateAppListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_
+
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
new file mode 100644
index 0000000000..3e6a1d78a2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_app_list_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateAppListResponse command class
+ **/
+class UpdateAppListResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateAppListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateAppListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateAppListResponse class destructor
+ **/
+ virtual ~UpdateAppListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateAppListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
new file mode 100644
index 0000000000..e9a32e9fc4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_request.h
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListRequest command class
+ **/
+class UpdateDeviceListRequest : public RequestToHMI,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief UpdateDeviceListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateDeviceListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateDeviceListRequest class destructor
+ **/
+ ~UpdateDeviceListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ * Need to observe OnHMIReady event, to send UpdateDeviceListRequest
+ * when HMI will be ready
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Need to stop execution StopMethod if HMI did not started
+ */
+ virtual bool CleanUp();
+
+ private:
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::ConditionalVariable termination_condition_;
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
new file mode 100644
index 0000000000..d4191c8bee
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_device_list_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateDeviceListResponse command class
+ **/
+class UpdateDeviceListResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateDeviceListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateDeviceListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateDeviceListResponse class destructor
+ **/
+ virtual ~UpdateDeviceListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
new file mode 100644
index 0000000000..506c137861
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLRequest command class
+ **/
+class UpdateSDLRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UpdateSDLRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateSDLRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateSDLRequest class destructor
+ **/
+ virtual ~UpdateSDLRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
new file mode 100644
index 0000000000..729483cfa1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/update_sdl_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateSDLResponse command class
+ **/
+class UpdateSDLResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UpdateSDLResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateSDLResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateSDLResponse class destructor
+ **/
+ virtual ~UpdateSDLResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateSDLResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
new file mode 100644
index 0000000000..90e1e145c2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageRequest command class
+ **/
+class VIDiagnosticMessageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIDiagnosticMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIDiagnosticMessageRequest class destructor
+ **/
+ virtual ~VIDiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
new file mode 100644
index 0000000000..f332a32812
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_diagnostic_message_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIDiagnosticMessageResponse command class
+ **/
+class VIDiagnosticMessageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIDiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIDiagnosticMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIDiagnosticMessageResponse class destructor
+ **/
+ virtual ~VIDiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIDiagnosticMessageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
new file mode 100644
index 0000000000..93f046d7d6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsRequest command class
+ **/
+class VIGetDTCsRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetDTCsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetDTCsRequest class destructor
+ **/
+ virtual ~VIGetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
new file mode 100644
index 0000000000..9ee7fac44a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_dtcs_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetDTCsResponse command class
+ **/
+class VIGetDTCsResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetDTCsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetDTCsResponse class destructor
+ **/
+ virtual ~VIGetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetDTCsResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
new file mode 100644
index 0000000000..9cb964981c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataRequest command class
+ **/
+class VIGetVehicleDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleDataRequest class destructor
+ **/
+ virtual ~VIGetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
new file mode 100644
index 0000000000..951bf0c334
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataRequestTemplate command class
+ *
+ * Template class for sending 1 subscribe thin request
+ **/
+template<event_engine::Event::EventID eventID>
+class VIGetVehicleDataRequestTemplate : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataRequestTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+ }
+
+ /**
+ * @brief Execute command with sending DBus thin request to HMI
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleDataRequestTemplate::Run");
+ SendRequest();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataRequestTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
new file mode 100644
index 0000000000..952b0fb4d3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataResponse command class
+ **/
+class VIGetVehicleDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleDataResponse class destructor
+ **/
+ virtual ~VIGetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
new file mode 100644
index 0000000000..ecd465365a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIGetVehicleDataResponseTemplate command class
+ **/
+template<event_engine::Event::EventID eventID>
+class VIGetVehicleDataResponseTemplate : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleDataResponseTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIGetVehicleDataResponseTemplate::Run");
+ event_engine::Event event(eventID);
+ event.set_smart_object(*message_);
+ event.raise();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleDataResponseTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
new file mode 100644
index 0000000000..876f7d2e55
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeRequest command class
+ **/
+class VIGetVehicleTypeRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleTypeRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleTypeRequest class destructor
+ **/
+ virtual ~VIGetVehicleTypeRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
new file mode 100644
index 0000000000..8b632182f0
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIGetVehicleTypeResponse command class
+ **/
+class VIGetVehicleTypeResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIGetVehicleTypeResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIGetVehicleTypeResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIGetVehicleTypeResponse class destructor
+ **/
+ virtual ~VIGetVehicleTypeResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIGetVehicleTypeResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
new file mode 100644
index 0000000000..e905cf4c09
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyRequest command class
+ **/
+class VIIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIIsReadyRequest class destructor
+ **/
+ virtual ~VIIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
new file mode 100644
index 0000000000..e13e368b34
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIIsReadyResponse command class
+ **/
+class VIIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIIsReadyResponse class destructor
+ **/
+ virtual ~VIIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
new file mode 100644
index 0000000000..336ad4443a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDRequest command class
+ **/
+class VIReadDIDRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIReadDIDRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIReadDIDRequest class destructor
+ **/
+ virtual ~VIReadDIDRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
new file mode 100644
index 0000000000..af66505174
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_read_did_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIReadDIDResponse command class
+ **/
+class VIReadDIDResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIReadDIDResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIReadDIDResponse class destructor
+ **/
+ virtual ~VIReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIReadDIDResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..ef14a05f2d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataRequest command class
+ **/
+class VISubscribeVehicleDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VISubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VISubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
new file mode 100644
index 0000000000..bcfa2f6f1a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VISubscriveVehicleDataRequestTemplate command class
+ *
+ * Template class for sending 1 subscribe thin request
+ **/
+template<event_engine::Event::EventID eventID>
+class VISubscribeVehicleDataRequestTemplate : public RequestToHMI {
+ public:
+ /**
+ * @brief VISubscriveVehicleDataRequestTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataRequestTemplate(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+ }
+
+ /**
+ * @brief Execute command with sending DBus thin request to HMI
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VISubscriveVehicleDataRequestTemplate::Run");
+ SendRequest();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataRequestTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..057fd52e13
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VISubscribeVehicleDataResponse command class
+ **/
+class VISubscribeVehicleDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VISubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VISubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
new file mode 100644
index 0000000000..740d8c386a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+/**
+ * @brief VISubscriveVehicleDataResponseTemplate command class
+ **/
+template<event_engine::Event::EventID eventID>
+class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscriveVehicleDataResponseTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VISubscribeVehicleDataResponseTemplate(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VISubscribeVehicleDataResponse::Run");
+ event_engine::Event event(eventID);
+ event.set_smart_object(*message_);
+ event.raise();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..18d118fadb
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataRequest command class
+ **/
+class VIUnsubscribeVehicleDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIUnsubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
new file mode 100644
index 0000000000..d604d4d536
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIUnsubscriveVehicleDataRequestTemplate command class
+ *
+ * Template class for sending 1 unsubscribe thin request
+ **/
+template<event_engine::Event::EventID eventID>
+class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI {
+ public:
+ /**
+ * @brief VIUnsubscriveVehicleDataRequestTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataRequestTemplate(
+ const MessageSharedPtr& message)
+ : RequestToHMI(message) {
+ }
+
+ /**
+ * @brief Execute command with sending DBus thin request to HMI
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIUnsubscriveVehicleDataRequestTemplate::Run");
+ SendRequest();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataRequestTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..b71b8241f5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VIUnsubscribeVehicleDataResponse command class
+ **/
+class VIUnsubscribeVehicleDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VIUnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~VIUnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
new file mode 100644
index 0000000000..8730cc0361
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+
+#include "application_manager/event_engine/event.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+namespace commands {
+
+/**
+ * @brief VIUnsubscriveVehicleDataResponseTemplate command class
+ **/
+template<event_engine::Event::EventID eventID>
+class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VISubscriveVehicleDataResponseTemplate class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VIUnsubscribeVehicleDataResponseTemplate(
+ const MessageSharedPtr& message)
+ : ResponseFromHMI(message) {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run() {
+ LOG4CXX_INFO(logger_, "VIUnsubscriveVehicleDataResponseTemplate::Run");
+ event_engine::Event event(eventID);
+ event.set_smart_object(*message_);
+ event.raise();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
new file mode 100644
index 0000000000..3675cfb153
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandRequest command class
+ **/
+class VRAddCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRAddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRAddCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRAddCommandRequest class destructor
+ **/
+ virtual ~VRAddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
new file mode 100644
index 0000000000..328e8a2058
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_add_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRAddCommandResponse command class
+ **/
+class VRAddCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRAddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRAddCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRAddCommandResponse class destructor
+ **/
+ virtual ~VRAddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRAddCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
new file mode 100644
index 0000000000..5e69b4c18b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationRequest command class
+ **/
+class VRChangeRegistrationRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRChangeRegistrationRequest class destructor
+ **/
+ virtual ~VRChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
new file mode 100644
index 0000000000..f79da44598
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_change_registration_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRChangeRegistrationResponse command class
+ **/
+class VRChangeRegistrationResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRChangeRegistrationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRChangeRegistrationResponse class destructor
+ **/
+ virtual ~VRChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRChangeRegistrationResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
new file mode 100644
index 0000000000..b843f498f8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandRequest command class
+ **/
+class VRDeleteCommandRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRDeleteCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRDeleteCommandRequest class destructor
+ **/
+ virtual ~VRDeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
new file mode 100644
index 0000000000..11a681bd5e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_delete_command_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRDeleteCommandResponse command class
+ **/
+class VRDeleteCommandResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRDeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRDeleteCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRDeleteCommandResponse class destructor
+ **/
+ virtual ~VRDeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRDeleteCommandResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
new file mode 100644
index 0000000000..7771bdd141
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesRequest command class
+ **/
+class VRGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetCapabilitiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetCapabilitiesRequest class destructor
+ **/
+ virtual ~VRGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
new file mode 100644
index 0000000000..ced60c9d65
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_capabilities_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetCapabilitiesResponse command class
+ **/
+class VRGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetCapabilitiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetCapabilitiesResponse class destructor
+ **/
+ virtual ~VRGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
new file mode 100644
index 0000000000..955355d06c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageRequest command class
+ **/
+class VRGetLanguageRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetLanguageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetLanguageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetLanguageRequest class destructor
+ **/
+ virtual ~VRGetLanguageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
new file mode 100644
index 0000000000..2bd59b8be2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_language_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetLanguageResponse command class
+ **/
+class VRGetLanguageResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetLanguageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetLanguageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetLanguageResponse class destructor
+ **/
+ virtual ~VRGetLanguageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetLanguageResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
new file mode 100644
index 0000000000..79105978b0
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesRequest command class
+ **/
+class VRGetSupportedLanguagesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetSupportedLanguagesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetSupportedLanguagesRequest class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
new file mode 100644
index 0000000000..38f5056225
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_get_supported_languages_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRGetSupportedLanguagesResponse command class
+ **/
+class VRGetSupportedLanguagesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRGetSupportedLanguagesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRGetSupportedLanguagesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRGetSupportedLanguagesResponse class destructor
+ **/
+ virtual ~VRGetSupportedLanguagesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRGetSupportedLanguagesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
new file mode 100644
index 0000000000..ac734638b1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyRequest command class
+ **/
+class VRIsReadyRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRIsReadyRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRIsReadyRequest class destructor
+ **/
+ virtual ~VRIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
new file mode 100644
index 0000000000..4f4f86d84c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_is_ready_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRIsReadyResponse command class
+ **/
+class VRIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief VRIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRIsReadyResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRIsReadyResponse class destructor
+ **/
+ virtual ~VRIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
new file mode 100644
index 0000000000..b71b31baf5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_request.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief VRPerformInteractionRequest command class
+ **/
+class VRPerformInteractionRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief VRPerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRPerformInteractionRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief VRPerformInteractionRequest class destructor
+ **/
+ virtual ~VRPerformInteractionRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
new file mode 100644
index 0000000000..fbf5b87cb6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/hmi/vr_perform_interaction_response.h
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief TTSPerformInteractionResponse command class
+ **/
+class VRPerformInteractionResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief TTSPerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit VRPerformInteractionResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief TTSPerformInteractionResponse class destructor
+ **/
+ virtual ~VRPerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
new file mode 100644
index 0000000000..fc683988bf
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_request.h
@@ -0,0 +1,147 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddCommandRequest command class
+ **/
+class AddCommandRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AddCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddCommandRequest class destructor
+ **/
+ virtual ~AddCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+
+ /*
+ * @brief Check if command name doesn't exist in application
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandName(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command VR synonyms doesn't exist in application commands
+ * Please see SDLAQ-CRS-407 for more information
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandVRSynonym(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Check if command parent ID exists in submenu map
+ *
+ * @param app Mobile application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckCommandParentId(ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Removes command from list when HMI sends negative response or
+ * HMI does not answer on addCommand request.
+ */
+ void RemoveCommand();
+
+ DISALLOW_COPY_AND_ASSIGN(AddCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /**
+ * @brief Checks add command param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if add command contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ bool send_ui_;
+ bool send_vr_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
new file mode 100644
index 0000000000..67a49a8e17
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_command_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddCommandResponse command class
+ **/
+class AddCommandResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AddCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddCommandResponse class destructor
+ **/
+ virtual ~AddCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
new file mode 100644
index 0000000000..befeb76d9f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuRequest command class
+ **/
+class AddSubMenuRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AddSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddSubMenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddSubMenuRequest class destructor
+ **/
+ virtual ~AddSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+
+ /*
+ * @brief Check if submenu name is valid
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckSubMenuName();
+
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
new file mode 100644
index 0000000000..62c404951a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/add_sub_menu_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AddSubMenuResponse command class
+ **/
+class AddSubMenuResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AddSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AddSubMenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AddSubMenuResponse class destructor
+ **/
+ virtual ~AddSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AddSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
new file mode 100644
index 0000000000..02423f0630
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_request.h
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverRequest command class
+ **/
+class AlertManeuverRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertManeuverRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertManeuverRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertManeuverRequest class destructor
+ **/
+ virtual ~AlertManeuverRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks alert maneuver params(ttsChunks, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if alert maneuver contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ mobile_apis::Result::eType tts_speak_result_code_;
+ mobile_apis::Result::eType navi_alert_maneuver_result_code_;
+ Pending pending_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
new file mode 100644
index 0000000000..5f0827699b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_maneuver_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertManeuverResponse command class
+ **/
+class AlertManeuverResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertManeuverResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertManeuverResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertManeuverResponse class destructor
+ **/
+ virtual ~AlertManeuverResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertManeuverResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
new file mode 100644
index 0000000000..705a1d1454
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_request.h
@@ -0,0 +1,142 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertRequest command class
+ **/
+class AlertRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief AlertRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertRequest class destructor
+ **/
+ virtual ~AlertRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /*
+ * @brief Will caled by request controller, when default will be expired.
+ * If Alert request has soft buttons, timeout response should not be sent to mobile
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ protected:
+
+ private:
+ /*
+ * @brief Checks if request parameters are valid
+ * @param app_id Id of application requested this RPC
+ * @returns true if request is valid and should be processed
+ */
+ bool Validate(uint32_t app_id);
+ /*
+ * @brief Sends UI Alert request
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendAlertRequest(int32_t app_id);
+
+ /*
+ * @brief Sends TTS Speak request
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendSpeakRequest(int32_t app_id);
+
+ /*
+ * @brief Sends Basic communication playtone notification
+ *
+ * @param app_id Id of application requested this RPC
+ */
+ void SendPlayToneNotification(int32_t app_id);
+
+ /*
+ * @brief Tells if there are sent requests without responses
+ */
+ bool HasHmiResponsesToWait();
+
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfAlertRequest();
+
+ bool awaiting_ui_alert_response_;
+ bool awaiting_tts_speak_response_;
+ bool awaiting_tts_stop_speaking_response_;
+ bool response_success_;
+ bool flag_other_component_sent_;
+ mobile_apis::Result::eType response_result_;
+ smart_objects::SmartObject response_params_;
+ mobile_apis::Result::eType tts_speak_response_;
+
+ DISALLOW_COPY_AND_ASSIGN(AlertRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
new file mode 100644
index 0000000000..59b38933a7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/alert_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief AlertResponse command class
+ **/
+class AlertResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief AlertResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit AlertResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief AlertResponse class destructor
+ **/
+ virtual ~AlertResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AlertResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
new file mode 100644
index 0000000000..3de3e8fc2f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_request.h
@@ -0,0 +1,162 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
+
+#include <strings.h>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/commands/pending.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ChangeRegistrationRequest command class
+ **/
+class ChangeRegistrationRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ChangeRegistrationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ChangeRegistrationRequest class destructor
+ **/
+ virtual ~ChangeRegistrationRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Search for requested language in HMI UI supported languages
+ *
+ * @return true if language supported by UI, otherwise false
+ */
+ bool IsLanguageSupportedByUI(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI VR supported languages
+ *
+ * @return true if language supported by VR, otherwise false
+ */
+ bool IsLanguageSupportedByVR(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Search for requested language in HMI TTS supported languages
+ *
+ * @return true if language supported by TTS, otherwise false
+ */
+ bool IsLanguageSupportedByTTS(const int32_t& hmi_display_lang);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /*
+ * @brief Checks result codes
+ *
+ * @return true if one of result codes is success
+ */
+ static bool WasAnySuccess(const hmi_apis::Common_Result::eType ui,
+ const hmi_apis::Common_Result::eType vr,
+ const hmi_apis::Common_Result::eType tts);
+
+ /**
+ * @brief Checks change_registration params(ttsName, appname,
+ * ngnMediaScreenAppName, vrSynonyms) on invalid characters.
+ *
+ * @return true if command contains \t\n \\t \\n of whitespace otherwise
+ * returns false.
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Check parameters (name, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * @return SUCCESS if there is no coincidence of app.name/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /**
+ * @brief Predicate for using with CheckCoincidence method to compare with VR synonym SO
+ *
+ * @return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ explicit CoincidencePredicateVR(const std::string &newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ const std::string vr_synonym = obj.asString();
+ return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str()));
+ };
+
+ const std::string &newItem_;
+ };
+
+ Pending pending_requests_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
new file mode 100644
index 0000000000..2cac5f2d58
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/change_registration_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ChangeRegistrationResponse command class
+ **/
+class ChangeRegistrationResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ChangeRegistrationResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ChangeRegistrationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ChangeRegistrationResponse class destructor
+ **/
+ virtual ~ChangeRegistrationResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
new file mode 100644
index 0000000000..1936c9678e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
@@ -0,0 +1,179 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
+
+#include "application_manager/application.h"
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetRequest command class
+ **/
+class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CreateInteractionChoiceSetRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief CreateInteractionChoiceSetRequest class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /*
+ * @brief Sends VR AddCommand request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRAddCommandRequest(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks incoming choiseSet params.
+ * @param app Registred mobile application
+ *
+ * @return Mobile result code
+ */
+ mobile_apis::Result::eType CheckChoiceSet(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare choice ID param
+ *
+ * return TRUE if there is coincidence of choice ID, otherwise FALSE
+ */
+ struct CoincidencePredicateChoiceID {
+ explicit CoincidencePredicateChoiceID(const uint32_t newItem)
+ :newItem_(newItem)
+ {}
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[strings::choice_id].asUInt() == newItem_;
+ }
+
+ const uint32_t newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare menu name param
+ *
+ * return TRUE if there is coincidence of menu name, otherwise FALSE
+ */
+ struct CoincidencePredicateMenuName {
+ explicit CoincidencePredicateMenuName(const std::string& newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return obj[strings::menu_name].asString() == newItem_;
+ };
+
+ const std::string& newItem_;
+ };
+
+ /*
+ * @brief Predicate for using with CheckChoiceSet method to compare VR commands param
+ *
+ * return TRUE if there is coincidence of VR commands, otherwise FALSE
+ */
+ struct CoincidencePredicateVRCommands {
+ explicit CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ return compareStr(obj, newItem_);
+ };
+
+ const smart_objects::SmartObject& newItem_;
+ };
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param choice1 Choice to compare
+ * @param choice2 Choice to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool compareSynonyms(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2);
+
+ /*
+ * @brief Checks VR synonyms ignoring differences in case.
+ *
+ * @param str1 VR synonym to compare
+ * @param str2 VR synonym to compare
+ *
+ * return Return TRUE if there are similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ static bool compareStr(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1,
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2);
+
+ /**
+ * @brief Checks choice set params(menuName, tertiaryText, ...)
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @param choice_set which must check
+ * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set);
+
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
new file mode 100644
index 0000000000..965573f4a4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief CreateInteractionChoiceSetResponse command class
+ **/
+class CreateInteractionChoiceSetResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief CreateInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit CreateInteractionChoiceSetResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief CreateInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~CreateInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
new file mode 100644
index 0000000000..bae0fedd54
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandRequest command class
+ **/
+class DeleteCommandRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteCommandRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteCommandRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteCommandRequest class destructor
+ **/
+ virtual ~DeleteCommandRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ bool is_ui_send_;
+ bool is_vr_send_;
+
+ bool is_ui_received_;
+ bool is_vr_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType vr_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
new file mode 100644
index 0000000000..0fe0f0959b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_command_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteCommandResponse command class
+ **/
+class DeleteCommandResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteCommandResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteCommandResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteCommandResponse class destructor
+ **/
+ virtual ~DeleteCommandResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteCommandResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
new file mode 100644
index 0000000000..4927227465
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_request.h
@@ -0,0 +1,77 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+struct AppFile;
+
+namespace commands {
+
+/**
+ * @brief DeleteFileRequest command class
+ **/
+class DeleteFileRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteFileRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteFileRequest class destructor
+ **/
+ virtual ~DeleteFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileRequest);
+
+ void SendFileRemovedNotification(const AppFile* file) const;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
new file mode 100644
index 0000000000..cfe6aaa4fa
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_file_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteFileResponse command class
+ **/
+class DeleteFileResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteFileResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteFileResponse class destructor
+ **/
+ virtual ~DeleteFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
new file mode 100644
index 0000000000..283b882fad
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
@@ -0,0 +1,84 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetRequest command class
+ **/
+class DeleteInteractionChoiceSetRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteInteractionChoiceSetRequest class destructor
+ **/
+ virtual ~DeleteInteractionChoiceSetRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /*
+ * @brief Check if requested choice set ID in use by perform interaction
+ *
+ * @param app mobile application
+ */
+ bool ChoiceSetInUse(ApplicationConstSharedPtr app);
+
+ void SendVrDeleteCommand(ApplicationSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
new file mode 100644
index 0000000000..1f641e15b3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteInteractionChoiceSetResponse command class
+ **/
+class DeleteInteractionChoiceSetResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteInteractionChoiceSetResponse class destructor
+ **/
+ virtual ~DeleteInteractionChoiceSetResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteInteractionChoiceSetResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_COMMAND_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
new file mode 100644
index 0000000000..6687218051
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_request.h
@@ -0,0 +1,99 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DeleteSubMenuRequest command class
+ **/
+class DeleteSubMenuRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteSubMenuRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteSubMenuRequest class destructor
+ **/
+ virtual ~DeleteSubMenuRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Deletes VR commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuVRCommands(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Deletes UI commands from SDL for corresponding submenu ID
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ void DeleteSubMenuUICommands(ApplicationSharedPtr const app);
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
new file mode 100644
index 0000000000..0bb080e93e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/delete_sub_menu_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class DeleteSubMenuResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DeleteSubMenuResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DeleteSubMenuResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DeleteSubMenuResponse class destructor
+ **/
+ virtual ~DeleteSubMenuResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DeleteSubMenuResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_COMMAND_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
new file mode 100644
index 0000000000..4cda040b42
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageRequest command class
+ **/
+class DiagnosticMessageRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DiagnosticMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief DiagnosticMessageRequest class destructor
+ **/
+ virtual ~DiagnosticMessageRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
new file mode 100644
index 0000000000..1b6a6024f4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/diagnostic_message_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DiagnosticMessageResponse command class
+ **/
+class DiagnosticMessageResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief DiagnosticMessageResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit DiagnosticMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief DiagnosticMessageResponse class destructor
+ **/
+ virtual ~DiagnosticMessageResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiagnosticMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
new file mode 100644
index 0000000000..10ffa5b324
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/dial_number_request.h
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DialNumber request command class
+ **/
+class DialNumberRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief DialNumberRequest class constructor
+ **/
+ explicit DialNumberRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief DialNumberRequest class destructor
+ **/
+ virtual ~DialNumberRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DialNumberRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
new file mode 100644
index 0000000000..f291f7a748
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruRequest command class
+ **/
+class EndAudioPassThruRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit EndAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief EndAudioPassThruRequest class destructor
+ **/
+ virtual ~EndAudioPassThruRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
new file mode 100644
index 0000000000..5ad5f85e6e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief EndAudioPassThruResponse command class
+ **/
+class EndAudioPassThruResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief EndAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit EndAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief EndAudioPassThruResponse class destructor
+ **/
+ virtual ~EndAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EndAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
new file mode 100644
index 0000000000..c3b39bf917
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/generic_response.h
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class GenericResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief GenericResponse class constructor
+ **/
+ explicit GenericResponse(const MessageSharedPtr& message)
+ : CommandResponseImpl(message) {
+ }
+
+ /**
+ * \brief GenericResponse class destructor
+ **/
+ virtual ~GenericResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GenericResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
new file mode 100644
index 0000000000..d76ac253bc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetDTCsRequest command class
+ **/
+class GetDTCsRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief GetDTCsRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetDTCsRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetDTCsRequest class destructor
+ **/
+ virtual ~GetDTCsRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
new file mode 100644
index 0000000000..69ff1fca59
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_dtcs_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetDTCsResponse command class
+ **/
+class GetDTCsResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief GetDTCsResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetDTCsResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetDTCsResponse class destructor
+ **/
+ virtual ~GetDTCsResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetDTCsResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
new file mode 100644
index 0000000000..db9db7b0a7
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_request.h
@@ -0,0 +1,94 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class SmartObject;
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataRequest command class
+ **/
+class GetVehicleDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief GetVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetVehicleDataRequest class destructor
+ **/
+ virtual ~GetVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+
+ protected:
+ virtual void on_event(const event_engine::Event& event);
+
+#ifdef HMI_DBUS_API
+ private:
+ void SendRequestsToHmi(const int32_t app_id);
+
+ struct HmiRequest {
+ hmi_apis::Common_Result::eType status;
+ bool complete;
+ smart_objects::SmartObject value;
+ const char* str;
+ hmi_apis::FunctionID::eType func_id;
+ };
+
+ typedef std::vector<HmiRequest> HmiRequests;
+ HmiRequests hmi_requests_;
+#endif // #ifdef HMI_DBUS_API
+
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
new file mode 100644
index 0000000000..f0306df6aa
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/get_vehicle_data_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief GetVehicleDataResponse command class
+ **/
+class GetVehicleDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief GetVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit GetVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief GetVehicleDataResponse class destructor
+ **/
+ virtual ~GetVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
new file mode 100644
index 0000000000..86171f1ff8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_request.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ListFilesRequest command class
+ **/
+class ListFilesRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ListFilesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ListFilesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ListFilesRequest class destructor
+ **/
+ virtual ~ListFilesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
new file mode 100644
index 0000000000..6f8e80bae2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/list_files_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ListFilesResponse command class
+ **/
+class ListFilesResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ListFilesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ListFilesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ListFilesResponse class destructor
+ **/
+ virtual ~ListFilesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListFilesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
new file mode 100644
index 0000000000..8753660470
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
@@ -0,0 +1,74 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAppInterfaceUnregisteredNotification class
+ **/
+class OnAppInterfaceUnregisteredNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAppInterfaceUnregisteredNotification(
+ const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAppInterfaceUnregisteredNotification class destructor
+ **/
+ virtual ~OnAppInterfaceUnregisteredNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAppInterfaceUnregisteredNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
new file mode 100644
index 0000000000..67bc319771
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
@@ -0,0 +1,74 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAudioPassThruNotification class used to send notification with binary data written from
+ * microphone to mobile device while PerformAudioPassThru is active.
+ **/
+class OnAudioPassThruNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnAudioPassThruNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnAudioPassThruNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnAudioPassThruNotification class destructor
+ **/
+ virtual ~OnAudioPassThruNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAudioPassThruNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
new file mode 100644
index 0000000000..d1297ba980
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_event_notification.h
@@ -0,0 +1,86 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonEventNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonEventNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnButtonEventNotification class destructor
+ **/
+ virtual ~OnButtonEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button event notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonEvent(ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
new file mode 100644
index 0000000000..0ebdb6d7c6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_button_press_notification.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnButtonPressNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnButtonPressNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnButtonPressNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnButtonPressNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnButtonEventCommand class destructor
+ **/
+ virtual ~OnButtonPressNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends button press notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendButtonPress(ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnButtonPressNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
new file mode 100644
index 0000000000..751b1e7dd2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_command_notification.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief OnCommandNotification class is used to send notification
+ * to mobile device.
+ **/
+class OnCommandNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnCommandNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnCommandNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnCommandNotification class destructor
+ **/
+ virtual ~OnCommandNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnCommandNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
new file mode 100644
index 0000000000..2f2a3c81fc
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_driver_distraction_notification.h
@@ -0,0 +1,77 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnDriverDistractionNotification class
+ **/
+class OnDriverDistractionNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnDriverDistractionNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnDriverDistractionNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnDriverDistractionNotification class destructor
+ **/
+ virtual ~OnDriverDistractionNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnDriverDistractionNotification);
+};
+
+} // namespace mobile
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
new file mode 100644
index 0000000000..be83047863
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hash_change_notification.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+namespace mobile {
+
+/**
+ * @brief OnHashChangeNotification class
+ **/
+class OnHashChangeNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHashChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnHashChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnHashChangeNotification class destructor
+ **/
+ virtual ~OnHashChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
new file mode 100644
index 0000000000..aefa7f9c24
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_hmi_status_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnHMIStatusNotification class
+ **/
+class OnHMIStatusNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnHMIStatusNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnHMIStatusNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnHMIStatusNotification class destructor
+ **/
+ virtual ~OnHMIStatusNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
new file mode 100644
index 0000000000..e0d6a258e9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_keyboard_input_notification.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnKeyBoardInputNotification class
+ **/
+class OnKeyBoardInputNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnKeyBoardInputNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnKeyBoardInputNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnKeyBoardInputNotification class destructor
+ **/
+ virtual ~OnKeyBoardInputNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnKeyBoardInputNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
new file mode 100644
index 0000000000..d163114890
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_language_change_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnLanguageChangeNotification class
+ **/
+class OnLanguageChangeNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnLanguageChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnLanguageChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnLanguageChangeNotification class destructor
+ **/
+ virtual ~OnLanguageChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnLanguageChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
new file mode 100644
index 0000000000..3cffe8ff49
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_permissions_change_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnPermissionsChangeNotification class
+ **/
+class OnPermissionsChangeNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnPermissionsChangeNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnPermissionsChangeNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnPermissionsChangeNotification class destructor
+ **/
+ virtual ~OnPermissionsChangeNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnPermissionsChangeNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
new file mode 100644
index 0000000000..183b673afd
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_system_request_notification.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+
+
+#include "application_manager/commands/command_notification_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnSystemRequestNotification class
+ **/
+class OnSystemRequestNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnSystemRequestNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnSystemRequestNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnSystemRequestNotification class destructor
+ **/
+ virtual ~OnSystemRequestNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
new file mode 100644
index 0000000000..5c34caba36
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnTBTClientStateNotification class
+ **/
+class OnTBTClientStateNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTBTClientStateNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTBTClientStateNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTBTClientStateNotification class destructor
+ **/
+ virtual ~OnTBTClientStateNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTBTClientStateNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
new file mode 100644
index 0000000000..1aba3087dd
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_touch_event_notification.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace mobile {
+
+/**
+ * @brief OnTouchEventNotification class
+ **/
+class OnTouchEventNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnTouchEventNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnTouchEventNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnTouchEventNotification class destructor
+ **/
+ virtual ~OnTouchEventNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnTouchEventNotification);
+};
+
+} // namespace mobile
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
new file mode 100644
index 0000000000..7e64f19639
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/on_vehicle_data_notification.h
@@ -0,0 +1,82 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "application_manager/commands/command_notification_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnVehicleDataNotification class is used to send notification
+ * to mobile device that some button was pressed on HMI.
+ **/
+class OnVehicleDataNotification : public CommandNotificationImpl {
+ public:
+ /**
+ * @brief OnVehicleDataNotification class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit OnVehicleDataNotification(const MessageSharedPtr& message);
+
+ /**
+ * @brief OnVehicleDataNotification class destructor
+ **/
+ virtual ~OnVehicleDataNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ /*
+ * @brief Sends vehicle data notification to mobile device
+ *
+ * @param app Application to receive notification
+ */
+ void SendVehicleData(ApplicationConstSharedPtr app);
+
+ DISALLOW_COPY_AND_ASSIGN(OnVehicleDataNotification);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
new file mode 100644
index 0000000000..62ca1257bb
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
@@ -0,0 +1,132 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruRequest command class
+ **/
+class PerformAudioPassThruRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformAudioPassThruRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformAudioPassThruRequest class destructor
+ **/
+ virtual ~PerformAudioPassThruRequest();
+
+ /**
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sends TTS Speak request
+ */
+ void SendSpeakRequest();
+
+ /*
+ * @brief Sends UI PerformAudioPassThru request
+ */
+ void SendPerformAudioPassThruRequest();
+
+ /*
+ * @brief Sends UI RecordStart notification after TTS Speak response received.
+ * Indicates that capturing mic data should be started
+ */
+ void SendRecordStartNotification();
+
+ /*
+ * @brief Starts microphone recording
+ */
+ void StartMicrophoneRecording();
+
+ /**
+ * @brief Checks perform audio pass thru params(initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform audio pass thru contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief If is_active_tts_speak_ TRUE - set up to FALSE and send request
+ * TTS_StopSpeaking to HMI
+ */
+ void FinishTTSSpeak();
+
+ //flag display state of speak during perform audio pass thru
+ bool is_active_tts_speak_;
+ mobile_apis::Result::eType result_tts_speak_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
new file mode 100644
index 0000000000..d659e59be0
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PerformAudioPassThruResponse command class
+ **/
+class PerformAudioPassThruResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformAudioPassThruResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformAudioPassThruResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformAudioPassThruResponse class destructor
+ **/
+ virtual ~PerformAudioPassThruResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformAudioPassThruResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
new file mode 100644
index 0000000000..ce85a70176
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_request.h
@@ -0,0 +1,220 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/timer_thread.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionRequest command class
+ **/
+class PerformInteractionRequest : public CommandRequestImpl {
+
+ public:
+ /**
+ * @brief PerformInteractionRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformInteractionRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformInteractionRequest class destructor
+ **/
+ virtual ~PerformInteractionRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Timer callback function
+ *
+ */
+ void onTimer();
+
+ private:
+ /*
+ * @brief Function is called by RequestController when request execution time
+ * has exceed it's limit
+ *
+ */
+ virtual void onTimeOut();
+
+ /*
+ * @brief Function will be called when VR_OnCommand event
+ * comes
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessVRResponse(const smart_objects::SmartObject& message);
+
+ /*
+ * @brief Sends PerformInteraction response to mobile side
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessPerformInteractionResponse
+ (const smart_objects::SmartObject& message);
+
+
+ /*
+ * @brief Sends UI PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendUIPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends TTS PerformInteraction request to HMI
+ *
+ * @param app_id Application ID
+ *
+ */
+ void SendVRPerformInteractionRequest(
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sends UI Show VR help request to HMI
+ *
+ * @param app_id Application ID
+ */
+ void SendUIShowVRHelpRequest(ApplicationSharedPtr const app);
+
+ /**
+ * @brief Creates and Sends Perform interaction to UI.
+ */
+ void CreateUIPerformInteraction(const smart_objects::SmartObject& msg_params,
+ application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar menu names.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar menu names in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetMenuNames(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if incoming choice set doesn't has similar VR synonyms.
+ *
+ * @param app_id Application ID
+ *
+ * return Return TRUE if there are no similar VR synonyms in choice set,
+ * otherwise FALSE
+ */
+ bool CheckChoiceSetVRSynonyms(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Checks if request with non-sequential positions of vrHelpItems
+ * SDLAQ-CRS-466
+ *
+ * @param app_id Application ID
+ *
+ * @return TRUE if vrHelpItems positions are sequential,
+ * otherwise FALSE
+ */
+ bool CheckVrHelpItemPositions(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Disable PerformInteraction state in application and
+ * delete VR commands from HMI
+ */
+ void DisablePerformInteraction();
+
+ /**
+ * @brief Checks perform interaction params(initialText, initialPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if perform interaction contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ /**
+ * @brief Send HMI close PopUp and call DisablePerformInteraction
+ */
+ void TerminatePerformInteraction();
+
+ /**
+ * @brief Checks parameter ChoiceID from response.
+ * @param app contains pointer to application
+ * @param choice_id contains ChoiceID from response.
+ * @return if ChoiceID from response is correct method returns TRUE
+ * otherwise returns FALSE.
+ */
+ bool CheckChoiceIDFromResponse(ApplicationSharedPtr app, int32_t choice_id);
+
+ // members
+ timer::TimerThread<PerformInteractionRequest> timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest);
+ mobile_apis::Result::eType vr_perform_interaction_code_;
+ mobile_apis::InteractionMode::eType interaction_mode_;
+ bool ui_response_recived;
+ bool vr_response_recived;
+
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
new file mode 100644
index 0000000000..4ecc149fb4
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/perform_interaction_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PerformInteractionResponse command class
+ **/
+class PerformInteractionResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief PerformInteractionResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PerformInteractionResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief PerformInteractionResponse class destructor
+ **/
+ virtual ~PerformInteractionResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PerformInteractionResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
new file mode 100644
index 0000000000..8a94a708a1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_request.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PutFileRequest command class
+ **/
+class PutFileRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief PutFileRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PutFileRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief PutFileRequest class destructor
+ **/
+ virtual ~PutFileRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ int64_t offset_;
+ std::string sync_file_name_;
+ int64_t length_;
+ mobile_apis::FileType::eType file_type_;
+ bool is_persistent_file_;
+
+ void SendOnPutFileNotification();
+ DISALLOW_COPY_AND_ASSIGN(PutFileRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
new file mode 100644
index 0000000000..89ff6ad08f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/put_file_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief PutFileResponse command class
+ **/
+class PutFileResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief PutFileResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit PutFileResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief PutFileResponse class destructor
+ **/
+ virtual ~PutFileResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PutFileResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
new file mode 100644
index 0000000000..e2e5dbf3da
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ReadDIDRequest command class
+ **/
+class ReadDIDRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ReadDIDRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ReadDIDRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ReadDIDRequest class destructor
+ **/
+ virtual ~ReadDIDRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
new file mode 100644
index 0000000000..80b9b5ea48
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/read_did_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ReadDIDResponse command class
+ **/
+class ReadDIDResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ReadDIDResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ReadDIDResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ReadDIDResponse class destructor
+ **/
+ virtual ~ReadDIDResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ReadDIDResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_READ_DID_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
new file mode 100644
index 0000000000..9c1d46368f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_request.h
@@ -0,0 +1,174 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
+
+#include <string.h>
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace policy {
+struct DeviceInfo;
+}
+
+namespace application_manager {
+
+class Application;
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceRequest class constructor
+ **/
+ explicit RegisterAppInterfaceRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief RegisterAppInterfaceRequest class destructor
+ **/
+ virtual ~RegisterAppInterfaceRequest();
+
+ /**
+ * @brief Init required by command resources
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ // virtual void cleanUp() = 0;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Sends RegisterAppInterface response to mobile
+ *
+ *@param application_impl application
+ *
+ **/
+ void SendRegisterAppInterfaceResponseToMobile(
+ mobile_apis::Result::eType result = mobile_apis::Result::SUCCESS);
+
+ private:
+ /*
+ * @brief Check new ID along with known mobile application ID
+ *
+ * return TRUE if ID is known already, otherwise - FALSE
+ */
+ bool IsApplicationWithSameAppIdRegistered();
+
+ /*
+ * @brief Check for some request param. names restrictions, e.g. for
+ * newline characters
+ *
+ * return SUCCESS if param name pass the check, otherwise - error code
+ * will be returned
+ */
+ mobile_apis::Result::eType CheckRestrictions() const;
+
+ /*
+ * @brief Removes hidden symbols and spaces
+ *
+ * return cleared copy of param name
+ */
+ std::string ClearParamName(std::string param_name) const;
+
+
+ /*
+ * @brief Check new application parameters (name, tts, vr) for
+ * coincidence with already known parameters of registered applications
+ *
+ * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms,
+ * otherwise appropriate error code returns
+ */
+ mobile_apis::Result::eType CheckCoincidence();
+
+ /*
+ * @brief Predicate for using with CheckCoincidence method to compare with VR synonym SO
+ *
+ * return TRUE if there is coincidence of VR, otherwise FALSE
+ */
+ struct CoincidencePredicateVR {
+ explicit CoincidencePredicateVR(const std::string &newItem)
+ :newItem_(newItem)
+ {};
+
+ bool operator()(smart_objects::SmartObject obj) {
+ const std::string vr_synonym = obj.asString();
+ return !(strcasecmp(vr_synonym.c_str(), newItem_.c_str()));
+ };
+
+ const std::string &newItem_;
+ };
+
+ /**
+ * @brief Check request parameters against policy table data
+ * @return SUCCESS if check ok, otherwise return appropriate error code
+ */
+ mobile_apis::Result::eType CheckWithPolicyData();
+
+ /**
+ * @brief Fill DeviceInfo struct with data from request, if any
+ * @param device_info Struct for device params from request
+ */
+ void FillDeviceInfo(policy::DeviceInfo* device_info);
+
+ /**
+ * @brief Checks register app interface params(ttsName, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if register app interface contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ std::string response_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
new file mode 100644
index 0000000000..1244cb65f8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/register_app_interface_response.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+/**
+ * @brief Register app interface request command class
+ **/
+class RegisterAppInterfaceResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief RegisterAppInterfaceResponse class constructor
+ **/
+ explicit RegisterAppInterfaceResponse(const MessageSharedPtr& response)
+ : CommandResponseImpl(response) {
+ }
+
+ /**
+ * \brief RegisterAppInterfaceResponse class destructor
+ **/
+ virtual ~RegisterAppInterfaceResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ void SetHeartBeatTimeout(uint32_t connection_key,
+ const std::string& mobile_app_id);
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
new file mode 100644
index 0000000000..d7abe38c11
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_request.h
@@ -0,0 +1,130 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesRequest command class
+ **/
+class ResetGlobalPropertiesRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ResetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ResetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~ResetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sets default value of the HELPPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ * @param is_timeout_promp Flag indicating that timeout prompt
+ * should be reset
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetHelpPromt(ApplicationSharedPtr app);
+
+ /*
+ * @brief Sets default value of the TIMEOUTPROMT global property
+ * to the first vrCommand of each Command Menu registered in application
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetTimeoutPromt(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Sets default value of the VRHELPTITLE global property
+ * to the application name and value of the VRHELPITEMS global property
+ * to value equal to registered command -1(default command “Help / Cancel”.)
+ *
+ * @param app Registered application
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool ResetVrHelpTitleItems(application_manager::ApplicationSharedPtr const app);
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesRequest);
+
+ bool is_ui_send_;
+ bool is_tts_send_;
+
+ bool is_ui_received_;
+ bool is_tts_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
new file mode 100644
index 0000000000..7c0b8eb00b
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/reset_global_properties_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ResetGlobalPropertiesResponse command class
+ **/
+class ResetGlobalPropertiesResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ResetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ResetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ResetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~ResetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
new file mode 100644
index 0000000000..a810f4eb2d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_request.h
@@ -0,0 +1,85 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief scrollable message request command class
+ **/
+class ScrollableMessageRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ScrollableMessageRequest class constructor
+ **/
+ explicit ScrollableMessageRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SliderCommand class destructor
+ **/
+ virtual ~ScrollableMessageRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
new file mode 100644
index 0000000000..36fd311ad6
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/scrollable_message_response.h
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class ScrollableMessageResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief ScrollableMessageResponse class constructor
+ **/
+ explicit ScrollableMessageResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakResponseCommand class destructor
+ **/
+ virtual ~ScrollableMessageResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScrollableMessageResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
new file mode 100644
index 0000000000..e178e284d9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_request.h
@@ -0,0 +1,87 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief send location request command class
+ */
+class SendLocationRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SendLocationRquest class constructor
+ */
+ explicit SendLocationRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SendLocationRquest class destructor
+ */
+ virtual ~SendLocationRequest();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+
+ /**
+ * @brief Checks sendlocation params(locationName, locationDescription, ...).
+ * Checks string if it contains \t\n \\t \\n or whitespace
+ * @return true if string contains invalid characters, otherwise returns false
+ */
+ bool IsWhiteSpaceExist();
+
+
+ DISALLOW_COPY_AND_ASSIGN(SendLocationRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
new file mode 100644
index 0000000000..6e18aa5f27
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/send_location_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+
+
+namespace application_manager {
+namespace commands {
+
+class SendLocationResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SendLocationResponse class constructor
+ */
+ explicit SendLocationResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SendLocationResponse class destructor
+ */
+ virtual ~SendLocationResponse();
+
+ /**
+ * @brief Execute command
+ */
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendLocationResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
new file mode 100644
index 0000000000..925a1cd67f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutRequest command class
+ **/
+class SetDisplayLayoutRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetDisplayLayoutRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetDisplayLayoutRequest class destructor
+ **/
+ virtual ~SetDisplayLayoutRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ **/
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
new file mode 100644
index 0000000000..dbf3de8d88
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_display_layout_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetDisplayLayoutResponse command class
+ **/
+class SetDisplayLayoutResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SetDisplayLayoutResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetDisplayLayoutResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetDisplayLayoutResponse class destructor
+ **/
+ virtual ~SetDisplayLayoutResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetDisplayLayoutResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
new file mode 100644
index 0000000000..d9e18dd76f
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_request.h
@@ -0,0 +1,121 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetGlobalPropertiesRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetGlobalPropertiesRequest class destructor
+ **/
+ virtual ~SetGlobalPropertiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Chec if HelpItems order is correct
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckVrHelpItemsOrder();
+
+ /*
+ * @brief Check if there some not delivered hmi responses exist
+ *
+ * @return true if all responses received
+ */
+ bool IsPendingResponseExist();
+
+ /*
+ * @brief Checks if request has at least one parameter
+ *
+ * @param params request parameters
+ *
+ * @returns true if at least one parameter is present in object
+ */
+ static bool ValidateConditionalMandatoryParameters(
+ const smart_objects::SmartObject& params);
+
+ /**
+ * @brief Checks set global properties params(helpPrompt, timeoutPrompt, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if set global properties contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesRequest);
+
+ bool is_ui_send_;
+ bool is_tts_send_;
+
+ bool is_ui_received_;
+ bool is_tts_received_;
+
+ hmi_apis::Common_Result::eType ui_result_;
+ hmi_apis::Common_Result::eType tts_result_;
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
new file mode 100644
index 0000000000..dd80e738e3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_global_properties_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Register app interface request command class
+ **/
+class SetGlobalPropertiesResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SetGlobalPropertiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetGlobalPropertiesResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetGlobalPropertiesResponse class destructor
+ **/
+ virtual ~SetGlobalPropertiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetGlobalPropertiesResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
new file mode 100644
index 0000000000..d46094032a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetIconRequest command class
+ **/
+class SetIconRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief Contains information about the type of image
+ */
+ typedef enum {
+ STATIC = 0,
+ DYNAMIC
+ } ImageType;
+
+ /**
+ * @brief SetIconRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetIconRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetIconRequest class destructor
+ **/
+ virtual ~SetIconRequest();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetIconRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
new file mode 100644
index 0000000000..88dceaf5a2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_icon_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetIconResponse command class
+ **/
+class SetIconResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SetIconResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SetIconResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SetIconResponse class destructor
+ **/
+ virtual ~SetIconResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetIconResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
new file mode 100644
index 0000000000..e4fae5c0b3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_request.h
@@ -0,0 +1,81 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SetMediaClockRequest request command class
+ **/
+class SetMediaClockRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief SetMediaClockRequest class constructor
+ **/
+ explicit SetMediaClockRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief ShowCommand class destructor
+ **/
+ virtual ~SetMediaClockRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event);
+
+ private:
+ bool isDataValid();
+
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
new file mode 100644
index 0000000000..e835c17c80
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/set_media_clock_timer_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class SetMediaClockTimerResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief SetMediaClockTimerResponse class constructor
+ **/
+ explicit SetMediaClockTimerResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SetMediaClockTimerResponse class destructor
+ **/
+ virtual ~SetMediaClockTimerResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SetMediaClockTimerResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
new file mode 100644
index 0000000000..a22ee9852a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_request.h
@@ -0,0 +1,89 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTRequest command class
+ **/
+class ShowConstantTBTRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ShowConstantTBTRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief ShowConstantTBTRequest class destructor
+ **/
+ virtual ~ShowConstantTBTRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks show constant TBT params(turnIcon, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if show constant TBT contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
new file mode 100644
index 0000000000..6a102b1984
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_constant_tbt_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief ShowConstantTBTResponse command class
+ **/
+class ShowConstantTBTResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief ShowConstantTBTResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit ShowConstantTBTResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief ShowConstantTBTResponse class destructor
+ **/
+ virtual ~ShowConstantTBTResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowConstantTBTResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
new file mode 100644
index 0000000000..091cab3bfd
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief show request command class
+ **/
+class ShowRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief ShowRequest class constructor
+ **/
+ explicit ShowRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief ShowRequest class destructor
+ **/
+ virtual ~ShowRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+
+ /*
+ * @brief Check if all strings have valid syntax in request
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool CheckStringsOfShowRequest();
+
+ DISALLOW_COPY_AND_ASSIGN(ShowRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
new file mode 100644
index 0000000000..970b54747e
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/show_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class ShowResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief ShowResponse class constructor
+ **/
+ explicit ShowResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief ShowResponse class destructor
+ **/
+ virtual ~ShowResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShowResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SHOW_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
new file mode 100644
index 0000000000..de24438ddd
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_request.h
@@ -0,0 +1,91 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief slider request command class
+ **/
+class SliderRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief SliderRequest class constructor
+ **/
+ explicit SliderRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief SliderRequest class destructor
+ **/
+ virtual ~SliderRequest();
+
+ /**
+ * @brief Initialize request params
+ **/
+ virtual bool Init();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief Checks slider params(sliderHeader, sliderFooter, ...).
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if slider contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SliderRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
new file mode 100644
index 0000000000..b7821adca2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/slider_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class SliderResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief SliderResponse class constructor
+ **/
+ explicit SliderResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakResponseCommand class destructor
+ **/
+ virtual ~SliderResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SliderResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SLIDER_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
new file mode 100644
index 0000000000..7d3b2096af
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_request.h
@@ -0,0 +1,93 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief speak request command class
+ **/
+class SpeakRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief SpeakRequest class constructor
+ **/
+ explicit SpeakRequest(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakRequest class destructor
+ **/
+ virtual ~SpeakRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /*
+ * @brief Sends Speak response to mobile side
+ *
+ * @param message which should send to mobile side
+ *
+ */
+ void ProcessTTSSpeakResponse(const smart_objects::SmartObject& message);
+
+ /**
+ * @brief Checks speak param ttsChunks on the contents \t\n \\t \\n
+ * @return if speak contains \t\n \\t \\n return TRUE, FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(SpeakRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
new file mode 100644
index 0000000000..ef9b8f89d3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/speak_response.h
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+
+class SpeakResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief SpeakResponse class constructor
+ **/
+ explicit SpeakResponse(const MessageSharedPtr& message);
+
+ /**
+ * \brief SpeakResponse class destructor
+ **/
+ virtual ~SpeakResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SpeakResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
new file mode 100644
index 0000000000..3e0cc2ceae
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_request.h
@@ -0,0 +1,88 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonRequest command class
+ **/
+class SubscribeButtonRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeButtonRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SubscribeButtonRequest class destructor
+ **/
+ virtual ~SubscribeButtonRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+
+ /**
+ * @brief Checks if button subscription allowed. In case non-media
+ * application trying to subscribe on buttons(tune, seek) negative result will
+ * be returned
+ *
+ * @param app Application requested subscription
+ * @param btn_id Button to be subscribe
+ *
+ * @return TRUE on success, otherwise false
+ **/
+ bool IsSubscribtionAllowed(ApplicationSharedPtr app,
+ const mobile_apis::ButtonName::eType btn_id);
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
new file mode 100644
index 0000000000..8366884540
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_button_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeButtonResponse command class
+ **/
+class SubscribeButtonResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeButtonResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SubscribeButtonResponse class destructor
+ **/
+ virtual ~SubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..288500e7e8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataRequest command class
+ **/
+class SubscribeVehicleDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SubscribeButtonCommandRequest class destructor
+ **/
+ virtual ~SubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+#ifdef HMI_DBUS_API
+ private:
+ struct HmiRequest {
+ hmi_apis::Common_Result::eType status;
+ bool complete;
+ smart_objects::SmartObject value;
+ const char* str;
+ hmi_apis::FunctionID::eType func_id;
+ };
+
+ typedef std::vector<HmiRequest> HmiRequests;
+ HmiRequests hmi_requests_;
+#endif // #ifdef HMI_DBUS_API
+
+ private:
+ bool IsAnythingAlreadySubscribed(
+ const smart_objects::SmartObject& msg_params) const;
+
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..d2771c0712
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SubscribeVehicleDataResponse command class
+ **/
+class SubscribeVehicleDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeVehicleDataCommandRequest class destructor
+ **/
+ virtual ~SubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
new file mode 100644
index 0000000000..64a6510fc5
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_request.h
@@ -0,0 +1,80 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SystemRequest command class
+ **/
+class SystemRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SystemRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SystemRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief SystemRequest class destructor
+ **/
+ virtual ~SystemRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+ private:
+
+ static uint32_t index;
+ DISALLOW_COPY_AND_ASSIGN(SystemRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
new file mode 100644
index 0000000000..ca2fb99970
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/system_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SystemResponse command class
+ **/
+class SystemResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SystemResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit SystemResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief SystemResponse class destructor
+ **/
+ virtual ~SystemResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
new file mode 100644
index 0000000000..a5a53736e2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_request.h
@@ -0,0 +1,76 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceRequest : public CommandRequestImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceRequest class constructor
+ **/
+ explicit UnregisterAppInterfaceRequest(const MessageSharedPtr& message)
+ : CommandRequestImpl(message) {
+ }
+
+ /**
+ * \brief UnregisterAppInterfaceRequest class destructor
+ **/
+ virtual ~UnregisterAppInterfaceRequest() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+ // virtual void cleanUp() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
new file mode 100644
index 0000000000..5c8928a6c8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unregister_app_interface_response.h
@@ -0,0 +1,72 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+namespace commands {
+/**
+ * @brief Unregister app interface request command class
+ **/
+class UnregisterAppInterfaceResponse : public CommandResponseImpl {
+ public:
+ /**
+ * \brief UnregisterAppInterfaceResponse class constructor
+ **/
+ explicit UnregisterAppInterfaceResponse(const MessageSharedPtr& response)
+ : CommandResponseImpl(response) {
+ }
+
+ /**
+ * \brief UnregisterAppInterfaceResponse class destructor
+ **/
+ virtual ~UnregisterAppInterfaceResponse() {
+ }
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnregisterAppInterfaceResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
new file mode 100644
index 0000000000..3ec216de27
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_request.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonRequest command class
+ **/
+class UnsubscribeButtonRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeButtonRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeButtonRequest class destructor
+ **/
+ virtual ~UnsubscribeButtonRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
new file mode 100644
index 0000000000..972da48065
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_button_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeButtonResponse command class
+ **/
+class UnsubscribeButtonResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeButtonResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeButtonResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeButtonResponse class destructor
+ **/
+ virtual ~UnsubscribeButtonResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeButtonResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
new file mode 100644
index 0000000000..dd52a77224
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -0,0 +1,96 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataRequest command class
+ **/
+class UnsubscribeVehicleDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeVehicleDataRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeVehicleDataRequest class destructor
+ **/
+ virtual ~UnsubscribeVehicleDataRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+#ifdef HMI_DBUS_API
+ private:
+ struct HmiRequest {
+ hmi_apis::Common_Result::eType status;
+ bool complete;
+ smart_objects::SmartObject value;
+ const char* str;
+ hmi_apis::FunctionID::eType func_id;
+ };
+
+ typedef std::vector<HmiRequest> HmiRequests;
+ HmiRequests hmi_requests_;
+#endif // #ifdef HMI_DBUS_API
+
+ private:
+ bool IsAnythingAlreadyUnsubscribed(
+ const smart_objects::SmartObject& msg_params) const;
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
new file mode 100644
index 0000000000..3fb932ecf3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UnsubscribeVehicleDataResponse command class
+ **/
+class UnsubscribeVehicleDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief UnsubscribeVehicleDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UnsubscribeVehicleDataResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UnsubscribeVehicleDataResponse class destructor
+ **/
+ virtual ~UnsubscribeVehicleDataResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UnsubscribeVehicleDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
new file mode 100644
index 0000000000..c65c2bc534
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_request.h
@@ -0,0 +1,97 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListRequest command class
+ **/
+class UpdateTurnListRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief UpdateTurnListRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateTurnListRequest(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateTurnListRequest class destructor
+ **/
+ virtual ~UpdateTurnListRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ /**
+ * @brief check correct parameter turnList
+ *
+ * @return TRUE if turnList is correct,
+ * otherwise FALSE
+ */
+ bool CheckTurnListArray();
+
+ /**
+ * @brief Checks update turn list param
+ * When type is String there is a check on the contents \t\n \\t \\n
+ * @return if update turn list contains \t\n \\t \\n return TRUE,
+ * FALSE otherwise
+ */
+ bool IsWhiteSpaceExist();
+
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
new file mode 100644
index 0000000000..fdbf64826c
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/mobile/update_turn_list_response.h
@@ -0,0 +1,73 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UpdateTurnListResponse command class
+ **/
+class UpdateTurnListResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief UpdateTurnListResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ explicit UpdateTurnListResponse(const MessageSharedPtr& message);
+
+ /**
+ * @brief UpdateTurnListResponse class destructor
+ **/
+ virtual ~UpdateTurnListResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UpdateTurnListResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/commands/pending.h b/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
new file mode 100644
index 0000000000..bbfc246659
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/commands/pending.h
@@ -0,0 +1,75 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
+
+#include <set>
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/*
+ * @brief Class for monitoring of pending requests/responses to HMI
+ */
+class Pending {
+ public:
+ /*
+ * Constructor
+ */
+ Pending();
+
+ /*
+ * Destructor
+ */
+ ~Pending();
+
+ void Add(hmi_apis::FunctionID::eType id);
+ void Remove(hmi_apis::FunctionID::eType id);
+ bool IsFinal(hmi_apis::FunctionID::eType id);
+
+ private:
+ std::set<hmi_apis::FunctionID::eType> pending_;
+ sync_primitives::Lock lock_;
+ hmi_apis::FunctionID::eType last_;
+ DISALLOW_COPY_AND_ASSIGN(Pending);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
new file mode 100644
index 0000000000..e76b767f17
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/event_engine/event.h
@@ -0,0 +1,147 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+
+#include <interfaces/HMI_API.h>
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace application_manager {
+namespace event_engine {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class Event {
+ public:
+
+ // Typedef for possible Event ID's from mobile_apis functionID enum
+ typedef hmi_apis::FunctionID::eType EventID;
+
+ /*
+ * @brief Constructor with parameters
+ *
+ * @param id Event ID. Please see mobile_apis::FunctionID for possible ID's
+ */
+ explicit Event(const EventID& id);
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~Event();
+
+ /*
+ * @brief Sends synchronously event to all subscribers.
+ *
+ */
+ void raise();
+
+ /*
+ * @brief Provides event ID
+ */
+ inline const EventID& id() const;
+
+ /*
+ * @brief Sets event smart object
+ *
+ * @param so The smart_object received in HMI response
+ */
+ void set_smart_object(smart_objects::SmartObject& so);
+
+ /*
+ * @brief Retrieves event smart object
+ *
+ * @return The smart_object received in HMI response
+ */
+ inline const smart_objects::SmartObject& smart_object() const;
+
+ /*
+ * @brief Retrieves smart object request ID
+ */
+ inline int32_t smart_object_function_id() const;
+
+ /*
+ * @brief Retrieves smart object correlation ID
+ */
+ inline int32_t smart_object_correlation_id() const;
+
+ /*
+ * @brief Retrieves smart_object response type
+ */
+ inline int32_t smart_object_type() const;
+
+ protected:
+
+ private:
+
+ EventID id_;
+ smart_objects::SmartObject response_so_;
+
+ /*
+ * @brief Default constructor
+ *
+ * Unimplemented to avoid misusing
+ */
+ Event();
+
+ DISALLOW_COPY_AND_ASSIGN(Event);
+};
+
+const Event::EventID& Event::id() const {
+ return id_;
+}
+
+const smart_objects::SmartObject& Event::smart_object() const {
+ return response_so_;
+}
+
+int32_t Event::smart_object_function_id() const {
+ return response_so_.getElement(
+ strings::params).getElement(strings::function_id).asInt();
+}
+
+int32_t Event::smart_object_correlation_id() const {
+ return response_so_.getElement(
+ strings::params).getElement(strings::correlation_id).asInt();
+}
+
+int32_t Event::smart_object_type() const {
+ return response_so_.getElement(
+ strings::params).getElement(strings::message_type).asInt();
+}
+
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
new file mode 100644
index 0000000000..875add2828
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_dispatcher.h
@@ -0,0 +1,117 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
+
+#include <list>
+#include <map>
+
+#include "utils/lock.h"
+#include "utils/singleton.h"
+
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+namespace event_engine {
+
+class EventObserver;
+
+class EventDispatcher : public utils::Singleton<EventDispatcher> {
+ public:
+
+ /*
+ * @brief Delivers the event to all subscribers
+ *
+ * @param event Received event
+ */
+ void raise_event(const Event& event);
+
+ /*
+ * @brief Subscribe the observer to event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID
+ * @param observer The observer to subscribe for event
+ */
+ void add_observer(const Event::EventID& event_id,
+ int32_t hmi_correlation_id,
+ EventObserver* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(const Event::EventID& event_id,
+ EventObserver* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(EventObserver* const observer);
+
+ protected:
+
+ private:
+
+ /*
+ * @brief Default constructor
+ */
+ EventDispatcher();
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~EventDispatcher();
+
+ DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
+
+ FRIEND_BASE_SINGLETON_CLASS(EventDispatcher);
+
+ // Data types section
+ typedef std::list<EventObserver*> ObserverList;
+ typedef std::map<int32_t, ObserverList> ObserversMap;
+ typedef std::map<Event::EventID, ObserversMap> EventObserverMap;
+
+ // Members section
+ sync_primitives::Lock state_lock_;
+ EventObserverMap observers_;
+};
+
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
new file mode 100644
index 0000000000..8631203290
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/event_engine/event_observer.h
@@ -0,0 +1,116 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
+
+#include <string>
+#include "application_manager/event_engine/event.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace application_manager {
+namespace event_engine {
+
+class EventObserver
+{
+ public:
+
+ friend class EventDispatcher;
+
+ // Typedef for possible Observer ID's from mobile_apis functionID enum
+ typedef unsigned long ObserverID;
+
+ /*
+ * @brief Constructor
+ *
+ */
+ EventObserver();
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~EventObserver();
+
+ /**
+ * @brief Retrieves observer unique id
+ *
+ * @return Unique Observer id
+ */
+ inline const ObserverID& id() const;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const Event& event) = 0;
+
+ protected:
+
+ /*
+ * @brief Subscribe to an event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID.
+ * If param is omitted, it means subscription for HMI notification
+ */
+ void subscribe_on_event(
+ const Event::EventID& event_id, int32_t hmi_correlation_id = 0);
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ */
+ void unsubscribe_from_event(const Event::EventID& event_id);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ */
+ void unsubscribe_from_all_events();
+
+ private:
+
+ ObserverID id_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventObserver);
+};
+
+const EventObserver::ObserverID& EventObserver::id() const {
+ return id_;
+}
+
+}
+}
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h b/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
new file mode 100644
index 0000000000..20a849baee
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/hmi_capabilities.h
@@ -0,0 +1,538 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
+
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "json/json.h"
+#include "utils/macro.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+namespace application_manager {
+class ApplicationManagerImpl;
+
+class HMICapabilities {
+
+ public:
+
+ /*
+ * @ Class constructor
+ *
+ * @param app_mngr Application manager pointer
+ */
+ explicit HMICapabilities(ApplicationManagerImpl* const app_mngr);
+
+ /*
+ * @brief Class destructor
+ *
+ */
+ virtual ~HMICapabilities();
+
+ /**
+ * @brief Checks if all HMI capabilities received
+ *
+ * @return TRUE if all information received, otherwise FALSE
+ */
+ bool is_hmi_capabilities_initialized() const;
+
+ /*
+ * @brief Checks is image type(Static/Dynamic) requested by
+ * Mobile Device is supported on current HMI.
+ * @param image_type recieved type of image from Enum.
+ * @return Bool true if supported
+ */
+ bool VerifyImageType(int32_t image_type) const;
+
+ /**
+ * @brief Checks if all HMI capabilities received
+ *
+ * @return TRUE if all information received, otherwise FALSE
+ */
+ inline bool is_vr_cooperating() const;
+ void set_is_vr_cooperating(bool value);
+
+ inline bool is_tts_cooperating() const;
+ void set_is_tts_cooperating(bool value);
+
+ inline bool is_ui_cooperating() const;
+ void set_is_ui_cooperating(bool value);
+
+ inline bool is_navi_cooperating() const;
+ void set_is_navi_cooperating(bool value);
+
+ inline bool is_ivi_cooperating() const;
+ void set_is_ivi_cooperating(bool value);
+
+ /*
+ * @brief Retrieves if mixing audio is supported by HMI
+ * (ie recording TTS command and playing audio)
+ *
+ * @return Current state of the mixing audio flag
+ */
+ inline bool attenuated_supported() const;
+
+ /*
+ * @brief Sets state for mixing audio
+ *
+ * @param state New state to be set
+ */
+ void set_attenuated_supported(bool state);
+
+ /*
+ * @brief Retrieves currently active UI language
+ *
+ * @return Currently active UI language
+ */
+ inline const hmi_apis::Common_Language::eType&
+ active_ui_language() const;
+
+ /*
+ * @brief Sets currently active UI language
+ *
+ * @param language Currently active UI language
+ */
+ void set_active_ui_language(const hmi_apis::Common_Language::eType& language);
+
+ /*
+ * @brief Retrieves UI supported languages
+ *
+ * @return Currently supported UI languages
+ */
+ inline const smart_objects::SmartObject*
+ ui_supported_languages() const;
+
+ /*
+ * @brief Sets supported UI languages
+ *
+ * @param supported_languages Supported UI languages
+ */
+ void set_ui_supported_languages(
+ const smart_objects::SmartObject& supported_languages);
+
+ /*
+ * @brief Retrieves currently active VR language
+ *
+ * @return Currently active VR language
+ */
+ inline const hmi_apis::Common_Language::eType&
+ active_vr_language() const;
+
+ /*
+ * @brief Sets currently active VR language
+ *
+ * @param language Currently active VR language
+ */
+ void set_active_vr_language(const hmi_apis::Common_Language::eType& language);
+
+ /*
+ * @brief Retrieves VR supported languages
+ *
+ * @return Currently supported VR languages
+ */
+ inline const smart_objects::SmartObject*
+ vr_supported_languages() const;
+
+ /*
+ * @brief Sets supported VR languages
+ *
+ * @param supported_languages Supported VR languages
+ */
+ void set_vr_supported_languages(
+ const smart_objects::SmartObject& supported_languages);
+
+ /*
+ * @brief Retrieves currently active TTS language
+ *
+ * @return Currently active TTS language
+ */
+ inline const hmi_apis::Common_Language::eType&
+ active_tts_language() const;
+
+ /*
+ * @brief Sets currently active TTS language
+ *
+ * @param language Currently active TTS language
+ */
+ void set_active_tts_language(
+ const hmi_apis::Common_Language::eType& language);
+
+ /*
+ * @brief Retrieves TTS supported languages
+ *
+ * @return Currently supported TTS languages
+ */
+ inline const smart_objects::SmartObject*
+ tts_supported_languages() const;
+
+ /*
+ * @brief Sets supported TTS languages
+ *
+ * @param supported_languages Supported TTS languages
+ */
+ void set_tts_supported_languages(
+ const smart_objects::SmartObject& supported_languages);
+
+ /*
+ * @brief Retrieves information about the display capabilities
+ *
+ * @return Currently supported display capabilities
+ */
+ inline const smart_objects::SmartObject*
+ display_capabilities() const;
+
+ /*
+ * @brief Sets supported display capabilities
+ *
+ * @param display_capabilities supported display capabilities
+ */
+ void set_display_capabilities(
+ const smart_objects::SmartObject& display_capabilities);
+
+ /*
+ * @brief Retrieves information about the HMI zone capabilities
+ *
+ * @return Currently supported HMI zone capabilities
+ */
+ inline const smart_objects::SmartObject*
+ hmi_zone_capabilities() const;
+
+ /*
+ * @brief Sets supported HMI zone capabilities
+ *
+ * @param hmi_zone_capabilities supported HMI zone capabilities
+ */
+ void set_hmi_zone_capabilities(
+ const smart_objects::SmartObject& hmi_zone_capabilities);
+
+ /*
+ * @brief Retrieves information about the SoftButton's capabilities
+ *
+ * @return Currently supported SoftButton's capabilities
+ */
+ inline const smart_objects::SmartObject*
+ soft_button_capabilities() const;
+
+ /*
+ * @brief Sets supported SoftButton's capabilities
+ *
+ * @param soft_button_capabilities supported SoftButton's capabilities
+ */
+ void set_soft_button_capabilities(
+ const smart_objects::SmartObject& soft_button_capabilities);
+
+ /*
+ * @brief Retrieves information about the Button's capabilities
+ *
+ * @return Currently supported Button's capabilities
+ */
+ inline const smart_objects::SmartObject* button_capabilities() const;
+
+ /*
+ * @brief Sets supported Button's capabilities
+ *
+ * @param soft_button_capabilities supported Button's capabilities
+ */
+ void set_button_capabilities(
+ const smart_objects::SmartObject& button_capabilities);
+
+ /*
+ * @brief Sets supported speech capabilities
+ *
+ * @param speech_capabilities supported speech capabilities
+ */
+ void set_speech_capabilities(
+ const smart_objects::SmartObject& speech_capabilities);
+
+ /*
+ * @brief Retrieves information about the speech capabilities
+ *
+ * @return Currently supported speech capabilities
+ */
+ inline const smart_objects::SmartObject* speech_capabilities() const;
+
+ /*
+ * @brief Sets supported VR capabilities
+ *
+ * @param vr_capabilities supported VR capabilities
+ */
+ void set_vr_capabilities(const smart_objects::SmartObject& vr_capabilities);
+
+ /*
+ * @brief Retrieves information about the VR capabilities
+ *
+ * @return Currently supported VR capabilities
+ */
+ inline const smart_objects::SmartObject* vr_capabilities() const;
+
+ /*
+ * @brief Sets supported audio_pass_thru capabilities
+ *
+ * @param vr_capabilities supported audio_pass_thru capabilities
+ */
+ void set_audio_pass_thru_capabilities(
+ const smart_objects::SmartObject& audio_pass_thru_capabilities);
+
+ /*
+ * @brief Retrieves information about the audio_pass_thru capabilities
+ *
+ * @return Currently supported audio_pass_thru capabilities
+ */
+ inline const smart_objects::SmartObject*
+ audio_pass_thru_capabilities() const;
+
+ /*
+ * @brief Retrieves information about the preset bank capabilities
+ *
+ * @return Currently supported preset bank capabilities
+ */
+ inline const smart_objects::SmartObject* preset_bank_capabilities() const;
+
+ /*
+ * @brief Sets supported preset bank capabilities
+ *
+ * @param soft_button_capabilities supported preset bank capabilities
+ */
+ void set_preset_bank_capabilities(
+ const smart_objects::SmartObject& preset_bank_capabilities);
+
+ /*
+ * @brief Sets vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ void set_vehicle_type(const smart_objects::SmartObject& vehicle_type);
+
+ /*
+ * @brief Retrieves vehicle information(make, model, modelYear)
+ *
+ * @param vehicle_type Cuurent vehicle information
+ */
+ inline const smart_objects::SmartObject* vehicle_type() const;
+
+ /*
+ * @brief Retrieves information about the prerecorded speech
+ *
+ * @return Currently supported prerecorded speech
+ */
+ inline const smart_objects::SmartObject* prerecorded_speech() const;
+
+ /*
+ * @brief Sets supported prerecorded speech
+ *
+ * @param prerecorded_speech supported prerecorded speech
+ */
+ void set_prerecorded_speech(
+ const smart_objects::SmartObject& prerecorded_speech);
+
+ protected:
+
+ /*
+ * @brief Loads capabilities from local file in case SDL was launched
+ * without HMI
+ *
+ * @return TRUE if capabilities loaded successfully, otherwise FALSE.
+ */
+ bool load_capabilities_from_file();
+
+ /*
+ * @brief function checks if json member exists
+ *
+ * @param json_member from file hmi_capabilities.json
+ * @param name_of_member name which we should check
+ * hmi_capabilities.json
+ *
+ * @returns TRUE if member exists and returns FALSE if
+ * member does not exist.
+ */
+ bool check_existing_json_member(
+ const Json::Value& json_member, const char* name_of_member);
+
+ /*
+ * @brief function converts json object "languages" to smart object
+ *
+ * @param json_languages from file hmi_capabilities.json
+ * @param languages - the converted object
+ *
+ */
+ void convert_json_languages_to_obj(Json::Value& json_languages,
+ smart_objects::SmartObject& languages);
+
+ private:
+ bool is_vr_cooperating_;
+ bool is_tts_cooperating_;
+ bool is_ui_cooperating_;
+ bool is_navi_cooperating_;
+ bool is_ivi_cooperating_;
+
+ // to check if IsReady response for corresponding interface received
+ bool is_vr_ready_response_recieved_;
+ bool is_tts_ready_response_recieved_;
+ bool is_ui_ready_response_recieved_;
+ bool is_navi_ready_response_recieved_;
+ bool is_ivi_ready_response_recieved_;
+
+ bool attenuated_supported_;
+ hmi_apis::Common_Language::eType ui_language_;
+ hmi_apis::Common_Language::eType vr_language_;
+ hmi_apis::Common_Language::eType tts_language_;
+ smart_objects::SmartObject* vehicle_type_;
+ smart_objects::SmartObject* ui_supported_languages_;
+ smart_objects::SmartObject* tts_supported_languages_;
+ smart_objects::SmartObject* vr_supported_languages_;
+ smart_objects::SmartObject* display_capabilities_;
+ smart_objects::SmartObject* hmi_zone_capabilities_;
+ smart_objects::SmartObject* soft_buttons_capabilities_;
+ smart_objects::SmartObject* button_capabilities_;
+ smart_objects::SmartObject* preset_bank_capabilities_;
+ smart_objects::SmartObject* vr_capabilities_;
+ smart_objects::SmartObject* speech_capabilities_;
+ smart_objects::SmartObject* audio_pass_thru_capabilities_;
+ smart_objects::SmartObject* prerecorded_speech_;
+
+ ApplicationManagerImpl* app_mngr_;
+
+ DISALLOW_COPY_AND_ASSIGN(HMICapabilities);
+};
+
+bool HMICapabilities::is_ui_cooperating() const {
+ return is_ui_cooperating_;
+}
+
+bool HMICapabilities::is_vr_cooperating() const {
+ return is_vr_cooperating_;
+}
+
+bool HMICapabilities::is_tts_cooperating() const {
+ return is_tts_cooperating_;
+}
+
+bool HMICapabilities::is_navi_cooperating() const {
+ return is_navi_cooperating_;
+}
+
+bool HMICapabilities::is_ivi_cooperating() const {
+ return is_ivi_cooperating_;
+}
+
+const hmi_apis::Common_Language::eType&
+HMICapabilities::active_ui_language() const {
+ return ui_language_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::ui_supported_languages() const {
+ return ui_supported_languages_;
+}
+
+const hmi_apis::Common_Language::eType&
+HMICapabilities::active_vr_language() const {
+ return vr_language_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::vr_supported_languages() const {
+ return vr_supported_languages_;
+}
+
+const hmi_apis::Common_Language::eType&
+HMICapabilities::active_tts_language() const {
+ return tts_language_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::tts_supported_languages() const {
+ return tts_supported_languages_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::display_capabilities() const {
+ return display_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::hmi_zone_capabilities() const {
+ return hmi_zone_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::soft_button_capabilities() const {
+ return soft_buttons_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilities::button_capabilities() const {
+ return button_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::speech_capabilities() const {
+ return speech_capabilities_;
+}
+
+const smart_objects::SmartObject* HMICapabilities::vr_capabilities() const {
+ return vr_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::audio_pass_thru_capabilities() const {
+ return audio_pass_thru_capabilities_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::preset_bank_capabilities() const {
+ return preset_bank_capabilities_;
+}
+
+bool HMICapabilities::attenuated_supported() const {
+ return attenuated_supported_;
+}
+
+const smart_objects::SmartObject* HMICapabilities::vehicle_type() const {
+ return vehicle_type_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilities::prerecorded_speech() const {
+ return prerecorded_speech_;
+}
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h b/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
new file mode 100644
index 0000000000..d6f85a480d
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/hmi_command_factory.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
+
+#include "application_manager/commands/command.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+
+/**
+ * @brief Factory class for command creation
+ **/
+class HMICommandFactory {
+ public:
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param smartObject SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ static CommandSharedPtr CreateCommand(const MessageSharedPtr& message);
+
+ private:
+ HMICommandFactory();
+ DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/message.h b/src/components/application_manager/test/mock/include/application_manager/message.h
new file mode 100644
index 0000000000..d92c89adf1
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/message.h
@@ -0,0 +1,128 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
+
+#include <string>
+#include <vector>
+
+#include "utils/shared_ptr.h"
+#include "protocol/message_priority.h"
+#include "protocol/rpc_type.h"
+#include "smart_objects/smart_object.h"
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+namespace application_manager {
+
+typedef std::vector<uint8_t> BinaryData;
+
+// Message type is a general type used by both mobile and HMI messages
+enum MessageType {
+ kUnknownType = -1,
+ kRequest = 0,
+ kResponse = 1,
+ kNotification = 2,
+ kErrorResponse = 3 // Error Response HMI ONLY
+};
+
+// Map PrcType to corresponding MessageType
+MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type);
+
+enum ProtocolVersion {
+ kUnknownProtocol = -1,
+ kHMI = 0,
+ kV1 = 1,
+ kV2 = 2,
+ kV3 = 3
+};
+
+class Message {
+ public:
+ Message(protocol_handler::MessagePriority priority);
+ Message(const Message& message);
+ Message& operator=(const Message& message);
+ bool operator==(const Message& message);
+ ~Message();
+
+ //! --------------------------------------------------------------------------
+ int32_t function_id() const;
+ int32_t correlation_id() const;
+ int32_t connection_key() const;
+
+ MessageType type() const;
+ ProtocolVersion protocol_version() const;
+
+ const std::string& json_message() const;
+ const BinaryData* binary_data() const;
+ bool has_binary_data() const;
+ size_t data_size() const;
+ size_t payload_size() const;
+ const smart_objects::SmartObject& smart_object() const;
+
+ //! --------------------------------------------------------------------------
+ void set_function_id(int32_t id);
+ void set_correlation_id(int32_t id);
+ void set_connection_key(int32_t key);
+ void set_message_type(MessageType type);
+ void set_binary_data(BinaryData* data);
+ void set_json_message(const std::string& json_message);
+ void set_protocol_version(ProtocolVersion version);
+ void set_smart_object(const smart_objects::SmartObject& object);
+ void set_data_size(size_t data_size);
+ void set_payload_size(size_t payload_size);
+
+ protocol_handler::MessagePriority Priority() const { return priority_; }
+
+ private:
+ int32_t function_id_; // @remark protocol V2.
+ int32_t correlation_id_; // @remark protocol V2.
+ MessageType type_; // @remark protocol V2.
+
+ // Pre-calculated message priority, higher priority messages are
+ // Processed first
+ protocol_handler::MessagePriority priority_;
+
+ int32_t connection_key_;
+ std::string json_message_;
+ smart_objects::SmartObject smart_object_;
+
+ // TODO(akandul): replace with shared_ptr
+ BinaryData* binary_data_;
+ size_t data_size_;
+ size_t payload_size_;
+ ProtocolVersion version_;
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/message_helper.h b/src/components/application_manager/test/mock/include/application_manager/message_helper.h
new file mode 100644
index 0000000000..e7a7631d69
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/message_helper.h
@@ -0,0 +1,492 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
+
+#include <map>
+#include <string>
+#include <string.h>
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+#include "utils/macro.h"
+#include "connection_handler/device.h"
+#include "application_manager/application.h"
+#include "application_manager/vehicle_info_data.h"
+#include "policy/policy_types.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace application_manager {
+namespace mobile_api = mobile_apis;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+/*
+ * @brief Typedef for VehicleData
+ *
+ * @param const char* Name of the parameter in mobile request
+ * @param VehicleDataType Enum for vehicle data
+ */
+typedef std::map<std::string, VehicleDataType> VehicleData;
+
+/**
+ * @brief MessageHelper class
+ **/
+class MessageHelper {
+ public:
+
+ typedef std::vector<smart_objects::SmartObject*> SmartObjectList;
+
+ /**
+ * @brief Creates request for different interfaces(JSON, DBUS)
+ * @param correlation_id unique ID
+ * @param params Vector of arguments that we need in GetVehicleData request (e.g. gps, odometer, fuel_level)
+ */
+ static void CreateGetVehicleDataRequest(uint32_t correlation_id, const std::vector<std::string>& params);
+
+ /**
+ * @brief Sends HMI status notification to mobile
+ *
+ *@param application_impl application with changed HMI status
+ *
+ **/
+ static void SendHMIStatusNotification(const Application& application_impl);
+
+ /**
+ * @brief Sends OnAppRegistered notification to HMI
+ *
+ *@param application_impl application with changed HMI status
+ *
+ **/
+ static void SendOnAppRegisteredNotificationToHMI(
+ const Application& application_impl, bool resumption = false);
+
+ /**
+ * @brief Create mobile HashUpdateNotification
+ */
+ static smart_objects::SmartObject* GetHashUpdateNotification(const uint32_t app_id);
+
+ /**
+ * @brief Sends to mobile HashUpdateNotification
+ */
+ static void SendHashUpdateNotification(const uint32_t app_id);
+
+ /**
+ * @brief Sends OnAppInterfaceUnregistered notification to mobile
+ *
+ *@param connection_key Connection key
+ *@param reason Reason
+ *
+ **/
+ static void SendOnAppInterfaceUnregisteredNotificationToMobile(
+ int32_t connection_key,
+ mobile_apis::AppInterfaceUnregisteredReason::eType reason);
+
+ /*
+ * @brief Retrieve vehicle data map for param name in mobile request
+ * to VehicleDataType
+ *
+ * @return VehicleData reference
+ */
+ static const VehicleData& vehicle_data();
+
+ /**
+ * @brief Convert string to HMI level, if possible
+ * @param hmi_level Stringified HMI level
+ * @return Appropriate enum from HMI level, or INVALID_ENUM, if conversiion
+ * is not possible
+ */
+ static mobile_api::HMILevel::eType StringToHMILevel(
+ const std::string& hmi_level);
+
+ /*
+ * @brief Used to obtain string representation of app's
+ * HMI Level.
+ * @param hmi_level Desired HMI Level
+ */
+ static std::string StringifiedHMILevel(
+ mobile_apis::HMILevel::eType hmi_level);
+
+ /*
+ * @brief Used to obtain function name by its id
+ * @param function_id Function ID
+ */
+ static std::string StringifiedFunctionID(
+ mobile_apis::FunctionID::eType function_id);
+
+ static smart_objects::SmartObject* CreateBlockedByPoliciesResponse(
+ mobile_apis::FunctionID::eType function_id,
+ mobile_apis::Result::eType result, uint32_t correlation_id,
+ uint32_t connection_key);
+
+ /*
+ * @brief Prepare GetDeviceListResponse
+ *
+ *
+ * @param devices Devices list
+ *
+ */
+ static smart_objects::SmartObject* CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices);
+
+ static smart_objects::SmartObject* CreateModuleInfoSO(
+ uint32_t function_id);
+
+ static smart_objects::SmartObject* CreateSetAppIcon(
+ const std::string& path_to_icon, uint32_t app_id);
+
+ /**
+ * @brief Sends IVI subscriptions
+ */
+ static bool SendIVISubscribtions(const uint32_t app_id);
+
+ /**
+ * @brief Sends IVI subscriptions
+ */
+ static SmartObjectList GetIVISubscribtionRequests(const uint32_t app_id);
+
+ static void SendAppDataToHMI(ApplicationConstSharedPtr app);
+ static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app);
+ static SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
+
+ static smart_objects::SmartObject* CreateAppVrHelp(ApplicationConstSharedPtr app);
+
+ static SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendShowRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+ static SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+
+ static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
+ static void SendAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id);
+
+ static smart_objects::SmartObject* CreateAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id);
+
+ /*
+ * @brief Create Common.HMIApplication struct application instance
+ * @param app : applicaton instace
+ * @param output smart object to store Common.HMIApplication struct
+ * @return true on succes, otherwise return false;
+ */
+ static bool CreateHMIApplicationStruct(ApplicationConstSharedPtr app,
+ smart_objects::SmartObject& output);
+
+ static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
+ static SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Creates BasicCommunication.OnAppUnregistered notification
+ * @param app Application instance
+ * @param is_unexpected_disconnect
+ * Indicates if connection was unexpectedly lost by TM or HB
+ */
+ static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app,
+ bool is_unexpected_disconnect = false);
+ static void SendActivateAppToHMI(
+ uint32_t const app_id,
+ hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL);
+
+ static void SendOnResumeAudioSourceToHMI(const uint32_t app_id);
+
+ static std::string GetDeviceMacAddressForHandle(
+ const uint32_t device_handle);
+
+ static void GetDeviceInfoForHandle(const uint32_t device_handle,
+ policy::DeviceParams* device_info);
+ static void GetDeviceInfoForApp(uint32_t connection_key,
+ policy::DeviceParams* device_info);
+
+ /**
+ * @brief Send SDL_ActivateApp response to HMI
+ * @param permissions response parameters
+ */
+ static void SendSDLActivateAppResponse(policy::AppPermissions& permissions,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send OnSDLConsentNeeded to HMI for device data consent by user
+ * @param device_info Device info, e.g. mac, handle, name
+ */
+ static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info);
+
+ /**
+ * @brief Send request to SyncP process to read file and send
+ * Policy Table Snapshot using Retry Strategy
+ * @param file_path Path to file with PTS
+ * @param timeout Timeout to wait for PTU
+ * @param retries Seconds between retries
+ */
+ static void SendPolicyUpdate(const std::string& file_path,
+ int timeout,
+ const std::vector<int>& retries);
+
+ /**
+ * @brief Send GetUserFriendlyMessage response to HMI
+ * @param msg Appopriate messages params
+ * @param correlation_id Correlation id of request
+ */
+ static void SendGetUserFriendlyMessageResponse(
+ const std::vector<policy::UserFriendlyMessage>& msg,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send GetListOfPermissions response to HMI
+ * @param permissions Array of groups permissions
+ * @param correlation_id Correlation id of request
+ */
+ static void SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ uint32_t correlation_id);
+
+ /*
+ * @brief Sends notification to HMI to start video streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendNaviStartStream(int32_t connection_key);
+
+ /*
+ * @brief Sends notification to HMI to stop video streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendNaviStopStream(int32_t connection_key);
+
+ /*
+ * @brief Send notification for Update of Policy Table
+ * with PT Snapshot.
+ * @param connection_key Id of application to send message to
+ * @param policy_data PT Snapshot
+ * @param url If empty string, no URL is provided
+ * @param timeout If -1 no timeout is provdied
+ */
+ static void SendPolicySnapshotNotification(
+ unsigned int connection_key, const std::vector<uint8_t>& policy_data,
+ const std::string& url = "", int timeout = -1);
+
+ /*
+ * @brief Send notification to mobile on application permissions update
+ * @param connection_key Id of application to send message to
+ * @param permissions updated permissions for application
+ */
+ static void SendOnPermissionsChangeNotification(
+ uint32_t connection_key, const policy::Permissions& permissions);
+
+ /*
+ * @brief Send notification to HMI on application permissions update
+ * @param connection_key Id of application to send message to
+ * @param permissions updated permissions for application
+ */
+ static void SendOnAppPermissionsChangedNotification(
+ uint32_t connection_key, const policy::AppPermissions& permissions);
+
+ /**
+ * @brief Send GetStatusUpdate response to HMI with current policy update
+ * status
+ * @param status Update status
+ * @param correlation_id Correlation id from request
+ */
+ static void SendGetStatusUpdateResponse(const std::string& status,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send UpdateSDL response to HMI with policy update result
+ * @param result Update result
+ * @param correlation_id Correlation id from request
+ */
+ static void SendUpdateSDLResponse(const std::string& result,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Send OnStatusUpdate to HMI on policy update status change
+ * @param status Policy table update status
+ */
+ static void SendOnStatusUpdate(const std::string& status);
+
+ /**
+ * @brief Send GetSystemInfo request to HMI
+ */
+ static void SendGetSystemInfoRequest();
+
+ /*
+ * @brief Sends notification to HMI to start audio streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendAudioStartStream(int32_t connection_key);
+
+ /*
+ * @brief Sends notification to HMI to stop audio streaming
+ *
+ * @param connection_key Application connection key
+ *
+ */
+ static void SendAudioStopStream(int32_t connection_key);
+
+ /*
+ * @brief Sends notification to HMI to stop audioPathThru
+ *
+ * @param connection_key Application connection key
+ *
+ * @return TRUE on SUCCES otherwise return FALSE
+ */
+ static bool SendStopAudioPathThru();
+
+ static smart_objects::SmartObject* CreateNegativeResponse(
+ uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
+ int32_t result_code);
+
+ /*
+ * @brief Verify image and add image file full path
+ *
+ * @param SmartObject with image
+ *
+ * @param app current application
+ *
+ * @return verification result
+ *
+ */
+ static mobile_apis::Result::eType VerifyImage(smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app);
+
+ /*
+ * @brief Finds "Image" structure in request and verify image file presence
+ * in Core.
+ *
+ * @param message SmartObject with request
+ *
+ * @param app current application
+ *
+ * @return verification result
+ *
+ */
+ static mobile_apis::Result::eType VerifyImageFiles(
+ smart_objects::SmartObject& message, ApplicationConstSharedPtr app);
+
+ static mobile_apis::Result::eType VerifyImageVrHelpItems(
+ smart_objects::SmartObject& message, ApplicationConstSharedPtr app);
+
+ /**
+ * @brief Checks string if it contains incorrect character \t\n \\t \\n
+ * or string contains only whitespace
+ * @param parameter str contains string which must be checked
+ * @return returns FALSE if string contains incorrect character or
+ * string is empty otherwise returns TRUE
+ */
+ static bool VerifySoftButtonString(const std::string& str);
+
+ static mobile_apis::Result::eType ProcessSoftButtons(
+ smart_objects::SmartObject& message_params,
+ ApplicationConstSharedPtr app);
+
+ /*
+ * @brief subscribe application to softbutton
+ *
+ * @param message_params contains data of request
+ *
+ * @param app current application
+ *
+ * @param function_id Unique command id from mobile API
+ */
+ static void SubscribeApplicationToSoftButton(
+ smart_objects::SmartObject& message_params,
+ ApplicationSharedPtr app,
+ int32_t function_id);
+
+ static bool PrintSmartObject(const smart_objects::SmartObject& object);
+
+ template<typename From, typename To>
+ static To ConvertEnumAPINoCheck(const From& input) {
+ return static_cast<To>(input);
+ }
+
+ /**
+ * @brief Convert common language to string representation
+ * @param language Common language
+ * @return Common language string representation
+ */
+ static std::string CommonLanguageToString(
+ hmi_apis::Common_Language::eType language);
+
+ /**
+ * @brief Gets command limit number per minute for specific application
+ * @param policy_app_id Unique application id
+ * @return Limit for number of command per minute
+ */
+ static uint32_t GetAppCommandLimit(const std::string& policy_app_id);
+
+ /**
+ * @brief Creates TTS.SetGlobalProperties request and sends
+ * to HMI for VCA module.
+ * @param app contains application which sends TTS GlobalProperties to HMI
+ * after timeout or first time when application register with level NONE or
+ * BACKGROUND
+ * @param default_help_prompt
+ * if default_help_prompt=TRUE->TTSGlobalProperties request will be created with
+ * default helpPrompt array, otherwise TTSGlobalProperties request will be created
+ * with empty helpPrompt array.
+ */
+ static void SendTTSGlobalProperties(
+ ApplicationSharedPtr app, bool default_help_prompt);
+
+ private:
+ /**
+ * @brief Allows to fill SO according to the current permissions.
+ * @param permissions application permissions.
+ * @param message which should be filled.
+ */
+ static void FillAppRevokedPermissions(const policy::AppPermissions& permissions,
+ smart_objects::SmartObject& message);
+
+ static smart_objects::SmartObject* CreateChangeRegistration(
+ int32_t function_id, int32_t language, uint32_t app_id);
+
+ MessageHelper();
+
+ static const VehicleData vehicle_data_;
+ DISALLOW_COPY_AND_ASSIGN(MessageHelper);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h b/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
new file mode 100644
index 0000000000..1bf60fb745
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/mobile_command_factory.h
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
+
+#include "application_manager/commands/command.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+
+/**
+ * @brief Factory class for command creation
+ **/
+class MobileCommandFactory {
+ public:
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param smartObject SmartObject shared pointer.
+ * @return Pointer to created command object.
+ **/
+ static commands::Command* CreateCommand(const MessageSharedPtr& message);
+
+ private:
+ MobileCommandFactory();
+ DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h b/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
new file mode 100644
index 0000000000..c84ba54212
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/mobile_message_handler.h
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
+
+#include "utils/macro.h"
+#include "protocol/common.h"
+#include "application_manager/message.h"
+
+namespace application_manager {
+typedef utils::SharedPtr<application_manager::Message> MobileMessage;
+class MobileMessageHandler {
+ public:
+ static application_manager::Message* HandleIncomingMessageProtocolV1(
+ const RawMessagePtr message);
+
+ static application_manager::Message* HandleIncomingMessageProtocolV2(
+ const RawMessagePtr message);
+
+ //! -------------------------------------------------------------
+
+ static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV1(
+ const MobileMessage& message);
+
+ static protocol_handler::RawMessage* HandleOutgoingMessageProtocolV2(
+ const MobileMessage& message);
+
+ //! -------------------------------------------------------------
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MobileMessageHandler);
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
new file mode 100644
index 0000000000..7fdfb4e0ac
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_event_observer.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/shared_ptr.h"
+
+namespace policy {
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class PolicyManager;
+
+class PolicyEventObserver :
+ public application_manager::event_engine::EventObserver {
+ public:
+ PolicyEventObserver(utils::SharedPtr<PolicyManager> policy_manager);
+ void on_event(const application_manager::event_engine::Event& event);
+ void subscribe_on_event(
+ const application_manager::event_engine::Event::EventID& event_id,
+ int32_t hmi_correlation_id = 0);
+ private:
+ utils::SharedPtr<PolicyManager> policy_manager_;
+ void ProcessOdometerEvent(const smart_objects::SmartObject& message);
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
new file mode 100644
index 0000000000..5bc23c106a
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_handler.h
@@ -0,0 +1,376 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
+
+#include <string>
+#include <map>
+#include <set>
+#include <vector>
+#include "policy/policy_manager.h"
+#include "application_manager/policies/policy_event_observer.h"
+#include "application_manager/policies/pt_exchange_handler.h"
+#include "utils/logger.h"
+#include "utils/singleton.h"
+#include "usage_statistics/statistics_manager.h"
+
+namespace Json {
+class Value;
+}
+
+namespace policy {
+typedef std::vector<uint32_t> AppIds;
+typedef std::vector<uint32_t> DeviceHandles;
+
+class PolicyHandler :
+ public utils::Singleton<PolicyHandler, utils::deleters::Deleter<PolicyHandler> >,
+ public PolicyListener {
+ public:
+ virtual ~PolicyHandler();
+ bool LoadPolicyLibrary();
+ bool PolicyEnabled();
+ bool InitPolicyTable();
+ bool ResetPolicyTable();
+ bool ClearUserConsent();
+ bool SendMessageToSDK(const BinaryMessage& pt_string);
+ bool ReceiveMessageFromSDK(const std::string& file,
+ const BinaryMessage& pt_string);
+ bool UnloadPolicyLibrary();
+ void OnPTExchangeNeeded();
+ void OnPermissionsUpdated(const std::string& policy_app_id,
+ const Permissions& permissions,
+ const HMILevel& default_hmi);
+
+ bool GetPriority(const std::string& policy_app_id, std::string* priority);
+ void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result);
+
+ uint32_t GetNotificationsNumber(const std::string& priority);
+ DeviceConsent GetUserConsentForDevice(const std::string& device_id);
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi);
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL);
+ EndpointUrls GetUpdateUrls(int service_type);
+ void ResetRetrySequence();
+ int NextRetryTimeout();
+ int TimeoutExchange();
+ void OnExceededTimeout();
+ BinaryMessageSptr RequestPTUpdate();
+ const std::vector<int> RetrySequenceDelaysSeconds();
+
+ utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager();
+
+ /**
+ * Checks system action of application for permission of keep context
+ * @param system_action system action (see mobile api)
+ * @param policy_app_id unique application id
+ * @return false if system_action is KEEP_CONTEXT and it isn't allowed by policy
+ * otherwise true
+ */
+ bool CheckKeepContext(int system_action, const std::string& policy_app_id);
+
+ /**
+ * Checks system action of application for permission of steal focus
+ * @param system_action system action (see mobile api)
+ * @param policy_app_id unique application id
+ * @return false if system_action is STEAL_FOCUS and it isn't allowed by policy
+ * otherwise true
+ */
+ bool CheckStealFocus(int system_action, const std::string& policy_app_id);
+
+ /**
+ * Lets client to notify PolicyHandler that more kilometers expired
+ * @param kms New value of odometer
+ */
+ void KmsChanged(int kms);
+
+ /**
+ * @brief Gather information for application and sends it to HMI
+ * @param connection_key Connection key for application
+ */
+ void OnActivateApp(uint32_t connection_key, uint32_t correlation_id);
+
+ /**
+ * @brief Process user consent on mobile data connection access
+ * @param Device id or 0, if concern to all SDL functionality
+ * @param User consent from response
+ */
+ void OnAllowSDLFunctionalityNotification(bool is_allowed,
+ uint32_t device_id = 0);
+
+ /**
+ * @brief Increment counter for ignition cycles
+ */
+ void OnIgnitionCycleOver();
+
+ /**
+ * @brief Send notification to HMI concerning revocation of application
+ * @param policy_app_id Unique identifier of application
+ */
+ void OnAppRevoked(const std::string& policy_app_id);
+
+ void OnPendingPermissionChange(const std::string& policy_app_id);
+
+ /**
+ * Initializes PT exchange at ignition if need
+ */
+ void PTExchangeAtRegistration(const std::string& app_id);
+
+ /**
+ * Initializes PT exchange at user request
+ * @param correlation_id correlation id of request
+ */
+ void PTExchangeAtUserRequest(uint32_t correlation_id);
+
+ /**
+ * @brief Save device info for specific device to policy table
+ * @param device_id Device mac address
+ * @param device_info Device params
+ */
+ void SetDeviceInfo(std::string& device_id, const DeviceInfo& device_info);
+
+ /**
+ * @brief Store user-changed permissions consent to DB
+ * @param connection_key Connection key of application or 0, if permissions
+ * should be applied to all applications
+ * @param permissions User-changed group permissions consent
+ */
+ void OnAppPermissionConsent(const uint32_t connection_key,
+ PermissionConsent& permissions);
+
+ /**
+ * @brief Get appropriate message parameters and send them with response
+ * to HMI
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @param correlation_id correlation id of request
+ */
+ void OnGetUserFriendlyMessage(const std::vector<std::string>& message_codes,
+ const std::string& language,
+ uint32_t correlation_id);
+
+ /**
+ * @brief Get list of permissions for application/device binded to
+ * connection key from request and send response
+ * @param connection_key Connection key for specific application or 0 for all
+ * currently registered applications
+ * @param correlation_id Correlation id from request
+ */
+ void OnGetListOfPermissions(const uint32_t connection_key,
+ const uint32_t correlation_id);
+
+ /**
+ * @brief Get current policy table update state and send response
+ * @param correlation_id Correlation id from request
+ */
+ void OnGetStatusUpdate(const uint32_t correlation_id);
+
+ /**
+ * @brief Send notification to HMI with changed policy update status
+ * @param status Current policy update state
+ */
+ void OnUpdateStatusChanged(policy::PolicyTableStatus status);
+
+ /**
+ * @brief Update currently used device id in policies manager for given
+ * application
+ * @param policy_app_id Application id
+ */
+ std::string OnCurrentDeviceIdUpdateRequired(const std::string& policy_app_id);
+
+ /**
+ * @brief Set parameters from OnSystemInfoChanged to policy table
+ * @param language System language
+ */
+ void OnSystemInfoChanged(const std::string& language);
+
+ /**
+ * @brief Save data from GetSystemInfo request to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void OnGetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ /**
+ * @brief Send request to HMI to get update on system parameters
+ */
+ virtual void OnSystemInfoUpdateRequired();
+
+ /**
+ * @brief Sends GetVehicleData request in case when Vechicle info is ready.
+ */
+ virtual void OnVIIsReady();
+
+ /**
+ * @brief Allows to update vechicle data info.
+ * @param SmartObject which contains all needed information.
+ */
+ virtual void OnVehicleDataUpdated(const smart_objects::SmartObject& message);
+
+ /**
+ * Removes device
+ * @param device_id id of device
+ */
+ void RemoveDevice(const std::string& device_id);
+
+ /**
+ * Adds statistics info
+ * @param type type of info
+ */
+ void AddStatisticsInfo(int type);
+
+ /**
+ * Handles system error
+ * @param code code of error
+ */
+ void OnSystemError(int code);
+
+ /**
+ * @brief Choose application id to be used for snapshot sending
+ * @return Application id or 0, if there are no applications registered
+ */
+ uint32_t GetAppIdForSending();
+
+ std::string GetAppName(const std::string& policy_app_id);
+
+ virtual void OnUserRequestedUpdateCheckRequired();
+
+ virtual void OnDeviceConsentChanged(const std::string& device_id,
+ bool is_allowed);
+
+ /**
+ * @brief Allows to add new or update existed application during
+ * registration process
+ * @param application_id The policy aplication id.
+ */
+ void AddApplication(const std::string& application_id);
+
+ /**
+ * Checks whether application is revoked
+ * @param app_id id application
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id);
+
+ /**
+ * @brief Notifies policy manager, that PTS was sent out
+ */
+ void OnUpdateRequestSentToMobile();
+
+ /**
+ * Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in seconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint16_t HeartBeatTimeout(const std::string& app_id) const;
+
+protected:
+
+ /**
+ * Starts next retry exchange policy table
+ */
+ void StartNextRetry();
+
+ /**
+ * Initializes PT exchange at odometer if need
+ * @param kilometers value from odometer in kilometers
+ */
+ void PTExchangeAtOdometer(int kilometers);
+
+ /**
+ * Starts proccess updating policy table
+ */
+ void StartPTExchange(bool skip_device_selection = false);
+
+ private:
+ /**
+ * @brief Choose device according to app HMI status and user consent for
+ * device
+ * @param device_info Struct with selected device parameters
+ * @return consent status for selected device
+ */
+ DeviceConsent GetDeviceForSending(DeviceParams& device_params);
+
+ /**
+ * @brief Convert internal policy update status to appropriate status for HMI
+ * @param status Internal policy update status
+ * @return Converted status for sending to HMI
+ */
+ const std::string ConvertUpdateStatus(policy::PolicyTableStatus status);
+
+private:
+ PolicyHandler();
+ static PolicyHandler* instance_;
+ static const std::string kLibrary;
+ utils::SharedPtr<PolicyManager> policy_manager_;
+ void* dl_handle_;
+ AppIds last_used_app_ids_;
+ utils::SharedPtr<PTExchangeHandler> exchange_handler_;
+ utils::SharedPtr<PolicyEventObserver> event_observer_;
+ bool on_ignition_check_done_;
+ uint32_t last_activated_app_id_;
+ bool registration_in_progress;
+
+ /**
+ * @brief Contains device handles, which were sent for user consent to HMI
+ */
+ DeviceHandles pending_device_handles_;
+
+ inline bool CreateManager();
+
+ bool is_user_requested_policy_table_update_;
+
+ /**
+ * @brief Application-to-device map is used for getting/setting user consents
+ * for all apps
+ */
+ std::map<std::string, std::string> app_to_device_link_;
+
+ DISALLOW_COPY_AND_ASSIGN(PolicyHandler);
+ FRIEND_BASE_SINGLETON_CLASS_WITH_DELETER(PolicyHandler,
+ utils::deleters::Deleter<PolicyHandler>);
+ FRIEND_DELETER_DESTRUCTOR(PolicyHandler);
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h b/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
new file mode 100644
index 0000000000..f1a9ff55b8
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/policy_retry_sequence.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
+
+#include "utils/threads/thread_delegate.h"
+
+namespace policy {
+
+class PolicyHandler;
+
+class RetrySequence : public threads::ThreadDelegate {
+ public:
+ explicit RetrySequence(PolicyHandler* const policy_handler);
+ void threadMain();
+
+ private:
+ PolicyHandler* const policy_handler_;
+ void StartNextRetry();
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_RETRY_SEQUENCE_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
new file mode 100644
index 0000000000..31f7ded507
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler.h
@@ -0,0 +1,47 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
+
+#include "policy/policy_manager.h"
+
+namespace policy {
+class PTExchangeHandler {
+ public:
+ virtual ~PTExchangeHandler() {};
+ virtual void Start() = 0;
+ virtual void Stop() = 0;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
new file mode 100644
index 0000000000..05aec0c3e9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_ext.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
+
+#include "application_manager/policies/pt_exchange_handler.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace policy {
+class PTExchangeHandlerExt : public PTExchangeHandler {
+ public:
+ PTExchangeHandlerExt(PolicyHandler* policy_handler);
+ ~PTExchangeHandlerExt();
+ virtual void Start();
+ virtual void Stop();
+
+ private:
+ PolicyHandler* policy_handler_;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_HANDLER_EXT_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
new file mode 100644
index 0000000000..e1e67b1505
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/policies/pt_exchange_handler_impl.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
+
+#include "application_manager/policies/pt_exchange_handler.h"
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
+
+namespace policy {
+
+class PolicyHandler;
+
+class PTExchangeHandlerImpl : public PTExchangeHandler {
+ public:
+ PTExchangeHandlerImpl(PolicyHandler* handler);
+ virtual ~PTExchangeHandlerImpl();
+ virtual void Start();
+ virtual void Stop();
+
+ protected:
+ PolicyHandler* policy_handler_;
+ threads::Thread retry_sequence_;
+ sync_primitives::Lock retry_sequence_lock_;
+
+ friend class RetrySequence;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXCHANGE_IMPL_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_controller.h b/src/components/application_manager/test/mock/include/application_manager/request_controller.h
new file mode 100644
index 0000000000..b70608fbc2
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/request_controller.h
@@ -0,0 +1,266 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
+
+#include <climits>
+#include <vector>
+#include <list>
+
+#include "utils/lock.h"
+#include "utils/shared_ptr.h"
+#include "utils/threads/thread.h"
+#include "utils/conditional_variable.h"
+#include "utils/threads/thread_delegate.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+#include "application_manager/request_info.h"
+#include "utils/timer_thread.h"
+
+
+namespace application_manager {
+
+namespace request_controller {
+
+using namespace threads;
+
+/**
+* @brief RequestController class is used to control currently active mobile
+* requests.
+*/
+class RequestController {
+ public:
+
+ /**
+ * @brief Result code for addRequest
+ */
+ enum TResult
+ {
+ SUCCESS = 0,
+ TOO_MANY_REQUESTS,
+ TOO_MANY_PENDING_REQUESTS,
+ NONE_HMI_LEVEL_MANY_REQUESTS,
+ INVALID_DATA
+ };
+
+ /**
+ * @brief Thread pool state
+ */
+ enum TPoolState
+ {
+ UNDEFINED = 0,
+ STARTED,
+ STOPPED,
+ };
+
+ // Methods
+
+ /**
+ * @brief Class constructor
+ *
+ */
+ RequestController();
+
+ /**
+ * @brief Class destructor
+ *
+ */
+ virtual ~RequestController();
+
+ /**
+ * @brief Initialize thread pool
+ *
+ */
+ void InitializeThreadpool();
+
+ /**
+ * @brief Destroy thread pool
+ *
+ */
+ void DestroyThreadpool();
+
+ /**
+ * @brief Check if max request amount wasn't exceed and adds request to queue.
+ *
+ * @param request Active mobile request
+ * @param hmi_level Current application hmi_level
+ *
+ * @return Result code
+ *
+ */
+ TResult addMobileRequest(const MobileRequestPtr& request,
+ const mobile_apis::HMILevel::eType& hmi_level);
+
+
+ /**
+ * @brief Store HMI request until response or timeout won't remove it
+ *
+ * @param request Active hmi request
+ * @return Result code
+ *
+ */
+ TResult addHMIRequest(const RequestPtr& request);
+
+ /**
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ void addNotification(const RequestPtr ptr);
+
+ /**
+ * @brief Removes request from queue
+ *
+ * @param mobile_corellation_id Active mobile request correlation ID
+ *
+ */
+ void terminateMobileRequest(const uint32_t& mobile_correlation_id);
+
+
+ /**
+ * @brief Removes request from queue
+ *
+ * @param mobile_corellation_id Active mobile request correlation ID
+ *
+ */
+ void terminateHMIRequest(const uint32_t& correlation_id);
+
+ /**
+ * @ Add notification to collection
+ *
+ * @param ptr Reference to shared pointer that point on hmi notification
+ */
+ void removeNotification(const commands::Command* notification);
+
+ /**
+ * @brief Removes all requests from queue for specified application
+ *
+ * @param app_id Mobile application ID (app_id)
+ *
+ */
+ void terminateAppRequests(const uint32_t& app_id);
+
+ /**
+ * @brief Terminates all requests from HMI
+ */
+ void terminateAllHMIRequests();
+
+ /**
+ * @brief Updates request timeout
+ *
+ * @param app_id Connection key of application
+ * @param mobile_correlation_id Correlation ID of the mobile request
+ * @param new_timeout_value New timeout to be set
+ */
+ void updateRequestTimeout(const uint32_t& app_id,
+ const uint32_t& mobile_correlation_id,
+ const uint32_t& new_timeout);
+
+ protected:
+
+ /**
+ * @brief Checs if this app as able to add new requests, or limits was exceeded
+ * @param app_id - application id
+ * @param app_time_scale - time scale (seconds)
+ * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
+ */
+ bool checkTimeScaleMaxRequest(const uint32_t& app_id, const uint32_t& app_time_scale, const uint32_t& max_request_per_time_scale);
+
+ /**
+ * @brief Checs if this app as able to add new requests in current hmi_level, or limits was exceeded
+ * @param hmi_level - hmi level
+ * @param app_id - application id
+ * @param app_time_scale - time scale (seconds)
+ * @param max_request_per_time_scale - maximum count of request that should be allowed for app_time_scale secconds
+ */
+ bool checkHMILevelTimeScaleMaxRequest(const mobile_apis::HMILevel::eType& hmi_level, const uint32_t& app_id, const uint32_t& app_time_scale, const uint32_t& max_request_per_time_scale);
+
+ void onTimer();
+
+ /**
+ * @brief Update timout for next OnTimer
+ * Not thread safe
+ */
+ void UpdateTimer();
+
+ private:
+
+ // Data types
+
+ class Worker : public ThreadDelegate {
+ public:
+ Worker(RequestController* requestController);
+ virtual ~Worker();
+ virtual void threadMain();
+ virtual bool exitThreadMain();
+ protected:
+ private:
+ RequestController* request_controller_;
+ sync_primitives::Lock thread_lock_;
+ volatile bool stop_flag_;
+ };
+
+ /**
+ * @brief Typedef for thread shared pointer
+ */
+ typedef utils::SharedPtr<Thread> ThreadSharedPtr;
+
+ std::vector<ThreadSharedPtr> pool_;
+ volatile TPoolState pool_state_;
+ uint32_t pool_size_;
+ sync_primitives::ConditionalVariable cond_var_;
+
+ std::list<MobileRequestPtr> mobile_request_list_;
+ sync_primitives::Lock mobile_request_list_lock_;
+
+ RequestInfoSet pending_request_set_;
+ sync_primitives::Lock pending_request_set_lock_;
+
+ /**
+ * @brief Set of HMI notifications with timeout.
+ */
+ std::list<RequestPtr> notification_list_;
+
+ timer::TimerThread<RequestController> timer_;
+ static const uint32_t dafault_sleep_time_ = UINT_MAX;
+
+ DISALLOW_COPY_AND_ASSIGN(RequestController);
+};
+
+} // namespace request_controller
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/request_info.h b/src/components/application_manager/test/mock/include/application_manager/request_info.h
new file mode 100644
index 0000000000..778e72c916
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/request_info.h
@@ -0,0 +1,236 @@
+/**
+* \file request_info.h
+* \brief request information structure header file.
+*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
+
+#include <stdint.h>
+
+#include "application_manager/commands/command_request_impl.h"
+#include "commands/hmi/request_to_hmi.h"
+
+#include "utils/date_time.h"
+
+namespace application_manager {
+
+namespace request_controller {
+
+ /*
+ * @brief Typedef for active mobile request
+ *
+ */
+ typedef utils::SharedPtr<commands::Command> RequestPtr;
+ typedef utils::SharedPtr<commands::CommandRequestImpl> MobileRequestPtr;
+
+ struct RequestInfo {
+ RequestInfo(const uint64_t timeout_sec):
+ timeout_sec_(timeout_sec) {
+ start_time_ = date_time::DateTime::getCurrentTime();
+ updateEndTime();
+ }
+
+ RequestInfo(const TimevalStruct& start_time,const uint64_t timeout_sec):
+ start_time_(start_time),
+ timeout_sec_(timeout_sec) {
+ updateEndTime();
+ }
+
+ virtual ~RequestInfo(){}
+
+ virtual uint32_t requestId() = 0;
+ virtual commands::Command* request() = 0;
+
+ void updateEndTime() {
+ end_time_ = date_time::DateTime::getCurrentTime();
+ end_time_.tv_sec += timeout_sec_;
+ }
+
+ void updateTimeOut(const uint64_t& timeout_sec) {
+ timeout_sec_ = timeout_sec;
+ updateEndTime();
+ }
+
+ bool isExpired() {
+ if ( date_time::GREATER ==
+ date_time::DateTime::compareTime(end_time_, date_time::DateTime::getCurrentTime()) ) {
+ return false;
+ }
+ return true;
+ }
+ TimevalStruct start_time() {
+ return start_time_;
+ }
+ uint64_t timeout_sec() {
+ return timeout_sec_;
+ }
+
+ TimevalStruct end_time() {
+ return end_time_;
+ }
+
+ protected:
+ TimevalStruct start_time_;
+ uint64_t timeout_sec_;
+ TimevalStruct end_time_;
+ };
+
+ typedef utils::SharedPtr<RequestInfo> RequestInfoPtr;
+
+ struct RequestInfoComparator {
+ bool operator() (const RequestInfoPtr lhs, const RequestInfoPtr rhs) const {
+ date_time::TimeCompare compare_result = date_time::DateTime::compareTime(lhs->end_time(), rhs->end_time());
+ return compare_result == date_time::LESS;
+ }
+ };
+
+ typedef std::set<RequestInfoPtr,RequestInfoComparator> RequestInfoSet;
+
+ struct HMIRequestInfo: public RequestInfo {
+ HMIRequestInfo(RequestPtr request, const uint64_t timeout_sec);
+ HMIRequestInfo(RequestPtr request, const TimevalStruct& start_time,const uint64_t timeout_sec);
+ RequestPtr request_;
+ uint32_t correlation_id_;
+ virtual uint32_t requestId() {
+ return correlation_id_;
+ }
+ virtual commands::Command* request() {
+ return request_.get();
+ }
+ };
+
+ struct MobileRequestInfo: public RequestInfo {
+ MobileRequestInfo(MobileRequestPtr request, const uint64_t timeout_sec);
+ MobileRequestInfo(MobileRequestPtr request, const TimevalStruct& start_time, const uint64_t timeout_sec);
+ MobileRequestPtr request_;
+ uint32_t app_id_;
+ mobile_apis::HMILevel::eType hmi_level_;
+ uint32_t mobile_correlation_id_;
+
+ virtual uint32_t requestId() {
+ return mobile_correlation_id_;
+ }
+
+ virtual commands::Command* request() {
+ return request_.get();
+ }
+ };
+
+ /**
+ * @brief Structure used in std algorithms to determine amount of request
+ * during time scale
+ */
+ struct TimeScale {
+ explicit TimeScale(const TimevalStruct& start, const TimevalStruct& end,
+ const int32_t& app_id)
+ : start_(start),
+ end_(end),
+ app_id_(app_id) {}
+
+ bool operator()(RequestInfoPtr setEntry) {
+ MobileRequestInfo* mobile_request_info = NULL;
+ RequestInfo* request = setEntry.get();
+ mobile_request_info = dynamic_cast<MobileRequestInfo*>(request);
+ if (NULL == mobile_request_info) {
+ return false;
+ }
+
+ if (mobile_request_info->app_id_ != app_id_) {
+ return false;
+ }
+
+ if (date_time::DateTime::getmSecs(mobile_request_info->start_time())
+ < date_time::DateTime::getmSecs(start_) ||
+ date_time::DateTime::getmSecs(mobile_request_info->start_time())
+ > date_time::DateTime::getmSecs(end_)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private:
+ TimevalStruct start_;
+ TimevalStruct end_;
+ uint32_t app_id_;
+ };
+
+ /**
+ * @brief Structure used in std algorithms to determine amount of request
+ * during time scale for application in defined hmi level
+ */
+ struct HMILevelTimeScale {
+ explicit HMILevelTimeScale(
+ const TimevalStruct& start, const TimevalStruct& end,
+ const uint32_t& app_id, const mobile_apis::HMILevel::eType& hmi_level)
+ : start_(start),
+ end_(end),
+ app_id_(app_id),
+ hmi_level_(hmi_level) {}
+
+ bool operator()(RequestInfoPtr setEntry) {
+ MobileRequestInfo* mobile_request_info = NULL;
+ mobile_request_info = dynamic_cast<MobileRequestInfo*>(setEntry.get());
+ if (NULL == mobile_request_info) {
+ return false;
+ }
+ if (mobile_request_info->app_id_ != app_id_) {
+ return false;
+ }
+ if (mobile_request_info->hmi_level_ != hmi_level_) {
+ return false;
+ }
+
+ if (date_time::DateTime::getSecs(mobile_request_info->start_time())
+ < date_time::DateTime::getSecs(start_) ||
+ date_time::DateTime::getSecs(mobile_request_info->start_time())
+ > date_time::DateTime::getSecs(end_)) {
+ return false;
+ }
+
+ return true;
+ }
+ private:
+ TimevalStruct start_;
+ TimevalStruct end_;
+ uint32_t app_id_;
+ mobile_apis::HMILevel::eType hmi_level_;
+ };
+
+
+
+} // namespace request_controller
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h b/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
new file mode 100644
index 0000000000..463df0b867
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/resume_ctrl.h
@@ -0,0 +1,285 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
+
+#include <stdint.h>
+#include <vector>
+#include <map>
+#include <set>
+#include <list>
+
+#include "json/json.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
+#include "connection_handler/connection_handler_observer.h"
+#include "connection_handler/device.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/application.h"
+#include "utils/timer_thread.h"
+
+namespace application_manager {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class ApplicationManagerImpl;
+class Application;
+class ResumeCtrl: public event_engine::EventObserver {
+
+ public:
+
+ /**
+ * @brief Constructor
+ * @param app_mngr ApplicationManager pointer
+ */
+ explicit ResumeCtrl(ApplicationManagerImpl* app_mngr);
+
+ /**
+ * @brief Event, that raised if application get resumption response from HMI
+ * @param event : event object, that contains smart_object with HMI message
+ */
+ virtual void on_event(const event_engine::Event& event);
+
+ /**
+ * @brief Save all applications info to the file system
+ */
+ void SaveAllApplications();
+
+ /**
+ * @brief Save application persistent info for future resuming
+ * @param application is application witch need to be saved
+ */
+ void SaveApplication(ApplicationConstSharedPtr application);
+
+ /**
+ * @brief Set application HMI Level as saved
+ * @param application is application witch HMI Level is need to restore
+ * @return true if success, otherwise return false
+ */
+ bool RestoreApplicationHMILevel(ApplicationSharedPtr application);
+
+ /**
+ * @brief Set application HMI Level as stored in policy
+ * @param application is application witch HMI Level is need to setup
+ * @return true if success, otherwise return false
+ */
+ bool SetupDefaultHMILevel(ApplicationSharedPtr application);
+
+ /**
+ * @brief Setup HmiLevel for application
+ * Do routine of setting up hmi_level
+ * @param application is application witch HMI Level is need to setup
+ * @param hmi_level HMI Level is needed to setup
+ * @param hmi_level AudioStreamingState is needed to setup
+ * @param check_policy indicate if policy data consent must be verified
+ * @return true if success, otherwise return false
+ */
+ bool SetupHMILevel(ApplicationSharedPtr application,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_streaming_state,
+ bool check_policy = true);
+
+ /**
+ * @brief Set application HMI Level as saved
+ * @param application is application witch HMI Level is need to restore
+ * @return true if success, otherwise return false
+ */
+ bool RestoreApplicationData(ApplicationSharedPtr application);
+
+ /**
+ * @brief Check if Resume controller have saved instance of application
+ * @param application is application witch need to be checked
+ * @return true if exist, false otherwise
+ */
+ bool ApplicationIsSaved(ApplicationConstSharedPtr application);
+
+ /**
+ * @brief Remove application from list of saved applications
+ * @param application is application witch need to be removed
+ * @return return true, if success, otherwise return false
+ */
+ bool RemoveApplicationFromSaved(ApplicationConstSharedPtr application);
+
+ /**
+ * @brief Increments ignition counter for all registered applications
+ */
+ void IgnitionOff();
+
+ /**
+ * @brief Start timer for resumption applications
+ * Restore D1-D5 data
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool StartResumption(ApplicationSharedPtr application, uint32_t hash);
+
+ /**
+ * @brief Start timer for resumption applications
+ * Does not restore D1-D5 data
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool StartResumptionOnlyHMILevel(ApplicationSharedPtr application);
+
+ /**
+ * @brief Check if there are all files need for resumption
+ * @param application that is need to be restored
+ * @return true if it all files exist, otherwise return false
+ */
+ bool CheckPersistenceFilesForResumption(ApplicationSharedPtr application);
+
+ /**
+ * @brief Check application hash
+ * @param application that is need to be restored
+ * @return true if it was saved, otherwise return false
+ */
+ bool CheckApplicationHash(ApplicationSharedPtr application, uint32_t hash);
+
+ /**
+ * @brief Check if Resume controller have saved application with hmi app id
+ * @param hmi_app_id - hmi application id
+ * @return true if exist, false otherwise
+ */
+ bool IsHMIApplicationIdExist(uint32_t hmi_app_id);
+
+ /**
+ * @brief Check if Resume controller have saved instance of application
+ * @param mobile_app_id - mobile application id
+ * @return true if exist, false otherwise
+ */
+ bool IsApplicationSaved(const std::string& mobile_app_id);
+
+ /**
+ * @brief Function is used for application resume. HMI app ID must be
+ * the same(PASA VCA module use it for stored app info).
+ * Retrieves HMI app ID for the given mobile app ID from stored information.
+ *
+ * @param mobile_app_id - mobile application id
+ * @return HMI app ID
+ */
+ uint32_t GetHMIApplicationID(const std::string& mobile_app_id);
+
+ /**
+ * @brief Timer callback function
+ *
+ */
+ void onTimer();
+
+ void ClearResumptionInfo();
+
+ private:
+
+ typedef std::pair<uint32_t, uint32_t> application_timestamp;
+
+ /**
+ * @brief This struct need to map
+ * timestamp and application from correlationID
+ */
+ struct ResumingApp {
+ uint32_t old_session_key; // session key is the same as app_id
+ ApplicationSharedPtr app;
+ };
+
+ struct TimeStampComparator {
+ bool operator() (const application_timestamp& lhs,
+ const application_timestamp& rhs) const{
+ return lhs.second < rhs.second;
+ }
+ };
+
+ /**
+ * @brief Check device MAC address
+ *
+ * @param application that is need to be restored
+ * @param saved_device_mac Saved device MAC address
+ *
+ * @return TRUE on success, otherwise FALSE
+ */
+ bool IsDeviceMacAddressEqual(ApplicationSharedPtr application,
+ const std::string& saved_device_mac);
+
+ Json::Value& GetSavedApplications();
+
+ void SetSavedApplication(Json::Value& apps_json);
+
+ Json::Value GetApplicationCommands(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationSubMenus(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationInteractionChoiseSets(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationGlobalProperties(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationSubscriptions(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationFiles(
+ ApplicationConstSharedPtr application);
+ Json::Value GetApplicationShow(
+ ApplicationConstSharedPtr application);
+
+ Json::Value JsonFromSO(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject *so);
+
+ void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id,
+ const smart_objects::SmartObject* msg_params = NULL,
+ bool use_events = false);
+
+ bool ProcessHMIRequest(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* request = NULL,
+ bool use_events = false);
+
+ /**
+ * @brief Time step to check resumption TIME_OUT
+ */
+ static const uint32_t kTimeStep = 3;
+
+ /**
+ * @brief times of IGN_OFF that zombie application have to be saved.
+ */
+ static const uint32_t kApplicationLifes = 3;
+
+ /**
+ *@brief Mapping applications to time_stamps
+ * wait for timer to resume HMI Level
+ *
+ */
+ std::multiset<application_timestamp, TimeStampComparator> waiting_for_timer_;
+ mutable sync_primitives::Lock queue_lock_;
+ ApplicationManagerImpl* app_mngr_;
+ timer::TimerThread<ResumeCtrl> timer_;
+};
+
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H
diff --git a/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h b/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
new file mode 100644
index 0000000000..1df8b21ad9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/smart_object_keys.h
@@ -0,0 +1,369 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
+
+namespace application_manager {
+
+namespace strings {
+
+const char params[] = "params";
+const char message_type[] = "message_type";
+const char correlation_id[] = "correlation_id";
+const char function_id[] = "function_id";
+const char protocol_version[] = "protocol_version";
+const char protocol_type[] = "protocol_type";
+const char connection_key[] = "connection_key";
+const char error[] = "error";
+const char error_msg[] = "message";
+const char default_app_id[] = "default";
+
+
+const char msg_params[] = "msg_params";
+const char info[] = "info";
+const char app_id[] = "appID";
+const char hmi_app_id[] = "hmiAppID";
+const char device_mac[] = "deviceMAC";
+const char url[] = "url";
+const char cmd_icon[] = "cmdIcon";
+const char result_code[] = "resultCode";
+const char success[] = "success";
+const char sync_msg_version[] = "syncMsgVersion";
+const char major_version[] = "majorVersion";
+const char minor_version[] = "minorVersion";
+const char app_name[] = "appName";
+const char ngn_media_screen_app_name[] = "ngnMediaScreenAppName";
+const char vr_synonyms[] = "vrSynonyms";
+const char uses_vehicle_data[] = "usesVehicleData";
+const char is_media_application[] = "isMediaApplication";
+const char language_desired[] = "languageDesired";
+const char auto_activated_id[] = "autoActivateID";
+const char app_type[] = "appType";
+const char app_hmi_type[] = "appHMIType";
+const char tts_name[] = "ttsName";
+const char binary_data[] = "binary_data";
+const char timeout_prompt[] = "timeoutPrompt";
+const char timeout[] = "timeout";
+const char vr_help_title[] = "vrHelpTitle";
+const char vr_help[] = "vrHelp";
+const char main_field_1[] = "mainField1";
+const char main_field_2[] = "mainField2";
+const char main_field_3[] = "mainField3";
+const char main_field_4[] = "mainField4";
+const char eta[] = "eta";
+const char time_to_destination[] = "timeToDestination";
+const char total_distance[] = "totalDistance";
+const char alignment[] = "alignment";
+const char graphic[] = "graphic";
+const char secondary_graphic[] = "secondaryGraphic";
+const char status_bar[] = "statusBar";
+const char media_clock[] = "mediaClock";
+const char media_track[] = "mediaTrack";
+const char properties[] = "properties";
+const char cmd_id[] = "cmdID";
+const char menu_params[] = "menuParams";
+const char menu_title[] = "menuTitle";
+const char menu_icon[] = "menuIcon";
+const char keyboard_properties[] = "keyboardProperties";
+const char vr_commands[] = "vrCommands";
+const char position[] = "position";
+const char num_ticks[] = "numTicks";
+const char slider_footer[] = "sliderFooter";
+const char menu_id[] = "menuID";
+const char menu_name[] = "menuName";
+const char interaction_choice_set_id[] = "interactionChoiceSetID";
+const char interaction_choice_set_id_list[] = "interactionChoiceSetIDList";
+const char choice_set[] = "choiceSet";
+const char choice_id[] = "choiceID";
+const char grammar_id[] = "grammarID";
+const char navigation_text_1[] = "navigationText1";
+const char navigation_text_2[] = "navigationText2";
+const char alert_text1[] = "alertText1";
+const char alert_text2[] = "alertText2";
+const char alert_text3[] = "alertText3";
+const char tts_chunks[] = "ttsChunks";
+const char initial_prompt[] = "initialPrompt";
+const char initial_text[] = "initialText";
+const char duration[] = "duration";
+const char progress_indicator[] = "progressIndicator";
+const char alert_type[] = "alertType";
+const char play_tone[] = "playTone";
+const char soft_buttons[] = "softButtons";
+const char soft_button_id[] = "softButtonID";
+const char custom_presets[] = "customPresets";
+const char audio_pass_display_text1[] = "audioPassThruDisplayText1";
+const char audio_pass_display_text2[] = "audioPassThruDisplayText2";
+const char max_duration[] = "maxDuration";
+const char sampling_rate[] = "samplingRate";
+const char bits_per_sample[] = "bitsPerSample";
+const char audio_type[] = "audioType";
+const char mute_audio[] = "muteAudio";
+const char button_name[] = "buttonName";
+const char button_event_mode[] = "buttonEventMode";
+const char button_press_mode[] = "buttonPressMode";
+const char custom_button_id[] = "customButtonID";
+const char data_type[] = "dataType";
+const char turn_list[] = "turnList";
+const char turn_icon[] = "turnIcon";
+const char next_turn_icon[] = "nextTurnIcon";
+const char value[] = "value";
+const char hmi_display_language[] = "hmiDisplayLanguage";
+const char language[] = "language";
+const char data[] = "data";
+const char start_time[] = "startTime";
+const char end_time[] = "endTime";
+const char hours[] = "hours";
+const char minutes[] = "minutes";
+const char seconds [] = "seconds";
+const char update_mode[] = "updateMode";
+const char trigger_source[] = "triggerSource";
+const char hmi_level[] = "hmiLevel";
+const char activate_app_hmi_level[] = "level";
+const char audio_streaming_state[] = "audioStreamingState";
+const char system_context[] = "systemContext";
+const char speech_capabilities[] = "speechCapabilities";
+const char vr_capabilities[] = "vrCapabilities";
+const char audio_pass_thru_capabilities[] = "audioPassThruCapabilities";
+// PutFile
+const char sync_file_name[] = "syncFileName";
+const char file_name[] = "fileName";
+const char file_type[] = "fileType";
+const char file_size[] = "fileSize";
+const char request_type[] = "requestType";
+const char persistent_file[] = "persistentFile";
+const char file_data[] = "fileData";
+const char space_available[] = "spaceAvailable";
+const char image_type[] = "imageType";
+const char image[] = "image";
+const char type[] = "type";
+const char system_file[] = "systemFile";
+const char offset[] = "offset";
+const char length[] = "length";
+const char secondary_image[] = "secondaryImage";
+const char filenames[] = "filenames";
+
+const char hmi_display_language_desired[] = "hmiDisplayLanguageDesired";
+const char ecu_name[] = "ecuName";
+const char dtc_mask[] = "dtcMask";
+const char did_location[] = "didLocation";
+const char app_list[] = "appList";
+const char device_list[] = "deviceList";
+const char device_info[] = "deviceInfo";
+const char name[] = "name";
+const char id[] = "id";
+const char isSDLAllowed[] = "isSDLAllowed";
+const char application[] = "application";
+const char applications[] = "applications";
+const char icon[] = "icon";
+const char device_name[] = "deviceName";
+const char reason[] = "reason";
+const char available[] = "available";
+const char text[] = "text";
+const char character_set[] = "characterSet";
+const char secondary_text[] = "secondaryText";
+const char tertiary_text[] = "tertiaryText";
+const char hardware[] = "hardware";
+const char firmware_rev[] = "firmwareRev";
+const char os[] = "os";
+const char os_version[] = "osVersion";
+const char carrier[] = "carrier";
+const char slider_header[] = "sliderHeader";
+
+// duplicate names from hmi_request
+const char limited_character_list[] = "limitedCharacterList";
+const char auto_complete_text[] = "autoCompleteText";
+const char navigation_text[] = "navigationText";
+
+// vehicle info
+const char gps[] = "gps";
+const char speed[] = "speed";
+const char rpm[] = "rpm";
+const char fuel_level[] = "fuelLevel";
+const char fuel_level_state[] = "fuelLevel_State";
+const char instant_fuel_consumption[] = "instantFuelConsumption";
+const char external_temp[] = "externalTemperature";
+const char vin[] = "vin";
+const char prndl[] = "prndl";
+const char tire_pressure[] = "tirePressure";
+const char odometer[] = "odometer";
+const char belt_status[] = "beltStatus";
+const char body_information[] = "bodyInformation";
+const char device_status[] = "deviceStatus";
+const char driver_braking[] = "driverBraking";
+const char wiper_status[] = "wiperStatus";
+const char head_lamp_status[] = "headLampStatus";
+const char engine_torque[] = "engineTorque";
+const char acc_pedal_pos[] = "accPedalPosition";
+const char steering_wheel_angle[] = "steeringWheelAngle";
+const char e_call_info[] = "eCallInfo";
+const char airbag_status[] = "airbagStatus";
+const char emergency_event[] = "emergencyEvent";
+const char cluster_mode_status[] = "clusterModeStatus";
+const char my_key[] = "myKey";
+const char help_prompt[] = "helpPrompt";
+const char scroll_message_body[] = "scrollableMessageBody";
+const char data_result[] = "dataResult";
+const char dtc_list[] = "dtcList";
+const char interaction_mode[] = "interactionMode";
+const char slider_position[] = "sliderPosition";
+const char system_action[] = "systemAction";
+const char prerecorded_speech[] = "prerecordedSpeech";
+const char supported_diag_modes[] = "supportedDiagModes";
+const char priority[] = "priority";
+
+//resuming
+const char application_commands[] = "applicationCommands";
+const char application_submenus[] = "applicationSubMenus";
+const char application_choise_sets[] = "applicationChoiceSets";
+const char application_global_properties[] = "globalProperties";
+const char application_vehicle_info[] = "vehicleInfo";
+const char application_buttons[] = "buttons";
+const char application_subscribtions[] = "subscribtions";
+const char application_files[] = "applicationFiles";
+const char application_show[] = "applicationShow";
+const char resumption[] = "resumption";
+const char resume_vr_grammars[] = "resumeVrGrammars";
+
+const char ign_off_count[] = "ign_off_count";
+const char connection_info[] = "connection_info";
+const char is_download_complete[] = "is_download_complete";
+
+const char hash_id[] = "hashID";
+const char time_stamp[] = "timeStamp";
+const char manual_text_entry[] = "manualTextEntry";
+const char image_type_supported[] = "imageTypeSupported";
+const char unexpected_disconnect[] = "unexpectedDisconnect";
+const char location_name[] = "locationName";
+const char location_description[] = "locationDescription";
+const char address_lines[] = "addressLines";
+const char phone_number[] = "phoneNumber";
+const char location_image[] = "locationImage";
+} // namespace strings
+
+namespace mobile_notification {
+const char state[] = "state";
+const char syncp_timeout[] = "Timeout";
+const char syncp_url[] = "URL";
+} // namespace mobile_notification
+
+namespace hmi_levels {
+const char kFull[] = "FULL";
+const char kLimited[] = "LIMITED";
+const char kBackground[] = "BACKGROUND";
+const char kNone[] = "NONE";
+}
+
+namespace hmi_request {
+const char parent_id[] = "parentID";
+const char field_name[] = "fieldName";
+const char field_text[] = "fieldText";
+const char alert_strings[] = "alertStrings";
+const char duration[] = "duration";
+const char soft_buttons[] = "softButtons";
+const char tts_chunks[] = "ttsChunks";
+const char speak_type[] = "speakType";
+const char audio_pass_display_texts[] = "audioPassThruDisplayTexts";
+const char max_duration[] = "maxDuration";
+const char reason[] = "reason";
+const char message_text[] = "messageText";
+const char initial_text[] = "initialText";
+const char navi_texts[] = "navigationTexts";
+const char navi_text[] = "navigationText";
+const char show_strings[] = "showStrings";
+const char interaction_layout[] = "interactionLayout";
+const char menu_title[] = "menuTitle";
+const char menu_icon[] = "menuIcon";
+const char keyboard_properties[] = "keyboardProperties";
+const char method_name[] = "methodName";
+const char keyboard_layout[] = "keyboardLayout";
+const char limited_character_list[] = "limitedCharacterList";
+const char auto_complete_text[] = "autoCompleteText";
+const char file[] = "file";
+const char retry[] = "retry";
+const char service[] = "service";
+} // namespace hmi_request
+
+namespace hmi_response {
+const char code[] = "code";
+const char message[] = "message";
+const char method[] = "method";
+const char try_again_time[] = "tryAgainTime";
+const char custom_button_id[] = "customButtonID";
+const char button_name[] = "name";
+const char button_mode[] = "mode";
+const char attenuated_supported[] = "attenuatedSupported";
+const char languages[] = "languages";
+const char language[] = "language";
+const char display_capabilities[] = "displayCapabilities";
+const char hmi_zone_capabilities[] = "hmiZoneCapabilities";
+const char soft_button_capabilities[] = "softButtonCapabilities";
+const char image_supported[] = "imageSupported";
+const char button_capabilities[] = "buttonCapabilities";
+const char capabilities[] = "capabilities";
+const char speech_capabilities[] = "speechCapabilities";
+const char prerecorded_speech_capabilities[] = "prerecordedSpeechCapabilities";
+const char preset_bank_capabilities[] = "presetBankCapabilities";
+const char allowed[] = "allowed";
+const char vehicle_type[] = "vehicleType";
+const char did_result[] = "didResult";
+const char result_code[] = "resultCode";
+const char dtc[] = "dtc";
+const char ecu_header[] = "ecuHeader";
+const char image_capabilities[] = "imageCapabilities";
+const char display_type[] = "displayType";
+const char text_fields[] = "textFields";
+const char media_clock_formats[] = "mediaClockFormats";
+const char graphic_supported[] = "graphicSupported";
+const char image_fields[] = "imageFields";
+const char templates_available[] = "templatesAvailable";
+const char screen_params[] = "screenParams";
+const char num_custom_presets_available[] = "numCustomPresetsAvailable";
+const char urls[] = "urls";
+const char policy_app_id[] = "policyAppId";
+} // namespace hmi_response
+
+namespace hmi_notification {
+const char prndl[] = "prndl";
+const char file_name[] = "file_name";
+const char system_context[] = "systemContext";
+const char state[] = "state";
+const char result[] = "result";
+const char statistic_type[] = "statisticType";
+const char error[] = "error";
+const char policyfile[] = "policyfile";
+
+} // namespace hmi_notification
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SMART_OBJECT_KEYS_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h b/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
new file mode 100644
index 0000000000..780401f6f3
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/time_metric_observer.h
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TIME_METRIC_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TIME_METRIC_OBSERVER_H_
+
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "json/json.h"
+#include "utils/shared_ptr.h"
+#include "utils/date_time.h"
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace application_manager {
+
+class AMMetricObserver {
+ public:
+ struct MessageMetric {
+ TimevalStruct begin;
+ TimevalStruct end;
+ utils::SharedPtr<smart_objects::SmartObject> message;
+ };
+ typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr;
+
+ virtual void OnMessage(MessageMetricSharedPtr) = 0;
+ virtual ~AMMetricObserver(){}
+};
+} // application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h b/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
new file mode 100644
index 0000000000..dcd57aee34
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/usage_statistics.h
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+
+#include <string>
+#include "usage_statistics/counter.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+class UsageStatistics {
+ public:
+ UsageStatistics(const std::string& app_id,
+ utils::SharedPtr<usage_statistics::StatisticsManager>
+ statistics_manager);
+ void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level);
+ void RecordAppRegistrationGuiLanguage(
+ mobile_apis::Language::eType gui_language);
+ void RecordAppRegistrationVuiLanguage(
+ mobile_apis::Language::eType vui_language);
+ void RecordRpcSentInHMINone();
+ void RecordPolicyRejectedRpcCall();
+ void RecordAppUserSelection();
+ void RecordRunAttemptsWhileRevoked();
+ void RecordRemovalsForBadBehavior();
+
+ private:
+ usage_statistics::AppStopwatch time_in_hmi_state_;
+ usage_statistics::AppInfo app_registration_language_gui_;
+ usage_statistics::AppInfo app_registration_language_vui_;
+ usage_statistics::AppCounter count_of_rejected_rpc_calls_;
+ usage_statistics::AppCounter count_of_rpcs_sent_in_hmi_none_;
+ usage_statistics::AppCounter count_of_user_selections_;
+ usage_statistics::AppCounter count_of_run_attempts_while_revoked_;
+ usage_statistics::AppCounter count_of_removals_for_bad_behavior_;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
diff --git a/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h b/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
new file mode 100644
index 0000000000..0cac4fd8f9
--- /dev/null
+++ b/src/components/application_manager/test/mock/include/application_manager/vehicle_info_data.h
@@ -0,0 +1,71 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
+
+namespace application_manager {
+ /*
+ * @brief Typedef for the vehicle data types that can
+ * be published and subscribed to
+ */
+enum VehicleDataType {
+ GPS = 0,
+ SPEED,
+ RPM,
+ FUELLEVEL,
+ FUELLEVEL_STATE,
+ FUELCONSUMPTION,
+ EXTERNTEMP,
+ VIN,
+ PRNDL,
+ TIREPRESSURE,
+ ODOMETER,
+ BELTSTATUS,
+ BODYINFO,
+ DEVICESTATUS,
+ ECALLINFO,
+ AIRBAGSTATUS,
+ EMERGENCYEVENT,
+ CLUSTERMODESTATUS,
+ MYKEY,
+ BRAKING,
+ WIPERSTATUS,
+ HEADLAMPSTATUS,
+ BATTVOLTAGE,
+ ENGINETORQUE,
+ ACCPEDAL,
+ STEERINGWHEEL
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
diff --git a/src/components/application_manager/test/mock/src/application_manager_impl.cc b/src/components/application_manager/test/mock/src/application_manager_impl.cc
new file mode 100644
index 0000000000..b5d80e740a
--- /dev/null
+++ b/src/components/application_manager/test/mock/src/application_manager_impl.cc
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/application_manager_impl.h"
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt
new file mode 100644
index 0000000000..2f7f771441
--- /dev/null
+++ b/src/components/config_profile/CMakeLists.txt
@@ -0,0 +1,13 @@
+include_directories (
+ ./include
+ ../utils/include/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ ./src/profile.cc
+ ./src/ini_file.cc
+)
+
+add_library("ConfigProfile" ${SOURCES})
+target_link_libraries("ConfigProfile" Utils)
diff --git a/src/components/config_profile/include/config_profile/ini_file.h b/src/components/config_profile/include/config_profile/ini_file.h
new file mode 100644
index 0000000000..764ff2f6cf
--- /dev/null
+++ b/src/components/config_profile/include/config_profile/ini_file.h
@@ -0,0 +1,133 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_INI_FILE_H_
+#define SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_INI_FILE_H_
+
+#include <stdint.h>
+
+namespace profile {
+
+#define INI_FILE_VER 1000
+
+#if !defined TRUE
+#define TRUE 1
+#endif
+#if !defined True
+#define True 1
+#endif
+
+#if !defined FALSE
+#define FALSE 0
+#endif
+#if !defined False
+#define False 0
+#endif
+
+/*
+ * @brief Global defines
+ */
+#define INI_LINE_LEN 512
+#define INI_FILE_TEMP_NAME "ini.tmp"
+
+#define INI_FLAG_UPDATE 0x00
+#define INI_FLAG_ITEM_UP_CREA 0x01
+#define INI_FLAG_FILE_UP_CREA 0x10
+
+/*
+ * @brief Global typedefs
+ */
+typedef enum Ini_search_id_e {
+ INI_NOTHING,
+ INI_RIGHT_CHAPTER,
+ INI_WRONG_CHAPTER,
+ INI_RIGHT_ITEM,
+ INI_WRONG_ITEM,
+ INI_REMARK,
+
+ INI_SEARCH_MAX
+} Ini_search_id;
+
+/*
+ * @brief Prototypes of functions
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * @brief Write usage instructions to the end of the file
+ * @param
+ *
+ * @return NULL if file or desired entry not found, otherwise pointer to fname
+ */
+extern char* ini_write_inst(const char *fname,
+ uint8_t flag);
+
+/*
+ * @brief Read a certain item of the specified chapter of a ini-file
+ *
+ * @return NULL if file or desired entry not found, otherwise pointer to value
+ */
+extern char* ini_read_value(const char *fname,
+ const char *chapter,
+ const char *item,
+ char *value);
+
+/*
+ * @brief Write a certain item of the specified chapter of a ini-file
+ *
+ * @return NULL if file not found, otherwise pointer to value
+ */
+extern char ini_write_value(const char *fname,
+ const char *chapter,
+ const char *item,
+ const char *value,
+ uint8_t flag);
+
+/*
+ * @brief Parse the given line for the item and returns the value if
+ * there is one otherwise NULL
+ *
+ * @return NULL if desired entry not found, otherwise pointer to value
+ */
+extern Ini_search_id ini_parse_line(const char *line,
+ const char *tag,
+ char *value);
+
+#ifdef __cplusplus
+}
+#endif
+
+} // namespace profile
+
+#endif // SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_INI_FILE_H_
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
new file mode 100644
index 0000000000..5be14d4006
--- /dev/null
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -0,0 +1,623 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_PROFILE_H_
+#define SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_PROFILE_H_
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include <list>
+#include "utils/macro.h"
+#include "utils/singleton.h"
+
+namespace profile {
+
+/**
+ * The Profile class
+ */
+class Profile : public utils::Singleton<Profile> {
+ public:
+ // Methods section
+
+ /**
+ * Destructor
+ *
+ * Unimplemented to avoid misusing
+ *
+ */
+ virtual ~Profile();
+
+ /**
+ * @brief Returns true if HMI should be started, otherwise false
+ */
+ bool launch_hmi() const;
+
+ /**
+ * @brief Returns application configuration path
+ */
+ const std::string& app_config_folder() const;
+
+ /**
+ * @brief Returns application storage path
+ */
+ const std::string& app_storage_folder() const;
+
+ /**
+ * @brief Return application resourse folder
+ */
+ const std::string& app_resourse_folder() const;
+
+ /**
+ * @brief Returns the path to the config file
+ */
+ const std::string& config_file_name() const;
+
+ /**
+ * @brief Sets the path to the config file
+ */
+ void config_file_name(const std::string& fileName);
+
+ /**
+ * @brief Returns server address
+ */
+ const std::string& server_address() const;
+
+ /**
+ * @brief Returns server port
+ */
+ const uint16_t& server_port() const;
+
+ /**
+ * @brief Returns port for video streaming
+ */
+ const uint16_t& video_streaming_port() const;
+
+ /**
+ * @brief Returns port for audio streaming
+ */
+ const uint16_t& audio_streaming_port() const;
+
+ /**
+ * @brief Returns port for time reports
+ */
+ const uint16_t& time_testing_port() const;
+
+ /**
+ * @brief Returns hmi capabilities file name
+ */
+ const std::string& hmi_capabilities_file_name() const;
+
+ /**
+ * @brief Returns help promt vector
+ */
+ const std::vector<std::string>& help_prompt() const;
+
+ /**
+ * @brief Returns help promt vector
+ */
+ const std::vector<std::string>& time_out_promt() const;
+
+ /**
+ * @brief Returns vr commands default for all apps
+ * such as Help.
+ */
+ const std::vector<std::string>& vr_commands() const;
+
+ /**
+ * @brief Maximum command id available for mobile app
+ */
+ const uint32_t& max_cmd_id() const;
+
+ /**
+ * @brief Default timeout for waiting for response to mobile app
+ */
+ const uint32_t& default_timeout() const;
+
+ /**
+ * @brief Default timeout for waiting for resuming
+ */
+ const uint32_t& app_resuming_timeout() const;
+
+ /**
+ * @brief Returns desirable thread stack size
+ */
+ const uint64_t& thread_min_stack_size() const;
+
+ /**
+ * @brief Returns true if audio mixing is supported
+ */
+ bool is_mixing_audio_supported() const;
+
+ /**
+ * @brief Returns true if video re-decoding enabled
+ */
+ bool is_redecoding_enabled() const;
+
+ /**
+ * @brief Returns title for Vr Help
+ */
+ const std::string& vr_help_title() const;
+
+ /**
+ * @brief Returns application directory quota size
+ */
+ const uint32_t& app_dir_quota() const;
+
+ /**
+ * @brief Returns the video server type
+ */
+ const std::string& video_server_type() const;
+
+ /**
+ * @brief Returns the audio server type
+ */
+ const std::string& audio_server_type() const;
+
+ /**
+ * @brief Returns the video pipe path
+ */
+ const std::string& named_video_pipe_path() const;
+
+ /**
+ * @brief Returns the audio pipe path
+ */
+ const std::string& named_audio_pipe_path() const;
+
+ /**
+ * @brief Returns time scale for max amount of requests for application
+ * in hmi level none.
+ */
+ const uint32_t& app_hmi_level_none_time_scale() const;
+
+ /**
+ * @brief Returns path to testing file to which redirects video stream
+ */
+ const std::string& video_stream_file() const;
+
+ /**
+ * @brief Returns path to testing file to which redirects audio stream
+ */
+ const std::string& audio_stream_file() const;
+ /**
+ * @brief Returns allowable max amount of requests per time scale for
+ * application in hmi level none
+ *
+ */
+ const uint32_t& app_hmi_level_none_time_scale_max_requests() const;
+
+ /**
+ * @brief Returns application time scale for max amount of requests per it.
+ */
+ const uint32_t& app_time_scale() const;
+
+ /**
+ * @brief Returns allowable max amount of requests per application
+ * time scale
+ */
+ const uint32_t& app_time_scale_max_requests() const;
+
+ /**
+ * @brief Returns allowable amount of the system pending requests
+ */
+ const uint32_t& pending_requests_amount() const;
+
+ /**
+ * @brief Returns Max allowed number of PutFile requests for one
+ * application in NONE
+ */
+ const uint32_t& put_file_in_none() const;
+
+ /**
+ * @brief Returns Max allowed number of DeleteFile requests for one
+ * application in NONE
+ */
+ const uint32_t& delete_file_in_none() const;
+
+ /**
+ * @brief Returns Max allowed number of ListFiles requests for one
+ * application in NONE
+ */
+ const uint32_t& list_files_in_none() const;
+
+ /*
+ * @brief Returns file name for storing applications data
+ */
+ const std::string& app_info_storage() const;
+
+ /*
+ * @brief Heartbeat timeout before closing connection
+ */
+ int32_t heart_beat_timeout() const;
+
+ /*
+ * @brief Path to preloaded policy file
+ */
+ const std::string& preloaded_pt_file() const;
+
+ /**
+ * @brief Path to policies snapshot file
+ * @return file path
+ */
+ const std::string& policies_snapshot_file_name() const;
+
+ /**
+ * @brief Should Policy be turned off? (Library not loaded)
+ * @return Flag
+ */
+ bool enable_policy() const;
+
+ /*
+ * @brief Timeout in transport manager before disconnect
+ */
+ uint32_t transport_manager_disconnect_timeout() const;
+
+ /*
+ * @brief Returns true if last state singleton is used
+ */
+ bool use_last_state() const;
+
+ /**
+ * @brief Returns supported diagnostic modes
+ */
+ const std::vector<uint32_t>& supported_diag_modes() const;
+
+ /**
+ * @brief Returns system files folder path
+ */
+ const std::string& system_files_path() const;
+
+ /**
+ * @brief Returns port for TCP transport adapter
+ */
+ uint16_t transport_manager_tcp_adapter_port() const;
+
+ /**
+ * @brief Returns value of timeout after which sent
+ * tts global properties for VCA
+ */
+ uint16_t tts_global_properties_timeout() const;
+
+ /**
+ * @brief Reads a string value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
+ bool ReadStringValue(std::string* value,
+ const char* default_value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
+ * @brief Reads an int32_t value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
+ bool ReadIntValue(int32_t* value,
+ int32_t default_value,
+ const char* const pSection,
+ const char* const pKey) const;
+ /**
+ * @brief Reads an bool value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is equal \c default_value)
+ */
+ bool ReadBoolValue(bool *value,
+ const bool default_value,
+ const char * const pSection,
+ const char * const pKey) const;
+ /**
+ * @brief Reads an container of string values from the profile,
+ * which handle as "Value1, Value2, Value3"
+ *
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ * @param out_result Pointer to bool value for result reading Section
+ * (could be NULL)
+ *
+ * @return container of values or empty continer
+ * if could not read the value out of the profile
+ */
+ std::list<std::string> ReadStringContainer(
+ const char * const pSection,
+ const char * const pKey,
+ bool* out_result) const;
+ /**
+ * @brief Reads an container of hex int values from the profile,
+ * which handle as "0x01, 0xA0, 0XFF"
+ *
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ * @param out_result Pointer to bool value for result reading Section
+ * (could be NULL)
+ *
+ * @return container of values or empty continer
+ * if could not read the value out of the profile
+ */
+ std::list<int> ReadIntContainer(const char * const pSection,
+ const char * const pKey,
+ bool* out_result) const;
+
+ /**
+ * @brief Returns delimiter for SDL-generated TTS chunks
+ * @return TTS delimiter
+ */
+ const std::string& tts_delimiter() const;
+
+ /**
+ * @brief Returns recording file source name
+ */
+ const std::string& recording_file_source() const;
+
+ /**
+ * @brief Returns recording file name
+ */
+ const std::string& recording_file_name() const;
+
+ const std::string& mme_db_name() const;
+
+ const std::string& event_mq_name() const;
+
+ const std::string& ack_mq_name() const;
+
+ uint32_t application_list_update_timeout() const;
+
+ const std::pair<uint32_t, int32_t>& read_did_frequency() const;
+
+ const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency() const;
+
+ const std::pair<uint32_t, int32_t>& start_stream_retry_amount() const;
+
+ /**
+ * @brief Returns max allowed threads number for handling mobile requests
+ */
+ uint32_t thread_pool_size() const;
+
+ uint32_t default_hub_protocol_index() const;
+
+ const std::string& iap_legacy_protocol_mask() const;
+
+ const std::string& iap_hub_protocol_mask() const;
+
+ const std::string& iap_pool_protocol_mask() const;
+
+ const std::string& iap_system_config() const;
+
+ const std::string& iap2_system_config() const;
+
+ int iap2_hub_connect_attempts() const;
+
+ /**
+ * @return seconds
+ */
+ int iap_hub_connection_wait_timeout() const;
+
+ private:
+ /**
+ * Default constructor
+ *
+ * Unimplemented to avoid misusing
+ *
+ */
+ Profile();
+
+ /*
+ * @brief Updates all related values from ini file
+ */
+ void UpdateValues();
+
+ /**
+ * @brief Reads a boolean value from the profile
+ *
+ * @param value The value to return
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is not changed)
+ */
+ bool ReadValue(bool* value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
+ * @brief Reads a string value from the profile and interpret it
+ * as \c true on "true" value or as \c false on any other value
+ *
+ * @param value The value to return
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is not changed)
+ */
+ bool ReadValue(std::string* value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
+ * @brief Reads a pair of ints value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is not changed)
+ */
+ bool ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value,
+ const std::pair<uint32_t, uint32_t>& default_value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
+ * @brief Reads an uint16/32/64_t value from the profile
+ *
+ * @param value Result value
+ * @param default_value Value to use key wasn't found
+ * @param pSection The section to read the value in
+ * @param pKey The key whose value needs to be read out
+ *
+ * @return FALSE if could not read the value out of the profile
+ * (then the value is changed to default)
+ */
+ bool ReadUIntValue(uint16_t* value,
+ uint16_t default_value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ bool ReadUIntValue(uint32_t* value,
+ uint32_t default_value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ bool ReadUIntValue(uint64_t* value,
+ uint64_t default_value,
+ const char* const pSection,
+ const char* const pKey) const;
+
+ /**
+ * @brief Write to log content of container
+ * @param array Source array
+ * @param log Log string
+ */
+ void LogContainer(const std::vector<std::string>& container,
+ std::string* log);
+
+ // Members section
+ bool launch_hmi_;
+ std::string app_config_folder_;
+ std::string app_storage_folder_;
+ std::string app_resourse_folder_;
+ std::string config_file_name_;
+ std::string server_address_;
+ uint16_t server_port_;
+ uint16_t video_streaming_port_;
+ uint16_t audio_streaming_port_;
+ uint16_t time_testing_port_;
+ std::string hmi_capabilities_file_name_;
+ std::vector<std::string> help_prompt_;
+ std::vector<std::string> time_out_promt_;
+ std::vector<std::string> vr_commands_;
+ uint64_t min_tread_stack_size_;
+ bool is_mixing_audio_supported_;
+ bool is_redecoding_enabled_;
+ uint32_t max_cmd_id_;
+ uint32_t default_timeout_;
+ uint32_t app_resuming_timeout_;
+ std::string vr_help_title_;
+ uint32_t app_dir_quota_;
+ std::string video_consumer_type_;
+ std::string audio_consumer_type_;
+ std::string named_video_pipe_path_;
+ std::string named_audio_pipe_path_;
+ uint32_t app_hmi_level_none_time_scale_max_requests_;
+ uint32_t app_hmi_level_none_requests_time_scale_;
+ std::string video_stream_file_;
+ std::string audio_stream_file_;
+ uint32_t app_time_scale_max_requests_;
+ uint32_t app_requests_time_scale_;
+ uint32_t pending_requests_amount_;
+ uint32_t put_file_in_none_;
+ uint32_t delete_file_in_none_;
+ uint32_t list_files_in_none_;
+ std::string app_info_storage_;
+ uint32_t heart_beat_timeout_;
+ std::string preloaded_pt_file_;
+ std::string policy_snapshot_file_name_;
+ bool enable_policy_;
+ uint32_t transport_manager_disconnect_timeout_;
+ bool use_last_state_;
+ std::vector<uint32_t> supported_diag_modes_;
+ std::string system_files_path_;
+ uint16_t transport_manager_tcp_adapter_port_;
+ std::string tts_delimiter_;
+ std::string mme_db_name_;
+ std::string event_mq_name_;
+ std::string ack_mq_name_;
+ std::string recording_file_source_;
+ std::string recording_file_name_;
+ uint32_t application_list_update_timeout_;
+ uint32_t max_thread_pool_size_;
+ uint32_t default_hub_protocol_index_;
+ /*
+ * first value is count of request
+ * second is time scale
+ */
+ std::pair<uint32_t, int32_t> read_did_frequency_;
+
+ /*
+ * first value is count of request
+ * second is time scale
+ */
+ std::pair<uint32_t, int32_t> get_vehicle_data_frequency_;
+
+ /**
+ * first value is count of retries for start stream
+ * second for timer
+ */
+ std::pair<uint32_t, int32_t> start_stream_retry_amount_;
+
+ std::string iap_legacy_protocol_mask_;
+ std::string iap_hub_protocol_mask_;
+ std::string iap_pool_protocol_mask_;
+ std::string iap_system_config_;
+ std::string iap2_system_config_;
+ int iap2_hub_connect_attempts_;
+ int iap_hub_connection_wait_timeout_;
+ uint16_t tts_global_properties_timeout_;
+
+ FRIEND_BASE_SINGLETON_CLASS(Profile);
+ DISALLOW_COPY_AND_ASSIGN(Profile);
+};
+} // namespace profile
+
+#endif // SRC_COMPONENTS_CONFIG_PROFILE_INCLUDE_CONFIG_PROFILE_PROFILE_H_
diff --git a/src/components/config_profile/src/ini_file.cc b/src/components/config_profile/src/ini_file.cc
new file mode 100644
index 0000000000..63c9668bc8
--- /dev/null
+++ b/src/components/config_profile/src/ini_file.cc
@@ -0,0 +1,411 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "config_profile/ini_file.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
+#include <stdint.h>
+
+#ifndef _WIN32
+#include <unistd.h>
+#else
+#define PATH_MAX _MAX_PATH
+#endif
+
+#ifdef __linux__
+#define USE_MKSTEMP 1
+#endif
+
+#include <string>
+
+namespace profile {
+
+char* ini_write_inst(const char *fname, uint8_t flag) {
+ FILE *fp = 0;
+
+ if (NULL == fname)
+ return NULL;
+ if ('\0' == *fname)
+ return NULL;
+
+ if ((fp = fopen(fname, "a")) == 0)
+ if (flag & INI_FLAG_FILE_UP_CREA)
+ if ((fp = fopen(fname, "w")) == 0)
+ return NULL;
+ if (0 == fp) {
+ return NULL;
+ }
+ fprintf(fp, "\n");
+ fprintf(fp, "; The INI-file consists of different chapters.\n");
+ fprintf(fp, "; Each chapter begins with the line containing\n");
+ fprintf(fp, "; the name in square brackets. Syntax:\n");
+ fprintf(fp, "; [chapter]\n");
+ fprintf(fp, "; The chapters consists of a set of items with a\n");
+ fprintf(fp, "; assinged value. The syntax is:\n");
+ fprintf(fp, "; item=value\n");
+ fprintf(fp, "; All white spaces an second encounters of chapters\n");
+ fprintf(fp, "; or items will be ignored.\n");
+ fprintf(fp, "; Remarks start with semicolon or star as first character.\n");
+ fprintf(fp, "; It is alowed for names of chapters and items to\n");
+ fprintf(fp, "; contain semicolon and star. Possible syntax is:\n");
+ fprintf(fp, "; [ chapter ] ;Remark\n");
+ fprintf(fp, "; item = value\n");
+ fprintf(fp, "\n");
+
+ fclose(fp);
+ return const_cast<char*>(fname);
+}
+
+char* ini_read_value(const char *fname,
+ const char *chapter, const char *item, char *value) {
+ FILE *fp = 0;
+ bool chapter_found = false;
+ char line[INI_LINE_LEN] = "";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "";
+
+ Ini_search_id result;
+ *line = '\0';
+ *val = '\0';
+ *tag = '\0';
+ if ((NULL == fname) || (NULL == chapter) || (NULL == item) || (NULL == value))
+ return NULL;
+
+ *value = '\0';
+ if (('\0' == *fname) || ('\0' == *chapter) || ('\0' == *item))
+ return NULL;
+
+ if ((fp = fopen(fname, "r")) == 0)
+ return NULL;
+
+ snprintf(tag, INI_LINE_LEN, "%s", chapter);
+ for (uint32_t i = 0; i < strlen(tag); i++) {
+ tag[i] = toupper(tag[i]);
+ }
+
+ while (NULL != fgets(line, INI_LINE_LEN, fp)) {
+ // Now start the line parsing
+ result = ini_parse_line(line, tag, val);
+ if (!chapter_found) {
+ if (INI_RIGHT_CHAPTER == result) {
+ chapter_found = true;
+
+ snprintf(tag, INI_LINE_LEN, "%s", item);
+ for (uint32_t i = 0; i < strlen(tag); i++)
+ tag[i] = toupper(tag[i]);
+ }
+ } else {
+ // FIXME (dchmerev): Unnecessary condition
+ if ((INI_RIGHT_CHAPTER == result) || (INI_WRONG_CHAPTER == result)) {
+ fclose(fp);
+ return NULL;
+ }
+ if (INI_RIGHT_ITEM == result) {
+ fclose(fp);
+ snprintf(value, INI_LINE_LEN, "%s", val);
+ return value;
+ }
+ }
+ }
+
+ fclose(fp);
+
+ return NULL;
+}
+
+char ini_write_value(const char *fname,
+ const char *chapter, const char *item,
+ const char *value, uint8_t flag) {
+ FILE *rd_fp, *wr_fp = 0;
+ uint16_t i, cr_count;
+ int32_t wr_result;
+ bool chapter_found = false;
+ bool value_written = false;
+ char line[INI_LINE_LEN] = "";
+ char val[INI_LINE_LEN] = "";
+ char tag[INI_LINE_LEN] = "";
+ char temp_fname[PATH_MAX] = "";
+ Ini_search_id result;
+ *line = '\0';
+ *val = '\0';
+ *tag = '\0';
+ *temp_fname = '\0';
+
+ if ((NULL == fname) || (NULL == chapter) || (NULL == item) || (NULL == value))
+ return FALSE;
+ if (('\0' == *fname) || ('\0' == *chapter) || ('\0' == *item))
+ return FALSE;
+
+ if (0 == (rd_fp = fopen(fname, "r"))) {
+ ini_write_inst(fname, flag);
+ if (0 == (rd_fp = fopen(fname, "r")))
+ return FALSE;
+ }
+
+#if USE_MKSTEMP
+ {
+ char *temp_str;
+ int32_t fd = -1;
+ temp_str = static_cast<char*>(getenv("TMPDIR"));
+ if (temp_str) {
+ snprintf(temp_fname, PATH_MAX,
+ "%s/ini.XXXXXX", temp_str);
+
+ fd = mkstemp(temp_fname);
+ if (-1 == fd) {
+ return FALSE;
+ }
+ wr_fp = fdopen(fd, "w");
+ if (NULL == wr_fp) {
+ unlink(temp_fname);
+ close(fd);
+ return FALSE;
+ }
+ } else {
+ return FALSE;
+ }
+ }
+#else // #if USE_MKSTEMP
+ tmpnam(temp_fname);
+ if (0 == (wr_fp = fopen(temp_fname, "w")))
+ return FALSE;
+#endif // #else #if USE_MKSTEMP
+
+ snprintf(tag, INI_LINE_LEN, "%s", chapter);
+ for (uint32_t i = 0; i < strlen (tag); i++)
+ tag[i] = toupper(tag[i]);
+
+ wr_result = 1; cr_count = 0;
+ while ((NULL != fgets(line, INI_LINE_LEN, rd_fp)) && (0 < wr_result)) {
+ // Now start the line parsing
+ result = ini_parse_line(line, tag, val);
+
+ if (!value_written) {
+ if (!chapter_found) {
+ if (INI_RIGHT_CHAPTER == result) {
+ chapter_found = true;
+ // coding style
+ snprintf(tag, INI_LINE_LEN, "%s", item);
+ for (uint32_t i = 0; i < strlen (tag); i++)
+ tag[i] = toupper(tag[i]);
+ }
+ } else {
+ if ((INI_RIGHT_CHAPTER == result) || (INI_WRONG_CHAPTER == result)) {
+ /* item not found but new capture */
+ if (flag & INI_FLAG_ITEM_UP_CREA)
+ fprintf(wr_fp, "%s=%s\n", item, value);
+ /* The item must not update in an other chapter
+ even it has the right name because only the
+ first chapter is significant */
+ value_written = true;
+ } else if (result == INI_RIGHT_ITEM) {
+ for (i = 0; i < cr_count; i++)
+ fprintf(wr_fp, "\n");
+ cr_count = 0;
+ wr_result = fprintf(wr_fp, "%s=%s\n", item, value);
+ value_written = true;
+ continue;
+ }
+ }
+ } /* if (!value_written) */
+
+ if (0 == strcmp(val, "\n")) {
+ cr_count++;
+ } else {
+ for (uint32_t i = 0; i < cr_count; i++)
+ fprintf(wr_fp, "\n");
+ cr_count = 0;
+ wr_result = fprintf(wr_fp, "%s", line);
+ }
+ }
+ if (0 < (wr_result) && (!value_written)) {
+ if (flag & INI_FLAG_ITEM_UP_CREA) {
+ if (!chapter_found)
+ fprintf(wr_fp, "\n[%s]\n", chapter);
+ fprintf(wr_fp, "%s=%s\n", item, value);
+ value_written = true;
+ }
+ }
+ fprintf(wr_fp, "\n");
+
+
+ fclose(wr_fp);
+ fclose(rd_fp);
+
+ remove(fname);
+ if (0 != rename(temp_fname, fname)) {
+ remove(temp_fname);
+ return FALSE;
+ }
+
+ return (value_written);
+}
+
+Ini_search_id ini_parse_line(const char *line, const char *tag, char *value) {
+ const char *line_ptr;
+ char *temp_ptr;
+ char temp_str[INI_LINE_LEN] = "";
+ *temp_str = '\0';
+
+ snprintf(value, INI_LINE_LEN, "%s", line);
+
+ /* cut leading spaces */
+ line_ptr = line;
+ for (uint32_t i = 0; i < strlen(line); i++) {
+ if ((line[i] == ' ') ||
+ (line[i] == 9) || // TAB
+ (line[i] == 10) || // LF
+ (line[i] == 13)) { // CR
+ line_ptr++;
+ } else {
+ break;
+ }
+ }
+ if ('\0' == *line_ptr) {
+ snprintf(value, INI_LINE_LEN, "\n");
+ return INI_NOTHING;
+ }
+
+ if ((*line_ptr == ';') || (*line_ptr == '*')) /* remark */
+ return INI_REMARK;
+
+ if (*line_ptr == '[' && strrchr(line_ptr, ']') != NULL) {
+ line_ptr++;
+
+ /* cut leading stuff */
+ uint16_t len = strlen(line_ptr);
+ for (int32_t i = 0; i < len; i++) {
+ if ((*line_ptr == ' ') ||
+ (*line_ptr == 9) || // TAB
+ (*line_ptr == 10) || // LF
+ (*line_ptr == 13)) { // CR
+ line_ptr++;
+ } else {
+ break;
+ }
+ }
+ if (*line_ptr == '\0')
+ return INI_NOTHING;
+
+ snprintf(temp_str, INI_LINE_LEN, "%s", line_ptr);
+ temp_ptr = strrchr(temp_str, ']');
+ if (NULL == temp_ptr) {
+ return INI_NOTHING;
+ } else {
+ *temp_ptr = '\0';
+ }
+
+ /* cut trailing stuff */
+ for (int32_t i = strlen(temp_str) - 1; i > 0; i--) {
+ if ((temp_str[i] == ' ') ||
+ (temp_str[i] == 9) || // TAB
+ (temp_str[i] == 10) || // LF
+ (temp_str[i] == 13)) { // CR
+ temp_str[i] = '\0';
+ } else {
+ break;
+ }
+ }
+
+ snprintf(value, INI_LINE_LEN, "%s", temp_str);
+
+ for (uint32_t i = 0; i < strlen(temp_str); i++)
+ temp_str[i] = toupper(temp_str[i]);
+ if (strcmp(temp_str, tag) == 0)
+ return INI_RIGHT_CHAPTER;
+ else
+ return INI_WRONG_CHAPTER;
+ }
+
+ if (NULL != strchr(line_ptr, '=')) {
+ strncpy(temp_str, line_ptr, (strchr(line_ptr, '=') - line_ptr));
+ /* cut trailing stuff */
+ for (int32_t i = strlen(temp_str) - 1; i > 0; i--) {
+ if ((temp_str[i] == '=') ||
+ (temp_str[i] == ' ') ||
+ (temp_str[i] == 9) || // TAB
+ (temp_str[i] == 10) || // LF
+ (temp_str[i] == 13)) { // CR
+ temp_str[i] = '\0';
+ } else {
+ break;
+ }
+ }
+
+ snprintf(value, INI_LINE_LEN, "%s", temp_str);
+
+ for (uint32_t i = 0; i < strlen (temp_str); i++)
+ temp_str[i] = toupper(temp_str[i]);
+ if (strcmp(temp_str, tag) == 0) {
+ line_ptr = strchr(line_ptr, '=') + 1;
+ uint16_t len = strlen(line_ptr);
+ /* cut trailing stuff */
+ for (uint32_t i = 0; i < len; i++) {
+ if ((*line_ptr == ' ') ||
+ (*line_ptr == 9) || // TAB
+ (*line_ptr == 10) || // LF
+ (*line_ptr == 13)) { // CR
+ line_ptr++;
+ } else {
+ break;
+ }
+ }
+
+ snprintf(value, INI_LINE_LEN, "%s", line_ptr);
+
+ if (value[0] != '\0') {
+ /* cut trailing stuff */
+ for (int32_t i = strlen(value) - 1; i > 0; i--) {
+ if ((value[i] == ' ') ||
+ (value[i] == ';') ||
+ (value[i] == 9) || // TAB
+ (value[i] == 10) || // LF
+ (value[i] == 13)) { // CR
+ value[i] = '\0';
+ } else {
+ break;
+ }
+ }
+ }
+ return INI_RIGHT_ITEM;
+ } else {
+ return INI_WRONG_ITEM;
+ }
+ }
+
+ return INI_NOTHING;
+}
+} // namespace profile
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
new file mode 100644
index 0000000000..49b41cf23a
--- /dev/null
+++ b/src/components/config_profile/src/profile.cc
@@ -0,0 +1,1323 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config_profile/profile.h"
+
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sstream>
+#include <algorithm>
+
+#include "config_profile/ini_file.h"
+#include "utils/logger.h"
+#include "utils/threads/thread.h"
+#include "utils/file_system.h"
+
+namespace {
+#define LOG_UPDATED_VALUE(value, key, section) {\
+ LOG4CXX_INFO(logger_, "Setting value '" << value\
+ << "' for key '" << key\
+ << "' in section '" << section << "'.");\
+}
+
+#define LOG_UPDATED_BOOL_VALUE(value, key, section) {\
+ LOG4CXX_INFO(logger_, "Setting value '" << std::boolalpha << value\
+ << "' for key '" << key\
+ << "' in section '" << section << "'.");\
+}
+
+const char* kDefaultConfigFileName = "smartDeviceLink.ini";
+
+const char* kMainSection = "MAIN";
+const char* kPolicySection = "Policy";
+const char* kHmiSection = "HMI";
+const char* kAppInfoSection = "AppInfo";
+const char* kMediaManagerSection = "MEDIA MANAGER";
+const char* kGlobalPropertiesSection = "GLOBAL PROPERTIES";
+const char* kVrCommandsSection = "VR COMMANDS";
+const char* kTransportManagerSection = "TransportManager";
+const char* kApplicationManagerSection = "ApplicationManager";
+const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS";
+const char* kIAPSection = "IAP";
+
+const char* kHmiCapabilitiesKey = "HMICapabilities";
+const char* kPathToSnapshotKey = "PathToSnapshot";
+const char* kPreloadedPTKey = "PreloadedPT";
+//const char* kPoliciesTableKey = "PoliciesTable";
+const char* kServerAddressKey = "ServerAddress";
+const char* kAppInfoStorageKey = "AppInfoStorage";
+const char* kAppStorageFolderKey = "AppStorageFolder";
+const char* kAppResourseFolderKey = "AppResourceFolder";
+const char* kAppConfigFolderKey = "AppConfigFolder";
+const char* kLaunchHMIKey = "LaunchHMI";
+const char* kStartStreamRetry = "StartStreamRetry";
+const char* kEnableRedecodingKey = "EnableRedecoding";
+const char* kVideoStreamConsumerKey = "VideoStreamConsumer";
+const char* kAudioStreamConsumerKey = "AudioStreamConsumer";
+const char* kNamedVideoPipePathKey = "NamedVideoPipePath";
+const char* kNamedAudioPipePathKey = "NamedAudioPipePath";
+const char* kVideoStreamFileKey = "VideoStreamFile";
+const char* kAudioStreamFileKey = "AudioStreamFile";
+
+
+const char* kMixingAudioSupportedKey = "MixingAudioSupported";
+const char* kHelpPromptKey = "HelpPromt";
+const char* kTimeoutPromptKey = "TimeOutPromt";
+const char* kHelpTitleKey = "HelpTitle";
+const char* kHelpCommandKey = "HelpCommand";
+const char* kSystemFilesPathKey = "SystemFilesPath";
+const char* kHeartBeatTimeoutKey = "HeartBeatTimeout";
+const char* kUseLastStateKey = "UseLastState";
+const char* kTCPAdapterPortKey = "TCPAdapterPort";
+const char* kServerPortKey = "ServerPort";
+const char* kVideoStreamingPortKey = "VideoStreamingPort";
+const char* kAudioStreamingPortKey = "AudioStreamingPort";
+const char* kTimeTestingPortKey = "TimeTestingPort";
+const char* kThreadStackSizeKey = "ThreadStackSize";
+const char* kMaxCmdIdKey = "MaxCmdID";
+const char* kPutFileRequestKey = "PutFileRequest";
+const char* kDeleteFileRequestKey = "DeleteFileRequest";
+const char* kListFilesRequestKey = "ListFilesRequest";
+const char* kDefaultTimeoutKey = "DefaultTimeout";
+const char* kAppResumingTimeoutKey = "ApplicationResumingTimeout";
+const char* kAppDirectoryQuotaKey = "AppDirectoryQuota";
+const char* kAppTimeScaleMaxRequestsKey = "AppTimeScaleMaxRequests";
+const char* kAppRequestsTimeScaleKey = "AppRequestsTimeScale";
+const char* kAppHmiLevelNoneTimeScaleMaxRequestsKey =
+ "AppHMILevelNoneTimeScaleMaxRequests";
+const char* kAppHmiLevelNoneRequestsTimeScaleKey =
+ "AppHMILevelNoneRequestsTimeScale";
+const char* kPendingRequestsAmoundKey = "PendingRequestsAmount";
+const char* kSupportedDiagModesKey = "SupportedDiagModes";
+const char* kTransportManagerDisconnectTimeoutKey = "DisconnectTimeout";
+const char* kTTSDelimiterKey = "TTSDelimiter";
+const char* kRecordingFileNameKey = "RecordingFileName";
+const char* kRecordingFileSourceKey = "RecordingFileSource";
+const char* kEnablePolicy = "EnablePolicy";
+const char* kMmeDatabaseNameKey = "MMEDatabase";
+const char* kEventMQKey = "EventMQ";
+const char* kAckMQKey = "AckMQ";
+const char* kApplicationListUpdateTimeoutKey = "ApplicationListUpdateTimeout";
+const char* kReadDIDFrequencykey = "ReadDIDRequest";
+const char* kGetVehicleDataFrequencyKey = "GetVehicleDataRequest";
+const char* kLegacyProtocolMaskKey = "LegacyProtocol";
+const char* kHubProtocolMaskKey = "HubProtocol";
+const char* kPoolProtocolMaskKey = "PoolProtocol";
+const char* kIAPSystemConfigKey = "IAPSystemConfig";
+const char* kIAP2SystemConfigKey = "IAP2SystemConfig";
+const char* kIAP2HubConnectAttemptskey = "IAP2HubConnectAttempts";
+const char* kIAPHubConnectionWaitTimeoutKey = "ConnectionWaitTimeout";
+const char* kDefaultHubProtocolIndexKey = "DefaultHubProtocolIndex";
+const char* kTTSGlobalPropertiesTimeoutKey = "TTSGlobalPropertiesTimeout";
+
+const char* kDefaultPoliciesSnapshotFileName = "sdl_snapshot.json";
+const char* kDefaultHmiCapabilitiesFileName = "hmi_capabilities.json";
+const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json";
+const char* kDefaultServerAddress = "127.0.0.1";
+const char* kDefaultAppInfoFileName = "app_info.dat";
+const char* kDefaultSystemFilesPath = "/tmp/fs/mp/images/ivsu_cache";
+const char* kDefaultTtsDelimiter = ",";
+const char* kDefaultMmeDatabaseName = "/dev/qdb/mediaservice_db";
+const char* kDefaultEventMQ = "/dev/mqueue/ToSDLCoreUSBAdapter";
+const char* kDefaultAckMQ = "/dev/mqueue/FromSDLCoreUSBAdapter";
+const char* kDefaultRecordingFileSourceName = "audio.8bit.wav";
+const char* kDefaultRecordingFileName = "record.wav";
+const char* kDefaultThreadPoolSize = "ThreadPoolSize";
+const char* kDefaultLegacyProtocolMask = "com.ford.sync.prot";
+const char* kDefaultHubProtocolMask = "com.smartdevicelink.prot";
+const char* kDefaultPoolProtocolMask = "com.smartdevicelink.prot";
+const char* kDefaultIAPSystemConfig = "/fs/mp/etc/mm/ipod.cfg";
+const char* kDefaultIAP2SystemConfig = "/fs/mp/etc/mm/iap2.cfg";
+
+const uint32_t kDefaultHubProtocolIndex = 0;
+const uint32_t kDefaultHeartBeatTimeout = 0;
+const uint16_t kDefautTransportManagerTCPPort = 12345;
+const uint16_t kDefaultServerPort = 8087;
+const uint16_t kDefaultVideoStreamingPort = 5050;
+const uint16_t kDefaultAudioStreamingPort = 5080;
+const uint16_t kDefaultTimeTestingPort = 5090;
+const uint32_t kDefaultMaxCmdId = 2000000000;
+const uint32_t kDefaultPutFileRequestInNone = 5;
+const uint32_t kDefaultDeleteFileRequestInNone = 5;
+const uint32_t kDefaultListFilesRequestInNone = 5;
+const uint32_t kDefaultTimeout = 10;
+const uint32_t kDefaultAppResumingTimeout = 5;
+const uint32_t kDefaultDirQuota = 104857600;
+const uint32_t kDefaultAppTimeScaleMaxRequests = 100;
+const uint32_t kDefaultAppRequestsTimeScale = 10;
+const uint32_t kDefaultAppHmiLevelNoneTimeScaleMaxRequests = 100;
+const uint32_t kDefaultAppHmiLevelNoneRequestsTimeScale = 10;
+const uint32_t kDefaultPendingRequestsAmount = 1000;
+const uint32_t kDefaultTransportManagerDisconnectTimeout = 0;
+const uint32_t kDefaultApplicationListUpdateTimeout = 1;
+const std::pair<uint32_t, uint32_t> kReadDIDFrequency = {5 , 1};
+const std::pair<uint32_t, uint32_t> kGetVehicleDataFrequency = {5 , 1};
+const std::pair<uint32_t, uint32_t> kStartStreamRetryAmount = {3 , 1};
+const uint32_t kDefaultMaxThreadPoolSize = 2;
+const int kDefaultIAP2HubConnectAttempts = 0;
+const int kDefaultIAPHubConnectionWaitTimeout = 10;
+const uint16_t kDefaultTTSGlobalPropertiesTimeout = 20;
+
+} // namespace
+
+namespace profile {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Profile")
+
+Profile::Profile()
+ : launch_hmi_(true),
+ app_config_folder_(),
+ app_storage_folder_(),
+ app_resourse_folder_(),
+ config_file_name_(kDefaultConfigFileName),
+ server_address_(kDefaultServerAddress),
+ server_port_(kDefaultServerPort),
+ video_streaming_port_(kDefaultVideoStreamingPort),
+ audio_streaming_port_(kDefaultAudioStreamingPort),
+ time_testing_port_(kDefaultTimeTestingPort),
+ hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName),
+ help_prompt_(),
+ time_out_promt_(),
+ min_tread_stack_size_(threads::Thread::kMinStackSize),
+ is_mixing_audio_supported_(false),
+ is_redecoding_enabled_(false),
+ max_cmd_id_(kDefaultMaxCmdId),
+ default_timeout_(kDefaultTimeout),
+ app_resuming_timeout_(kDefaultAppResumingTimeout),
+ app_dir_quota_(kDefaultDirQuota),
+ app_hmi_level_none_time_scale_max_requests_(
+ kDefaultAppHmiLevelNoneTimeScaleMaxRequests),
+ app_hmi_level_none_requests_time_scale_(
+ kDefaultAppHmiLevelNoneRequestsTimeScale),
+ app_time_scale_max_requests_(kDefaultAppTimeScaleMaxRequests),
+ app_requests_time_scale_(kDefaultAppRequestsTimeScale),
+ pending_requests_amount_(kDefaultPendingRequestsAmount),
+ put_file_in_none_(kDefaultPutFileRequestInNone),
+ delete_file_in_none_(kDefaultDeleteFileRequestInNone),
+ list_files_in_none_(kDefaultListFilesRequestInNone),
+ app_info_storage_(kDefaultAppInfoFileName),
+ heart_beat_timeout_(kDefaultHeartBeatTimeout),
+ policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName),
+ enable_policy_(false),
+ transport_manager_disconnect_timeout_(
+ kDefaultTransportManagerDisconnectTimeout),
+ use_last_state_(false),
+ supported_diag_modes_(),
+ system_files_path_(kDefaultSystemFilesPath),
+ transport_manager_tcp_adapter_port_(kDefautTransportManagerTCPPort),
+ tts_delimiter_(kDefaultTtsDelimiter),
+ mme_db_name_(kDefaultMmeDatabaseName),
+ event_mq_name_(kDefaultEventMQ),
+ ack_mq_name_(kDefaultAckMQ),
+ recording_file_source_(kDefaultRecordingFileSourceName),
+ recording_file_name_(kDefaultRecordingFileName),
+ application_list_update_timeout_(kDefaultApplicationListUpdateTimeout),
+ iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask),
+ iap_hub_protocol_mask_(kDefaultHubProtocolMask),
+ iap_pool_protocol_mask_(kDefaultPoolProtocolMask),
+ iap_system_config_(kDefaultIAPSystemConfig),
+ iap2_system_config_(kDefaultIAP2SystemConfig),
+ iap2_hub_connect_attempts_(kDefaultIAP2HubConnectAttempts),
+ iap_hub_connection_wait_timeout_(kDefaultIAPHubConnectionWaitTimeout),
+ tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout) {
+}
+
+Profile::~Profile() {
+}
+
+void Profile::config_file_name(const std::string& fileName) {
+ if (false == fileName.empty()) {
+ config_file_name_ = fileName;
+ UpdateValues();
+ }
+}
+
+const std::string& Profile::config_file_name() const {
+ return config_file_name_;
+}
+
+bool Profile::launch_hmi() const {
+ return launch_hmi_;
+}
+
+const std::string& Profile::app_config_folder() const {
+ return app_config_folder_;
+}
+
+const std::string& Profile::app_storage_folder() const {
+ return app_storage_folder_;
+}
+
+const std::string& Profile::app_resourse_folder() const {
+ return app_resourse_folder_;
+}
+
+const std::string& Profile::hmi_capabilities_file_name() const {
+ return hmi_capabilities_file_name_;
+}
+
+const std::string& Profile::server_address() const {
+ return server_address_;
+}
+
+const std::vector<std::string>& Profile::help_prompt() const {
+ return help_prompt_;
+}
+
+const std::vector<std::string>& Profile::time_out_promt() const {
+ return time_out_promt_;
+}
+
+const std::vector<std::string>& Profile::vr_commands() const {
+ return vr_commands_;
+}
+
+const uint32_t& Profile::max_cmd_id() const {
+ return max_cmd_id_;
+}
+
+const uint32_t& Profile::default_timeout() const {
+ return default_timeout_;
+}
+
+const uint32_t& Profile::app_resuming_timeout() const {
+ return app_resuming_timeout_;
+}
+
+const std::string& Profile::vr_help_title() const {
+ return vr_help_title_;
+}
+
+const uint16_t& Profile::server_port() const {
+ return server_port_;
+}
+
+const uint16_t& Profile::video_streaming_port() const {
+ return video_streaming_port_;
+}
+
+const uint16_t& Profile::audio_streaming_port() const {
+ return audio_streaming_port_;
+}
+
+const uint16_t& Profile::time_testing_port() const {
+ return time_testing_port_;
+}
+
+
+const uint64_t& Profile::thread_min_stack_size() const {
+ return min_tread_stack_size_;
+}
+
+bool Profile::is_mixing_audio_supported() const {
+ return is_mixing_audio_supported_;
+}
+
+const uint32_t& Profile::app_dir_quota() const {
+ return app_dir_quota_;
+}
+
+bool Profile::is_redecoding_enabled() const {
+ return is_redecoding_enabled_;
+}
+
+const std::string& Profile::video_server_type() const {
+ return video_consumer_type_;
+}
+
+const std::string& Profile::audio_server_type() const {
+ return audio_consumer_type_;
+}
+
+const std::string& Profile::named_video_pipe_path() const {
+ return named_video_pipe_path_;
+}
+
+const std::string& Profile::named_audio_pipe_path() const {
+ return named_audio_pipe_path_;
+}
+
+const uint32_t& Profile::app_hmi_level_none_time_scale() const {
+ return app_hmi_level_none_requests_time_scale_;
+}
+
+const uint32_t& Profile::app_hmi_level_none_time_scale_max_requests() const {
+ return app_hmi_level_none_time_scale_max_requests_;
+}
+
+const std::string& Profile::video_stream_file() const {
+ return video_stream_file_;
+}
+
+const std::string& Profile::audio_stream_file() const {
+ return audio_stream_file_;
+}
+
+
+const uint32_t& Profile::app_time_scale() const {
+ return app_requests_time_scale_;
+}
+
+const uint32_t& Profile::app_time_scale_max_requests() const {
+ return app_time_scale_max_requests_;
+}
+
+const uint32_t& Profile::pending_requests_amount() const {
+ return pending_requests_amount_;
+}
+
+const uint32_t& Profile::put_file_in_none() const {
+ return put_file_in_none_;
+}
+
+const uint32_t& Profile::delete_file_in_none() const {
+ return delete_file_in_none_;
+}
+
+const uint32_t& Profile::list_files_in_none() const {
+ return list_files_in_none_;
+}
+
+const std::string& Profile::app_info_storage() const {
+ return app_info_storage_;
+}
+
+int32_t Profile::heart_beat_timeout() const {
+ return heart_beat_timeout_;
+}
+
+const std::string& Profile::preloaded_pt_file() const {
+ return preloaded_pt_file_;
+}
+
+const std::string& Profile::policies_snapshot_file_name() const {
+ return policy_snapshot_file_name_;
+}
+
+bool Profile::enable_policy() const {
+ return enable_policy_;
+}
+
+uint32_t Profile::transport_manager_disconnect_timeout() const {
+ return transport_manager_disconnect_timeout_;
+}
+
+bool Profile::use_last_state() const {
+ return use_last_state_;
+}
+
+const std::string& Profile::system_files_path() const {
+ return system_files_path_;
+}
+
+const std::vector<uint32_t>& Profile::supported_diag_modes() const {
+ return supported_diag_modes_;
+}
+
+uint16_t Profile::transport_manager_tcp_adapter_port() const {
+ return transport_manager_tcp_adapter_port_;
+}
+
+const std::string& Profile::tts_delimiter() const {
+ return tts_delimiter_;
+}
+
+const std::string& Profile::recording_file_source() const {
+ return recording_file_source_;
+}
+
+const std::string&Profile::recording_file_name() const {
+ return recording_file_name_;
+}
+
+const std::string& Profile::mme_db_name() const {
+ return mme_db_name_;
+}
+
+const std::string& Profile::event_mq_name() const {
+ return event_mq_name_;
+}
+
+const std::string& Profile::ack_mq_name() const {
+ return ack_mq_name_;
+}
+
+uint32_t Profile::application_list_update_timeout() const {
+ return application_list_update_timeout_;
+}
+
+const std::pair<uint32_t, int32_t>& Profile::read_did_frequency() const {
+ return read_did_frequency_;
+}
+
+const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency() const {
+ return get_vehicle_data_frequency_;
+}
+
+const std::pair<uint32_t, int32_t>& Profile::start_stream_retry_amount() const {
+ return start_stream_retry_amount_;
+}
+
+uint32_t Profile::thread_pool_size() const {
+ return max_thread_pool_size_;
+}
+
+uint32_t Profile::default_hub_protocol_index() const{
+ return default_hub_protocol_index_;
+}
+
+const std::string& Profile::iap_legacy_protocol_mask() const {
+ return iap_legacy_protocol_mask_;
+}
+
+const std::string& Profile::iap_hub_protocol_mask() const {
+ return iap_hub_protocol_mask_;
+}
+
+const std::string& Profile::iap_pool_protocol_mask() const {
+ return iap_pool_protocol_mask_;
+}
+
+const std::string& Profile::iap_system_config() const {
+ return iap_system_config_;
+}
+
+const std::string& Profile::iap2_system_config() const {
+ return iap2_system_config_;
+}
+
+int Profile::iap2_hub_connect_attempts() const {
+ return iap2_hub_connect_attempts_;
+}
+
+int Profile::iap_hub_connection_wait_timeout() const {
+ return iap_hub_connection_wait_timeout_;
+}
+
+uint16_t Profile::tts_global_properties_timeout() const {
+ return tts_global_properties_timeout_;
+}
+
+void Profile::UpdateValues() {
+ LOG4CXX_INFO(logger_, "Profile::UpdateValues");
+
+ // Launch HMI parameter
+ std::string launch_value;
+ if (ReadValue(&launch_value, kHmiSection, kLaunchHMIKey) &&
+ 0 == strcmp("true", launch_value.c_str())) {
+ launch_hmi_ = true;
+ } else {
+ launch_hmi_ = false;
+ }
+
+ LOG_UPDATED_BOOL_VALUE(launch_hmi_, kLaunchHMIKey, kHmiSection);
+
+ // Application config folder
+ ReadStringValue(&app_config_folder_,
+ file_system::CurrentWorkingDirectory().c_str(),
+ kMainSection, kAppConfigFolderKey);
+
+ LOG_UPDATED_VALUE(app_config_folder_, kAppConfigFolderKey, kMainSection);
+
+ // Application storage folder
+ ReadStringValue(&app_storage_folder_,
+ file_system::CurrentWorkingDirectory().c_str(),
+ kMainSection, kAppStorageFolderKey);
+
+ LOG_UPDATED_VALUE(app_storage_folder_, kAppStorageFolderKey, kMainSection);
+
+ // Application resourse folder
+ ReadStringValue(&app_resourse_folder_,
+ file_system::CurrentWorkingDirectory().c_str(),
+ kMainSection, kAppResourseFolderKey);
+
+LOG_UPDATED_VALUE(app_resourse_folder_, kAppResourseFolderKey,
+ kMainSection);
+LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey,
+ kAppInfoSection);
+
+ app_info_storage_ = app_storage_folder_ + "/" + app_info_storage_;
+
+// Application info file name
+ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName,
+ kAppInfoSection,
+ kAppInfoStorageKey);
+
+ LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey,
+ kAppInfoSection);
+
+// Server address
+ ReadStringValue(&server_address_, kDefaultServerAddress, kHmiSection,
+ kServerAddressKey);
+
+ LOG_UPDATED_VALUE(server_address_, kServerAddressKey, kHmiSection);
+
+ LOG_UPDATED_VALUE(server_address_, kServerAddressKey, kHmiSection);
+
+// HMI capabilities
+ ReadStringValue(&hmi_capabilities_file_name_ ,
+ kDefaultHmiCapabilitiesFileName,
+ kMainSection, kHmiCapabilitiesKey);
+
+ hmi_capabilities_file_name_ = app_config_folder_ + "/" +
+ hmi_capabilities_file_name_;
+
+ LOG_UPDATED_VALUE(hmi_capabilities_file_name_, kHmiCapabilitiesKey,
+ kMainSection);
+
+ // Server port
+ ReadUIntValue(&server_port_, kDefaultServerPort, kHmiSection,
+ kServerPortKey);
+
+ LOG_UPDATED_VALUE(server_port_, kServerPortKey, kHmiSection);
+
+ // Video streaming port
+ ReadUIntValue(&video_streaming_port_, kDefaultVideoStreamingPort,
+ kHmiSection, kVideoStreamingPortKey);
+
+ LOG_UPDATED_VALUE(video_streaming_port_, kVideoStreamingPortKey,
+ kHmiSection);
+ // Audio streaming port
+ ReadUIntValue(&audio_streaming_port_, kDefaultAudioStreamingPort,
+ kHmiSection, kAudioStreamingPortKey);
+
+ LOG_UPDATED_VALUE(audio_streaming_port_, kAudioStreamingPortKey,
+ kHmiSection);
+
+
+ // Time testing port
+ ReadUIntValue(&time_testing_port_, kDefaultTimeTestingPort, kMainSection,
+ kTimeTestingPortKey);
+
+ LOG_UPDATED_VALUE(time_testing_port_, kTimeTestingPortKey, kMainSection);
+
+ // Minimum thread stack size
+ ReadUIntValue(&min_tread_stack_size_, threads::Thread::kMinStackSize,
+ kMainSection, kThreadStackSizeKey);
+
+ if (min_tread_stack_size_ < threads::Thread::kMinStackSize) {
+ min_tread_stack_size_ = threads::Thread::kMinStackSize;
+ }
+
+ LOG_UPDATED_VALUE(min_tread_stack_size_, kThreadStackSizeKey, kMainSection);
+
+ // Start stream retry frequency
+ ReadUintIntPairValue(&start_stream_retry_amount_, kStartStreamRetryAmount,
+ kMediaManagerSection, kStartStreamRetry);
+
+ // Redecoding parameter
+ std::string redecoding_value;
+ if (ReadValue(&redecoding_value, kMediaManagerSection, kEnableRedecodingKey)
+ && 0 == strcmp("true", redecoding_value.c_str())) {
+ is_redecoding_enabled_ = true;
+ } else {
+ is_redecoding_enabled_ = false;
+ }
+
+ LOG_UPDATED_BOOL_VALUE(is_redecoding_enabled_, kEnableRedecodingKey,
+ kMediaManagerSection);
+
+ // Video consumer type
+ ReadStringValue(&video_consumer_type_, "", kMediaManagerSection,
+ kVideoStreamConsumerKey);
+
+ LOG_UPDATED_VALUE(video_consumer_type_, kVideoStreamConsumerKey,
+ kMediaManagerSection);
+
+ // Audio stream consumer
+ ReadStringValue(&audio_consumer_type_, "", kMediaManagerSection,
+ kAudioStreamConsumerKey);
+
+ LOG_UPDATED_VALUE(audio_consumer_type_, kAudioStreamConsumerKey,
+ kMediaManagerSection);
+
+ // Named video pipe path
+ ReadStringValue(&named_video_pipe_path_, "" , kMediaManagerSection,
+ kNamedVideoPipePathKey);
+
+ named_video_pipe_path_ = app_storage_folder_ + "/" + named_video_pipe_path_;
+
+ LOG_UPDATED_VALUE(named_video_pipe_path_, kNamedVideoPipePathKey,
+ kMediaManagerSection);
+
+ // Named audio pipe path
+ ReadStringValue(&named_audio_pipe_path_, "" , kMediaManagerSection,
+ kNamedAudioPipePathKey);
+
+ named_audio_pipe_path_ = app_storage_folder_ + "/" + named_audio_pipe_path_;
+
+ LOG_UPDATED_VALUE(named_audio_pipe_path_, kNamedAudioPipePathKey,
+ kMediaManagerSection);
+
+ // Video stream file
+ ReadStringValue(&video_stream_file_, "", kMediaManagerSection,
+ kVideoStreamFileKey);
+
+ video_stream_file_ = app_storage_folder_ + "/" + video_stream_file_;
+
+ LOG_UPDATED_VALUE(video_stream_file_, kVideoStreamFileKey,
+ kMediaManagerSection);
+
+ // Audio stream file
+ ReadStringValue(&audio_stream_file_, "", kMediaManagerSection,
+ kAudioStreamFileKey);
+
+ audio_stream_file_ = app_storage_folder_ + "/" + audio_stream_file_;
+
+ LOG_UPDATED_VALUE(audio_stream_file_, kAudioStreamFileKey,
+ kMediaManagerSection);
+
+
+ // Mixing audio parameter
+ std::string mixing_audio_value;
+ if (ReadValue(&mixing_audio_value, kMainSection, kMixingAudioSupportedKey)
+ && 0 == strcmp("true", mixing_audio_value.c_str())) {
+ is_mixing_audio_supported_ = true;
+ } else {
+ is_mixing_audio_supported_ = false;
+ }
+
+ LOG_UPDATED_BOOL_VALUE(is_mixing_audio_supported_, kMixingAudioSupportedKey,
+ kMainSection);
+
+ // Maximum command id value
+ ReadUIntValue(&max_cmd_id_, kDefaultMaxCmdId, kMainSection, kMaxCmdIdKey);
+
+ if (max_cmd_id_ < 0) {
+ max_cmd_id_ = kDefaultMaxCmdId;
+ }
+
+ LOG_UPDATED_VALUE(max_cmd_id_, kMaxCmdIdKey, kMainSection);
+
+ // PutFile restrictions
+ ReadUIntValue(&put_file_in_none_, kDefaultPutFileRequestInNone,
+ kFilesystemRestrictionsSection, kPutFileRequestKey);
+
+ if (put_file_in_none_ < 0) {
+ put_file_in_none_ = kDefaultPutFileRequestInNone;
+ }
+
+ LOG_UPDATED_VALUE(put_file_in_none_, kPutFileRequestKey,
+ kFilesystemRestrictionsSection);
+
+ // DeleteFileRestrictions
+ ReadUIntValue(&delete_file_in_none_, kDefaultDeleteFileRequestInNone,
+ kFilesystemRestrictionsSection, kDeleteFileRequestKey);
+
+ if (delete_file_in_none_ < 0) {
+ delete_file_in_none_ = kDefaultDeleteFileRequestInNone;
+ }
+
+ LOG_UPDATED_VALUE(delete_file_in_none_, kDeleteFileRequestKey,
+ kFilesystemRestrictionsSection);
+
+ // ListFiles restrictions
+ ReadUIntValue(&list_files_in_none_, kDefaultListFilesRequestInNone,
+ kFilesystemRestrictionsSection, kListFilesRequestKey);
+
+ if (list_files_in_none_ < 0) {
+ list_files_in_none_ = kDefaultListFilesRequestInNone;
+ }
+
+ LOG_UPDATED_VALUE(list_files_in_none_, kListFilesRequestKey,
+ kFilesystemRestrictionsSection);
+
+ // Default timeout
+ ReadUIntValue(&default_timeout_, kDefaultTimeout, kMainSection,
+ kDefaultTimeoutKey);
+
+ if (default_timeout_ <= 0) {
+ default_timeout_ = kDefaultTimeout;
+ }
+
+ LOG_UPDATED_VALUE(default_timeout_, kDefaultTimeoutKey, kMainSection);
+
+ // Application resuming timeout
+ ReadUIntValue(&app_resuming_timeout_, kDefaultAppResumingTimeout,
+ kMainSection, kAppResumingTimeoutKey);
+
+ if (app_resuming_timeout_ <= 0) {
+ app_resuming_timeout_ = kDefaultAppResumingTimeout;
+ }
+
+ LOG_UPDATED_VALUE(app_resuming_timeout_, kAppResumingTimeoutKey,
+ kMainSection);
+
+ // Application directory quota
+ ReadUIntValue(&app_dir_quota_, kDefaultDirQuota, kMainSection,
+ kAppDirectoryQuotaKey);
+
+ if (app_dir_quota_ <= 0) {
+ app_dir_quota_ = kDefaultDirQuota;
+ }
+
+ LOG_UPDATED_VALUE(app_dir_quota_, kAppDirectoryQuotaKey, kMainSection);
+
+ // TTS delimiter
+ // Should be gotten before any TTS prompts, since it should be appended back
+ ReadStringValue(&tts_delimiter_, kDefaultTtsDelimiter,
+ kGlobalPropertiesSection, kTTSDelimiterKey);
+
+ LOG_UPDATED_VALUE(tts_delimiter_, kTTSDelimiterKey,
+ kGlobalPropertiesSection);
+
+ // Help prompt
+ help_prompt_.clear();
+ std::string help_prompt_value;
+ if (ReadValue(&help_prompt_value, kGlobalPropertiesSection,
+ kHelpPromptKey)) {
+ char* str = NULL;
+ str = strtok(const_cast<char*>(help_prompt_value.c_str()), ",");
+ while (str != NULL) {
+ // Default prompt should have delimiter included for each item
+ const std::string prompt_item = std::string(str)+tts_delimiter_;
+ help_prompt_.push_back(prompt_item);
+ LOG_UPDATED_VALUE(prompt_item, kHelpPromptKey,
+ kGlobalPropertiesSection);
+ str = strtok(NULL, ",");
+ }
+ } else {
+ help_prompt_value.clear();
+ LOG_UPDATED_VALUE(help_prompt_value, kHelpPromptKey,
+ kGlobalPropertiesSection);
+ }
+
+
+
+ // Timeout prompt
+ time_out_promt_.clear();
+ std::string timeout_prompt_value;
+ if (ReadValue(&timeout_prompt_value, kGlobalPropertiesSection,
+ kTimeoutPromptKey)) {
+ char* str = NULL;
+ str = strtok(const_cast<char*>(timeout_prompt_value.c_str()), ",");
+ while (str != NULL) {
+ // Default prompt should have delimiter included for each item
+ const std::string prompt_item = std::string(str)+tts_delimiter_;
+ time_out_promt_.push_back(prompt_item);
+ LOG_UPDATED_VALUE(prompt_item, kTimeoutPromptKey,
+ kGlobalPropertiesSection);
+ str = strtok(NULL, ",");
+ }
+ } else {
+ timeout_prompt_value.clear();
+ LOG_UPDATED_VALUE(timeout_prompt_value, kTimeoutPromptKey,
+ kGlobalPropertiesSection);
+ }
+
+ // Voice recognition help title
+ ReadStringValue(&vr_help_title_, "", kGlobalPropertiesSection,
+ kHelpTitleKey);
+
+ LOG_UPDATED_VALUE(vr_help_title_, kHelpTitleKey,
+ kGlobalPropertiesSection);
+
+ // Voice recognition help command
+ vr_commands_.clear();
+ std::string vr_help_command_value;
+ if (ReadValue(&vr_help_command_value, kVrCommandsSection,
+ kHelpCommandKey)) {
+ char* str = NULL;
+ str = strtok(const_cast<char*>(vr_help_command_value.c_str()), ",");
+ while (str != NULL) {
+ const std::string vr_item = str;
+ vr_commands_.push_back(vr_item);
+ LOG_UPDATED_VALUE(vr_item, kHelpCommandKey, kVrCommandsSection);
+ str = strtok(NULL, ",");
+ }
+ } else {
+ vr_help_command_value.clear();
+ LOG_UPDATED_VALUE(vr_help_command_value, kHelpCommandKey,
+ kVrCommandsSection);
+ }
+
+ //TTS GlobalProperties timeout
+ ReadUIntValue(&tts_global_properties_timeout_,
+ kDefaultTTSGlobalPropertiesTimeout,
+ kGlobalPropertiesSection,
+ kTTSGlobalPropertiesTimeoutKey);
+
+ LOG_UPDATED_VALUE(tts_global_properties_timeout_, kTTSGlobalPropertiesTimeoutKey,
+ kGlobalPropertiesSection);
+
+ // Application time scale maximum requests
+ ReadUIntValue(&app_time_scale_max_requests_,
+ kDefaultAppTimeScaleMaxRequests,
+ kMainSection,
+ kAppTimeScaleMaxRequestsKey);
+
+ LOG_UPDATED_VALUE(app_time_scale_max_requests_, kAppTimeScaleMaxRequestsKey,
+ kMainSection);
+
+ // Application time scale
+ ReadUIntValue(&app_requests_time_scale_, kDefaultAppRequestsTimeScale,
+ kMainSection, kAppRequestsTimeScaleKey);
+
+ LOG_UPDATED_VALUE(app_requests_time_scale_, kAppRequestsTimeScaleKey,
+ kMainSection);
+
+ // Application HMI level NONE time scale maximum requests
+ ReadUIntValue(&app_hmi_level_none_time_scale_max_requests_,
+ kDefaultAppHmiLevelNoneTimeScaleMaxRequests,
+ kMainSection,
+ kAppHmiLevelNoneTimeScaleMaxRequestsKey);
+
+ LOG_UPDATED_VALUE(app_hmi_level_none_time_scale_max_requests_,
+ kAppHmiLevelNoneTimeScaleMaxRequestsKey,
+ kMainSection);
+
+ // Application HMI level NONE requests time scale
+ ReadUIntValue(&app_hmi_level_none_requests_time_scale_,
+ kDefaultAppHmiLevelNoneRequestsTimeScale,
+ kMainSection,
+ kAppHmiLevelNoneRequestsTimeScaleKey);
+
+ LOG_UPDATED_VALUE(app_hmi_level_none_requests_time_scale_,
+ kAppHmiLevelNoneRequestsTimeScaleKey,
+ kMainSection);
+
+ // Amount of pending requests
+ ReadUIntValue(&pending_requests_amount_, kDefaultPendingRequestsAmount,
+ kMainSection, kPendingRequestsAmoundKey);
+
+ if (pending_requests_amount_ <= 0) {
+ pending_requests_amount_ = kDefaultPendingRequestsAmount;
+ }
+
+ LOG_UPDATED_VALUE(pending_requests_amount_, kPendingRequestsAmoundKey,
+ kMainSection);
+
+ // Supported diagnostic modes
+ supported_diag_modes_.clear();
+ std::string supported_diag_modes_value;
+ std::string correct_diag_modes;
+ if (ReadStringValue(&supported_diag_modes_value, "", kMainSection,
+ kSupportedDiagModesKey)) {
+ char* str = NULL;
+ str = strtok(const_cast<char*>(supported_diag_modes_value.c_str()), ",");
+ while (str != NULL) {
+ uint32_t user_value = strtol(str, NULL, 16);
+ if (user_value && errno != ERANGE) {
+ correct_diag_modes += str;
+ correct_diag_modes += ",";
+ supported_diag_modes_.push_back(user_value);
+ }
+ str = strtok(NULL, ",");
+ }
+ }
+
+ LOG_UPDATED_VALUE(correct_diag_modes, kSupportedDiagModesKey, kMainSection);
+
+ // System files path
+ ReadStringValue(&system_files_path_, kDefaultSystemFilesPath, kMainSection,
+ kSystemFilesPathKey);
+
+ LOG_UPDATED_VALUE(system_files_path_, kSystemFilesPathKey, kMainSection);
+
+ // Heartbeat timeout
+ ReadUIntValue(&heart_beat_timeout_, kDefaultHeartBeatTimeout, kMainSection,
+ kHeartBeatTimeoutKey);
+
+ LOG_UPDATED_VALUE(heart_beat_timeout_, kHeartBeatTimeoutKey, kMainSection);
+
+ // Use last state value
+ std::string last_state_value;
+ if (ReadValue(&last_state_value, kMainSection, kUseLastStateKey) &&
+ 0 == strcmp("true", last_state_value.c_str())) {
+ use_last_state_ = true;
+ } else {
+ use_last_state_ = false;
+ }
+
+ LOG_UPDATED_BOOL_VALUE(use_last_state_, kUseLastStateKey, kMainSection);
+
+ // Transport manager TCP port
+ ReadUIntValue(&transport_manager_tcp_adapter_port_,
+ kDefautTransportManagerTCPPort,
+ kTransportManagerSection,
+ kTCPAdapterPortKey);
+
+ LOG_UPDATED_VALUE(transport_manager_tcp_adapter_port_, kTCPAdapterPortKey,
+ kTransportManagerSection);
+
+ // MME database name
+ ReadStringValue(&mme_db_name_,
+ kDefaultMmeDatabaseName,
+ kTransportManagerSection,
+ kMmeDatabaseNameKey);
+
+LOG_UPDATED_VALUE(mme_db_name_, kMmeDatabaseNameKey, kTransportManagerSection);
+// Event MQ
+ReadStringValue(&event_mq_name_,
+kDefaultEventMQ,
+kTransportManagerSection,
+kEventMQKey);
+
+LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection);
+
+ // Ack MQ
+ ReadStringValue(&ack_mq_name_,
+ kDefaultAckMQ,
+ kTransportManagerSection,
+ kAckMQKey);
+
+ LOG_UPDATED_VALUE(ack_mq_name_, kAckMQKey, kTransportManagerSection);
+
+ // Transport manager disconnect timeout
+ ReadUIntValue(&transport_manager_disconnect_timeout_,
+ kDefaultTransportManagerDisconnectTimeout,
+ kTransportManagerSection,
+ kTransportManagerDisconnectTimeoutKey);
+
+ LOG_UPDATED_VALUE(transport_manager_disconnect_timeout_,
+ kTransportManagerDisconnectTimeoutKey,
+ kTransportManagerSection);
+
+ // Recording file
+ ReadStringValue(&recording_file_name_, kDefaultRecordingFileName,
+ kMediaManagerSection, kRecordingFileNameKey);
+
+ LOG_UPDATED_VALUE(recording_file_name_, kRecordingFileNameKey, kMediaManagerSection);
+
+ // Recording file source
+ ReadStringValue(&recording_file_source_, kDefaultRecordingFileSourceName,
+ kMediaManagerSection, kRecordingFileSourceKey);
+
+ LOG_UPDATED_VALUE(recording_file_source_, kRecordingFileSourceKey,
+ kMediaManagerSection);
+
+ // Policy preloaded file
+ ReadStringValue(&preloaded_pt_file_,
+ kDefaultPreloadedPTFileName,
+ kPolicySection, kPreloadedPTKey);
+
+ preloaded_pt_file_ = app_config_folder_ + '/' + preloaded_pt_file_;
+
+ LOG_UPDATED_VALUE(preloaded_pt_file_, kPreloadedPTKey, kPolicySection);
+
+ // Policy snapshot file
+ ReadStringValue(&policy_snapshot_file_name_,
+ kDefaultPoliciesSnapshotFileName,
+ kPolicySection, kPathToSnapshotKey);
+
+ LOG_UPDATED_VALUE(policy_snapshot_file_name_, kPathToSnapshotKey,
+ kPolicySection);
+
+ // Turn Policy Off?
+ std::string enable_policy_string;
+ if (ReadValue(&enable_policy_string, kPolicySection, kEnablePolicy) &&
+ 0 == strcmp("true", enable_policy_string.c_str())) {
+ enable_policy_ = true;
+ } else {
+ enable_policy_ = false;
+ }
+
+ LOG_UPDATED_BOOL_VALUE(enable_policy_, kEnablePolicy, kPolicySection);
+
+ ReadUIntValue(&application_list_update_timeout_,
+ kDefaultApplicationListUpdateTimeout,
+ kApplicationManagerSection,
+ kApplicationListUpdateTimeoutKey);
+
+ LOG_UPDATED_VALUE(application_list_update_timeout_,
+ kApplicationListUpdateTimeoutKey, kMainSection);
+
+ ReadUintIntPairValue(&read_did_frequency_, kReadDIDFrequency,
+ kMainSection, kReadDIDFrequencykey);
+
+ ReadUintIntPairValue(&get_vehicle_data_frequency_, kGetVehicleDataFrequency,
+ kMainSection, kGetVehicleDataFrequencyKey);
+
+ ReadUIntValue(&max_thread_pool_size_,
+ kDefaultMaxThreadPoolSize,
+ kApplicationManagerSection,
+ kDefaultThreadPoolSize);
+ if (max_thread_pool_size_ > kDefaultMaxThreadPoolSize) {
+ max_thread_pool_size_ = kDefaultMaxThreadPoolSize;
+ }
+ LOG_UPDATED_VALUE(max_thread_pool_size_,
+ kDefaultMaxThreadPoolSize, kApplicationManagerSection);
+
+ ReadStringValue(&iap_legacy_protocol_mask_,
+ kDefaultLegacyProtocolMask,
+ kIAPSection,
+ kLegacyProtocolMaskKey);
+
+ LOG_UPDATED_VALUE(iap_legacy_protocol_mask_, kLegacyProtocolMaskKey, kIAPSection);
+
+ ReadStringValue(&iap_hub_protocol_mask_,
+ kDefaultHubProtocolMask,
+ kIAPSection,
+ kHubProtocolMaskKey);
+
+ LOG_UPDATED_VALUE(iap_hub_protocol_mask_, kHubProtocolMaskKey, kIAPSection);
+
+ ReadStringValue(&iap_pool_protocol_mask_,
+ kDefaultPoolProtocolMask,
+ kIAPSection,
+ kPoolProtocolMaskKey);
+
+ LOG_UPDATED_VALUE(iap_pool_protocol_mask_, kPoolProtocolMaskKey, kIAPSection);
+
+ ReadStringValue(&iap_system_config_,
+ kDefaultIAPSystemConfig,
+ kIAPSection,
+ kIAPSystemConfigKey);
+
+ LOG_UPDATED_VALUE(iap_system_config_, kIAPSystemConfigKey, kIAPSection);
+
+ ReadStringValue(&iap2_system_config_,
+ kDefaultIAP2SystemConfig,
+ kIAPSection,
+ kIAP2SystemConfigKey);
+
+ LOG_UPDATED_VALUE(iap2_system_config_, kIAP2SystemConfigKey, kIAPSection);
+
+ ReadIntValue(&iap2_hub_connect_attempts_,
+ kDefaultIAP2HubConnectAttempts,
+ kIAPSection,
+ kIAP2HubConnectAttemptskey);
+
+ LOG_UPDATED_VALUE(iap2_hub_connect_attempts_, kIAP2HubConnectAttemptskey, kIAPSection);
+
+ ReadIntValue(&iap_hub_connection_wait_timeout_,
+ kDefaultIAPHubConnectionWaitTimeout,
+ kIAPSection,
+ kIAPHubConnectionWaitTimeoutKey);
+
+ LOG_UPDATED_VALUE(iap_hub_connection_wait_timeout_,
+ kIAPHubConnectionWaitTimeoutKey, kIAPSection);
+
+ ReadUIntValue(&default_hub_protocol_index_, kDefaultHubProtocolIndex, kIAPSection, kDefaultHubProtocolIndexKey);
+
+ LOG_UPDATED_VALUE(default_hub_protocol_index_, kDefaultHubProtocolIndexKey, kIAPSection);
+}
+
+bool Profile::ReadValue(bool* value, const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
+ bool ret = false;
+
+ char buf[INI_LINE_LEN + 1];
+ *buf = '\0';
+ if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf))
+ && ('\0' != *buf)) {
+ const int32_t tmpVal = atoi(buf);
+ if (0 == tmpVal) {
+ *value = false;
+ } else {
+ *value = true;
+ }
+
+ ret = true;
+ }
+ return ret;
+}
+
+bool Profile::ReadValue(std::string* value, const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
+ bool ret = false;
+
+ char buf[INI_LINE_LEN + 1];
+ *buf = '\0';
+ if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf))
+ && ('\0' != *buf)) {
+ *value = buf;
+ ret = true;
+ }
+ return ret;
+}
+
+bool Profile::ReadStringValue(std::string* value, const char* default_value,
+ const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
+ if (!ReadValue(value, pSection, pKey)) {
+ *value = default_value;
+ return false;
+ }
+ return true;
+}
+
+bool Profile::ReadIntValue(int32_t* value, const int32_t default_value,
+ const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
+ std::string string_value;
+ if (!ReadValue(&string_value, pSection, pKey)) {
+ *value = default_value;
+ return false;
+ }
+ *value = atoi(string_value.c_str());
+ return true;
+}
+
+bool Profile::ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value,
+ const std::pair<uint32_t, uint32_t>& default_value,
+ const char *const pSection,
+ const char *const pKey) const {
+ std::string string_value;
+ if (!ReadValue(&string_value, pSection, pKey)) {
+ *value = default_value;
+ return false;
+ }
+ std::string first_str = string_value.substr(0, string_value.find(","));
+ std::string second_str = string_value.substr(string_value.find(",") + 1,
+ string_value.size() - first_str.size());
+ (*value).first = strtoul(first_str.c_str(), NULL, 10);
+ (*value).second = strtoul(second_str.c_str(), NULL, 10);
+ return true;
+}
+
+bool Profile::ReadBoolValue(bool* value, const bool default_value,
+ const char* const pSection,
+ const char* const pKey) const {
+ DCHECK(value);
+ bool read_value;
+ const bool result = ReadValue(&read_value, pSection, pKey);
+ *value = result ? read_value : default_value;
+ return result;
+}
+namespace {
+int32_t hex_to_int(const std::string& value) {
+ return static_cast<int32_t>(strtol(value.c_str(), NULL, 16));
+}
+}
+
+std::list<int> Profile::ReadIntContainer(
+ const char * const pSection, const char * const pKey,
+ bool *out_result) const {
+ const std::list<std::string> string_list =
+ ReadStringContainer(pSection, pKey, out_result);
+ std::list<int> value_list;
+ value_list.resize(string_list.size());
+ std::transform(string_list.begin(), string_list.end(),
+ value_list.begin(), hex_to_int);
+ return value_list;
+}
+
+std::list<std::string> Profile::ReadStringContainer(
+ const char * const pSection, const char * const pKey,
+ bool *out_result) const {
+ std::string string;
+ const bool result = ReadValue(&string, pSection, pKey);
+ if (out_result)
+ *out_result = result;
+ std::list<std::string> value_container;
+ if (result) {
+ std::istringstream iss(string);
+ std::string temp_str;
+ while (iss) {
+ if (!getline( iss, temp_str, ',' )) break;
+ value_container.push_back(temp_str);
+ }
+ }
+ return value_container;
+}
+
+bool Profile::ReadUIntValue(uint16_t* value, uint16_t default_value,
+ const char* const pSection,
+ const char* const pKey) const {
+ std::string string_value;
+ if (!ReadValue(&string_value, pSection, pKey)) {
+ *value = default_value;
+ return false;
+ } else {
+ uint16_t user_value = strtoul(string_value.c_str(), NULL, 10);
+ if (!user_value || errno == ERANGE) {
+ *value = default_value;
+ return false;
+ }
+
+ *value = user_value;
+ return true;
+ }
+}
+
+bool Profile::ReadUIntValue(uint32_t* value, uint32_t default_value,
+ const char* const pSection,
+ const char* const pKey) const {
+ std::string string_value;
+ if (!ReadValue(&string_value, pSection, pKey)) {
+ *value = default_value;
+ return false;
+ } else {
+ uint32_t user_value = strtoul(string_value.c_str(), NULL, 10);
+ if (!user_value || errno == ERANGE) {
+ *value = default_value;
+ return false;
+ }
+
+ *value = user_value;
+ return true;
+ }
+}
+
+bool Profile::ReadUIntValue(uint64_t* value, uint64_t default_value,
+ const char* const pSection,
+ const char* const pKey) const {
+ std::string string_value;
+ if (!ReadValue(&string_value, pSection, pKey)) {
+ *value = default_value;
+ return false;
+ } else {
+ uint64_t user_value = strtoull(string_value.c_str(), NULL, 10);
+ if (!user_value || errno == ERANGE) {
+ *value = default_value;
+ return false;
+ }
+
+ *value = user_value;
+ return true;
+ }
+}
+
+void Profile::LogContainer(const std::vector<std::string>& container,
+ std::string* log) {
+ if (container.empty()) {
+ return;
+ }
+ if (NULL == log) {
+ return;
+ }
+ std::vector<std::string>::const_iterator it = container.begin();
+ std::vector<std::string>::const_iterator it_end = container.end();
+ for (; it != it_end-1; ++it) {
+ log->append(*it);
+ log->append(" ; ");
+ }
+
+ log->append(container.back());
+}
+} // namespace profile
diff --git a/src/components/connection_handler/CMakeLists.txt b/src/components/connection_handler/CMakeLists.txt
new file mode 100644
index 0000000000..18946ac349
--- /dev/null
+++ b/src/components/connection_handler/CMakeLists.txt
@@ -0,0 +1,23 @@
+include_directories (
+ ./include/
+ ../protocol_handler/include/
+ ../config_profile/include/
+ ../utils/include/
+ ${ENCRYPTION_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ ./src/connection_handler_impl.cc
+ ./src/connection.cc
+ ./src/device.cc
+ ./src/heartbeat_monitor.cc
+)
+
+set(LIBRARIES
+ ConfigProfile
+ ProtocolLibrary
+)
+
+add_library(connectionHandler ${SOURCES})
+target_link_libraries(connectionHandler encryption)
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
new file mode 100644
index 0000000000..6bcbc3fdcd
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_H_
+
+#include <map>
+#include <vector>
+
+#include "utils/lock.h"
+#include "connection_handler/device.h"
+#include "connection_handler/heartbeat_monitor.h"
+#include "protocol/service_type.h"
+
+#ifdef ENABLE_SECURITY
+namespace security_manager {
+class SSLContext;
+} // namespace security_manager
+#endif // ENABLE_SECURITY
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+
+class ConnectionHandler;
+
+/**
+ * \brief Type for ConnectionHandle
+ */
+typedef int32_t ConnectionHandle;
+
+/**
+ * \brief Type for Connections map
+ * Key is ConnectionHandle which is unique
+ */
+typedef std::map<int32_t, Connection*> ConnectionList;
+
+/**
+ * \brief ServiceType
+ */
+struct Service {
+ protocol_handler::ServiceType service_type;
+ bool is_protected_;
+ Service()
+ : service_type(protocol_handler::kInvalidServiceType),
+ is_protected_(false) {
+ }
+ explicit Service(protocol_handler::ServiceType service_type)
+ : service_type(service_type),
+ is_protected_(false) {
+ }
+ bool operator==(const protocol_handler::ServiceType service_type) const {
+ return this->service_type == service_type;
+ }
+};
+
+/**
+ * \brief Type for Session Services
+ */
+typedef std::vector<Service> ServiceList;
+
+struct Session {
+ ServiceList service_list;
+ uint8_t protocol_version;
+#ifdef ENABLE_SECURITY
+ security_manager::SSLContext *ssl_context;
+#endif // ENABLE_SECURITY
+ Session()
+ : service_list()
+#ifdef ENABLE_SECURITY
+ , ssl_context(NULL)
+#endif // ENABLE_SECURITY
+ {}
+ explicit Session(const ServiceList &services, uint8_t protocol_version)
+ : service_list(services),
+ protocol_version(protocol_version)
+#ifdef ENABLE_SECURITY
+ , ssl_context(NULL)
+#endif // ENABLE_SECURITY
+ {}
+ Service *FindService(const protocol_handler::ServiceType &service_type);
+ const Service *FindService(const protocol_handler::ServiceType &service_type) const;
+};
+
+/**
+ * \brief Type for Session map
+ */
+typedef std::map<uint8_t, Session> SessionMap;
+
+/**
+ * \class Connection
+ * \brief Stores connection information
+ */
+class Connection {
+ public:
+ /**
+ * \brief Class constructor
+ */
+ Connection(ConnectionHandle connection_handle,
+ DeviceHandle connection_device_handle,
+ ConnectionHandler *connection_handler,
+ int32_t heartbeat_timeout);
+
+ /**
+ * \brief Destructor
+ */
+ ~Connection();
+
+ /**
+ * \brief Returns device handle
+ * \return DeviceHandle
+ */
+ ConnectionHandle connection_handle() const;
+
+ /**
+ * \brief Returns connection device handle
+ * \return ConnectionDeviceHandle
+ */
+ DeviceHandle connection_device_handle();
+
+ /**
+ * \brief Adds session to connection
+ * \return new session id or 0 in case of issues
+ */
+ uint32_t AddNewSession();
+
+ /**
+ * \brief Removes session from connection
+ * \param session session ID
+ * \return session_id or 0 in case of issues
+ */
+ uint32_t RemoveSession(uint8_t session_id);
+
+ /**
+ * \brief Adds uprotected service to session or
+ * check protection to service has been started before
+ * \param session_id session ID
+ * \param service_type Type of service
+ * \param is_protected protection state
+ * \return TRUE on success, otherwise FALSE
+ */
+ bool AddNewService(uint8_t session_id,
+ protocol_handler::ServiceType service_type,
+ const bool is_protected);
+ /**
+ * \brief Removes service from session
+ * \param session_id session ID
+ * \param service_type Type of service
+ * \return TRUE on success, otherwise FALSE
+ */
+ bool RemoveService(uint8_t session_id,
+ protocol_handler::ServiceType service_type);
+#ifdef ENABLE_SECURITY
+ /**
+ * \brief Sets crypto context of service
+ * \param session_id Identifier of the session
+ * \param context SSL for connection
+ * \return \c true in case of service is protected or \c false otherwise
+ */
+ int SetSSLContext(uint8_t session_id,
+ security_manager::SSLContext *context);
+ /**
+ * \brief Gets crypto context of session, use service_type to get NULL
+ * SSLContext for not protected services or ControlService (0x0)
+ * to get current SSLContext of connection
+ * \param session_id Identifier of the session
+ * \param service_type Type of service
+ * \return \ref SSLContext of connection
+ */
+ security_manager::SSLContext *GetSSLContext(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType &service_type) const;
+ /**
+ * \brief Set protection flag to service in session by key
+ * to get current SSLContext of connection
+ * \param session_id Identifier of the session
+ * \param service_type Type of service
+ */
+ void SetProtectionFlag(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType &service_type);
+#endif // ENABLE_SECURITY
+ /**
+ * \brief Returns map of sessions which have been opened in
+ * current connection.
+ */
+ const SessionMap session_map() const;
+
+ /**
+ * \brief Close session
+ * \param session_id session id
+ */
+ void CloseSession(uint8_t session_id);
+
+ /**
+ * \brief Prevent session from being closed by heartbeat timeout
+ * \param session_id session id
+ */
+ void KeepAlive(uint8_t session_id);
+
+ /**
+ * \brief Start heartbeat for specified session
+ * \param session_id session id
+ */
+ void StartHeartBeat(uint8_t session_id);
+
+ /**
+ * \brief Send heartbeat to mobile app
+ * \param session_id session id
+ */
+ void SendHeartBeat(uint8_t session_id);
+
+ /**
+ * Sets heart beat timeout
+ * @param timeout in seconds
+ */
+ void SetHeartBeatTimeout(int32_t timeout);
+
+ /**
+ * \brief changes protocol version in session
+ * \param session_id session id
+ * \param protocol_version protocol version registered application
+ */
+ void UpdateProtocolVersionSession(uint8_t session_id, uint8_t protocol_version);
+
+ /**
+ * \brief checks if session supports heartbeat
+ * \param session_id session id
+ * \return TRUE on success, otherwise FALSE
+ */
+ bool SupportHeartBeat(uint8_t session_id);
+
+
+ private:
+ /**
+ * \brief Current connection handler.
+ */
+ ConnectionHandler *connection_handler_;
+
+ /**
+ * \brief Current connection handle.
+ */
+ ConnectionHandle connection_handle_;
+
+ /**
+ * \brief DeviceHandle of this connection.
+ */
+ DeviceHandle connection_device_handle_;
+
+ /**
+ * \brief session/services map
+ */
+ SessionMap session_map_;
+
+ mutable sync_primitives::Lock session_map_lock_;
+
+ /**
+ * \brief monitor that closes connection if there is no traffic over it
+ */
+ HeartBeatMonitor *heartbeat_monitor_;
+ threads::Thread *heart_beat_monitor_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(Connection);
+};
+
+} // namespace connection_handler
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_H_
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler.h b/src/components/connection_handler/include/connection_handler/connection_handler.h
new file mode 100644
index 0000000000..08bef97155
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/connection_handler.h
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
+
+#include "transport_manager/transport_manager_listener.h"
+#include "protocol_handler/session_observer.h"
+#include "connection_handler/connection_handler_observer.h"
+#include "connection_handler/device.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/devices_discovery_starter.h"
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+/**
+ * \class ConnectionHandler
+ * \brief SmartDeviceLink ConnectionHandler interface class
+ */
+class ConnectionHandler {
+ public:
+ /**
+ * \brief Sets observer pointer for ConnectionHandler.
+ * \param observer Pointer to observer object.
+ **/
+ virtual void set_connection_handler_observer(
+ ConnectionHandlerObserver *observer) = 0;
+
+ /**
+ * \brief Sets pointer to TransportManager.
+ * \param transportManager Pointer to TransportManager object.
+ **/
+ virtual void set_transport_manager(
+ transport_manager::TransportManager *transport_manager) = 0;
+
+ virtual void StartTransportManager() = 0;
+
+ virtual void ConnectToDevice(
+ connection_handler::DeviceHandle device_handle) = 0;
+
+ virtual void ConnectToAllDevices() = 0;
+
+ /**
+ * @brief Close the connection revoked by Policy
+ * @param connection_key pair of connection and session id
+ */
+ virtual void CloseRevokedConnection(uint32_t connection_key) = 0;
+
+ /**
+ * \brief Close all associated sessions and close the connection pointed by handle
+ */
+ virtual void CloseConnection(ConnectionHandle connection_handle) = 0;
+
+ /**
+ * \brief Return count of session for specified connection
+ * \param connection_key pair of connection handle and session id
+ */
+ virtual uint32_t GetConnectionSessionsCount(uint32_t connection_key) = 0;
+
+ /**
+ * Gets device id by mac address
+ * @param mac_address
+ * @return true if successfully
+ */
+ virtual bool GetDeviceID(const std::string &mac_address,
+ DeviceHandle *device_handle) = 0;
+
+ /**
+ * Close session associated with the key
+ */
+ virtual void CloseSession(uint32_t key) = 0;
+
+ /**
+ * Close session
+ */
+ virtual void CloseSession(ConnectionHandle connection_handle,
+ uint8_t session_id) = 0;
+
+ /**
+ * \brief Start heartbeat for specified session
+ *
+ * \param connection_key pair of connection and session id
+ */
+ virtual void StartSessionHeartBeat(uint32_t connection_key) = 0;
+
+ /**
+ * \brief Send heartbeat to mobile app
+ */
+ virtual void SendHeartBeat(ConnectionHandle connection_handle,
+ uint8_t session_id) = 0;
+
+ /**
+ * Sets heart beat timeout for specified session
+ * @param connection_key pair of connection and session id
+ * @param timeout in seconds
+ */
+ virtual void SetHeartBeatTimeout(uint32_t connection_key,
+ int32_t timeout) = 0;
+
+ /**
+ * \brief binds protocol version with session
+ *
+ * \param connection_key pair of connection and session id
+ * \param protocol_version contains protocol version of
+ * \registered application.
+ */
+ virtual void BindProtocolVersionWithSession(uint32_t connection_key,
+ uint8_t protocol_version) = 0;
+
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ConnectionHandler() {
+ }
+};
+} // namespace connection_handler
+
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
new file mode 100644
index 0000000000..00ebdf0ab5
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h
@@ -0,0 +1,423 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_IMPL_H_
+
+#include <map>
+#include <list>
+#include <string>
+#include <vector>
+
+#include "transport_manager/transport_manager_listener_empty.h"
+#include "protocol_handler/session_observer.h"
+#include "protocol_handler/protocol_handler.h"
+#include "connection_handler/connection_handler_observer.h"
+#include "connection_handler/device.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/devices_discovery_starter.h"
+#include "connection_handler/connection_handler.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "utils/stl_utils.h"
+#include "utils/singleton.h"
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+/**
+ * \class ConnectionHandlerImpl
+ * \brief SmartDeviceLink connection_handler main class
+ * Observes TransportManager and ProtocolHandler,
+ * stores information regarding connections
+ * and sessions and provides it to AppManager.
+ */
+class ConnectionHandlerImpl : public ConnectionHandler,
+ public transport_manager::TransportManagerListenerEmpty,
+ public protocol_handler::SessionObserver,
+ public DevicesDiscoveryStarter,
+ public utils::Singleton<ConnectionHandlerImpl> {
+ public:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ConnectionHandlerImpl();
+
+ void Stop();
+ /**
+ * \brief Sets observer pointer for connection_handler.
+ * \param observer Pointer to observer object.
+ */
+ virtual void set_connection_handler_observer(
+ ConnectionHandlerObserver *observer);
+
+ /**
+ * \brief Sets pointer to TransportManager.
+ * \param transport_mngr Pointer to TransportManager object.
+ **/
+ virtual void set_transport_manager(
+ transport_manager::TransportManager *transport_mngr);
+
+ /**
+ * \brief Sets pointer to ProtocolHandler.
+ * \param protocol_handler Pointer to ProtocolHandler object.
+ **/
+ void set_protocol_handler(
+ protocol_handler::ProtocolHandler *protocol_handler);
+
+ /**
+ * \brief Connects to all services of device
+ * \param deviceHandle Handle of device to connect to
+ */
+ virtual void ConnectToDevice(connection_handler::DeviceHandle device_handle);
+
+ virtual void ConnectToAllDevices();
+
+ virtual void StartTransportManager();
+
+ virtual void OnDeviceListUpdated(
+ const std::vector<transport_manager::DeviceInfo> &);
+
+ virtual void OnFindNewApplicationsRequest();
+
+ /**
+ * \brief Available devices list updated.
+ *
+ * Called when device scanning initiated with scanForNewDevices
+ * is completed or devices connected via background procedures.
+ *
+ * \param DeviceList New list of available devices.
+ **/
+ virtual void OnDeviceFound(const transport_manager::DeviceInfo &device_info);
+ virtual void OnDeviceAdded(const transport_manager::DeviceInfo &device_info);
+ virtual void OnDeviceRemoved(const transport_manager::DeviceInfo &device_info);
+
+ virtual void OnScanDevicesFinished();
+ virtual void OnScanDevicesFailed(
+ const transport_manager::SearchDeviceError &error);
+
+ /**
+ * \brief Notifies about established connection.
+ *
+ * \param connection_id ID of new connection.
+ **/
+ virtual void OnConnectionEstablished(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id);
+ virtual void OnConnectionFailed(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectError &error);
+ virtual void OnConnectionClosed(
+ transport_manager::ConnectionUID connection_id);
+ virtual void OnConnectionClosedFailure(
+ transport_manager::ConnectionUID connection_id,
+ const transport_manager::DisconnectError &error);
+ virtual void OnUnexpectedDisconnect(
+ transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError &error);
+ virtual void OnDeviceConnectionLost(
+ const connection_handler::DeviceHandle &device,
+ const transport_manager::DisconnectDeviceError &error);
+ /**
+ * \brief Informs about failure during DisconnectDevice procedure of TM
+ * \param device Information about disconnected device
+ * \param error Information about possible reason of loosing connection
+ */
+ virtual void OnDisconnectFailed(
+ const connection_handler::DeviceHandle &device,
+ const transport_manager::DisconnectDeviceError &error);
+
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates start of new session.
+ * \param connection_handle Connection identifier within which session has to be started.
+ * \param session_id Identifier of the session to be started
+ * \param service_type Type of service
+ * \param is_protected would be service protected
+ * \param hash_id pointer for session hash identifier
+ * \return uint32_t Id (number) of new session if successful, otherwise 0.
+ */
+ virtual uint32_t OnSessionStartedCallback(const transport_manager::ConnectionUID &connection_handle,
+ const uint8_t session_id,
+ const protocol_handler::ServiceType &service_type,
+ const bool is_protected, uint32_t* hash_id);
+
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates session ending.
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Identifier of the session to be ended
+ * \param hashCode Hash used only in second version of SmartDeviceLink protocol.
+ * If not equal to hash assigned to session on start then operation fails.
+ * \return uint32_t 0 if operation fails, session key otherwise
+ */
+ virtual uint32_t OnSessionEndedCallback(
+ const transport_manager::ConnectionUID &connection_handle,
+ const uint8_t session_id, const uint32_t &hashCode,
+ const protocol_handler::ServiceType &service_type);
+
+ /**
+ * \brief Creates unique identifier of session (can be used as hash)
+ * from given connection identifier
+ * within which session exists and session number.
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Identifier of the session
+ * \return int32_t Unique key for session
+ */
+ virtual uint32_t KeyFromPair(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id);
+
+ /**
+ * \brief Returns connection identifier and session number from given session key
+ * \param key Unique key used by other components as session identifier
+ * \param connection_handle Returned: Connection identifier within which session exists
+ * \param sessionId Returned: Number of session
+ */
+ virtual void PairFromKey(uint32_t key,
+ transport_manager::ConnectionUID *connection_handle,
+ uint8_t *session_id);
+
+ /**
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ virtual int32_t GetDataOnSessionKey(uint32_t key, uint32_t *app_id = 0,
+ std::list<int32_t> *sessions_list = NULL,
+ uint32_t *device_id = 0);
+
+ /**
+ * \brief information about device
+ * \param device_handle
+ * \param device_name Returned: name of device
+ * \param applications_list Returned: applications on device
+ * \param mac_address Returned: List of session keys
+ * \param connection_type Returned: type of connection (USB, BT, etc.)
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ virtual int32_t GetDataOnDeviceID(connection_handler::DeviceHandle device_handle,
+ std::string *device_name = NULL,
+ std::list<uint32_t> *applications_list = NULL,
+ std::string *mac_address = NULL,
+ std::string* connection_type = NULL);
+#ifdef ENABLE_SECURITY
+ /**
+ * \brief Sets crypto context of connection
+ * \param key Unique key used by other components as session identifier
+ * \param context SSLContext to be set
+ * \return \c SecurityQuery::ProtectSessionResult value
+ */
+ int SetSSLContext(
+ const uint32_t &key,
+ security_manager::SSLContext *context) OVERRIDE;
+
+ /**
+ * \brief Gets crypto context of connection, use service_type to get NULL
+ * SSLContext for not protected services or ControlService (0x0)
+ * to get current SSLContext of connection
+ * \param key Unique key used by other components as session identifier
+ * \param service_type Type of service
+ * \return \ref SSLContext of connection
+ */
+ security_manager::SSLContext *GetSSLContext(
+ const uint32_t &key,
+ const protocol_handler::ServiceType &service_type) OVERRIDE;
+ /**
+ * \brief Set protection flag to service in session by key
+ * \param key Unique key used by other components as session identifier
+ * \param service_type Type of service
+ */
+ void SetProtectionFlag(
+ const uint32_t &key,
+ const protocol_handler::ServiceType &service_type) OVERRIDE;
+#endif // ENABLE_SECURITY
+
+ /**
+ * \brief Get device handle by mac address
+ * \param mac_address uniq address
+ * \param device_handle
+ * \return true on sucess otherwise false.
+ */
+ virtual bool GetDeviceID(const std::string &mac_address,
+ DeviceHandle *device_handle);
+
+ /**
+ * \brief Method which should start devices discovering
+ */
+ virtual void StartDevicesDiscovery();
+
+ /**
+ * @brief Close the connection revoked by Policy
+ * @param connection_key pair of connection and session id
+ */
+ virtual void CloseRevokedConnection(uint32_t connection_key);
+
+ /**
+ * @brief Close the connection pointed by handle
+ * @param connection_handle Connection unique id
+ */
+ virtual void CloseConnection(ConnectionHandle connection_handle) OVERRIDE;
+
+ /**
+ * \brief Close session associated with the key
+ * \param key Unique key used by other components as session identifier
+ */
+ virtual void CloseSession(uint32_t key);
+
+ /**
+ * \brief Function used by HearbeatMonitior to close session on HB timeout
+ * \param connection_handle Connection handler within which session exists
+ * \param session_id Identifier of the session to be ended
+ */
+ virtual void CloseSession(ConnectionHandle connection_handle,
+ uint8_t session_id);
+
+ /**
+ * \brief Return count of session for specified connection
+ * \param connection_key pair of connection handle and session id
+ */
+ virtual uint32_t GetConnectionSessionsCount(uint32_t connection_key);
+
+ /**
+ * \brief Send heartbeat message to mobile app
+ */
+ virtual void SendHeartBeat(ConnectionHandle connection_handle,
+ uint8_t session_id);
+
+ /**
+ * \brief Start heartbeat for specified session
+ *
+ * \param connection_key pair of connection and session id
+ */
+ virtual void StartSessionHeartBeat(uint32_t connection_key);
+
+ /**
+ * Sets heart beat timeout for specified session
+ * @param connection_key pair of connection and session id
+ * @param timeout in seconds
+ */
+ virtual void SetHeartBeatTimeout(uint32_t connection_key, int32_t timeout);
+
+ /**
+ * \brief Keep connection associated with the key from being closed by heartbeat monitor
+ */
+ void KeepConnectionAlive(uint32_t connection_key, uint8_t session_id);
+
+ /**
+ * \brief binds protocol version with session
+ *
+ * \param connection_key pair of connection and session id
+ * \param protocol_version contains protocol version of
+ * \registered application.
+ */
+ virtual void BindProtocolVersionWithSession(uint32_t connection_key,
+ uint8_t protocol_version);
+
+ /**
+ * \brief returns TRUE if session supports sending HEART BEAT ACK to mobile side
+ * \param connection_handle Connection identifier whithin which session exists
+ * \param sessionId Identifier of the session
+ * \return TRUE if session has protocol version which supports heartbeat otherwise returns FALSE
+ */
+ virtual bool IsHeartBeatSupported(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id);
+ private:
+ /**
+ * \brief Default class constructor
+ */
+ ConnectionHandlerImpl();
+
+ /**
+ * \brief Disconnect application.
+ *
+ * \param device_handle DeviceHandle of disconnected device.
+ * \param connection_handle Connection handle.
+ **/
+ void RemoveConnection(const ConnectionHandle connection_handle);
+
+ void OnConnectionEnded(
+ const transport_manager::ConnectionUID &connection_id);
+
+ /**
+ * \brief Pointer to observer
+ */
+ ConnectionHandlerObserver *connection_handler_observer_;
+
+ /**
+ * \brief Pointer to TransportManager
+ */
+ transport_manager::TransportManager *transport_manager_;
+
+ protocol_handler::ProtocolHandler *protocol_handler_;
+
+ /**
+ * \brief List of devices
+ */
+ DeviceMap device_list_;
+
+ /**
+ * \brief List of connections
+ */
+ ConnectionList connection_list_;
+
+ /**
+ * \brief Lock for applications list
+ */
+ mutable sync_primitives::Lock connection_list_lock_;
+
+ /**
+ * \brief Cleans connection list on destruction
+ */
+ utils::StlMapDeleter<ConnectionList> connection_list_deleter_;
+
+#ifdef BUILD_TESTS
+ // Methods for test usage
+ public:
+ ConnectionList &getConnectionList();
+ void addDeviceConnection(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id);
+#endif
+ private:
+ FRIEND_BASE_SINGLETON_CLASS(ConnectionHandlerImpl);
+ DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl);
+};
+} // namespace connection_handler
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_IMPL_H_
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_observer.h b/src/components/connection_handler/include/connection_handler/connection_handler_observer.h
new file mode 100644
index 0000000000..cd419c124a
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/connection_handler_observer.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
+
+#include "connection_handler/device.h"
+#include "connection_handler/connection.h"
+#include "protocol/service_type.h"
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+
+/**
+ * \class ConnectionHandlerObserver
+ * \brief ConnectionHandlerObserver class
+ */
+class ConnectionHandlerObserver {
+ public:
+ /**
+ * \brief Available devices list updated.
+ *
+ * Called when device scanning initiated with scanForNewDevices
+ * is completed.
+ *
+ * \param DeviceList New list of available devices.
+ **/
+ virtual void OnDeviceListUpdated(
+ const connection_handler::DeviceMap &device_list) = 0;
+
+ /**
+ * @brief Reaction to "Find new applications" request
+ */
+ virtual void OnFindNewApplicationsRequest() = 0;
+
+ /**
+ * \brief Removes device.
+ *
+ * Called when device has been removed from a list.
+ *
+ * \param DeviceHandle Handle of removed device.
+ **/
+ virtual void RemoveDevice(
+ const connection_handler::DeviceHandle &device_handle) = 0;
+
+ /**
+ * \brief Callback function used by connection_handler
+ * when Mobile Application initiates start of new service.
+ * \param deviceHandle Device identifier within which session has to be started.
+ * \param sessionKey Key of started session.
+ * \param type Established service type
+ */
+ virtual bool OnServiceStartedCallback(
+ const connection_handler::DeviceHandle &device_handle,
+ const int32_t &session_key,
+ const protocol_handler::ServiceType &type) = 0;
+
+ /**
+ * \brief Callback function used by connection_handler
+ * when Mobile Application initiates service ending.
+ * \param sessionKey Key of session which should be ended
+ */
+ virtual void OnServiceEndedCallback(
+ const int32_t &session_key,
+ const protocol_handler::ServiceType &type) = 0;
+
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ConnectionHandlerObserver() {
+ }
+};
+} // namespace connection_handler
+
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
diff --git a/src/components/connection_handler/include/connection_handler/device.h b/src/components/connection_handler/include/connection_handler/device.h
new file mode 100644
index 0000000000..c37c4cc62c
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/device.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
+
+#include <string>
+#include <map>
+#include <vector>
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+
+/**
+ * \brief Type for DeviceHandle
+ */
+typedef uint32_t DeviceHandle;
+typedef std::vector<int32_t> AppList;
+
+/**
+ * \class Device
+ * \brief Connection class
+ */
+class Device {
+ public:
+ /**
+ * \brief Class constructor
+ */
+ Device(DeviceHandle device_handle, const std::string &user_friendly_name,
+ const std::string &mac_address = "", const std::string& connection_type = "");
+
+ /**
+ * \brief Returns device handle
+ * \return DeviceHandle
+ */
+ DeviceHandle device_handle() const;
+
+ /**
+ * \brief Returns user frendly device name
+ * \return UserFriendlyName
+ */
+ std::string user_friendly_name() const;
+
+ /**
+ *\brief Also should be used for iOS USB connections
+ *(better not know why this same method)
+ */
+ std::string mac_address() const;
+
+ /**
+ * @brief The type of connection used by device.
+ * @return connection type (USB_serial, BTMAC, etc.)
+ */
+ std::string connection_type() const;
+
+ private:
+ /**
+ * \brief Uniq device handle.
+ */
+ DeviceHandle device_handle_;
+
+ /**
+ * \brief User-friendly device name.
+ */
+ std::string user_friendly_name_;
+
+ /**
+ * \brief Mac address of device if available
+ */
+ std::string mac_address_;
+
+ /**
+ * \brief The type of connection used by device.
+ */
+ std::string connection_type_;
+};
+
+/**
+ * \brief Type for Devices map
+ */
+typedef std::map<int32_t, Device> DeviceMap;
+} // namespace connection_handler
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
diff --git a/src/components/connection_handler/include/connection_handler/devices_discovery_starter.h b/src/components/connection_handler/include/connection_handler/devices_discovery_starter.h
new file mode 100644
index 0000000000..bd5885a273
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/devices_discovery_starter.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICES_DISCOVERY_STARTER_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICES_DISCOVERY_STARTER_H_
+
+#include "connection_handler/device.h"
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+/**
+ * \class DevicesDiscoveryStarter
+ * \brief Starter of devices discovering process class
+ */
+class DevicesDiscoveryStarter {
+ public:
+ /**
+ * \brief Method which should start devices discoveryng
+ */
+ virtual void StartDevicesDiscovery()=0;
+
+ /**
+ * \brief Connects to all services of device
+ * \param deviceHandle Handle of device to connect to
+ */
+ virtual void ConnectToDevice(
+ connection_handler::DeviceHandle device_handle) = 0;
+
+ virtual void StartTransportManager() = 0;
+
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~DevicesDiscoveryStarter() {
+ }
+};
+} // namespace connection_handler
+
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICES_DISCOVERY_STARTER_H_
diff --git a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
new file mode 100644
index 0000000000..9b641ce01c
--- /dev/null
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_HEARTBEAT_MONITOR_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_HEARTBEAT_MONITOR_H_
+
+#include <stdint.h>
+#include <map>
+
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/date_time.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+
+namespace connection_handler {
+
+class Connection;
+
+/*
+ * Starts hearbeat timer for session and when it elapses closes it
+ */
+class HeartBeatMonitor: public threads::ThreadDelegate {
+ public:
+ HeartBeatMonitor(int32_t heartbeat_timeout_seconds,
+ Connection *connection);
+
+ /**
+ * Thread procedure.
+ */
+ virtual void threadMain();
+
+ /**
+ * \brief add and remove session
+ */
+ void AddSession(uint8_t session_id);
+ void RemoveSession(uint8_t session_id);
+
+ /**
+ * \brief Resets timer preventing session from being killed
+ */
+ void KeepAlive(uint8_t session_id);
+
+ /**
+ * \brief Thread exit procedure.
+ */
+ virtual bool exitThreadMain();
+
+ void set_heartbeat_timeout_seconds(int32_t timeout);
+
+ private:
+ struct SessionState;
+ typedef std::map<uint8_t, SessionState> SessionMap;
+
+ // \brief Heartbeat timeout, should be read from profile
+ int32_t heartbeat_timeout_seconds_;
+ // \brief Connection that must be closed when timeout elapsed
+ Connection *connection_;
+
+ static const int32_t kDefaultCycleTimeout = 100000;
+
+ struct SessionState {
+ TimevalStruct heartbeat_expiration;
+ bool is_heartbeat_sent;
+ };
+
+ // \brief monitored sessions collection
+
+ SessionMap sessions_;
+
+ sync_primitives::Lock sessions_list_lock_; // recurcive
+ sync_primitives::Lock main_thread_lock_;
+ mutable sync_primitives::Lock heartbeat_timeout_seconds_lock_;
+
+ volatile bool run_;
+
+ void Process();
+ void RefreshExpiration(TimevalStruct* expiration) const;
+ inline bool HasTimeoutElapsed(const TimevalStruct& expiration) const;
+
+ DISALLOW_COPY_AND_ASSIGN(HeartBeatMonitor);
+};
+
+} // namespace connection_handler
+
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_HEARTBEAT_MONITOR_H_
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
new file mode 100644
index 0000000000..bd8b478ba5
--- /dev/null
+++ b/src/components/connection_handler/src/connection.cc
@@ -0,0 +1,360 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <limits.h>
+
+#include <algorithm>
+
+#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler.h"
+#include "protocol_handler/protocol_packet.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/ssl_context.h"
+#include "security_manager/security_manager.h"
+#endif // ENABLE_SECURITY
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink ConnectionHandler namespace.
+ */
+namespace connection_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ConnectionHandler")
+
+Service *Session::FindService(const protocol_handler::ServiceType &service_type) {
+ ServiceList::iterator service_it =
+ std::find(service_list.begin(), service_list.end(), service_type);
+ if(service_it != service_list.end()){
+ return &(*service_it);
+ }
+ return NULL;
+}
+
+const Service *Session::FindService(const protocol_handler::ServiceType &service_type) const {
+ ServiceList::const_iterator service_it =
+ std::find(service_list.begin(), service_list.end(), service_type);
+ if(service_it != service_list.end()){
+ return &(*service_it);
+ }
+ return NULL;
+}
+
+Connection::Connection(ConnectionHandle connection_handle,
+ DeviceHandle connection_device_handle,
+ ConnectionHandler *connection_handler,
+ int32_t heartbeat_timeout)
+ : connection_handler_(connection_handler),
+ connection_handle_(connection_handle),
+ connection_device_handle_(connection_device_handle) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ DCHECK(connection_handler_);
+
+ heartbeat_monitor_ = new HeartBeatMonitor(heartbeat_timeout, this);
+ heart_beat_monitor_thread_ = new threads::Thread("HeartBeatMonitor",
+ heartbeat_monitor_);
+ heart_beat_monitor_thread_->start();
+}
+
+Connection::~Connection() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ heart_beat_monitor_thread_->stop();
+ delete heart_beat_monitor_thread_;
+ sync_primitives::AutoLock lock(session_map_lock_);
+ session_map_.clear();
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+// Finds a key not presented in std::map<unsigned char, T>
+// Returns 0 if that key not found
+namespace {
+template <class T>
+uint32_t findGap(const std::map<unsigned char, T> &map) {
+ for (uint32_t i = 1; i <= UCHAR_MAX; ++i) {
+ if (map.find(i) == map.end()) {
+ return i;
+ }
+ }
+ return 0;
+}
+} // namespace
+
+uint32_t Connection::AddNewSession() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ sync_primitives::AutoLock lock(session_map_lock_);
+ const uint32_t session_id = findGap(session_map_);
+ if (session_id > 0) {
+ Session& new_session = session_map_[session_id];
+ new_session.protocol_version = ::protocol_handler::PROTOCOL_VERSION_2;
+ new_session.service_list.push_back(Service(protocol_handler::kRpc));
+ new_session.service_list.push_back(Service(protocol_handler::kBulk));
+ }
+ return session_id;
+}
+
+uint32_t Connection::RemoveSession(uint8_t session_id) {
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator it = session_map_.find(session_id);
+ if (session_map_.end() == it) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return 0;
+ }
+ heartbeat_monitor_->RemoveSession(session_id);
+ session_map_.erase(session_id);
+ return session_id;
+}
+
+bool Connection::AddNewService(uint8_t session_id,
+ protocol_handler::ServiceType service_type,
+ const bool request_protection) {
+ // Ignore wrong services
+ if (protocol_handler::kControl == service_type ||
+ protocol_handler::kInvalidServiceType == service_type ) {
+ LOG4CXX_WARN(logger_, "Wrong service " << static_cast<int>(service_type));
+ return false;
+ }
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_it == session_map_.end()) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return false;
+ }
+ Session &session = session_it->second;
+ Service *service = session.FindService(service_type);
+ // if service already exists
+ if (service) {
+#ifdef ENABLE_SECURITY
+ if(!request_protection) {
+ LOG4CXX_WARN(logger_, "Session " << static_cast<int>(session_id) <<
+ " already has unprotected service "<< static_cast<int>(service_type));
+ return false;
+ }
+ if (service->is_protected_) {
+ LOG4CXX_WARN(logger_, "Session " << static_cast<int>(session_id) <<
+ " already has protected service "<< static_cast<int>(service_type));
+ return false;
+ }
+ // For unproteced service could be start protection
+ return true;
+#else
+ // Service already exists
+ return false;
+#endif // ENABLE_SECURITY
+ }
+ // id service is not exists
+ session.service_list.push_back(Service(service_type));
+ return true;
+}
+
+inline bool is_incorrect_for_remove_service(
+ const protocol_handler::ServiceType service_type) {
+ return
+ // Control type is internal part of session
+ protocol_handler::kControl == service_type ||
+ // RPC and bulk service is necessary part of session
+ protocol_handler::kRpc == service_type ||
+ protocol_handler::kBulk == service_type ||
+ // Invalid service is not part of session
+ protocol_handler::kInvalidServiceType == service_type;
+}
+
+bool Connection::RemoveService(
+ uint8_t session_id, protocol_handler::ServiceType service_type) {
+ // Ignore wrong and required for Session services
+ if (is_incorrect_for_remove_service(service_type)) {
+ LOG4CXX_WARN(logger_, "Could not remove service "
+ << static_cast<int>(service_type));
+ return false;
+ }
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_map_.end() == session_it) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return false;
+ }
+
+ ServiceList &service_list = session_it->second.service_list;
+ ServiceList::iterator service_it =
+ find(service_list.begin(), service_list.end(), service_type);
+ if (service_list.end() == service_it) {
+ LOG4CXX_WARN(logger_, "Session " << session_id << " didn't established"
+ " service " << service_type);
+ return false;
+ }
+ service_list.erase(service_it);
+ return true;
+}
+
+#ifdef ENABLE_SECURITY
+int Connection::SetSSLContext(uint8_t session_id,
+ security_manager::SSLContext *context) {
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_it == session_map_.end()) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return security_manager::SecurityManager::ERROR_INTERNAL;
+ }
+ Session &session = session_it->second;
+ session.ssl_context = context;
+ return security_manager::SecurityManager::ERROR_SUCCESS;
+}
+
+security_manager::SSLContext *Connection::GetSSLContext(
+ const uint8_t session_id, const protocol_handler::ServiceType &service_type) const {
+ LOG4CXX_TRACE(logger_, "Connection::GetSSLContext");
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::const_iterator session_it = session_map_.find(session_id);
+ if (session_it == session_map_.end()) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return NULL;
+ }
+ const Session &session = session_it->second;
+ // for control services return current SSLContext value
+ if (protocol_handler::kControl == service_type)
+ return session.ssl_context;
+ const Service *service = session.FindService(service_type);
+ if (!service) {
+ LOG4CXX_WARN(logger_, "Service not found in this session!");
+ return NULL;
+ }
+ if (!service->is_protected_)
+ return NULL;
+ LOG4CXX_TRACE(logger_, "SSLContext is " << session.ssl_context);
+ return session.ssl_context;
+}
+
+void Connection::SetProtectionFlag(
+ const uint8_t session_id, const protocol_handler::ServiceType &service_type) {
+ LOG4CXX_TRACE(logger_, "Connection::SetProtectionFlag");
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_it == session_map_.end()) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return;
+ }
+ Session &session = session_it->second;
+ Service *service = session.FindService(service_type);
+ if (!service) {
+ LOG4CXX_WARN(logger_, "Service not found in this session!");
+ return;
+ }
+ service->is_protected_ = true;
+ // Rpc and bulk shall be protected as one service
+ if (service->service_type == protocol_handler::kRpc) {
+ Service *service_bulk = session.FindService(protocol_handler::kBulk);
+ DCHECK(service_bulk);
+ service_bulk->is_protected_ = true;
+ } else if (service->service_type == protocol_handler::kBulk) {
+ Service *service_rpc = session.FindService(protocol_handler::kRpc);
+ DCHECK(service_rpc);
+ service_rpc->is_protected_ = true;
+ }
+}
+#endif // ENABLE_SECURITY
+
+ConnectionHandle Connection::connection_handle() const {
+ return connection_handle_;
+}
+
+DeviceHandle Connection::connection_device_handle() {
+ return connection_device_handle_;
+}
+
+const SessionMap Connection::session_map() const {
+ sync_primitives::AutoLock lock(session_map_lock_);
+ return session_map_;
+}
+
+void Connection::CloseSession(uint8_t session_id) {
+ size_t size;
+ {
+ sync_primitives::AutoLock lock(session_map_lock_);
+
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_it == session_map_.end()) {
+ return;
+ }
+ size = session_map_.size();
+ }
+
+ connection_handler_->CloseSession(connection_handle_, session_id);
+
+ //Close connection if it is last session
+ if (1 == size) {
+ connection_handler_->CloseConnection(connection_handle_);
+ }
+}
+
+void Connection::UpdateProtocolVersionSession(
+ uint8_t session_id, uint8_t protocol_version) {
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_map_.end() == session_it) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return;
+ }
+ Session &session = session_it->second;
+ session.protocol_version = protocol_version;
+}
+
+bool Connection::SupportHeartBeat(uint8_t session_id) {
+ sync_primitives::AutoLock lock(session_map_lock_);
+ SessionMap::iterator session_it = session_map_.find(session_id);
+ if (session_map_.end() == session_it) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return false;
+ }
+ Session &session = session_it->second;
+ return ::protocol_handler::PROTOCOL_VERSION_3 == session.protocol_version;
+}
+
+void Connection::StartHeartBeat(uint8_t session_id) {
+ heartbeat_monitor_->AddSession(session_id);
+}
+
+void Connection::SendHeartBeat(uint8_t session_id) {
+ connection_handler_->SendHeartBeat(connection_handle_, session_id);
+}
+
+void Connection::KeepAlive(uint8_t session_id) {
+ heartbeat_monitor_->KeepAlive(session_id);
+}
+
+void Connection::SetHeartBeatTimeout(int32_t timeout) {
+ heartbeat_monitor_->set_heartbeat_timeout_seconds(timeout);
+}
+
+} // namespace connection_handler
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
new file mode 100644
index 0000000000..f1dae841a6
--- /dev/null
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -0,0 +1,863 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <strings.h>
+
+#include <string>
+#include <list>
+#include <algorithm>
+
+#include "connection_handler/connection_handler_impl.h"
+#include "transport_manager/info.h"
+#include "config_profile/profile.h"
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/security_manager.h"
+#endif // ENABLE_SECURITY
+
+namespace {
+int32_t HeartBeatTimeout() {
+ return profile::Profile::instance()->heart_beat_timeout();
+}
+} // namespace
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink ConnectionHandler namespace.
+ */
+namespace connection_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ConnectionHandler")
+
+ConnectionHandle HandleFromConnectionUID(transport_manager::ConnectionUID uid) {
+ return ConnectionHandle(uid);
+}
+
+transport_manager::ConnectionUID ConnectionUIDFromHandle(
+ ConnectionHandle handle) {
+ return transport_manager::ConnectionUID(handle);
+}
+
+ConnectionHandlerImpl::ConnectionHandlerImpl()
+ : connection_handler_observer_(NULL),
+ transport_manager_(NULL),
+ protocol_handler_(NULL),
+ connection_list_deleter_(&connection_list_) {
+}
+
+ConnectionHandlerImpl::~ConnectionHandlerImpl() {
+ LOG4CXX_TRACE(logger_, "Destructing ConnectionHandlerImpl.");
+}
+
+void ConnectionHandlerImpl::Stop() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ ConnectionList::iterator itr = connection_list_.begin();
+ while (itr != connection_list_.end()) {
+ RemoveConnection(itr->second->connection_handle());
+ itr = connection_list_.begin();
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ConnectionHandlerImpl::set_connection_handler_observer(
+ ConnectionHandlerObserver *observer) {
+ LOG4CXX_DEBUG(logger_, "ConnectionHandlerImpl::set_connection_handler_observer() "
+ << observer);
+ if (!observer) {
+ LOG4CXX_WARN(logger_, "Set Null pointer to observer.");
+ }
+ connection_handler_observer_ = observer;
+}
+
+void ConnectionHandlerImpl::set_transport_manager(
+ transport_manager::TransportManager *transport_mngr) {
+ LOG4CXX_DEBUG(logger_, "ConnectionHandlerImpl::set_transport_manager() "
+ << transport_mngr);
+ if (!transport_mngr) {
+ LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
+ return;
+ }
+ transport_manager_ = transport_mngr;
+}
+
+void ConnectionHandlerImpl::set_protocol_handler(
+ protocol_handler::ProtocolHandler *protocol_handler) {
+ LOG4CXX_DEBUG(logger_, "ConnectionHandlerImpl::set_protocol_handler()"
+ << protocol_handler);
+ if (!protocol_handler) {
+ LOG4CXX_WARN(logger_, "Set Null pointer to protocol handler.");
+ }
+ protocol_handler_ = protocol_handler;
+}
+
+void ConnectionHandlerImpl::OnDeviceListUpdated(
+ const std::vector<transport_manager::DeviceInfo>&) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceListUpdated()");
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ }
+}
+
+void ConnectionHandlerImpl::OnFindNewApplicationsRequest() {
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnFindNewApplicationsRequest();
+ }
+}
+
+void ConnectionHandlerImpl::OnDeviceFound(
+ const transport_manager::DeviceInfo&) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceFound()");
+}
+
+void ConnectionHandlerImpl::OnDeviceAdded(
+ const transport_manager::DeviceInfo &device_info) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceAdded()");
+ device_list_.insert(
+ DeviceMap::value_type(
+ device_info.device_handle(),
+ Device(device_info.device_handle(), device_info.name(),
+ device_info.mac_address(), device_info.connection_type())));
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ }
+}
+
+void ConnectionHandlerImpl::OnDeviceRemoved(
+ const transport_manager::DeviceInfo &device_info) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnDeviceRemoved()");
+ // Device has been removed. Perform all needed actions.
+ // 1. Delete all the connections and sessions of this device
+ // 2. Delete device from a list
+ // 3. Let observer know that device has been deleted.
+
+ std::vector<ConnectionHandle> connections_to_remove;
+ {
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ for (ConnectionList::iterator it = connection_list_.begin();
+ it != connection_list_.end(); ++it) {
+ if (device_info.device_handle() ==
+ (*it).second->connection_device_handle()) {
+ connections_to_remove.push_back((*it).first);
+ }
+ }
+ }
+
+ std::vector<ConnectionHandle>::iterator it = connections_to_remove.begin();
+ for (; it != connections_to_remove.end(); ++it) {
+ RemoveConnection(*it);
+ }
+
+ device_list_.erase(device_info.device_handle());
+ if (connection_handler_observer_) {
+ connection_handler_observer_->RemoveDevice(device_info.device_handle());
+ connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ }
+}
+
+void ConnectionHandlerImpl::OnScanDevicesFinished() {
+ LOG4CXX_TRACE(logger_, "Scan devices finished successfully.");
+}
+
+void ConnectionHandlerImpl::OnScanDevicesFailed(
+ const transport_manager::SearchDeviceError &error) {
+ LOG4CXX_WARN(logger_, "Scan devices failed. " << error.text());
+}
+
+void ConnectionHandlerImpl::OnConnectionEstablished(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnConnectionEstablished()");
+
+ DeviceMap::iterator it = device_list_.find(device_info.device_handle());
+ if (device_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown device!");
+ return;
+ }
+ LOG4CXX_INFO(logger_, "Add Connection:" << connection_id << " to the list.");
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ connection_list_.insert(
+ ConnectionList::value_type(
+ connection_id,
+ new Connection(connection_id, device_info.device_handle(), this,
+ HeartBeatTimeout())));
+}
+
+void ConnectionHandlerImpl::OnConnectionFailed(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectError &error) {
+ // TODO(PV): implement
+ LOG4CXX_ERROR(logger_, "Failed connecting.");
+}
+
+void ConnectionHandlerImpl::OnConnectionClosed(
+ transport_manager::ConnectionUID connection_id) {
+ LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::OnConnectionClosed");
+
+ OnConnectionEnded(connection_id);
+}
+
+void ConnectionHandlerImpl::OnConnectionClosedFailure(
+ transport_manager::ConnectionUID connection_id,
+ const transport_manager::DisconnectError &error) {
+ // TODO(PV): implement
+ LOG4CXX_ERROR(logger_, "ConnectionHandlerImpl::OnConnectionClosedFailure");
+}
+
+void ConnectionHandlerImpl::OnUnexpectedDisconnect(
+ transport_manager::ConnectionUID connection_id,
+ const transport_manager::CommunicationError &error) {
+ LOG4CXX_ERROR(logger_, "ConnectionHandlerImpl::OnUnexpectedDisconnect");
+
+ OnConnectionEnded(connection_id);
+}
+
+void ConnectionHandlerImpl::OnDeviceConnectionLost(
+ const transport_manager::DeviceHandle &device,
+ const transport_manager::DisconnectDeviceError &error) {
+ // TODO(PV): implement
+ LOG4CXX_ERROR(logger_, "Lost connection with device " << device);
+}
+
+void ConnectionHandlerImpl::OnDisconnectFailed(
+ const transport_manager::DeviceHandle &device,
+ const transport_manager::DisconnectDeviceError &error) {
+ // TODO(PV): implement
+ LOG4CXX_ERROR(logger_, "Trying to Disconnect device failed.");
+}
+
+void ConnectionHandlerImpl::RemoveConnection(
+ const ConnectionHandle connection_handle) {
+ LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::RemoveConnection()");
+
+ OnConnectionEnded(connection_handle);
+}
+
+#ifdef ENABLE_SECURITY
+namespace {
+bool AllowProtection(const protocol_handler::ServiceType &service_type,
+ const bool is_protected) {
+ if (is_protected) {
+ // Check deliver-specific services (which shall not be protected)
+ const std::list<int> force_unprotected_list =
+ profile::Profile::instance()->ReadIntContainer(
+ "Security Manager", "ForceUnprotectedService", NULL);
+ if (std::find(force_unprotected_list.begin(), force_unprotected_list.end(), service_type) !=
+ force_unprotected_list.end()) {
+ LOG4CXX_ERROR(logger_, "Service " << static_cast<int>(service_type)
+ << " is forbidden to be protected");
+ return false;
+ }
+ } else {
+ // Check deliver-specific services (which shall be protected)
+ const std::list<int> force_protected_list =
+ profile::Profile::instance()->ReadIntContainer(
+ "Security Manager", "ForceProtectedService", NULL);
+ if (std::find(force_protected_list.begin(), force_protected_list.end(), service_type) !=
+ force_protected_list.end()) {
+ LOG4CXX_ERROR(logger_, "Service " << static_cast<int>(service_type)
+ << " shall be protected");
+ return false;
+ }
+ }
+ return true;
+}
+} // namespace
+#endif // ENABLE_SECURITY
+
+uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
+ const transport_manager::ConnectionUID &connection_handle,
+ const uint8_t session_id, const protocol_handler::ServiceType &service_type,
+ const bool is_protected, uint32_t* hash_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (hash_id) {
+ *hash_id = protocol_handler::HASH_ID_WRONG;
+ }
+#ifdef ENABLE_SECURITY
+ if (!AllowProtection(service_type, is_protected)) {
+ return 0;
+ }
+#endif // ENABLE_SECURITY
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return 0;
+ }
+ uint32_t new_session_id = 0;
+
+ Connection *connection = it->second;
+ if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
+ new_session_id = connection->AddNewSession();
+ if (0 == new_session_id) {
+ LOG4CXX_ERROR(logger_, "Couldn't start new session!");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return 0;
+ }
+ if (hash_id) {
+ *hash_id = KeyFromPair(connection_handle, new_session_id);
+ }
+ } else { // Could be create new service or protected exists one
+ if (!connection->AddNewService(session_id, service_type, is_protected)) {
+ LOG4CXX_ERROR(logger_, "Couldn't establish "
+#ifdef ENABLE_SECURITY
+ << (is_protected ? "protected" : "non-protected")
+#endif // ENABLE_SECURITY
+ << " service " << static_cast<int>(service_type)
+ << " for session " << static_cast<int>(session_id));
+ LOG4CXX_TRACE_EXIT(logger_);
+ return 0;
+ }
+ new_session_id = session_id;
+ if (hash_id) {
+ *hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED;
+ }
+ }
+
+ if (connection_handler_observer_) {
+ const uint32_t session_key = KeyFromPair(connection_handle, new_session_id);
+ const bool success = connection_handler_observer_->OnServiceStartedCallback(
+ connection->connection_device_handle(), session_key, service_type);
+ if (!success) {
+ if (protocol_handler::kRpc == service_type) {
+ connection->RemoveSession(new_session_id);
+ } else {
+ connection->RemoveService(session_id, service_type);
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+ return 0;
+ }
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+ return new_session_id;
+}
+
+uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
+ const uint32_t &connection_handle, const uint8_t session_id,
+ const uint32_t &hashCode,
+ const protocol_handler::ServiceType &service_type) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::OnSessionEndedCallback()");
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_, "Unknown connection!");
+ return 0;
+ }
+ Connection *connection = it->second;
+ const uint32_t session_key = KeyFromPair(connection_handle, session_id);
+
+ if (protocol_handler::kRpc == service_type) {
+ LOG4CXX_INFO(logger_, "Session " << static_cast<uint32_t>(session_id)
+ << " to be removed");
+ // old version of protocol doesn't support hash
+ if (protocol_handler::HASH_ID_NOT_SUPPORTED != hashCode) {
+ if (protocol_handler::HASH_ID_WRONG == hashCode ||
+ session_key != hashCode) {
+ LOG4CXX_WARN(logger_, "Wrong hash_id for session "
+ << static_cast<uint32_t>(session_id));
+ return 0;
+ }
+ }
+ if (!connection->RemoveSession(session_id)) {
+ LOG4CXX_WARN(logger_, "Couldn't remove session "
+ << static_cast<uint32_t>(session_id));
+ return 0;
+ }
+ } else {
+ LOG4CXX_INFO(logger_, "Service " << static_cast<uint32_t>(service_type)
+ << " to be removed");
+ if (!connection->RemoveService(session_id, service_type)) {
+ LOG4CXX_WARN(logger_, "Couldn't remove service "
+ << static_cast<uint32_t>(service_type));
+ return 0;
+ }
+ }
+
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnServiceEndedCallback(session_key,
+ service_type);
+ }
+ return session_key;
+}
+
+uint32_t ConnectionHandlerImpl::KeyFromPair(
+ transport_manager::ConnectionUID connection_handle, uint8_t session_id) {
+ const uint32_t key = connection_handle | (session_id << 16);
+ LOG4CXX_TRACE(logger_, "Key for ConnectionHandle:"
+ << static_cast<uint32_t>(connection_handle)
+ << " Session:" << static_cast<uint32_t>(session_id)
+ << " is: " << static_cast<uint32_t>(key));
+ if (protocol_handler::HASH_ID_WRONG == key) {
+ LOG4CXX_ERROR(logger_, "Connection key is WRONG_HASH_ID "
+ "(session id shall be greater 0)");
+ }
+ return key;
+}
+
+void ConnectionHandlerImpl::PairFromKey(uint32_t key,
+ uint32_t *connection_handle,
+ uint8_t *session_id) {
+ *connection_handle = key & 0xFF00FFFF;
+ *session_id = key >> 16;
+ LOG4CXX_TRACE(logger_, "ConnectionHandle:"
+ << static_cast<int32_t>(*connection_handle)
+ << " Session:" << static_cast<int32_t>(*session_id)
+ << " for key:" << static_cast<int32_t>(key));
+}
+
+int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
+ uint32_t key, uint32_t *app_id, std::list<int32_t> *sessions_list,
+ uint32_t *device_id) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::GetDataOnSessionKey");
+
+ int32_t result = -1;
+ transport_manager::ConnectionUID conn_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(key, &conn_handle, &session_id);
+ ConnectionList::iterator it = connection_list_.find(conn_handle);
+
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ return result;
+ }
+
+ Connection &connection = *it->second;
+ if (device_id) {
+ *device_id = connection.connection_device_handle();
+ }
+
+ if (sessions_list) {
+ sessions_list->clear();
+ }
+
+ if (0 == session_id) {
+ LOG4CXX_WARN(
+ logger_,
+ "No sessions in connection " << static_cast<int32_t>(conn_handle));
+ if (app_id) {
+ *app_id = 0;
+ }
+ } else {
+ if (app_id) {
+ *app_id = KeyFromPair(conn_handle, session_id);
+ }
+
+ LOG4CXX_INFO(logger_, "Connection "
+ << static_cast<int32_t>(conn_handle)
+ << " has " << connection.session_map().size()
+ << " sessions.");
+
+ if (sessions_list) {
+ const SessionMap session_map = connection.session_map();
+ for (SessionMap::const_iterator session_it = session_map.begin();
+ session_map.end() != session_it; ++session_it) {
+ sessions_list->push_back(KeyFromPair(conn_handle, it->first));
+ }
+ }
+
+ result = 0;
+ }
+
+ return result;
+}
+
+struct CompareMAC {
+ explicit CompareMAC(const std::string &mac) : mac_(mac) {}
+ bool operator() (const DeviceMap::value_type &device) {
+ return strcasecmp(device.second.mac_address().c_str(), mac_.c_str()) == 0;
+ }
+ private:
+ std::string mac_;
+};
+
+bool ConnectionHandlerImpl::GetDeviceID(const std::string &mac_address,
+ DeviceHandle *device_handle) {
+ DeviceMap::const_iterator it = std::find_if(device_list_.begin(),
+ device_list_.end(),
+ CompareMAC(mac_address));
+ if (it != device_list_.end()) {
+ if (device_handle) {
+ *device_handle = it->first;
+ }
+ return true;
+ }
+ return false;
+}
+
+int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
+ DeviceHandle device_handle,
+ std::string *device_name,
+ std::list<uint32_t> *applications_list, std::string *mac_address,
+ std::string* connection_type ) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::GetDataOnDeviceID");
+
+ int32_t result = -1;
+ DeviceMap::iterator it = device_list_.find(device_handle);
+ if (device_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Device not found!");
+ return result;
+ }
+
+ if (device_name) {
+ *device_name = it->second.user_friendly_name();
+ }
+ if (connection_type) {
+ *connection_type = it->second.connection_type();
+ }
+ if (applications_list) {
+ applications_list->clear();
+ sync_primitives::AutoLock connection_list_lock(connection_list_lock_);
+ for (ConnectionList::iterator itr = connection_list_.begin();
+ itr != connection_list_.end(); ++itr) {
+ if (device_handle == (*itr).second->connection_device_handle()) {
+ const SessionMap &session_map = (itr->second)->session_map();
+ for (SessionMap::const_iterator session_it = session_map.begin();
+ session_map.end() != session_it; ++session_it) {
+ const transport_manager::ConnectionUID &connection_handle = itr->first;
+ const uint32_t session_id = session_it->first;
+ const uint32_t application_id = KeyFromPair(connection_handle, session_id);
+ applications_list->push_back(application_id);
+ }
+ }
+ }
+ }
+
+ if (mac_address) {
+ *mac_address = it->second.mac_address();
+ }
+
+ result = 0;
+
+ return result;
+}
+#ifdef ENABLE_SECURITY
+int ConnectionHandlerImpl::SetSSLContext(
+ const uint32_t &key, security_manager::SSLContext *context) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::SetSSLContext");
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(key, &connection_handle, &session_id);
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ return security_manager::SecurityManager::ERROR_INTERNAL;
+ }
+ Connection &connection = *it->second;
+ return connection.SetSSLContext(session_id, context);
+}
+
+security_manager::SSLContext *ConnectionHandlerImpl::GetSSLContext(
+ const uint32_t &key, const protocol_handler::ServiceType &service_type) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::GetSSLContext");
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(key, &connection_handle, &session_id);
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ return NULL;
+ }
+ Connection &connection = *it->second;
+ return connection.GetSSLContext(session_id, service_type);
+}
+
+void ConnectionHandlerImpl::SetProtectionFlag(
+ const uint32_t &key, const protocol_handler::ServiceType &service_type) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::SetProtectionFlag");
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(key, &connection_handle, &session_id);
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ return;
+ }
+ Connection &connection = *it->second;
+ connection.SetProtectionFlag(session_id, service_type);
+}
+#endif // ENABLE_SECURITY
+
+void ConnectionHandlerImpl::StartDevicesDiscovery() {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::StartDevicesDiscovery()");
+
+ if (NULL == transport_manager_) {
+ LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
+ return;
+ }
+ transport_manager_->SearchDevices();
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ }
+}
+
+void ConnectionHandlerImpl::ConnectToDevice(
+ connection_handler::DeviceHandle device_handle) {
+ connection_handler::DeviceMap::const_iterator it_in;
+ it_in = device_list_.find(device_handle);
+ if (device_list_.end() != it_in) {
+ LOG4CXX_INFO_EXT(logger_,
+ "Connecting to device with handle " << device_handle);
+ if (transport_manager_) {
+ if (transport_manager::E_SUCCESS
+ != transport_manager_->ConnectDevice(device_handle)) {
+ LOG4CXX_WARN(logger_, "Can't connect to device");
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
+ }
+ } else {
+ LOG4CXX_ERROR(
+ logger_, "Application Manager wanted to connect to non-existing device");
+ }
+}
+
+void ConnectionHandlerImpl::ConnectToAllDevices() {
+ for (DeviceMap::iterator i = device_list_.begin(); i != device_list_.end(); ++i) {
+ connection_handler::DeviceHandle device_handle = i->first;
+ ConnectToDevice(device_handle);
+ }
+}
+
+void ConnectionHandlerImpl::StartTransportManager() {
+ LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::StartTransportManager()");
+ if (NULL == transport_manager_) {
+ LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
+ return;
+ }
+
+ transport_manager_->Visibility(true);
+}
+
+void ConnectionHandlerImpl::CloseRevokedConnection(uint32_t connection_key) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::CloseRevokedConnection");
+
+ uint32_t connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ CloseConnection(connection_handle);
+}
+
+void ConnectionHandlerImpl::CloseConnection(
+ ConnectionHandle connection_handle) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::CloseConnection");
+ if (!transport_manager_) {
+ LOG4CXX_ERROR(logger_, "Null pointer to TransportManager.");
+ return;
+ }
+ transport_manager::ConnectionUID connection_uid =
+ ConnectionUIDFromHandle(connection_handle);
+ transport_manager_->DisconnectForce(connection_uid);
+}
+
+uint32_t ConnectionHandlerImpl::GetConnectionSessionsCount(
+ uint32_t connection_key) {
+ uint32_t connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator itr = connection_list_.find(connection_handle);
+
+ if (connection_list_.end() != itr) {
+ return itr->second->session_map().size();
+ }
+
+ return 0;
+}
+
+void ConnectionHandlerImpl::CloseSession(uint32_t key) {
+ LOG4CXX_TRACE(logger_, "ConnectionHandlerImpl::CloseSession");
+
+ uint32_t connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(key, &connection_handle, &session_id);
+
+ CloseSession(connection_handle, session_id);
+}
+
+void ConnectionHandlerImpl::CloseSession(ConnectionHandle connection_handle,
+ uint8_t session_id) {
+ if (protocol_handler_) {
+ protocol_handler_->SendEndSession(connection_handle, session_id);
+ }
+
+ transport_manager::ConnectionUID connection_id =
+ ConnectionUIDFromHandle(connection_handle);
+
+ sync_primitives::AutoLock connection_list_lock(connection_list_lock_);
+ ConnectionList::iterator itr = connection_list_.find(connection_id);
+
+ if (connection_list_.end() != itr) {
+ if (connection_handler_observer_) {
+ SessionMap session_map = itr->second->session_map();
+ SessionMap::iterator session_it = session_map.find(session_id);
+ if (session_it != session_map.end()) {
+ const Session &session = session_it->second;
+ const ServiceList &service_list = session.service_list;
+ ServiceList::const_iterator it = service_list.begin();
+ for (;it != service_list.end(); ++it) {
+ const uint32_t session_key = KeyFromPair(connection_id, session_id);
+ const protocol_handler::ServiceType service_type = it->service_type;
+ connection_handler_observer_->OnServiceEndedCallback(session_key,
+ service_type);
+ }
+ }
+ }
+ itr->second->RemoveSession(session_id);
+ }
+}
+
+void ConnectionHandlerImpl::StartSessionHeartBeat(uint32_t connection_key) {
+ uint32_t connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() != it) {
+ it->second->StartHeartBeat(session_id);
+ }
+}
+
+void ConnectionHandlerImpl::SetHeartBeatTimeout(uint32_t connection_key,
+ int32_t timeout) {
+ uint32_t connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() != it) {
+ it->second->SetHeartBeatTimeout(timeout);
+ }
+}
+
+void ConnectionHandlerImpl::SendHeartBeat(ConnectionHandle connection_handle,
+ uint8_t session_id) {
+ transport_manager::ConnectionUID connection_uid =
+ ConnectionUIDFromHandle(connection_handle);
+ if (protocol_handler_) {
+ protocol_handler_->SendHeartBeat(connection_uid, session_id);
+ }
+}
+
+void ConnectionHandlerImpl::KeepConnectionAlive(uint32_t connection_key,
+ uint8_t session_id) {
+ sync_primitives::AutoLock lock(connection_list_lock_);
+
+ ConnectionList::iterator it = connection_list_.find(connection_key);
+ if (connection_list_.end() != it) {
+ it->second->KeepAlive(session_id);
+ }
+}
+
+void ConnectionHandlerImpl::OnConnectionEnded(
+ const transport_manager::ConnectionUID &connection_id) {
+ LOG4CXX_INFO(logger_, "Delete Connection: " << static_cast<int32_t>(connection_id)
+ << " from the list.");
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator itr = connection_list_.find(connection_id);
+ if (connection_list_.end() == itr) {
+ LOG4CXX_ERROR(logger_, "Connection not found!");
+ return;
+ }
+
+ if (connection_handler_observer_) {
+ const Connection *connection = itr->second;
+ const SessionMap session_map = connection->session_map();
+
+ for (SessionMap::const_iterator session_it = session_map.begin();
+ session_map.end() != session_it; ++session_it) {
+ const uint32_t session_key = KeyFromPair(connection_id, session_it->first);
+ const ServiceList &service_list = session_it->second.service_list;
+ for (ServiceList::const_iterator service_it = service_list.begin(), end =
+ service_list.end(); service_it != end; ++service_it) {
+ connection_handler_observer_->OnServiceEndedCallback(
+ session_key, service_it->service_type);
+ }
+ }
+ }
+ delete itr->second;
+ connection_list_.erase(itr);
+}
+
+void ConnectionHandlerImpl::BindProtocolVersionWithSession(
+ uint32_t connection_key, uint8_t protocol_version) {
+ LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::BindProtocolVersionWithSession()");
+ uint32_t connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() != it) {
+ it->second->UpdateProtocolVersionSession(session_id, protocol_version);
+ }
+}
+
+bool ConnectionHandlerImpl::IsHeartBeatSupported(
+ transport_manager::ConnectionUID connection_handle,uint8_t session_id) {
+ LOG4CXX_INFO(logger_, "ConnectionHandlerImpl::IsHeartBeatSupported()");
+ sync_primitives::AutoLock lock(connection_list_lock_);
+ uint32_t connection = static_cast<uint32_t>(connection_handle);
+ ConnectionList::iterator it = connection_list_.find(connection);
+ if (connection_list_.end() == it) {
+ LOG4CXX_WARN(logger_, "Connection not found !");
+ return false;
+ }
+ return it->second->SupportHeartBeat(session_id);
+}
+
+#ifdef BUILD_TESTS
+ConnectionList &ConnectionHandlerImpl::getConnectionList() {
+ return connection_list_;
+}
+
+void ConnectionHandlerImpl::addDeviceConnection(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id) {
+ // Add Device
+ OnDeviceAdded(device_info);
+ // Add connection
+ OnConnectionEstablished(device_info, connection_id);
+}
+#endif // BUILD_TESTS
+} // namespace connection_handler
diff --git a/src/components/connection_handler/src/device.cc b/src/components/connection_handler/src/device.cc
new file mode 100644
index 0000000000..93638bd370
--- /dev/null
+++ b/src/components/connection_handler/src/device.cc
@@ -0,0 +1,74 @@
+/**
+ * \file Device.cpp
+ * \brief Device class implementation.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "connection_handler/device.h"
+#include "encryption/hashing.h"
+#include "utils/logger.h"
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink ConnectionHandler namespace.
+ */
+namespace connection_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ConnectionHandler")
+
+Device::Device(DeviceHandle device_handle,
+ const std::string &user_friendly_name,
+ const std::string &mac_address, const std::string& connection_type)
+ : device_handle_(device_handle),
+ user_friendly_name_(user_friendly_name),
+ mac_address_(mac_address),
+ connection_type_(connection_type){
+ mac_address_ = encryption::MakeHash(mac_address);
+}
+
+DeviceHandle Device::device_handle() const {
+ return device_handle_;
+}
+
+std::string Device::user_friendly_name() const {
+ return user_friendly_name_;
+}
+
+std::string Device::mac_address() const {
+ return mac_address_;
+}
+
+std::string Device::connection_type() const {
+ return connection_type_;
+}
+
+} // namespace connection_handler
diff --git a/src/components/connection_handler/src/heartbeat_monitor.cc b/src/components/connection_handler/src/heartbeat_monitor.cc
new file mode 100644
index 0000000000..6a5a9e723e
--- /dev/null
+++ b/src/components/connection_handler/src/heartbeat_monitor.cc
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2013-2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "connection_handler/heartbeat_monitor.h"
+
+#include <unistd.h>
+
+#include "utils/logger.h"
+#include "connection_handler/connection.h"
+
+namespace connection_handler {
+
+using namespace sync_primitives;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HeartBeatMonitor")
+
+HeartBeatMonitor::HeartBeatMonitor(int32_t heartbeat_timeout_seconds,
+ Connection *connection)
+ : heartbeat_timeout_seconds_(heartbeat_timeout_seconds),
+ connection_(connection),
+ sessions_list_lock_(true),
+ run_(true) {
+}
+
+bool HeartBeatMonitor::HasTimeoutElapsed(const TimevalStruct& expiration) const {
+ TimevalStruct now = date_time::DateTime::getCurrentTime();
+ return date_time::DateTime::Greater(now, expiration);
+}
+
+void HeartBeatMonitor::Process() {
+ AutoLock auto_lock(sessions_list_lock_);
+
+ SessionMap::iterator it = sessions_.begin();
+ while (it != sessions_.end()) {
+ SessionState &state = it->second;
+ if (HasTimeoutElapsed(state.heartbeat_expiration)) {
+ const uint8_t session_id = it->first;
+ if (state.is_heartbeat_sent) {
+ LOG4CXX_DEBUG(logger_,
+ "Session with id " << static_cast<int32_t>(session_id) << " timed out, closing");
+ connection_->CloseSession(session_id);
+ it = sessions_.begin();
+ continue;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Send heart beat into session with id " << static_cast<int32_t>(session_id));
+ RefreshExpiration(&state.heartbeat_expiration);
+ connection_->SendHeartBeat(it->first);
+ state.is_heartbeat_sent = true;
+ }
+ }
+
+ ++it;
+ }
+}
+
+void HeartBeatMonitor::RefreshExpiration(TimevalStruct* expiration) const {
+ LOG4CXX_TRACE_ENTER(logger_);
+ sync_primitives::AutoLock locker(heartbeat_timeout_seconds_lock_);
+ DCHECK(expiration);
+ *expiration = date_time::DateTime::getCurrentTime();
+ expiration->tv_sec += heartbeat_timeout_seconds_;
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void HeartBeatMonitor::threadMain() {
+ AutoLock main_lock(main_thread_lock_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Start heart beat monitor. Timeout is " << heartbeat_timeout_seconds_);
+ while (run_) {
+ usleep(kDefaultCycleTimeout);
+ Process();
+ }
+}
+
+void HeartBeatMonitor::AddSession(uint8_t session_id) {
+ LOG4CXX_DEBUG(logger_, "Add session with id " << static_cast<int32_t>(session_id));
+ AutoLock auto_lock(sessions_list_lock_);
+ if (sessions_.end() != sessions_.find(session_id)) {
+ LOG4CXX_WARN(
+ logger_,
+ "Session with id " << static_cast<int32_t>(session_id) << " already exists");
+ return;
+ }
+ SessionState session_state;
+ RefreshExpiration(&session_state.heartbeat_expiration);
+ session_state.is_heartbeat_sent = false;
+ sessions_[session_id] = session_state;
+
+ LOG4CXX_INFO(
+ logger_,
+ "Start heartbeat for session " << static_cast<int32_t>(session_id));
+}
+
+void HeartBeatMonitor::RemoveSession(uint8_t session_id) {
+ AutoLock auto_lock(sessions_list_lock_);
+
+ if (sessions_.end() != sessions_.find(session_id)) {
+ LOG4CXX_INFO(logger_,
+ "Remove session with id " << static_cast<int32_t>(session_id));
+ sessions_.erase(session_id);
+ }
+}
+
+void HeartBeatMonitor::KeepAlive(uint8_t session_id) {
+ AutoLock auto_lock(sessions_list_lock_);
+
+ if (sessions_.end() != sessions_.find(session_id)) {
+ LOG4CXX_INFO(
+ logger_,
+ "Resetting heart beat timer for session with id " << static_cast<int32_t>(session_id));
+
+ RefreshExpiration(&sessions_[session_id].heartbeat_expiration);
+ sessions_[session_id].is_heartbeat_sent = false;
+ }
+}
+
+bool HeartBeatMonitor::exitThreadMain() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ run_ = false;
+ AutoLock main_lock(main_thread_lock_);
+ LOG4CXX_TRACE_EXIT(logger_);
+ return true;
+}
+
+void HeartBeatMonitor::set_heartbeat_timeout_seconds(int32_t timeout) {
+ LOG4CXX_DEBUG(logger_, "Set new heart beat timeout " << timeout);
+ {
+ AutoLock locker(heartbeat_timeout_seconds_lock_);
+ heartbeat_timeout_seconds_ = timeout;
+ }
+
+ AutoLock session_locker(sessions_list_lock_);
+ for (SessionMap::iterator i = sessions_.begin(); i != sessions_.end(); ++i) {
+ SessionState& session_state = i->second;
+ RefreshExpiration(&session_state.heartbeat_expiration);
+ }
+}
+
+} // namespace connection_handler
diff --git a/src/components/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt
new file mode 100644
index 0000000000..0bea8025e1
--- /dev/null
+++ b/src/components/dbus/CMakeLists.txt
@@ -0,0 +1,45 @@
+include_directories (
+ ${DBUS_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/
+ ${CMAKE_SOURCE_DIR}/
+ ${CMAKE_SOURCE_DIR}/src/components/
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${CMAKE_SOURCE_DIR}/src/components/formatters/include/
+ ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include/
+)
+
+set (SOURCES
+ ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_adapter.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_message.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_message_controller.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/schema.cc
+)
+
+set (LIBRARIES dbus-1 -L${DBUS_LIBS_DIRECTORY})
+
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
+ COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
+ --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
+ --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
+)
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
+ COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
+ --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
+ --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
+)
+
+add_library("DBus" ${SOURCES})
+ADD_DEPENDENCIES("DBus" Utils install-3rd_party_dbus)
+
+target_link_libraries("DBus" "${LIBRARIES}")
diff --git a/src/components/dbus/codegen/code_formatter.py b/src/components/dbus/codegen/code_formatter.py
new file mode 100644
index 0000000000..c3eb1b7815
--- /dev/null
+++ b/src/components/dbus/codegen/code_formatter.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file code_formatter.py
+# @brief Utility that helps to manage indents in generated code
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+class CodeBlock:
+ indent = 0
+ def __init__(self, out):
+ self.out = out
+ if type(out) == file:
+ self.indent = 0
+ elif type(out) == CodeBlock:
+ self.indent = out.indent
+ def __enter__(self):
+ self.indent += 1
+ return self
+ def __exit__(self, exc_type, exc_value, traceback):
+ if self.indent >= 1:
+ self.indent -= 1
+ def write(self, s):
+ for string in s.splitlines(True):
+ self.out.write(' ' * self.indent + string)
+
+# vim: set ts=4 sw=4 et:
+
diff --git a/src/components/dbus/codegen/ford_xml_parser.py b/src/components/dbus/codegen/ford_xml_parser.py
new file mode 100644
index 0000000000..4f9f222d24
--- /dev/null
+++ b/src/components/dbus/codegen/ford_xml_parser.py
@@ -0,0 +1,231 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file ford_xml_parser.py
+# @brief Parser for HMI_API.xml
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from xml.etree import ElementTree
+from collections import OrderedDict
+
+node_name = '/com/ford/hmi'
+
+class ParamDesc:
+ pass
+
+class FordXmlParser:
+ def __init__(self, in_el_tree, interface_path=None):
+ self.interface_path = interface_path
+ self.el_tree = in_el_tree
+ self.find_enums()
+ self.find_structs()
+
+ def find_enums(self):
+ self.enums = dict()
+ for interface_el in self.el_tree.findall('interface'):
+ interface_name = interface_el.get('name')
+ for enum_el in interface_el.findall('enum'):
+ enum_name = enum_el.get('name')
+ self.enums[(interface_name,enum_name)] = enum_el
+
+
+ def make_param_desc(self, param_el, iface=None):
+ param_desc = ParamDesc()
+ param_desc.name = param_el.get('name')
+ param_desc.type = param_el.get('type')
+ param_desc.enum = False
+ param_desc.struct = False
+ param_desc.fulltype = param_desc.type
+ if param_el.get('mandatory') == 'false':
+ param_desc.mandatory = False
+ else:
+ param_desc.mandatory = True
+ if param_el.get('array') == 'true':
+ param_desc.array = True
+ else:
+ param_desc.array = False
+ param_desc.minValue = param_el.get('minvalue') if param_el.get('minvalue') else 0
+ param_desc.maxValue = param_el.get('maxvalue')
+ param_desc.minLength = param_el.get('minlength') if param_el.get('minlength') else 0
+ param_desc.maxLength = param_el.get('maxlength')
+ param_desc.minSize = param_el.get('minsize')
+ param_desc.maxSize = param_el.get('maxsize')
+
+ param_desc.restricted = param_desc.minValue != None or \
+ param_desc.maxValue != None or \
+ param_desc.minLength > 0 or \
+ param_desc.maxLength > 0
+ param_desc.restrictedArray = param_desc.array and (param_desc.minSize > 0 or param_desc.maxSize > 0)
+ if iface is None:
+ return param_desc
+ if param_desc.type not in ['Integer', 'String', 'Boolean', 'Float']:
+ param_type = param_desc.type.split('.')
+ if len(param_type) > 1:
+ param_type = (param_type[0], param_type[1])
+ else:
+ param_type = (iface, param_type[0])
+ param_desc.fulltype = param_type
+ if param_type in self.enums: param_desc.enum = True
+ elif param_type in self.structs: param_desc.struct = True
+ return param_desc
+
+
+ def find_structs(self):
+ self.structs = OrderedDict()
+ for interface_el in self.el_tree.findall('interface'):
+ interface_name = interface_el.get('name')
+ for struct_el in interface_el.findall('struct'):
+ struct_name = struct_el.get('name')
+ self.structs[(interface_name, struct_name)] = []
+
+ for interface_el in self.el_tree.findall('interface'):
+ interface_name = interface_el.get('name')
+ for struct_el in interface_el.findall('struct'):
+ struct_name = struct_el.get('name')
+ for param_el in struct_el.findall('param'):
+ param_desc = self.make_param_desc(param_el, interface_name)
+ self.structs[(interface_name, struct_name)].append(param_desc)
+
+
+ def convert_struct_to_dbus(self, param_type):
+ ret = '('
+ struct = self.structs[param_type]
+ for param in struct:
+ ret = ret + self.convert_to_dbus_type(param)
+ ret = ret + ')'
+ return ret
+
+
+ def convert_to_dbus_type(self, param):
+ if param.type == 'Integer': restype = 'i'
+ elif param.type == 'String': restype = 's'
+ elif param.type == 'Boolean': restype = 'b'
+ elif param.type == 'Float': restype = 'd' # D-Bus double
+ elif param.enum: restype = 'i' # D-Bus 32-bit signed int
+ elif param.struct: restype = self.convert_struct_to_dbus(param.fulltype)
+ else: raise RuntimeError('Unknown type: ' + param.type)
+ if param.array: restype = 'a' + restype
+ if not param.mandatory: restype = '(b' + restype + ')'
+ return restype
+
+
+ def find_notifications(self, interface_el):
+ notifications = list()
+ for function_el in interface_el.findall('function[@messagetype="notification"]'):
+ notifications.append(function_el)
+ return notifications
+
+
+ def find_notifications_by_provider(self, interface_el, provider):
+ notifications = list()
+ condition = 'function[@messagetype="notification"][@provider="%s"]' % provider
+ for function_el in interface_el.findall(condition):
+ notifications.append(function_el)
+ return notifications
+
+
+ def find_request_response_pairs(self, interface_el):
+ result = list()
+ request_els = interface_el.findall('function[@messagetype="request"]')
+ response_els = interface_el.findall('function[@messagetype="response"]')
+ for request_el in request_els:
+ name = request_el.get('name')
+ response_el = next(r for r in response_els if r.get('name') == name)
+ result.append((request_el, response_el))
+ return result
+
+
+ def find_request_response_pairs_by_provider(self, interface_el, provider):
+ result = list()
+ condition = 'function[@messagetype="request"][@provider="%s"]' % provider
+ request_els = interface_el.findall(condition)
+ response_els = interface_el.findall('function[@messagetype="response"]')
+ for request_el in request_els:
+ name = request_el.get('name')
+ response_el = next(r for r in response_els if r.get('name') == name)
+ result.append((request_el, response_el))
+ return result
+
+
+ def convert_to_signal(self, notification_el, interface):
+ result = ElementTree.Element('signal')
+ result.set('name', notification_el.get('name'))
+ for param_el in notification_el.findall('param'):
+ self.create_arg_element(result, param_el, interface)
+ return result
+
+
+ def convert_to_method(self, (request_el, response_el), interface):
+ result = ElementTree.Element('method')
+ result.set('name', request_el.get('name'))
+ for param_el in request_el.findall('param'):
+ arg_el = self.create_arg_element(result, param_el, interface)
+ arg_el.set('direction', 'in')
+
+ arg_el = ElementTree.SubElement(result, 'arg')
+ arg_el.set('name', 'retCode')
+ arg_el.set('type', 'i')
+ arg_el.set('direction', 'out')
+
+ for param_el in response_el.findall('param'):
+ arg_el = self.create_arg_element(result, param_el, interface)
+ arg_el.set('direction', 'out')
+ return result
+
+
+ def create_arg_element(self, parent, param_el, interface):
+ arg_el = ElementTree.SubElement(parent, 'arg')
+ arg_el.set('name', param_el.get('name'))
+ arg_el.set('type', self.convert_to_dbus_type(self.make_param_desc(param_el, interface)))
+ return arg_el
+
+
+ def create_introspection_iface_el(self, interface_el, provider):
+ interface = interface_el.get('name')
+ interface_name = self.interface_path + '.' + interface
+
+ notifications = self.find_notifications_by_provider(interface_el, provider)
+ signals = [self.convert_to_signal(n, interface) for n in notifications]
+
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, provider)
+ methods = [self.convert_to_method(r, interface) for r in request_responses]
+
+ if signals or methods:
+ el = ElementTree.Element('interface', attrib={'name':interface_name})
+ for m in methods: el.append(m)
+ for s in signals: el.append(s)
+ return el
+
+
+
diff --git a/src/components/dbus/codegen/make_hmi_requests.py b/src/components/dbus/codegen/make_hmi_requests.py
new file mode 100755
index 0000000000..4716d40439
--- /dev/null
+++ b/src/components/dbus/codegen/make_hmi_requests.py
@@ -0,0 +1,343 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_qml_dbus_cpp.py
+# @brief Generator of QML to QDbus C++ part
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2014, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+import os.path
+from sys import argv
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser, ParamDesc
+from code_formatter import CodeBlock
+
+prefix_class_item = 'Declarative'
+invoke_type_connection = 'Direct'
+
+def defaultValue(param):
+ if param.type == "Integer":
+ return "0"
+ elif param.type == "Float":
+ return "0.0"
+ elif param.type == "Boolean":
+ return "false"
+ elif param.enum:
+ return "0"
+
+class Impl(FordXmlParser):
+ def make_requests_classes_header(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
+ for (request, response) in request_responses:
+ request_full_name = interface_el.get('name') + '_' +request.get('name')
+ out.write('class ' + request_full_name + ': public HMIRequest {\n')
+ with CodeBlock(out) as output:
+ output.write('Q_OBJECT\n')
+ out.write(' public:\n')
+ with CodeBlock(out) as output:
+ output.write(request_full_name + '(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name):\n')
+ output.write(' HMIRequest(hmi_callback, interface, args, name) {}\n')
+ out.write(' private:\n')
+ with CodeBlock(out) as output:
+ output.write('QJSValueList fillArgsList();\n};\n\n')
+
+
+ def make_header_file(self, out):
+ out.write("namespace requests {\n")
+ out.write("class HMIRequest: public QObject {\n")
+ with CodeBlock(out) as output:
+ output.write('Q_OBJECT\n')
+ out.write('public:\n')
+ with CodeBlock(out) as output:
+ output.write('HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name );\n')
+ out.write('protected:\n')
+ with CodeBlock(out) as output:
+ output.write('virtual QJSValueList fillArgsList() = 0;\n')
+ output.write('QDBusPendingCallWatcher *watcher_;\n')
+ output.write('QJSValue hmi_callback_;\n\n')
+ output.write('template<typename T>\n')
+ output.write('QJSValue CreateQJSValue(T value) {\n')
+ output.write(' return QJSValue(value);\n')
+ output.write('}\n\n')
+ output.write('template<typename T>\n')
+ output.write('QJSValue CreateQJSValue(QList<T> value) {\n')
+ with CodeBlock(output) as output:
+ output.write('QJSValue array = hmi_callback_.engine()->newArray();\n')
+ output.write('int i = 0;\n')
+ output.write('foreach (T item, value) {\n')
+ output.write(' QJSValue value = CreateQJSValue(item);\n')
+ output.write(' array.setProperty(i, value);\n')
+ output.write(' ++i;\n')
+ output.write('}\n')
+ output.write('return array;\n')
+ output.write('}\n')
+ out.write('private:\n')
+ with CodeBlock(out) as output:
+ output.write('QDBusInterface *interface_;\n')
+ output.write('QList<QVariant> args_;\n')
+ out.write('public slots:\n')
+ with CodeBlock(out) as output:
+ output.write('void invokeCallback();\n')
+ out.write('};\n\n')
+ output.write('template<>\n')
+ output.write('QJSValue HMIRequest::CreateQJSValue(QStringList value);\n')
+ for (interface_name, struct_name) in self.structs:
+ out.write('template<>\n')
+ out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_name + ' value);\n\n')
+ impl.make_requests_classes_header(out)
+ out.write("} // namespace requests\n")
+
+
+ def qt_param_type(self, param):
+ if not param.mandatory:
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
+ if param.array:
+ param_copy = copy(param)
+ param_copy.array = False
+ if param.type == 'String':
+ return "QStringList"
+ return "QList< " + self.qt_param_type(param_copy) + " >"
+ if param.type == 'Integer' or param.enum:
+ return 'int'
+ elif param.type == 'String':
+ return 'QString'
+ elif param.type == 'Boolean':
+ return 'bool'
+ elif param.type == 'Float':
+ return 'double'
+ elif param.struct:
+ return "_".join(param.fulltype)
+ return "xxx"
+
+
+ def make_requests_methods_source(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
+ for (request, response) in request_responses:
+ iface_name = interface_el.get('name')
+ request_full_name = iface_name + '_' +request.get('name')
+ out.write('QJSValueList ' + request_full_name + '::fillArgsList() {\n')
+ out.write(' QDBusPendingReply< ')
+ count = 0
+ for param_el in response.findall('param'):
+ param = self.make_param_desc(param_el, iface_name)
+ out.write(self.qt_param_type(param))
+ count += 1
+ if count < len(response.findall('param')):
+ out.write(',')
+ out.write(' > reply = *watcher_;\n')
+
+ with CodeBlock(out) as out:
+ out.write('QJSValueList qjsValueList;\n\n')
+ out.write('QJSValue param;\n\n')
+ count = 0
+ for param_el in response.findall('param'):
+ if param_el.get('mandatory') == 'false':
+ out.write('if (reply.argumentAt<' + str(count) + '>().presence) {\n')
+ out.write(' param = CreateQJSValue(reply.argumentAt<' + str(count) + '>().val);\n')
+ out.write('} else {\n')
+ out.write(' param = QJSValue();\n')
+ out.write('}\n')
+ out.write('qjsValueList.append(param);\n')
+ else:
+ out.write('param = CreateQJSValue(reply.argumentAt<' + str(count) + '>());\n')
+ out.write('qjsValueList.append(param);\n')
+ count += 1
+ out.write('return qjsValueList;\n')
+ out.write('}\n\n')
+
+
+ def make_source_file(self, out):
+ out.write("namespace requests {\n")
+ for interface_el in self.el_tree.findall('interface'):
+ for struct_el in interface_el.findall('struct'):
+ out.write('template<>\n')
+ out.write('QJSValue HMIRequest::CreateQJSValue(Common_' + struct_el.get('name') + ' value){\n')
+ with CodeBlock(out) as output:
+ output.write('QJSValue object = hmi_callback_.engine()->newObject();\n')
+ for param_el in struct_el.findall('param'):
+ param_name = param_el.get('name')
+ if param_el.get('mandatory') == 'true':
+ with CodeBlock(out) as output:
+ output.write('object.setProperty("' + param_name + '", CreateQJSValue(value.' + param_name + '));\n')
+ elif param_el.get('mandatory') == 'false':
+ with CodeBlock(out) as output:
+ output.write('object.setProperty("' + param_name + '", value.' + param_name + '.presence ? CreateQJSValue(value.' + param_name + '.val) : QJSValue());\n')
+ out.write('return object;\n')
+ out.write('}\n\n')
+
+
+ out.write('HMIRequest::HMIRequest(QJSValue hmi_callback, QDBusInterface *interface, QList<QVariant> args, QString name) :\n')
+ out.write(' hmi_callback_(hmi_callback), interface_(interface), args_(args) {\n')
+ with CodeBlock(out) as output:
+ output.write('QDBusPendingCall pcall = interface->asyncCallWithArgumentList(name, args);\n')
+ output.write('watcher_ = new QDBusPendingCallWatcher(pcall);\n')
+ output.write('QObject::connect(watcher_, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(invokeCallback()));\n}\n\n')
+ out.write('void HMIRequest::invokeCallback() {\n')
+ with CodeBlock(out) as output:
+ output.write('if (!hmi_callback_.isUndefined()) {\n')
+ with CodeBlock(output) as output:
+ output.write('QJSValueList qjsValueList;\n')
+ output.write('qjsValueList = this->fillArgsList();\n')
+ output.write('hmi_callback_.call(qjsValueList);\n')
+ output.write('}\n')
+ output.write('watcher_->deleteLater();\n')
+ output.write('this->deleteLater();\n}\n\n')
+ impl.make_requests_methods_source(out)
+ out.write("} // namespace requests\n")
+
+
+arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
+args = arg_parser.parse_args()
+
+if args.version == "4.8.5":
+ prefix_class_item = 'Declarative'
+ invoke_type_connection = 'Direct'
+elif args.version == "5.1.0":
+ prefix_class_item = 'Quick'
+ invoke_type_connection = 'BlockingQueued'
+
+header_name = 'hmi_requests.h'
+source_name = 'hmi_requests.cc'
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
+
+header_out = open(args.outdir + '/' + header_name, "w")
+source_out = open(args.outdir + '/' + source_name, "w")
+
+header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+header_out.write("""/**
+ * @file hmi_requests.h
+ * @brief Generated class that process requests from qtHMI
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2014, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
+header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n\n");
+header_out.write("#include <QObject>\n");
+header_out.write("#include <QJSValue>\n");
+header_out.write("#include <QDBusPendingCall>\n");
+header_out.write("#include <QDBusPendingCallWatcher>\n");
+header_out.write('#include <QDBusPendingReply>\n');
+header_out.write("#include <QDBusAbstractInterface>\n");
+header_out.write("#include <QDBusInterface>\n");
+header_out.write("#include <QJSEngine>\n");
+
+header_out.write('#include "qml_dbus.h"\n\n');
+
+impl.make_header_file(header_out)
+
+header_out.write("#endif // SRC_COMPONENTS_QTHMI_QMLMODELQT5_HMIREQUESTS_\n");
+
+source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+source_out.write("""/**
+ * @file hmi_requests.cc
+ * @brief Generated class that process requests from qtHMI
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2014, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+source_out.write('#include "hmi_requests.h"\n\n')
+impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_introspection_c.py b/src/components/dbus/codegen/make_introspection_c.py
new file mode 100755
index 0000000000..22a53f308d
--- /dev/null
+++ b/src/components/dbus/codegen/make_introspection_c.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_introspection_c.py
+# @brief Converts introspection.xml to C-string
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+from ford_xml_parser import FordXmlParser
+from ford_xml_parser import node_name
+from xml.etree import ElementTree
+from os import path
+from sys import argv
+
+class Impl(FordXmlParser):
+ def convert_to_introspection(self, out_el_tree):
+ for interface_el in self.el_tree.findall('interface'):
+ el = self.create_introspection_iface_el(interface_el, 'sdl')
+ if el is not None:
+ out_el_tree.append(el)
+
+arg_parser = ArgumentParser(description='Converts introspection.xml to C-string')
+arg_parser.add_argument('--infile', required=True, help="Full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--outdir', required=True, help="Path to directory where output file introspection_xml.cc will be saved")
+args = arg_parser.parse_args()
+
+if not path.isdir(args.outdir):
+ makedirs(args.outdir)
+
+out_file = open(args.outdir + '/' + 'introspection_xml.cc', "w")
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+out_tree_root = ElementTree.Element('node', attrib={'name':node_name})
+
+impl = Impl(in_tree_root, 'com.ford.hmi.sdl')
+impl.convert_to_introspection(out_tree_root)
+
+introspection_string = '<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">'
+introspection_string += "\n"
+introspection_string += ElementTree.tostring(out_tree_root)
+
+out_file.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+out_file.write("""/**
+ * @file instrospections_xml.cc
+ * @brief D-Bus introspection XML as C-string
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+
+out_file.write("char introspection_xml[] = {")
+
+cnt = 0
+for char in introspection_string:
+ if cnt % 12 == 0:
+ out_file.write("\n ")
+ else:
+ out_file.write(" ")
+ out_file.write("0x%02x," % ord(char))
+ cnt = cnt + 1
+
+out_file.write(" 0x00\n")
+out_file.write("};")
+
diff --git a/src/components/dbus/codegen/make_message_descriptions.py b/src/components/dbus/codegen/make_message_descriptions.py
new file mode 100755
index 0000000000..0079666392
--- /dev/null
+++ b/src/components/dbus/codegen/make_message_descriptions.py
@@ -0,0 +1,273 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_message_descriptions.py
+# @brief Generates HMI API message descriptions for D-Bus
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser
+from os import path
+from sys import argv
+
+namespace_name = 'ford_message_descriptions'
+namespace = namespace_name + '::'
+
+
+class Impl(FordXmlParser):
+ def write_param_definition(self, param_var_name, param, out):
+ if param.array:
+ tmp_param = copy(param)
+ tmp_param.array = False
+ tmp_param.mandatory = True
+ dbus_sig = self.convert_to_dbus_type(tmp_param)
+ self.write_param_definition(param_var_name + '_array', tmp_param, out)
+
+ if param.array: out.write('const ' + namespace + 'ArrayDescription ')
+ elif param.struct: out.write('const ' + namespace + 'StructDescription ')
+ else: out.write('const ' + namespace + 'ParameterDescription ')
+
+ out.write(param_var_name + " = {\n")
+
+ if param.struct or param.array:
+ out.write(" {\n")
+ shift = ' ' * 4
+ else:
+ shift = ' ' * 2
+
+ out.write(shift + "\"" + param.name + "\",\n")
+
+ if param.array:
+ out.write(shift + namespace + "Array,\n")
+ elif param.struct:
+ out.write(shift + namespace + "Struct,\n")
+ elif param.enum:
+ out.write(shift + namespace + "Enum,\n")
+ else:
+ out.write(shift + namespace + param.type + ",\n")
+
+ if param.mandatory:
+ out.write(shift + "true\n")
+ else:
+ out.write(shift + "false\n")
+
+ if param.struct or param.array:
+ out.write(" },\n")
+ if param.array:
+ out.write(" (const " + namespace + "ParameterDescription*)&" + param_var_name + "_array,\n")
+ out.write(" \"" + dbus_sig + "\"\n")
+ elif param.struct:
+ out.write(" Structs::" + param.fulltype[0] + "__" + param.fulltype[1] + "__parameters\n")
+ out.write("};\n")
+
+
+ def write_struct_params_declarations(self, out):
+ out.write("struct Structs {\n");
+ for (interface, name), params in self.structs.iteritems():
+ params_var_name = interface + '__' + name + '__parameters'
+ out.write(" static const " + namespace + "ParameterDescription* " + params_var_name + "[];\n")
+ out.write("};\n\n")
+
+
+ def write_enum_entries_declarations(self, out):
+ out.write("struct Enums {\n");
+ for interface, name in self.enums:
+ entries_var_name = interface + '__' + name + '__entries'
+ out.write(" static const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[];\n")
+ out.write("};\n\n")
+
+
+ def write_parameters(self, params, out, name):
+ n = 1
+ for param in params:
+ param_var_name = name + str(n)
+ n = n + 1
+ self.write_param_definition(param_var_name, param, out)
+
+
+ def write_struct_params_definitions(self, out):
+ for (interface, name), params in self.structs.iteritems():
+ param_var_name = interface + '__' + name + '__parameter'
+ self.write_parameters(params, out, param_var_name)
+ params_var_name = 'Structs::' + interface + '__' + name + '__parameters'
+ out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
+ for n in range(1, len(params) + 1):
+ name = param_var_name + str(n)
+ out.write(" (const " + namespace + "ParameterDescription*)&" + name + ",\n")
+ out.write( " NULL };\n\n")
+
+
+ def write_enum_entries_definitions(self, out):
+ for (interface, name), enum_el in self.enums.iteritems():
+ n = 1
+ for element_el in enum_el.findall('element'):
+ entry_var_name = interface + '__' + name + '__entry' + str(n)
+ value = element_el.get("value")
+ if value is None:
+ value = str(n)
+ out.write(namespace + "EnumDescription::Entry " + entry_var_name + " = {\"" + element_el.get("name") + "\", " + value + "};\n")
+ n = n + 1
+
+ entries_var_name = "Enums::" + interface + '__' + name + '__entries'
+ out.write("const " + namespace + "EnumDescription::Entry* " + entries_var_name + "[] = {\n")
+ for n in range(1, len(enum_el.findall('element')) + 1):
+ entry_var_name = interface + '__' + name + '__entry' + str(n)
+ out.write(" &" + entry_var_name + ",\n")
+ out.write(" NULL };\n\n")
+
+
+ def write_message_definition(self, message_el, interface, out):
+ name = message_el.get('name')
+ messagetype = message_el.get('messagetype')
+ params = list()
+ for param_el in message_el.findall('param'):
+ param_desc = self.make_param_desc(param_el, interface)
+ params.append(param_desc)
+ param_var_name = interface + '__' + name + '__' + messagetype + '__parameter'
+ self.write_parameters(params, out, param_var_name)
+
+ params_var_name = param_var_name + 's'
+ out.write("const " + namespace + "ParameterDescription* " + params_var_name + "[] = {\n")
+ for n in range(1, len(params) + 1):
+ param_name = param_var_name + str(n)
+ out.write(" (const " + namespace + "ParameterDescription*)&" + param_name + ",\n")
+ out.write(" NULL };\n")
+
+ message_desc_name = interface + '__' + name + '__' + messagetype
+ out.write("const " + namespace + "MessageDescription " + message_desc_name + " = {\n")
+ out.write(" \"" + interface + "\",\n")
+ out.write(" \"" + name + "\",\n")
+ out.write(" hmi_apis::messageType::" + messagetype + ",\n")
+ out.write(" hmi_apis::FunctionID::" + interface + "_" + name + ",\n")
+ out.write(" " + params_var_name + "\n")
+ out.write("};\n\n")
+
+
+ def write_message_definitions(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ interface = interface_el.get('name')
+ message_els = interface_el.findall('function')
+ for message_el in message_els:
+ self.write_message_definition(message_el, interface, out)
+
+
+ def make_message_descriptions(self, out):
+ self.write_struct_params_declarations(out)
+ #self.write_enum_entries_declarations(out)
+ self.write_struct_params_definitions(out)
+ #self.write_enum_entries_definitions(out)
+ self.write_message_definitions(out)
+
+
+ def make_message_array(self, out):
+ out.write("const MessageDescription* message_descriptions[] = {\n")
+ for interface_el in self.el_tree.findall('interface'):
+ interface = interface_el.get('name')
+ message_els = interface_el.findall('function')
+ for message_el in message_els:
+ name = message_el.get('name')
+ messagetype = message_el.get('messagetype')
+ message_desc_name = interface + '__' + name + '__' + messagetype
+ out.write(" &" + message_desc_name + ",\n")
+ out.write(" NULL\n")
+ out.write("};\n")
+
+
+arg_parser = ArgumentParser(description="Generates HMI API message descriptions for D-Bus on SDL core side")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output file message_descriptions.cc will be saved")
+args = arg_parser.parse_args()
+
+if not path.isdir(args.outdir):
+ makedirs(args.outdir)
+
+outfile = 'message_descriptions.cc'
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Impl(in_tree_root)
+
+out = open(args.outdir + "/" + outfile, "w")
+
+out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+out.write("""/**
+ * @file message_descriptions.cc
+ * @brief Generated HMI API message descriptions for D-Bus
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+
+out.write("#include \"dbus/message_descriptions.h\"\n\n");
+out.write("namespace {\n\n");
+impl.make_message_descriptions(out)
+out.write("}\n\n");
+
+out.write("namespace " + namespace_name + " {\n\n");
+impl.make_message_array(out)
+out.write("}\n\n");
+
diff --git a/src/components/dbus/codegen/make_notifications_qml.py b/src/components/dbus/codegen/make_notifications_qml.py
new file mode 100755
index 0000000000..3c173e8b4f
--- /dev/null
+++ b/src/components/dbus/codegen/make_notifications_qml.py
@@ -0,0 +1,387 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_qml_dbus_cpp.py
+# @brief Generator of QML to QDbus C++ part
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2014, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+import os.path
+from sys import argv
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser, ParamDesc
+from code_formatter import CodeBlock
+
+class Notifications_qml(FordXmlParser):
+ #Used for qt signal names, because qt signals cannot begin with a capital letter
+ def first_letter_to_lower_case(self, s):
+ if len(s) == 0:
+ return s
+ else:
+ return s[0].lower() + s[1:]
+
+ def make_header(self, out):
+ out.write("class SdlProxy: public Item {\n")
+ with CodeBlock(out) as out:
+ out.write("Q_OBJECT\n")
+ out.write("Q_DISABLE_COPY(SdlProxy)\n")
+ out.write("public:\n")
+ out.write("explicit SdlProxy(Item* parent = 0);\n")
+ out.write("private:\n")
+ out.write("QDBusInterface *sdlBasicCommunicationInterface;\n")
+ out.write("signals:\n")
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ notifications = self.find_notifications_by_provider(interface_el, "sdl")
+ for notification_el in notifications:
+ with CodeBlock(out) as out:
+ out.write("void %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
+ param_el_count = 1
+ list_of_params = notification_el.findall("param")
+ list_of_params_len = len(list_of_params)
+ for param_el in list_of_params:
+ param = self.make_param_desc(param_el, iface_name)
+ out.write("QVariant %s" % param_el.get("name"))
+ if param_el_count < list_of_params_len:
+ out.write(", ")
+ param_el_count += 1
+ out.write(");\n")
+ with CodeBlock(out) as out:
+ out.write("private slots:\n")
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ notifications = self.find_notifications_by_provider(interface_el, "sdl")
+ for notification_el in notifications:
+ with CodeBlock(out) as out:
+ out.write("void slot_%s(" % notification_el.get("name"))
+ param_el_count = 1
+ list_of_params = notification_el.findall("param")
+ list_of_params_len = len(list_of_params)
+ for param_el in list_of_params:
+ param = self.make_param_desc(param_el, iface_name)
+ out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
+ if param_el_count < list_of_params_len:
+ out.write(", ")
+ param_el_count += 1
+ out.write(");\n")
+ out.write("};\n")
+
+
+ def qt_param_type(self, param):
+ if not param.mandatory:
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
+ if param.array:
+ param_copy = copy(param)
+ param_copy.array = False
+ if param.type == 'String':
+ return "QStringList"
+ return "QList< " + self.qt_param_type(param_copy) + " >"
+ if param.type == 'Integer' or param.enum:
+ return 'int'
+ elif param.type == 'String':
+ return 'QString'
+ elif param.type == 'Boolean':
+ return 'bool'
+ elif param.type == 'Float':
+ return 'double'
+ elif param.struct:
+ return "_".join(param.fulltype)
+ else:
+ raise RuntimeError('Unknown type: ' + param.type)
+
+
+ def qml_param_type(self, param):
+ if not param.mandatory:
+ return "QVariant"
+ if param.array:
+ return "QVariant"
+ if param.type == 'Integer' or param.enum:
+ return 'int'
+ elif param.type == 'String':
+ return 'QString'
+ elif param.type == 'Boolean':
+ return 'bool'
+ elif param.type == 'Float':
+ return 'double'
+ elif param.struct:
+ return "QVariant"
+ else:
+ raise RuntimeError('Unknown type: ' + param.type)
+
+
+ def make_source(self, out):
+ def qml_args(variable_name_needed):
+ param_el_count = 1
+ list_of_params = notification_el.findall("param")
+ list_of_params_len = len(list_of_params)
+ for param_el in list_of_params:
+ param = self.make_param_desc(param_el, iface_name)
+ if variable_name_needed:
+ out.write("%s %s" % (self.qt_param_type(param), param_el.get("name")))
+ else:
+ out.write("%s" % self.qt_param_type(param))
+ if param_el_count < list_of_params_len:
+ out.write(", ")
+ param_el_count += 1
+ out.write("SdlProxy::SdlProxy(Item *parent): Item(parent) {\n")
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ notifications = self.find_notifications_by_provider(interface_el, "sdl")
+ for notification_el in notifications:
+ notification_name = notification_el.get('name')
+ with CodeBlock(out) as out:
+ out.write("QDBusConnection::sessionBus().connect(\n")
+ with CodeBlock(out) as out:
+ out.write("\"com.ford.sdl.core\", \"/\", \"com.ford.sdl.core.%s\",\n" % iface_name)
+ out.write("\"%s\", this, SLOT(slot_%s(" % (notification_name, notification_el.get("name")))
+ qml_args(variable_name_needed = False)
+ out.write(")));\n")
+ out.write("}\n\n")
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ notifications = self.find_notifications_by_provider(interface_el, "sdl")
+ for notification_el in notifications:
+ notific_full_name = interface_el.get("name") + "_" + notification_el.get("name")
+ out.write("void SdlProxy::slot_%s(" % notification_el.get("name"))
+ qml_args(variable_name_needed = True)
+ out.write(") {\n")
+ with CodeBlock(out) as out:
+ out.write("LOG4CXX_TRACE(logger_, \"ENTER\");\n\n")
+ for param_el in notification_el.findall("param"):
+ param = self.make_param_desc(param_el, iface_name)
+ tmp_param_name = param.name + "_qvariant"
+ out.write("QVariant %s;\n" % tmp_param_name)
+ out.write("%s = ValueToVariant(%s);\n" % (tmp_param_name, param.name))
+ self.write_param_validation(param, param.name, "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\")" % (param.name, notific_full_name), out)
+ out.write("\n")
+ out.write("emit %s(" % self.first_letter_to_lower_case( notification_el.get("name")) )
+ param_el_count = 1
+ list_of_params = notification_el.findall("param")
+ list_of_params_len = len(list_of_params)
+ for param_el in list_of_params:
+ param = self.make_param_desc(param_el, iface_name)
+ out.write("%s" % param.name + "_qvariant")
+ if param_el_count < list_of_params_len:
+ out.write(", ")
+ param_el_count += 1
+ out.write(");\n")
+ with CodeBlock(out) as out:
+ out.write("LOG4CXX_TRACE(logger_, \"EXIT\");\n")
+ out.write("}\n\n")
+
+
+
+ def write_param_validation(self, param, param_name, fail_statement, out, level=0):
+ if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
+ out.write("if (%s.presence) {\n" % param_name)
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ with CodeBlock(out) as out:
+ self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
+ out.write("}\n")
+ elif param.array:
+ if param.minSize > 0:
+ out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
+ with CodeBlock(out) as out:
+ out.write("{0};\n".format(fail_statement))
+ out.write("}\n")
+ if param.maxSize != None:
+ out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
+ with CodeBlock(out) as out:
+ out.write("{0};\n".format(fail_statement))
+ out.write("}\n")
+ if param.restricted:
+ out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
+ with CodeBlock(out) as out:
+ param_copy = copy(param)
+ param_copy.array = False
+ self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
+ out.write("}\n")
+ elif param.struct:
+ for p in self.structs[param.fulltype]:
+ self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
+ elif param.type == "Integer" or param.type == "Float":
+ conditions = []
+ if (param.minValue != None):
+ conditions.append("(%s < %s)" % (param_name, param.minValue))
+ if (param.maxValue != None):
+ conditions.append("(%s > %s)" % (param_name, param.maxValue))
+ if conditions:
+ out.write('if (%s) {' % ' || '.join(conditions))
+ with CodeBlock(out) as out:
+ out.write('%s;\n' % fail_statement)
+ out.write("}\n")
+ elif param.type == "String":
+ conditions = []
+ if (param.minLength > 0):
+ conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
+ if (param.maxLength > 0):
+ conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
+ if conditions:
+ out.write('if (%s) {' % ' || '.join(conditions))
+ with CodeBlock(out) as out:
+ out.write('%s;\n' % (fail_statement))
+ out.write("}\n")
+
+
+#QVarian name;
+#if (ttsName.presence) {
+
+
+
+arg_parser = ArgumentParser(description="Generator of classes which Qt to QDbus C++ part")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
+args = arg_parser.parse_args()
+
+
+if args.version == "4.8.5":
+ prefix_class_item = 'Script'
+ invoke_type_connection = 'Direct'
+elif args.version == "5.1.0":
+ prefix_class_item = 'JS'
+ invoke_type_connection = 'BlockingQueued'
+else:
+ prefix_class_item = 'JS'
+ invoke_type_connection = 'BlockingQueued'
+
+header_name = 'sdl_proxy.h'
+source_name = 'sdl_proxy.cc'
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Notifications_qml(in_tree_root, 'com.ford.sdl.hmi')
+
+header_out = open(args.outdir + '/' + header_name, "w")
+source_out = open(args.outdir + '/' + source_name, "w")
+
+header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+header_out.write("""
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+""")
+header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n")
+header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_SDL_PROXY_H_\n\n")
+header_out.write("#include \"qml_dbus.h\"\n")
+header_out.write("#include \"qt_version.h\"\n\n")
+header_out.write("#include <QtCore/QVariant>\n")
+header_out.write("#include <QtDBus/QDBusInterface>\n")
+header_out.write("#if QT_4\n")
+header_out.write("#include <QtDeclarative/QDeclarativeItem>\n")
+header_out.write("typedef QDeclarativeItem Item;\n")
+header_out.write("#elif QT_5\n")
+header_out.write("#include <QtQuick/QQuickItem>\n")
+header_out.write("typedef QQuickItem Item;\n")
+header_out.write("#endif // QT_VERSION\n")
+
+impl.make_header(header_out)
+
+header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
+
+
+source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+source_out.write("""
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+""")
+
+source_out.write("#include \"sdl_proxy.h\"\n")
+source_out.write("#include \"utils/logger.h\"\n")
+source_out.write("CREATE_LOGGERPTR_GLOBAL(logger_, \"DBusPlugin\")\n\n")
+
+impl.make_source(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_cpp.py b/src/components/dbus/codegen/make_qml_dbus_cpp.py
new file mode 100755
index 0000000000..f40bc74df8
--- /dev/null
+++ b/src/components/dbus/codegen/make_qml_dbus_cpp.py
@@ -0,0 +1,736 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_qml_dbus_cpp.py
+# @brief Generator of QML to QDbus C++ part
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+import os.path
+from sys import argv
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser, ParamDesc
+from code_formatter import CodeBlock
+
+prefix_class_item = 'Declarative'
+invoke_type_connection = 'Direct'
+
+def defaultValue(param):
+ if param.type == "Integer":
+ return "0"
+ elif param.type == "Float":
+ return "0.0"
+ elif param.type == "Boolean":
+ return "false"
+ elif param.enum:
+ return "0"
+
+class Impl(FordXmlParser):
+ def make_dbus_type_declarations(self, out):
+ for struct in self.structs.items():
+ self.write_struct_declaration(struct, out)
+
+ def make_dbus_metatype_declarations(self, out):
+ for struct in self.structs.items():
+ self.write_struct_metatype_declaration(struct, out)
+
+
+ def write_struct_declaration(self, ((iface, name), params), out):
+ struct_name = "{0}_{1}".format(iface, name)
+ out.write("struct {0} {{\n".format(struct_name))
+ with CodeBlock(out) as out:
+ for param in params:
+ out.write("{0} {1};\n".format(self.qt_param_type(param), param.name))
+ out.write("{0}()\n".format(struct_name))
+ initializersList = map(lambda x: "{0}({1})".format(x.name, defaultValue(x)), [p for p in params if p.type != "String" and not p.struct and not p.array])
+ if initializersList:
+ out.write(": " + ",\n ".join(initializersList))
+
+ out.write("{ }\n")
+
+ out.write("};\n")
+ out.write('QDBusArgument& operator << (QDBusArgument&, const ' + struct_name + "&);\n")
+ out.write('const QDBusArgument& operator >> (const QDBusArgument&, ' + struct_name + "&);\n")
+ out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v);\n")
+ out.write('QVariant ValueToVariant(const ' + struct_name + "& v);\n")
+ out.write('QVariant ValueToVariant(const QList<' + struct_name + " >& v);\n")
+ out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v);\n")
+ out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v);\n")
+ out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + " >& v);\n")
+
+
+ def write_struct_metatype_declaration(self, ((iface, name), params), out):
+ struct_name = iface + '_' + name
+ out.write('Q_DECLARE_METATYPE(' + struct_name + ")\n")
+ out.write('Q_DECLARE_METATYPE(OptionalArgument<' + struct_name + ">)\n")
+ out.write('Q_DECLARE_METATYPE(QList<' + struct_name + ">)\n")
+ out.write('Q_DECLARE_METATYPE(OptionalArgument<QList<' + struct_name + "> >)\n\n")
+
+
+ def make_dbus_type_definitions(self, out):
+ for struct in self.structs.items():
+ self.write_struct_definition(struct, out)
+
+ def write_struct_definition(self, ((iface, name), params), out):
+ struct_name = iface + '_' + name
+
+ out.write('QDBusArgument& operator << (QDBusArgument& arg, const ' + struct_name + "& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("arg.beginStructure();\n")
+ for param in params:
+ out.write("arg << v.{0};\n".format(param.name))
+ out.write("arg.endStructure();\n")
+ out.write("return arg;\n")
+ out.write("}\n\n")
+
+ out.write('const QDBusArgument& operator >> (const QDBusArgument& arg, ' + struct_name + "& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("arg.beginStructure();\n")
+ for param in params:
+ out.write("arg >> v.{0};\n".format(param.name))
+ out.write("arg.endStructure();\n")
+ out.write("return arg;\n")
+ out.write("}\n\n")
+
+ out.write('QVariant ValueToVariant(const ' + struct_name + "& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("QVariantMap map;\n")
+ for param in params:
+ out.write("""PutArgToMap(map, "{0}", v.{0});\n""".format(param.name))
+ out.write("return QVariant::fromValue(map);\n")
+ out.write("}\n\n")
+
+ out.write('QVariant ValueToVariant(const QList<' + struct_name + ">& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("QList<QVariant> ret;\n")
+ out.write("for (QList<{0}>::const_iterator i = v.begin(); i != v.end(); ++i)\n".format(struct_name))
+ with CodeBlock(out) as out:
+ out.write("ret.append(ValueToVariant(*i));\n")
+ out.write("return QVariant::fromValue(ret);\n")
+ out.write("}\n\n")
+
+ out.write('void PutArgToMap(QVariantMap& map, const char* name, const ' + struct_name + "& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("map.insert(name, ValueToVariant(v));\n")
+ out.write("}\n\n")
+
+ out.write('bool VariantToValue(const QVariant& variant, ' + struct_name + "& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("if (variant.type() != QVariant::Map) {\n")
+ with CodeBlock(out) as out:
+ out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a map");\n""")
+ out.write("return false;\n")
+ out.write("}\n")
+ out.write("QVariantMap map = variant.toMap();\n")
+ for param in params:
+ out.write("if (!GetArgFromMap(map, \"" + param.name + "\", v." + param.name + ")) return false;\n")
+ out.write("return true;\n")
+ out.write("}\n\n")
+
+ out.write('bool VariantToValue(const QVariant& variant, QList<' + struct_name + ">& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("if (variant.type() != QVariant::List) {\n")
+ with CodeBlock(out) as out:
+ out.write("""LOG4CXX_ERROR(logger_, "Input argument isn't a list");\n""")
+ out.write("return false;\n")
+ out.write("}\n")
+ out.write("QList<QVariant> list = variant.toList();\n")
+ out.write("for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {\n");
+ with CodeBlock(out) as out:
+ out.write(struct_name + " s;\n");
+ out.write("if (!VariantToValue(*i, s)) return false;\n");
+ out.write("v.append(s);\n");
+ out.write("}\n")
+ out.write("return true;\n")
+ out.write("}\n\n")
+
+ out.write('bool GetArgFromMap(const QVariantMap& map, const char* name, ' + struct_name + "& v) {\n")
+ with CodeBlock(out) as out:
+ out.write("QVariantMap::const_iterator it = map.find(name);\n")
+ out.write("if (map.end() == it) {\n")
+ with CodeBlock(out) as out:
+ out.write("""LOG4CXX_WARN(logger_, "Argument '" << name << "' not found");\n""")
+ out.write("return false;\n")
+ out.write("}\n")
+ out.write("if (it->type() != QVariant::Map) {\n")
+ with CodeBlock(out) as out:
+ out.write("""LOG4CXX_ERROR(logger_, "Argument '" << name << "' isn't a map");\n""")
+ out.write("return false;\n")
+ out.write("}\n")
+ out.write("const QVariantMap& inmap = it->toMap();\n")
+ for param in params:
+ out.write("if (!GetArgFromMap(inmap, \"" + param.name + "\", v." + param.name + ")) return false;\n")
+ out.write("return true;\n")
+ out.write("}\n\n")
+
+ def write_param_validation(self, param, param_name, fail_statement, out, level=0):
+ if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
+ out.write("if (%s.presence) {\n" % param_name)
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ with CodeBlock(out) as out:
+ self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
+ out.write("}\n")
+ elif param.array:
+ if param.minSize > 0:
+ out.write("if ({0}.count() < {1}) {{ {2}; }}\n".format(param_name, param.minSize, fail_statement))
+ if param.maxSize != None:
+ out.write("if ({0}.count() > {1}) {{ {2}; }}\n".format(param_name, param.maxSize, fail_statement))
+ if param.restricted:
+ out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
+ with CodeBlock(out) as out:
+ param_copy = copy(param)
+ param_copy.array = False
+ self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
+ out.write("}\n")
+ elif param.struct:
+ for p in self.structs[param.fulltype]:
+ self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
+ elif param.type == "Integer" or param.type == "Float":
+ conditions = []
+ if (param.minValue != None):
+ conditions.append("(%s < %s)" % (param_name, param.minValue))
+ if (param.maxValue != None):
+ conditions.append("(%s > %s)" % (param_name, param.maxValue))
+ if conditions:
+ out.write('if (%s) { %s; }\n' % (' || '.join(conditions), fail_statement))
+ elif param.type == "String":
+ conditions = []
+ if (param.minLength > 0):
+ conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
+ if (param.maxLength > 0):
+ conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
+ if conditions:
+ with CodeBlock(out) as out:
+ out.write('if (%s) { %s;\n }\n' % (' || '.join(conditions), fail_statement))
+
+ def qt_param_type(self, param):
+ if not param.mandatory:
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
+ if param.array:
+ param_copy = copy(param)
+ param_copy.array = False
+ if param.type == 'String':
+ return "QStringList"
+ return "QList< " + self.qt_param_type(param_copy) + " >"
+ if param.type == 'Integer' or param.enum:
+ return 'int'
+ elif param.type == 'String':
+ return 'QString'
+ elif param.type == 'Boolean':
+ return 'bool'
+ elif param.type == 'Float':
+ return 'double'
+ elif param.struct:
+ return "_".join(param.fulltype)
+ return "xxx"
+
+
+ def from_variant_func_name(self, param, interface):
+ prefix = ''
+ if not param.mandatory:
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ return 'opt_' + self.from_variant_func_name(param_copy, interface)
+ if param.array:
+ param_copy = copy(param)
+ param_copy.array = False
+ return 'arr_' + self.from_variant_func_name(param_copy, interface)
+
+ if param.type in ['Integer', 'String', 'Boolean', 'Float']:
+ param_type = param.type
+ else:
+ param_type = param.type.split('.')
+ if len(param_type) > 1:
+ param_type = (param_type[0], param_type[1])
+ else:
+ param_type = (interface, param_type[0])
+ if param_type in self.structs:
+ param_type = param_type[0] + '_' + param_type[1]
+ elif param_type in self.enums:
+ param_type = 'Integer'
+ return param_type + '_from_variant'
+
+
+ def make_method_signature(self, request, response, interface, add_classname):
+ in_params = [self.make_param_desc(x, interface) for x in request.findall('param')]
+ out_params = [self.make_param_desc(x, interface) for x in response.findall('param')]
+
+ signature_len = len(''.join(map(lambda x: self.convert_to_dbus_type(x), in_params + out_params)))
+ if signature_len > 255:
+ raise RuntimeError("Too long signature of {0} method. Maximum valid length is 255, actual is {1}", request.get('name'), signature_len)
+
+ return "int {0}{1} ({2}{3}const QDBusMessage& message, QString& userMessage_out{4}{5})".format(
+ interface + "Adaptor::" if add_classname else "",
+ request.get('name'),
+ ", ".join(map(lambda x: "const {0}& {1}_in".format(self.qt_param_type(x), x.name), in_params)),
+ ", " if in_params else "",
+ ", " if out_params else "",
+ ", ".join(map(lambda x: "{0}& {1}_out".format(self.qt_param_type(x), x.name), out_params)))
+
+
+ def make_signal_signature(self, signal, interface, add_void):
+ params = signal.findall('param')
+ if add_void:
+ retstr = 'void '
+ else:
+ retstr = ''
+ retstr = retstr + signal.get('name') + '('
+ params_num = len(params)
+ for i in range(0, params_num):
+ param_desc = self.make_param_desc(params[i], interface)
+ param_type = self.qt_param_type(param_desc)
+ retstr = retstr + param_type + ' ' + param_desc.name
+ if i <> params_num - 1: retstr = retstr + ", "
+ retstr = retstr + ')'
+ return retstr
+
+
+ def make_qml_signal_signature(self, signal, interface, name, short=False, add_classname=False):
+ params = signal.findall('param')
+ if short:
+ retstr = ''
+ else:
+ retstr = 'void '
+ if add_classname:
+ retstr = retstr + interface + 'Adaptor::'
+ retstr = retstr + name + '('
+ params_num = len(params)
+ for i in range(0, params_num):
+ param_desc = self.make_param_desc(params[i], interface)
+ if param_desc.struct or param_desc.array or not param_desc.mandatory: typ = 'QVariant'
+ elif param_desc.type == 'Integer' or param_desc.enum: typ = 'int'
+ elif param_desc.type == 'Boolean': typ = 'bool'
+ elif param_desc.type == 'Float': typ = 'double'
+ elif param_desc.type == 'String': typ = 'QString'
+ else: typ = 'QVariant'
+ retstr = retstr + typ
+ if not short: retstr = retstr + ' ' + param_desc.name
+ if i <> params_num - 1: retstr = retstr + ", "
+ retstr = retstr + ')'
+ return retstr
+
+
+ def write_adaptor_declaration(self, interface_el, notifications, request_responses, out):
+ global prefix_class_item
+ def glue_strings(strings):
+ ret = list()
+ curstr = ''
+ for str in strings:
+ curstr = curstr + str
+ if(str[-1] == '>'):
+ ret.append(curstr)
+ curstr = ''
+ return ret
+ ifacename = interface_el.get('name')
+ out.write("class " + ifacename + "Adaptor : public QDBusAbstractAdaptor {\n");
+ out.write(" Q_OBJECT\n");
+ out.write(" Q_CLASSINFO(\"D-Bus Interface\", \"" + self.interface_path + '.' + ifacename + "\")\n");
+ out.write(" Q_CLASSINFO(\"D-Bus Introspection\",\n");
+ introspection_el = self.create_introspection_iface_el(interface_el, 'hmi')
+ introspection = glue_strings(ElementTree.tostringlist(introspection_el))
+ for str in introspection:
+ str = str.replace('"', '\\"')
+ out.write('"' + str + '"' + "\n")
+ out.write(" )\n")
+ out.write(" public:\n")
+ out.write(" explicit " + ifacename + "Adaptor(QObject *parent = 0);\n")
+ out.write(" void SetApi(Q%sItem*);\n" % prefix_class_item)
+ out.write(" DBusController *dbusController;\n")
+ out.write(" public slots:\n")
+ for (request, response) in request_responses:
+ signature = self.make_method_signature(request, response, ifacename, False)
+ out.write(" " + signature + ";\n")
+ out.write(" signals:\n")
+ for n in notifications:
+ signature = self.make_signal_signature(n, ifacename, True)
+ out.write(" " + signature + ";\n")
+ out.write(" private slots:\n")
+ for n in notifications:
+ signature = self.make_qml_signal_signature(n, ifacename, n.get('name') + '_qml', False)
+ out.write(" " + signature + ";\n")
+ out.write(" private:\n")
+ out.write(" Q%sItem* api_;\n" % prefix_class_item)
+ out.write("};\n\n");
+
+ def write_adaptor_definition(self, interface_el, notifications, request_responses, out):
+ global prefix_class_item
+ iface_name = interface_el.get('name')
+ classname = iface_name + 'Adaptor'
+ out.write("{0}::{0}(QObject* parent) : QDBusAbstractAdaptor(parent) {{}}\n".format(classname))
+
+ out.write("void {0}::SetApi(Q{1}Item* api) {{\n".format(classname, prefix_class_item))
+ with CodeBlock(out) as out:
+ out.write("api_ = api;\n")
+ for n in notifications:
+ signame = n.get('name')
+ signame = signame[:1].lower() + signame[1:]
+ slotname = n.get('name') + '_qml'
+ sig_signature = self.make_qml_signal_signature(n, iface_name, signame, True)
+ slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, True)
+ out.write("connect(api_, SIGNAL(" + sig_signature + "), this, SLOT(" + slot_signature + "));\n")
+ out.write("LOG4CXX_TRACE(logger_, \"CONNECT SIGNALS: \" << __PRETTY_FUNCTION__ );\n")
+ out.write("}\n\n")
+
+ for (request,response) in request_responses:
+ in_params = [ self.make_param_desc(x, iface_name) for x in request.findall('param') ]
+ out_params = [ self.make_param_desc(x, iface_name) for x in response.findall('param') ]
+
+ out.write("bool fill{0}{1}Reply(QDBusMessage& message, const QVariantMap& map) {{\n".format(classname, request.get('name')))
+ with CodeBlock(out) as out:
+ out.write("int retCode_out = 0;\n")
+ out.write("GetArgFromMap(map, \"__retCode\", retCode_out);\n")
+ out.write("QVariant retCode_arg = QVariant::fromValue(retCode_out);\n")
+ out.write("message << retCode_arg;\n")
+ out.write("QString userMessage_out;\n")
+ out.write("GetArgFromMap(map, \"__message\", userMessage_out);\n")
+ out.write("QVariant userMessage_arg = QVariant::fromValue(userMessage_out);\n")
+ out.write("message << userMessage_arg;\n")
+ for p in out_params:
+ param_name = p.name
+ param_type = self.qt_param_type(p)
+ out.write("%s %s_out;\n" % (param_type, p.name))
+ out.write("if (!GetArgFromMap(map, \"{0}\", {0}_out)) {{ return false; }}\n".format(p.name))
+ self.write_param_validation(p, p.name + "_out", "return false", out)
+ out.write("QVariant {0}_arg;\n".format(p.name))
+ out.write("{0}_arg.setValue({0}_out);\n".format(p.name))
+ out.write("message << {0}_arg;\n".format(p.name))
+ out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(map));\n")
+ out.write("LOG4CXX_TRACE(logger_, \"REPLY ASYNC: \" << __PRETTY_FUNCTION__ );\n")
+ out.write("return true;\n")
+ out.write("}\n\n")
+
+ out.write("{0} {{\n".format(self.make_method_signature(request, response, iface_name, True)))
+ with CodeBlock(out) as out:
+ out.write("LOG4CXX_TRACE(logger_, \"ENTER: \" << __PRETTY_FUNCTION__ );\n")
+ out.write("int ret = 0;\n")
+ return_statement = "return ret;\n"
+ out.write("QVariantMap in_arg;\n");
+ out.write("QVariant out_arg_v;\n");
+ for param in in_params:
+ self.write_param_validation(param, param.name + "_in", "RaiseDbusError(this, InvalidData); return ret", out)
+ out.write("PutArgToMap(in_arg, \"" + param.name + "\", " + param.name + "_in);\n")
+ out.write("LOG4CXX_DEBUG(logger_, \"Input arguments:\\n\" << in_arg);\n")
+ method_name = request.get('name')[:1].lower() + request.get('name')[1:]
+
+ out.write("dbusController->message = &message;\n")
+ out.write("dbusController->fill = &fill{0}{1}Reply;\n".format(classname, request.get("name")))
+
+ out.write("""if (!QMetaObject::invokeMethod(api_, "{0}", Qt::{1}Connection, Q_RETURN_ARG(QVariant, out_arg_v), Q_ARG(QVariant, QVariant(in_arg)))) {{\n""".format(method_name, invoke_type_connection))
+ with CodeBlock(out) as out:
+ out.write("RaiseDbusError(this, InvalidData);\n")
+ out.write("LOG4CXX_ERROR(logger_, \"Can't invoke method " + method_name +"\");\n ")
+ out.write("return ret;\n")
+ out.write("}\n")
+
+ out.write("dbusController->message = NULL;\n")
+ out.write("dbusController->fill = NULL;\n")
+ out.write("if (message.isDelayedReply()) {\n")
+ with CodeBlock(out) as out:
+ out.write("return ret;\n")
+ out.write("}\n")
+
+ out.write("QVariantMap out_arg;\n")
+ out.write("if (out_arg_v.type() == QVariant::Map) {\n")
+ with CodeBlock(out) as out:
+ out.write("out_arg = out_arg_v.toMap();\n")
+ out.write("};\n")
+
+ out.write("int err;\n")
+ out.write("""if (GetArgFromMap(out_arg, "__errno", err)) { RaiseDbusError(this, err); return ret; }\n""")
+
+ out.write("int async_uid;\n")
+ out.write("if (GetArgFromMap(out_arg, \"__async_uid\", async_uid)) {\n")
+ with CodeBlock(out) as out:
+ out.write("message.setDelayedReply(true);\n")
+ out.write("dbusController->addMessage(message, &fill%s%sReply, async_uid);\n" % (classname, request.get('name')))
+ out.write("LOG4CXX_TRACE(logger_, \"EXIT ASYNC: \" << __PRETTY_FUNCTION__ );\n")
+ out.write("return ret;\n");
+ out.write("}\n\n")
+
+ for param in out_params:
+ out.write("if (!GetArgFromMap(out_arg, \"{0}\", {0}_out)) {{ RaiseDbusError(this, InvalidData); return ret; }}\n".format(param.name))
+ self.write_param_validation(param, param.name + "_out", "RaiseDbusError(this, InvalidData); return ret", out)
+
+ out.write("GetArgFromMap(out_arg, \"__retCode\", ret);\n")
+ out.write("GetArgFromMap(out_arg, \"__message\", userMessage_out);\n")
+ out.write("LOG4CXX_DEBUG(logger_, \"Output arguments:\\n\" << QVariant(out_arg));\n")
+ out.write("LOG4CXX_TRACE(logger_, \"EXIT: \" << __PRETTY_FUNCTION__ );\n")
+ out.write("return ret;\n")
+ out.write("}\n\n")
+
+ for n in notifications:
+ slotname = n.get('name') + '_qml'
+ slot_signature = self.make_qml_signal_signature(n, iface_name, slotname, False, True)
+ out.write(slot_signature + " {\n")
+ params = n.findall('param')
+ out.write(" LOG4CXX_TRACE(logger_, \"EMIT SIGNAL: \" << __PRETTY_FUNCTION__ );\n")
+ out.write(" LOG4CXX_DEBUG(logger_, \"Arguments:\\n{\"")
+ for p in params[0:-1]:
+ param = self.make_param_desc(p, iface_name)
+ out.write(" << \" " + param.name + ":\" << " + param.name + " << \",\"")
+ for p in params[-1:]: # last param without comma in end line
+ p = params[-1]
+ param = self.make_param_desc(p, iface_name)
+ out.write(" << \" " + param.name + ":\" << " + param.name)
+ out.write(" << \" }\");\n")
+ for p in params:
+ param = self.make_param_desc(p, iface_name)
+ param_type = self.qt_param_type(param)
+ param_name = 'p_' + param.name
+ if param.mandatory:
+ if param.array or (param.type not in ['Integer', 'String', 'Float', 'Boolean'] and not param.enum):
+ out.write(' ' + param_type + ' ' + param_name + ";\n")
+ out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ")) {\n")
+ out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
+ out.write(" return;}\n")
+ else:
+ out.write(' ' + param_type + ' ' + param_name + ";\n")
+ out.write(' ' + param_name + '.presence = !' + param.name + ".isNull();\n")
+ out.write(' if (' + param_name + ".presence) {\n")
+ out.write(' if (!VariantToValue(' + param.name + ', ' + param_name + ".val)) {\n")
+ out.write(" LOG4CXX_ERROR(logger_, \"Can't convert variant to value\");\n")
+ out.write(" return;\n }\n")
+ out.write(" }\n")
+ out.write(' emit ' + n.get('name') + '(')
+ for i in range(len(params)):
+ param = self.make_param_desc(params[i], iface_name)
+ basic_type = (param.type in ['Integer', 'String', 'Float', 'Boolean']) or param.enum
+ if param.array or (not param.mandatory) or (not basic_type):
+ param_name = 'p_' + param.name
+ else:
+ param_name = param.name
+ out.write(param_name)
+ if i != len(params) - 1: out.write(', ')
+ out.write(");\n")
+ out.write("}\n\n")
+
+
+ def make_dbus_adaptor_declarations(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ notifications = self.find_notifications_by_provider(interface_el, "hmi")
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
+ if len(notifications) > 0 or len(request_responses) > 0:
+ self.write_adaptor_declaration(interface_el, notifications, request_responses, out)
+
+
+ def make_dbus_adaptor_definitions(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ notifications = self.find_notifications_by_provider(interface_el, "hmi")
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "hmi")
+ if len(notifications) > 0 or len(request_responses) > 0:
+ self.write_adaptor_definition(interface_el, notifications, request_responses, out)
+
+
+ def make_dbus_register_metatypes_declaraion(self, out):
+ out.write("void RegisterDbusMetatypes();\n")
+
+
+ def make_dbus_register_metatypes_definition(self, out):
+ out.write("void RegisterDbusMetatypes() {\n")
+ for (iface, name) in self.structs:
+ struct_name = iface + '_' + name
+ out.write('qDBusRegisterMetaType<' + struct_name + ">();\n")
+ out.write('qDBusRegisterMetaType<OptionalArgument<' + struct_name + "> >();\n")
+ out.write('qDBusRegisterMetaType<QList<' + struct_name + "> >();\n")
+ out.write('qDBusRegisterMetaType<OptionalArgument<QList<' + struct_name + "> > >();\n")
+ out.write("}\n")
+
+
+ def make_api_adaptors_class(self, out):
+ global prefix_class_item
+ out.write("struct ApiAdaptors {\n")
+ interfaces = self.el_tree.findall('interface')
+ def filt(iface):
+ return self.find_notifications_by_provider(iface, "hmi") or self.find_request_response_pairs_by_provider(iface, "hmi")
+ interfaces = filter(filt, interfaces)
+ for interface_el in interfaces:
+ name = interface_el.get('name') + 'Adaptor'
+ out.write(" " + name + "* " + name + "_;\n")
+ out.write(" ApiAdaptors() :\n")
+ for i in range(len(interfaces)):
+ name = interfaces[i].get('name') + 'Adaptor'
+ out.write(" " + name + "_(NULL)")
+ if i <> len(interfaces) - 1: out.write(',')
+ out.write("\n")
+ out.write(" {}\n")
+ out.write(" void Init(QObject* p) {\n")
+ for interface_el in interfaces:
+ name = interface_el.get('name') + 'Adaptor'
+ out.write(" " + name + "_ = new " + name + "(p);\n")
+ out.write(" }\n")
+ out.write(" void SetApi(QObject* p) {\n")
+ for interface_el in interfaces:
+ name = interface_el.get('name') + 'Adaptor'
+ chname = interface_el.get('name')
+ out.write(" " + name + ("_->SetApi(p->findChild<Q%sItem*>(\"" % prefix_class_item) + chname + "\"));\n")
+ out.write(" }\n")
+ out.write(" void SetDBusController(DBusController* dc) {\n")
+ for interface_el in interfaces:
+ name = interface_el.get('name') + 'Adaptor'
+ chname = interface_el.get('name')
+ out.write(" " + name + "_->dbusController = dc;\n")
+ out.write(" }\n")
+ out.write("};\n\n")
+
+
+
+arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output files qml_dbus.cc, qml_dbus.h will be saved")
+args = arg_parser.parse_args()
+
+if args.version == "4.8.5":
+ prefix_class_item = 'Declarative'
+ invoke_type_connection = 'Direct'
+elif args.version == "5.1.0":
+ prefix_class_item = 'Quick'
+ invoke_type_connection = 'BlockingQueued'
+
+header_name = 'qml_dbus.h'
+source_name = 'qml_dbus.cc'
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
+
+header_out = open(args.outdir + '/' + header_name, "w")
+source_out = open(args.outdir + '/' + source_name, "w")
+
+header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+header_out.write("""/**
+ * @file qml_dbus.h
+ * @brief Generated QDbus adaptors header file
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+header_out.write("#ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
+header_out.write("#define SRC_COMPONENTS_DBUS_QML_DBUS_H_\n\n");
+header_out.write("#include <QtDBus/QDBusArgument>\n");
+header_out.write("#include <QtDBus/QDBusMessage>\n");
+header_out.write("#include <QtDBus/QDBusConnection>\n");
+header_out.write("#include <QtDBus/QDBusAbstractAdaptor>\n");
+header_out.write("#include <QtDBus/QDBusMetaType>\n");
+header_out.write("#include <Qt%s/Q%sItem>\n" % (prefix_class_item, prefix_class_item));
+header_out.write("#include \"qml_dbus_common.h\"\n\n");
+header_out.write("#include \"dbus_controller.h\"\n\n");
+impl.make_dbus_type_declarations(header_out)
+impl.make_dbus_adaptor_declarations(header_out)
+impl.make_dbus_register_metatypes_declaraion(header_out)
+impl.make_api_adaptors_class(header_out)
+impl.make_dbus_metatype_declarations(header_out)
+header_out.write("#endif // #ifndef SRC_COMPONENTS_DBUS_QML_DBUS_H_\n");
+
+source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+source_out.write("""/**
+ * @file qml_dbus.cc
+ * @brief Generated QDbus adaptors source file
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+source_out.write("#include \"" + header_name + "\"\n\n");
+source_out.write("#include \"utils/logger.h\"\n")
+source_out.write("#ifdef ENABLE_LOG\n")
+source_out.write("extern log4cxx::LoggerPtr logger_;\n")
+source_out.write("#endif // ENABLE_LOG\n\n")
+impl.make_dbus_type_definitions(source_out)
+impl.make_dbus_adaptor_definitions(source_out)
+impl.make_dbus_register_metatypes_definition(source_out)
diff --git a/src/components/dbus/codegen/make_qml_dbus_qml.py b/src/components/dbus/codegen/make_qml_dbus_qml.py
new file mode 100755
index 0000000000..8d057dcda1
--- /dev/null
+++ b/src/components/dbus/codegen/make_qml_dbus_qml.py
@@ -0,0 +1,217 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_qml_dbus_qml.py
+# @brief Generator of QML to QDbus QML part
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from os import path
+from os import makedirs
+from sys import argv
+from argparse import ArgumentParser
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser
+
+namespace = 'dbus_qml'
+qt_quick_version = '1.1'
+type_variant_name = 'variant'
+
+class Impl(FordXmlParser):
+ def write_function(self, ifacename, request, response, out):
+ name = request.get('name')
+ name = name[:1].lower() + name[1:]
+ out.write(" function " + name + "(params) {\n")
+ out.write(""" console.debug("{0}Proxy::{1}")\n""".format(ifacename, name))
+ out.write(" try {\n")
+ out.write(" if(\"{0}\" in sdl{1})\n".format(name, ifacename))
+ out.write(" return sdl{0}.{1}(" .format(ifacename, name))
+ params = request.findall('param')
+ for i in range(len(params)):
+ out.write('params.' + params[i].get('name'))
+ if i <> len(params) - 1:
+ out.write(', ')
+ out.write(")\n")
+ out.write(" else\n")
+ out.write(""" return { "__errno": Common.Result.UNSUPPORTED_REQUEST }\n""")
+ out.write(" } catch(err) {\n")
+ out.write(""" return { "__errno": err }\n""")
+ out.write(" }\n")
+ out.write(" }\n\n")
+
+
+ def write_signal_param(self, param, out):
+ if param.array or param.struct or not param.mandatory: typ = type_variant_name
+ elif param.type == 'Integer' or param.enum: typ = 'int'
+ elif param.type == 'String': typ = 'string'
+ elif param.type == 'Boolean': typ = 'bool'
+ elif param.type == 'Float': typ = 'double'
+ else: typ = type_variant_name
+ out.write(typ + ' ' + param.name)
+
+
+ def write_signal(self, ifacename, notification, out):
+ name = notification.get('name')
+ name = name[:1].lower() + name[1:]
+ out.write(" signal " + name + "(")
+ params = notification.findall('param')
+ for i in range(len(params)):
+ self.write_signal_param(self.make_param_desc(params[i], ifacename), out)
+ if i <> len(params) - 1:
+ out.write(', ')
+ out.write(")\n")
+ name = notification.get('name')
+ out.write(""" on{1}: console.debug("emitted {0}:{1}")\n""".format(ifacename, name))
+
+
+ def write_qml(self, iface, out):
+ global qt_quick_version
+ name = iface.get('name')
+ out.write("import QtQuick %s\n" % qt_quick_version)
+ out.write("""import "Common.js" as Common\n""")
+ out.write("import \"..\"\n\n")
+ out.write("Item {\n")
+ out.write(" " + name + " {\n")
+ out.write(" id: sdl" + name + "\n")
+ out.write(" }\n")
+
+ notifications = impl.find_notifications_by_provider(interface_el, "hmi")
+ request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
+ for request, response in request_responses:
+ self.write_function(name, request, response, out)
+ for n in notifications:
+ self.write_signal(name, n, out)
+ out.write("}\n")
+
+
+ def write_js_enum(self, enum, out):
+ out.write("var " + enum.get('name') + " = {\n")
+ lastval = -1
+ elements = enum.findall('element')
+ for i in range(len(elements)):
+ element = elements[i]
+ value = element.get('value')
+ if value is None:
+ value = lastval + 1
+ else:
+ value = int(value)
+ lastval = value
+ name = element.get('internal_name')
+ if name is None:
+ name = element.get('name')
+ out.write(" " + name + ': ' + str(value))
+ if len(elements) - 1 != i: out.write(',')
+ out.write("\n")
+ out.write("}\n\n")
+
+
+def write_header(out):
+ out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+ out.write("""/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+""")
+
+arg_parser = ArgumentParser(description="Generator of Qt to QDbus QML part")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output files with pattern name <intarface name>Proxy.qml will be saved, e.g. BasicCommunicationProxy.qml, ButtonsProxy.qml VRProxy.qml")
+args = arg_parser.parse_args()
+
+if args.version == "4.8.5":
+ qt_quick_version = "1.1"
+ type_variant_name = "variant"
+elif args.version == "5.1.0":
+ qt_quick_version = "2.0"
+ type_variant_name = "var"
+
+if not path.isdir(args.outdir):
+ makedirs(args.outdir)
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Impl(in_tree_root)
+
+for interface_el in in_tree_root.findall('interface'):
+ notifications = impl.find_notifications_by_provider(interface_el, "hmi")
+ request_responses = impl.find_request_response_pairs_by_provider(interface_el, "hmi")
+ if notifications or request_responses:
+ filename = interface_el.get('name')+'Proxy.qml'
+ outfile = open(args.outdir + '/' + filename, 'w')
+ write_header(outfile)
+ impl.write_qml(interface_el, outfile)
+
+enum_files = dict()
+for (iface, name), enum in impl.enums.items():
+ if iface in enum_files:
+ outfile = enum_files[iface]
+ else:
+ filename = iface+'.js'
+ outfile = open(args.outdir + '/' + filename, 'w')
+ write_header(outfile)
+ outfile.write(".pragma library\n")
+ enum_files[iface] = outfile
+ impl.write_js_enum(enum, outfile)
+
+
diff --git a/src/components/dbus/codegen/make_qml_requests_cpp.py b/src/components/dbus/codegen/make_qml_requests_cpp.py
new file mode 100644
index 0000000000..6674b8f5e2
--- /dev/null
+++ b/src/components/dbus/codegen/make_qml_requests_cpp.py
@@ -0,0 +1,253 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_qml_dbus_cpp.py
+# @brief Generator of QML to QDbus C++ part
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2014, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+import os.path
+from sys import argv
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser, ParamDesc
+from code_formatter import CodeBlock
+
+prefix_class_item = 'Declarative'
+invoke_type_connection = 'Direct'
+
+def defaultValue(param):
+ if param.type == "Integer":
+ return "0"
+ elif param.type == "Float":
+ return "0.0"
+ elif param.type == "Boolean":
+ return "false"
+ elif param.enum:
+ return "0"
+
+class Impl(FordXmlParser):
+
+
+ def args_for_function_definition(self, params, out):
+ if len(params) == 0:
+ out.write('QJSValue hmi_callback')
+ return
+ for param in params:
+ out.write('QVariant ' + param.get('name') + ', ')
+ out.write('QJSValue hmi_callback')
+
+
+ def make_requests_for_header(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
+ for (request, response) in request_responses:
+ all_params = list()
+ for param_el in request.findall('param'):
+ all_params.append(param_el)
+ with CodeBlock(out) as output:
+ output.write("Q_INVOLABKE void " + interface_el.get('name') + "_" +request.get('name') + "(")
+ impl.args_for_function_definition(all_params, out)
+ output.write(");\n")
+
+
+ def make_header_file(self, out):
+ out.write("class RequestToSDL : public QObject\n")
+ out.write("{\n")
+ out.write(" public:\n")
+ with CodeBlock(out) as output:
+ output.write("explicit RequestToSDL(QObject *parent = 0);\n")
+ output.write("~RequestToSDL();\n")
+ impl.make_requests_for_header(out)
+ out.write(" private:\n")
+ with CodeBlock(out) as output:
+ for interface_el in self.el_tree.findall('interface'):
+ output.write('QDBusInterface *' + interface_el.get('name') + ';\n')
+ out.write("};\n")
+
+
+ def make_requests_for_source(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
+ for (request, response) in request_responses:
+ out.write('void RequestToSDL::' + request.get('name') + '(QString name, ')
+ for param_el in request.findall('param'):
+ out.write('QVariant ' + param_el.get('name') + ', ')
+ out.write('QJSValue hmi_callback) {\n')
+ with CodeBlock(out) as output:
+ output.write('QList<QVariant> args;\n')
+ for param_el in request.findall('param'):
+ output.write('args << ' + param_el.get('name') + ';\n')
+ output.write('new ' + interface_el.get('name') + '_' + request.get('name') + '(' + interface_el.get('name') + ', name, args, hmi_callback);\n}\n')
+
+
+
+ def make_source_file(self, out):
+ out.write('#include "request_to_sdl.h"\n')
+ out.write('\n')
+ out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
+ with CodeBlock(out) as output:
+ output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
+ out.write('}\n\n')
+ out.write('RequestToSDL::~RequestToSDL() {\n')
+ with CodeBlock(out) as output:
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ output.write(iface_name + '->deleteLater();\n')
+ output.write('this->deleteLater();\n')
+ out.write('}\n\n')
+ impl.make_requests_for_source(out)
+
+
+
+
+
+arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
+args = arg_parser.parse_args()
+
+if args.version == "4.8.5":
+ prefix_class_item = 'Declarative'
+ invoke_type_connection = 'Direct'
+elif args.version == "5.1.0":
+ prefix_class_item = 'Quick'
+ invoke_type_connection = 'BlockingQueued'
+
+header_name = 'request_to_sdl.h'
+source_name = 'request_to_sdl.cc'
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
+
+header_out = open(args.outdir + '/' + header_name, "w")
+source_out = open(args.outdir + '/' + source_name, "w")
+
+header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+header_out.write("""/**
+ * @file request_to_sdl.h
+ * @brief Generated class that process requests from qtHMI
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+header_out.write("#ifndef SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
+header_out.write("#define SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n\n");
+header_out.write("#include <QDBusConnection>\n");
+header_out.write("#include <QJSValue>\n");
+header_out.write("#include <QObject>\n");
+header_out.write("#include <QDBusInterface>\n");
+header_out.write('#include "hmi_requests.h"\n');
+
+impl.make_header_file(header_out)
+
+header_out.write("#endif SRC_COMPONENTS_QTHMI_QMLMODELQT5_REQUESTTOSDL_\n");
+
+
+source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+source_out.write("""/**
+ * @file request_to_sdl.cc
+ * @brief Generated class that process requests from qtHMI
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2014, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+""")
+
+impl.make_source_file(source_out)
diff --git a/src/components/dbus/codegen/make_request_to_sdl.py b/src/components/dbus/codegen/make_request_to_sdl.py
new file mode 100755
index 0000000000..c8940f3eb7
--- /dev/null
+++ b/src/components/dbus/codegen/make_request_to_sdl.py
@@ -0,0 +1,335 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# @file make_qml_dbus_cpp.py
+# @brief Generator of QML to QDbus C++ part
+#
+# This file is a part of HMI D-Bus layer.
+#
+# Copyright (c) 2014, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+from argparse import ArgumentParser
+import os.path
+from sys import argv
+from xml.etree import ElementTree
+from copy import copy
+from ford_xml_parser import FordXmlParser, ParamDesc
+from code_formatter import CodeBlock
+
+class Impl(FordXmlParser):
+
+ def args_for_function_definition(self, params, iface_name, out):
+ for param_el in params:
+ param = self.make_param_desc(param_el, iface_name)
+ out.write('QVariant %s,' % (param.name))
+ out.write('Q%sValue hmi_callback' % prefix_class_item)
+
+ def make_requests_for_header(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
+ for (request, response) in request_responses:
+ all_params = list()
+ for param_el in request.findall('param'):
+ all_params.append(param_el)
+ with CodeBlock(out) as output:
+ output.write("Q_INVOKABLE bool %s_%s(" % (interface_el.get('name'), request.get('name')))
+ impl.args_for_function_definition(all_params, interface_el.get('name'), out)
+ output.write(");\n")
+
+
+ def make_header_file(self, out):
+ out.write("class QDBusInterface;\n")
+ out.write("class RequestToSDL : public QObject\n")
+ out.write("{\n")
+ out.write(' Q_OBJECT\n')
+ out.write(" public:\n")
+ with CodeBlock(out) as output:
+ output.write("explicit RequestToSDL(QObject *parent = 0);\n")
+ output.write("~RequestToSDL();\n")
+ impl.make_requests_for_header(out)
+ out.write(" private:\n")
+ with CodeBlock(out) as output:
+ for interface_el in self.el_tree.findall('interface'):
+ output.write('QDBusInterface *%s;\n' % interface_el.get('name'))
+ out.write("};\n")
+
+
+ def qt_param_type(self, param):
+ if not param.mandatory:
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ return "OptionalArgument< " + self.qt_param_type(param_copy) + " >"
+ if param.array:
+ param_copy = copy(param)
+ param_copy.array = False
+ if param.type == 'String':
+ return "QStringList"
+ return "QList< " + self.qt_param_type(param_copy) + " >"
+ if param.type == 'Integer' or param.enum:
+ return 'int'
+ elif param.type == 'String':
+ return 'QString'
+ elif param.type == 'Boolean':
+ return 'bool'
+ elif param.type == 'Float':
+ return 'double'
+ elif param.struct:
+ return "_".join(param.fulltype)
+ else:
+ raise RuntimeError('Unknown type: ' + param.type)
+
+
+ def make_requests_for_source(self, out):
+ for interface_el in self.el_tree.findall('interface'):
+ request_responses = self.find_request_response_pairs_by_provider(interface_el, "sdl")
+ for (request, response) in request_responses:
+ request_name = request.get('name')
+ iface_name = interface_el.get('name')
+ request_full_name = iface_name + '_' + request_name
+ out.write('bool RequestToSDL::' + request_full_name + '(')
+ for param_el in request.findall('param'):
+ out.write('QVariant %s, ' % (param_el.get('name')))
+ out.write('Q%sValue hmi_callback) {\n' % prefix_class_item)
+ with CodeBlock(out) as output:
+ output.write('LOG4CXX_TRACE(logger_, "ENTER");\n')
+ output.write('QList<QVariant> args;\n')
+ for param_el in request.findall('param'):
+ param = self.make_param_desc(param_el, iface_name)
+ output.write('%s %s;\n' % (impl.qt_param_type(param), param.name + "_tmp"))
+ output.write('if (VariantToValue(%s, %s)) {\n' % (param.name, param.name + '_tmp'))
+ with CodeBlock(output) as out:
+ self.write_param_validation(param, param.name + "_tmp",
+ "\nLOG4CXX_ERROR(logger_, \"%s in %s out of bounds\");\nreturn false" % (param.name, request_full_name),
+ out)
+ out.write('args << QVariant::fromValue(%s);\n' % (param.name + '_tmp'))
+ output.write('} else {\n')
+ with CodeBlock(output) as out:
+ out.write('LOG4CXX_ERROR(logger_, "%s in %s is NOT valid");\n' % (param.name, request_full_name))
+ out.write('return false;\n')
+ out.write('}\n')
+ output.write('new requests::' + request_full_name + '(hmi_callback, ' + interface_el.get('name') + ' , args, '
+ + '"' + request_name + '");\n')
+ output.write('LOG4CXX_TRACE(logger_, "EXIT");\n')
+ output.write('return true;\n')
+ out.write('}\n\n')
+
+
+ def write_param_validation(self, param, param_name, fail_statement, out, level=0):
+ if not param.mandatory and (param.restricted or param.restrictedArray or (param.struct and any(map(lambda x: x.restricted, self.structs[param.fulltype])))):
+ out.write("if (%s.presence) {\n" % param_name)
+ param_copy = copy(param)
+ param_copy.mandatory = True
+ with CodeBlock(out) as out:
+ self.write_param_validation(param_copy, param_name + ".val", fail_statement, out, level+1)
+ out.write("}\n")
+ elif param.array:
+ if param.minSize > 0:
+ out.write("if ({0}.count() < {1}) {{".format(param_name, param.minSize))
+ with CodeBlock(out) as out:
+ out.write("{0};\n".format(fail_statement))
+ out.write("}\n")
+ if param.maxSize != None:
+ out.write("if ({0}.count() > {1}) {{".format(param_name, param.maxSize))
+ with CodeBlock(out) as out:
+ out.write("{0};\n".format(fail_statement))
+ out.write("}\n")
+ if param.restricted:
+ out.write('for ({0}::const_iterator it_{2} = {1}.begin(); it_{2} != {1}.end(); ++it_{2}) {{\n'.format(self.qt_param_type(param), param_name, level))
+ with CodeBlock(out) as out:
+ param_copy = copy(param)
+ param_copy.array = False
+ self.write_param_validation(param_copy, "(*it_{0})".format(level), fail_statement, out, level+1)
+ out.write("}\n")
+ elif param.struct:
+ for p in self.structs[param.fulltype]:
+ self.write_param_validation(p, "{0}.{1}".format(param_name, p.name), fail_statement, out, level+1)
+ elif param.type == "Integer" or param.type == "Float":
+ conditions = []
+ if (param.minValue != None):
+ conditions.append("(%s < %s)" % (param_name, param.minValue))
+ if (param.maxValue != None):
+ conditions.append("(%s > %s)" % (param_name, param.maxValue))
+ if conditions:
+ out.write('if (%s) {' % ' || '.join(conditions))
+ with CodeBlock(out) as out:
+ out.write('%s;\n' % fail_statement)
+ out.write("}\n")
+ elif param.type == "String":
+ conditions = []
+ if (param.minLength > 0):
+ conditions.append("(%s.size() < %s)" % (param_name, param.minLength))
+ if (param.maxLength > 0):
+ conditions.append("(%s.size() > %s)" % (param_name, param.maxLength))
+ if conditions:
+ out.write('if (%s) {' % ' || '.join(conditions))
+ with CodeBlock(out) as out:
+ out.write('%s;\n' % (fail_statement))
+ out.write("}\n")
+
+ def make_source_file(self, out):
+ out.write('RequestToSDL::RequestToSDL(QObject *parent) {\n')
+ with CodeBlock(out) as output:
+ output.write('QDBusConnection bus = QDBusConnection::sessionBus();\n')
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ output.write(iface_name + ' = new QDBusInterface("com.ford.sdl.core", "/", "com.ford.sdl.core.' + iface_name + '", bus, this);\n')
+ out.write('}\n\n')
+ out.write('RequestToSDL::~RequestToSDL() {\n')
+ with CodeBlock(out) as output:
+ for interface_el in self.el_tree.findall('interface'):
+ iface_name = interface_el.get('name')
+ output.write(iface_name + '->deleteLater();\n')
+ output.write('this->deleteLater();\n')
+ out.write('}\n\n')
+ impl.make_requests_for_source(out)
+
+arg_parser = ArgumentParser(description="Generator of Qt to QDbus C++ part")
+arg_parser.add_argument('--infile', required=True, help="full name of input file, e.g. applink/src/components/interfaces/QT_HMI_API.xml")
+arg_parser.add_argument('--version', required=False, help="Qt version 4.8.5 (default) or 5.1.0")
+arg_parser.add_argument('--outdir', required=True, help="path to directory where output files request_to_sdl.h, request_to_sdl.cc will be saved")
+args = arg_parser.parse_args()
+
+
+if args.version == "4.8.5":
+ prefix_class_item = 'Script'
+ invoke_type_connection = 'Direct'
+elif args.version == "5.1.0":
+ prefix_class_item = 'JS'
+ invoke_type_connection = 'BlockingQueued'
+else:
+ prefix_class_item = 'JS'
+ invoke_type_connection = 'BlockingQueued'
+
+header_name = 'request_to_sdl.h'
+source_name = 'request_to_sdl.cc'
+
+in_tree = ElementTree.parse(args.infile)
+in_tree_root = in_tree.getroot()
+
+impl = Impl(in_tree_root, 'com.ford.sdl.hmi')
+
+header_out = open(args.outdir + '/' + header_name, "w")
+source_out = open(args.outdir + '/' + source_name, "w")
+
+header_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+header_out.write("""
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+""")
+header_out.write("#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n")
+header_out.write("#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_\n\n")
+
+header_out.write("#include <QtCore/QObject>\n")
+header_out.write("#include <QtCore/QVariant>\n")
+header_out.write("#include <QtCore/QStringList>\n\n")
+header_out.write('#include "qml_dbus.h"\n\n')
+if args.version == "4.8.5":
+ header_out.write("#include <QtScript/QScriptValue>\n")
+elif args.version == "5.1.0":
+ header_out.write("#include <QtQml/QJSValue>\n")
+
+impl.make_header_file(header_out)
+header_out.write("#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_REQUEST_TO_SDL_H_")
+
+
+source_out.write("// Warning! This file is generated by '%s'. Edit at your own risk.\n" % argv[0])
+source_out.write("""
+/*
+ Copyright (c) 2014, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+""")
+
+source_out.write('#include "request_to_sdl.h"\n')
+source_out.write("#include <QtDBus/QDBusConnection>\n")
+source_out.write("#include <QtDBus/QDBusInterface>\n")
+source_out.write('#include "hmi_requests.h"\n')
+source_out.write('#include "utils/logger.h"\n\n')
+source_out.write('CREATE_LOGGERPTR_GLOBAL(logger_, "DBusPlugin")\n\n')
+
+impl.make_source_file(source_out)
diff --git a/src/components/dbus/include/dbus/dbus_adapter.h b/src/components/dbus/include/dbus/dbus_adapter.h
new file mode 100644
index 0000000000..ec59fa421e
--- /dev/null
+++ b/src/components/dbus/include/dbus/dbus_adapter.h
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2013-2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
+#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
+
+#include <string>
+#include "smart_objects/smart_object.h"
+#include "dbus/schema.h"
+
+struct DBusConnection;
+struct DBusMessage;
+struct DBusMessageIter;
+
+namespace dbus {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+/**
+ * \brief class for work with DBus
+ */
+class DBusAdapter {
+ public:
+ /**
+ * \brief constructs DBus adapter
+ * \param sdlServiceName core service name
+ * \param sdlObjectPath core object path
+ * \param hmiServiceName hmi service name
+ */
+ DBusAdapter(const std::string& sdlServiceName,
+ const std::string& sdlObjectPath,
+ const std::string& hmiServiceName,
+ const std::string& hmiObjectPath);
+
+ /**
+ * \brief destructs DBus adapter
+ */
+ virtual ~DBusAdapter();
+
+ /**
+ * \brief inits service
+ * \return true if success
+ */
+ bool Init();
+
+ /**
+ * \brief return schema messages for DBus
+ * \return schema
+ */
+ const DBusSchema& get_schema() const;
+
+ protected:
+ /**
+ * \brief calls method on HMI
+ * \param id id message
+ * \param func_id id function in Ford protocol
+ * \param name pair interface and name of method for call
+ * \param obj params for call
+ */
+ void MethodCall(uint id, const MessageId func_id, const MessageName& name,
+ const smart_objects::SmartObject& obj);
+
+ /**
+ * \brief sends signal
+ * \param id id message
+ * \param func_id id function in Ford protocol
+ * \param name pair interface and name of signal for call
+ * \param obj params for signal
+ */
+ void Signal(const MessageId func_id, const MessageName& name,
+ const smart_objects::SmartObject& obj);
+
+ /**
+ * \brief returns result of call method to HMI
+ * \param id id message
+ * \param obj params for return
+ */
+ void MethodReturn(uint id, const MessageId func_id, const MessageName& name,
+ const smart_objects::SmartObject& obj);
+
+ /**
+ * \brief sends error on message from HMI
+ * \param id id message
+ * \param msg message from HMI
+ * \param name name of error
+ * \param description description of error
+ */
+ void Error(uint id, const std::string& name, const std::string& description);
+
+ /**
+ * \brief adds a match rule
+ * \param rule string rule in the DBus specification
+ */
+ void AddMatch(const std::string& rule);
+
+ /**
+ * \brief processes incoming message from DBus if queue isn't empty
+ * and fill obj
+ * \param obj object for send to core
+ * \return true if message processed
+ */
+ bool Process(smart_objects::SmartObject& obj);
+
+ /**
+ * \brief saves link D-Bus serial to Ford message id
+ * \param serial D-Bus message serial
+ * \param ids pair correlation id and Ford message id
+ */
+ inline void SaveRequestToHMI(uint32_t serial,
+ const std::pair<uint, MessageId>& ids);
+
+ /**
+ * \brief gets Ford message id by serial
+ * \param serial D-Bus message serial
+ * \return pair correlation id and Ford message id
+ */
+ inline std::pair<uint, MessageId> GetRequestToHMI(uint32_t serial);
+
+ /**
+ * \brief saves link D-Bus serial to Ford message id
+ * \param serial D-Bus message serial
+ * \param request D-Bus message from HMI
+ */
+ inline void SaveRequestFromHMI(uint32_t serial, DBusMessage* request);
+
+ /**
+ * \brief gets D-Bus message id by serial
+ * \param serial DBus message serial
+ * \return D-Bus message from HMI
+ */
+ inline DBusMessage* GetRequestFromHMI(uint32_t serial);
+
+ std::string sdl_service_name_;
+ std::string sdl_object_path_;
+ std::string hmi_service_name_;
+ std::string hmi_object_path_;
+ DBusConnection* conn_;
+
+ private:
+ /**
+ * \brief schema messages and arguments for DBus
+ */
+ const DBusSchema* schema_;
+
+ /**
+ * \brief mapping serial message DBus on message id Ford protocol
+ */
+ std::map<uint32_t, std::pair<uint, MessageId> > requests_to_hmi_;
+
+ /**
+ * \brief mapping message id Ford protocol on message DBus
+ */
+ std::map<uint32_t, DBusMessage*> requests_from_hmi_;
+
+ /**
+ * \brief processes incoming call of method and fill obj
+ * \param msg message from DBus
+ * \param obj object for send to core
+ * \return true if success
+ */
+ bool ProcessMethodCall(DBusMessage* msg, smart_objects::SmartObject& obj);
+
+ /**
+ * \brief processes incoming return of method and fill obj
+ * \param msg message from DBus
+ * \param obj object for send to core
+ * \return true if success
+ */
+ bool ProcessMethodReturn(DBusMessage* msg, smart_objects::SmartObject& obj);
+
+ /**
+ * \brief processes incoming error and fill obj
+ * \param msg message from DBus
+ * \param obj object for send to core
+ * \return true if success
+ */
+ bool ProcessError(DBusMessage* msg, smart_objects::SmartObject& obj);
+
+ /**
+ * \brief processes incoming signal and fill obj
+ * \param msg message from DBus
+ * \param obj object for send to core
+ * \return true if success
+ */
+ bool ProcessSignal(DBusMessage* msg, smart_objects::SmartObject& obj);
+
+ /**
+ * \brief sets arguments to message
+ * \param msg DBus message
+ * \param rules list of rules for arguments
+ * \param args map of arguments
+ * \return true if success
+ */
+ bool SetArguments(DBusMessage* msg, const ListArgs& rules,
+ const smart_objects::SmartObject& args);
+
+ /**
+ * \brief Sets one argument to message
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param value of argument
+ * \return true if success
+ */
+ bool SetOneArgument(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ const smart_objects::SmartObject& param);
+
+ /**
+ * \brief sets value for argument
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param value of argument
+ * \return true if success
+ */
+ bool SetValue(DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ const smart_objects::SmartObject& param);
+
+ /**
+ * \brief sets value for every element of argument
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param array values of argument
+ * \return true if success
+ */
+ bool SetArrayValue(DBusMessageIter* iter,
+ const ford_message_descriptions::ArrayDescription* rules,
+ const smart_objects::SmartObject& param);
+
+ /**
+ * \brief sets struct value for argument
+ * \param iter DBus message iter
+ * \param rules description for argument
+ * \param param structure
+ * \return true if success
+ */
+ bool SetStructValue(DBusMessageIter* iter,
+ const ford_message_descriptions::StructDescription* rules,
+ const smart_objects::SmartObject& param);
+
+ /**
+ * \brief sets optional value for argument.
+ * Optional param is struct bool, value
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param value of optional argument
+ * \return true if success
+ */
+ bool SetOptionalValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ const smart_objects::SmartObject &param);
+
+ /**
+ * \brief gets arguments from message
+ * \param iter DBus message iterator
+ * \param code response code (output)
+ * \param message response message (output)
+ * \return true if success
+ */
+ bool GetHeader(DBusMessageIter* iter, int *code, std::string *message);
+
+ /**
+ * \brief gets arguments from message with header
+ * \param iter DBus message iterator
+ * \param rules list of rules for arguments
+ * \param args map of arguments
+ * \return true if success
+ */
+ bool GetArguments(DBusMessageIter* iter, const ListArgs& rules,
+ smart_objects::SmartObject& args);
+
+ /**
+ * \brief gets one argument from message
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param args map of arguments
+ * \return true if success
+ */
+ bool GetOneArgument(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ smart_objects::SmartObject &args);
+
+ /**
+ * \brief gets value for argument
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param value of argument
+ * \return true if success
+ */
+ bool GetValue(DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ smart_objects::SmartObject& param);
+
+ /**
+ * \brief gets value for every element of argument
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param array values of argument
+ * \return true if success
+ */
+ bool GetArrayValue(DBusMessageIter* iter,
+ const ford_message_descriptions::ArrayDescription* rules,
+ smart_objects::SmartObject& param);
+
+ /**
+ * \brief gets struct value for argument
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param structure
+ * \return true if success
+ */
+ bool GetStructValue(DBusMessageIter* iter,
+ const ford_message_descriptions::StructDescription* rules,
+ smart_objects::SmartObject& param);
+
+ /**
+ * \brief gets optional value for argument.
+ * Optional param is struct bool, value
+ * \param iter DBus message iterator
+ * \param rules description for argument
+ * \param param value of optional argument
+ * \return true if success
+ */
+ bool GetOptionalValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ smart_objects::SmartObject &param);
+
+ /**
+ * \brief processes request on introspect
+ * \param msg DBus message
+ */
+ void Introspect(DBusMessage* msg);
+};
+
+} // namespace dbus
+
+#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_ADAPTER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message.h b/src/components/dbus/include/dbus/dbus_message.h
new file mode 100644
index 0000000000..42ec68b3bf
--- /dev/null
+++ b/src/components/dbus/include/dbus/dbus_message.h
@@ -0,0 +1,176 @@
+/* Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DBUS_DBUS_MESSAGE_H
+#define DBUS_DBUS_MESSAGE_H
+
+#include <stdint.h>
+#include <string>
+
+#include <dbus/dbus.h>
+
+namespace dbus {
+
+enum ContainerType {
+ kArray = DBUS_TYPE_ARRAY,
+ kStruct = DBUS_TYPE_STRUCT,
+ kDictEntry = DBUS_TYPE_DICT_ENTRY
+};
+
+class MessageRefKeeper {
+public:
+ MessageRefKeeper();
+ MessageRefKeeper(DBusMessage* message);
+ ~MessageRefKeeper();
+ MessageRefKeeper(const MessageRefKeeper& other);
+ MessageRefKeeper& operator=(MessageRefKeeper other);
+ DBusMessage* get() const;
+ DBusMessage* Pass();
+ void swap(MessageRefKeeper& other);
+private:
+ DBusMessage* raw_message_;
+};
+
+class MessageRef {
+ public:
+ MessageRef(DBusMessage* message);
+ ~MessageRef();
+ std::string GetInterface() const;
+ std::string GetMember() const;
+ protected:
+ MessageRefKeeper raw_message_ref_;
+ friend class MessageReader;
+ friend class MessageWriter;
+};
+
+class MessageReader {
+ public:
+ // Main constructor
+ MessageReader(const MessageRef& message);
+ bool has_failed() const;
+ bool IsAtLastElement() const;
+ bool HasNext() const;
+
+ // Type checkers
+ bool NextIsInvalid() const;
+ bool NextIsBool() const;
+ bool NextIsByte() const;
+ bool NextIsInt16() const;
+ bool NextIsUint16() const;
+ bool NextIsInt32() const;
+ bool NextIsUint32() const;
+ bool NextIsInt64() const;
+ bool NextIsUint64() const;
+ bool NextIsDouble() const;
+ bool NextIsString() const;
+ bool NextIsArray() const;
+ bool NextIsStruct() const;
+ bool NextIsDictEntry() const;
+
+ // Readers
+ bool TakeBool();
+ uint8_t TakeByte();
+ int16_t TakeInt16();
+ uint16_t TakeUint16();
+ int32_t TakeInt32();
+ uint32_t TakeUint32();
+ int64_t TakeInt64();
+ uint64_t TakeUint64();
+ double TakeDouble();
+ std::string TakeString();
+
+ MessageReader TakeArrayReader();
+ MessageReader TakeStructReader();
+ MessageReader TakeDictEntryReader();
+ private:
+ typedef int DataType;
+ // Container reader constructor
+ MessageReader(MessageReader* reader,
+ DataType container_data_type);
+ void MoveToNext();
+ void MarkFailed();
+ DataType NextValueType() const;
+ void ReadNextValue(DataType type, void* value);
+ private:
+ // Fields
+ MessageReader* parent_reader_;
+ bool failed_;
+ DBusMessageIter iterator_;
+};
+
+class MessageWriter {
+ public:
+ // Methods
+ // Main appending constructor
+ MessageWriter(const MessageRef& message);
+ // Container writer constructor
+ MessageWriter(MessageWriter* parent,
+ ContainerType type,
+ const char* array_signature);
+ ~MessageWriter();
+ void PutBool(bool value);
+ void PutByte(uint8_t value);
+ void PutInt16(int16_t value);
+ void PutUint16(uint16_t value);
+ void PutInt32(int32_t value);
+ void PutUint32(uint32_t value);
+ void PutInt64(int64_t value);
+ void PutUint64(uint64_t value);
+ void PutDouble(double value);
+ void PutString(const std::string& value);
+ private:
+ typedef int DataType;
+ // Main constructor
+ void WriteAndCheck(DataType value_type, const void* value);
+ void CloseWriter();
+ private:
+ //Fields
+ bool has_opened_subcontainer_;
+ MessageWriter* parent_writer_;
+ DBusMessageIter iterator_;
+
+ // Disallow copy and assign
+ MessageWriter(const MessageWriter& other);
+ MessageWriter& operator=(const MessageWriter& other);
+};
+
+MessageRef MethodCall(const char* bus_name,
+ const char* path,
+ const char* interface,
+ const char* method);
+MessageRef Signal(const char *path,
+ const char *interface,
+ const char *name);
+} // namespace dbus
+
+#include "dbus/dbus_message_inl.h"
+
+#endif // DBUS_DBUS_MESSAGE_H
diff --git a/src/components/dbus/include/dbus/dbus_message_controller.h b/src/components/dbus/include/dbus/dbus_message_controller.h
new file mode 100644
index 0000000000..0d0638d84f
--- /dev/null
+++ b/src/components/dbus/include/dbus/dbus_message_controller.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
+#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
+
+#include <string>
+#include <map>
+#include "dbus/dbus_adapter.h"
+
+namespace dbus {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+class DBusMessageController : public DBusAdapter {
+ public:
+ /**
+ * \brief constructs DBus message controller
+ * \param sdlServiceName name of service SDL
+ * \param sdlObjectPath path of object SDL
+ * \param hmiServiceName name of service HMI
+ * \param hmiObjectPath path of object HMI
+ */
+ DBusMessageController(const std::string& sdlServiceName,
+ const std::string& sdlObjectPath,
+ const std::string& hmiServiceName,
+ const std::string& hmiObjectPath);
+
+ /**
+ * \brief destructs DBus message controller
+ */
+ virtual ~DBusMessageController();
+
+ /**
+ * \brief subscribes to the DBus signal.
+ * \param interface name of interface in HMI
+ * \param signal name of signal
+ */
+ void SubscribeTo(const std::string& interface, const std::string& signal);
+
+ /**
+ * \brief Method for receiving thread.
+ */
+ void* MethodForReceiverThread(void*);
+
+ protected:
+ /**
+ * \brief sends message to core
+ * \param obj
+ */
+ virtual void SendMessageToCore(const smart_objects::SmartObject& obj) = 0;
+};
+
+} // namespace dbus
+
+#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_inl.h b/src/components/dbus/include/dbus/dbus_message_inl.h
new file mode 100644
index 0000000000..714e66ea33
--- /dev/null
+++ b/src/components/dbus/include/dbus/dbus_message_inl.h
@@ -0,0 +1,218 @@
+/* Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DBUS_MESSAGE_INL_H
+#define DBUS_MESSAGE_INL_H
+
+#include "dbus/dbus_message.h"
+
+namespace dbus {
+// MessageReader
+inline bool MessageReader::has_failed() const {
+ return failed_;
+}
+
+inline bool MessageReader::IsAtLastElement() const {
+ DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
+ return dbus_message_iter_has_next(iter) == 0;
+}
+
+inline bool MessageReader::HasNext() const {
+ return !failed_ && NextValueType() != DBUS_TYPE_INVALID;
+}
+
+inline bool MessageReader::NextIsInvalid() const {
+ return NextValueType() == DBUS_TYPE_INVALID;
+}
+
+inline bool MessageReader::NextIsBool() const {
+ return NextValueType() == DBUS_TYPE_BOOLEAN;
+}
+
+inline bool MessageReader::NextIsByte() const {
+ return NextValueType() == DBUS_TYPE_BYTE;
+}
+
+inline bool MessageReader::NextIsInt16() const {
+ return NextValueType() == DBUS_TYPE_INT16;
+}
+
+inline bool MessageReader::NextIsUint16() const {
+ return NextValueType() == DBUS_TYPE_UINT16;
+}
+
+inline bool MessageReader::NextIsInt32() const {
+ return NextValueType() == DBUS_TYPE_INT32;
+}
+
+inline bool MessageReader::NextIsUint32() const {
+ return NextValueType() == DBUS_TYPE_UINT32;
+}
+
+inline bool MessageReader::NextIsInt64() const {
+ return NextValueType() == DBUS_TYPE_INT64;
+}
+
+inline bool MessageReader::NextIsUint64() const {
+ return NextValueType() == DBUS_TYPE_UINT64;
+}
+
+inline bool MessageReader::NextIsDouble() const {
+ return NextValueType() == DBUS_TYPE_DOUBLE;
+}
+
+inline bool MessageReader::NextIsString() const {
+ return NextValueType() == DBUS_TYPE_STRING;
+}
+
+inline bool MessageReader::NextIsArray() const {
+ return NextValueType() == DBUS_TYPE_ARRAY;
+}
+
+inline bool MessageReader::NextIsStruct() const {
+ return NextValueType() == DBUS_TYPE_STRUCT;
+}
+
+inline bool MessageReader::TakeBool() {
+ dbus_bool_t value = 0;
+ ReadNextValue(DBUS_TYPE_BOOLEAN, &value);
+ return value != 0;
+}
+
+inline uint8_t MessageReader::TakeByte() {
+ uint8_t value = 0;
+ ReadNextValue(DBUS_TYPE_BYTE, &value);
+ return value;
+}
+
+inline int16_t MessageReader::TakeInt16() {
+ int16_t value = 0;
+ ReadNextValue(DBUS_TYPE_INT16, &value);
+ return value;
+}
+
+inline uint16_t MessageReader::TakeUint16() {
+ uint16_t value = 0;
+ ReadNextValue(DBUS_TYPE_UINT16, &value);
+ return value;
+}
+
+inline int32_t MessageReader::TakeInt32() {
+ int32_t value = 0;
+ ReadNextValue(DBUS_TYPE_INT32, &value);
+ return value;
+}
+
+inline uint32_t MessageReader::TakeUint32() {
+ uint32_t value = 0;
+ ReadNextValue(DBUS_TYPE_UINT32, &value);
+ return value;
+}
+
+inline int64_t MessageReader::TakeInt64() {
+ int64_t value = 0;
+ ReadNextValue(DBUS_TYPE_INT64, &value);
+ return value;
+}
+
+inline uint64_t MessageReader::TakeUint64() {
+ uint64_t value = 0;
+ ReadNextValue(DBUS_TYPE_UINT64, &value);
+ return value;
+}
+
+inline double MessageReader::TakeDouble() {
+ double value = 0.;
+ ReadNextValue(DBUS_TYPE_DOUBLE, &value);
+ return value;
+}
+
+inline std::string MessageReader::TakeString() {
+ const char* value = "";
+ ReadNextValue(DBUS_TYPE_STRING, &value);
+ return value;
+}
+
+
+inline MessageReader::DataType MessageReader::NextValueType() const {
+ DBusMessageIter* iter = const_cast<DBusMessageIter*>(&iterator_);
+ return failed_ ? DBUS_TYPE_INVALID : dbus_message_iter_get_arg_type(iter);
+}
+
+
+
+// Message writer methods
+inline void MessageWriter::PutBool(bool value) {
+ dbus_bool_t dbus_value = value;
+ WriteAndCheck(DBUS_TYPE_BOOLEAN, &dbus_value);
+}
+
+inline void MessageWriter::PutByte(uint8_t value) {
+ WriteAndCheck(DBUS_TYPE_BYTE, &value);
+}
+
+inline void MessageWriter::PutInt16(int16_t value) {
+ WriteAndCheck(DBUS_TYPE_INT16, &value);
+}
+
+inline void MessageWriter::PutUint16(uint16_t value) {
+ WriteAndCheck(DBUS_TYPE_UINT16, &value);
+}
+
+inline void MessageWriter::PutInt32(int32_t value) {
+ WriteAndCheck(DBUS_TYPE_INT32, &value);
+}
+
+inline void MessageWriter::PutUint32(uint32_t value) {
+ WriteAndCheck(DBUS_TYPE_UINT32, &value);
+}
+
+inline void MessageWriter::PutInt64(int64_t value) {
+ WriteAndCheck(DBUS_TYPE_INT64, &value);
+}
+
+inline void MessageWriter::PutUint64(uint64_t value) {
+ WriteAndCheck(DBUS_TYPE_UINT64, &value);
+}
+
+inline void MessageWriter::PutDouble(double value) {
+ WriteAndCheck(DBUS_TYPE_DOUBLE, &value);
+}
+
+inline void MessageWriter::PutString(const std::string& value) {
+ const char* pointer = value.c_str();
+ WriteAndCheck(DBUS_TYPE_STRING, &pointer);
+}
+
+
+} // namespace dbus
+
+#endif // DBUS_MESSAGE_INL_H
diff --git a/src/components/dbus/include/dbus/message_descriptions.h b/src/components/dbus/include/dbus/message_descriptions.h
new file mode 100644
index 0000000000..9f73b25737
--- /dev/null
+++ b/src/components/dbus/include/dbus/message_descriptions.h
@@ -0,0 +1,73 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
+#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
+
+#include <stdint.h>
+#include <stdlib.h>
+#include "interfaces/HMI_API.h"
+
+namespace ford_message_descriptions {
+
+enum ParameterType {Integer, Boolean, Float, String, Struct, Enum, Array};
+
+struct ParameterDescription {
+ const char* name;
+ const ParameterType type;
+ const bool obligatory; // TODO (dchmerev@luxoft.com): rename to 'mandatory' as in HMI API description
+};
+
+struct ArrayDescription {
+ const ParameterDescription base;
+ const ParameterDescription* element;
+ const char* element_dbus_signature;
+};
+
+struct StructDescription {
+ const ParameterDescription base;
+ const ParameterDescription** parameters;
+};
+
+struct MessageDescription {
+ const char* interface;
+ const char* name;
+ const hmi_apis::messageType::eType message_type;
+ const hmi_apis::FunctionID::eType function_id;
+ const ParameterDescription** parameters;
+};
+
+extern const MessageDescription* message_descriptions[];
+
+} // namespace ford_message_descriptions
+
+#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_MESSAGE_DESCRIPTIONS_H_
+
diff --git a/src/components/dbus/include/dbus/schema.h b/src/components/dbus/include/dbus/schema.h
new file mode 100644
index 0000000000..d1ba37f232
--- /dev/null
+++ b/src/components/dbus/include/dbus/schema.h
@@ -0,0 +1,98 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef SRC_COMPONENTS_DBUS_SCHEMA_INCLUDE_DBUS_SCHEMA_SCHEMA_H_
+#define SRC_COMPONENTS_DBUS_SCHEMA_INCLUDE_DBUS_SCHEMA_SCHEMA_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+
+#include "dbus/message_descriptions.h"
+#include "interfaces/HMI_API.h"
+
+namespace dbus {
+
+using ford_message_descriptions::ParameterDescription;
+using ford_message_descriptions::MessageDescription;
+
+struct Description;
+
+typedef hmi_apis::FunctionID::eType MessageId;
+typedef hmi_apis::messageType::eType MessageType;
+typedef std::pair<std::string, std::string> MessageName; // interface, message
+typedef std::vector<const ParameterDescription*> ListArgs;
+typedef std::vector<const Description*> Messages;
+
+/**
+ * \brief Wrapper class for message description
+ */
+class DBusSchema {
+ public:
+ explicit DBusSchema(const MessageDescription** array);
+
+ /**
+ * \brief gets message name by message id
+ * \param id id message
+ * \return name message
+ */
+ MessageName getMessageName(MessageId id) const;
+
+ /**
+ * \brief gets message id by message name
+ * \param name name message
+ * \return id message
+ */
+ MessageId getMessageId(const MessageName& name) const;
+
+ /**
+ * \brief gets list rules for arguments
+ * \param id id message
+ * \param type type message
+ * \return list rules
+ */
+ ListArgs getListArgs(MessageId id, MessageType type) const;
+
+ /**
+ * \brief gets list rules for arguments
+ * @param name name message
+ * @param type type message
+ * @return list rules
+ */
+ ListArgs getListArgs(const MessageName& name, MessageType type) const;
+
+ private:
+ Messages msgs_;
+};
+
+} // namespace dbus
+
+#endif // SRC_COMPONENTS_DBUS_SCHEMA_INCLUDE_DBUS_SCHEMA_SCHEMA_H_
diff --git a/src/components/dbus/src/dbus_adapter.cc b/src/components/dbus/src/dbus_adapter.cc
new file mode 100644
index 0000000000..5f38e3d80f
--- /dev/null
+++ b/src/components/dbus/src/dbus_adapter.cc
@@ -0,0 +1,918 @@
+/*
+ * Copyright (c) 2013-2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "dbus/dbus_adapter.h"
+#include <dbus/dbus.h>
+#include <sstream>
+#include "formatters/CSmartFactory.hpp"
+#include "utils/logger.h"
+
+using ford_message_descriptions::ParameterDescription;
+namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+extern char introspection_xml[];
+
+namespace dbus {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
+
+std::vector<std::string> &split(const std::string& s, char delim,
+ std::vector<std::string> &elems) {
+ std::stringstream ss(s);
+ std::string item;
+ while (std::getline(ss, item, delim)) {
+ elems.push_back(item);
+ }
+ return elems;
+}
+
+DBusAdapter::DBusAdapter(const std::string& sdlServiceName,
+ const std::string& sdlObjectPath,
+ const std::string& hmiServiceName,
+ const std::string& hmiObjectPath)
+ : sdl_service_name_(sdlServiceName),
+ sdl_object_path_(sdlObjectPath),
+ hmi_service_name_(hmiServiceName),
+ hmi_object_path_(hmiObjectPath),
+ conn_(NULL),
+ schema_(new DBusSchema(ford_message_descriptions::message_descriptions)) {
+}
+
+DBusAdapter::~DBusAdapter() {
+ dbus_shutdown();
+ delete schema_;
+}
+
+bool DBusAdapter::Init() {
+ DBusError err;
+ int ret;
+ dbus_error_init(&err);
+ if (!dbus_threads_init_default()) {
+ LOG4CXX_ERROR(logger_, "DBus: Can't initializes threads");
+ return false;
+ }
+ conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
+ if (dbus_error_is_set(&err)) {
+ LOG4CXX_ERROR(logger_, "DBus: Connection Error " << err.message);
+ dbus_error_free(&err);
+ return false;
+ }
+ ret = dbus_bus_request_name(conn_, sdl_service_name_.c_str(),
+ DBUS_NAME_FLAG_DO_NOT_QUEUE,
+ &err);
+ if (ret == -1 || dbus_error_is_set(&err)) {
+ LOG4CXX_ERROR(logger_, "DBus: Can't request name " << err.name);
+ dbus_error_free(&err);
+ return false;
+ }
+ if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) {
+ LOG4CXX_ERROR(
+ logger_,
+ "DBus: Service '" << sdl_service_name_ << "' is already running");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger_, "DBus: Success init dbus adaptor");
+ return true;
+}
+
+bool DBusAdapter::Process(smart_objects::SmartObject& obj) {
+ if (conn_ == NULL) {
+ LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't initialized");
+ return false;
+ }
+ DBusMessage* msg = dbus_connection_pop_message(conn_);
+ if (msg != NULL) {
+ switch (dbus_message_get_type(msg)) {
+ case DBUS_MESSAGE_TYPE_METHOD_CALL:
+ return ProcessMethodCall(msg, obj);
+ case DBUS_MESSAGE_TYPE_METHOD_RETURN:
+ return ProcessMethodReturn(msg, obj);
+ case DBUS_MESSAGE_TYPE_ERROR:
+ return ProcessError(msg, obj);
+ case DBUS_MESSAGE_TYPE_SIGNAL:
+ return ProcessSignal(msg, obj);
+ default:
+ return false;
+ }
+ } else {
+ dbus_connection_read_write(conn_, 50);
+ }
+ return false;
+}
+
+void DBusAdapter::MethodReturn(uint id, const MessageId func_id,
+ const MessageName& name,
+ const smart_objects::SmartObject& obj) {
+ LOG4CXX_DEBUG(logger_, "Method return " << name.first << "." << name.second);
+ if (conn_ == NULL) {
+ LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
+ return;
+ }
+
+ if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
+ return;
+ }
+
+ DBusMessage* msg = GetRequestFromHMI(id);
+ if (!msg) {
+ LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
+ return;
+ }
+
+ DBusMessage* reply;
+ reply = dbus_message_new_method_return(msg);
+ if (NULL == reply) {
+ LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
+ return;
+ }
+
+ const ListArgs& args = schema_->getListArgs(func_id,
+ hmi_apis::messageType::response);
+ if (!SetArguments(reply, args, obj)) {
+ LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
+ dbus_message_unref(reply);
+ dbus_message_unref(msg);
+ return;
+ }
+
+ dbus_uint32_t serial;
+ if (!dbus_connection_send(conn_, reply, &serial)) {
+ LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
+ dbus_message_unref(reply);
+ dbus_message_unref(msg);
+ return;
+ }
+ dbus_connection_flush(conn_);
+ dbus_message_unref(reply);
+ dbus_message_unref(msg);
+ LOG4CXX_INFO(logger_, "DBus: Success return method");
+}
+
+void DBusAdapter::Error(uint id, const std::string& name,
+ const std::string& description) {
+ LOG4CXX_DEBUG(logger_, "Error " << name << ": " << description);
+ if (conn_ == NULL) {
+ LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
+ return;
+ }
+
+ DBusMessage* msg = GetRequestFromHMI(id);
+ if (!msg) {
+ LOG4CXX_WARN(logger_, "DBus: request from HMI is not found");
+ return;
+ }
+
+ DBusMessage* error;
+ error = dbus_message_new_error(msg, name.c_str(), description.c_str());
+ if (NULL == error) {
+ LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
+ return;
+ }
+
+ dbus_uint32_t serial;
+ if (!dbus_connection_send(conn_, error, &serial)) {
+ LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
+ dbus_message_unref(error);
+ dbus_message_unref(msg);
+ return;
+ }
+ dbus_connection_flush(conn_);
+ dbus_message_unref(error);
+ dbus_message_unref(msg);
+ LOG4CXX_INFO(logger_, "DBus: Success error");
+}
+
+void DBusAdapter::MethodCall(uint id, const MessageId func_id,
+ const MessageName& name,
+ const smart_objects::SmartObject& obj) {
+ LOG4CXX_DEBUG(logger_, "Method call " << name.first << "." << name.second);
+ if (conn_ == NULL) {
+ LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
+ return;
+ }
+
+ if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
+ return;
+ }
+
+ DBusMessage* msg;
+ msg = dbus_message_new_method_call(
+ hmi_service_name_.c_str(), hmi_object_path_.c_str(),
+ (hmi_service_name_ + "." + name.first).c_str(), name.second.c_str());
+ if (NULL == msg) {
+ LOG4CXX_WARN(logger_, "DBus: Failed call method (Message Null)");
+ return;
+ }
+
+ const ListArgs& args = schema_->getListArgs(func_id,
+ hmi_apis::messageType::request);
+ if (!SetArguments(msg, args, obj)) {
+ LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
+ dbus_message_unref(msg);
+ return;
+ }
+
+ dbus_uint32_t serial;
+ if (!dbus_connection_send(conn_, msg, &serial)) {
+ LOG4CXX_ERROR(logger_, "DBus: Failed call method (Can't send message)");
+ dbus_message_unref(msg);
+ return;
+ }
+ SaveRequestToHMI(serial, std::make_pair(id, func_id));
+ dbus_message_unref(msg);
+ LOG4CXX_INFO(logger_, "DBus: Success call method");
+}
+
+void DBusAdapter::Signal(const MessageId func_id, const MessageName& name,
+ const smart_objects::SmartObject& obj) {
+ LOG4CXX_DEBUG(logger_, "Signal " << name.first << "." << name.second);
+ if (conn_ == NULL) {
+ LOG4CXX_ERROR(logger_, "DBus: DBusAdaptor isn't init");
+ return;
+ }
+
+ if (func_id == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
+ return;
+ }
+
+ DBusMessage *msg;
+ msg = dbus_message_new_signal(sdl_object_path_.c_str(),
+ (sdl_service_name_ + "." + name.first).c_str(),
+ name.second.c_str());
+ if (NULL == msg) {
+ LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Message Null)");
+ return;
+ }
+
+ const ListArgs& args = schema_->getListArgs(
+ func_id, hmi_apis::messageType::notification);
+ if (!SetArguments(msg, args, obj)) {
+ LOG4CXX_ERROR(logger_, "DBus: Failed call method (Signature is wrong)");
+ dbus_message_unref(msg);
+ return;
+ }
+
+ if (!dbus_connection_send(conn_, msg, NULL)) { // serial isn't required
+ LOG4CXX_WARN(logger_, "DBus: Failed emit signal (Out Of Memory)");
+ dbus_message_unref(msg);
+ return;
+ }
+ dbus_message_unref(msg);
+ LOG4CXX_INFO(logger_, "DBus: Success emit signal");
+}
+
+void DBusAdapter::AddMatch(const std::string& rule) {
+ LOG4CXX_INFO(logger_, "Subscription: " << rule);
+ dbus_bus_add_match(conn_, rule.c_str(), NULL);
+}
+
+bool DBusAdapter::ProcessMethodCall(DBusMessage* msg,
+ smart_objects::SmartObject& obj) {
+ std::string method = dbus_message_get_member(msg);
+ std::string interface = dbus_message_get_interface(msg);
+ LOG4CXX_INFO(logger_, "DBus: name of method " << interface << " " << method);
+
+ if (interface == "org.freedesktop.DBus.Introspectable"
+ && method == "Introspect") {
+ LOG4CXX_INFO(logger_, "DBus: INTROSPECT");
+ Introspect(msg);
+ return false;
+ }
+
+ std::vector<std::string> elems;
+ split(interface, '.', elems);
+ MessageName name(elems.back(), method);
+ MessageId m_id = schema_->getMessageId(name);
+ if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name method call from hmi");
+ return false;
+ }
+
+ uint32_t serial = dbus_message_get_serial(msg);
+ if (!serial) {
+ LOG4CXX_ERROR(logger_, "DBus: Serial of request from HMI isn't defined");
+ return false;
+ }
+
+ obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = serial;
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
+ obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::request;
+ obj[sos::S_MSG_PARAMS] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ const ListArgs args = schema_->getListArgs(name,
+ hmi_apis::messageType::request);
+
+ DBusMessageIter iter;
+ dbus_message_iter_init(msg, &iter);
+ if (GetArguments(&iter, args, obj[sos::S_MSG_PARAMS])) {
+ SaveRequestFromHMI(serial, msg);
+ return true;
+ }
+ return false;
+}
+
+bool DBusAdapter::ProcessMethodReturn(DBusMessage* msg,
+ smart_objects::SmartObject& obj) {
+ LOG4CXX_INFO(logger_, "ProcessMethodReturn");
+ dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
+ std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
+ if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
+ return false;
+ }
+
+ obj[sos::S_MSG_PARAMS] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ ListArgs args = schema_->getListArgs(ids.second,
+ hmi_apis::messageType::response);
+ DBusMessageIter iter;
+ dbus_message_iter_init(msg, &iter);
+ int code = 0;
+ std::string message;
+ smart_objects::SmartObject description(smart_objects::SmartType_Map);
+ bool ret = GetHeader(&iter, &code, &message)
+ && GetArguments(&iter, args, description);
+
+ if (ret) {
+ obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
+ obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::response;
+ obj[sos::S_PARAMS][sos::kCode] = code;
+ obj[sos::S_PARAMS][sos::kMessage] = message;
+ if (code != hmi_apis::Common_Result::SUCCESS) {
+ MessageName name = schema_->getMessageName(ids.second);
+ description["method"] = name.first + "." + name.second;
+ obj[sos::S_PARAMS]["data"] = description;
+ } else {
+ obj[sos::S_MSG_PARAMS] = description;
+ }
+ }
+
+ dbus_message_unref(msg);
+ return ret;
+}
+
+bool DBusAdapter::ProcessError(DBusMessage* msg,
+ smart_objects::SmartObject& obj) {
+ dbus_uint32_t reply_serial = dbus_message_get_reply_serial(msg);
+ std::pair<uint, MessageId> ids = GetRequestToHMI(reply_serial);
+ if (ids.second == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name method");
+ return false;
+ }
+
+ const char* error_name;
+ bool ret = false;
+ if ((error_name = dbus_message_get_error_name(msg)) != NULL) {
+ smart_objects::SmartObject name(smart_objects::SmartType_String);
+ name = error_name;
+ ford_message_descriptions::ParameterDescription rule = { "description",
+ ford_message_descriptions::String, true };
+ ListArgs args;
+ args.push_back(&rule);
+ smart_objects::SmartObject description(smart_objects::SmartType_Map);
+ description[rule.name] = smart_objects::SmartObject(
+ smart_objects::SmartType_String);
+
+ DBusMessageIter iter;
+ dbus_message_iter_init(msg, &iter);
+ ret = GetArguments(&iter, args, description);
+ MessageName method = schema_->getMessageName(ids.second);
+
+ obj[sos::S_PARAMS][sos::S_CORRELATION_ID] = ids.first;
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = ids.second;
+ obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] =
+ hmi_apis::messageType::error_response;
+ obj[sos::S_PARAMS][sos::kCode] = name.asInt();
+ obj[sos::S_PARAMS][sos::kMessage] = description[rule.name].asString();
+ obj[sos::S_MSG_PARAMS] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ obj[sos::S_PARAMS]["data"]["method"] = method.first + "." + method.second;
+
+ LOG4CXX_WARN(
+ logger_,
+ "DBus: Call of method " << method.first << "." << method.second << " returned error " << name.asInt() << ": " << description[rule.name].asString());
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Type message isn't error");
+ }
+
+ dbus_message_unref(msg);
+ return ret;
+}
+
+bool DBusAdapter::ProcessSignal(DBusMessage* msg,
+ smart_objects::SmartObject& obj) {
+ std::string method = dbus_message_get_member(msg);
+ std::string interface = dbus_message_get_interface(msg);
+ LOG4CXX_INFO(logger_, "DBus: name of signal " << method);
+
+ std::vector<std::string> elems;
+ split(interface, '.', elems);
+ MessageName name(elems.back(), method);
+ MessageId m_id = schema_->getMessageId(name);
+ if (m_id == hmi_apis::FunctionID::INVALID_ENUM) {
+ LOG4CXX_ERROR(logger_, "DBus: Invalid name signal");
+ return false;
+ }
+
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID] = m_id;
+ obj[sos::S_PARAMS][sos::S_MESSAGE_TYPE] = hmi_apis::messageType::notification;
+ obj[sos::S_MSG_PARAMS] = smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+
+ const ListArgs args = schema_->getListArgs(
+ name, hmi_apis::messageType::notification);
+
+ DBusMessageIter iter;
+ dbus_message_iter_init(msg, &iter);
+ bool ret = GetArguments(&iter, args, obj[sos::S_MSG_PARAMS]);
+ dbus_message_unref(msg);
+ return ret;
+}
+
+bool DBusAdapter::SetArguments(DBusMessage* msg, const ListArgs& rules,
+ const smart_objects::SmartObject& args) {
+ DBusMessageIter iter;
+ dbus_message_iter_init_append(msg, &iter);
+ size_t size = rules.size();
+ for (size_t i = 0; i < size; ++i) {
+ const smart_objects::SmartObject& param = args.getElement(rules[i]->name);
+ if (!SetOneArgument(&iter, rules[i], param)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool DBusAdapter::SetOneArgument(DBusMessageIter* iter,
+ const ParameterDescription* rules,
+ const smart_objects::SmartObject& param) {
+ if (rules->obligatory) {
+ if (param.isValid()) {
+ return SetValue(iter, rules, param);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "DBus: Argument '" << rules->name << "' is obligatory!");
+ return false;
+ }
+ } else {
+ return SetOptionalValue(iter, rules, param);
+ }
+}
+
+bool DBusAdapter::SetValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ const smart_objects::SmartObject& param) {
+ // LOG4CXX_DEBUG(logger_, "DBus: Set param " << rules->name << " = " << param.asString());
+ int type = 0;
+ void* value = 0;
+ dbus_int32_t integerValue = 0;
+ double floatValue = 0;
+ dbus_bool_t booleanValue = false;
+ const char* stringValue;
+ switch (rules->type) {
+ case ford_message_descriptions::ParameterType::Array:
+ return SetArrayValue(
+ iter,
+ reinterpret_cast<const ford_message_descriptions::ArrayDescription*>(rules),
+ param);
+ break;
+ case ford_message_descriptions::ParameterType::Struct:
+ return SetStructValue(
+ iter,
+ reinterpret_cast<const ford_message_descriptions::StructDescription*>(rules),
+ param);
+ break;
+ case ford_message_descriptions::ParameterType::Enum:
+ case ford_message_descriptions::ParameterType::Integer:
+ type = DBUS_TYPE_INT32;
+ integerValue = param.asInt();
+ value = &integerValue;
+ break;
+ case ford_message_descriptions::ParameterType::Float:
+ type = DBUS_TYPE_DOUBLE;
+ floatValue = param.asDouble();
+ value = &floatValue;
+ break;
+ case ford_message_descriptions::ParameterType::Boolean:
+ type = DBUS_TYPE_BOOLEAN;
+ booleanValue = param.asBool();
+ value = &booleanValue;
+ break;
+ case ford_message_descriptions::ParameterType::String:
+ type = DBUS_TYPE_STRING;
+ stringValue = param.asString().c_str();
+ value = &stringValue;
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument")
+ ;
+ return false;
+ }
+ return dbus_message_iter_append_basic(iter, type, value);
+}
+
+bool DBusAdapter::SetOptionalValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ const smart_objects::SmartObject &param) {
+ DBusMessageIter sub_iter;
+ if (!dbus_message_iter_open_container(iter, DBUS_TYPE_STRUCT, NULL,
+ &sub_iter)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "DBus: Can't open container type (STRUCT) for optional parameter");
+ return false;
+ }
+
+ ford_message_descriptions::ParameterDescription flagRules = { "flag",
+ ford_message_descriptions::Boolean, true };
+ smart_objects::SmartObject flag(
+ param.getType() != smart_objects::SmartType_Invalid);
+ if (!SetValue(&sub_iter, &flagRules, flag)
+ || !SetValue(&sub_iter, rules, param)) {
+ return false;
+ }
+
+ if (!dbus_message_iter_close_container(iter, &sub_iter)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "DBus: Can't close container type (STRUCT) for optional parameter");
+ return false;
+ }
+ return true;
+}
+
+bool DBusAdapter::SetArrayValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ArrayDescription* rules,
+ const smart_objects::SmartObject& param) {
+ smart_objects::SmartType type = param.getType();
+ if (type != smart_objects::SmartType_Array
+ && type != smart_objects::SmartType_Invalid) {
+ LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
+ return false;
+ }
+ DBusMessageIter sub_iter;
+ if (!dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+ rules->element_dbus_signature,
+ &sub_iter)) {
+ LOG4CXX_ERROR(logger_, "DBus: Can't open container type (ARRAY)");
+ return false;
+ }
+ size_t size = param.length();
+ for (size_t i = 0; i < size; ++i) {
+ if (!SetValue(&sub_iter, rules->element, param[i])) {
+ return false;
+ }
+ }
+ if (!dbus_message_iter_close_container(iter, &sub_iter)) {
+ LOG4CXX_ERROR(logger_, "DBus: Can't close container type (ARRAY)");
+ return false;
+ }
+ return true;
+}
+
+bool DBusAdapter::SetStructValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::StructDescription* rules,
+ const smart_objects::SmartObject& structure) {
+ smart_objects::SmartType type = structure.getType();
+ if (type != smart_objects::SmartType_Map
+ && type != smart_objects::SmartType_Invalid) {
+ LOG4CXX_ERROR(logger_, "DBus: SmartObject is not a map");
+ return false;
+ }
+ DBusMessageIter sub_iter;
+ if (!dbus_message_iter_open_container(iter, DBUS_TYPE_STRUCT, NULL,
+ &sub_iter)) {
+ LOG4CXX_ERROR(logger_, "DBus: Can't open container type (STRUCT)");
+ return false;
+ }
+ const ParameterDescription** entry;
+ entry = rules->parameters;
+ while (*entry != NULL) {
+ const smart_objects::SmartObject& param = structure.getElement(
+ (*entry)->name);
+ if (!SetOneArgument(&sub_iter, *entry, param)) {
+ return false;
+ }
+ entry++;
+ }
+ if (!dbus_message_iter_close_container(iter, &sub_iter)) {
+ LOG4CXX_ERROR(logger_, "DBus: Can't close container type (STRUCT)");
+ return false;
+ }
+ return true;
+}
+
+bool DBusAdapter::GetHeader(DBusMessageIter* iter, int* code,
+ std::string* message) {
+ // Get code of response
+ dbus_int32_t intValue;
+ int type = dbus_message_iter_get_arg_type(iter);
+ if (type != DBUS_TYPE_INT32) {
+ LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
+ return false;
+ }
+ dbus_message_iter_get_basic(iter, &intValue);
+ *code = intValue;
+ LOG4CXX_DEBUG(logger_, "DBus: Code of response " << *code);
+
+ dbus_message_iter_next(iter);
+
+ // Get message of response
+ type = dbus_message_iter_get_arg_type(iter);
+ if (type != DBUS_TYPE_STRING) {
+ LOG4CXX_ERROR(logger_, "DBus: Unknown format of header");
+ return false;
+ }
+ const char* stringValue;
+ dbus_message_iter_get_basic(iter, &stringValue);
+ *message = stringValue;
+ LOG4CXX_DEBUG(logger_, "DBus: message of response " << *message);
+
+ dbus_message_iter_next(iter);
+ return true;
+}
+
+bool DBusAdapter::GetArguments(DBusMessageIter* iter, const ListArgs& rules,
+ smart_objects::SmartObject& args) {
+ LOG4CXX_TRACE(logger_, "GetArguments");
+
+ size_t size = rules.size();
+ for (size_t i = 0; i < size; ++i) {
+ if (!GetOneArgument(iter, rules[i], args)) {
+ return false;
+ }
+ dbus_message_iter_next(iter);
+ }
+ return true;
+}
+
+const DBusSchema& DBusAdapter::get_schema() const {
+ return *schema_;
+}
+
+bool DBusAdapter::GetOneArgument(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ smart_objects::SmartObject& args) {
+ if (rules->obligatory) {
+ return GetValue(iter, rules, args[rules->name]);
+ } else {
+ return GetOptionalValue(iter, rules, args);
+ }
+}
+
+bool DBusAdapter::GetValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ smart_objects::SmartObject& param) {
+ LOG4CXX_DEBUG(logger_, "DBus: Get param " << rules->name);
+ int type = dbus_message_iter_get_arg_type(iter);
+ switch (rules->type) {
+ case ford_message_descriptions::ParameterType::Array:
+ if (type == DBUS_TYPE_ARRAY) {
+ return GetArrayValue(
+ iter,
+ // FIXME (dchmerev@luxoft.com): not portable, danger cast.
+ reinterpret_cast<const ford_message_descriptions::ArrayDescription*>(rules),
+ param);
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
+ return false;
+ }
+ break;
+ case ford_message_descriptions::ParameterType::Struct:
+ if (type == DBUS_TYPE_STRUCT) {
+ return GetStructValue(
+ iter,
+ reinterpret_cast<const ford_message_descriptions::StructDescription*>(rules),
+ param);
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
+ return false;
+ }
+ break;
+ case ford_message_descriptions::ParameterType::Enum:
+ case ford_message_descriptions::ParameterType::Integer:
+ if (type == DBUS_TYPE_INT32) {
+ dbus_int32_t integerValue;
+ dbus_message_iter_get_basic(iter, &integerValue);
+ smart_objects::SmartObject value(integerValue);
+ param = value;
+ LOG4CXX_DEBUG(logger_, "DBus: " << rules->name << " = " << integerValue);
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
+ return false;
+ }
+ break;
+ case ford_message_descriptions::ParameterType::Float:
+ if (type == DBUS_TYPE_DOUBLE) {
+ double floatValue;
+ dbus_message_iter_get_basic(iter, &floatValue);
+ smart_objects::SmartObject value(floatValue);
+ param = value;
+ LOG4CXX_DEBUG(logger_, "DBus: " << rules->name << " = " << floatValue);
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
+ return false;
+ }
+ break;
+ case ford_message_descriptions::ParameterType::Boolean:
+ if (type == DBUS_TYPE_BOOLEAN) {
+ dbus_bool_t booleanValue;
+ dbus_message_iter_get_basic(iter, &booleanValue);
+ smart_objects::SmartObject value(static_cast<bool>(booleanValue));
+ param = value;
+ LOG4CXX_DEBUG(
+ logger_,
+ "DBus: " << rules->name << " = " << std::boolalpha << booleanValue);
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
+ return false;
+ }
+ break;
+ case ford_message_descriptions::ParameterType::String:
+ if (type == DBUS_TYPE_STRING) {
+ const char* stringValue;
+ dbus_message_iter_get_basic(iter, &stringValue);
+ std::string strValue = stringValue;
+ smart_objects::SmartObject value(strValue);
+ param = value;
+ LOG4CXX_DEBUG(logger_,
+ "DBus: " << rules->name << " = \"" << strValue << "\"");
+ } else {
+ LOG4CXX_ERROR(logger_, "DBus: Not expected type of argument");
+ return false;
+ }
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument")
+ ;
+ return false;
+ }
+ return true;
+}
+
+bool DBusAdapter::GetArrayValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ArrayDescription* rules,
+ smart_objects::SmartObject& param) {
+ smart_objects::SmartObject array(smart_objects::SmartType_Array);
+
+ int i = 0;
+ DBusMessageIter sub_iter;
+ dbus_message_iter_recurse(iter, &sub_iter);
+ while (dbus_message_iter_get_arg_type(&sub_iter) != DBUS_TYPE_INVALID) {
+ if (!GetValue(&sub_iter, rules->element, array[i])) {
+ return false;
+ }
+ dbus_message_iter_next(&sub_iter);
+ i++;
+ }
+ param = array;
+ return true;
+}
+
+bool DBusAdapter::GetStructValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::StructDescription* rules,
+ smart_objects::SmartObject& param) {
+
+ DBusMessageIter sub_iter;
+ dbus_message_iter_recurse(iter, &sub_iter);
+ const ParameterDescription** entry;
+ entry = rules->parameters;
+ smart_objects::SmartObject structure(smart_objects::SmartType_Map);
+ while (*entry != NULL) {
+ if (!GetOneArgument(&sub_iter, *entry, structure)) {
+ return false;
+ }
+ dbus_message_iter_next(&sub_iter);
+ entry++;
+ }
+ param = structure;
+ return true;
+}
+
+bool DBusAdapter::GetOptionalValue(
+ DBusMessageIter* iter,
+ const ford_message_descriptions::ParameterDescription* rules,
+ smart_objects::SmartObject& param) {
+ int type = dbus_message_iter_get_arg_type(iter);
+ if (type != DBUS_TYPE_STRUCT) {
+ LOG4CXX_WARN(logger_, "DBus: Not expected type of argument. It is not optional parameter.");
+ return false;
+ }
+
+ DBusMessageIter sub_iter;
+ dbus_message_iter_recurse(iter, &sub_iter);
+ ford_message_descriptions::ParameterDescription flagRules = { "flag",
+ ford_message_descriptions::Boolean, true };
+ smart_objects::SmartObject flag;
+ if (!GetValue(&sub_iter, &flagRules, flag)) {
+ return false;
+ }
+ if (flag.asBool()) {
+ dbus_message_iter_next(&sub_iter);
+ return GetValue(&sub_iter, rules, param[rules->name]);
+ } else {
+ return true;
+ }
+}
+
+std::pair<uint, MessageId> DBusAdapter::GetRequestToHMI(uint32_t serial) {
+ std::map<uint32_t, std::pair<uint, MessageId> >::iterator it;
+ it = requests_to_hmi_.find(serial);
+ if (it != requests_to_hmi_.end()) {
+ std::pair<uint, MessageId> ids = it->second;
+ requests_to_hmi_.erase(it);
+ return ids;
+ }
+ return std::make_pair(0, hmi_apis::FunctionID::INVALID_ENUM);
+}
+
+void DBusAdapter::SaveRequestToHMI(uint32_t serial,
+ const std::pair<uint, MessageId>& ids) {
+ requests_to_hmi_.insert(std::make_pair(serial, ids));
+}
+
+void DBusAdapter::Introspect(DBusMessage* msg) {
+ DBusMessage *reply;
+
+ dbus_uint32_t serial = dbus_message_get_serial(msg);
+ reply = dbus_message_new_method_return(msg);
+ if (!reply) {
+ LOG4CXX_WARN(logger_, "DBus: Failed return method for introspection");
+ return;
+ }
+
+ DBusMessageIter iter;
+ dbus_message_iter_init_append(reply, &iter);
+ char* value = introspection_xml;
+ dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &value);
+ dbus_connection_send(conn_, reply, &serial);
+ dbus_connection_flush(conn_);
+ dbus_message_unref(reply);
+ dbus_message_unref(msg);
+}
+
+void DBusAdapter::SaveRequestFromHMI(uint32_t serial, DBusMessage* request) {
+ LOG4CXX_DEBUG(logger_, "Save correlation id (serial id) : " << serial);
+ LOG4CXX_DEBUG(logger_, "D-Bus message: " << request);
+ requests_from_hmi_.insert(std::make_pair(serial, request));
+}
+
+DBusMessage* DBusAdapter::GetRequestFromHMI(uint32_t serial) {
+ LOG4CXX_DEBUG(logger_, "Get correlation id (serial id) : " << serial);
+ std::map<uint32_t, DBusMessage*>::iterator it;
+ it = requests_from_hmi_.find(serial);
+ if (it != requests_from_hmi_.end()) {
+ DBusMessage *msg = it->second;
+ requests_from_hmi_.erase(it);
+ LOG4CXX_DEBUG(logger_, "D-Bus message: " << msg);
+ return msg;
+ }
+ return 0;
+}
+
+} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message.cc b/src/components/dbus/src/dbus_message.cc
new file mode 100644
index 0000000000..702e44f801
--- /dev/null
+++ b/src/components/dbus/src/dbus_message.cc
@@ -0,0 +1,243 @@
+/* Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "dbus/dbus_message.h"
+
+#include <algorithm>
+#include <cassert>
+
+#include <dbus/dbus.h>
+
+namespace dbus {
+
+MessageRefKeeper::MessageRefKeeper()
+ : raw_message_(NULL) {
+}
+
+MessageRefKeeper::MessageRefKeeper(DBusMessage* message)
+ : raw_message_(message) {
+ assert(raw_message_);
+ dbus_message_ref(raw_message_);
+}
+
+MessageRefKeeper::~MessageRefKeeper() {
+ if (raw_message_) {
+ dbus_message_unref(raw_message_);
+ }
+}
+
+MessageRefKeeper::MessageRefKeeper(const MessageRefKeeper& other)
+ : raw_message_(other.raw_message_) {
+ assert(raw_message_);
+ dbus_message_ref(raw_message_);
+}
+
+MessageRefKeeper& MessageRefKeeper::operator=(MessageRefKeeper other) {
+ other.swap(*this);
+ return *this;
+}
+
+DBusMessage* MessageRefKeeper::get() const {
+ return raw_message_;
+}
+
+DBusMessage* MessageRefKeeper::Pass() {
+ DBusMessage* message = raw_message_;
+ raw_message_ = NULL;
+ return message;
+}
+
+void MessageRefKeeper::swap(MessageRefKeeper& other) {
+ std::swap(raw_message_, other.raw_message_);
+}
+
+
+MessageRef::MessageRef(DBusMessage* message)
+ : raw_message_ref_(message) {
+}
+
+MessageRef::~MessageRef(){
+}
+
+std::string MessageRef::GetInterface() const {
+ return dbus_message_get_interface(raw_message_ref_.get());
+}
+
+std::string MessageRef::GetMember() const {
+ return dbus_message_get_member(raw_message_ref_.get());
+}
+
+// Message writer
+MessageReader::MessageReader(const MessageRef& message)
+ : parent_reader_(NULL),
+ failed_(false) {
+ dbus_bool_t success =
+ dbus_message_iter_init(message.raw_message_ref_.get(),
+ &iterator_);
+ if (!success) {
+ MarkFailed();
+ }
+}
+
+MessageReader::MessageReader(MessageReader* reader,
+ DataType container_data_type)
+ : parent_reader_(reader),
+ failed_(reader->has_failed()) {
+ assert(parent_reader_);
+ if (!failed_) {
+ if (reader->NextValueType() != container_data_type) {
+ MarkFailed();
+ } else {
+ dbus_message_iter_recurse(&reader->iterator_, &iterator_);
+ reader->MoveToNext();
+ }
+ }
+}
+
+
+bool MessageReader::NextIsDictEntry() const {
+ return NextValueType() == DBUS_TYPE_DICT_ENTRY;
+}
+
+
+MessageReader MessageReader::TakeArrayReader() {
+ return MessageReader(this, DBUS_TYPE_ARRAY);
+}
+
+MessageReader MessageReader::TakeStructReader() {
+ return MessageReader(this, DBUS_TYPE_STRUCT);
+}
+
+MessageReader MessageReader::TakeDictEntryReader() {
+ return MessageReader(this, DBUS_TYPE_DICT_ENTRY);
+}
+
+void MessageReader::MoveToNext() {
+ if (!HasNext()) {
+ MarkFailed();
+ }
+ dbus_message_iter_next(&iterator_);
+}
+
+void MessageReader::MarkFailed() {
+ if (!failed_) {
+ failed_ = true;
+ if (parent_reader_) {
+ parent_reader_->MarkFailed();
+ }
+ }
+}
+
+void MessageReader::ReadNextValue(MessageReader::DataType type,
+ void* value) {
+ assert(value);
+ if (NextValueType() != type) {
+ MarkFailed();
+ } else if (!failed_) {
+ dbus_message_iter_get_basic(&iterator_, value);
+ MoveToNext();
+ }
+}
+
+// DbusMessageWriter
+MessageWriter::MessageWriter(const MessageRef& message)
+ : has_opened_subcontainer_(false),
+ parent_writer_(NULL) {
+ dbus_message_iter_init_append(message.raw_message_ref_.get(),
+ &iterator_);
+}
+
+MessageWriter::MessageWriter(
+ MessageWriter* parent,
+ ContainerType container_type,
+ const char* array_signature)
+ : has_opened_subcontainer_(false),
+ parent_writer_(parent) {
+ assert(parent_writer_);
+ // Only array writers require array_signature
+ assert((container_type == kArray && array_signature != NULL)
+ || (container_type != kArray && array_signature == NULL));
+ assert(!parent_writer_->has_opened_subcontainer_);
+ bool enough_memory =
+ dbus_message_iter_open_container(&parent_writer_->iterator_,
+ container_type,
+ array_signature,
+ &iterator_);
+ assert(enough_memory);
+ parent_writer_->has_opened_subcontainer_ = true;
+}
+
+MessageWriter::~MessageWriter() {
+ assert(!has_opened_subcontainer_);
+ if (parent_writer_ != NULL) {
+ CloseWriter();
+ }
+}
+
+void MessageWriter::WriteAndCheck(
+ MessageWriter::DataType value_type, const void* value) {
+ assert(!has_opened_subcontainer_);
+ dbus_bool_t enough_memory =
+ dbus_message_iter_append_basic(&iterator_, value_type, value);
+ assert(enough_memory);
+}
+
+void MessageWriter::CloseWriter() {
+ assert(parent_writer_);
+ assert(parent_writer_->has_opened_subcontainer_);
+ dbus_bool_t enough_memory =
+ dbus_message_iter_close_container(&parent_writer_->iterator_,
+ &iterator_);
+ assert(enough_memory);
+ parent_writer_->has_opened_subcontainer_ = false;
+}
+
+// Construction functions
+
+MessageRef MethodCall(const char* bus_name,
+ const char* path,
+ const char* interface,
+ const char* method) {
+ return MessageRef(dbus_message_new_method_call(
+ bus_name,
+ path,
+ interface,
+ method));
+}
+
+MessageRef Signal(const char* path,
+ const char* interface,
+ const char* name) {
+ return MessageRef(dbus_message_new_signal(path, interface, name));
+}
+
+
+} // namespace dbus
diff --git a/src/components/dbus/src/dbus_message_controller.cc b/src/components/dbus/src/dbus_message_controller.cc
new file mode 100644
index 0000000000..56efe67905
--- /dev/null
+++ b/src/components/dbus/src/dbus_message_controller.cc
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "dbus/dbus_message_controller.h"
+#include "formatters/CSmartFactory.hpp"
+
+namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
+
+namespace dbus {
+
+DBusMessageController::DBusMessageController(const std::string& sdlServiceName,
+ const std::string& sdlObjectPath,
+ const std::string& hmiServiceName,
+ const std::string& hmiObjectPath)
+ : DBusAdapter(sdlServiceName, sdlObjectPath,
+ hmiServiceName, hmiObjectPath) {}
+
+void DBusMessageController::SubscribeTo(const std::string& interface,
+ const std::string& signal) {
+ std::string rule = "type='signal'";
+ rule.append(", sender='").append(hmi_service_name_).append("'")
+ .append(", path='").append(hmi_object_path_).append("'")
+ .append(", interface='").append(hmi_service_name_).append(".")
+ .append(interface).append("'")
+ .append(", member='").append(signal).append("'");
+ DBusAdapter::AddMatch(rule);
+}
+
+DBusMessageController::~DBusMessageController() {
+}
+
+void* DBusMessageController::MethodForReceiverThread(void*) {
+ while (true) {
+ smart_objects::SmartObject obj(smart_objects::SmartType_Map);
+ obj[sos::S_PARAMS][sos::S_PROTOCOL_VERSION] = 2;
+ obj[sos::S_PARAMS][sos::S_PROTOCOL_TYPE] = 1;
+ if (DBusAdapter::Process(obj)) {
+ SendMessageToCore(obj);
+ }
+ }
+ return NULL;
+}
+
+} // namespace dbus
diff --git a/src/components/dbus/src/schema.cc b/src/components/dbus/src/schema.cc
new file mode 100644
index 0000000000..dde1f6ab50
--- /dev/null
+++ b/src/components/dbus/src/schema.cc
@@ -0,0 +1,149 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "dbus/schema.h"
+
+#include <algorithm>
+#include <functional>
+
+namespace dbus {
+
+struct Description {
+ MessageId id;
+ MessageName name;
+ MessageType type;
+ ListArgs args;
+};
+
+struct IsId : public std::unary_function<const Description*, bool> {
+ explicit IsId(MessageId id)
+ : id_(id) {
+ }
+ bool operator()(const Description* desc) {
+ return desc->id == id_;
+ }
+ private:
+ MessageId id_;
+};
+
+struct IsName : public std::unary_function<const Description*, bool> {
+ explicit IsName(const MessageName& name)
+ : name_(name) {
+ }
+ bool operator()(const Description* desc) {
+ return desc->name == name_;
+ }
+ private:
+ MessageName name_;
+};
+
+struct IsIdType : public std::unary_function<const Description*, bool> {
+ explicit IsIdType(const MessageId& id, const MessageType& type)
+ : id_(id),
+ type_(type) {
+ }
+ bool operator()(const Description* desc) {
+ return desc->id == id_ && desc->type == type_;
+ }
+ private:
+ MessageId id_;
+ MessageType type_;
+};
+
+struct IsNameType : public std::unary_function<const Description*, bool> {
+ explicit IsNameType(const MessageName& name, const MessageType& type)
+ : name_(name),
+ type_(type) {
+ }
+ bool operator()(const Description* desc) {
+ return desc->name == name_ && desc->type == type_;
+ }
+ private:
+ MessageName name_;
+ MessageType type_;
+};
+
+DBusSchema::DBusSchema(const MessageDescription** array) {
+ const MessageDescription** msg = array;
+ while (*msg != NULL) {
+ Description *desc = new Description();
+ desc->id = (*msg)->function_id;
+ desc->name = std::make_pair((*msg)->interface, (*msg)->name);
+ desc->type = (*msg)->message_type;
+ const ParameterDescription** param;
+ param = (*msg)->parameters;
+ while (*param != NULL) {
+ desc->args.push_back(*param);
+ param++;
+ }
+ msgs_.push_back(desc);
+ msg++;
+ }
+}
+
+MessageName DBusSchema::getMessageName(MessageId id) const {
+ Messages::const_iterator it = std::find_if(msgs_.begin(), msgs_.end(),
+ IsId(id));
+ if (msgs_.end() != it) {
+ return (*it)->name;
+ }
+ return MessageName();
+}
+
+MessageId DBusSchema::getMessageId(const MessageName& name) const {
+ Messages::const_iterator it = std::find_if(msgs_.begin(), msgs_.end(),
+ IsName(name));
+ if (msgs_.end() != it) {
+ return (*it)->id;
+ }
+ return hmi_apis::FunctionID::eType::INVALID_ENUM;
+}
+
+ListArgs DBusSchema::getListArgs(MessageId id, MessageType type) const {
+ Messages::const_iterator it = std::find_if(msgs_.begin(), msgs_.end(),
+ IsIdType(id, type));
+ if (msgs_.end() != it) {
+ return (*it)->args;
+ }
+ return ListArgs();
+}
+
+ListArgs DBusSchema::getListArgs(const MessageName& name,
+ MessageType type) const {
+ Messages::const_iterator it = std::find_if(msgs_.begin(), msgs_.end(),
+ IsNameType(name, type));
+ if (msgs_.end() != it) {
+ return (*it)->args;
+ }
+ return ListArgs();
+}
+
+} // namespace dbus_schema
diff --git a/src/components/formatters/CMakeLists.txt b/src/components/formatters/CMakeLists.txt
new file mode 100644
index 0000000000..3f53cf0b7f
--- /dev/null
+++ b/src/components/formatters/CMakeLists.txt
@@ -0,0 +1,25 @@
+include_directories (
+ ./include/
+ ../protocol_handler/include/
+ ../utils/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
+ ../../../src/components/smart_objects/include
+)
+
+set (SOURCES
+ ./src/CSmartFactory.cpp
+)
+
+set (FORMATTER_SOURCES
+ ./src/CFormatterJsonBase.cpp
+ ./src/CFormatterJsonSDLRPCv1.cpp
+ ./src/CFormatterJsonSDLRPCv2.cpp
+ ./src/formatter_json_rpc.cc
+ ./src/meta_formatter.cc
+ ./src/generic_json_formatter.cc
+)
+
+add_library("formatters" ${SOURCES}
+ ${FORMATTER_SOURCES}
+)
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.hpp b/src/components/formatters/include/formatters/CFormatterJsonBase.hpp
new file mode 100644
index 0000000000..ef57d9b1b9
--- /dev/null
+++ b/src/components/formatters/include/formatters/CFormatterJsonBase.hpp
@@ -0,0 +1,122 @@
+/**
+ * @file CFormatterJsonBase.hpp
+ * @brief CFormatterJsonBase header file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef __CFORMATTERJSONBASE_HPP__
+#define __CFORMATTERJSONBASE_HPP__
+
+#include "smart_objects/smart_object.h"
+#include "json/json.h"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+namespace meta_formatter_error_code {
+ /**
+ * @brief Error codes of MetaFormatter represented as bitmask
+ **/
+ typedef long tMetaFormatterErrorCode ;
+
+ /**
+ * @brief OK, no error
+ */
+ static const tMetaFormatterErrorCode kErrorOk = 0x0;
+
+ /**
+ * @brief origin smart object is not function
+ */
+ static const tMetaFormatterErrorCode kErrorObjectIsNotFunction = 0x01;
+
+ /**
+ * @brief smart shema describes object which is not function
+ */
+ static const tMetaFormatterErrorCode kErrorSchemaIsNotFunction = 0x02;
+
+ /**
+ * @brief result smart object has invalid type (SmartType_Invalid)
+ * before passing to MetaFormatter, i.e. result object can not
+ * be changed, i.e. result object can not be built
+ *
+ */
+ static const tMetaFormatterErrorCode kErrorFailedCreateObjectBySchema = 0x04;
+}
+
+ /**
+ * @brief The base class for all JSON based formatters.
+ */
+ class CFormatterJsonBase
+ {
+ private:
+
+ /**
+ * @brief Constructor.
+ */
+ CFormatterJsonBase();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * @param obj Object to copy.
+ */
+ CFormatterJsonBase(const CFormatterJsonBase &obj);
+
+ protected:
+
+
+ public:
+
+ /**
+ * @brief The method constructs a SmartObject from the input JSON object
+ *
+ * @param value Input JSON object.
+ * @param obj The resulting SmartObject.
+ */
+ static void jsonValueToObj(const Json::Value &value,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject &obj);
+
+ /**
+ * @brief The method constructs a JSON object from the input SmartObject
+ *
+ * @param obj Input SmartObject. Can contain a complex structure of objects.
+ * @param value The resulting JSON object. It has the same structure as the input SmartObject.
+ */
+ static void objToJsonValue(const NsSmartDeviceLink::NsSmartObjects::SmartObject &obj,
+ Json::Value &value);
+ };
+
+}
+}
+} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+
+#endif // __CFORMATTERJSONBASE_HPP__
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.hpp b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.hpp
new file mode 100644
index 0000000000..03454395b0
--- /dev/null
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.hpp
@@ -0,0 +1,235 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+#ifndef __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV1_HPP__
+#define __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV1_HPP__
+
+#include "json/json.h"
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/enum_schema_item.h"
+
+#include "CFormatterJsonBase.hpp"
+
+#include "formatters/CSmartFactory.hpp"
+#include "formatters/meta_formatter.h"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+/**
+ * @brief Class is used to convert SmartObjects to JSON string and vice versa.
+ *
+ * JSON strings is in SDLRPCv1 format.
+ */
+class CFormatterJsonSDLRPCv1 : public CFormatterJsonBase {
+ private:
+ /**
+ * @brief Hidden constructor.
+ *
+ * The class contains only static methods. Should not be instantiated.
+ */
+ CFormatterJsonSDLRPCv1();
+
+ /**
+ * @brief Hidden copy constructor.
+ *
+ * The class contains only static methods. Should not be instantiated.
+ */
+ CFormatterJsonSDLRPCv1(const CFormatterJsonSDLRPCv1&);
+
+ /**
+ * @brief Extracts a message type from the SmartObject
+ */
+ static const std::string getMessageType(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& obj);
+
+ /**
+ * @brief Extracts a message type from the root JSON object.
+ *
+ * @return Type or empty string if there's no type in the JSON object.
+ */
+ static const std::string getMessageType(const Json::Value& root);
+
+ // SDLRPCv1 string consts
+
+ /**
+ * @brief String constant for REQUEST.
+ */
+ static const std::string S_REQUEST;
+
+ /**
+ * @brief String constant for RESPONSE.
+ */
+ static const std::string S_RESPONSE;
+
+ /**
+ * @brief String constant for NOTIFICATION.
+ */
+ static const std::string S_NOTIFICATION;
+
+ /**
+ * @brief String constant for PARAMETERS.
+ */
+ static const std::string S_PARAMETERS;
+
+ /**
+ * @brief String constant for NAME.
+ */
+ static const std::string S_NAME;
+
+ /**
+ * @brief String constant for CORRELATION_ID.
+ */
+ static const std::string S_CORRELATION_ID;
+
+ public:
+
+ static const int32_t kSuccess;
+ static const int32_t kParsingError;
+ static const int32_t kFunctionIdNotFound;
+ static const int32_t kMessageTypeNotFound;
+ static const int32_t kCorrelationIdNotFound;
+
+ typedef NsSmartDeviceLink::NsJSONHandler::Formatters::meta_formatter_error_code::tMetaFormatterErrorCode tMetaFormatterErrorCode;
+
+ /**
+ * @brief Creates a JSON string from a SmartObject.
+ *
+ * @param obj input SmartObject
+ * @param outStr resulting JSON string
+ * @return true if success, false otherwise
+ */
+ static bool toString(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject &obj,
+ std::string& outStr);
+
+ /**
+ * @brief Creates a SmartObject from a JSON string.
+ *
+ * @param str input JSON string
+ * @param out The resulting SmartObject
+ * @return true if success, otherwise - false
+ */
+ template<typename FunctionId, typename MessageType>
+ static int32_t fromString(const std::string &str,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject &out);
+
+ /**
+ * @brief Converts to string the smart object against the given schema
+ *
+ * @param object Original smart object
+ * @param schema Smart schema which describes 'fake' smart object to be formatted
+ * @param outStr Resulting JSON string
+ * @return formatting error code
+ */
+ static tMetaFormatterErrorCode MetaFormatToString(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
+ const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ std::string& outStr);
+
+};
+
+// ----------------------------------------------------------------------------
+
+template<typename FunctionId, typename MessageType>
+int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
+ const std::string& str,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& out) {
+ int32_t result = kSuccess;
+
+ try {
+ Json::Value root;
+ Json::Reader reader;
+ std::string type;
+
+ if (false == reader.parse(str, root)) {
+ result = kParsingError | kMessageTypeNotFound | kFunctionIdNotFound
+ | kCorrelationIdNotFound;
+ }
+
+ if (kSuccess == result) {
+ type = getMessageType(root);
+ if (true == type.empty()) {
+ result = kMessageTypeNotFound | kFunctionIdNotFound
+ | kCorrelationIdNotFound;
+ }
+ }
+
+ FunctionId functionId = FunctionId::INVALID_ENUM;
+ MessageType messageType = MessageType::INVALID_ENUM;
+
+ if (kSuccess == result) {
+ if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(type, &messageType)) {
+ // If MessageType is not found than FunctionId and CorrelationId can not be found either
+ result = kMessageTypeNotFound | kFunctionIdNotFound
+ | kCorrelationIdNotFound;
+ }
+ }
+
+ if (kSuccess == result) {
+ if (!NsSmartObjects::EnumConversionHelper<FunctionId>::StringToEnum(root[type][S_NAME].asString(),
+ &functionId)) {
+ result = kFunctionIdNotFound;
+ functionId = FunctionId::INVALID_ENUM;
+ }
+ }
+
+ namespace S = NsSmartDeviceLink::NsJSONHandler::strings;
+
+ if (!(result & kMessageTypeNotFound)) {
+ jsonValueToObj(root[type][S_PARAMETERS], out[S::S_MSG_PARAMS]);
+
+ out[S::S_PARAMS][S::S_MESSAGE_TYPE] = messageType;
+ out[S::S_PARAMS][S::S_FUNCTION_ID] = functionId;
+ if (true == root[type][S_CORRELATION_ID].empty()) {
+ if (type != S_NOTIFICATION) { // Notification may not have CorrelationId
+ result |= kCorrelationIdNotFound;
+ out[S::S_PARAMS][S::S_CORRELATION_ID] = -1;
+ }
+ } else {
+ out[S::S_PARAMS][S::S_CORRELATION_ID] = root[type][S_CORRELATION_ID]
+ .asInt();
+ }
+ out[S::S_PARAMS][S::S_PROTOCOL_TYPE] = 0;
+ out[S::S_PARAMS][S::S_PROTOCOL_VERSION] = 1;
+ }
+ } catch (...) {
+ result = kParsingError;
+ }
+
+ return result;
+}
+
+}
+}
+} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+
+#endif // __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV1_HPP__
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.hpp b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.hpp
new file mode 100644
index 0000000000..3b4e206515
--- /dev/null
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.hpp
@@ -0,0 +1,176 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV2_HPP__
+#define __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV2_HPP__
+
+#include "json/json.h"
+
+#include "smart_objects/smart_object.h"
+
+#include "CFormatterJsonBase.hpp"
+#include "formatters/CSmartFactory.hpp"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+/**
+ * @brief Class is used to convert SmartObjects to JSON string and vice versa.
+ *
+ * JSON strings is in SDLRPCv2 format.
+ */
+class CFormatterJsonSDLRPCv2 : public CFormatterJsonBase {
+ private:
+
+ /**
+ * @brief Hidden constructor.
+ *
+ * The class contains only static methods. Should not be instantiated.
+ */
+ CFormatterJsonSDLRPCv2();
+
+ /**
+ * @brief Hidden copy constructor.
+ *
+ * The class contains only static methods. Should not be instantiated.
+ */
+ CFormatterJsonSDLRPCv2(const CFormatterJsonSDLRPCv2&);
+
+ public:
+
+ typedef NsSmartDeviceLink::NsJSONHandler::Formatters::meta_formatter_error_code::tMetaFormatterErrorCode tMetaFormatterErrorCode;
+
+ /**
+ * @brief Creates a JSON string from a SmartObject.
+ *
+ * @param obj input SmartObject
+ * @param outStr resulting JSON string
+ * @return true if success, false otherwise
+ */
+ static bool toString(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject &obj,
+ std::string& outStr);
+
+ /**
+ * @brief Creates a SmartObject from a JSON string.
+ *
+ * @param str Input JSON string in SDLRPCv2 format
+ * @param out Output SmartObject
+ * @param functionId The corresponding field in SmartObject is filled with this param.
+ * @param messageType The corresponding field in SmartObject is filled with this param.
+ * @return true if success, otherwise - false
+ */
+ template<typename FunctionId, typename MessageType>
+ static bool fromString(const std::string &str,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject &out,
+ FunctionId functionId, MessageType messageType);
+
+ /**
+ * @brief Creates a SmartObject from a JSON string.
+ *
+ * Version with CorrelationID.
+ *
+ * @param str Input JSON string in SDLRPCv2 format
+ * @param out Output SmartObject
+ * @param functionId The corresponding field in SmartObject is filled with this param.
+ * @param messageType The corresponding field in SmartObject is filled with this param.
+ * @param correlatioId It's like sequence number. The corresponding field in SmartObject
+ * is filled with this param.
+ * @return true if success, otherwise - false
+ */
+ template<typename FunctionId, typename MessageType>
+ static bool fromString(const std::string &str,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject &out,
+ FunctionId functionId, MessageType messageType,
+ int32_t correlationId);
+
+ /**
+ * @brief Converts to string the smart object against the given schema
+ *
+ * @param object Original smart object
+ * @param schema Smart schema which describes 'fake' smart object to be formatted
+ * @param outStr Resulting JSON string
+ * @return formatting error code
+ */
+ static tMetaFormatterErrorCode MetaFormatToString(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
+ const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ std::string& outStr);
+};
+
+template<typename FunctionId, typename MessageType>
+inline bool CFormatterJsonSDLRPCv2::fromString(
+ const std::string& str, NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ FunctionId functionId, MessageType messageType) {
+ bool result = true;
+
+ try {
+ Json::Value root;
+ Json::Reader reader;
+
+ namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+ bool result = reader.parse(str, root);
+
+ if (true == result) {
+ out[strings::S_PARAMS][strings::S_MESSAGE_TYPE] = messageType;
+ out[strings::S_PARAMS][strings::S_FUNCTION_ID] = functionId;
+ out[strings::S_PARAMS][strings::S_PROTOCOL_TYPE] = 0;
+ out[strings::S_PARAMS][strings::S_PROTOCOL_VERSION] = 2;
+
+ jsonValueToObj(root, out[strings::S_MSG_PARAMS]);
+ }
+ } catch (...) {
+ result = false;
+ }
+
+ return result;
+}
+
+template<typename FunctionId, typename MessageType>
+inline bool CFormatterJsonSDLRPCv2::fromString(
+ const std::string& str, NsSmartDeviceLink::NsSmartObjects::SmartObject& out,
+ FunctionId functionId, MessageType messageType, int32_t correlationId) {
+
+ bool result = fromString(str, out, functionId, messageType);
+ namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+
+ if (true == result) {
+ out[strings::S_PARAMS][strings::S_CORRELATION_ID] = correlationId;
+ }
+
+ return result;
+}
+
+}
+}
+} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+
+#endif // __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV2_HPP__
diff --git a/src/components/formatters/include/formatters/CSmartFactory.hpp b/src/components/formatters/include/formatters/CSmartFactory.hpp
new file mode 100644
index 0000000000..7cefabaa74
--- /dev/null
+++ b/src/components/formatters/include/formatters/CSmartFactory.hpp
@@ -0,0 +1,422 @@
+/**
+ * @file CSmartFactory.hpp
+ * @brief CSmartFactory header file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef __CSMARTFACTORY_HPP__
+#define __CSMARTFACTORY_HPP__
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/smart_schema.h"
+#include <map>
+#include <string>
+
+namespace NsSmartDeviceLink
+{
+ namespace NsJSONHandler
+ {
+ /**
+ * @brief String constants used by SmartFactory.
+ */
+ namespace strings
+ {
+ /**
+ * @brief String constant for MSG_PARAMS.
+ */
+ extern const std::string S_MSG_PARAMS;
+
+ /**
+ * @brief String constant for PARAMS.
+ */
+ extern const std::string S_PARAMS;
+
+ /**
+ * @brief String constant for FUNCTION_ID.
+ */
+ extern const std::string S_FUNCTION_ID;
+
+ /**
+ * @brief String constant for MESSAGE_TYPE.
+ */
+ extern const std::string S_MESSAGE_TYPE;
+
+ /**
+ * @brief String constant for PROTOCOL_VERSION.
+ */
+ extern const std::string S_PROTOCOL_VERSION;
+
+ /**
+ * @brief String constant for PROTOCOL_TYPE.
+ */
+ extern const std::string S_PROTOCOL_TYPE;
+
+ /**
+ * @brief String constant for CORRELATION_ID.
+ */
+ extern const std::string S_CORRELATION_ID;
+
+ /**
+ * @brief String constant for "code" param name.
+ */
+ extern const std::string kCode;
+
+ /**
+ * @brief String constant for "message" param name.
+ */
+ extern const std::string kMessage;
+ }
+
+ /**
+ * @brief Smart Schema key.
+ *
+ * @tparam FunctionIdEnum Type of function ID enum.
+ * @tparam MessageTypeEnum Type of messageType enum.
+ */
+ template <class FunctionIdEnum, class MessageTypeEnum>
+ struct SmartSchemaKey
+ {
+ /**
+ * @brief Value of function ID for the key.
+ */
+ FunctionIdEnum functionId;
+
+ /**
+ * @brief Value of messageType for the key.
+ */
+ MessageTypeEnum messageType;
+
+ /**
+ * @brief Constructor.
+ *
+ * @param functionIdParam Value of function ID.
+ * @param messageTypeParam Value of message type.
+ */
+ SmartSchemaKey(FunctionIdEnum functionIdParam, MessageTypeEnum messageTypeParam);
+ };
+
+ /**
+ * @brief Smart Factory.
+ *
+ * This class is used as base class for generated factories.
+ * Clients should use methods of this class to access all
+ * SmartSchema validation features.
+ *
+ * @tparam FunctionIdEnum Type of function ID enum.
+ * @tparam MessageTypeEnum Type of messageType enum.
+ * @tparam StructIdEnum Type of StructId enum.
+ */
+ template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
+ class CSmartFactory
+ {
+ public:
+
+ /**
+ * @brief Constructor.
+ */
+ CSmartFactory(void);
+
+ /**
+ * @brief Attach schema to the function SmartObject.
+ *
+ * @param object SmartObject to attach schema for.
+ *
+ * @return True if operation was successful or false otherwise.
+ */
+ bool attachSchema(NsSmartDeviceLink::NsSmartObjects::SmartObject& object);
+
+ /**
+ * @brief Attach schema to the struct SmartObject.
+ *
+ * @param struct_id Identifier of the struct.
+ * @param object SmartObject to attach schema for.
+ *
+ * @return True if operation was successful of false otherwise.
+ */
+ bool AttachSchema(const StructIdEnum struct_id,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject &object);
+
+
+ /**
+ * @brief Create new SmartObject with attached function SmartSchema.
+ *
+ * @param function_id FunctionID of the function.
+ * @param message_type messageType of the function.
+ *
+ * @return If function succeeded it returns new SmartObject with
+ * map type and attached SmartSchema. Client can use such
+ * object to store specific function and perform validation.
+ * Otherwise (if SmartSchema was not attached to the
+ * SmartObject) function returns empty SmartObject with
+ * null type.
+ */
+ NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ const FunctionIdEnum function_id,
+ const MessageTypeEnum message_type);
+
+ /**
+ * @brief Create new SmartObject with attached struct SmartSchema.
+ *
+ * @param struct_id Identifier of the struct.
+ *
+ * @return If function succeeded it returns new SmartObject with
+ * map type and attached SmartSchema. Client can use such
+ * object to store specific struct and perform validation.
+ * Otherwise (if SmartSchema was not attached to the
+ * SmartObject) function returns empty SmartObject with
+ * null type.
+ */
+ NsSmartDeviceLink::NsSmartObjects::SmartObject CreateSmartObject(
+ const StructIdEnum struct_id);
+
+ /**
+ * @brief Get SmartSchema for specific function.
+ *
+ * @param function_id FunctionID of the function.
+ * @param message_type messageType of the function.
+ * @param[out] result This value will be copy of the desired
+ * function SmartSchema if it found (this
+ * function returns true) or unmodified if
+ * SmartSchema is not found (this function
+ * returns false).
+ *
+ * @return True if function schema for specified input parameters
+ * is found or false otherwise.
+ */
+ bool GetSchema(
+ const FunctionIdEnum function_id,
+ const MessageTypeEnum message_type,
+ NsSmartDeviceLink::NsSmartObjects::CSmartSchema &result);
+
+ /**
+ * @brief Get SmartSchema for specific struct.
+ *
+ * @param struct_id Identifier of the struct.
+ *
+ * @param[out] result This value will be copy of the desired
+ * struct SmartSchema if it found (this
+ * function returns true) or unmodified if
+ * SmartSchema is not found (this function
+ * returns false).
+ *
+ * @return True if struct schema for specified input parameter is
+ * found or false otherwise.
+ */
+ bool GetSchema(
+ const StructIdEnum struct_id,
+ NsSmartDeviceLink::NsSmartObjects::CSmartSchema &result);
+
+ protected:
+
+ /**
+ * @brief Defines map of SmartSchemaKeys to the SmartSchemes.
+ *
+ * This container type should be used to store SmartSchemes of
+ * functions.
+ */
+ typedef std::map<SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>,
+ NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ FuncionsSchemesMap;
+
+ /**
+ * @brief Defines map of StructIdEnum to the SmartSchemes.
+ *
+ * This container type should be used to store SmartSchemes of
+ * structs.
+ */
+ typedef std::map<StructIdEnum,
+ NsSmartDeviceLink::NsSmartObjects::CSmartSchema>
+ StructsSchemesMap;
+
+ /**
+ * @brief Map of all function schemes for this factory.
+ */
+ FuncionsSchemesMap functions_schemes_;
+
+ /**
+ * @brief Map of all struct shemes for this factory.
+ */
+ StructsSchemesMap structs_schemes_;
+ };
+
+ template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
+ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::CSmartFactory(void)
+ : functions_schemes_(),
+ structs_schemes_()
+ {
+ }
+
+ template <class FunctionIdEnum, class MessageTypeEnum, class StructIdEnum>
+ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema(NsSmartDeviceLink::NsSmartObjects::SmartObject &object)
+ {
+ if(false == object.keyExists(strings::S_PARAMS)) return false;
+ if(false == object[strings::S_PARAMS].keyExists(strings::S_MESSAGE_TYPE)) return false;
+ if(false == object[strings::S_PARAMS].keyExists(strings::S_FUNCTION_ID)) return false;
+
+ MessageTypeEnum msgtype((MessageTypeEnum)object[strings::S_PARAMS][strings::S_MESSAGE_TYPE].asInt());
+ FunctionIdEnum fid((FunctionIdEnum)object[strings::S_PARAMS][strings::S_FUNCTION_ID].asInt());
+
+ SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(fid, msgtype);
+
+ typename FuncionsSchemesMap::iterator schemaIterator = functions_schemes_.find(key);
+
+ if(schemaIterator == functions_schemes_.end())
+ {
+ // Schema was not found
+ return false;
+ }
+
+ object.setSchema(schemaIterator->second);
+ schemaIterator->second.applySchema(object);
+
+ return true;
+ }
+
+ template <class FunctionIdEnum,
+ class MessageTypeEnum,
+ class StructIdEnum>
+ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::
+ AttachSchema(
+ const StructIdEnum struct_id,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject &object) {
+ typename StructsSchemesMap::iterator structs_iterator =
+ structs_schemes_.find(struct_id);
+
+ if (structs_iterator == structs_schemes_.end()) {
+ return false;
+ }
+
+ object.setSchema(structs_iterator->second);
+ structs_iterator->second.applySchema(object);
+
+ return true;
+ }
+
+ template <class FunctionIdEnum,
+ class MessageTypeEnum,
+ class StructIdEnum>
+ NsSmartDeviceLink::NsSmartObjects::SmartObject
+ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::
+ CreateSmartObject(
+ const FunctionIdEnum function_id,
+ const MessageTypeEnum message_type) {
+ SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(
+ function_id, message_type);
+
+ typename FuncionsSchemesMap::iterator schema_iterator =
+ functions_schemes_.find(key);
+
+ if(schema_iterator != functions_schemes_.end()) {
+ NsSmartDeviceLink::NsSmartObjects::SmartObject function_object(
+ NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ function_object.setSchema(schema_iterator->second);
+ schema_iterator->second.applySchema(function_object);
+ return function_object;
+ }
+
+ return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ }
+
+ template <class FunctionIdEnum,
+ class MessageTypeEnum,
+ class StructIdEnum>
+ NsSmartDeviceLink::NsSmartObjects::SmartObject
+ CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::
+ CreateSmartObject(const StructIdEnum struct_id) {
+ NsSmartDeviceLink::NsSmartObjects::SmartObject struct_object(
+ NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ if (AttachSchema(struct_id, struct_object)) {
+ return struct_object;
+ }
+
+ return NsSmartDeviceLink::NsSmartObjects::SmartObject();
+ }
+
+ template <class FunctionIdEnum,
+ class MessageTypeEnum,
+ class StructIdEnum>
+ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::
+ GetSchema(const FunctionIdEnum function_id,
+ const MessageTypeEnum message_type,
+ NsSmartDeviceLink::NsSmartObjects::CSmartSchema &result) {
+ SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(function_id,
+ message_type);
+
+ typename FuncionsSchemesMap::iterator schema_iterator =
+ functions_schemes_.find(key);
+
+ if(schema_iterator != functions_schemes_.end()) {
+ result = schema_iterator->second;
+ return true;
+ }
+
+ return false;
+ }
+
+ template <class FunctionIdEnum,
+ class MessageTypeEnum,
+ class StructIdEnum>
+ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::
+ GetSchema(const StructIdEnum struct_id,
+ NsSmartDeviceLink::NsSmartObjects::CSmartSchema &result) {
+ typename StructsSchemesMap::iterator structs_iterator =
+ structs_schemes_.find(struct_id);
+
+ if(structs_iterator != structs_schemes_.end()) {
+ result = structs_iterator->second;
+ return true;
+ }
+
+ return false;
+ }
+
+ template <class FunctionIdEnum, class MessageTypeEnum>
+ SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>::SmartSchemaKey(FunctionIdEnum functionIdParam, MessageTypeEnum messageTypeParam)
+ : functionId(functionIdParam)
+ , messageType(messageTypeParam)
+ {
+
+ }
+
+ template <class FunctionIdEnum, class MessageTypeEnum>
+ bool operator<(const SmartSchemaKey< FunctionIdEnum, MessageTypeEnum >& l, const SmartSchemaKey< FunctionIdEnum, MessageTypeEnum >& r)
+ {
+ if (l.functionId < r.functionId) return true;
+ if (l.functionId > r.functionId) return false;
+
+ if (l.messageType < r.messageType) return true;
+ if (l.messageType > r.messageType) return false;
+
+ return false;
+ }
+ }
+}
+#endif //__CSMARTFACTORY_HPP__
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
new file mode 100644
index 0000000000..26636f4a2b
--- /dev/null
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -0,0 +1,497 @@
+/**
+ * @file formatter_json_rpc.h
+ * @brief FormatterJsonRpc header file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef SMARTDEVICELINK_COMPONENTS_JSONHANDLER_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
+#define SMARTDEVICELINK_COMPONENTS_JSONHANDLER_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
+
+#include <string>
+#include <sys/stat.h>
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/enum_schema_item.h"
+#include "json/json.h"
+
+#include "CFormatterJsonBase.hpp"
+#include "formatters/CSmartFactory.hpp"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+/**
+ * @brief Formatter for JSON RPC format.
+ */
+class FormatterJsonRpc: public CFormatterJsonBase {
+ public:
+ /**
+ * @brief No errors occurred during the parsing of the input JSON string.
+ */
+ static const int32_t kSuccess = 0;
+
+ /**
+ * @brief Input JSON string cannot be parsed.
+ */
+ static const int32_t kParsingError = 1;
+
+ /**
+ * @brief Input JSON string has invalid format.
+ */
+ static const int32_t kInvalidFormat = 2;
+
+ /**
+ * @brief Method in input JSON string is not
+ * specified or specified incorrectly.
+ */
+ static const int32_t kMethodNotSpecified = 4;
+
+ /**
+ * @brief Method is unknown.
+ */
+ static const int32_t kUnknownMethod = 8;
+
+ /**
+ * @brief Message type is unknown.
+ */
+ static const int32_t kUnknownMessageType = 16;
+
+ /**
+ * @brief Id of request or response is invalid.
+ */
+ static const int32_t kInvalidId = 32;
+
+ /**
+ * @brief Response code is not available.
+ */
+ static const int32_t kResponseCodeNotAvailable = 64;
+
+ /**
+ * @brief Message for error response is not available.
+ */
+ static const int32_t kErrorResponseMessageNotAvailable = 128;
+
+ /**
+ * @brief Creates a JSON string from a SmartObject.
+ *
+ * @param obj Input SmartObject.
+ * @param out_str Resulting JSON string.
+ *
+ * @return true if success, false otherwise.
+ */
+ static bool ToString(const NsSmartObjects::SmartObject& obj,
+ std::string& out_str);
+
+ /**
+ * @brief Creates a SmartObject from a JSON string.
+ *
+ * @tparam FunctionId Type of function id enumeration.
+ * @tparam MessageType Type of message type enumeration.
+ *
+ * @param str input JSON string.
+ * @param out The resulting SmartObject.
+ *
+ * @return An integer that is a bitwise-or of all error codes occurred
+ * during the parsing of the input string. 0 if no errors occurred.
+ */
+ template <typename FunctionId, typename MessageType>
+ static int32_t FromString(const std::string& str,
+ NsSmartObjects::SmartObject& out);
+
+ private:
+ /**
+ * @brief Request.
+ */
+ static const char* kRequest;
+
+ /**
+ * @brief Response.
+ */
+ static const char* kResponse;
+
+ /**
+ * @brief Notification.
+ */
+ static const char* kNotification;
+
+ /**
+ * @brief Error reponse.
+ */
+ static const char* kErrorResponse;
+
+ /**
+ * @brief Name of "jsonrpc" message field.
+ */
+ static const char* kJsonRpc;
+
+ /**
+ * @brief Expected value of "jsonrpc" message field ("2.0").
+ */
+ static const char* kJsonRpcExpectedValue;
+
+ /**
+ * @brief Name of "id" message field.
+ */
+ static const char* kId;
+
+ /**
+ * @brief Name of "method" field.
+ */
+ static const char* kMethod;
+
+ /**
+ * @brief Name of "params" field.
+ */
+ static const char* kParams;
+
+ /**
+ * @brief Name of "result" field.
+ */
+ static const char* kResult;
+
+ /**
+ * @brief Name of "error" field.
+ */
+ static const char* kError;
+
+ /**
+ * @brief Name of "code" field.
+ */
+ static const char* kCode;
+
+ /**
+ * @brief Name of "data" field.
+ */
+ static const char* kData;
+
+ /**
+ * @brief Name of "message" field.
+ */
+ static const char* kMessage;
+
+ /**
+ * @brief Constructor.
+ */
+ FormatterJsonRpc();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * @param unused Unused parameter.
+ */
+ FormatterJsonRpc(const FormatterJsonRpc& unused);
+
+ /**
+ * @brief Parse function id.
+ *
+ * @tparam FunctionId Type of function id enumeration.
+ *
+ * @param method_value JSON value with function id.
+ * @param out The resulting SmartObject.
+ *
+ * @return An integer that is a bitwise-or of all error codes occurred
+ * during the parsing of the function id. 0 if no errors occurred.
+ */
+ template <typename FunctionId>
+ static int32_t ParseFunctionId(const Json::Value& method_value,
+ NsSmartObjects::SmartObject& out);
+
+ /**
+ * @brief Set method.
+ *
+ * Try to extract function id from the message object and set the "method"
+ * field of the container.
+ *
+ * @param params Message parameters object.
+ * @param method_container Container for the "method" field.
+ *
+ * @return true if function id was extracted successfully and set as a
+ * value of "method" field.
+ */
+ static bool SetMethod(const NsSmartObjects::SmartObject& params,
+ Json::Value& method_container);
+
+ /**
+ * @brief Set id.
+ *
+ * Try to extract request/response id from the message object and set the
+ * "id" field of the container.
+ *
+ * @param params Message parameters object.
+ * @param id_container Container for the "id" field.
+ *
+ * @return true if request/response id was extracted successfully and set
+ * as a value of "id" field.
+ */
+ static bool SetId(const NsSmartObjects::SmartObject& params,
+ Json::Value& id_container);
+
+ /**
+ * @brief Set message
+ *
+ * Try to extract message from response error object and set "message" field for the container
+ *
+ * @param params Message parameters object.
+ * @param id_container Container of the "message" field
+ *
+ * @return true if message string was extracted successfully and set
+ * as a value of "message" field.
+ */
+ static bool SetMessage(const NsSmartObjects::SmartObject& params,
+ Json::Value& id_container);
+};
+
+template <typename FunctionId, typename MessageType>
+int32_t FormatterJsonRpc::FromString(const std::string& str,
+ NsSmartObjects::SmartObject& out) {
+ int32_t result = kSuccess;
+ try {
+ Json::Value root;
+ Json::Reader reader;
+ namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+
+ if (false == reader.parse(str, root)) {
+ result = kParsingError | kMethodNotSpecified | kUnknownMethod |
+ kUnknownMessageType;
+ } else {
+ if (false == root.isMember(kJsonRpc)) {
+ result |= kInvalidFormat;
+ } else {
+ const Json::Value& jsonRpcValue = root[kJsonRpc];
+
+ if ((false == jsonRpcValue.isString()) ||
+ (jsonRpcValue.asString() != kJsonRpcExpectedValue)) {
+ result |= kInvalidFormat;
+ }
+ }
+
+ std::string message_type_string;
+ Json::Value response_value;
+ bool response_value_found = false;
+ bool is_error_response = false;
+
+ if (false == root.isMember(kId)) {
+ message_type_string = kNotification;
+
+ if (false == root.isMember(kMethod)) {
+ result |= kMethodNotSpecified | kUnknownMethod;
+ } else {
+ result |= ParseFunctionId<FunctionId>(root[kMethod], out);
+ }
+ out[strings::S_MSG_PARAMS]
+ = NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ } else {
+ const Json::Value& id_value = root[kId];
+
+ if (true == id_value.isString()) {
+ out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
+ id_value.asString();
+ } else if (true == id_value.isInt()) {
+ out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
+ id_value.asInt();
+ } else if (true == id_value.isDouble()) {
+ out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
+ id_value.asDouble();
+ } else if (true == id_value.isNull()) {
+ out[strings::S_PARAMS][strings::S_CORRELATION_ID] =
+ NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Null);
+ } else {
+ result |= kInvalidFormat | kInvalidId;
+ }
+
+ if (true == root.isMember(kMethod)) {
+ message_type_string = kRequest;
+ result |= ParseFunctionId<FunctionId>(root[kMethod], out);
+ out[strings::S_MSG_PARAMS]
+ = NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ } else {
+ Json::Value method_container;
+ bool method_container_found = false;
+
+ if (true == root.isMember(kResult)) {
+ out[strings::S_MSG_PARAMS]
+ = NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+
+ message_type_string = kResponse;
+ response_value = root[kResult];
+ response_value_found = true;
+ method_container = root[kResult];
+ method_container_found = true;
+ } else if (true == root.isMember(kError)) {
+ out[strings::S_MSG_PARAMS]
+ = NsSmartObjects::SmartObject(NsSmartObjects::SmartType_Map);
+ message_type_string = kErrorResponse;
+ response_value = root[kError];
+ response_value_found = true;
+ is_error_response = true;
+
+ if (true == response_value.isObject()) {
+ if (true == response_value.isMember(kData)) {
+ method_container = response_value[kData];
+ method_container_found = true;
+ }
+ }
+ } else {
+ result |= kUnknownMessageType;
+ }
+
+ if (false == method_container_found) {
+ result |= kMethodNotSpecified | kUnknownMethod;
+ } else if (false == method_container.isObject()) {
+ result |= kInvalidFormat | kMethodNotSpecified | kUnknownMethod;
+ } else {
+ if (false == method_container.isMember(kMethod)) {
+ result |= kMethodNotSpecified | kUnknownMethod;
+ } else {
+ result |= ParseFunctionId<FunctionId>(method_container[kMethod],
+ out);
+ }
+ }
+ }
+ }
+
+ if (0 == (result & kUnknownMessageType)) {
+ MessageType message_type;
+
+ if (!NsSmartObjects::EnumConversionHelper<MessageType>::StringToEnum(
+ message_type_string, &message_type)) {
+ result |= kUnknownMessageType;
+ } else {
+ out[strings::S_PARAMS][strings::S_MESSAGE_TYPE] = message_type;
+ }
+ }
+
+ if (true == root.isMember(kParams)) {
+ const Json::Value& params_value = root[kParams];
+
+ if (false == params_value.isObject()) {
+ result |= kInvalidFormat;
+ } else {
+ jsonValueToObj(root[kParams], out[strings::S_MSG_PARAMS]);
+ }
+ } else if (true == root.isMember(kResult)) {
+ const Json::Value& result_value = root[kResult];
+
+ if (false == result_value.isObject()) {
+ result |= kInvalidFormat;
+ } else {
+ jsonValueToObj(root[kResult], out[strings::S_MSG_PARAMS]);
+ }
+ } else if (true == is_error_response) {
+ jsonValueToObj(response_value[kData], out[strings::S_PARAMS][kData]);
+ }
+
+ if ((kResponse == message_type_string) ||
+ (kErrorResponse == message_type_string)) {
+ if (true == out.keyExists(strings::S_MSG_PARAMS)) {
+ out[strings::S_MSG_PARAMS].erase(kMethod);
+ out[strings::S_MSG_PARAMS].erase(kCode);
+ }
+
+ if (false == response_value_found) {
+ result |= kResponseCodeNotAvailable;
+ } else {
+ if (false == response_value.isObject()) {
+ result |= kInvalidFormat | kResponseCodeNotAvailable;
+
+ if (true == is_error_response) {
+ result |= kErrorResponseMessageNotAvailable;
+ }
+ } else {
+ if (false == response_value.isMember(kCode)) {
+ result |= kResponseCodeNotAvailable;
+ } else {
+ const Json::Value& code_value = response_value[kCode];
+
+ if (false == code_value.isInt()) {
+ result |= kInvalidFormat | kResponseCodeNotAvailable;
+ } else {
+ out[strings::S_PARAMS][strings::kCode] = code_value.asInt();
+ }
+ }
+
+ if (true == is_error_response) {
+ if (false == response_value.isMember(kMessage)) {
+ result |= kErrorResponseMessageNotAvailable;
+ } else {
+ const Json::Value& message_value = response_value[kMessage];
+
+ if (false == message_value.isString()) {
+ result |= kErrorResponseMessageNotAvailable;
+ } else {
+ out[strings::S_PARAMS][strings::kMessage] =
+ message_value.asString();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ out[strings::S_PARAMS][strings::S_PROTOCOL_TYPE] = 1;
+ out[strings::S_PARAMS][strings::S_PROTOCOL_VERSION] = 2;
+ } catch(...) {
+ result = kParsingError;
+ }
+
+ return result;
+}
+
+template <typename FunctionId>
+int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
+ NsSmartObjects::SmartObject& out) {
+ int32_t result = kSuccess;
+
+ if (false == method_value.isString()) {
+ result |= kInvalidFormat | kUnknownMethod;
+ } else {
+ FunctionId function_id;
+
+ if (!NsSmartObjects::EnumConversionHelper<FunctionId>::CStringToEnum(
+ method_value.asCString(), &function_id)) {
+ result |= kUnknownMethod;
+ } else {
+ namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+
+ out[strings::S_PARAMS][strings::S_FUNCTION_ID] = function_id;
+ }
+ }
+
+ return result;
+}
+
+} // namespace Formatters
+} // namespace NsJSONHandler
+} // namespace NsSmartDeviceLink
+
+#endif // SMARTDEVICELINK_COMPONENTS_JSONHANDLER_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
diff --git a/src/components/formatters/include/formatters/generic_json_formatter.h b/src/components/formatters/include/formatters/generic_json_formatter.h
new file mode 100644
index 0000000000..3eaee0b36e
--- /dev/null
+++ b/src/components/formatters/include/formatters/generic_json_formatter.h
@@ -0,0 +1,71 @@
+/**
+ * @file generic_json_formatter.h
+ * @brief Generic JSON formatter header file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef SMARTDEVICELINK_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
+#define SMARTDEVICELINK_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
+
+#include "CFormatterJsonBase.hpp"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+class GenericJsonFormatter: public CFormatterJsonBase {
+public:
+ /**
+ * @brief Creates a JSON string from a SmartObject.
+ *
+ * @param obj Input SmartObject.
+ * @param out_str Resulting JSON string.
+ */
+ static void ToString(const NsSmartObjects::SmartObject& obj,
+ std::string& out_str);
+
+ /**
+ * @brief Creates a SmartObject from a JSON string.
+ *
+ * @param str input JSON string.
+ * @param out The resulting SmartObject.
+ *
+ * @return true if success, false otherwise.
+ */
+ static bool FromString(const std::string& str,
+ NsSmartObjects::SmartObject& out);
+};
+
+} // namespace Formatters
+} // namespace NsJSONHandler
+} // namespace NsSmartDeviceLink
+
+#endif // SMARTDEVICELINK_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
new file mode 100644
index 0000000000..c1b767d7cf
--- /dev/null
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -0,0 +1,78 @@
+/**
+ * @file meta_fromatter.h
+ * @brief file describes class CMetaFormatter which is designed to format
+ * the smart object against given schema for given formatter
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS_METAFORMATTER_H__
+#define __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS_METAFORMATTER_H__
+
+#include "smart_objects/smart_object.h"
+#include "smart_objects/smart_schema.h"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+/**
+ * @brief Formats to string the smart object against given schema for given formatter
+ *
+ * Sample usage:
+ * CSmartFactory factory;
+ * SmartObject object;
+ * CSmartSchmema schema;
+ *
+ */
+class CMetaFormatter {
+ public:
+
+ /**
+ * @brief Creates smart object by the given schema having copied
+ * matched tree elements from original object.
+ *
+ * @param object Original smart object which macthed tree elements
+ * will be copied from
+ * @param schema Smart schema which describes result smart object
+ * @param result_object createdsmart object
+ * @return true if successful, false - otherwise
+ */
+ static bool CreateObjectByPattern(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
+ const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object);
+};
+
+}// namespace NsSmartDeviceLink
+}// namespace NsSmartDeviceLink::NsJSONHandler
+}// namespace NsSmartDeviceLink::NsJSONHandler::Formatters
+
+#endif // __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS_METAFORMATTER_H__
diff --git a/src/components/formatters/src/CFormatterJsonBase.cpp b/src/components/formatters/src/CFormatterJsonBase.cpp
new file mode 100644
index 0000000000..64a60e4f8f
--- /dev/null
+++ b/src/components/formatters/src/CFormatterJsonBase.cpp
@@ -0,0 +1,118 @@
+/**
+ * @file CFormatterJsonBase.cpp
+ * @brief CFormatterJsonBase source file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+#include "json/json.h"
+
+#include "formatters/CFormatterJsonBase.hpp"
+
+void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj(
+ const Json::Value& value,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& obj) {
+ try {
+ if (value.type() == Json::objectValue) {
+ obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
+ NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+
+ Json::Value::Members members = value.getMemberNames();
+
+ for (uint32_t i = 0; i < members.size(); i++) {
+ jsonValueToObj(value[members[i]], obj[members[i]]);
+ }
+ } else if (value.type() == Json::arrayValue) {
+ obj = NsSmartDeviceLink::NsSmartObjects::SmartObject(
+ NsSmartDeviceLink::NsSmartObjects::SmartType_Array);
+
+ for (uint32_t i = 0; i < value.size(); i++) {
+ jsonValueToObj(value[i], obj[i]);
+ }
+ } else if (value.type() == Json::intValue
+ || value.type() == Json::uintValue) {
+ obj = value.asInt();
+ } else if (value.type() == Json::realValue) {
+ obj = value.asDouble();
+ } else if (value.type() == Json::booleanValue) {
+ obj = value.asBool();
+ } else if (value.type() == Json::stringValue) {
+ obj = value.asString();
+ }
+ } catch (...) {
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+void NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject &obj,
+ Json::Value &item) {
+ try {
+ if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == obj.getType()) {
+ item = Json::arrayValue;
+
+ for (uint32_t i = 0; i < obj.length(); i++) {
+ Json::Value value(Json::nullValue);
+
+ objToJsonValue(obj.getElement(i), value);
+
+ item.append(value);
+ }
+ } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Map
+ == obj.getType()) {
+ item = Json::objectValue;
+ std::set<std::string> keys = obj.enumerate();
+
+ for (std::set<std::string>::const_iterator key = keys.begin();
+ key != keys.end(); key++) {
+ Json::Value value(Json::nullValue);
+
+ objToJsonValue(obj.getElement(*key), value);
+
+ item[*key] = value;
+ }
+ } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Boolean
+ == obj.getType()) {
+ item = obj.asBool();
+ } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Integer
+ == obj.getType()) {
+ item = obj.asInt();
+ } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Double
+ == obj.getType()) {
+ item = obj.asDouble();
+ } else if (NsSmartDeviceLink::NsSmartObjects::SmartType_Null
+ == obj.getType()) {
+ item = Json::nullValue;
+ } else {
+ item = obj.asString();
+ }
+ } catch (...) {
+ }
+}
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cpp b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cpp
new file mode 100644
index 0000000000..407a001883
--- /dev/null
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cpp
@@ -0,0 +1,157 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+#include "formatters/CFormatterJsonSDLRPCv1.hpp"
+#include "formatters/meta_formatter.h"
+
+namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+// ----------------------------------------------------------------------------
+
+const std::string CFormatterJsonSDLRPCv1::S_REQUEST("request");
+const std::string CFormatterJsonSDLRPCv1::S_RESPONSE("response");
+const std::string CFormatterJsonSDLRPCv1::S_NOTIFICATION("notification");
+const std::string CFormatterJsonSDLRPCv1::S_PARAMETERS("parameters");
+const std::string CFormatterJsonSDLRPCv1::S_NAME("name");
+const std::string CFormatterJsonSDLRPCv1::S_CORRELATION_ID("correlationID");
+
+const int32_t CFormatterJsonSDLRPCv1::kSuccess = 0;
+const int32_t CFormatterJsonSDLRPCv1::kParsingError = 1 << 0;
+const int32_t CFormatterJsonSDLRPCv1::kFunctionIdNotFound = 1 << 1;
+const int32_t CFormatterJsonSDLRPCv1::kMessageTypeNotFound = 1 << 2;
+const int32_t CFormatterJsonSDLRPCv1::kCorrelationIdNotFound = 1 << 3;
+// ----------------------------------------------------------------------------
+
+const std::string CFormatterJsonSDLRPCv1::getMessageType(
+ const smart_objects_ns::SmartObject& obj) {
+ return obj.getElement(strings::S_PARAMS).getElement(strings::S_MESSAGE_TYPE)
+ .asString();
+}
+
+// ----------------------------------------------------------------------------
+
+const std::string CFormatterJsonSDLRPCv1::getMessageType(
+ const Json::Value& root) {
+ std::string type;
+
+ if (true == root.isMember(S_REQUEST)) {
+ type = S_REQUEST;
+ } else if (true == root.isMember(S_RESPONSE)) {
+ type = S_RESPONSE;
+ } else if (true == root.isMember(S_NOTIFICATION)) {
+ type = S_NOTIFICATION;
+ } else {
+ }
+
+ return type;
+}
+
+// ----------------------------------------------------------------------------
+
+bool CFormatterJsonSDLRPCv1::toString(const smart_objects_ns::SmartObject& obj,
+ std::string& outStr) {
+ bool result = false;
+ try {
+ Json::Value root(Json::objectValue);
+ Json::Value params(Json::objectValue);
+
+ smart_objects_ns::SmartObject formattedObj(obj);
+ formattedObj.getSchema().unapplySchema(formattedObj); // converts enums(as int32_t) to strings
+
+ objToJsonValue(formattedObj.getElement(strings::S_MSG_PARAMS), params);
+
+ std::string type = getMessageType(formattedObj);
+ root[type] = Json::Value(Json::objectValue);
+ root[type][S_PARAMETERS] = params;
+
+ if (formattedObj[strings::S_PARAMS].keyExists(strings::S_CORRELATION_ID)) {
+ root[type][S_CORRELATION_ID] =
+ formattedObj[strings::S_PARAMS][strings::S_CORRELATION_ID].asInt();
+ }
+
+ root[type][S_NAME] = formattedObj[strings::S_PARAMS][strings::S_FUNCTION_ID]
+ .asString();
+
+ outStr = root.toStyledString();
+
+ result = true;
+ } catch (...) {
+ result = false;
+ }
+
+ return result;
+}
+
+// ----------------------------------------------------------------------------
+
+CFormatterJsonSDLRPCv1::tMetaFormatterErrorCode CFormatterJsonSDLRPCv1::MetaFormatToString(
+ const smart_objects_ns::SmartObject& object,
+ const smart_objects_ns::CSmartSchema& schema, std::string& outStr) {
+ meta_formatter_error_code::tMetaFormatterErrorCode result_code =
+ meta_formatter_error_code::kErrorOk;
+
+ smart_objects_ns::SmartObject tmp_object;
+
+ if (false
+ == CMetaFormatter::CreateObjectByPattern(object, schema, tmp_object)) {
+ result_code |= meta_formatter_error_code::kErrorFailedCreateObjectBySchema;
+ return result_code;
+ }
+
+ // determine whether smart objects are functions
+ // (in terms of SDLRPC communication)
+ bool is_root_object_created_by_schema = ((tmp_object.getType()
+ == smart_objects_ns::SmartType_Map)
+ && tmp_object.keyExists(strings::S_PARAMS)
+ && tmp_object.keyExists(strings::S_MSG_PARAMS));
+
+ bool is_root_object = ((object.getType() == smart_objects_ns::SmartType_Map)
+ && object.keyExists(strings::S_PARAMS)
+ && object.keyExists(strings::S_MSG_PARAMS));
+
+ if (false == is_root_object) {
+ result_code |= meta_formatter_error_code::kErrorObjectIsNotFunction;
+ }
+ if (false == is_root_object_created_by_schema) {
+ result_code |= meta_formatter_error_code::kErrorSchemaIsNotFunction;
+ }
+
+ CFormatterJsonSDLRPCv1::toString(tmp_object, outStr);
+
+ return result_code;
+}
+
+}
+}
+}
diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cpp b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cpp
new file mode 100644
index 0000000000..d76e28911c
--- /dev/null
+++ b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cpp
@@ -0,0 +1,106 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "formatters/CFormatterJsonSDLRPCv2.hpp"
+#include "formatters/meta_formatter.h"
+
+namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+namespace strings = NsSmartDeviceLink::NsJSONHandler::strings;
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+// ----------------------------------------------------------------------------
+
+bool CFormatterJsonSDLRPCv2::toString(const smart_objects_ns::SmartObject& obj,
+ std::string& outStr) {
+ bool result = true;
+ try {
+ Json::Value root(Json::objectValue);
+
+ smart_objects_ns::SmartObject formattedObj(obj);
+ formattedObj.getSchema().unapplySchema(formattedObj); // converts enums(as int32_t) to strings
+
+ objToJsonValue(formattedObj.getElement(strings::S_MSG_PARAMS), root);
+
+ outStr = root.toStyledString();
+
+ result = true;
+ } catch (...) {
+ result = false;
+ }
+
+ return result;
+}
+
+// ----------------------------------------------------------------------------
+
+CFormatterJsonSDLRPCv2::tMetaFormatterErrorCode CFormatterJsonSDLRPCv2::MetaFormatToString(
+ const smart_objects_ns::SmartObject& object,
+ const smart_objects_ns::CSmartSchema& schema, std::string& outStr) {
+
+ meta_formatter_error_code::tMetaFormatterErrorCode result_code =
+ meta_formatter_error_code::kErrorOk;
+
+ smart_objects_ns::SmartObject tmp_object;
+
+ if (false
+ == CMetaFormatter::CreateObjectByPattern(object, schema, tmp_object)) {
+ result_code |= meta_formatter_error_code::kErrorFailedCreateObjectBySchema;
+ return result_code;
+ }
+
+ // determine whether smart objects are functions
+ // (in terms of SDLRPC communication)
+ bool is_root_object_created_by_schema = ((tmp_object.getType()
+ == smart_objects_ns::SmartType_Map)
+ && tmp_object.keyExists(strings::S_PARAMS)
+ && tmp_object.keyExists(strings::S_MSG_PARAMS));
+
+ bool is_root_object = ((object.getType() == smart_objects_ns::SmartType_Map)
+ && object.keyExists(strings::S_PARAMS)
+ && object.keyExists(strings::S_MSG_PARAMS));
+
+ if (false == is_root_object) {
+ result_code |= meta_formatter_error_code::kErrorObjectIsNotFunction;
+ }
+ if (false == is_root_object_created_by_schema) {
+ result_code |= meta_formatter_error_code::kErrorSchemaIsNotFunction;
+ }
+
+ CFormatterJsonSDLRPCv2::toString(tmp_object, outStr);
+
+ return result_code;
+}
+
+}
+}
+}
diff --git a/src/components/formatters/src/CSmartFactory.cpp b/src/components/formatters/src/CSmartFactory.cpp
new file mode 100644
index 0000000000..363db7696e
--- /dev/null
+++ b/src/components/formatters/src/CSmartFactory.cpp
@@ -0,0 +1,46 @@
+/**
+ * @file CSmartFactory.cpp
+ * @brief CSmartFactory source file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "formatters/CSmartFactory.hpp"
+
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MSG_PARAMS("msg_params");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PARAMS("params");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID("function_id");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE("message_type");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION("protocol_version");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE("protocol_type");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID("correlation_id");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::kCode("code");
+const std::string NsSmartDeviceLink::NsJSONHandler::strings::kMessage(
+ "message");
diff --git a/src/components/formatters/src/formatter_json_rpc.cc b/src/components/formatters/src/formatter_json_rpc.cc
new file mode 100644
index 0000000000..8722df46df
--- /dev/null
+++ b/src/components/formatters/src/formatter_json_rpc.cc
@@ -0,0 +1,204 @@
+/**
+ * @file formatter_json_rpc.cc
+ * @brief formatter_json_rpc source file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "formatters/formatter_json_rpc.h"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+namespace strings = NsJSONHandler::strings;
+
+const char *FormatterJsonRpc::kRequest = "request";
+const char *FormatterJsonRpc::kResponse = "response";
+const char *FormatterJsonRpc::kNotification = "notification";
+const char *FormatterJsonRpc::kErrorResponse = "error_response";
+const char *FormatterJsonRpc::kJsonRpc = "jsonrpc";
+const char *FormatterJsonRpc::kJsonRpcExpectedValue = "2.0";
+const char *FormatterJsonRpc::kId = "id";
+const char *FormatterJsonRpc::kMethod = "method";
+const char *FormatterJsonRpc::kParams = "params";
+const char *FormatterJsonRpc::kResult = "result";
+const char *FormatterJsonRpc::kError = "error";
+const char *FormatterJsonRpc::kCode = "code";
+const char *FormatterJsonRpc::kData = "data";
+const char *FormatterJsonRpc::kMessage = "message";
+
+bool FormatterJsonRpc::ToString(const NsSmartObjects::SmartObject &obj,
+ std::string &out_str) {
+ bool result = true;
+ try {
+ Json::Value root(Json::objectValue);
+
+ root[kJsonRpc] = kJsonRpcExpectedValue;
+
+ NsSmartObjects::SmartObject formatted_object(obj);
+ Json::Value msg_params_json(Json::objectValue);
+ formatted_object.getSchema().unapplySchema(formatted_object);
+
+ bool is_message_params = formatted_object.keyExists(strings::S_MSG_PARAMS);
+ bool empty_message_params = true;
+ if (true == is_message_params) {
+ const NsSmartObjects::SmartObject &msg_params = formatted_object
+ .getElement(strings::S_MSG_PARAMS);
+
+ result = (NsSmartObjects::SmartType_Map == msg_params.getType());
+ if (true == result) {
+ objToJsonValue(msg_params, msg_params_json);
+ }
+ if (0 < msg_params.length()) {
+ empty_message_params = false;
+ }
+ }
+
+ if (false == formatted_object.keyExists(strings::S_PARAMS)) {
+ result = false;
+ } else {
+ const NsSmartObjects::SmartObject &params = formatted_object.getElement(
+ strings::S_PARAMS);
+ if (NsSmartObjects::SmartType_Map != params.getType()) {
+ result = false;
+ } else {
+ const NsSmartObjects::SmartObject &message_type_object = params
+ .getElement(strings::S_MESSAGE_TYPE);
+
+ if (NsSmartObjects::SmartType_String != message_type_object.getType()) {
+ result = false;
+ } else {
+ const std::string message_type = message_type_object.asString();
+
+ if (kRequest == message_type) {
+ if (false == empty_message_params) {
+ root[kParams] = msg_params_json;
+ }
+ result = result && SetMethod(params, root);
+ result = result && SetId(params, root);
+ } else if (kResponse == message_type) {
+ root[kResult] = msg_params_json;
+ result = result && SetMethod(params, root[kResult]);
+ result = result && SetId(params, root);
+
+ if (false == params.keyExists(strings::kCode)) {
+ result = false;
+ } else {
+ const NsSmartObjects::SmartObject &code = params.getElement(
+ strings::kCode);
+
+ if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ result = false;
+ } else {
+ root[kResult][kCode] = code.asInt();
+ }
+ }
+ } else if (kNotification == message_type) {
+ root[kParams] = msg_params_json;
+ result = result && SetMethod(params, root);
+ } else if (kErrorResponse == message_type) {
+ result = result && SetId(params, root);
+ result = result && SetMethod(params, root[kError][kData]);
+ result = result && SetMessage(params, root[kError]);
+
+ const NsSmartObjects::SmartObject &code = params.getElement(
+ strings::kCode);
+ if (NsSmartObjects::SmartType_Integer != code.getType()) {
+ result = false;
+ } else {
+ root[kError][kCode] = code.asInt();
+ }
+ }
+ }
+ }
+ }
+ out_str = root.toStyledString();
+ } catch (...) {
+ result = false;
+ }
+
+ return result;
+}
+
+bool FormatterJsonRpc::SetMethod(const NsSmartObjects::SmartObject &params,
+ Json::Value &method_container) {
+ bool result = false;
+
+ if (true == params.keyExists(strings::S_FUNCTION_ID)) {
+ const NsSmartObjects::SmartObject &function_id =
+ params.getElement(strings::S_FUNCTION_ID);
+
+ if (NsSmartObjects::SmartType_String == function_id.getType()) {
+ method_container[kMethod] = function_id.asString();
+ result = true;
+ }
+ }
+
+ return result;
+}
+
+bool FormatterJsonRpc::SetId(const NsSmartObjects::SmartObject &params,
+ Json::Value &id_container) {
+ bool result = false;
+
+ if (true == params.keyExists(strings::S_CORRELATION_ID)) {
+ const NsSmartObjects::SmartObject &id = params.getElement(
+ strings::S_CORRELATION_ID);
+
+ if (NsSmartObjects::SmartType_Integer == id.getType()) {
+ id_container[kId] = id.asUInt();
+ result = true;
+ }
+ }
+
+ return result;
+}
+
+bool FormatterJsonRpc::SetMessage(const NsSmartObjects::SmartObject &params,
+ Json::Value &message_container) {
+ bool result = false;
+
+ if (true == params.keyExists(strings::kMessage)) {
+ const NsSmartObjects::SmartObject &message = params.getElement(
+ strings::kMessage);
+
+ if (NsSmartObjects::SmartType_String == message.getType()) {
+ message_container[kMessage] = message.asString();
+ result = true;
+ }
+ }
+
+ return result;
+}
+
+} // namespace Formatters
+} // namespace NsJSONHandler
+} // namespace NsSmartDeviceLink
diff --git a/src/components/formatters/src/generic_json_formatter.cc b/src/components/formatters/src/generic_json_formatter.cc
new file mode 100644
index 0000000000..ce1aa03807
--- /dev/null
+++ b/src/components/formatters/src/generic_json_formatter.cc
@@ -0,0 +1,63 @@
+/**
+ * @file generic_json_formatter.cc
+ * @brief Generic JSON formatter source file.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "formatters/generic_json_formatter.h"
+
+namespace NsSmartDeviceLink {
+namespace NsJSONHandler {
+namespace Formatters {
+
+void GenericJsonFormatter::ToString(const NsSmartObjects::SmartObject& obj,
+ std::string& out_str) {
+ Json::Value json_root;
+ objToJsonValue(obj, json_root);
+ out_str = json_root.toStyledString();
+}
+
+bool GenericJsonFormatter::FromString(const std::string& str,
+ NsSmartObjects::SmartObject& out) {
+ Json::Value json_root;
+ Json::Reader reader;
+ bool result = reader.parse(str, json_root);
+
+ if (true == result) {
+ jsonValueToObj(json_root, out);
+ }
+
+ return result;
+}
+
+} // namespace Formatters
+} // namespace NsJSONHandler
+} // namespace NsSmartDeviceLink
diff --git a/src/components/formatters/src/meta_formatter.cc b/src/components/formatters/src/meta_formatter.cc
new file mode 100644
index 0000000000..145020a5e2
--- /dev/null
+++ b/src/components/formatters/src/meta_formatter.cc
@@ -0,0 +1,60 @@
+/**
+ * @file meta_fromatter.cc
+ * @brief implementation of class CMetaFormatter which is designed to format
+ * the smart object against given schema for given formatter
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.auto
+
+#include <set>
+#include <string>
+
+#include "formatters/meta_formatter.h"
+
+namespace formatter_ns = NsSmartDeviceLink::NsJSONHandler::Formatters;
+namespace smart_objects_ns = NsSmartDeviceLink::NsSmartObjects;
+
+//---------------------------------------------------------------
+
+bool formatter_ns::CMetaFormatter::CreateObjectByPattern(
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& object,
+ const NsSmartDeviceLink::NsSmartObjects::CSmartSchema& schema,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& result_object) {
+
+ if (smart_objects_ns::SmartType_Invalid == result_object.getType()) {
+ return false;
+ }
+
+ schema.BuildObjectBySchema(object, result_object);
+
+ result_object.setSchema(schema);
+
+ return true;
+}
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
new file mode 100644
index 0000000000..f280f97664
--- /dev/null
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -0,0 +1,44 @@
+include_directories (
+ ./include/
+ ../application_manager/include/
+ ../utils/include/
+ ../smart_objects/include/
+ ../formatters/include/
+ ../config_profile/include/
+ ../media_manager/include/
+ ../protocol_handler/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${MESSAGE_BROKER_INCLUDE_DIRECTORY}
+ ../config_profile/include
+ ${CMAKE_SOURCE_DIR}/src/components/
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${CMAKE_SOURCE_DIR}/src/components/dbus/include/
+ ${CMAKE_SOURCE_DIR}/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+IF (HMIADAPTER STREQUAL "dbus")
+ set (DBUS_SOURCE ./src/dbus_message_adapter.cc)
+ set (DBUS_ADAPTER DBus)
+ENDIF ()
+
+set (SOURCES
+ ./src/hmi_message_handler_impl.cc
+ ./src/messagebroker_adapter.cc
+ ./src/hmi_message_adapter.cc
+ ./src/mqueue_adapter.cc
+ ${DBUS_SOURCE}
+)
+
+set (LIBRARIES
+ Utils
+ ${DBUS_ADAPTER}
+ ${RTLIB}
+)
+
+add_library("HMIMessageHandler" ${SOURCES})
+target_link_libraries("HMIMessageHandler" ${LIBRARIES})
+
+if(ENABLE_LOG)
+ target_link_libraries("HMIMessageHandler" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
new file mode 100644
index 0000000000..7d33e93332
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
+
+#include <string>
+#include "hmi_message_handler/hmi_message_adapter.h"
+#include "dbus/dbus_message_controller.h"
+#include "smart_objects/smart_object.h"
+
+namespace hmi_message_handler {
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
+/**
+ * \brief adapter for DBus
+ */
+class DBusMessageAdapter
+ : public HMIMessageAdapter,
+ public dbus::DBusMessageController {
+ public:
+ typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
+ explicit DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler);
+ ~DBusMessageAdapter();
+ void SendMessageToHMI(MessageSharedPointer message);
+
+ /**
+ * \brief subscribes to signals
+ */
+ void SubscribeTo();
+
+ private:
+ static const std::string SDL_SERVICE_NAME;
+ static const std::string SDL_OBJECT_PATH;
+ static const std::string HMI_SERVICE_NAME;
+ static const std::string HMI_OBJECT_PATH;
+
+ /**
+ * \brief sends request to HMI
+ * \param obj request
+ */
+ void Request(const smart_objects::SmartObject &obj);
+
+ /**
+ * \brief sends notification to HMI
+ * \param obj notification
+ */
+ void Notification(const smart_objects::SmartObject& obj);
+
+ /**
+ * \brief sends response to HMI
+ * \param obj response
+ */
+ void Response(const smart_objects::SmartObject &obj);
+
+ /**
+ * \brief sends error response to HMI
+ * \param obj error
+ */
+ void ErrorResponse(const smart_objects::SmartObject& obj);
+
+ /**
+ * \brief sends message to core
+ * \param obj
+ */
+ void SendMessageToCore(const smart_objects::SmartObject &obj);
+};
+
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h
new file mode 100644
index 0000000000..dc515318a0
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
+
+#include "hmi_message_handler/hmi_message_handler.h"
+
+namespace hmi_message_handler {
+/**
+ * \class HMIMessageAdapter
+ * \brief Interface class describing methods neccessary for exchanging message
+ * between ApplicationManager and HMI. Adapter for concrete transport connection
+ * SDL with HMI has to implement this interface.
+ */
+class HMIMessageAdapter : public HMIMessageSender {
+ public:
+ /**
+ * \brief Constructor
+ * \param handler Pointer to implementation of HMIMessageHandler abstract class
+ * to notify it about receiving message or error on sending message.
+ */
+ explicit HMIMessageAdapter(HMIMessageHandler* handler);
+
+ /**
+ * \brief Destructor
+ */
+ virtual ~HMIMessageAdapter();
+
+ protected:
+ /**
+ * \brief Interface for subscriptions.
+ * Each class implementing interface should use it according to
+ * standarts of transport for which it is to be an adapter.
+ * For example, Adapter for MessageBroker will use it to subscribe to notifications
+ * from HMI.
+ */
+ virtual void SubscribeTo() = 0;
+ inline virtual HMIMessageHandler* handler() const {
+ return handler_;
+ }
+
+ private:
+ /**
+ *\brief Pointer on handler to notify it about receiving message/error.
+ */
+ mutable HMIMessageHandler* handler_;
+};
+
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h
new file mode 100644
index 0000000000..828ae9a00e
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
+
+#include "hmi_message_handler/hmi_message_sender.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+
+namespace hmi_message_handler {
+
+class HMIMessageAdapter;
+/**
+ * \class HMIMessageHandler
+ * \brief Abstract class for handling different HMI adapters;
+ * establishing interface for message exchange between SDL core and HMI.
+ */
+class HMIMessageHandler : public HMIMessageObserver, public HMIMessageSender {
+ public:
+ virtual ~HMIMessageHandler() {}
+ virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter) = 0;
+ virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) = 0;
+};
+
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
new file mode 100644
index 0000000000..071ce2c549
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_IMPL_H_
+
+#include <set>
+#include "hmi_message_handler/hmi_message_adapter.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+#include "utils/macro.h"
+#include "utils/message_queue.h"
+#include "utils/prioritized_queue.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/threads/thread.h"
+#include "utils/singleton.h"
+
+namespace hmi_message_handler {
+
+
+namespace impl {
+/*
+* These dummy classes are here to locally impose strong typing on different
+* kinds of messages
+* Currently there is no type difference between incoming and outgoing messages
+* TODO(ik): replace these with globally defined message types
+* when we have them.
+*/
+struct MessageFromHmi: public MessageSharedPointer {
+ MessageFromHmi(const MessageSharedPointer& message)
+ : MessageSharedPointer(message) {}
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); }
+};
+
+struct MessageToHmi: public MessageSharedPointer {
+ MessageToHmi(const MessageSharedPointer& message)
+ : MessageSharedPointer(message) {}
+ // PrioritizedQueue requres this method to decide which priority to assign
+ size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); }
+};
+
+typedef threads::MessageLoopThread<
+ utils::PrioritizedQueue<MessageFromHmi> > FromHmiQueue;
+typedef threads::MessageLoopThread<
+ utils::PrioritizedQueue<MessageToHmi> > ToHmiQueue;
+}
+
+class ToHMIThreadImpl;
+class FromHMIThreadImpl;
+
+class HMIMessageHandlerImpl
+ : public HMIMessageHandler,
+ public impl::FromHmiQueue::Handler,
+ public impl::ToHmiQueue::Handler,
+ public utils::Singleton<HMIMessageHandlerImpl> {
+ public:
+ ~HMIMessageHandlerImpl();
+ void OnMessageReceived(MessageSharedPointer message);
+ void SendMessageToHMI(MessageSharedPointer message);
+ void set_message_observer(HMIMessageObserver* observer);
+ void OnErrorSending(MessageSharedPointer message);
+ void AddHMIMessageAdapter(HMIMessageAdapter* adapter);
+ void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter);
+
+ private:
+ HMIMessageHandlerImpl();
+
+
+ // threads::MessageLoopThread<*>::Handler implementations
+
+ // CALLED ON messages_from_hmi_ THREAD!
+ virtual void Handle(const impl::MessageFromHmi message) OVERRIDE;
+ // CALLED ON messages_to_hmi_ THREAD!
+ virtual void Handle(const impl::MessageToHmi message) OVERRIDE;
+ private:
+
+ HMIMessageObserver* observer_;
+ mutable sync_primitives::Lock observer_locker_;
+ std::set<HMIMessageAdapter*> message_adapters_;
+
+ // Construct message threads when everything is already created
+
+ // Thread that pumps messages being passed to hmi.
+ impl::ToHmiQueue messages_to_hmi_;
+ // Thread that pumps messages coming from hmi.
+ impl::FromHmiQueue messages_from_hmi_;
+
+ DISALLOW_COPY_AND_ASSIGN(HMIMessageHandlerImpl);
+ FRIEND_BASE_SINGLETON_CLASS(HMIMessageHandlerImpl);
+};
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_IMPL_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h
new file mode 100644
index 0000000000..f77a1f6a50
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
+
+#include "utils/shared_ptr.h"
+
+namespace application_manager {
+class Message;
+}
+
+namespace hmi_message_handler {
+
+class HMIMessageObserver {
+ public:
+ virtual void OnMessageReceived(
+ utils::SharedPtr<application_manager::Message> message) = 0;
+ virtual void OnErrorSending(
+ utils::SharedPtr<application_manager::Message> message) = 0;
+};
+}
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h
new file mode 100644
index 0000000000..2712857305
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
+
+#include "application_manager/message.h"
+
+namespace hmi_message_handler {
+ typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
+
+class HMIMessageSender {
+ public:
+ virtual void SendMessageToHMI(MessageSharedPointer message) = 0;
+};
+
+}
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
new file mode 100644
index 0000000000..13314ba0da
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
@@ -0,0 +1,88 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MESSAGEBROKER_ADAPTER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MESSAGEBROKER_ADAPTER_H_
+
+#include <string>
+
+#include "mb_controller.hpp"
+#include "hmi_message_handler/hmi_message_adapter.h"
+#include "utils/threads/thread_validator.h"
+
+namespace hmi_message_handler {
+
+class MessageBrokerAdapter : public HMIMessageAdapter,
+ public NsMessageBroker::CMessageBrokerController,
+ public threads::SingleThreadValidator {
+ public:
+ MessageBrokerAdapter(HMIMessageHandler* handler_param, const std::string&
+ server_address, uint16_t port);
+ ~MessageBrokerAdapter();
+ void SendMessageToHMI(MessageSharedPointer message);
+
+ /*Methods from CMessageBrokerController*/
+ /**
+ * \brief Called on receiving response message from RPCBus.
+ * \param method Name of corresponding request method that was sent previously to RPCBus.
+ * \param root Received Json object.
+ */
+ void processResponse(std::string method, Json::Value& root);
+
+ /**
+ * \brief Called on receiving request message from RPCBus.
+ * \param root Received Json object.
+ */
+ void processRequest(Json::Value& root);
+
+ /**
+ * \brief Called on receiving notification message from RPCBus.
+ * \param root Received Json object.
+ */
+ void processNotification(Json::Value& root);
+
+ void SubscribeTo();
+
+ void* SubscribeAndBeginReceiverThread(void* param);
+
+ protected:
+ void ProcessRecievedFromMB(Json::Value& root);
+
+ private:
+ static const std::string ADDRESS;
+ static const uint16_t PORT;
+
+ DISALLOW_COPY_AND_ASSIGN(MessageBrokerAdapter);
+};
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MESSAGEBROKER_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
new file mode 100644
index 0000000000..b0fb016622
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
+#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
+
+#include <memory>
+#include <mqueue.h>
+#include "utils/threads/thread.h"
+#include "hmi_message_handler/hmi_message_adapter.h"
+
+namespace hmi_message_handler {
+
+/**
+ * \brief HMI message adapter for mqueue
+ */
+class MqueueAdapter : public HMIMessageAdapter {
+ public:
+ MqueueAdapter(HMIMessageHandler* hmi_message_handler);
+ virtual ~MqueueAdapter();
+
+ protected:
+ virtual void SendMessageToHMI(MessageSharedPointer message);
+ virtual void SubscribeTo();
+
+ private:
+ mqd_t sdl_to_hmi_mqueue_;
+ mqd_t hmi_to_sdl_mqueue_;
+ std::auto_ptr<threads::Thread> receiver_thread_;
+};
+
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/src/dbus_message_adapter.cc b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
new file mode 100644
index 0000000000..1842789b22
--- /dev/null
+++ b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi_message_handler/dbus_message_adapter.h"
+#include <sstream>
+#include "utils/logger.h"
+#include "formatters/CSmartFactory.hpp"
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
+
+const std::string DBusMessageAdapter::SDL_SERVICE_NAME = "com.ford.sdl.core";
+const std::string DBusMessageAdapter::SDL_OBJECT_PATH = "/";
+const std::string DBusMessageAdapter::HMI_SERVICE_NAME = "com.ford.sdl.hmi";
+const std::string DBusMessageAdapter::HMI_OBJECT_PATH = "/";
+
+std::vector<std::string> &split(const std::string &s, char delim,
+ std::vector<std::string> &elems) {
+ std::stringstream ss(s);
+ std::string item;
+ while (std::getline(ss, item, delim)) {
+ elems.push_back(item);
+ }
+ return elems;
+}
+
+DBusMessageAdapter::DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler)
+ : HMIMessageAdapter(hmi_msg_handler),
+ DBusMessageController(SDL_SERVICE_NAME, SDL_OBJECT_PATH,
+ HMI_SERVICE_NAME, HMI_OBJECT_PATH) {
+ LOG4CXX_INFO(logger_, "Created DBusMessageAdapter");
+}
+
+DBusMessageAdapter::~DBusMessageAdapter() {
+}
+
+void DBusMessageAdapter::SendMessageToHMI(MessageSharedPointer message) {
+ LOG4CXX_INFO(logger_, "DBusMessageAdapter::sendMessageToHMI");
+
+ const smart_objects::SmartObject& smart = message->smart_object();
+ switch (smart[sos::S_PARAMS][sos::S_MESSAGE_TYPE].asInt()) {
+ case hmi_apis::messageType::request:
+ Request(smart);
+ break;
+ case hmi_apis::messageType::notification:
+ Notification(smart);
+ break;
+ case hmi_apis::messageType::response:
+ Response(smart);
+ break;
+ case hmi_apis::messageType::error_response:
+ ErrorResponse(smart);
+ break;
+ case hmi_apis::messageType::INVALID_ENUM:
+ default:
+ LOG4CXX_INFO(logger_, "Message type is invalid");
+ }
+}
+
+void DBusMessageAdapter::SubscribeTo() {
+ LOG4CXX_INFO(logger_, "DBusMessageAdapter::subscribeTo");
+ DBusMessageController::SubscribeTo("Buttons", "OnButtonEvent");
+ DBusMessageController::SubscribeTo("Buttons", "OnButtonPress");
+ DBusMessageController::SubscribeTo("UI", "OnCommand");
+ DBusMessageController::SubscribeTo("UI", "OnDriverDistraction");
+ DBusMessageController::SubscribeTo("UI", "OnSystemContext");
+ DBusMessageController::SubscribeTo("UI", "OnLanguageChange");
+ DBusMessageController::SubscribeTo("UI", "OnKeyboardInput");
+ DBusMessageController::SubscribeTo("UI", "OnTouchEvent");
+ DBusMessageController::SubscribeTo("UI", "OnResetTimeout");
+ DBusMessageController::SubscribeTo("TTS", "OnResetTimeout");
+ DBusMessageController::SubscribeTo("VR", "Started");
+ DBusMessageController::SubscribeTo("VR", "Stopped");
+ DBusMessageController::SubscribeTo("VR", "OnCommand");
+ DBusMessageController::SubscribeTo("VR", "OnLanguageChange");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnReady");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnAppDeactivated");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnStartDeviceDiscovery");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnUpdateDeviceList");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnFindApplications");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnAppActivated");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnExitApplication");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnExitAllApplications");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnDeviceChosen");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnIgnitionCycleOver");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemRequest");
+ DBusMessageController::SubscribeTo("BasicCommunication", "OnSystemInfoChanged");
+ DBusMessageController::SubscribeTo("TTS", "Started");
+ DBusMessageController::SubscribeTo("TTS", "Stopped");
+ DBusMessageController::SubscribeTo("TTS", "OnLanguageChange");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnGpsData");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnSpeed");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnRpm");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevel");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnFuelLevelState");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnInstantFuelConsumption");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnExternalTemperature");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnVin");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnPrndl");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnTirePressure");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnOdometer");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnBeltStatus");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnBodyInformation");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnDeviceStatus");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnDriverBraking");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnWiperStatus");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnHeadLampStatus");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnEngineTorque");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnAccPedalPosition");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnSteeringWheelAngle");
+ DBusMessageController::SubscribeTo("VehicleInfo", "OnMyKey");
+ DBusMessageController::SubscribeTo("Navigation", "OnTBTClientState");
+ DBusMessageController::SubscribeTo("SDL", "OnAllowSDLFunctionality");
+ DBusMessageController::SubscribeTo("SDL", "OnReceivedPolicyUpdate");
+ DBusMessageController::SubscribeTo("SDL", "OnPolicyUpdate");
+ DBusMessageController::SubscribeTo("SDL", "OnAppPermissionConsent");
+ DBusMessageController::SubscribeTo("SDL", "OnSystemError");
+ DBusMessageController::SubscribeTo("SDL", "AddStatisticsInfo");
+ DBusMessageController::SubscribeTo("SDL", "OnDeviceStateChanged");
+
+ LOG4CXX_INFO(logger_, "Subscribed to notifications.");
+}
+
+void DBusMessageAdapter::SendMessageToCore(const smart_objects::SmartObject& obj) {
+ LOG4CXX_INFO(logger_, "DBusMessageAdapter::SendMessageToCore");
+
+ if (!handler()) {
+ LOG4CXX_WARN(logger_, "DBusMessageAdapter hasn't handler");
+ return;
+ }
+
+ MessageSharedPointer message = new application_manager::Message(protocol_handler::MessagePriority::kDefault);//todo: ykazakov constant is a temp solution to finish merge MessagePriority::FromServiceType(message.servicetype) shall be used instead
+ message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+ message->set_smart_object(obj);
+ handler()->OnMessageReceived(message);
+ LOG4CXX_INFO(logger_, "Successfully sent to observer");
+}
+
+void DBusMessageAdapter::Request(const smart_objects::SmartObject& obj) {
+ LOG4CXX_DEBUG(logger_, "Request");
+ dbus::MessageId func_id = static_cast<dbus::MessageId>(
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
+ dbus::MessageName name = get_schema().getMessageName(func_id);
+ uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
+ MethodCall(id, func_id, name, obj[sos::S_MSG_PARAMS]);
+}
+
+void DBusMessageAdapter::Notification(const smart_objects::SmartObject &obj) {
+ LOG4CXX_DEBUG(logger_, "Notification");
+ dbus::MessageId func_id = static_cast<dbus::MessageId>(
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
+ dbus::MessageName name = get_schema().getMessageName(func_id);
+ Signal(func_id, name, obj[sos::S_MSG_PARAMS]);
+}
+
+void DBusMessageAdapter::Response(const smart_objects::SmartObject& obj) {
+ LOG4CXX_DEBUG(logger_, "Response");
+ dbus::MessageId func_id = static_cast<dbus::MessageId>(
+ obj[sos::S_PARAMS][sos::S_FUNCTION_ID].asInt());
+ dbus::MessageName name = get_schema().getMessageName(func_id);
+ uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
+ MethodReturn(id, func_id, name, obj[sos::S_MSG_PARAMS]);
+}
+
+void DBusMessageAdapter::ErrorResponse(const smart_objects::SmartObject &obj) {
+ LOG4CXX_DEBUG(logger_, "Error");
+ std::string error = obj[sos::S_PARAMS][sos::kCode].asString();
+ std::string description = obj[sos::S_PARAMS][sos::kMessage].asString();
+ uint id = obj[sos::S_PARAMS][sos::S_CORRELATION_ID].asInt();
+ Error(id, error, description);
+}
+
+} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/hmi_message_adapter.cc b/src/components/hmi_message_handler/src/hmi_message_adapter.cc
new file mode 100644
index 0000000000..343f13f00a
--- /dev/null
+++ b/src/components/hmi_message_handler/src/hmi_message_adapter.cc
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi_message_handler/hmi_message_adapter.h"
+
+namespace hmi_message_handler {
+HMIMessageAdapter::HMIMessageAdapter(HMIMessageHandler* handler)
+ : handler_(handler) {
+}
+
+HMIMessageAdapter::~HMIMessageAdapter() {
+ handler_ = 0;
+}
+
+} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
new file mode 100644
index 0000000000..ed37ee677c
--- /dev/null
+++ b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi_message_handler/hmi_message_handler_impl.h"
+#include "config_profile/profile.h"
+#include "utils/logger.h"
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
+
+HMIMessageHandlerImpl::HMIMessageHandlerImpl()
+ : observer_(NULL),
+ messages_to_hmi_("HMH ToHMI", this,
+ threads::ThreadOptions(
+ profile::Profile::instance()->thread_min_stack_size())),
+ messages_from_hmi_("HMH FromHMI", this,
+ threads::ThreadOptions(
+ profile::Profile::instance()->thread_min_stack_size())) {
+}
+
+HMIMessageHandlerImpl::~HMIMessageHandlerImpl() {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::~HMIMessageHandlerImpl()");
+ sync_primitives::AutoLock lock(observer_locker_);
+ observer_ = NULL;
+ if (!message_adapters_.empty()) {
+ LOG4CXX_WARN(logger_, "Not all HMIMessageAdapter have unsubscribed from"
+ " HMIMessageHandlerImpl");
+ }
+}
+
+void HMIMessageHandlerImpl::OnMessageReceived(MessageSharedPointer message) {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::OnMessageReceived()");
+ sync_primitives::AutoLock lock(observer_locker_);
+ if (!observer_) {
+ LOG4CXX_WARN(logger_, "No HMI message observer set!");
+ return;
+ }
+ messages_from_hmi_.PostMessage(impl::MessageFromHmi(message));
+}
+
+void HMIMessageHandlerImpl::SendMessageToHMI(MessageSharedPointer message) {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::~sendMessageToHMI()");
+ messages_to_hmi_.PostMessage(impl::MessageToHmi(message));
+}
+
+void HMIMessageHandlerImpl::set_message_observer(HMIMessageObserver* observer) {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::SetMessageObserver()");
+ observer_ = observer;
+}
+
+void HMIMessageHandlerImpl::OnErrorSending(MessageSharedPointer message) {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::OnErrorSending()");
+ sync_primitives::AutoLock lock(observer_locker_);
+ if (!observer_) {
+ LOG4CXX_WARN(logger_, "No HMI message observer set!");
+ return;
+ }
+ observer_->OnErrorSending(message);
+}
+
+void HMIMessageHandlerImpl::AddHMIMessageAdapter(HMIMessageAdapter* adapter) {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::AddHMIMessageAdapter()");
+ message_adapters_.insert(adapter);
+}
+
+void HMIMessageHandlerImpl::RemoveHMIMessageAdapter(
+ HMIMessageAdapter* adapter) {
+ LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::RemoveHMIMessageAdapter()");
+ if (adapter != NULL) {
+ message_adapters_.erase(adapter);
+ }
+}
+
+void HMIMessageHandlerImpl::Handle(const impl::MessageFromHmi message) {
+ LOG4CXX_INFO(logger_, "Received message from hmi");
+ sync_primitives::AutoLock lock(observer_locker_);
+ if (!observer_) {
+ LOG4CXX_ERROR(logger_, "Observer is not set for HMIMessageHandler");
+ return;
+ }
+
+ observer_->OnMessageReceived(message);
+ LOG4CXX_INFO(logger_, "Message from hmi given away.");
+
+}
+void HMIMessageHandlerImpl::Handle(const impl::MessageToHmi message) {
+ for (std::set<HMIMessageAdapter*>::iterator it =
+ message_adapters_.begin();
+ it != message_adapters_.end();
+ ++it) {
+ (*it)->SendMessageToHMI(message);
+ }
+}
+
+
+} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
new file mode 100644
index 0000000000..52975b257b
--- /dev/null
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -0,0 +1,176 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "hmi_message_handler/messagebroker_adapter.h"
+#include "config_profile/profile.h"
+#include "utils/logger.h"
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
+
+typedef NsMessageBroker::CMessageBrokerController MessageBrokerController;
+
+MessageBrokerAdapter::MessageBrokerAdapter(HMIMessageHandler* handler_param,
+ const std::string& server_address,
+ uint16_t port)
+ : HMIMessageAdapter(handler_param),
+ MessageBrokerController(server_address, port, "SDL") {
+ LOG4CXX_INFO(logger_, "Created MessageBrokerAdapter");
+}
+
+
+MessageBrokerAdapter::~MessageBrokerAdapter() {
+}
+
+void MessageBrokerAdapter::SendMessageToHMI(
+ hmi_message_handler::MessageSharedPointer message) {
+ LOG4CXX_INFO(logger_, "MessageBrokerAdapter::sendMessageToHMI");
+ /*if (!message) {
+ // TODO(PV): LOG
+ return;
+ }*/
+
+ Json::Reader reader;
+ Json::Value json_value;
+ if (!reader.parse(message->json_message(), json_value, false)) {
+ // TODO(PV): LOG4CXX_ERROR(mLogger, "Received invalid json string.");
+ return;
+ }
+
+ sendJsonMessage(json_value);
+}
+
+void MessageBrokerAdapter::processResponse(std::string method,
+ Json::Value& root) {
+ LOG4CXX_INFO(logger_, "MessageBrokerAdapter::processResponse");
+ ProcessRecievedFromMB(root);
+}
+
+void MessageBrokerAdapter::processRequest(Json::Value& root) {
+ LOG4CXX_INFO(logger_, "MessageBrokerAdapter::processRequest");
+ ProcessRecievedFromMB(root);
+}
+
+void MessageBrokerAdapter::processNotification(Json::Value& root) {
+ LOG4CXX_INFO(logger_, "MessageBrokerAdapter::processNotification");
+ ProcessRecievedFromMB(root);
+}
+
+void MessageBrokerAdapter::SubscribeTo() {
+ LOG4CXX_INFO(logger_, "MessageBrokerAdapter::subscribeTo");
+ MessageBrokerController::subscribeTo("Buttons.OnButtonEvent");
+ MessageBrokerController::subscribeTo("Buttons.OnButtonPress");
+ MessageBrokerController::subscribeTo("UI.OnCommand");
+ MessageBrokerController::subscribeTo("VR.OnCommand");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnReady");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnExitAllApplications");
+ MessageBrokerController::subscribeTo("UI.OnDriverDistraction");
+ MessageBrokerController::subscribeTo("UI.OnSystemContext");
+ MessageBrokerController::subscribeTo("UI.OnAppActivated");
+ MessageBrokerController::subscribeTo("UI.OnKeyboardInput");
+ MessageBrokerController::subscribeTo("UI.OnTouchEvent");
+ MessageBrokerController::subscribeTo("UI.OnResetTimeout");
+ MessageBrokerController::subscribeTo("TTS.OnResetTimeout");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnAppDeactivated");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnStartDeviceDiscovery");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnUpdateDeviceList");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnFindApplications");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnAppActivated");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnExitApplication");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnExitAllApplications");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnDeviceChosen");
+ MessageBrokerController::subscribeTo("UI.OnLanguageChange");
+ MessageBrokerController::subscribeTo("VR.OnLanguageChange");
+ MessageBrokerController::subscribeTo("TTS.OnLanguageChange");
+ MessageBrokerController::subscribeTo("VehicleInfo.OnVehicleData");
+ MessageBrokerController::subscribeTo("Navigation.OnTBTClientState");
+ MessageBrokerController::subscribeTo("TTS.Started");
+ MessageBrokerController::subscribeTo("TTS.Stopped");
+ MessageBrokerController::subscribeTo("VR.Started");
+ MessageBrokerController::subscribeTo("VR.Stopped");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnSystemRequest");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnIgnitionCycleOver");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnSystemInfoChanged");
+ MessageBrokerController::subscribeTo("SDL.OnAppPermissionConsent");
+ MessageBrokerController::subscribeTo("SDL.OnAllowSDLFunctionality");
+ MessageBrokerController::subscribeTo("SDL.OnReceivedPolicyUpdate");
+ MessageBrokerController::subscribeTo("SDL.OnSystemError");
+ MessageBrokerController::subscribeTo("SDL.AddStatisticsInfo");
+ MessageBrokerController::subscribeTo("SDL.OnDeviceStateChanged");
+ MessageBrokerController::subscribeTo("SDL.OnPolicyUpdate");
+
+ LOG4CXX_INFO(logger_, "Subscribed to notifications.");
+}
+
+void* MessageBrokerAdapter::SubscribeAndBeginReceiverThread(void* param) {
+ PassToThread(threads::Thread::CurrentId());
+ registerController();
+ SubscribeTo();
+ return MethodForReceiverThread(param);
+}
+
+void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
+ LOG4CXX_INFO(logger_, "MessageBrokerAdapter::ProcessRecievedFromMB");
+ if (root.isNull()) {
+ // LOG
+ return;
+ }
+
+ Json::FastWriter writer;
+ std::string message_string = writer.write(root);
+
+ if (message_string.empty()) {
+ // LOG
+ return;
+ }
+
+ // Messages from HMI (sent through message broker) have no priority so far
+ // assign default priority
+ hmi_message_handler::MessageSharedPointer message = hmi_message_handler::MessageSharedPointer(new application_manager::Message(
+ protocol_handler::MessagePriority::kDefault));
+ // message->set_message_type()
+ message->set_json_message(message_string);
+ message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+
+ if (!handler()) {
+ // WARNING
+ return;
+ }
+
+ handler()->OnMessageReceived(message);
+ LOG4CXX_INFO(logger_, "Successfully sent to observer");
+}
+
+} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/mqueue_adapter.cc b/src/components/hmi_message_handler/src/mqueue_adapter.cc
new file mode 100644
index 0000000000..0164c3c85c
--- /dev/null
+++ b/src/components/hmi_message_handler/src/mqueue_adapter.cc
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "hmi_message_handler/mqueue_adapter.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+#include "utils/logger.h"
+
+namespace hmi_message_handler {
+
+const uint32_t kMqueueSize = 100;
+const uint32_t kMqueueMessageSize = 65536;
+const char* kSdlToHmiQueue = "/sdl_to_hmi";
+const char* kHmiToSdlQueue = "/hmi_to_sdl";
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
+
+class ReceiverThreadDelegate : public threads::ThreadDelegate {
+ public:
+ ReceiverThreadDelegate(mqd_t mqueue_descriptor,
+ HMIMessageHandler* hmi_message_handler)
+ : mqueue_descriptor_(mqueue_descriptor),
+ hmi_message_handler_(hmi_message_handler) {}
+
+ private:
+ virtual void threadMain() {
+ while (true) {
+ static char buffer[kMqueueMessageSize];
+ const ssize_t size =
+ mq_receive(mqueue_descriptor_, buffer, kMqueueMessageSize, NULL);
+ if (-1 == size) {
+ LOG4CXX_ERROR(logger_, "Message queue receive failed, error " << errno);
+ continue;
+ }
+ const std::string message_string(buffer, buffer + size);
+ LOG4CXX_INFO(logger_, "Message: " << message_string);
+ MessageSharedPointer message(new application_manager::Message(
+ protocol_handler::MessagePriority::kDefault));
+ message->set_json_message(message_string);
+ message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+ hmi_message_handler_->OnMessageReceived(message);
+ }
+ }
+
+ const mqd_t mqueue_descriptor_;
+ HMIMessageHandler* hmi_message_handler_;
+};
+
+MqueueAdapter::MqueueAdapter(HMIMessageHandler* hmi_message_handler)
+ : HMIMessageAdapter(hmi_message_handler),
+ sdl_to_hmi_mqueue_(-1),
+ hmi_to_sdl_mqueue_(-1),
+ receiver_thread_() {
+ mq_attr mq_attributes;
+ mq_attributes.mq_maxmsg = kMqueueSize;
+ mq_attributes.mq_msgsize = kMqueueMessageSize;
+ sdl_to_hmi_mqueue_ =
+ mq_open(kSdlToHmiQueue, O_CREAT | O_RDWR, S_IRWXU, &mq_attributes);
+ if (-1 == sdl_to_hmi_mqueue_) {
+ LOG4CXX_ERROR(logger_, "Could not open message queue "
+ << kSdlToHmiQueue << ", error " << errno);
+ return;
+ }
+ hmi_to_sdl_mqueue_ =
+ mq_open(kHmiToSdlQueue, O_CREAT | O_RDWR, S_IRWXU, &mq_attributes);
+ if (-1 == hmi_to_sdl_mqueue_) {
+ LOG4CXX_ERROR(logger_, "Could not open message queue "
+ << kHmiToSdlQueue << ", error " << errno);
+ return;
+ }
+ ReceiverThreadDelegate* receiver_thread_delegate =
+ new ReceiverThreadDelegate(hmi_to_sdl_mqueue_, hmi_message_handler);
+ receiver_thread_.reset(
+ new threads::Thread("MqueueAdapter", receiver_thread_delegate));
+ receiver_thread_->start();
+}
+
+MqueueAdapter::~MqueueAdapter() {
+ if (receiver_thread_.get()) receiver_thread_->stop();
+ if (-1 != hmi_to_sdl_mqueue_) mq_close(hmi_to_sdl_mqueue_);
+ if (-1 != sdl_to_hmi_mqueue_) mq_close(sdl_to_hmi_mqueue_);
+ mq_unlink(kHmiToSdlQueue);
+ mq_unlink(kSdlToHmiQueue);
+}
+
+void MqueueAdapter::SendMessageToHMI(const MessageSharedPointer message) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (-1 == sdl_to_hmi_mqueue_) {
+ LOG4CXX_ERROR(logger_, "Message queue is not opened");
+ return;
+ }
+ const std::string& json = message->json_message();
+ if (json.size() > kMqueueMessageSize) {
+ LOG4CXX_ERROR(logger_, "Message size " << json.size() << " is too big");
+ return;
+ }
+ const int rc = mq_send(sdl_to_hmi_mqueue_, json.c_str(), json.size(), 0);
+ if (0 != rc) {
+ LOG4CXX_ERROR(logger_, "Could not send message, error " << errno);
+ return;
+ }
+
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void MqueueAdapter::SubscribeTo() {
+ // empty implementation of pure virtual method, actually it's not called
+}
+
+} // namespace hmi_message_handler
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
new file mode 100644
index 0000000000..7cbfad769c
--- /dev/null
+++ b/src/components/include/protocol/common.h
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_COMMON_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_COMMON_H_
+
+#include "utils/macro.h"
+#include "protocol/raw_message.h"
+
+/**
+ *\namespace protocol_handlerHandler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
+namespace protocol_handler {
+
+/**
+ *\brief Size of protocol header version 1.
+ */
+const uint8_t PROTOCOL_HEADER_V1_SIZE = 8;
+
+/**
+ *\brief Size of protocol header version 2 and higher.
+ */
+const uint8_t PROTOCOL_HEADER_V2_SIZE = 12;
+
+/**
+ *\brief Protocol versions constants
+ * First 4-bit field of AppLink protocol packet
+ */
+enum {
+ /**
+ *\brief Constant: number of protocol version (1).
+ */
+ PROTOCOL_VERSION_1 = 0x01,
+ /**
+ *\brief Constant: number of protocol version (2).
+ * Has difference with v.1 in Mobile_API.xml and frame Header difference
+ * Support SSL with Encryption, Video and Audio services
+ */
+ PROTOCOL_VERSION_2 = 0x02,
+ /**
+ *\brief Constant: number of protocol version (3).
+ * Has no difference with v.2 in Mobile_API.xml and frame Header difference
+ * Support SSL with Encryption, Video and Audio services
+ * Suuport ControlFrame, End Service to/from mobile support, HeartBeat future
+ */
+ PROTOCOL_VERSION_3 = 0x03,
+ /**
+ *\brief Maximum value of packet version field (size 4-bit) specified AppLink Protocol v.7
+ */
+ PROTOCOL_VERSION_MAX = 0x0F
+};
+
+/**
+ *\brief Flag of protection packet
+ * 1-bit field of AppLink protocol packet
+ */
+const bool PROTECTION_ON = true;
+const bool PROTECTION_OFF = false;
+
+/**
+ *\brief Protocol frame type constants
+ * 3-bit field of AppLink protocol packet
+ */
+enum {
+ /**
+ *\brief Constant: Control type of frame
+ */
+ FRAME_TYPE_CONTROL = 0x00,
+ /**
+ *\brief Constant: Single type of frame.
+ */
+ FRAME_TYPE_SINGLE = 0x01,
+ /**
+ *\brief Constant: First frame for multiple frames
+ */
+ FRAME_TYPE_FIRST = 0x02,
+ /**
+ *\brief Constant: Consecutive type of frame for multiple frames
+ */
+ FRAME_TYPE_CONSECUTIVE = 0x03,
+ /**
+ *\brief Maximum value of frame type field (size 3-bit)
+ */
+ FRAME_TYPE_MAX_VALUE = 0x07
+};
+
+/**
+ *\brief Protocol frame info
+ * 8-bit field of AppLink protocol packet
+ */
+enum {
+ // Frame type FRAME_TYPE_CONTROL (0x0)
+ /**
+ *\brief Hartbeat frame type
+ */
+ FRAME_DATA_HEART_BEAT = 0x00,
+ /**
+ *\brief Start service frame
+ */
+ FRAME_DATA_START_SERVICE = 0x01,
+ /**
+ *\brief Start service acknowledgement frame
+ */
+ FRAME_DATA_START_SERVICE_ACK = 0x02,
+ /**
+ *\brief Start service not acknowledgement frame
+ */
+ FRAME_DATA_START_SERVICE_NACK = 0x03,
+ /**
+ *\brief End service request frame
+ */
+ FRAME_DATA_END_SERVICE = 0x04,
+ /**
+ * \brief End service acknowledgement frame
+ */
+ FRAME_DATA_END_SERVICE_ACK = 0x05,
+ /**
+ *\brief End service not acknowledgement frame
+ */
+ FRAME_DATA_END_SERVICE_NACK = 0x06,
+ /**
+ *\brief Service data ACK frame
+ */
+ FRAME_DATA_SERVICE_DATA_ACK = 0xFE,
+ /**
+ *\brief Frame is for heart beat ack
+ */
+ FRAME_DATA_HEART_BEAT_ACK = 0xFF,
+
+ // Frame type FRAME_TYPE_SINGLE (0x2)
+ /**
+ *\brief Single frame has reserver frame data value 0x0
+ */
+ FRAME_DATA_SINGLE = 0x00,
+
+ // Frame type FRAME_TYPE_FIRST (0x3)
+ /**
+ *\brief First frame has reserver frame data value 0x0
+ */
+ FRAME_DATA_FIRST = 0x00,
+
+ // Frame type FRAME_TYPE_CONSECUTIVE (0x3)
+ /**
+ *\brief Marks last frame in mutliframe message
+ */
+ FRAME_DATA_LAST_CONSECUTIVE = 0x00,
+ /**
+ *\brief Maximum of consecutive frame numbers after which count has to roll over to 0x01
+ */
+ FRAME_DATA_MAX_CONSECUTIVE = 0xFF,
+
+ /**
+ *\brief Maximum value of frame info field (size 8-bit)
+ */
+ FRAME_DATA_MAX_VALUE = 0xFF
+};
+
+/**
+ *\brief If FRAME_TYPE_CONTROL: Constant: Maximum size of one frame excluding
+ *\brief frame header (used Ethernet MTU as default target transport)
+ */
+const uint32_t MAXIMUM_FRAME_DATA_SIZE = 1500;
+
+/**
+ *\brief If FRAME_TYPE_CONSECUTIVE: Constant: Size of first frame in
+ *\brief mutliframe message.
+ */
+const uint8_t FIRST_FRAME_DATA_SIZE = 0x08;
+
+/**
+ *\enum RESULT_CODE
+ *\brief Return type for operations with message handling.
+ */
+enum RESULT_CODE {
+ RESULT_OK = 1,
+ RESULT_FAIL = 2,
+ RESULT_NUMBER_BUSY = 3,
+ RESULT_CONNECTION_LOST = 4,
+ RESULT_DISCONNECTED = 5,
+ RESULT_NOTFOUND = 6,
+ RESULT_TIMEOUT = 7,
+ RESULT_WRONG_SEQUENCE = 8,
+ RESULT_AGAIN = 9,
+ RESULT_WRONG_FRAME_SEQUENCE = 10,
+ RESULT_IN_PROGRESS = 11,
+ RESULT_REASSIGN = 12,
+ RESULT_XML_PARSING = 13,
+ RESULT_RESEND_ACK = 14,
+ RESULT_DEFRERRED = 15,
+ RESULT_ENCRYPTION_FAILED = 16,
+ RESULT_HEARTBEAT_IS_NOT_SUPPORTED = 17,
+ RESULT_UNKNOWN = 255
+};
+} // namespace protocol_handler
+typedef ::protocol_handler::RawMessage RawMessage;
+typedef ::protocol_handler::RawMessagePtr RawMessagePtr;
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_COMMON_H_
diff --git a/src/components/include/protocol/message_priority.h b/src/components/include/protocol/message_priority.h
new file mode 100644
index 0000000000..baed0d89c4
--- /dev/null
+++ b/src/components/include/protocol/message_priority.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_MESSAGE_PRIORITY_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_MESSAGE_PRIORITY_H_
+
+#include <cstddef>
+
+#include "protocol/service_type.h"
+
+namespace protocol_handler {
+
+// Class for calculating and tracking message priorities in the system
+// It was decided to wrap simple priority number into trivial class to
+// Have all priority value calculations in single place and
+// prevent random priorities assignment in the code
+class MessagePriority {
+ public:
+ // Default (in other words non-prioritized) priority value
+ static const MessagePriority kDefault;
+ // Static constructor to get priority value of Service type
+ static MessagePriority FromServiceType(ServiceType service_type);
+
+ // Trivial inline copy constructor
+ MessagePriority(const MessagePriority &that);
+
+ // Ordering value which is used by queues to order messages
+ // Higher value means higher prioirty
+ size_t OrderingValue() const;
+ private:
+ // Constructor is private to prevent creation
+ // of random priorities in the code please use static constructor if you
+ // need priority value
+ explicit MessagePriority(int32_t value): value_(value) {}
+ size_t value_;
+};
+} // namespace protocol_handler
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_MESSAGE_PRIORITY_H_
diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h
new file mode 100644
index 0000000000..09b5eafb7e
--- /dev/null
+++ b/src/components/include/protocol/raw_message.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
+
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "protocol/service_type.h"
+#include "protocol/message_priority.h"
+
+namespace protocol_handler {
+/**
+ * \class SmartDeviceLinkRawMessage
+ * \brief Class-wrapper for information about message for interchanging
+ * between components.
+ */
+class RawMessage {
+ public:
+ /**
+ * \brief Constructor
+ * \param connection_key Identifier of connection within which message
+ * is transferred
+ * \param protocolVersion Version of protocol of the message
+ * \param data Message string
+ * \param dataSize Message size
+ * \param payload_size Received data size
+ */
+ RawMessage(uint32_t connection_key, uint32_t protocol_version,
+ const uint8_t *const data_param, uint32_t data_size,
+ uint8_t type = ServiceType::kRpc,
+ uint32_t payload_size = 0);
+ /**
+ * \brief Destructor
+ */
+ ~RawMessage();
+ /**
+ * \brief Connection Identifier
+ * Obtained from \s ConnectionHandler
+ */
+ uint32_t connection_key() const;
+ /**
+ * \brief Setter for connection identifier
+ */
+ void set_connection_key(uint32_t);
+ /**
+ * \brief Getter for message string data
+ */
+ uint8_t *data() const;
+ /**
+ * \brief Getter for message size
+ */
+ size_t data_size() const;
+ /**
+ * \brief Getter for actual data size
+ */
+ size_t payload_size() const;
+ /**
+ * \brief Version of SmartDeviceLink protocol
+ * used for transferring message.
+ */
+ uint32_t protocol_version() const;
+ /**
+ * \brief Type of service message belongs to
+ */
+ ServiceType service_type() const {
+ return service_type_;
+ }
+ /**
+ * \brief Specifies current state of message in queue.
+ * if false message is "ready to be processed"
+ * otherwise it is "waiting for response"
+ */
+ bool IsWaiting() const;
+ void set_waiting(bool v);
+
+ private:
+ uint32_t connection_key_;
+ uint8_t *data_;
+ size_t data_size_;
+ uint32_t protocol_version_;
+ ServiceType service_type_;
+ size_t payload_size_;
+ bool waiting_;
+ DISALLOW_COPY_AND_ASSIGN(RawMessage);
+};
+typedef utils::SharedPtr<RawMessage> RawMessagePtr;
+} // namespace protocol_handler
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_
diff --git a/src/components/include/protocol/rpc_type.h b/src/components/include/protocol/rpc_type.h
new file mode 100644
index 0000000000..5419bb5fce
--- /dev/null
+++ b/src/components/include/protocol/rpc_type.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_RPC_TYPE_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_RPC_TYPE_H_
+
+#include <stdint.h>
+
+#include <ostream>
+
+namespace protocol_handler {
+
+// AppLink protocol 4.1.3 RpcType field
+enum RpcType {
+ kRpcTypeRequest = 0x0,
+ kRpcTypeResponse = 0x1,
+ kRpcTypeNotification = 0x2,
+ kRpcTypeReserved
+};
+
+// Validate and map byte value to RPC type
+RpcType RpcTypeFromByte(uint8_t byte);
+// Check and convert RpcType to byte value ready to be transmitted
+uint8_t RpcTypeToByte(RpcType type);
+
+const char *RpcTypeToString(RpcType type);
+
+std::ostream &operator<<(std::ostream &os, RpcType rpc_type);
+} // namespace protocol_handler
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RPC_TYPE_H_
diff --git a/src/components/include/protocol/service_type.h b/src/components/include/protocol/service_type.h
new file mode 100644
index 0000000000..ab049be9b7
--- /dev/null
+++ b/src/components/include/protocol/service_type.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_SERVICE_TYPE_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_SERVICE_TYPE_H_
+
+#include <stdint.h>
+
+namespace protocol_handler {
+
+/**
+ *\brief Constant: Frame type for HeartBeat
+ */
+const uint8_t SERVICE_TYPE_CONTROL = 0x00;
+
+/**
+ *\brief Constant: RPC type of session
+ */
+const uint8_t SERVICE_TYPE_RPC = 0x07;
+
+/**
+ *\brief Constant: Raw PCM audio service
+ */
+const uint8_t SERVICE_TYPE_AUDIO = 0x0A;
+
+/**
+ * \brief Constant: Mobile Navi type of session for map streaming
+ */
+const uint8_t SERVICE_TYPE_NAVI = 0x0B;
+
+/**
+ *\brief Constant: Bulk data type of session (hybrid)
+ */
+const uint8_t SERVICE_TYPE_BULK = 0x0F;
+
+
+/**
+ * \brief Enum describing possible types of sessions: RPC for API messages,
+ Navi for video streaming, bulk for PutFile.
+ */
+enum ServiceType {
+ kControl = SERVICE_TYPE_CONTROL,
+ kRpc = SERVICE_TYPE_RPC,
+ kAudio = SERVICE_TYPE_AUDIO,
+ kMobileNav = SERVICE_TYPE_NAVI,
+ kBulk = SERVICE_TYPE_BULK,
+ kInvalidServiceType
+};
+
+/*
+ * Service type conversion functions that are used to read and output
+ * Service types to binary stream
+ */
+ServiceType ServiceTypeFromByte(uint8_t type);
+uint8_t ServiceTypeToByte(ServiceType type);
+
+} // namespace protocol_handler
+
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_SERVICE_TYPE_H_
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
new file mode 100644
index 0000000000..e0d4fde8cd
--- /dev/null
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_H_
+
+#include "protocol/common.h"
+
+/**
+ *\namespace protocol_handlerHandler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
+namespace protocol_handler {
+
+class ProtocolObserver;
+
+/**
+ * \class ProtocolHandler
+ * \brief Interface for component parsing protocol header
+ * on the messages between SDL and mobile application.
+ */
+class ProtocolHandler {
+ public:
+ /**
+ * \brief Adds pointer to higher layer handler for message exchange
+ * \param observer Pointer to object of the class implementing
+ * IProtocolObserver
+ */
+ virtual void AddProtocolObserver(ProtocolObserver *observer) = 0;
+
+ /**
+ * \brief Removes pointer to higher layer handler for message exchange
+ * \param observer Pointer to object of the class implementing
+ * IProtocolObserver.
+ */
+ virtual void RemoveProtocolObserver(ProtocolObserver *observer) = 0;
+
+ /**
+ * \brief Method for sending message to Mobile Application.
+ * \param message RawMessage with params to be sent to Mobile App.
+ * \param final_message tells whether message's
+ * connection must be closed when message is processed
+ */
+ virtual void SendMessageToMobileApp(const RawMessagePtr message,
+ bool final_message) = 0;
+
+ /**
+ * \brief Sends number of processed frames in case of binary nav streaming
+ * \param connection_key Id of connection over which message is to be sent
+ * \param number_of_frames Number of frames processed by
+ * streaming server and displayed to user.
+ */
+ virtual void SendFramesNumber(uint32_t connection_key,
+ int32_t number_of_frames) = 0;
+
+ /**
+ * \brief Prepare and send heartbeat message to mobile app
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
+ */
+ virtual void SendHeartBeat(int32_t connection_id, uint8_t session_id) = 0;
+
+ /**
+ * \brief Sends ending session to mobile application
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
+ */
+ virtual void SendEndSession(int32_t connection_id, uint8_t session_id) = 0;
+
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ProtocolHandler() {
+ }
+};
+} // namespace protocol_handler
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_H_
diff --git a/src/components/include/protocol_handler/protocol_observer.h b/src/components/include/protocol_handler/protocol_observer.h
new file mode 100644
index 0000000000..3879a4057e
--- /dev/null
+++ b/src/components/include/protocol_handler/protocol_observer.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_OBSERVER_H_
+
+#include "protocol/common.h"
+
+/**
+ *\namespace protocol_handlerHandler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
+namespace protocol_handler {
+
+/**
+ * \class IProtocolObserver
+ * \brief Interface for making a bridge between
+ * ProtocolHandler and JSONHandler components.
+ */
+class ProtocolObserver {
+ public:
+ /**
+ * \brief Callback function which is used by ProtocolHandler
+ * when new message is received from Mobile Application.
+ * \param message Message with supporting params received
+ */
+ virtual void OnMessageReceived(const RawMessagePtr message) = 0;
+
+ virtual void OnMobileMessageSent(const RawMessagePtr message) = 0;
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ProtocolObserver() {
+ }
+};
+} // namespace protocol_handler
+
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_OBSERVER_H_
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
new file mode 100644
index 0000000000..9a958f6fa7
--- /dev/null
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_H_
+
+#include <list>
+#include <string>
+#include "transport_manager/transport_manager.h"
+#ifdef ENABLE_SECURITY
+#include "security_manager/ssl_context.h"
+#endif // ENABLE_SECURITY
+/**
+ *\namespace protocol_handlerHandler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
+namespace protocol_handler {
+/**
+ * \brief HASH_ID constants.
+ * Hint: Shall not intersect with connection identifiers for correct handling
+ * these constants (Session identifier shall be greater than zero)
+ */
+enum {
+ HASH_ID_NOT_SUPPORTED = 0,
+ HASH_ID_WRONG = 0xFFFF0000
+};
+/**
+ * \class SessionObserver
+ * \brief Interface for making a bridge between ProtocolHandler and
+ * ConnectionHandler components.
+ */
+// TODO(EZamakhov): Reconsider rename callbacks and SessionObserver to SessionManager
+// TODO(EZamakhov): Reconsider rename KeyFromPair and PairFromKey
+class SessionObserver {
+ public:
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates start of new session.
+ * \param connection_handle Connection identifier within which session
+ * has to be started.
+ * \param sessionId Identifier of the session to be start
+ * \param service_type Type of service
+ * \param protocol_version Version of protocol
+ * \param is_protected would be service protected
+ * \param hash_id pointer for session hash identifier, uint32_t* hash_id
+ * \return uint32_t Id (number) of new session if successful, otherwise 0.
+ */
+ virtual uint32_t OnSessionStartedCallback(
+ const transport_manager::ConnectionUID &connection_handle,
+ const uint8_t sessionId,
+ const protocol_handler::ServiceType &service_type,
+ const bool is_protected, uint32_t* hash_id) = 0;
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates session ending.
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Identifier of the session to be ended
+ * \param hashCode Hash used only in second version of SmartDeviceLink protocol.
+ * If not equal to hash assigned to session on start then operation fails.
+ * \param service_type Type of service
+ * \return uint32_t 0 if operation fails, session key otherwise
+ */
+ virtual uint32_t OnSessionEndedCallback(
+ const transport_manager::ConnectionUID &connection_handle,
+ const uint8_t sessionId,
+ const uint32_t &hashCode,
+ const protocol_handler::ServiceType &service_type) = 0;
+
+ /**
+ * \brief Creates unique identifier of session (can be used as hash)
+ * from given connection identifier
+ * within which session exists and session number.
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Identifier of the session
+ * \return uint32_t Unique key for session
+ */
+ virtual uint32_t KeyFromPair(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id) = 0;
+
+ /**
+ * \brief Returns connection identifier and session number from given
+ * session key
+ * \param key Unique key used by other components as session identifier
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Returned: Number of session
+ */
+ virtual void PairFromKey(
+ uint32_t key,
+ transport_manager::ConnectionUID *connection_handle,
+ uint8_t *sessionId) = 0;
+
+ /**
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ virtual int32_t GetDataOnSessionKey(uint32_t key,
+ uint32_t *app_id,
+ std::list<int32_t> *sessions_list,
+ uint32_t *device_id) = 0;
+
+ /**
+ * \brief information about device
+ * \param device_handle
+ * \param device_name Returned: name of device
+ * \param applications_list Returned: applications on device
+ * \param mac_address Returned: List of session keys
+ * \param connection_type Returned: type of connection (USB, BT, etc.)
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ virtual int32_t GetDataOnDeviceID(uint32_t device_handle,
+ std::string *device_name,
+ std::list<uint32_t> *applications_list,
+ std::string *mac_address,
+ std::string *connection_type) = 0;
+
+ /**
+ * \brief returns TRUE if session supports sending HEARTBEAT ACK to mobile side
+ * \param connection_handle Connection identifier whithin which session exists
+ * \param session_id Identifier of the session
+ * \return TRUE if session has protocol version which supports heartbeat otherwise returns FALSE
+ */
+ virtual bool IsHeartBeatSupported(
+ transport_manager::ConnectionUID connection_handle,
+ uint8_t session_id) = 0;
+
+#ifdef ENABLE_SECURITY
+ /**
+ * \brief Sets crypto context of connection
+ * \param key Unique key used by other components as session identifier
+ * \param context SSLContext to be set
+ * \return \c SecurityQuery::ProtectSessionResult value
+ */
+ virtual int SetSSLContext(
+ const uint32_t &key,
+ security_manager::SSLContext *context) = 0;
+ /**
+ * \brief Gets crypto context of connection, use service_type to get NULL
+ * SSLContext for not protected services or ControlService (0x0)
+ * to get current SSLContext of connection
+ * \param key Unique key used by other components as session identifier
+ * \param service_type Type of service
+ * \return \ref SSLContext of connection
+ */
+ virtual security_manager::SSLContext *GetSSLContext(
+ const uint32_t &key,
+ const protocol_handler::ServiceType &service_type) = 0;
+ /**
+ * \brief Set protection flag to service in session by key
+ * to get current SSLContext of connection
+ * \param key Unique key used by other components as session identifier
+ * \param service_type Type of service
+ */
+ virtual void SetProtectionFlag(
+ const uint32_t &key,
+ const protocol_handler::ServiceType &service_type) = 0;
+#endif // ENABLE_SECURITY
+
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~SessionObserver() {
+ }
+};
+} // namespace protocol_handler
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_H_
diff --git a/src/components/include/security_manager/crypto_manager.h b/src/components/include/security_manager/crypto_manager.h
new file mode 100644
index 0000000000..87cfc1397f
--- /dev/null
+++ b/src/components/include/security_manager/crypto_manager.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
+
+#include <string>
+
+/**
+ * \class security_manager::CryptoManager
+ * \brief Class factory, producing instances of \ref SSLContext
+ *
+ * \fn security_manager::SSLContext *security_manager::CryptoManager::CreateSSLContext()
+ * \brief Creates an instance of \ref SSLContext class
+ *
+ * \fn void security_manager::CryptoManager::ReleaseSSLContext(security_manager::SSLContext *context)
+ * \brief Frees \ref SSLContext instance
+ */
+
+namespace security_manager {
+class SSLContext;
+
+enum Mode { CLIENT, SERVER };
+enum Protocol { SSLv3, TLSv1, TLSv1_1, TLSv1_2 };
+
+class CryptoManager {
+ public:
+ virtual bool Init(Mode mode,
+ Protocol protocol,
+ const std::string &cert_filename,
+ const std::string &key_filename,
+ const std::string &ciphers_list,
+ bool verify_peer) = 0;
+ virtual void Finish() = 0;
+ virtual SSLContext *CreateSSLContext() = 0;
+ virtual void ReleaseSSLContext(SSLContext *context) = 0;
+ virtual std::string LastError() const = 0;
+ virtual ~CryptoManager() { }
+};
+
+} // namespace security_manager
+#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_H_
diff --git a/src/components/include/security_manager/security_manager.h b/src/components/include/security_manager/security_manager.h
new file mode 100644
index 0000000000..252ec610a8
--- /dev/null
+++ b/src/components/include/security_manager/security_manager.h
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_H_
+
+#include <list>
+#include <string>
+
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/protocol_observer.h"
+#include "protocol_handler/session_observer.h"
+
+#include "security_manager/crypto_manager.h"
+#include "security_manager/security_manager_listener.h"
+
+namespace security_manager {
+/**
+ * \brief SecurityManager interface implements protocol_handler::ProtocolObserver
+ * and provide interface for handling Security queries from mobile side
+ */
+class SecurityManager
+ : public protocol_handler::ProtocolObserver {
+ public:
+ /**
+ * \brief InternalErrors is 1 byte identifier of internal error
+ * Handle as binary data in Ford Protocol
+ */
+ enum InternalErrors {
+ ERROR_SUCCESS = 0x00,
+ ERROR_INVALID_QUERY_SIZE = 0x01, // wrong size of query data
+ ERROR_INVALID_QUERY_ID = 0x02, // unknown query id
+ ERROR_NOT_SUPPORTED = 0x03, // SDL does not support encryption
+ ERROR_SERVICE_ALREADY_PROTECTED = 0x04,
+ ERROR_SERVICE_NOT_PROTECTED = 0x05, // got handshake or encrypted data
+ // for not protected service
+ ERROR_DECRYPTION_FAILED = 0x06,
+ ERROR_ENCRYPTION_FAILED = 0x07,
+ ERROR_SSL_INVALID_DATA = 0x08,
+ ERROR_INTERNAL = 0xFF,
+ ERROR_UNKWOWN_INTERNAL_ERROR = 0xFE // error valeu for testing
+ };
+ /**
+ * \brief Sets pointer for Connection Handler layer for managing sessions
+ * \param session_observer pointer to object of the class implementing
+ */
+ virtual void set_session_observer(
+ protocol_handler::SessionObserver *observer) = 0;
+ /**
+ * \brief Sets pointer for Protocol Handler layer for sending
+ * \param protocol_handler pointer to object of the class implementing
+ */
+ virtual void set_protocol_handler(
+ protocol_handler::ProtocolHandler *protocol_handler_) = 0;
+ /**
+ * \brief Sets pointer for CryptoManager for handling SSLContext
+ * \param crypto_manager pointer to object of the class implementing
+ */
+ virtual void set_crypto_manager(CryptoManager *crypto_manager) = 0;
+
+ /**
+ * \brief Sends InternalError with text message to mobile application
+ * \param connection_key Unique key used by other components as session identifier
+ * \param error_id unique error identifier
+ * \param erorr_text SSL impelmentation error text
+ * \param seq_number received from Mobile Application
+ */
+ virtual void SendInternalError(const uint32_t connection_key,
+ const uint8_t &error_id,
+ const std::string &erorr_text,
+ const uint32_t seq_number) = 0;
+ /**
+ * \brief Sends InternalError override methode for sending without seq_number
+ * \param connection_key Unique key used by other components as session identifier
+ * \param error_id unique error identifier
+ * \param erorr_text SSL impelmentation error text
+ */
+ void SendInternalError(const uint32_t connection_key,
+ const uint8_t &error_id,
+ const std::string &erorr_text) {
+ SendInternalError(connection_key, error_id, erorr_text, 0);
+ }
+
+ /**
+ * \brief Create new SSLContext for connection or return exists
+ * Do not notify listeners, send security error on occure
+ * \param connection_key Unique key used by other components as session identifier
+ * @return new \c SSLContext or \c NULL on any error
+ */
+ virtual SSLContext *CreateSSLContext(const uint32_t &connection_key) = 0;
+
+ /**
+ * \brief Start handshake as SSL client
+ */
+ virtual void StartHandshake(uint32_t connection_key) = 0;
+
+ /**
+ * \brief Add/Remove for SecurityManagerListener
+ */
+ virtual void AddListener(SecurityManagerListener *const listener) = 0;
+ virtual void RemoveListener(SecurityManagerListener *const listener) = 0;
+};
+} // namespace security_manager
+#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_H_
diff --git a/src/components/include/security_manager/security_manager_listener.h b/src/components/include/security_manager/security_manager_listener.h
new file mode 100644
index 0000000000..14a5dc3281
--- /dev/null
+++ b/src/components/include/security_manager/security_manager_listener.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
+namespace security_manager {
+
+class SecurityManagerListener {
+ public:
+ /**
+ * \brief Notification about protection result
+ * \param connection_key Unique key used by other components as session identifier
+ * \param success result of connection protection
+ * \return \c true on success notification or \c false otherwise
+ */
+ virtual bool OnHandshakeDone(uint32_t connection_key,
+ bool success) = 0;
+ virtual ~SecurityManagerListener() {}
+};
+} // namespace security_manager
+#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
diff --git a/src/components/include/security_manager/ssl_context.h b/src/components/include/security_manager/ssl_context.h
new file mode 100644
index 0000000000..e3f1dadc4f
--- /dev/null
+++ b/src/components/include/security_manager/ssl_context.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SSL_CONTEXT_H_
+#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SSL_CONTEXT_H_
+
+#include <cstddef> // for size_t typedef
+#include <string>
+
+// TODO(EZamakhov): update brief info
+/**
+ * \class security_manager::SSLContext
+ * \brief Class responsible for SSL connection establishing
+ * and data encryption and decryption within this connection
+ *
+ * \fn security_manager::SSLContext::DoHandshakeStep(
+ * const uint8_t* in_data, size_t in_data_size,
+ * const uint8_t** out_data, size_t *out_data_size)
+ * \brief Performs SSL handshake
+ * In order to establish an SSL connection it's
+ * necessary to perform handshake process. During this process
+ * client and server negotiate about encryption algorithms to use
+ * and produce a session key.
+ *
+ * \param in_data [in] data sent by other side
+ * \param in_data_size [in] size of data in \ref in_data buffer
+ * \param out_data [out] response of SSL context if there is one. If not, equals NULL
+ * \param out_data_size [out] length of response. On no response, equals 0
+ */
+
+namespace security_manager {
+class SSLContext {
+ public:
+ enum HandshakeResult {
+ Handshake_Result_Success = 0x0,
+ Handshake_Result_Fail = 0x1,
+ Handshake_Result_AbnormalFail = 0x2
+ };
+ virtual HandshakeResult StartHandshake(const uint8_t** const out_data,
+ size_t *out_data_size) = 0;
+ virtual HandshakeResult DoHandshakeStep(const uint8_t *const in_data,
+ size_t in_data_size,
+ const uint8_t** const out_data,
+ size_t *out_data_size) = 0;
+ virtual bool Encrypt(const uint8_t *const in_data, size_t in_data_size,
+ const uint8_t ** const out_data, size_t *out_data_size) = 0;
+ virtual bool Decrypt(const uint8_t *const in_data, size_t in_data_size,
+ const uint8_t ** const out_data, size_t *out_data_size) = 0;
+ virtual bool IsInitCompleted() const = 0;
+ virtual bool IsHandshakePending() const = 0;
+ virtual size_t get_max_block_size(size_t mtu) const = 0;
+ virtual std::string LastError() const = 0;
+ virtual ~SSLContext() { }
+};
+} // namespace security_manager
+#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SSL_CONTEXT_H_
diff --git a/src/components/include/transport_manager/common.h b/src/components/include/transport_manager/common.h
new file mode 100644
index 0000000000..c1fc51dc8a
--- /dev/null
+++ b/src/components/include/transport_manager/common.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
+
+#include <vector>
+#include <string>
+
+/**
+ * @brief - transport_manager namespace
+ */
+namespace transport_manager {
+
+/**
+ * @enum Transport manager states.
+ */
+enum {
+ E_SUCCESS = 0,
+ E_TM_IS_NOT_INITIALIZED,
+ E_INVALID_HANDLE,
+ E_CONNECTION_IS_TO_SHUTDOWN,
+ E_CONNECTION_EXISTS,
+ E_ADAPTER_EXISTS,
+ E_ADAPTERS_FAIL,
+ E_INTERNAL_ERROR
+};
+
+/**
+ * @brief Type definition for variable that hold handle of device.
+ */
+typedef unsigned int DeviceHandle;
+
+/**
+ * @brief Type definition for variable that hold connection unique identifier.
+ */
+typedef unsigned int ConnectionUID;
+
+/**
+ * @brief Type definition for variable that hold connection type.
+ */
+typedef std::string ConnectionType;
+
+/**
+ * @brief Type definition for variable that hold device unique identifier.
+ */
+typedef std::string DeviceUID;
+
+/**
+ * @brief Type definition of container(vector) that holds device unique
+ * identifiers.
+ */
+typedef std::vector<DeviceUID> DeviceList;
+
+/**
+ * @brief Type definition for variable that hold handle of application.
+ */
+typedef int ApplicationHandle;
+
+/**
+ * @brief Type definition for vector that contain ApplicationHandle variables.
+ */
+typedef std::vector<ApplicationHandle> ApplicationList;
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
diff --git a/src/components/include/transport_manager/error.h b/src/components/include/transport_manager/error.h
new file mode 100644
index 0000000000..7e2349eac2
--- /dev/null
+++ b/src/components/include/transport_manager/error.h
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
+
+#include <string>
+#include <utils/shared_ptr.h>
+
+namespace transport_manager {
+
+/**
+ * @brief Class that hold information about error.
+ */
+class BaseError {
+ public:
+ /**
+ * @brief Constructor.
+ */
+ BaseError() {}
+
+ /**
+ * @brief Constructor.
+ *
+ * @param desc Description of error.
+ */
+ explicit BaseError(const std::string& desc) : description_(desc) {}
+
+ /**
+ * @brief Constructor.
+ *
+ * @param other Error class.
+ */
+ BaseError(const BaseError& other) : description_(other.description_) {}
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~BaseError() {}
+
+ /**
+ * @brief Return description of error.
+ *
+ * @return string with description of error.
+ */
+ virtual const std::string& text() const {
+ return description_;
+ }
+
+ private:
+ std::string description_;
+};
+typedef utils::SharedPtr<BaseError> BaseErrorPtr;
+
+/**
+ * @brief Error that originates during device search.
+ */
+class SearchDeviceError : public BaseError {
+};
+
+/**
+ * @brief Error that originates during connection.
+ */
+class ConnectError : public BaseError {
+};
+
+/**
+ * @brief Error that originates during disconnection.
+ */
+class DisconnectError : public BaseError {
+};
+
+/**
+ * @brief Error that originates during device disconnection.
+ */
+class DisconnectDeviceError : public BaseError {
+};
+
+/**
+ * @brief Error that originates during data receive..
+ */
+class DataReceiveError : public BaseError {
+};
+
+/**
+ * @brief Error that originates during data send.
+ */
+class DataSendError : public BaseError {
+ public:
+ /**
+ * @brief Constructor.
+ */
+ DataSendError() : BaseError() {}
+
+ /**
+ * @brief Constructor.
+ *
+ * @param Error description.
+ */
+ explicit DataSendError(const std::string& desc) : BaseError(desc) {}
+};
+
+/**
+ * @brief Error that originates during data sending timeout.
+ */
+class DataSendTimeoutError : public DataSendError {
+};
+
+
+/**
+ * @brief Error that originates during communication.
+ */
+class CommunicationError : public BaseError {
+};
+
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_
diff --git a/src/components/include/transport_manager/info.h b/src/components/include/transport_manager/info.h
new file mode 100644
index 0000000000..66e9df97a3
--- /dev/null
+++ b/src/components/include/transport_manager/info.h
@@ -0,0 +1,163 @@
+/*
+ * \file info.h
+ * \brief Information classes header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_INFO_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_INFO_H_
+
+#include <string>
+#include "transport_manager/common.h"
+
+/**
+ * @brief transport_manager name space
+ */
+namespace transport_manager {
+
+/**
+ * @brief Base information class.
+ */
+class Info {
+ protected:
+ /**
+ * @brief Variable that hold name.
+ */
+ std::string name_;
+
+ public:
+ /**
+ * @brief Constructor.
+ */
+ Info() {}
+
+ /**
+ * @brief Constructor
+ *
+ * @param name Info class object name.
+ */
+ explicit Info(std::string name)
+ : name_(name) {
+ }
+
+ /**
+ * @brief Return string with name.
+ */
+ std::string name() const {
+ return name_;
+ }
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~Info() {}
+};
+
+/**
+ * @brief Hold information about device.
+ */
+class DeviceInfo : public Info {
+ protected:
+ /**
+ * @brief Variable that hold MAC address of device.
+ */
+ std::string mac_address_;
+
+ /**
+ * @brief Variable that hold handle of device.
+ */
+ DeviceHandle device_handle_;
+
+ /**
+ * @brief The connection type used by device.
+ */
+ ConnectionType connection_type_;
+
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param device_handle Handle of device.
+ * @param mac_address MAC address of device.
+ * @param name Name of device.
+ */
+ DeviceInfo(DeviceHandle device_handle, std::string mac_address,
+ std::string name, const ConnectionType& connection_type)
+ : Info(name),
+ mac_address_(mac_address),
+ device_handle_(device_handle),
+ connection_type_(connection_type) {
+ }
+
+ /**
+ * @brief Return mac_address.
+ */
+ std::string mac_address() const {
+ return mac_address_;
+ }
+
+ /**
+ * @brief Return device_handle field.
+ */
+ DeviceHandle device_handle() const {
+ return device_handle_;
+ }
+
+ /**
+ * @brief Return connection_type_.
+ * @return
+ */
+ ConnectionType connection_type() const {
+ return connection_type_;
+ }
+
+ /**
+ * @brief Overloaded operator "==".
+ */
+ friend bool operator ==(const DeviceInfo& first, const DeviceInfo& second);
+
+ // Needed for std::set container
+ bool operator <(const DeviceInfo& than) const {
+ return device_handle_ < than.device_handle_;
+ }
+};
+
+/**
+ * @brief Assign fields of one DeviceInfo class to another.
+ */
+inline bool operator ==(const DeviceInfo& first, const DeviceInfo& second) {
+ return first.name_ == second.name_
+ && first.mac_address_ == second.mac_address_
+ && first.device_handle_ == second.device_handle_;
+}
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_INFO_H_
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
new file mode 100644
index 0000000000..78d3b44958
--- /dev/null
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_H_
+
+#include <string>
+#include <vector>
+
+#include "transport_manager/common.h"
+#include "utils/shared_ptr.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Internal class describing device.
+ **/
+class Device {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param name User-friendly device name.
+ * @param unique_device_id device unique identifier.
+ **/
+ Device(const std::string& name, const DeviceUID& unique_device_id)
+ : name_(name),
+ unique_device_id_(unique_device_id),
+ keep_on_disconnect_(false) {}
+ /**
+ * @brief Destructor.
+ **/
+ virtual ~Device() {}
+
+ /**
+ * @brief Compare devices.
+ *
+ * This method checks whether two SDevice structures
+ * refer to the same device.
+ *
+ * @param other_Ddvice Device to compare with.
+ *
+ * @return true if devices are equal, false otherwise.
+ **/
+ virtual bool IsSameAs(const Device* other_device) const = 0;
+
+ virtual ApplicationList GetApplicationList() const = 0;
+
+ inline const DeviceUID& unique_device_id() const {
+ return unique_device_id_;
+ }
+
+ /**
+ * @brief Return name of device.
+ */
+ inline const std::string& name() const {
+ return name_;
+ }
+
+ /**
+ * @brief Get @link keep_on_disconnect_ @endlink value
+ */
+ inline bool keep_on_disconnect() const {
+ return keep_on_disconnect_;
+ }
+
+ /**
+ * @brief Set @link keep_on_disconnect_ @endlink value
+ * @param keep_on_disconnect new value
+ */
+ inline void set_keep_on_disconnect(bool keep_on_disconnect) {
+ keep_on_disconnect_ = keep_on_disconnect;
+ }
+
+ private:
+ /**
+ * @brief Device user-friendly name.
+ **/
+ std::string name_;
+
+ /**
+ * @brief Unique device identifier across all devices.
+ **/
+ DeviceUID unique_device_id_;
+
+ /**
+ * @brief If true, device will remain in list even if all its connections finished.
+ **/
+ bool keep_on_disconnect_;
+};
+typedef utils::SharedPtr<Device> DeviceSptr;
+typedef std::vector<DeviceSptr> DeviceVector;
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_H_
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
new file mode 100644
index 0000000000..eb4bb88f53
--- /dev/null
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -0,0 +1,267 @@
+/**
+ * \file transport_adapter.h
+ * \brief TransportAdapter class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_H_
+
+#include <string>
+#include <vector>
+#include <list>
+#include <map>
+
+#include "utils/shared_ptr.h"
+
+#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/common.h"
+#include "transport_manager/error.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+
+class TMMetricObserver;
+
+namespace transport_adapter {
+
+class TransportAdapterListener;
+
+// TODO(EZamakhov): cahnge to DeviceUID
+typedef std::string DeviceType;
+/**
+ * @brief Type definition of container(map) that holds device unique
+ *identifier(key value) and smart pointer to the device(mapped value).
+ **/
+typedef std::map<DeviceUID, DeviceSptr> DeviceMap;
+/**
+ * @brief Type definition for container(list) that holds pointers to device
+ * adapter listeners
+ */
+typedef std::list<TransportAdapterListener*> TransportAdapterListenerList;
+
+class TransportAdapter {
+ public:
+ /**
+ * @enum Available types of errors.
+ */
+ enum Error {
+ OK,
+ FAIL,
+ NOT_SUPPORTED,
+ ALREADY_EXISTS,
+ BAD_STATE,
+ BAD_PARAM
+ };
+
+ public:
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TransportAdapter() {}
+
+ /**
+ * @brief
+ */
+ virtual DeviceType GetDeviceType() const = 0;
+
+ /**
+ * @brief Allows to obtain connection type used by device.
+ * @return connection type.
+ */
+ virtual ConnectionType GetConnectionType() const = 0;
+
+ /* TODO
+ virtual Error LoadState(TransportAdapterState* state) = 0;
+ virtual void SaveState(TransportAdapterState* state) = 0;
+ */
+
+ /**
+ * @brief Check initialization.
+ *
+ * @return true if initialized.
+ * @return false if not initialized.
+ */
+ virtual bool IsInitialised() const = 0;
+
+ /**
+ * @brief Run device adapter.
+ *
+ * Called from transport manager to start device adapter.
+ *
+ * @return Error information about possible reason of failure.
+ **/
+ virtual Error Init() = 0;
+
+ /**
+ * @brief Add listener to the container(list) of device adapter listeners.
+ *
+ * @param listener Pointer to the device adapter listener.
+ */
+ virtual void AddListener(TransportAdapterListener* listener) = 0;
+
+ /**
+ * @brief Notify that device scanner is available.
+ *
+ * @return true - available, false - not available.
+ */
+ virtual bool IsSearchDevicesSupported() const = 0;
+
+ /**
+ * @brief Start scanning for new devices.
+ *
+ * List of new devices will be supplied in onDeviceListUpdated callback.
+ *
+ * @return Error information about possible reason of failure.
+ **/
+ virtual Error SearchDevices() = 0;
+
+ /**
+ * @brief Notify that server connection factory is available.
+ *
+ * @return true - available, false - not available.
+ */
+ virtual bool IsServerOriginatedConnectSupported() const = 0;
+
+ /**
+ * @brief Connect to the specified application discovered on device.
+ *
+ * @param device_handle Handle of device to connect to.
+ * @param app_handle Handle of application to connect to.
+ *
+ * @return Error information about possible reason of failure.
+ **/
+ virtual Error Connect(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Connect to all applications discovered on device
+ * @param device_handle Handle of device
+ * @return Error information about connecting applications on device
+ */
+ virtual Error ConnectDevice(const DeviceUID& device_handle) = 0;
+
+ /**
+ * @brief Notify that listener of client connection is available.
+ *
+ * @return true - available, false - not available.
+ */
+ virtual bool IsClientOriginatedConnectSupported() const = 0;
+
+ /**
+ * @brief Start client listener.
+ *
+ * @return Error information about possible reason of failure.
+ */
+ virtual Error StartClientListening() = 0;
+
+ /**
+ * @brief Stop client listener.
+ *
+ * @return Error information about possible reason of failure.
+ */
+ virtual Error StopClientListening() = 0;
+
+ /**
+ * @brief Disconnect from specified session.
+ *
+ * @param device_handle Handle of device to Disconnect from.
+ * @param app_handle Handle of application.
+ *
+ * @return Error information about possible reason of disconnection from the
+ *device failure.
+ **/
+ virtual Error Disconnect(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Disconnect from all sessions on specified device.
+ *
+ * @param device_handle Device handle to Disconnect.
+ *
+ * @return Error information about possible reason of disconnecting from
+ *device failure
+ **/
+ virtual Error DisconnectDevice(const DeviceUID& device_handle) = 0;
+
+ /**
+ * @brief Send frame.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param data Smart pointer to the raw message.
+ *
+ * @return Error information about possible reason of sending data failure.
+ **/
+ virtual Error SendData(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const RawMessagePtr data) = 0;
+
+ /**
+ * @brief Create container(vector) of device unique identifiers.
+ *
+ * @return container(vector) of device unique identifiers.
+ */
+ virtual DeviceList GetDeviceList() const = 0;
+
+ /**
+ * @brief Get container(vector) of application unique identifiers that
+ *available at specified device.
+ *
+ * @param device_handle Device unique identifier.
+ *
+ * @return Container(vector) that holds application unique identifiers.
+ */
+ virtual ApplicationList GetApplicationList(const DeviceUID& device_handle)
+ const = 0;
+
+ /**
+ * @brief Return name of device.
+ *
+ * @param device_id device unique identifier.
+ *
+ * @return string.
+ */
+ virtual std::string DeviceName(const DeviceUID& device_id) const = 0;
+
+#ifdef TIME_TESTER
+ /**
+ * @brief Return Time metric observer
+ *
+ * @param return pointer to Time metric observer
+ */
+ virtual TMMetricObserver* GetTimeMetricObserver() = 0;
+#endif // TIME_TESTER
+};
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_H_
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
new file mode 100644
index 0000000000..d343ccc357
--- /dev/null
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_EVENT_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_EVENT_H_
+
+#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+
+class TransportAdapterEvent {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param type Event type.
+ * @param transport_adapter Transport adapter
+ * @param device_handle Handle of device.
+ * @param application_id Handle of application.
+ * @param data Smart pointer to the raw message.
+ * @param error Error class that contains details of this error situation.
+ */
+ TransportAdapterEvent(int type,
+ transport_adapter::TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& application_id,
+ RawMessagePtr data, BaseErrorPtr error)
+ : event_type(type),
+ application_id(application_id),
+ device_uid(device_handle),
+ transport_adapter(adapter),
+ event_data(data),
+ event_error(error) {
+ }
+ /**
+ * @brief Value that describe event type.
+ */
+ int event_type;
+ /**
+ * @brief Handle of application
+ */
+ ApplicationHandle application_id;
+ /**
+ * @brief Device unique identifier.
+ */
+ DeviceUID device_uid;
+ /**
+ * @brief Transport adapter.
+ */
+ transport_adapter::TransportAdapter* transport_adapter;
+ /**
+ * @brief Smart pointer to the raw message
+ */
+ RawMessagePtr event_data;
+ /**
+ * @brief Pointer to the class that contain details of error.
+ */
+ BaseErrorPtr event_error;
+};
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_EVENT_H_
diff --git a/src/components/include/transport_manager/transport_manager.h b/src/components/include/transport_manager/transport_manager.h
new file mode 100644
index 0000000000..149dede001
--- /dev/null
+++ b/src/components/include/transport_manager/transport_manager.h
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_H_
+
+#include "transport_manager/common.h"
+#include "transport_manager/transport_manager_listener.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+
+class TransportAdapterEvent;
+
+/**
+ * @brief Interface of transport manager.
+ **/
+class TransportManager {
+ public:
+ /**
+ * @brief Destructor.
+ **/
+ virtual ~TransportManager() {}
+
+ /**
+ * @brief Initialize transport manager.
+ * @return Error code.
+ */
+ virtual int Init() = 0;
+
+ /**
+ * @brief Start scanning for new devices.
+ *
+ * @return Code error.
+ **/
+ virtual int SearchDevices() = 0;
+
+ /**
+ * @brief Connect to all applications discovered on device.
+ *
+ * @param device_id Handle of device to connect to.
+ *
+ * @return Code error.
+ **/
+ virtual int ConnectDevice(const DeviceHandle& device_id) = 0;
+
+ /**
+ * @brief Disconnect from all applications connected on device.
+ *
+ * @param device_id Handle of device to Disconnect from.
+ *
+ * @return Code error.
+ **/
+ virtual int DisconnectDevice(const DeviceHandle& device_id) = 0;
+
+ /**
+ * @brief Disconnect from applications connected on device by connection
+ *unique identifier.
+ *
+ * @param connection Connection unique identifier.
+ *
+ * @return Code error.
+ **/
+ virtual int Disconnect(const ConnectionUID& connection_id) = 0;
+
+ /**
+ * @brief Disconnect and clear all unprocessed data.
+ *
+ * @param connection Connection unique identifier.
+ */
+ virtual int DisconnectForce(const ConnectionUID& connection_id) = 0;
+
+ /**
+ * @brief Post new message in queue for massages destined to device.
+ *
+ * @param message Smart pointer to the raw massage.
+ *
+ * @return Code error.
+ **/
+ virtual int SendMessageToDevice(const RawMessagePtr message) = 0;
+
+ /**
+ * @brief Post event in the event queue.
+ *
+ * @param event Current event information.
+ *
+ * @return Code error.
+ **/
+ virtual int ReceiveEventFromDevice(const TransportAdapterEvent& event) = 0;
+
+ /**
+ * @brief Add transport adapter.
+ *
+ * @param transport_adapter Transport adapter
+ *
+ * @return Error code.
+ **/
+ virtual int AddTransportAdapter(
+ transport_adapter::TransportAdapter* transport_adapter) = 0;
+
+ /**
+ * @brief Post listener to the container of transport manager listeners.
+ *
+ * @param listener Pointer to the transport manager listener.
+ *
+ * @return Code error.
+ **/
+ virtual int AddEventListener(TransportManagerListener* listener) = 0;
+
+ /**
+ * @brief Stop work finally. No new events guaranteed after method finish.
+ *
+ * @return Error code.
+ **/
+ virtual int Stop() = 0;
+
+ /**
+ * @brief Remove device from the container that hold devices.
+ *
+ * @param device Handle of device.
+ *
+ * @return Code error.
+ **/
+ virtual int RemoveDevice(const DeviceHandle& device_handle) = 0;
+
+ /**
+ * @brief Turns on or off visibility of SDL to mobile devices
+ * when visibility is ON (on_off = true) mobile devices are able to connect
+ * otherwise ((on_off = false)) SDL is not visible from outside
+ *
+ * @return Code error.
+ */
+ virtual int Visibility(const bool& on_off) const = 0;
+};
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_H_
diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
new file mode 100644
index 0000000000..c36c0cb2f1
--- /dev/null
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
+
+#include <vector>
+#include "transport_manager/common.h"
+#include "transport_manager/info.h"
+#include "transport_manager/error.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+
+class TransportManagerListener {
+ public:
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TransportManagerListener() {
+ }
+
+ /**
+ * @brief Reaction to the event, when the list of devices is updated.
+ *
+ * @param Container that holds information about devices.
+ */
+ virtual void OnDeviceListUpdated(const std::vector<DeviceInfo>&) = 0;
+
+ /**
+ * @brief Reaction to "Find new applications" request
+ */
+ virtual void OnFindNewApplicationsRequest() = 0;
+
+ /**
+ * @brief Reaction to the event, when the device is found.
+ *
+ * @param device_info Variable that hold information about device.
+ */
+ virtual void OnDeviceFound(const DeviceInfo& device_info) = 0;
+ virtual void OnDeviceAdded(const DeviceInfo& device_info) = 0;
+ virtual void OnDeviceRemoved(const DeviceInfo& device_info) = 0;
+
+ /**
+ * @brief Reaction to the event, when scanning of devices is finished.
+ */
+ virtual void OnScanDevicesFinished() = 0;
+
+ /**
+ * @brief Reaction to the event, when scanning of devices is failed.
+ *
+ * @param error Error information about possible reason of scanning of devices failure.
+ */
+ virtual void OnScanDevicesFailed(const SearchDeviceError& error) = 0;
+
+ /**
+ * @brief Reaction to the event, when connection is established.
+ *
+ * @param devcie_info Variable that hold information about device.
+ * @param connection_id connection unique identifier.
+ */
+ virtual void OnConnectionEstablished(const DeviceInfo& device_info,
+ const ConnectionUID& connection_id) = 0;
+
+ /**
+ * @brief Reaction to the event, when connection to the device is failed.
+ *
+ * @param device_info Variable that hold information about device.
+ * @param error Error information about possible reason of connect failure.
+ */
+ virtual void OnConnectionFailed(const DeviceInfo& device_info,
+ const ConnectError& error) = 0;
+
+ /**
+ * @brief Reaction to the event, when connection is closed.
+ *
+ * @param connection_id Connection unique identifier.
+ */
+ virtual void OnConnectionClosed(ConnectionUID connection_id) = 0;
+
+ /**
+ * @brief Called when connection is closed unexpectedly, i.e. disconnect was not requested
+ *
+ * @param connection_id Connection ID.
+ * @param error Error information.
+ */
+ virtual void OnUnexpectedDisconnect(ConnectionUID connection_id,
+ const CommunicationError& error) = 0;
+
+ /**
+ * @brief Reaction to the event, when connection close is failed.
+ *
+ * @param connection_id Connection unique identifier.
+ * @param error Error information about possible reason of failure.
+ */
+ virtual void OnConnectionClosedFailure(ConnectionUID connection_id,
+ const DisconnectError& error) = 0;
+
+ /**
+ * \brief Inform about losing connection with device.
+ * \param device Handle of device.
+ * \param error Error information about possible reason of loosing connection.
+ */
+ virtual void OnDeviceConnectionLost(const DeviceHandle& device,
+ const DisconnectDeviceError& error) = 0;
+
+ /**
+ * \brief Inform about failure during DisconnectDevice procedure of transport manager.
+ * \param device Handle of device.
+ * \param error Error information about possible reason of disconnecting failure.
+ */
+ virtual void OnDisconnectFailed(const DeviceHandle& device,
+ const DisconnectDeviceError& error) = 0;
+ /**
+ * @brief Notifies about recieving message from TM.
+ *
+ * @param message Recieved message
+ **/
+ virtual void OnTMMessageReceived(const RawMessagePtr message) = 0;
+
+ /**
+ * @brief Reaction to the event, when receiving of massage for transport manager is failed.
+ *
+ * @param connection_id connection unique identifier.
+ * @param error Error information about possible reason of failure.
+ */
+ virtual void OnTMMessageReceiveFailed(ConnectionUID connection_id,
+ const DataReceiveError& error) = 0;
+
+ /**
+ * @brief Reaction to the event, when transport manager sent a massage.
+ */
+ virtual void OnTMMessageSend(const RawMessagePtr message) = 0;
+
+ /**
+ * @brief Reaction to the event, when sending of massage by transport manager is failed.
+ *
+ * @param error Error information about possible reason of failure.
+ * @param message Smart pointer to the raw massage.
+ */
+ virtual void OnTMMessageSendFailed(const DataSendError& error,
+ const RawMessagePtr message) = 0;
+};
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_H_
diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h
new file mode 100644
index 0000000000..2b3149bb54
--- /dev/null
+++ b/src/components/include/transport_manager/transport_manager_listener_empty.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_
+
+#include <vector>
+
+#include "transport_manager/transport_manager_listener.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+
+/**
+ * @brief Empty implementation class for transport manager listener.
+ */
+class TransportManagerListenerEmpty : public TransportManagerListener {
+ public:
+ /**
+ * @Destructor.
+ */
+ virtual ~TransportManagerListenerEmpty() {}
+
+ /**
+ * @brief Reaction to the event, when the list of devices is updated.
+ *
+ * @param Container that holds information about devices.
+ */
+ virtual void OnDeviceListUpdated(const std::vector<DeviceInfo>&) {
+ }
+
+ virtual void OnFindNewApplicationsRequest() {
+ }
+
+ /**
+ * @brief Reaction to the event, when the device is found.
+ *
+ * @param device_info Variable that hold information about device.
+ */
+ virtual void OnDeviceFound(const DeviceInfo& device_info) {
+ }
+ virtual void OnDeviceAdded(const DeviceInfo& device_info) {
+ }
+ virtual void OnDeviceRemoved(const DeviceInfo& device_info) {
+ }
+
+ /**
+ * @brief Reaction to the event, when scanning of devices is finished.
+ */
+ virtual void OnScanDevicesFinished() {
+ }
+
+ /**
+ * @brief Reaction to the event, when scanning of devices is failed.
+ *
+ * @param error Error information about possible reason of scanning of devices failure.
+ */
+ virtual void OnScanDevicesFailed(const SearchDeviceError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when connection is established.
+ *
+ * @param devcie_info Variable that hold information about device.
+ * @param connection_id connection unique identifier.
+ */
+ virtual void OnConnectionEstablished(const DeviceInfo& device_info,
+ const ConnectionUID& connection_id) {
+ }
+
+ /**
+ * @brief Reaction to the event, when connection to the device is failed.
+ *
+ * @param device_info Variable that hold information about device.
+ * @param error Error information about possible reason of connect failure.
+ */
+ virtual void OnConnectionFailed(const DeviceInfo& device_info,
+ const ConnectError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when connection is closed.
+ *
+ * @param connection_id Connection unique identifier.
+ */
+ virtual void OnConnectionClosed(ConnectionUID connection_id) {
+ }
+
+ virtual void OnUnexpectedDisconnect(ConnectionUID connection_id,
+ const CommunicationError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when connection close is failed.
+ *
+ * @param connection_id Connection unique identifier.
+ * @param error Error information about possible reason of failure.
+ */
+ virtual void OnConnectionClosedFailure(ConnectionUID connection_id,
+ const DisconnectError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when connection with the device is lost.
+ *
+ * @param device Handle of device.
+ * @param error Error information about possible reason of lost connection.
+ */
+ virtual void OnDeviceConnectionLost(const DeviceHandle& device,
+ const DisconnectDeviceError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when Disconnect is failed.
+ *
+ * @param device Handle of device.
+ * @param error Error information about possible reason of Disconnect failure.
+ */
+ virtual void OnDisconnectFailed(const DeviceHandle& device,
+ const DisconnectDeviceError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when transport manager received a massage.
+ *
+ * @param message Smart pointer to the raw massage.
+ * @param connection_id Connection unique identifier.
+ */
+ virtual void OnTMMessageReceived(const RawMessagePtr message) {
+ }
+
+ /**
+ * @brief Reaction to the event, when receiving of massage for transport manager is failed.
+ *
+ * @param connection_id connection unique identifier.
+ * @param error Error information about possible reason of failure.
+ */
+ virtual void OnTMMessageReceiveFailed(ConnectionUID connection_id,
+ const DataReceiveError& error) {
+ }
+
+ /**
+ * @brief Reaction to the event, when transport manager sent a massage.
+ */
+ virtual void OnTMMessageSend(const RawMessagePtr message) {
+ }
+
+ /**
+ * @brief Reaction to the event, when sending of massage by transport manager is failed.
+ *
+ * @param error Error information about possible reason of failure.
+ * @param message Smart pointer to the raw massage.
+ */
+ virtual void OnTMMessageSendFailed(const DataSendError& error,
+ const RawMessagePtr message) {
+ }
+};
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_LISTENER_EMPTY_H_
diff --git a/src/components/include/utils/atomic.h b/src/components/include/utils/atomic.h
new file mode 100644
index 0000000000..6f6e98e0ec
--- /dev/null
+++ b/src/components/include/utils/atomic.h
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef __QNXNTO__
+#include <atomic.h>
+#endif
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
+
+#if defined(__QNXNTO__)
+#define atomic_post_inc(ptr) atomic_add_value((ptr), 1)
+#elif defined(__GNUG__)
+#define atomic_post_inc(ptr) __sync_fetch_and_add((ptr), 1)
+#else
+#warning "atomic_post_inc() implementation is not atomic"
+#define atomic_post_inc(ptr) (*(ptr))++
+#endif
+
+#if defined(__QNXNTO__)
+#define atomic_post_dec(ptr) atomic_sub_value((ptr), 1)
+#elif defined(__GNUG__)
+#define atomic_post_dec(ptr) __sync_fetch_and_sub((ptr), 1)
+#else
+#warning "atomic_post_dec() implementation is not atomic"
+#define atomic_post_dec(ptr) (*(ptr))--
+#endif
+
+#if defined(_QNXNTO__)
+// on QNX pointer assignment is believed to be atomic
+#define atomic_pointer_assign(dst, src) (dst) = (src)
+#elif defined(__GNUG__)
+// with g++ pointer assignment is believed to be atomic
+#define atomic_pointer_assign(dst, src) (dst) = (src)
+#else
+#warning atomic_pointer_assign() implementation may be non-atomic
+#define atomic_pointer_assign(dst, src) (dst) = (src)
+#endif
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_ATOMIC_H_
diff --git a/src/components/include/utils/byte_order.h b/src/components/include/utils/byte_order.h
new file mode 100644
index 0000000000..18d6ab3388
--- /dev/null
+++ b/src/components/include/utils/byte_order.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_BYTE_ORDER_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_BYTE_ORDER_H_
+
+#ifdef __QNX__
+#include <gulliver.h>
+#define BE_TO_LE32(x) ENDIAN_SWAP32(&(x));
+#define LE_TO_BE32(x) ENDIAN_SWAP32(&(x));
+#else
+#include <byteswap.h>
+#define BE_TO_LE32(x) bswap_32(x)
+#define LE_TO_BE32(x) bswap_32(x)
+#endif
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_BYTE_ORDER_H_
diff --git a/src/components/include/utils/conditional_variable.h b/src/components/include/utils/conditional_variable.h
new file mode 100644
index 0000000000..58119a0cfd
--- /dev/null
+++ b/src/components/include/utils/conditional_variable.h
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
+
+#if defined(OS_POSIX)
+#include <pthread.h>
+#else
+#error Please implement conditional variable for your OS
+#endif
+#include <stdint.h>
+
+#include "utils/macro.h"
+
+namespace sync_primitives {
+class AutoLock;
+
+namespace impl {
+#if defined(OS_POSIX)
+typedef pthread_cond_t PlatformConditionalVariable;
+#endif
+} // namespace impl
+
+/*
+ * Conditional variable wrapper
+ * Conditional variable is a thing that can be waited on
+ * Wait is finished when other thread puts that thing in a signaled state
+ * (or when timeout is over).
+ * Data that is conditionally accessed should be protected by
+ * a Lock and that lock must be taken before starting to Wait.
+ * When wait is performed, Lock is temporarly released.
+ * When wait is finished, Lock is captured back.
+ * WARNING: Beware of Spurious wakeups
+ * http://en.wikipedia.org/wiki/Spurious_wakeup
+ * Thread can wake up from wait spuriously, without conditional
+ * variable being actually set by other thread. This means
+ * additional check should be made right after thread awakening
+ * and if check fails thread should continue waiting.
+ *
+ * while(!DataReady()) cond_var.Wait(auto_lock);
+ *
+ */
+class ConditionalVariable {
+ public:
+ enum WaitStatus { kNoTimeout, kTimeout };
+ ConditionalVariable();
+ ~ConditionalVariable();
+ // Wakes up single thread that is waiting on this conditional variable
+ void NotifyOne();
+ // Wakes up all waiting threads
+ void Broadcast();
+
+ // Wait forever or up to milliseconds time limit
+ void Wait(AutoLock& auto_lock);
+ WaitStatus WaitFor(AutoLock& auto_lock, int32_t milliseconds);
+ private:
+ impl::PlatformConditionalVariable cond_var_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ConditionalVariable);
+};
+
+} // namespace sync_primitives
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_CONDITIONAL_VARIABLE_H_
diff --git a/src/components/include/utils/date_time.h b/src/components/include/utils/date_time.h
new file mode 100644
index 0000000000..766932652d
--- /dev/null
+++ b/src/components/include/utils/date_time.h
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
+
+#if defined(OS_POSIX)
+#include <sys/time.h>
+typedef struct timeval TimevalStruct;
+#endif
+#include <stdint.h>
+
+namespace date_time {
+
+enum TimeCompare {
+ LESS,
+ EQUAL,
+ GREATER
+};
+
+class DateTime {
+ public:
+ static const int32_t MILLISECONDS_IN_SECOND = 1000;
+ static const int32_t MICROSECONDS_IN_MILLISECONDS = 1000;
+
+ static TimevalStruct getCurrentTime();
+
+ // return SECONDS count
+ static int64_t getSecs(const TimevalStruct& time);
+
+ // return MILLISECONDS count
+ static int64_t getmSecs(const TimevalStruct& time);
+ // return MICROSECONDS count
+ static int64_t getuSecs(const TimevalStruct& time);
+
+ // return MILLISECONDS count between sinceTime value and current time
+ static int64_t calculateTimeSpan(const TimevalStruct& sinceTime);
+
+ // return MILLISECONDS count between time1 and time2
+ static int64_t calculateTimeDiff(const TimevalStruct& time1,
+ const TimevalStruct& time2);
+
+ static TimevalStruct Sub(const TimevalStruct& time1,
+ const TimevalStruct& time2);
+
+ static TimeCompare compareTime(const TimevalStruct& time1,
+ const TimevalStruct& time2);
+
+ static bool Greater(const TimevalStruct& time1, const TimevalStruct& time2);
+ static bool Less(const TimevalStruct& time1, const TimevalStruct& time2);
+ static bool Equal(const TimevalStruct& time1, const TimevalStruct& time2);
+};
+
+} // namespace date_time
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_DATE_TIME_H_
diff --git a/src/components/include/utils/lock.h b/src/components/include/utils/lock.h
new file mode 100644
index 0000000000..910a88052f
--- /dev/null
+++ b/src/components/include/utils/lock.h
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
+
+#if defined(OS_POSIX)
+#include <pthread.h>
+#else
+#error Please implement lock for your OS
+#endif
+#include <stdint.h>
+#include "utils/macro.h"
+
+namespace sync_primitives {
+
+namespace impl {
+#if defined(OS_POSIX)
+typedef pthread_mutex_t PlatformMutex;
+#endif
+} // namespace impl
+
+/* Platform-indepenednt NON-RECURSIVE lock (mutex) wrapper
+ Please use AutoLock to ackquire and (automatically) release it
+ It eases balancing of multple lock taking/releasing and makes it
+ Impossible to forget to release the lock:
+ ...
+ ConcurentlyAccessedData data_;
+ sync_primitives::Lock data_lock_;
+ ...
+ {
+ sync_primitives::AutoLock auto_lock(data_lock_);
+ data_.ReadOrWriteData();
+ } // lock is automatically released here
+*/
+class Lock {
+ public:
+ Lock();
+ Lock(bool is_mutex_recursive);
+ ~Lock();
+
+ // Ackquire the lock. Must be called only once on a thread.
+ // Please consider using AutoLock to capture it.
+ void Acquire();
+ // Release the lock. Must be called only once on a thread after lock.
+ // was acquired. Please consider using AutoLock to automatically release
+ // the lock
+ void Release();
+ // Try if lock can be captured and lock it if it was possible.
+ // If it captured, lock must be manually released calling to Release
+ // when protected resource access was finished.
+ // @returns wether lock was captured.
+ bool Try();
+
+ private:
+ impl::PlatformMutex mutex_;
+
+#ifndef NDEBUG
+ /**
+ * @brief Basic debugging aid, a flag that signals wether this lock is currently taken
+ * Allows detection of abandoned and recursively captured mutexes
+ */
+ uint32_t lock_taken_;
+
+ /**
+ * @brief Describe if mutex is recurcive or not
+ */
+ bool is_mutex_recursive_;
+
+ void AssertFreeAndMarkTaken();
+ void AssertTakenAndMarkFree();
+#else
+ void AssertFreeAndMarkTaken() {}
+ void AssertTakenAndMarkFree() {}
+#endif
+
+
+ friend class ConditionalVariable;
+ DISALLOW_COPY_AND_ASSIGN(Lock);
+};
+
+// This class is used to automatically acquire and release the a lock
+class AutoLock {
+ public:
+ explicit AutoLock(Lock& lock)
+ : lock_(lock) { lock_.Acquire(); }
+ ~AutoLock() { lock_.Release(); }
+ private:
+ Lock& GetLock(){ return lock_; }
+ Lock& lock_;
+
+ private:
+ friend class AutoUnlock;
+ friend class ConditionalVariable;
+ DISALLOW_COPY_AND_ASSIGN(AutoLock);
+};
+
+// This class is used to temporarly unlock autolocked lock
+class AutoUnlock {
+ public:
+ explicit AutoUnlock(AutoLock& lock)
+ : lock_(lock.GetLock()) { lock_.Release(); }
+ ~AutoUnlock() { lock_.Acquire(); }
+ private:
+ Lock& lock_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
+};
+} // namespace sync_primitives
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
diff --git a/src/components/include/utils/logger.h b/src/components/include/utils/logger.h
new file mode 100644
index 0000000000..7c00c5d3aa
--- /dev/null
+++ b/src/components/include/utils/logger.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOGGER_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOGGER_H_
+
+#ifdef ENABLE_LOG
+ #include <errno.h>
+ #include <string.h>
+ #include <sstream>
+ #include <apr_time.h>
+ #include <log4cxx/propertyconfigurator.h>
+ #include <log4cxx/spi/loggingevent.h>
+ #include "utils/push_log.h"
+ #include "utils/logger_status.h"
+#endif // ENABLE_LOG
+
+#ifdef ENABLE_LOG
+
+ #define CREATE_LOGGERPTR_GLOBAL(logger_var, logger_name) \
+ namespace { \
+ CREATE_LOGGERPTR_LOCAL(logger_var, logger_name); \
+ }
+
+ #define CREATE_LOGGERPTR_LOCAL(logger_var, logger_name) \
+ log4cxx::LoggerPtr logger_var = log4cxx::LoggerPtr(log4cxx::Logger::getLogger(logger_name));
+
+ #define INIT_LOGGER(file_name) \
+ log4cxx::PropertyConfigurator::configure(file_name);
+
+ // without this line log4cxx threads continue using some instances destroyed by exit()
+ #define DEINIT_LOGGER() \
+ log4cxx::Logger::getRootLogger()->closeNestedAppenders();
+
+ #define LOG4CXX_IS_TRACE_ENABLED(logger) logger->isTraceEnabled()
+
+ #define LOG_WITH_LEVEL(loggerPtr, logLevel, logEvent) \
+ do { \
+ if (logger::logger_status != logger::DeletingLoggerThread) { \
+ if (loggerPtr->isEnabledFor(logLevel)) { \
+ std::stringstream accumulator; \
+ accumulator << logEvent; \
+ logger::push_log(loggerPtr, logLevel, accumulator.str(), apr_time_now(), LOG4CXX_LOCATION, ::log4cxx::spi::LoggingEvent::getCurrentThreadName()); \
+ } \
+ } \
+ } while (false)
+
+ #undef LOG4CXX_INFO
+ #define LOG4CXX_INFO(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getInfo(), logEvent)
+
+ #define LOG4CXX_INFO_EXT(logger, logEvent) LOG4CXX_INFO(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+ #define LOG4CXX_INFO_STR_EXT(logger, logEvent) LOG4CXX_INFO_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+
+ #define LOG4CXX_TRACE_EXT(logger, logEvent) LOG4CXX_TRACE(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+ #define LOG4CXX_TRACE_STR_EXT(logger, logEvent) LOG4CXX_TRACE_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+
+ #undef LOG4CXX_DEBUG
+ #define LOG4CXX_DEBUG(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getDebug(), logEvent)
+
+ #define LOG4CXX_DEBUG_EXT(logger, logEvent) LOG4CXX_DEBUG(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+ #define LOG4CXX_DEBUG_STR_EXT(logger, logEvent) LOG4CXX_DEBUG_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+
+ #undef LOG4CXX_WARN
+ #define LOG4CXX_WARN(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getWarn(), logEvent)
+
+ #define LOG4CXX_WARN_EXT(logger, logEvent) LOG4CXX_WARN(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+ #define LOG4CXX_WARN_STR_EXT(logger, logEvent) LOG4CXX_WARN_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+
+ #undef LOG4CXX_ERROR
+ #define LOG4CXX_ERROR(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getError(), logEvent)
+
+ #define LOG4CXX_ERROR_EXT(logger, logEvent) LOG4CXX_ERROR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+ #define LOG4CXX_ERROR_STR_EXT(logger, logEvent) LOG4CXX_ERROR_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+
+ #undef LOG4CXX_FATAL
+ #define LOG4CXX_FATAL(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getFatal(), logEvent)
+
+ #define LOG4CXX_FATAL_EXT(logger, logEvent) LOG4CXX_FATAL(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+ #define LOG4CXX_FATAL_STR_EXT(logger, logEvent) LOG4CXX_FATAL_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
+
+ #undef LOG4CXX_TRACE
+ #define LOG4CXX_TRACE(loggerPtr, logEvent) LOG_WITH_LEVEL(loggerPtr, ::log4cxx::Level::getTrace(), logEvent)
+
+ #define LOG4CXX_TRACE_ENTER(logger) LOG4CXX_TRACE(logger, "ENTER: " << __PRETTY_FUNCTION__ )
+ #define LOG4CXX_TRACE_EXIT(logger) LOG4CXX_TRACE(logger, "EXIT: " << __PRETTY_FUNCTION__ )
+
+ #define LOG4CXX_ERROR_WITH_ERRNO(logger, message) \
+ LOG4CXX_ERROR(logger, message << ", error code " << errno << " (" << strerror(errno) << ")")
+
+ #define LOG4CXX_WARN_WITH_ERRNO(logger, message) \
+ LOG4CXX_WARN(logger, message << ", error code " << errno << " (" << strerror(errno) << ")")
+
+#else // ENABLE_LOG is OFF
+
+ #define CREATE_LOGGERPTR_GLOBAL(logger_var, logger_name)
+
+ #define CREATE_LOGGERPTR_LOCAL(logger_var, logger_name)
+
+ #define INIT_LOGGER(file_name)
+
+ #define DEINIT_LOGGER(file_name)
+
+ #define LOG4CXX_IS_TRACE_ENABLED(logger) false
+
+ #undef LOG4CXX_INFO
+ #define LOG4CXX_INFO(x,y)
+
+ #undef LOG4CXX_WARN
+ #define LOG4CXX_WARN(x,y)
+
+ #undef LOG4CXX_ERROR
+ #define LOG4CXX_ERROR(x,y)
+
+ #undef LOG4CXX_ERROR_WITH_ERRNO
+ #define LOG4CXX_ERROR_WITH_ERRNO(x,y)
+
+ #undef LOG4CXX_WARN_WITH_ERRNO
+ #define LOG4CXX_WARN_WITH_ERRNO(x,y)
+
+ #undef LOG4CXX_TRACE
+ #define LOG4CXX_TRACE(x,y)
+
+ #undef LOG4CXX_DEBUG
+ #define LOG4CXX_DEBUG(x,y)
+
+ #undef LOG4CXX_FATAL
+ #define LOG4CXX_FATAL(x,y)
+
+ #define LOG4CXX_INFO_EXT(logger, logEvent)
+ #define LOG4CXX_INFO_STR_EXT(logger, logEvent)
+
+ #define LOG4CXX_TRACE_EXT(logger, logEvent)
+ #define LOG4CXX_TRACE_STR_EXT(logger, logEvent)
+
+ #define LOG4CXX_DEBUG_EXT(logger, logEvent)
+ #define LOG4CXX_DEBUG_STR_EXT(logger, logEvent)
+
+ #define LOG4CXX_WARN_EXT(logger, logEvent)
+ #define LOG4CXX_WARN_STR_EXT(logger, logEvent)
+
+ #define LOG4CXX_ERROR_EXT(logger, logEvent)
+ #define LOG4CXX_ERROR_STR_EXT(logger, logEvent)
+
+ #define LOG4CXX_FATAL_EXT(logger, logEvent)
+ #define LOG4CXX_FATAL_STR_EXT(logger, logEvent)
+
+ #define LOG4CXX_TRACE_ENTER(logger)
+ #define LOG4CXX_TRACE_EXIT(logger)
+#endif // ENABLE_LOG
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOGGER_H_
diff --git a/src/components/include/utils/logger_status.h b/src/components/include/utils/logger_status.h
new file mode 100644
index 0000000000..e28fa6f839
--- /dev/null
+++ b/src/components/include/utils/logger_status.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_LOGGER_STATUS_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_LOGGER_STATUS_H_
+
+namespace logger {
+
+typedef enum {
+ LoggerThreadNotCreated,
+ CreatingLoggerThread,
+ LoggerThreadCreated,
+ DeletingLoggerThread
+} LoggerStatus;
+
+// this variable is only changed when creating and deleting logger thread
+// its reads and writes are believed to be atomic
+// thus it shall be considered thread safe
+extern LoggerStatus logger_status;
+
+} // namespace logger
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_LOGGER_STATUS_H_
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h
new file mode 100644
index 0000000000..bc3b3e71c9
--- /dev/null
+++ b/src/components/include/utils/macro.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
+
+#include <assert.h>
+#include <stdio.h>
+
+
+
+// A macro to disallow the copy constructor and operator= functions
+// This should be used in the private: declarations for a class
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+// A macro to allow utils::Singleton call derivative constructor and destructor
+#define FRIEND_BASE_SINGLETON_CLASS(TypeName) \
+ friend class utils::Singleton<TypeName>
+
+#define FRIEND_BASE_SINGLETON_CLASS_WITH_DELETER(TypeName, TypeDeleter) \
+ friend class utils::Singleton<TypeName, TypeDeleter>
+
+// A macro to allow utils::deleters::Deleter::~Deleter() call class destructor
+#define FRIEND_DELETER_DESTRUCTOR(TypeName) \
+ friend utils::deleters::Deleter<TypeName>::~Deleter()
+
+#define DCHECK(condition) \
+ if (!(condition)) { \
+ printf("\nDCHECK [%s:%d][%s]", __FILE__, __LINE__, __FUNCTION__); \
+ printf("[Check failed: " #condition); \
+ printf("]\n\n"); \
+ assert(false); \
+ }
+
+#define NOTREACHED() DCHECK(false)
+
+// Allows to perform static check that virtual function from base class is
+// actually being overriden if compiler support is available
+#if __cplusplus >= 201103L
+#define OVERRIDE override
+#define FINAL final
+#else
+#define OVERRIDE
+#define FINAL
+#endif
+
+/*
+* @brief Calculate size of na array
+* @param arr array, which size need to calculate
+*/
+#define ARRAYSIZE(arr) sizeof (arr) / sizeof(*arr)
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
diff --git a/src/components/include/utils/memory_barrier.h b/src/components/include/utils/memory_barrier.h
new file mode 100644
index 0000000000..312894e034
--- /dev/null
+++ b/src/components/include/utils/memory_barrier.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
+
+#ifdef __QNXNTO__
+#include <sys/cpuinline.h>
+#endif
+
+namespace utils {
+
+inline void memory_barrier() {
+#if defined(__QNXNTO__)
+ __cpu_membarrier();
+#elif defined(__GNUG__)
+ __sync_synchronize();
+#else
+#warning "memory_barrier() implementation does nothing"
+#endif
+}
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
diff --git a/src/components/include/utils/message_queue.h b/src/components/include/utils/message_queue.h
new file mode 100644
index 0000000000..2fea554886
--- /dev/null
+++ b/src/components/include/utils/message_queue.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef MESSAGE_QUEUE_CLASS
+#define MESSAGE_QUEUE_CLASS
+
+#include <queue>
+
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/prioritized_queue.h"
+
+/**
+ * \class MessageQueue
+ * \brief Wrapper for multithreading queue.
+ */
+ //TODO(Ezamakhov): move to utils namespace
+template<typename T, class Q = std::queue<T> > class MessageQueue {
+ public:
+ typedef Q Queue;
+ /**
+ * \brief Default constructor
+ */
+ MessageQueue();
+
+ /**
+ * \brief Destructor
+ */
+ ~MessageQueue();
+
+ /**
+ * \brief Returns size of the queue.
+ * \return Size of the queue.
+ */
+ size_t size() const;
+
+ /**
+ * \brief If queue is empty.
+ * \return Is queue empty.
+ */
+ bool empty() const;
+
+ /**
+ * \brief Tells if queue is being shut down
+ */
+ bool IsShuttingDown() const;
+
+ /**
+ * \brief Adds element to the queue.
+ * \param element Element to be added to the queue.n
+ */
+ void push(const T& element);
+
+ /**
+ * \brief Removes element from the queue and returns it.
+ * \return To element of the queue.
+ */
+ T pop();
+
+ /**
+ * \brief Conditional wait.
+ */
+ void wait();
+
+ /**
+ * \brief Shutdown the queue.
+ * This leads to waking up everyone waiting on the queue
+ * Queue being shut down can be drained ( with pop() )
+ * But nothing must be added to the queue after it began
+ * shutting down
+ */
+ void Shutdown();
+
+ /**
+ * \brief Clears queue.
+ */
+ void Reset();
+
+ private:
+
+ /**
+ *\brief Queue
+ */
+ Queue queue_;
+ volatile bool shutting_down_;
+
+ /**
+ *\brief Platform specific syncronisation variable
+ */
+ mutable sync_primitives::Lock queue_lock_;
+ sync_primitives::ConditionalVariable queue_new_items_;
+};
+
+template<typename T, class Q> MessageQueue<T, Q>::MessageQueue()
+ : shutting_down_(false) {
+}
+
+template<typename T, class Q> MessageQueue<T, Q>::~MessageQueue() {
+ if (!queue_.empty()) {
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_ERROR(logger_, "Destruction of non-drained queue");
+ }
+}
+
+template<typename T, class Q> void MessageQueue<T, Q>::wait() {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ while ((!shutting_down_) && queue_.empty()) {
+ queue_new_items_.Wait(auto_lock);
+ }
+}
+
+template<typename T, class Q> size_t MessageQueue<T, Q>::size() const {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ return queue_.size();
+}
+
+template<typename T, class Q> bool MessageQueue<T, Q>::empty() const {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ return queue_.empty();
+}
+
+template<typename T, class Q> bool MessageQueue<T, Q>::IsShuttingDown() const {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ return shutting_down_;
+}
+
+template<typename T, class Q> void MessageQueue<T, Q>::push(const T& element) {
+ {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ if (shutting_down_) {
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_ERROR(logger_, "Runtime error, pushing into queue"
+ " that is being shut down");
+ }
+ queue_.push(element);
+ }
+ queue_new_items_.Broadcast();
+}
+
+template<typename T, class Q> T MessageQueue<T, Q>::pop() {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ if (shutting_down_) {
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_ERROR(logger_, "Runtime error, pop from queue"
+ " that is being shut down");
+ }
+ if (queue_.empty()) {
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_ERROR(logger_, "Runtime error, popping out of empty que");
+ }
+ T result = queue_.front();
+ queue_.pop();
+ return result;
+}
+
+template<typename T, class Q> void MessageQueue<T, Q>::Shutdown() {
+ {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ shutting_down_ = true;
+ }
+ queue_new_items_.Broadcast();
+}
+
+template<typename T, class Q> void MessageQueue<T, Q>::Reset() {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ shutting_down_ = false;
+ if (!queue_.empty()) {
+ Queue empty_queue;
+ queue_.swap(empty_queue);
+ }
+}
+
+#endif // MESSAGE_QUEUE_CLASS
diff --git a/src/components/include/utils/prioritized_queue.h b/src/components/include/utils/prioritized_queue.h
new file mode 100644
index 0000000000..4bec901f59
--- /dev/null
+++ b/src/components/include/utils/prioritized_queue.h
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_PRIORITIZED_QUEUE_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_PRIORITIZED_QUEUE_H_
+
+#include <queue>
+#include <map>
+#include <iostream>
+
+#include "utils/macro.h"
+
+namespace utils {
+
+/*
+ * Template queue class that gives out messages respecting their priority
+ * Message class must have size_t PriorityOrder() method implemented
+ */
+template < typename M >
+class PrioritizedQueue {
+ public:
+ typedef M value_type;
+ // std::map guarantees it's contents is sorted by key
+ typedef std::map<size_t, std::queue<value_type> > QueuesMap;
+ PrioritizedQueue()
+ : total_size_(0) {
+ }
+ // All api mimics usual std queue interface
+ void push(const value_type& message) {
+ size_t message_priority = message.PriorityOrder();
+ queues_[message_priority].push(message);
+ ++total_size_;
+ }
+ size_t size() const {
+ return total_size_;
+ }
+ bool empty() const {
+ return queues_.empty();
+ }
+ value_type front() {
+ DCHECK(!queues_.empty() && !queues_.rbegin()->second.empty());
+ return queues_.rbegin()->second.front();
+ }
+ void pop() {
+ DCHECK(!queues_.empty() && !queues_.rbegin()->second.empty());
+ typename QueuesMap::iterator last = --queues_.end();
+ last->second.pop();
+ --total_size_;
+ if (last->second.empty()) {
+ queues_.erase(last);
+ }
+ }
+ private:
+ QueuesMap queues_;
+ size_t total_size_;
+};
+
+}
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_
diff --git a/src/components/include/utils/push_log.h b/src/components/include/utils/push_log.h
new file mode 100644
index 0000000000..01389fb736
--- /dev/null
+++ b/src/components/include/utils/push_log.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_PUSH_LOG_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_PUSH_LOG_H_
+
+#include <log4cxx/logger.h>
+#include <string>
+
+namespace logger {
+
+bool push_log(
+ log4cxx::LoggerPtr logger,
+ log4cxx::LevelPtr level,
+ const std::string& entry,
+ log4cxx_time_t timeStamp,
+ const log4cxx::spi::LocationInfo& location,
+ const log4cxx::LogString& threadName
+ );
+
+} // namespace logger
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_PUSH_LOG_H_
diff --git a/src/components/include/utils/rwlock.h b/src/components/include/utils/rwlock.h
new file mode 100644
index 0000000000..b5042acbfe
--- /dev/null
+++ b/src/components/include/utils/rwlock.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RWLOCK_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RWLOCK_H_
+
+#if defined(OS_POSIX)
+#include <pthread.h>
+#endif
+
+#include "utils/macro.h"
+
+namespace sync_primitives {
+
+namespace impl {
+#if defined(OS_POSIX)
+typedef pthread_rwlock_t PlatformRWLock;
+#else
+#error Please implement rwlock for your OS
+#endif
+} // namespace impl
+
+class RWLock {
+ public:
+ RWLock();
+ ~RWLock();
+ void AcquireForReading();
+ void AcquireForWriting();
+ void Release();
+
+ private:
+ impl::PlatformRWLock rwlock_;
+};
+
+class AutoReadLock {
+ public:
+ explicit AutoReadLock(RWLock& rwlock) : rwlock_(rwlock) {
+ rwlock_.AcquireForReading();
+ }
+ ~AutoReadLock() {
+ rwlock_.Release();
+ }
+
+ private:
+ RWLock& rwlock_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutoReadLock);
+};
+
+class AutoWriteLock {
+ public:
+ explicit AutoWriteLock(RWLock& rwlock) : rwlock_(rwlock) {
+ rwlock_.AcquireForWriting();
+ }
+ ~AutoWriteLock() {
+ rwlock_.Release();
+ }
+
+ private:
+ RWLock& rwlock_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutoWriteLock);
+};
+
+} // namespace sync_primitives
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RWLOCK_H_
diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h
new file mode 100644
index 0000000000..dbca508bd7
--- /dev/null
+++ b/src/components/include/utils/shared_ptr.h
@@ -0,0 +1,371 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "utils/macro.h"
+#include "utils/atomic.h"
+
+namespace utils {
+/**
+ * @brief Shared pointer.
+ *
+ * Pointer to an object with reference counting.
+ * Object will be automatically deallocated when last shared
+ * pointer is destroyed.
+ *
+ * @tparam ObjectType Type of wrapped object.
+ **/
+template<typename ObjectType>
+class SharedPtr {
+ public:
+ //std smart pointer compability
+ typedef ObjectType element_type;
+ /**
+ * @brief Constructor.
+ *
+ * Initialize shared pointer with wrapped object.
+ * Reference counter will be initialized to 1.
+ *
+ * @param Object Wrapped object.
+ **/
+ SharedPtr(ObjectType* Object);
+
+ SharedPtr();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * Initialize shared pointer with another shared pointer.
+ * Reference counter will be incremented.
+ *
+ * @param Other Other shared pointer.
+ **/
+ SharedPtr(const SharedPtr<ObjectType>& Other);
+
+ /**
+ * @brief Copy constructor.
+ *
+ * Initialize shared pointer with another shared pointer.
+ * Reference counter will be incremented.
+ *
+ * @tparam OtherObjectType Type of other object pointer. This
+ * allows creating a shared pointer to an
+ * intstance of a base class from a shared
+ * pointer to an instance of a class
+ * inherited from this base class.
+ * If OtherObjectType is not implicitly
+ * convertible to ObjectType it will
+ * cause a compile error.
+ *
+ * @param Other Other shared pointer.
+ **/
+ template<typename OtherObjectType>
+ SharedPtr(const SharedPtr<OtherObjectType>& Other);
+
+ /**
+ * @brief Destructor.
+ *
+ * Decrement reference counter and destroy wrapped object
+ * if reference counter reaches zero.
+ **/
+ ~SharedPtr();
+
+ /**
+ * @brief Assignment operator.
+ *
+ * Drop reference to currently referenced object and add
+ * reference to assigned object.
+ *
+ * @param Other Shared pointer to an object
+ * that must be referenced.
+ *
+ * @return Reference to this shared pointer.
+ **/
+ SharedPtr<ObjectType>& operator =(const SharedPtr<ObjectType>& Other);
+
+ bool operator ==(const SharedPtr<ObjectType>& Other) const;
+
+ bool operator< (const SharedPtr<ObjectType>& other) const;
+
+ /**
+ * @brief Assignment operator.
+ *
+ * Drop reference to currently referenced object and add
+ * reference to assigned object.
+ *
+ * @tparam OtherObjectType Type of other object pointer. This
+ * allows creating a shared pointer to an
+ * intstance of a base class from a shared
+ * pointer to an instance of a class
+ * inherited from this base class.
+ * If OtherObjectType is not implicitly
+ * convertible to ObjectType it will
+ * cause a compile error.
+ *
+ * @param Other Shared pointer to an object
+ * that must be referenced.
+ *
+ * @return Reference to this shared pointer.
+ **/
+ template<typename OtherObjectType>
+ SharedPtr<ObjectType>& operator =(const SharedPtr<OtherObjectType>& Other);
+
+ template<typename OtherObjectType>
+ static SharedPtr<OtherObjectType> static_pointer_cast(
+ const SharedPtr<ObjectType>& pointer);
+
+ template<typename OtherObjectType>
+ static SharedPtr<OtherObjectType> dynamic_pointer_cast(
+ const SharedPtr<ObjectType>& pointer);
+
+ /**
+ * @brief Member access operator.
+ *
+ * @return Wrapped object.
+ **/
+ ObjectType* operator->() const;
+
+ ObjectType& operator*() const;
+ operator bool() const;
+ void reset();
+ void reset(ObjectType* other);
+ void release();
+ ObjectType* get() const;
+
+ /**
+ * @return true if mObject not NULL
+ */
+ bool valid() const;
+
+ private:
+ void reset_impl(ObjectType* other);
+
+ // TSharedPtr needs access to other TSharedPtr private members
+ // for shared pointers type casts.
+ template<typename OtherObjectType>
+ friend class SharedPtr;
+
+ /**
+ * @brief Drop reference to wrapped object.
+ *
+ * If reference counter reaches zero object and its reference
+ * counter will be deallocated.
+ **/
+ void dropReference();
+
+ /**
+ * @brief Wrapped object.
+ **/
+ ObjectType* mObject;
+
+ /**
+ * @brief Pointer to reference counter.
+ **/
+ uint32_t* mReferenceCounter;
+};
+
+template<typename ObjectType>
+inline utils::SharedPtr<ObjectType>::SharedPtr(ObjectType* Object)
+ : mObject(NULL),
+ mReferenceCounter(new uint32_t(1)) {
+ DCHECK(Object != NULL);
+ mObject = Object;
+}
+
+template<typename ObjectType>
+inline utils::SharedPtr<ObjectType>::SharedPtr()
+ : mObject(0),
+ mReferenceCounter(0) {
+}
+
+template<typename ObjectType>
+inline utils::SharedPtr<ObjectType>::SharedPtr(
+ const SharedPtr<ObjectType>& Other)
+ : mObject(0),
+ mReferenceCounter(0) {
+ *this = Other;
+}
+
+template<typename ObjectType>
+template<typename OtherObjectType>
+inline utils::SharedPtr<ObjectType>::SharedPtr(
+ const SharedPtr<OtherObjectType>& Other)
+ : mObject(0),
+ mReferenceCounter(0) {
+ *this = Other;
+}
+
+template<typename ObjectType>
+inline utils::SharedPtr<ObjectType>::~SharedPtr() {
+ dropReference();
+}
+
+template<typename ObjectType>
+inline utils::SharedPtr<ObjectType>&
+utils::SharedPtr<ObjectType>::operator=(const SharedPtr<ObjectType>& Other) {
+ return operator=<ObjectType>(Other);
+}
+
+template<typename ObjectType>
+inline bool utils::SharedPtr<ObjectType>::operator ==(
+ const SharedPtr<ObjectType>& Other) const {
+ return (mObject == Other.mObject);
+}
+
+template<typename ObjectType>
+inline bool utils::SharedPtr<ObjectType>::operator< (
+ const SharedPtr<ObjectType>& other) const {
+ return (mObject < other.mObject);
+}
+
+template<typename ObjectType>
+template<typename OtherObjectType>
+inline utils::SharedPtr<ObjectType>&
+utils::SharedPtr<ObjectType>::operator=(
+ const SharedPtr<OtherObjectType>& Other) {
+ dropReference();
+
+ mObject = Other.mObject;
+ mReferenceCounter = Other.mReferenceCounter;
+
+ if (0 != mReferenceCounter) {
+ atomic_post_inc(mReferenceCounter);
+ }
+
+ return *this;
+}
+
+template<typename ObjectType>
+template<typename OtherObjectType>
+utils::SharedPtr<OtherObjectType> utils::SharedPtr<ObjectType>::static_pointer_cast(const SharedPtr<ObjectType>& pointer) {
+ SharedPtr<OtherObjectType> casted_pointer;
+ casted_pointer.mObject = static_cast<OtherObjectType*>(pointer.mObject);
+ casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
+
+ if (0 != casted_pointer.mReferenceCounter) {
+ atomic_post_inc(casted_pointer.mReferenceCounter);
+ }
+
+ return casted_pointer;
+}
+
+template<typename ObjectType>
+template<typename OtherObjectType>
+utils::SharedPtr<OtherObjectType> utils::SharedPtr<ObjectType>::dynamic_pointer_cast(const SharedPtr<ObjectType>& pointer) {
+ SharedPtr<OtherObjectType> casted_pointer;
+ casted_pointer.mObject = dynamic_cast<OtherObjectType*>(pointer.mObject);
+ if (NULL != casted_pointer.mObject) {
+ casted_pointer.mReferenceCounter = pointer.mReferenceCounter;
+
+ if (0 != casted_pointer.mReferenceCounter) {
+ atomic_post_inc(casted_pointer.mReferenceCounter);
+ }
+ }
+
+ return casted_pointer;
+}
+
+template<typename ObjectType> ObjectType*
+utils::SharedPtr<ObjectType>::operator->() const {
+ DCHECK(mObject);
+ return mObject;
+}
+
+template<typename ObjectType> ObjectType&
+utils::SharedPtr<ObjectType>::operator*() const {
+ DCHECK(mObject);
+ return *mObject;
+}
+
+template<typename ObjectType>
+utils::SharedPtr<ObjectType>::operator bool() const {
+ return 0 != mObject;
+}
+
+template<typename ObjectType> void
+utils::SharedPtr<ObjectType>::reset() {
+ reset_impl(0);
+}
+
+template<typename ObjectType> void
+utils::SharedPtr<ObjectType>::reset(ObjectType* other) {
+ DCHECK(other != NULL);
+ reset_impl(other);
+}
+
+template<typename ObjectType>
+void SharedPtr<ObjectType>::release() {
+
+ delete mObject;
+ mObject = 0;
+
+ delete mReferenceCounter;
+ mReferenceCounter = 0;
+}
+
+template<typename ObjectType> void
+utils::SharedPtr<ObjectType>::reset_impl(ObjectType* other) {
+ dropReference();
+ mObject = other;
+ mReferenceCounter = new uint32_t(1);
+}
+
+template<typename ObjectType>
+inline void SharedPtr<ObjectType>::dropReference() {
+ if (0 != mReferenceCounter) {
+ if (1 == atomic_post_dec(mReferenceCounter)) {
+ release();
+ }
+ }
+}
+
+template<typename ObjectType>
+ObjectType* SharedPtr<ObjectType>::get() const {
+ return mObject;
+}
+
+template<typename ObjectType>
+inline bool SharedPtr<ObjectType>::valid() const {
+ return (mObject != NULL);
+}
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_
+
+// vim: set ts=2 sw=2 et:
diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h
new file mode 100644
index 0000000000..bfe1c619f1
--- /dev/null
+++ b/src/components/include/utils/threads/message_loop_thread.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_MESSAGE_LOOP_THREAD_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_MESSAGE_LOOP_THREAD_H_
+
+#include <string>
+#include <queue>
+
+#include "utils/logger.h"
+#include "utils/macro.h"
+#include "utils/message_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/lock.h"
+
+namespace threads {
+
+/*
+ * Class that handles a thread which sole purpose is to pump messages pushed
+ * to it's queue. To handle messages someone, Handler must be implemented and
+ * passed to MessageLoopThread constructor.
+ */
+template < class Q >
+class MessageLoopThread {
+ public:
+ typedef Q Queue;
+ typedef typename Queue::value_type Message;
+ /*
+ * Handler interface. It is called from a thread that is
+ * owned by MessageLoopThread so make sure is only accesses
+ * thread-safe data
+ */
+ struct Handler {
+ /*
+ * Method called by MessageLoopThread to process single message
+ * from it's queue. After calling this method message is discarded.
+ */
+ virtual void Handle(const Message message) = 0;
+
+ virtual ~Handler() {}
+ };
+
+ /*
+ * Constructs new MessageLoopThread. Must be named to aid debugging.
+ */
+ MessageLoopThread(const std::string& name,
+ Handler* handler,
+ const ThreadOptions& thread_opts = ThreadOptions());
+ ~MessageLoopThread();
+
+ // Places a message to the therad's queue. Thread-safe.
+ void PostMessage(const Message& message);
+ private:
+ /*
+ * Implementation of ThreadDelegate that actually pumps the queue and is
+ * able to correctly shut it down
+ */
+ struct LoopThreadDelegate : public threads::ThreadDelegate {
+ LoopThreadDelegate(MessageQueue<Message, Queue>* message_queue,
+ Handler* handler);
+
+ // threads::ThreadDelegate overrides
+ virtual void threadMain() OVERRIDE;
+ virtual bool exitThreadMain() OVERRIDE;
+ private:
+ // Handle all messages that are in the queue until it is empty
+ void DrainQue();
+ private:
+ // Handler that processes messages
+ Handler& handler_;
+ // Message queue that is actually owned by MessageLoopThread
+ MessageQueue<Message, Queue>& message_queue_;
+ sync_primitives::Lock active_lock;
+ };
+ private:
+ MessageQueue<Message, Queue> message_queue_;
+ threads::Thread thread_;
+};
+
+///////// Implementation
+
+template<class Q>
+MessageLoopThread<Q>::MessageLoopThread(const std::string& name,
+ Handler* handler,
+ const ThreadOptions& thread_opts)
+ : thread_(name.c_str(), new LoopThreadDelegate(&message_queue_, handler)) {
+ bool started = thread_.startWithOptions(thread_opts);
+ if (!started) {
+ CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+ LOG4CXX_ERROR(logger_, "Failed to start thread " << name);
+ }
+}
+
+template<class Q>
+MessageLoopThread<Q>::~MessageLoopThread() {
+ // this will join us with the thread while it drains message queue
+ thread_.stop();
+}
+
+template <class Q>
+void MessageLoopThread<Q>::PostMessage(const Message& message) {
+ message_queue_.push(message);
+}
+
+//////////
+template<class Q>
+MessageLoopThread<Q>::LoopThreadDelegate::LoopThreadDelegate(
+ MessageQueue<Message, Queue>* message_queue, Handler* handler)
+ : handler_(*handler),
+ message_queue_(*message_queue) {
+ DCHECK(handler != NULL);
+ DCHECK(message_queue != NULL);
+}
+
+template<class Q>
+void MessageLoopThread<Q>::LoopThreadDelegate::threadMain() {
+ sync_primitives::AutoLock auto_lock(active_lock);
+ while(!message_queue_.IsShuttingDown()){
+ DrainQue();
+ message_queue_.wait();
+ }
+ // Process leftover messages
+ DrainQue();
+}
+
+template<class Q>
+bool MessageLoopThread<Q>::LoopThreadDelegate::exitThreadMain() {
+ message_queue_.Shutdown();
+ {
+ sync_primitives::AutoLock auto_lock(active_lock);
+ // Prevent canceling thread until queue is drained
+ }
+ return true;
+}
+
+template<class Q>
+void MessageLoopThread<Q>::LoopThreadDelegate::DrainQue() {
+ while(!message_queue_.empty()) {
+ handler_.Handle(message_queue_.pop());
+ }
+}
+} // namespace threads
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_THREADS_MESSAGE_LOOP_THREAD_H_
diff --git a/src/components/include/utils/threads/thread.h b/src/components/include/utils/threads/thread.h
new file mode 100644
index 0000000000..9ee2480e13
--- /dev/null
+++ b/src/components/include/utils/threads/thread.h
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_H_
+
+#if defined(OS_POSIX)
+#include <pthread.h>
+#endif
+
+#include <ostream>
+#include <string>
+
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/threads/thread_options.h"
+
+namespace threads {
+
+namespace impl {
+#if defined(OS_POSIX)
+typedef pthread_t PlatformThreadHandle;
+#else
+#error Please implement thread for your OS
+#endif
+}
+
+/**
+ * Non platform specific thread abstraction that establishes a
+ * threads::ThreadDelegate on a new thread.
+ *
+ * ThreadDelegate example:
+ * class TestThread : public threads::ThreadDelegate {
+ * public:
+ * void threadMain() {
+ * printf("Hello, thread!\n");
+ * sleep(2);
+ * }
+ * };
+ *
+ * Example usage:
+ * threads::Thread thread("test thread", new TestThread());
+ * thread.startWithOptions(
+ * threads::ThreadOptions(threads::Thread::kMinStackSize));
+ * printf("join!\n");
+ * thread.join();
+ * printf("ok!\n");
+ */
+class Thread {
+ public:
+ /**
+ * Class that represents unique in-process thread identifier
+ * due to restriction of pthread API it only allows checks
+ * for equality to different thread id and no ordering.
+ *
+ * ostream<< operator is provided for this class which
+ * outputs thread name associated to an identifier.
+ */
+ class Id {
+ public:
+ explicit Id(const impl::PlatformThreadHandle& id): id_(id) {}
+ bool operator==(const Id& that) const;
+ private:
+ impl::PlatformThreadHandle id_;
+ friend class Thread;
+ };
+
+ // Get unique ID of currently executing thread
+ static Id CurrentId();
+
+ // Get name associated with thread identified by thread_id
+ static std::string NameFromId(const Id& thread_id);
+
+ // Give thread thread_id a name, helpful for debugging
+ static void SetNameForId(const Id& thread_id, const std::string& name);
+
+ /**
+ * @brief Set current thread as main
+ */
+ static void SetMainThread();
+
+ /**
+ * @brief Send SIGINT to main thread
+ * @return \a true on success and \a false otherwise
+ */
+ static bool InterruptMainThread();
+
+ /**
+ * @brief Mask all POSIX signals for current thread
+ */
+ static void MaskSignals();
+
+ /**
+ * @brief Unmask all POSIX signals for current thread
+ */
+ static void UnmaskSignals();
+
+ /**
+ * Ctor.
+ * @param name - display string to identify the thread.
+ * @param delegate - thread procedure delegate. Look for
+ * 'threads/thread_delegate.h' for details.
+ * NOTE: delegate will be deleted by destructor.
+ */
+ Thread(const char* name, ThreadDelegate* delegate);
+
+ /**
+ * Dtor.
+ */
+ virtual ~Thread();
+
+ /**
+ * Starts the thread.
+ * @return true if the thread was successfully started.
+ */
+ bool start();
+
+ /**
+ * Starts the thread. Behaves exactly like Start in addition to
+ * allow to override the default options.
+ * @param options - thread options. Look for 'threads/thread_options.h'
+ * for details.
+ * @return true if the thread was successfully started.
+ */
+ bool startWithOptions(const ThreadOptions& options);
+
+ /**
+ * Signals the thread to exit and returns once the thread has exited.
+ * After this method returns, the Thread object is completely reset and may
+ * be used as if it were newly constructed (i.e., Start may be called again).
+ *
+ * Stop may be called multiple times and is simply ignored if the thread is
+ * already stopped.
+ */
+ void stop();
+
+ /**
+ * Joins with a thread created via the Create function.
+ * This function blocks the caller until the designated thread exits.
+ * This will invalidate |thread_handle|.
+ */
+ void join();
+
+ /**
+ * Get thread name.
+ * @return thread name
+ */
+ const std::string& thread_name() {
+ return name_;
+ }
+
+ /**
+ * Returns true if the thread has been started, and not yet stopped.
+ * When a thread is running, the thread_id_ is non-zero.
+ * @return true if the thread has been started, and not yet stopped.
+ */
+ bool is_running() const {
+ return isThreadRunning_;
+ }
+
+ /**
+ * Is thread joinable?
+ * @return - Returns true if the thread is joinable.
+ */
+ bool is_joinable() const {
+ return thread_options_.is_joinable();
+ }
+
+ /**
+ * Thread stack size
+ * @return thread stack size
+ */
+ size_t stack_size() const {
+ return thread_options_.stack_size();
+ }
+
+ /**
+ * The native thread handle.
+ * @return thread handle.
+ */
+ impl::PlatformThreadHandle thread_handle() const {
+ return thread_handle_;
+ }
+
+ /**
+ * Thread id.
+ * @return return thread id.
+ */
+ Id thread_id() const {
+ return Id(thread_handle());
+ }
+
+ /**
+ * Thread options.
+ * @return thread options.
+ */
+ const ThreadOptions& thread_options() const {
+ return thread_options_;
+ }
+
+ /**
+ * Minimum size of thread stack for specific platform.
+ */
+ static size_t kMinStackSize;
+
+ protected:
+ const std::string name_;
+ ThreadDelegate* delegate_;
+ impl::PlatformThreadHandle thread_handle_;
+ ThreadOptions thread_options_;
+ bool isThreadRunning_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Thread);
+};
+
+inline bool operator!= (const Thread::Id& left, const Thread::Id& right) {
+ return !(left == right);
+}
+std::ostream& operator<<(std::ostream& os, const Thread::Id& thread_id);
+} // namespace threads
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_H_
diff --git a/src/components/include/utils/threads/thread_delegate.h b/src/components/include/utils/threads/thread_delegate.h
new file mode 100644
index 0000000000..fec9b748b6
--- /dev/null
+++ b/src/components/include/utils/threads/thread_delegate.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_DELEGATE_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_DELEGATE_H_
+
+#include <pthread.h>
+
+namespace threads {
+
+/**
+ * Thread procedure interface.
+ * Look for "threads/thread.h" for example
+ */
+class ThreadDelegate {
+ public:
+ /**
+ * Dtor.
+ */
+ virtual ~ThreadDelegate() {
+ }
+
+ /**
+ * Thread procedure.
+ */
+ virtual void threadMain() = 0;
+
+ /**
+ * Should be called to free all resources allocated in threadMain
+ * and exiting threadMain
+ * This function should be blocking and return only when threadMain() will be
+ * finished in other case segmantation failes are possible
+ */
+ virtual bool exitThreadMain() {
+ return false;
+ }
+};
+
+} // namespace threads
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_DELEGATE_H_
diff --git a/src/components/include/utils/threads/thread_options.h b/src/components/include/utils/threads/thread_options.h
new file mode 100644
index 0000000000..394918f0bc
--- /dev/null
+++ b/src/components/include/utils/threads/thread_options.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_OPTIONS_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_OPTIONS_H_
+
+#include <cstdio>
+
+namespace threads {
+
+/**
+ * @breif Startup options for thread.
+ * Look for "threads/thread.h" for example
+ */
+class ThreadOptions {
+ public:
+ /**
+ * Ctor
+ * @param stack_size - thread stack size. If stack size less than
+ * threads::Thread::kMinStackSize the default value is used.
+ * 0 - default stack size for current platform.
+ * @param is_joinable - is thread joinable?
+ */
+ explicit ThreadOptions(size_t stack_size = 0, bool is_joinable = true)
+ : stack_size_(stack_size),
+ is_joinable_(is_joinable) {
+ }
+
+ /**
+ * Dtor.
+ */
+ virtual ~ThreadOptions() {
+ }
+
+ /**
+ * Copy ctor.
+ * @param options - new options.
+ */
+ ThreadOptions(const ThreadOptions& options) {
+ *this = options;
+ }
+
+ /**
+ * Assign operator.
+ * @param options - new options.
+ * @return new options.
+ */
+ ThreadOptions& operator=(const ThreadOptions& options ) {
+ stack_size_ = options.stack_size();
+ is_joinable_ = options.is_joinable();
+ return *this;
+ }
+
+ /**
+ * Stack size.
+ * @return Stack size for thread.
+ */
+ size_t stack_size() const {
+ return stack_size_;
+ }
+
+ /**
+ * Is thread joinable?
+ * @return - Returns true if the thread is joinable.
+ */
+ bool is_joinable() const {
+ return is_joinable_;
+ }
+
+ protected:
+ size_t stack_size_;
+ bool is_joinable_;
+};
+
+} // namespace threads
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_THREADS_THREAD_OPTIONS_H_
diff --git a/src/components/include/utils/timer_thread.h b/src/components/include/utils/timer_thread.h
new file mode 100644
index 0000000000..89a6220b48
--- /dev/null
+++ b/src/components/include/utils/timer_thread.h
@@ -0,0 +1,384 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_THREAD
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_THREAD
+
+#include <time.h>
+#include <inttypes.h>
+#include <cstdint>
+#include <limits>
+
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
+#include "utils/timer_thread.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace timer {
+// TODO(AKutsan): Remove this logger after bugfix
+CREATE_LOGGERPTR_GLOBAL(logger_, "Timer")
+class TimerDelegate;
+
+/*
+ * The TimerThread class provide possibility to run timer in a separate thread.
+ * The client should specify callee and const callback function.
+ * Example usage:
+ *
+ * Create timer in mobile request
+ *
+ * timer::TimerThread<MobileRequest> timer(this, &MobileRequest::onTimeOut);
+ * timer.start(10);
+ *
+ * some actions
+ *
+ * To stop timer call timer.stop();
+ *
+ */
+template <class T>
+class TimerThread {
+ public:
+
+ friend class TimerDelegate;
+ friend class TimerLooperDelegate;
+
+ /**
+ * @brief Default constructor
+ *
+ * @param name - display string to identify the thread.
+ * @param callee A class that use timer
+ * @param f CallBackFunction which will be called on timeout
+ * Attention! "f()" will be called not in main thread but in timer thread
+ * Never use stop() and start() methods inside f
+ * @param is_looper Define this timer as looper,
+ * if true, TimerThread will call "f()" function every time out
+ * until stop()
+ */
+ TimerThread(const char* name, T* callee , void (T::*f)(), bool is_looper = false);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~TimerThread();
+
+ /**
+ * @brief Starts timer for specified timeout.
+ * Previously started timeout will be set to new value.
+ * On timeout TimerThread::onTimeOut interface will be called.
+ * Must not be used in callback function!
+ *
+ * @param timeout_seconds Timeout in seconds to be set
+ */
+ virtual void start(uint32_t timeout_seconds);
+
+ /**
+ * @brief Stops timer execution
+ * Must not be used in callback function!
+ */
+ virtual void stop();
+
+ /**
+ * @brief Tell tmer status
+ * @return true if timer is currently running, otherwise return false
+ */
+ virtual bool isRunning();
+
+ /*
+ * @brief Stop timer update timeout and start timer again
+ * Note that it cancel thread of timer, If you use it from callback,
+ * it probably will stop execution of callback function
+ * @param timeout_seconds new timeout value
+ *
+ */
+ virtual void updateTimeOut(const uint32_t timeout_seconds);
+ threads::Thread* thread_;
+ protected:
+
+ /**
+ * @brief Interface called by delegator on timeout
+ */
+ void onTimeOut() const;
+
+ private:
+
+ /**
+ * @brief Delegate release timer, will call callback function one time
+ */
+ class TimerDelegate : public threads::ThreadDelegate {
+ public:
+
+ /**
+ * @brief Default constructor
+ *
+ * @param timer_thread The Timer_thread pointer
+ */
+ TimerDelegate(const TimerThread* timer_thread);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~TimerDelegate();
+
+ /**
+ * @brief Thread main function.
+ */
+ virtual void threadMain();
+
+ /**
+ * @brief Called by thread::thread to free all allocated resources.
+ */
+ virtual bool exitThreadMain();
+
+ /**
+ * @brief Set new Timeout
+ * @param timeout_seconds New timeout to be set
+ */
+ virtual void setTimeOut(const uint32_t timeout_seconds);
+
+ protected:
+ const TimerThread* timer_thread_;
+ uint32_t timeout_seconds_;
+ sync_primitives::Lock state_lock_;
+ sync_primitives::ConditionalVariable termination_condition_;
+ volatile bool stop_flag_;
+ int32_t calculateMillisecondsLeft();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimerDelegate);
+ };
+
+
+ /**
+ * @brief Delegate release looper timer.
+ * Will call delegate every timeout function while stop()
+ * won't be called
+ */
+ class TimerLooperDelegate : public TimerDelegate {
+ public:
+
+ /**
+ * @brief Default constructor
+ *
+ * @param timer_thread The Timer_thread pointer
+ * @param timeout Timeout to be set
+ */
+ TimerLooperDelegate(const TimerThread* timer_thread);
+
+ /**
+ * @brief Thread main function.
+ */
+ virtual void threadMain();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimerLooperDelegate);
+ };
+ void (T::*callback_)();
+ T* callee_;
+ TimerDelegate* delegate_;
+ //threads::Thread* thread_;
+ mutable bool is_running_;
+ bool is_looper_;
+
+
+ DISALLOW_COPY_AND_ASSIGN(TimerThread);
+};
+
+template <class T>
+TimerThread<T>::TimerThread(const char* name, T* callee, void (T::*f)(), bool is_looper)
+ : thread_(NULL),
+ callback_(f),
+ callee_(callee),
+ delegate_(NULL),
+ is_running_(false),
+ is_looper_(is_looper) {
+ if (is_looper) {
+ delegate_ = new TimerLooperDelegate(this);
+ } else {
+ delegate_ = new TimerDelegate(this);
+ }
+ thread_ = new threads::Thread("TimerThread", delegate_);
+}
+
+template <class T>
+TimerThread<T>::~TimerThread() {
+ if (is_running_) {
+ stop();
+ }
+ callback_ = NULL;
+ callee_ = NULL;
+ delete thread_;
+ // delegate_ will be deleted by thread_
+ thread_ = NULL;
+ delegate_ = NULL;
+}
+
+template <class T>
+void TimerThread<T>::start(uint32_t timeout_seconds) {
+ LOG4CXX_TRACE(logger_, "Starting timer " << this);
+ if (is_running_) {
+ stop();
+ }
+
+ delegate_->setTimeOut(timeout_seconds);
+ if (delegate_ && thread_) {
+ is_running_ = true;
+ thread_->start();
+ }
+}
+
+template <class T>
+void TimerThread<T>::stop() {
+ LOG4CXX_TRACE(logger_, "Stopping timer " << this);
+ if (delegate_ && thread_) {
+ thread_->stop();
+ is_running_ = false;
+ }
+}
+
+template <class T>
+bool TimerThread<T>::isRunning() {
+ return is_running_;
+}
+
+template <class T>
+void TimerThread<T>::updateTimeOut(const uint32_t timeout_seconds) {
+ delegate_->setTimeOut(timeout_seconds);
+}
+
+template <class T>
+void TimerThread<T>::onTimeOut() const {
+ if (callee_ && callback_) {
+ (callee_->*callback_)();
+ if (!is_looper_) {
+ is_running_ = false;
+ }
+ }
+}
+
+template <class T>
+TimerThread<T>::TimerDelegate::TimerDelegate(const TimerThread* timer_thread)
+ : timer_thread_(timer_thread),
+ timeout_seconds_(0),
+ state_lock_(true),
+ stop_flag_(false) {
+ DCHECK(timer_thread_);
+}
+
+template <class T>
+TimerThread<T>::TimerLooperDelegate::TimerLooperDelegate(const TimerThread* timer_thread)
+ : TimerDelegate(timer_thread) {
+}
+
+template <class T>
+TimerThread<T>::TimerDelegate::~TimerDelegate() {
+ timer_thread_ = NULL;
+}
+
+template <class T>
+void TimerThread<T>::TimerDelegate::threadMain() {
+ using sync_primitives::ConditionalVariable;
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ while (!stop_flag_) {
+ // Sleep
+ int32_t wait_milliseconds_left = TimerDelegate::calculateMillisecondsLeft();
+ ConditionalVariable::WaitStatus wait_status =
+ termination_condition_.WaitFor(auto_lock, wait_milliseconds_left);
+ // Quit sleeping or continue sleeping in case of spurious wake up
+ if (ConditionalVariable::kTimeout == wait_status ||
+ wait_milliseconds_left <= 0) {
+ break;
+ }
+ }
+ if (!stop_flag_) {
+ timer_thread_->onTimeOut();
+ }
+ stop_flag_ = false;
+}
+
+template <class T>
+void TimerThread<T>::TimerLooperDelegate::threadMain() {
+ using sync_primitives::ConditionalVariable;
+ sync_primitives::AutoLock auto_lock(TimerDelegate::state_lock_);
+ while (!TimerDelegate::stop_flag_) {
+ int32_t wait_milliseconds_left = TimerDelegate::calculateMillisecondsLeft();
+ ConditionalVariable::WaitStatus wait_status =
+ TimerDelegate::termination_condition_.WaitFor(auto_lock, wait_milliseconds_left);
+ // Quit sleeping or continue sleeping in case of spurious wake up
+ if (ConditionalVariable::kTimeout == wait_status ||
+ wait_milliseconds_left <= 0) {
+ LOG4CXX_TRACE(logger_, "Timer timeout " << wait_milliseconds_left);
+ TimerDelegate::timer_thread_->onTimeOut();
+ } else {
+ LOG4CXX_DEBUG(logger_, "Timeout reset force: " << TimerDelegate::timeout_seconds_);
+ }
+ }
+}
+
+
+template <class T>
+bool TimerThread<T>::TimerDelegate::exitThreadMain() {
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ stop_flag_ = true;
+ }
+ termination_condition_.NotifyOne();
+ // FIXME(AKutsan)
+ {sync_primitives::AutoLock wait_for_thread_main(state_lock_);}
+ return true;
+}
+
+template <class T>
+void TimerThread<T>::TimerDelegate::setTimeOut(const uint32_t timeout_seconds) {
+ timeout_seconds_ = timeout_seconds;
+ termination_condition_.NotifyOne();
+}
+
+template <class T>
+int32_t TimerThread<T>::TimerThread::TimerDelegate::calculateMillisecondsLeft() {
+ time_t cur_time = time(NULL);
+ time_t end_time = std::numeric_limits<time_t>::max();
+ if (TimerDelegate::timeout_seconds_ + cur_time > TimerDelegate::timeout_seconds_) { // no overflow occurred
+ end_time = cur_time + TimerDelegate::timeout_seconds_;
+ }
+
+ int64_t wait_seconds_left = static_cast<int64_t>(difftime(end_time, cur_time));
+ int32_t wait_milliseconds_left = std::numeric_limits<int32_t>::max();
+ const int32_t millisecconds_in_second = 1000;
+ if (wait_seconds_left < std::numeric_limits<int32_t>::max() / millisecconds_in_second) {
+ wait_milliseconds_left = millisecconds_in_second * wait_seconds_left;
+ }
+ return wait_milliseconds_left;
+}
+
+} // namespace timer
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_TIMER_THREAD
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
new file mode 100644
index 0000000000..ac065fafb6
--- /dev/null
+++ b/src/components/interfaces/CMakeLists.txt
@@ -0,0 +1,50 @@
+include_directories (
+ ../utils/include/
+ ../formatters/include
+)
+
+GenerateInterface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
+GenerateInterface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
+
+IF (${HMI_JSON_API})
+ GenerateInterface("HMI_API.xml" "hmi_apis" "jsonrpc")
+ENDIF (${HMI_JSON_API})
+
+IF (${HMI_DBUS_API})
+ set(hpp_file
+ "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h"
+ "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h"
+ )
+
+ set(cpp_file "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc")
+ set(full_xml_name "${CMAKE_CURRENT_SOURCE_DIR}/QT_HMI_API.xml")
+
+ add_custom_command( OUTPUT ${hpp_file} ${cpp_file}
+ COMMAND ${INTEFRACE_GENERATOR_CMD} ${full_xml_name} hmi_apis ${CMAKE_CURRENT_BINARY_DIR} "--parser-type" "jsonrpc"
+ DEPENDS ${INTERFACE_GENERATOR_DEPENDENCIES} ${full_xml_name}
+ COMMENT "Generating files:\n ${hpp_file}\n ${cpp_file}\nfrom:\n QT_HMI_API.xml ..."
+ VERBATIM
+ )
+
+ include_directories (
+ ../../../src/components/smart_objects/include
+ ../../../src/components/formatters/include/
+ ${CMAKE_SOURCE_DIR}/src/components/formatters/include/
+ ${CMAKE_BINARY_DIR}
+ )
+
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
+ COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h")
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
+ COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h")
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
+ COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h")
+ add_library(HMI_API "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc")
+ENDIF (${HMI_DBUS_API})
+
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
new file mode 100644
index 0000000000..557b931eb0
--- /dev/null
+++ b/src/components/interfaces/HMI_API.xml
@@ -0,0 +1,3888 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!--
+* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. -->
+
+
+<interfaces name="SmartDeviceLink HMI API">
+
+<interface name="Common" version="1.1" date="2013-10-02">
+
+<enum name="Result">
+ <element name="SUCCESS" value="0"/>
+ <element name="UNSUPPORTED_REQUEST" value="1"/>
+ <element name="UNSUPPORTED_RESOURCE" value="2"/>
+ <element name="DISALLOWED" value="3"/>
+ <element name="REJECTED" value="4"/>
+ <element name="ABORTED" value="5"/>
+ <element name="IGNORED" value="6"/>
+ <element name="RETRY" value="7"/>
+ <element name="IN_USE" value="8"/>
+ <element name="DATA_NOT_AVAILABLE" value="9"/>
+ <element name="TIMED_OUT" value="10"/>
+ <element name="INVALID_DATA" value="11"/>
+ <element name="CHAR_LIMIT_EXCEEDED" value="12"/>
+ <element name="INVALID_ID" value="13"/>
+ <element name="DUPLICATE_NAME" value="14"/>
+ <element name="APPLICATION_NOT_REGISTERED" value="15"/>
+ <element name="WRONG_LANGUAGE" value="16"/>
+ <element name="OUT_OF_MEMORY" value="17"/>
+ <element name="TOO_MANY_PENDING_REQUESTS" value="18"/>
+ <element name="NO_APPS_REGISTERED" value="19"/>
+ <element name="NO_DEVICES_CONNECTED" value="20"/>
+ <element name="WARNINGS" value="21"/>
+ <element name="GENERIC_ERROR" value="22"/>
+ <element name="USER_DISALLOWED" value="23"/>
+</enum>
+
+<enum name="ButtonName">
+ <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
+ <element name="OK"/>
+ <element name="SEEKLEFT"/>
+ <element name="SEEKRIGHT"/>
+ <element name="TUNEUP"/>
+ <element name="TUNEDOWN"/>
+ <element name="PRESET_0"/>
+ <element name="PRESET_1"/>
+ <element name="PRESET_2"/>
+ <element name="PRESET_3"/>
+ <element name="PRESET_4"/>
+ <element name="PRESET_5"/>
+ <element name="PRESET_6"/>
+ <element name="PRESET_7"/>
+ <element name="PRESET_8"/>
+ <element name="PRESET_9"/>
+ <element name="CUSTOM_BUTTON"/>
+ <element name="SEARCH"/>
+</enum>
+
+<enum name="ButtonEventMode">
+ <element name="BUTTONUP">
+ <description>A button has been released up</description>
+ </element>
+ <element name="BUTTONDOWN">
+ <description>A button has been pressed down</description>
+ </element>
+</enum>
+
+<enum name="ButtonPressMode">
+ <element name="LONG">
+ <description>A button was released, after it was pressed for a long time. Actual timing is defined by head unit and may vary</description>
+ </element>
+ <element name="SHORT">
+ <description>A button was released, after it was pressed for a short time. Actual timing is defined by head unit and may vary</description>
+ </element>
+</enum>
+
+ <enum name="Language">
+ <element name="EN-US" internal_name="EN_US">
+ <description>English - US</description>
+ </element>
+ <element name="ES-MX" internal_name="ES_MX">
+ <description>Spanish - Mexico</description>
+ </element>
+ <element name="FR-CA" internal_name="FR_CA">
+ <description>French - Canada</description>
+ </element>
+ <element name="DE-DE" internal_name="DE_DE">
+ <description>German - Germany</description>
+ </element>
+ <element name="ES-ES" internal_name="ES_ES">
+ <description>Spanish - Spain</description>
+ </element>
+ <element name="EN-GB" internal_name="EN_GB">
+ <description>English - GB</description>
+ </element>
+ <element name="RU-RU" internal_name="RU_RU">
+ <description>Russian - Russia</description>
+ </element>
+ <element name="TR-TR" internal_name="TR_TR">
+ <description>Turkish - Turkey</description>
+ </element>
+ <element name="PL-PL" internal_name="PL_PL">
+ <description>Polish - Poland</description>
+ </element>
+ <element name="FR-FR" internal_name="FR_FR">
+ <description>French - France</description>
+ </element>
+ <element name="IT-IT" internal_name="IT_IT">
+ <description>Italian - Italy</description>
+ </element>
+ <element name="SV-SE" internal_name="SV_SE">
+ <description>Swedish - Sweden</description>
+ </element>
+ <element name="PT-PT" internal_name="PT_PT">
+ <description>Portuguese - Portugal</description>
+ </element>
+ <element name="NL-NL" internal_name="NL_NL">
+ <description>Dutch (Standard) - Netherlands</description>
+ </element>
+ <element name="EN-AU" internal_name="EN_AU">
+ <description>English - Australia</description>
+ </element>
+ <element name="ZH-CN" internal_name="ZH_CN">
+ <description>Mandarin - China</description>
+ </element>
+ <element name="ZH-TW" internal_name="ZH_TW">
+ <description>Mandarin - Taiwan</description>
+ </element>
+ <element name="JA-JP" internal_name="JA_JP">
+ <description>Japanese - Japan</description>
+ </element>
+ <element name="AR-SA" internal_name="AR_SA">
+ <description>Arabic - Saudi Arabia</description>
+ </element>
+ <element name="KO-KR" internal_name="KO_KR">
+ <description>Korean - South Korea</description>
+ </element>
+ <element name="PT-BR" internal_name="PT_BR">
+ <description>Portuguese - Brazil</description>
+ </element>
+ <element name="CS-CZ" internal_name="CS_CZ">
+ <description>Czech - Czech Republic</description>
+ </element>
+ <element name="DA-DK" internal_name="DA_DK">
+ <description>Danish - Denmark</description>
+ </element>
+ <element name="NO-NO" internal_name="NO_NO">
+ <description>Norwegian - Norway</description>
+ </element>
+</enum>
+
+<enum name="SoftButtonType">
+ <description>Contains information about the SoftButton capabilities.</description>
+ <element name="TEXT" internal_name="SBT_TEXT"/>
+ <element name="IMAGE" internal_name="SBT_IMAGE"/>
+ <element name="BOTH" internal_name="SBT_BOTH"/>
+</enum>
+
+<enum name="SystemAction">
+ <description>Enumeration that describes system actions that can be triggered.</description>
+ <element name="DEFAULT_ACTION">
+ <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
+ </element>
+ <element name="STEAL_FOCUS">
+ <description>The calling app's dialog or related event should clear and the app should be brought into HMI_FULL.</description>
+ </element>
+ <element name="KEEP_CONTEXT">
+ <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
+ </element>
+</enum>
+
+<enum name="AppHMIType">
+ <description>Enumeration listing possible app types.</description>
+ <element name="DEFAULT" />
+ <element name="COMMUNICATION" />
+ <element name="MEDIA" />
+ <element name="MESSAGING" />
+ <element name="NAVIGATION" />
+ <element name="INFORMATION" />
+ <element name="SOCIAL" />
+ <element name="BACKGROUND_PROCESS" />
+ <element name="TESTING" />
+ <element name="SYSTEM" />
+</enum>
+
+<enum name="LayoutMode">
+ <description>For touchscreen interactions, the mode of how the choices are presented.</description>
+ <element name="ICON_ONLY" />
+ <description>This mode causes the interaction to display the previous set of choices as icons.</description>
+ <element name="ICON_WITH_SEARCH" />
+ <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
+ <element name="LIST_ONLY" />
+ <description>This mode causes the interaction to display the previous set of choices as a list.</description>
+ <element name="LIST_WITH_SEARCH" />
+ <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
+ <element name="KEYBOARD" />
+ <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
+</enum>
+
+<enum name="DeactivateReason">
+ <description>Specifies the functionality the User has switched to.</description>
+ <element name="AUDIO">
+ <description>Navigated to audio(radio, etc)</description>
+ </element>
+ <element name="PHONECALL">
+ <description>Navigated to make a call.</description>
+ </element>
+ <element name="NAVIGATIONMAP">
+ <description>Navigated to navigation screen.</description>
+ </element>
+ <element name="PHONEMENU">
+ <description>Navigated to phone menu.</description>
+ </element>
+ <element name="SYNCSETTINGS">
+ <description>Navigated to settings menu.</description>
+ </element>
+ <element name="GENERAL">
+ <description>Other screens navigation apart from other mobile app.</description>
+ </element>
+</enum>
+
+<enum name="ClockUpdateMode">
+ <description>Describes how the media clock timer should behave on the platform</description>
+ <element name="COUNTUP" />
+ <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
+ <element name="COUNTDOWN" />
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ <element name="PAUSE" />
+ <description>Pauses the media clock timer</description>
+ <element name="RESUME" />
+ <description>Resume the media clock timer</description>
+ <element name="CLEAR" />
+ <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
+</enum>
+
+<enum name="SystemContext">
+ <description>Enumeration that describes possible contexts the application might be in on HU.</description>
+ <description>Communicated to whichever app is in HMI FULL, except Alert.</description>
+ <element name="MAIN" internal_name="SYSCTXT_MAIN">
+ <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
+ <description> There is currently no user interaction (user-initiated or app-initiated) with the head-unit</description>
+ </element>
+ <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
+ <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
+ </element>
+ <element name="MENU" internal_name="SYSCTXT_MENU">
+ <description>The system is currently displaying a system or in-App menu onscreen.</description>
+ </element>
+ <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
+ <description>The app's display HMI is currently obscuring with either a system or other app's overlay (except of Alert element).</description>
+ </element>
+ <element name="ALERT" internal_name="SYSCTXT_ALERT">
+ <description>Broadcast only to whichever app has an alert currently being displayed.</description>
+ </element>
+</enum>
+
+<enum name="HmiZoneCapabilities">
+ <description>Contains information about the HMI zone capabilities.</description>
+ <description>For future use.</description>
+ <element name="FRONT" />
+ <element name="BACK" />
+</enum>
+
+<enum name="SpeechCapabilities">
+ <description>Contains information about the TTS capabilities.</description>
+ <element name="TEXT" internal_name="SC_TEXT" />
+ <element name="SAPI_PHONEMES" />
+ <element name="LHPLUS_PHONEMES" />
+ <element name="PRE_RECORDED" />
+ <element name="SILENCE" />
+</enum>
+
+<enum name="VrCapabilities">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="TEXT" internal_name="VR_TEXT" />
+</enum>
+
+<enum name="PrerecordedSpeech">
+ <description>Contains a list of prerecorded speech items present on the platform.</description>
+ <element name="HELP_JINGLE" />
+ <element name="INITIAL_JINGLE" />
+ <element name="LISTEN_JINGLE" />
+ <element name="POSITIVE_JINGLE" />
+ <element name="NEGATIVE_JINGLE" />
+</enum>
+
+<enum name="TBTState">
+ <description>Enumeration that describes possible states of turn-by-turn client or SmartDeviceLink app.</description>
+ <element name="ROUTE_UPDATE_REQUEST" />
+ <element name="ROUTE_ACCEPTED" />
+ <element name="ROUTE_REFUSED" />
+ <element name="ROUTE_CANCELLED" />
+ <element name="ETA_REQUEST" />
+ <element name="NEXT_TURN_REQUEST" />
+ <element name="ROUTE_STATUS_REQUEST" />
+ <element name="ROUTE_SUMMARY_REQUEST" />
+ <element name="TRIP_STATUS_REQUEST" />
+ <element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
+</enum>
+
+<enum name="ApplicationsCloseReason">
+ <description>Describes the reasons for exiting all of applications.</description>
+ <element name="IGNITION_OFF" />
+ <element name="MASTER_RESET" />
+ <element name="FACTORY_DEFAULTS" />
+ <element name="SUSPEND" />
+</enum>
+
+<enum name="DisplayType">
+ <description>The possible types of HU display.</description>
+ <element name="CID">
+ <description> A 2-line x 20 character "dot matrix" display </description>
+ </element>
+ <element name="TYPE2">
+ <description> 1 line older radio head unit.</description>
+ </element>
+ <element name="TYPE5">
+ <description> Old radio head unit.</description>
+ </element>
+ <element name="NGN">
+ <description> Next Generation Navigation display.</description>
+ </element>
+ <element name="GEN2_8_DMA">
+ <description> GEN-2, 8 inch display.</description>
+ </element>
+ <element name="GEN2_6_DMA">
+ <description> GEN-2, 6 inch display.</description>
+ </element>
+ <element name="MFD3">
+ <description> 3 inch GEN1.1 display </description>
+ </element>
+ <element name="MFD4">
+ <description> 4 inch GEN1.1 display </description>
+ </element>
+ <element name="MFD5">
+ <description> 5 inch GEN1.1 display </description>
+ </element>
+ <element name="GEN3_8_INCH"/>
+ </enum>
+
+<enum name="ImageType">
+ <description>Contains information about the type of image.</description>
+ <element name="STATIC" />
+ <element name="DYNAMIC" />
+</enum>
+
+<enum name="ApplicationToNONEReason">
+ <description>Describes the reasons of moving the app to NONE.</description>
+ <element name="DRIVER_DISTRACTION_VIOLATION" />
+ <element name="USER_EXIT" />
+</enum>
+
+<enum name="TextFieldName">
+ <element name="mainField1">
+ <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+ <element name="mainField2">
+ <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+ <element name="mainField3">
+ <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
+ </element>
+ <element name="mainField4">
+ <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+ <element name="statusBar">
+ <description>The status bar on NGN; applies to "Show"</description>
+ </element>
+ <element name="mediaClock">
+ <description>Text value for MediaClock field; applies to "Show"</description>
+ </element>
+ <element name="mediaTrack">
+ <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
+ </element>
+ <element name="alertText1">
+ <description>The first line of the alert text field; applies to "Alert"</description>
+ </element>
+ <element name="alertText2">
+ <description>The second line of the alert text field; applies to "Alert"</description>
+ </element>
+ <element name="alertText3">
+ <description>The third line of the alert text field; applies to "Alert"</description>
+ </element>
+ <element name="scrollableMessageBody">
+ <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
+ </element>
+ <element name="initialInteractionText">
+ <description> First line suggestion for a user response (in the case of VR enabled interaction</description>
+ </element>
+ <element name="navigationText1">
+ <description> First line of navigation text</description>
+ </element>
+ <element name="navigationText2">
+ <description> Second line of navigation text</description>
+ </element>
+ <element name="ETA">
+ <description> Estimated Time of Arrival time for navigation</description>
+ </element>
+ <element name="totalDistance">
+ <description> Total distance to destination for navigation</description>
+ </element>
+ <element name="audioPassThruDisplayText1">
+ <description> First line of text for audio pass thru</description>
+ </element>
+ <element name="audioPassThruDisplayText2">
+ <description> Second line of text for audio pass thru</description>
+ </element>
+ <element name="sliderHeader">
+ <description> Header text for slider</description>
+ </element>
+ <element name="sliderFooter">
+ <description> Footer text for slider</description>
+ </element>
+ <element name="menuName">
+ <description> Primary text for Choice</description>
+ </element>
+ <element name="secondaryText">
+ <description> Secondary text for Choice</description>
+ </element>
+ <element name="tertiaryText">
+ <description> Tertiary text for Choice</description>
+ </element>
+ <element name="menuTitle">
+ <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </element>
+ <element name="timeToDestination"/>
+ <element name="navigationText">
+ <description>Navigation text for UpdateTurnList.</description>
+ </element>
+ <element name="notificationText">
+ <description>Text of notification to be displayed on screen.</description>
+ </element>
+ <!-- TO DO to be removed -->
+ <element name="turnText"/>
+</enum>
+
+<enum name="ImageFieldName">
+ <element name="softButtonImage">
+ <description>The image field for SoftButton</description>
+ </element>
+ <element name="choiceImage">
+ <description>The first image field for Choice</description>
+ </element>
+ <element name="choiceSecondaryImage">
+ <description>The secondary image field for Choice</description>
+ </element>
+ <element name="vrHelpItem">
+ <description>The image field for vrHelpItem</description>
+ </element>
+ <element name="turnIcon">
+ <description>The image field for Turn</description>
+ </element>
+ <element name="menuIcon">
+ <description>The image field for the menu icon in SetGlobalProperties</description>
+ </element>
+ <element name="cmdIcon">
+ <description>The image field for AddCommand</description>
+ </element>
+ <element name="appIcon">
+ <description>The image field for the app icon (set by setAppIcon)</description>
+ </element>
+ <element name="graphic">
+ <description>The image field for Show</description>
+ </element>
+ <element name="showConstantTBTIcon">
+ <description>The primary image field for ShowConstantTBT</description>
+ </element>
+ <element name="showConstantTBTNextTurnIcon">
+ <description>The secondary image field for ShowConstantTBT</description>
+ </element>
+ <element name="locationImage">
+ <description>The optional image of a destination / location</description>
+ </element>
+</enum>
+
+<enum name="TextAlignment">
+ <description>The list of possible alignments, left, right, or centered</description>
+ <element name="LEFT_ALIGNED" />
+ <element name="RIGHT_ALIGNED" />
+ <element name="CENTERED" />
+</enum>
+
+<enum name="DriverDistractionState">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON" />
+ <element name="DD_OFF" />
+</enum>
+
+<enum name="MediaClockFormat">
+ <element name="CLOCK1">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
+ Is used for Type II, NGN and CID head units.
+ </description>
+ </element>
+ <element name="CLOCK2">
+ <description>
+ minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
+ Is used for Type V head units.
+ </description>
+ </element>
+ <element name="CLOCK3">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
+ Is used for GEN1.1 (i.e. MFD3/4/5) head units.
+ </description>
+ </element>
+ <element name="CLOCKTEXT1">
+ <description>
+ 5 characters possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters
+ :|sp : colon or space
+ Is used for Type II head unit
+ </description>
+ </element>
+ <element name="CLOCKTEXT2">
+ <description>
+ 5 chars possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters
+ :|sp : colon or space
+ Is used for CID and NGN head unit
+ </description>
+ </element>
+ <element name="CLOCKTEXT3">
+ <description>
+ 6 chars possible
+ Format: 1|sp c c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters
+ :|sp : colon or space
+ Is used for Type V head unit
+ </description>
+ </element>
+ <element name="CLOCKTEXT4">
+ <description>
+ 6 chars possible
+ Format: c :|sp c c : c c
+ :|sp : colon or space
+ c : character out of following character set: sp|0-9|[letters].
+ Is used for GEN1.1 (i.e. MFD3/4/5) head units
+ </description>
+ </element>
+</enum>
+
+<enum name="VRCommandType">
+ <element name="Choice">
+ <description>Type that expound that current AddCommand should be pocessed as choise for initiated PerformInteraction request for current active on HMI.</description>
+ </element>
+ <element name="Command">
+ <description>Type that expound that current AddCommand should be pocessed as common command for current application on HMI.</description>
+ </element>
+</enum>
+
+<!--IVI part-->
+<enum name="ComponentVolumeStatus">
+ <description>The volume status of a vehicle component.</description>
+ <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
+ <description> The data is unknown.</description>
+ </element>
+ <element name="NORMAL" internal_name="CVS_NORMAL">
+ <description> The volume is normal.</description>
+ </element>
+ <element name="LOW" internal_name="CVS_LOW">
+ <description> The volume is low.</description>
+ </element>
+ <element name="FAULT" internal_name="CVS_FAULT">
+ <description> The module/sensor is currently faulted. </description>
+ </element>
+ <element name="ALERT" internal_name="CVS_ALERT">
+ <description> The component`s volume is in critical level.</description>
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
+ <description> The data is not supported.</description>
+ </element>
+</enum>
+
+<enum name="PRNDL">
+ <description>The selected gear.</description>
+ <element name="PARK">
+ <description>Parking</description>
+ </element>
+ <element name="REVERSE">
+ <description>Reverse gear</description>
+ </element>
+ <element name="NEUTRAL">
+ <description>No gear</description>
+ </element>
+ <element name="DRIVE">
+ </element>
+ <element name="SPORT">
+ <description>Drive Sport mode</description>
+ </element>
+ <element name="LOWGEAR">
+ <description>1st gear hold</description>
+ </element>
+ <element name="FIRST">
+ </element>
+ <element name="SECOND">
+ </element>
+ <element name="THIRD">
+ </element>
+ <element name="FOURTH">
+ </element>
+ <element name="FIFTH">
+ </element>
+ <element name="SIXTH">
+ </element>
+ <element name="SEVENTH">
+ </element>
+ <element name="EIGHTH">
+ </element>
+ <element name="FAULT">
+ </element>
+</enum>
+
+<enum name="VehicleDataEventStatus">
+ <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
+ <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
+ <description> The system does not have the adequate information to send valid YES or NO states.</description>
+ </element>
+ <element name="NO" internal_name="VDES_NO">
+ <description> The requested event is in NO state.</description>
+ </element>
+ <element name="YES" internal_name="VDES_YES">
+ <description> The requested event is in YES state.</description>
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
+ <description> The requested data is not supported </description>
+ </element>
+ <element name="FAULT" internal_name="VDES_FAULT">
+ <description> The module/sensor is currently faulted.</description>
+ </element>
+</enum>
+
+<enum name="VehicleDataStatus">
+ <description>Reflects the status of a binary vehicle data item.</description>
+ <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
+ </element>
+ <element name="OFF" internal_name="VDS_OFF">
+ </element>
+ <element name="ON" internal_name="VDS_ON">
+ </element>
+</enum>
+
+<enum name="IgnitionStableStatus">
+ <description>Reflects the ignition switch stability.</description>
+ <element name="IGNITION_SWITCH_NOT_STABLE">
+ </element>
+ <element name="IGNITION_SWITCH_STABLE">
+ </element>
+ <element name="MISSING_FROM_TRANSMITTER">
+ <description> Either the data is not accessible or the sensor is broken.</description>
+ </element>
+</enum>
+
+<enum name="IgnitionStatus">
+ <description>Reflects the status of ignition.</description>
+ <element name="UNKNOWN" internal_name="IS_UNKNOWN">
+ <description> The information is not acceptable. </description>
+ </element>
+ <element name="OFF" internal_name="IS_OFF">
+ <description> The ignition is off.</description>
+ </element>
+ <element name="ACCESSORY" internal_name="IS_ACCESSORY">
+ <description> The accessories are active (power windows, audio, display, etc.).</description>
+ </element>
+ <element name="RUN" internal_name="IS_RUN">
+ <description> Ignition is active.</description>
+ </element>
+ <element name="START" internal_name="IS_START">
+ <description> Starter is switched.</description>
+ </element>
+ <element name="INVALID" internal_name="IS_INVALID">
+ <description> The data is provided, but there is some sort of fault or problem.</description>
+ </element>
+</enum>
+
+<enum name="DeviceLevelStatus">
+ <description>Reflects the reported component status of the connected device, if reported.</description>
+ <element name="ZERO_LEVEL_BARS">
+ </element>
+ <element name="ONE_LEVEL_BARS">
+ </element>
+ <element name="TWO_LEVEL_BARS">
+ </element>
+ <element name="THREE_LEVEL_BARS">
+ </element>
+ <element name="FOUR_LEVEL_BARS">
+ </element>
+ <element name="NOT_PROVIDED">
+ </element>
+</enum>
+
+<enum name="PrimaryAudioSource">
+ <description>Reflects the current primary audio source (if selected).</description>
+ <element name="NO_SOURCE_SELECTED">
+ </element>
+ <element name="USB">
+ </element>
+ <element name="USB2">
+ </element>
+ <element name="BLUETOOTH_STEREO_BTST">
+ </element>
+ <element name="LINE_IN">
+ </element>
+ <element name="IPOD">
+ </element>
+ <element name="MOBILE_APP">
+ </element>
+</enum>
+
+<enum name="CompassDirection">
+ <description>The list of potential compass directions</description>
+ <element name="NORTH">
+ </element>
+ <element name="NORTHWEST">
+ </element>
+ <element name="WEST">
+ </element>
+ <element name="SOUTHWEST">
+ </element>
+ <element name="SOUTH">
+ </element>
+ <element name="SOUTHEAST">
+ </element>
+ <element name="EAST">
+ </element>
+ <element name="NORTHEAST">
+ </element>
+</enum>
+
+<enum name="Dimension">
+ <description>The supported dimensions of the GPS</description>
+ <element name="NO_FIX" internal_name="Dimension_NO_FIX">
+ <description>No GPS at all</description>
+ </element>
+ <element name="2D" internal_name="Dimension_2D">
+ <description>Longitude and lattitude</description>
+ </element>
+ <element name="3D" internal_name="Dimension_3D">
+ <description>Longitude and lattitude and altitude</description>
+ </element>
+</enum>
+
+<enum name="TouchType">
+ <element name="BEGIN"/>
+ <element name="MOVE"/>
+ <element name="END"/>
+</enum>
+
+<enum name="WarningLightStatus">
+ <description>Reflects the status of a cluster instrument warning light.</description>
+ <element name="OFF" internal_name="WLS_OFF">
+ </element>
+ <element name="ON" internal_name="WLS_ON">
+ </element>
+ <element name="FLASH" internal_name="WLS_FLASH">
+ </element>
+ <element name="NOT_USED" internal_name="WLS_NOT_USED">
+ </element>
+</enum>
+
+<enum name="VehicleDataResultCode">
+ <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
+ <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
+ <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
+ <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
+ <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
+ <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
+ <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
+ <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
+ <element name="IGNORED" internal_name="VDRC_IGNORED"/>
+</enum>
+
+<enum name="VehicleDataType">
+ <description>Defines the data types that can be published and subscribed to.</description>
+ <element name="VEHICLEDATA_GPS">
+ <description>Notifies GPSData may be subscribed</description>
+ </element>
+ <element name="VEHICLEDATA_SPEED" />
+ <element name="VEHICLEDATA_RPM" />
+ <element name="VEHICLEDATA_FUELLEVEL" />
+ <element name="VEHICLEDATA_FUELLEVEL_STATE" />
+ <element name="VEHICLEDATA_FUELCONSUMPTION" />
+ <element name="VEHICLEDATA_EXTERNTEMP" />
+ <element name="VEHICLEDATA_VIN" />
+ <element name="VEHICLEDATA_PRNDL" />
+ <element name="VEHICLEDATA_TIREPRESSURE" />
+ <element name="VEHICLEDATA_ODOMETER" />
+ <element name="VEHICLEDATA_BELTSTATUS" />
+ <element name="VEHICLEDATA_BODYINFO" />
+ <element name="VEHICLEDATA_DEVICESTATUS" />
+ <element name="VEHICLEDATA_ECALLINFO" />
+ <element name="VEHICLEDATA_AIRBAGSTATUS" />
+ <element name="VEHICLEDATA_EMERGENCYEVENT" />
+ <element name="VEHICLEDATA_CLUSTERMODESTATUS" />
+ <element name="VEHICLEDATA_MYKEY" />
+ <element name="VEHICLEDATA_BRAKING" />
+ <element name="VEHICLEDATA_WIPERSTATUS" />
+ <element name="VEHICLEDATA_HEADLAMPSTATUS" />
+ <element name="VEHICLEDATA_BATTVOLTAGE" />
+ <element name="VEHICLEDATA_ENGINETORQUE" />
+ <element name="VEHICLEDATA_ACCPEDAL" />
+ <element name="VEHICLEDATA_STEERINGWHEEL" />
+</enum>
+
+<enum name="WiperStatus">
+ <description>Reflects the status of the wipers.</description>
+ <element name="OFF">
+ <description> The wipers are off.</description>
+ </element>
+ <element name="AUTO_OFF">
+ <description> The wipers are automatically off </description>
+ </element>
+ <element name="OFF_MOVING">
+ <description> Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).</description>
+ </element>
+ <element name="MAN_INT_OFF">
+ <description> The wipers are manually off after having been working.</description>
+ </element>
+ <element name="MAN_INT_ON">
+ <description> The wipers are manually on.</description>
+ </element>
+ <element name="MAN_LOW">
+ <description> The wipers are manually set to low speed.</description>
+ </element>
+ <element name="MAN_HIGH">
+ <description> The wipers are manually set to high speed.</description>
+ </element>
+ <element name="MAN_FLICK">
+ <description> The wipers are manually set for doing a flick.</description>
+ </element>
+ <element name="WASH">
+ <description> The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.</description>
+ </element>
+ <element name="AUTO_LOW">
+ <description> The wipers are automatically set to low speed.</description>
+ </element>
+ <element name="AUTO_HIGH">
+ <description> The wipers are automatically set to high speed.</description>
+ </element>
+ <element name="COURTESYWIPE">
+ <description> This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid.</description>
+ </element>
+ <element name="AUTO_ADJUST">
+ <description> This is set as the user moves between possible automatic wiper speeds.</description>
+ </element>
+ <element name="STALLED">
+ <description> The wiper is stalled to its place. </description>
+ </element>
+ <element name="NO_DATA_EXISTS">
+ <description> The sensor / module cannot provide any information for wiper.</description>
+ </element>
+</enum>
+
+<enum name="SamplingRate">
+ <description>Describes different sampling options for PerformAudioPassThru.</description>
+ <element name="8KHZ" internal_name="RATE_8KHZ"/>
+ <element name="16KHZ" internal_name="RATE_16KHZ"/>
+ <element name="22KHZ" internal_name="RATE_22KHZ"/>
+ <element name="44KHZ" internal_name="RATE_44KHZ"/>
+</enum>
+
+<enum name="BitsPerSample">
+ <description>Describes different quality options for PerformAudioPassThru.</description>
+ <element name="8_BIT" internal_name="RATE_8_BIT"/>
+ <element name="16_BIT" internal_name="RATE_16_BIT"/>
+</enum>
+
+<enum name="AudioType">
+ <description>Describes different audio type options for PerformAudioPassThru.</description>
+ <element name="PCM" />
+</enum>
+
+<enum name="KeyboardLayout">
+ <description>Enumeration listing possible keyboard layouts.</description>
+ <element name="QWERTY" />
+ <element name="QWERTZ" />
+ <element name="AZERTY" />
+</enum>
+
+<enum name="KeyboardEvent">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="KEYPRESS" />
+ <element name="ENTRY_SUBMITTED" />
+ <element name="ENTRY_CANCELLED" />
+ <element name="ENTRY_ABORTED" />
+</enum>
+
+<enum name="KeypressMode">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="SINGLE_KEYPRESS">
+ <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
+ </element>
+ <element name="QUEUE_KEYPRESSES">
+ <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
+ </element>
+ <element name="RESEND_CURRENT_ENTRY">
+ <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
+ </element>
+</enum>
+
+<enum name="AmbientLightStatus">
+ <description>Reflects the status of the ambient light sensor.</description>
+ <element name="NIGHT" />
+ <element name="TWILIGHT_1" />
+ <element name="TWILIGHT_2" />
+ <element name="TWILIGHT_3" />
+ <element name="TWILIGHT_4" />
+ <element name="DAY" />
+ <element name="UNKNOWN" />
+ <element name="INVALID" />
+</enum>
+
+<enum name="FileType">
+ <description>Enumeration listing possible file types.</description>
+ <element name="GRAPHIC_BMP" />
+ <element name="GRAPHIC_JPEG" />
+ <element name="GRAPHIC_PNG" />
+ <element name="AUDIO_WAVE" />
+ <element name="AUDIO_MP3" />
+ <element name="AUDIO_AAC" />
+ <element name="BINARY" />
+ <element name="JSON" />
+</enum>
+
+<enum name="RequestType">
+ <description>Enumeration listing possible asynchronous requests.</description>
+ <element name="HTTP" />
+ <element name="FILE_RESUME" />
+ <element name="AUTH_REQUEST" />
+ <element name="AUTH_CHALLENGE" />
+ <element name="AUTH_ACK" />
+ <element name="PROPRIETARY" />
+</enum>
+
+<enum name="ECallConfirmationStatus">
+ <description>Reflects the status of the eCall Notification.</description>
+ <element name="NORMAL" internal_name="ECCS_NORMAL">
+ </element>
+ <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
+ </element>
+ <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
+ </element>
+ <element name="CALL_COMPLETED">
+ </element>
+ <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
+ </element>
+ <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
+ </element>
+ <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
+ </element>
+</enum>
+
+<enum name="VehicleDataNotificationStatus">
+ <description>Reflects the status of a vehicle data notification.</description>
+ <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
+ </element>
+ <element name="NORMAL" internal_name="VDNS_NORMAL">
+ </element>
+ <element name="ACTIVE" internal_name="VDNS_ACTIVE">
+ </element>
+ <element name="NOT_USED" internal_name="VDNS_NOT_USED">
+ </element>
+</enum>
+
+<enum name="EmergencyEventType">
+ <description>Reflects the emergency event status of the vehicle.</description>
+ <element name="NO_EVENT" internal_name="EET_NO_EVENT">
+ </element>
+ <element name="FRONTAL" internal_name="EET_FRONTAL">
+ </element>
+ <element name="SIDE" internal_name="EET_SIDE">
+ </element>
+ <element name="REAR" internal_name="EET_REAR">
+ </element>
+ <element name="ROLLOVER" internal_name="EET_ROLLOVER">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="EET_FAULT">
+ </element>
+</enum>
+
+<enum name="FuelCutoffStatus">
+ <description>Reflects the status of the RCM fuel cutoff.</description>
+ <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
+ </element>
+ <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
+ </element>
+ <element name="FAULT" internal_name="FCS_FAULT">
+ </element>
+</enum>
+
+<enum name="PowerModeQualificationStatus">
+ <description>Reflects the status of the current power mode qualification.</description>
+ <element name="POWER_MODE_UNDEFINED">
+ </element>
+ <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
+ </element>
+ <element name="NOT_DEFINED">
+ </element>
+ <element name="POWER_MODE_OK">
+ </element>
+</enum>
+
+<enum name="CarModeStatus">
+ <description>Reflects the status of the current car mode.</description>
+ <element name="NORMAL" internal_name="CMS_NORMAL">
+ </element>
+ <element name="FACTORY" internal_name="CMS_FACTORY">
+ </element>
+ <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
+ </element>
+ <element name="CRASH" internal_name="CMS_CRASH">
+ </element>
+</enum>
+
+<enum name="PowerModeStatus">
+ <description>Reflects the status of the current power mode.</description>
+ <element name="KEY_OUT">
+ </element>
+ <element name="KEY_RECENTLY_OUT">
+ </element>
+ <element name="KEY_APPROVED_0">
+ </element>
+ <element name="POST_ACCESORY_0">
+ </element>
+ <element name="ACCESORY_1">
+ </element>
+ <element name="POST_IGNITION_1">
+ </element>
+ <element name="IGNITION_ON_2">
+ </element>
+ <element name="RUNNING_2">
+ </element>
+ <element name="CRANK_3">
+ </element>
+</enum>
+
+<enum name="CharacterSet">
+ <description>The list of potential character sets</description>
+ <element name="TYPE2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="TYPE5SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID1SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+</enum>
+
+<!-- End of IVI part-->
+
+<enum name="AppPriority">
+ <element name="EMERGENCY"/>
+ <element name="NAVIGATION"/>
+ <element name="VOICE_COMMUNICATION"/>
+ <element name="COMMUNICATION"/>
+ <element name="NORMAL"/>
+ <element name="NONE"/>
+</enum>
+
+<enum name="SpeakType">
+ <description>Defines the type of the request which causes text-to-speech prompt</description>
+ <element name="ALERT" />
+ <element name="SPEAK" />
+</enum>
+
+<enum name="AlertType">
+<description>Defines the type of the request which causes text-to-speech prompt</description>
+<element name="UI" />
+<element name="BOTH" />
+</enum>
+
+<enum name="HMILevel">
+ <element name="FULL"/>
+ <element name="LIMITED" />
+ <element name="BACKGROUND"/>
+ <element name="NONE"/>
+</enum>
+
+<!-- Policies -->
+<enum name="UpdateResult">
+ <element name="UP_TO_DATE"/>
+ <element name="UPDATING" />
+ <element name="UPDATE_NEEDED"/>
+ </enum>
+ <enum name="SystemError">
+ <element name="SYNC_REBOOTED"/>
+ <element name="SYNC_OUT_OF_MEMMORY" />
+ </enum>
+ <enum name="StatisticsType">
+ <element name="iAPP_BUFFER_FULL"/>
+ </enum>
+ <enum name="ConsentSource">
+ <element name="GUI"/>
+ <element name="VUI" />
+ </enum>
+ <enum name="DeviceState">
+ <element name="UNKNOWN"/>
+ <element name="UNPAIRED"/>
+ </enum>
+ <struct name="UserFriendlyMessage" scope="internal">
+ <param name="messageCode" type="String" mandatory="true"/>
+ <param name="ttsString" type="String" mandatory="false"/>
+ <param name="label" type="String" mandatory="false" />
+ <param name="line1" type="String" mandatory="false"/>
+ <param name="line2" type="String" mandatory="false"/>
+ <param name="textBody" type="String" mandatory="false"/>
+ </struct>
+ <struct name="PermissionItem">
+ <param name="name" type="String" mandatory="true">
+ <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
+ </param>
+ <param name="id" type="Integer" mandatory="true">
+ <description>Id of corresponding functional group, needed by SDL.</description>
+ </param>
+ <param name="allowed" type="Boolean" mandatory="false">
+ <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
+ </param>
+ </struct>
+ <struct name="ServiceInfo">
+ <param name="url" type="String" mandatory="true">
+ <description>Get URL based on service type.</description>
+ </param>
+ <param name="policyAppId" type="String" mandatory="false">
+ <description>Used if URL needed are specific for application.</description>
+ </param>
+ </struct>
+<!-- End of Policies -->
+
+<struct name="TextField">
+ <param name="name" type="Common.TextFieldName">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="Common.CharacterSet">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <description>The number of rows of this field.</description>
+ </param>
+</struct>
+
+<struct name="ButtonCapabilities">
+ <description>Contains the information about capabilities of a button.</description>
+ <param name="name" type="Common.ButtonName" mandatory="true">
+ <description>The name of the Button from the ButtonName enum</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a short press. Whenever the button is pressed short, onButtonPressed(SHORT) should be invoked.</description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a LONG press. Whenever the button is pressed long, onButtonPressed(LONG) should be invoked.</description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent(DOWN) should be invoked. Whenever the button is released, onButtonEvent(UP) should be invoked.</description>
+ </param>
+</struct>
+
+<struct name="VehicleDataResult">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="Common.VehicleDataType">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="Common.VehicleDataResultCode">
+ <description>Published data result code.</description>
+ </param>
+</struct>
+
+<struct name="TouchCoord">
+ <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The x coordinate of the touch.</description>
+ </param>
+ <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The y coordinate of the touch.</description>
+ </param>
+</struct>
+
+<struct name="TouchEvent">
+ <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
+ <description>
+ A touch's unique identifier. The application can track the current touch events by id.
+ If a touch event has type begin, the id should be added to the set of touches.
+ If a touch event has type end, the id should be removed from the set of touches.
+ </description>
+ </param>
+ <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
+ <description>
+ The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
+ The timestamp is used to determined the rate of change of position of a touch.
+ The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
+ If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
+ </description>
+ </param>
+ <param name="c" type="Common.TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
+ </param>
+</struct>
+
+<struct name="PresetBankCapabilities">
+ <description>Contains information about on-screen preset capabilities (whether the HW preset buttons could be duplicated with onscreen buttons).</description>
+ <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
+ <description>Must be true if onscreen custom presets are available.</description>
+ </param>
+</struct>
+
+<struct name="Image">
+ <param name="value" maxlength="65535" type="String" mandatory="true">
+ <description>The path to the dynamic image stored on HU or the static binary image itself.</description>
+ </param>
+ <param name="imageType" type="Common.ImageType" mandatory="true">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+</struct>
+
+<struct name="SoftButton">
+ <param name="type" type="Common.SoftButtonType" mandatory="true">
+ <description>Describes, whether text, icon or both text and image should be displayed on the soft button. See softButtonType</description>
+ </param>
+ <param name="text" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to be displayed (if defined as TEXT or BOTH)</description>
+ </param>
+ <param name="image" type="Common.Image" mandatory="false">
+ <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
+ </param>
+ <param name="isHighlighted" type="Boolean" mandatory="false">
+ <description>If true, must be highlighted</description>
+ <description>If false, must be not</description>
+ </param>
+ <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Value which must be returned via OnButtonPress / OnButtonEvent</description>
+ </param>
+ <param name="systemAction" type="Common.SystemAction" mandatory="true">
+ <description>Parameter indicates whether clicking a SoftButton must call a specific system action. See SystemAction</description>
+ </param>
+ </struct>
+
+<struct name="TTSChunk">
+ <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
+ <param name="text" type="String" mandatory="true" maxlength="500">
+ <description>The text or phonemes to be spoken.</description>
+ </param>
+ <param name="type" type="Common.SpeechCapabilities" mandatory="true">
+ <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
+ </param>
+</struct>
+
+<struct name="HMIApplication">
+ <description>Data type containing information about application needed by HMI.</description>
+ <param name="appName" type="String" maxlength="100" mandatory="true">
+ <description>The mobile application name, e.g. "Ford Drive Green".</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Provides an abbreviated version of the app name (if needed), that may be displayed on the NGN media screen.</description>
+ <description>If not provided, the appName should be used instead (and may be truncated if too long)</description>
+ </param>
+ <param name="icon" type="String" mandatory="false">
+ <description>Path to application icon stored on HU.</description>
+ </param>
+ <param name="deviceName" type="String" mandatory="true">
+ <description>The name of device which the provided application is running on.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Unique (during ignition cycle) id of the application. To be used in all RPCs sent by both HU system and SDL</description>
+ </param>
+ <param name="hmiDisplayLanguageDesired" type="Common.Language" mandatory="true">
+ <description>The language the application intends to use on HU </description>
+ </param>
+ <param name="isMediaApplication" type="Boolean" mandatory="true">
+ <description>Indicates whether it is a media or a non-media application.</description>
+ </param>
+ <param name="appType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>List of all applicable app types stating which classifications to be given to the app.</description>
+ <description>e.g. for platforms like GEN2, this determines which "corner(s)" the app can populate.</description>
+ </param>
+</struct>
+
+<struct name="MenuParams">
+ <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>unique ID of the sub menu, the command must be added to.</description>
+ <description>If not provided, the command must be added to the top level of the in application menu.</description>
+ </param>
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>Position within the items that are at the top level of the in application menu.</description>
+ <description>0 should insert at the front.</description>
+ <description>1 should insert at the second position.</description>
+ <description>if position is greater than or equal to the number of items on the top level, the the sub menu/command should be appended to the end.</description>
+ <description>If this param is omitted the entry should be added at the end.</description>
+ </param>
+ <param name="menuName" type="String" maxlength="500" mandatory="true">
+ <description>The name of the sub menu/command.</description>
+ </param>
+</struct>
+
+<struct name="Choice">
+ <description>A choice is an option given to the user which can be selected either by menu, or through voice recognition system.</description>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description> The unique within the concerned application identifier for this choice </description>
+ </param>
+ <param name="menuName" type="String" maxlength="500" mandatory="false">
+ <description> The name of the choice </description>
+ </param>
+ <param name="image" type="Common.Image" mandatory="false">
+ <description> The image for representing the choice </description>
+ </param>
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
+ </param>
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
+ </param>
+ <param name="secondaryImage" type="Image" mandatory="false">
+ <description>Optional secondary image struct for choice</description>
+ </param>
+</struct>
+
+<struct name="VrHelpItem">
+ <param name="text" maxlength="500" type="String" mandatory="true">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Common.Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
+ <description>Position to display item in VR Help list</description>
+ </param>
+</struct>
+
+<struct name="TimeFormat">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <description>The hour of the media clock.</description>
+ <description>Some units only support a max of 19 hours. If out of range, it should be rejected.</description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+</struct>
+
+<struct name="TouchEventCapabilities">
+ <param name="pressAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="multiTouchAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="doublePressAvailable" type="Boolean" mandatory="true">
+ </param>
+</struct>
+
+<struct name="ImageResolution">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution height.</description>
+ </param>
+</struct>
+
+<struct name="ScreenParams">
+ <param name="resolution" type="Common.ImageResolution" mandatory="true">
+ <description>The resolution of the prescribed screen area.</description>
+ </param>
+ <param name="touchEventAvailable" type="Common.TouchEventCapabilities" mandatory="false">
+ <description>Types of screen touch events available in screen area.</description>
+ </param>
+</struct>
+
+<struct name="ImageField">
+ <param name="name" type="Common.ImageFieldName" mandatory="true">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="Common.FileType" maxsize="100" array="true" mandatory="false" minsize="1">
+ <description>The image types that are supported in this field. See FileType.</description>
+ </param>
+ <param name="imageResolution" type="Common.ImageResolution" mandatory="false">
+ <description>The image resolution of this field.</description>
+ </param>
+</struct>
+
+<struct name="DisplayCapabilities">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="Common.DisplayType" mandatory="true">
+ <description>The type of the display. See DisplayType</description>
+ </param>
+ <param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
+ <description>If there are no textfields supported, the empty array must be returned</description>
+ </param>
+ <param name="imageFields" type="Common.ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="mediaClockFormats" type="Common.MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="imageCapabilities" type="Common.ImageType" array="true" minsize="0" maxsize="2" mandatory="false">
+ </param>
+ <param name="graphicSupported" type="Boolean" mandatory="true">
+ <description>The display's persistent screen supports referencing a static or dynamic image.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="true">
+ <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
+ </param>
+ <param name="screenParams" type="Common.ScreenParams" mandatory="false">
+ <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
+ </param>
+</struct>
+
+<struct name="SoftButtonCapabilities">
+ <description>Contains information about a SoftButton's capabilities.</description>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a short press.</description>
+ <description>Whenever the button is pressed short, onButtonPressed( SHORT) must be invoked.</description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a LONG press.</description>
+ <description>Whenever the button is pressed long, onButtonPressed( LONG) must be invoked.</description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>The button supports "button down" and "button up".</description>
+ <description>Whenever the button is pressed, onButtonEvent( DOWN) must be invoked.</description>
+ <description>Whenever the button is released, onButtonEvent( UP) must be invoked.</description>
+ </param>
+ <param name="imageSupported" type="Boolean" mandatory="true">
+ <description>Must be true if the button supports referencing a static or dynamic image.</description>
+ </param>
+</struct>
+
+<struct name="AudioPassThruCapabilities">
+ <description>
+ Describes different audio type configurations for PerformAudioPassThru.
+ e.g. 8kHz,8-bit,PCM
+ </description>
+ <param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
+ <param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
+ <param name="audioType" type="Common.AudioType" mandatory="true"/>
+</struct>
+
+<struct name="TextFieldStruct">
+ <param name="fieldName" type="Common.TextFieldName" mandatory="true">
+ <description>The name of the field for displaying the text.</description>
+ </param>
+ <param name="fieldText" type="String" maxlength="500" mandatory="true">
+ <description>The text itself.</description>
+ </param>
+</struct>
+
+<struct name="KeyboardProperties">
+ <description>Configuration of on-screen keyboard (if available).</description>
+ <param name="language" type="Common.Language" mandatory="false">
+ <description>The keyboard language.</description>
+ </param>
+ <param name="keyboardLayout" type="Common.KeyboardLayout" mandatory="false" >
+ <description>Desired keyboard layout.</description>
+ </param>
+ <param name="keypressMode" type="Common.KeypressMode" mandatory="false" >
+ <description>
+ Desired keypress mode.
+ If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ </description>
+ </param>
+ <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Array of keyboard characters to enable.</description>
+ <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
+ <description>If omitted, the entire keyboard will be enabled.</description>
+ </param>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
+ <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ </param>
+</struct>
+
+<struct name="Turn">
+ <param name="navigationText" type="Common.TextFieldStruct" mandatory="false">
+ <description>Uses navigationText from TextFieldStruct.</description>
+ </param>
+ <param name="turnIcon" type="Common.Image" mandatory="false">
+ </param>
+</struct>
+
+<struct name="VehicleType">
+ <param name="make" type="String" maxlength="500" mandatory="false">
+ <description>Make of the vehicle</description>
+ <description>e.g. Ford</description>
+ </param>
+ <param name="model" type="String" maxlength="500" mandatory="false">
+ <description>Model of the vehicle</description>
+ <description>e.g. Fiesta</description>
+ </param>
+ <param name="modelYear" type="String" maxlength="500" mandatory="false">
+ <description>Model Year of the vehicle</description>
+ <description>e.g. 2013</description>
+ </param>
+ <param name="trim" type="String" maxlength="500" mandatory="false">
+ <description>Trim of the vehicle</description>
+ <description>e.g. SE</description>
+ </param>
+</struct>
+
+<struct name="DeviceInfo">
+ <param name="name" type="String" mandatory="true">
+ <description>The name of the device connected.</description>
+ </param>
+ <param name="id" type="Integer" mandatory="true">
+ <description>The ID of the device connected</description>
+ </param>
+ <param name="isSDLAllowed" type="Boolean" mandatory="false">
+ <description>Sent by SDL in UpdateDeviceList. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </description>
+ </param>
+</struct>
+
+<!--IVI part-->
+<struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
+ <description>PDOP.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
+ <description>HDOP.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
+ <description>VDOP.</description>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Common.Dimension" mandatory="false">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
+ <description>The speed in KPH</description>
+ </param>
+</struct>
+
+<struct name="SingleTireStatus">
+ <param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
+ <description>The status of component volume. See ComponentVolumeStatus.</description>
+</param>
+</struct>
+
+<struct name="DIDResult">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data (the address from ReadDID request)</description>
+ </param>
+ <param name="data" type="String" maxlength="5000" mandatory="false">
+ <description>Raw DID-based data returned for requested element.</description>
+ </param>
+</struct>
+
+<struct name="HeadLampStatus">
+ <param name="lowBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the low beam lamps.</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the high beam lamps.</description>
+ </param>
+ <param name="ambientLightSensorStatus" type="Common.AmbientLightStatus" mandatory="true">
+ <description>Status of the ambient light sensor.</description>
+ </param>
+</struct>
+
+<struct name="TireStatus">
+ <description>The status and pressure of the tires.</description>
+ <param name="pressureTelltale" type="Common.WarningLightStatus" mandatory="false">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the inner right rear.</description>
+ </param>
+</struct>
+
+<struct name="BeltStatus">
+ <param name="driverBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+</struct>
+
+<struct name="BodyInformation">
+ <param name="parkBrakeActive" type="Boolean" mandatory="true">
+ <description>Must be true if the park brake is active</description>
+ </param>
+ <param name="ignitionStableStatus" type="Common.IgnitionStableStatus" mandatory="true">
+ <description>Information about the ignition switch. See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="Common.IgnitionStatus" mandatory="true">
+ <description>The status of the ignition. See IgnitionStatus.</description>
+ </param>
+ <param name="driverDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatDrv_B_Actl".</description>
+ </param>
+ <param name="passengerDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatPsngr_B_Actl".</description>
+ </param>
+ <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRl_B_Actl".</description>
+ </param>
+ <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRr_B_Actl".</description>
+ </param>
+</struct>
+
+<struct name="DeviceStatus">
+ <param name="voiceRecOn" type="Boolean" mandatory="false">
+ <description>Must be true if the voice recording is on.</description>
+ </param>
+ <param name="btIconOn" type="Boolean" mandatory="false">
+ <description>Must be true if Bluetooth icon is displayed.</description>
+ </param>
+ <param name="callActive" type="Boolean" mandatory="false">
+ <description>Must be true if there is an active call..</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean" mandatory="false">
+ <description>Must be true if ther is a phone roaming.</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean" mandatory="false">
+ <description>Must be true if the text message is available.</description>
+ </param>
+ <param name="battLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
+ <description>Device battery level status. See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean" mandatory="false">
+ <description>Must be true if stereo audio output is muted.</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean" mandatory="false">
+ <description>Must be true if mono audio output is muted.</description>
+ </param>
+ <param name="signalLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
+ <description>Device signal level status. See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="Common.PrimaryAudioSource" mandatory="false">
+ <description>See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean" mandatory="false">
+ <description>Must be true if emergency call event is active.</description>
+ </param>
+</struct>
+
+<struct name="ECallInfo">
+ <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+</struct>
+
+<struct name="AirbagStatus">
+ <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+</struct>
+
+<struct name="EmergencyEvent">
+ <param name="emergencyEventType" type="Common.EmergencyEventType">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="multipleEvents" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+</struct>
+
+<struct name="ClusterModeStatus">
+ <param name="powerModeActive" type="Boolean">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="Common.CarModeStatus">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="Common.PowerModeStatus">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+</struct>
+
+<struct name="MyKey">
+ <param name="e911Override" type="Common.VehicleDataStatus" mandatory="true">
+ <description>Indicates whether e911 override is on. See VehicleDataStatus.</description>
+ </param>
+</struct>
+<!--end of IVI part-->
+
+</interface>
+
+<interface name="Buttons" version="1.0" date="2013-04-12">
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="capabilities" type="Common.ButtonCapabilities" array="true" minsize="1" maxsize="100" mandatory="true">
+ <description>Response must provide the names of available buttons and their capabilities.See ButtonCapabilities</description>
+ </param>
+ <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
+ <description>Must be returned if the platform supports custom on-screen Presets</description>
+ </param>
+ </function>
+ <function name="OnButtonEvent" messagetype="notification">
+ <description>HU system must notify about every UP/DOWN event for buttons</description>
+ <param name="name" type="Common.ButtonName" mandatory="true"/>
+ <param name="mode" type="Common.ButtonEventMode" mandatory="true">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
+ <description>Must be provided if ButtonName is CUSTOM_BUTTON, this references the integer ID passed by a custom button. (e.g. softButtonName)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>
+ In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
+ Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
+ </description>
+ </param>
+ </function>
+ <function name="OnButtonPress" messagetype="notification">
+ <param name="name" type="Common.ButtonName" mandatory="true"/>
+ <param name="mode" type="Common.ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
+ <description>Must be returned if ButtonName is CUSTOM_BUTTON, this references the string passed by a custom button. (e.g. softButtonName)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>
+ In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonEvent notification sent to SDL.
+ Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
+ </description>
+ </param>
+ </function>
+</interface>
+
+<interface name="BasicCommunication" version="1.0" date="2013-04-12">
+ <function name="OnReady" messagetype="notification">
+ <description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
+ </function>
+ <function name="OnStartDeviceDiscovery" messagetype="notification">
+ <description>Initiated by HMI user for getting the list of connected devices.</description>
+ </function>
+ <function name="OnUpdateDeviceList" messagetype="notification">
+ <description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
+ </function>
+ <function name="OnResumeAudioSource" messagetype="notification">
+ <description>This method must be invoked by SDL to update audio state.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>The ID of app to be resumed audio source.</description>
+ </param>
+ </function>
+ <function name="OnSDLPersistenceComplete" messagetype="notification">
+ </function>
+ <function name="UpdateAppList" messagetype="request">
+ <description>Issued by SDL to notify HMI about new applications registered.</description>
+ <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="1" maxsize="100"/>
+ </function>
+ <function name="UpdateAppList" messagetype="response">
+ </function>
+ <function name="UpdateDeviceList" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to change device list.</description>
+ <param name="deviceList" type="Common.DeviceInfo" mandatory="true" array="true" minsize="0" maxsize="100">
+ <description>The array of names/IDs of connected devices</description>
+ </param>
+ </function>
+ <function name="UpdateDeviceList" messagetype="response">
+ </function>
+ <function name="OnFileRemoved" messagetype="notification">
+ <description>Notifies HMI in case some application file has been removed</description>
+ <param name="fileName" type="String" minlength="1" maxlength="30" mandatory="true">
+ <description>The name of the removed file</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="true">
+ <description>The file type. See FileType.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application.</description>
+ </param>
+ </function>
+ <function name="AllowDeviceToConnect" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
+ <param name="device" type="Common.DeviceInfo" mandatory="true"/>
+ </function>
+ <function name="AllowDeviceToConnect" messagetype="response">
+ <param name="allow" type="Boolean" mandatory="true"/>
+ </function>
+ <function name="OnDeviceChosen" messagetype="notification">
+ <description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
+ <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
+ <description>The name and ID of the device chosen</description>
+ </param>
+ </function>
+ <function name="OnFindApplications" messagetype="notification">
+ <description>This method must be invoked by HMI to get list of registered apps.</description>
+ <param name="deviceInfo" type="Common.DeviceInfo" mandatory="false">
+ <description>The name and ID of the device the list of registered applications is required for.</description>
+ </param>
+ </function>
+ <function name="ActivateApp" messagetype="request">
+ <description>Request from SDL to HMI to bring specified application to front on UI e.g make it HMI status 'FULL'.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of deactivated application.</description>
+ </param>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ <param name="level" type="Common.HMILevel" mandatory="false">
+ <description>If level for application is to be changed to something else then FULL then this parameter should be used.</description>
+ </param>
+ </function>
+ <function name="ActivateApp" messagetype="response">
+ </function>
+ <function name="OnAppActivated" messagetype="notification">
+ <description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ </function>
+ <function name="OnAppDeactivated" messagetype="notification">
+ <description>Must be sent by HU system when the user switches to any functionality which is not other mobile application.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of deactivated application.</description>
+ </param>
+ <param name="reason" type="Common.DeactivateReason" mandatory="true">
+ <description>Specifies the functionality the user has switched to.</description>
+ </param>
+ </function>
+ <function name="OnAppRegistered" messagetype="notification">
+ <description>Issued by SDL to notify HMI about new application registered.</description>
+ <param name="application" type="Common.HMIApplication" mandatory="true">
+ <description>The information about application registered. See HMIApplication. </description>
+ </param>
+ <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ May not be empty.
+ May not start with a new line character.
+ Not unique value
+ </description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Defines an additional voice recognition command.
+ Must not interfere with any name of previously registered applications(SDL makes check).
+ </description>
+ </param>
+ <param name="resumeVrGrammars" type="Boolean" mandatory="false">
+ <description>The flag if VR grammars resume is required</description>
+ </param>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ </function>
+ <function name="OnAppUnregistered" messagetype="notification">
+ <description>
+ Issued by SDL to notify HMI about application unregistered.
+ Application then to be removed from application list; all data connected with application has to be cleared up.
+ </description>
+ <param name="unexpectedDisconnect" type="Boolean" mandatory="true">
+ <description>
+ SDL sends 'true' in case the connection is unexpectedly lost.
+ SDL sends 'false' in case the mobile app is unregistered gracefully (via appropriate RPC)
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application unregistered</description>
+ </param>
+ </function>
+ <function name="OnExitApplication" messagetype="notification">
+ <description>Must be sent by HMI when the User chooses to exit the application..</description>
+ <param name="reason" type="Common.ApplicationToNONEReason" mandatory="true">
+ <description>Specifies reason of moving the app to NONE</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application to be exited.</description>
+ </param>
+ </function>
+ <function name="OnExitAllApplications" messagetype="notification">
+ <description>Sent by HMI to SDL to close all registered applications.</description>
+ <param name="reason" type="Common.ApplicationsCloseReason" mandatory="true">
+ <description>Specifies reason for exiting all apllications.</description>
+ </param>
+ </function>
+ <function name="MixingAudioSupported" messagetype="request">
+ <description>Request from SDL to HMI to find out if the last one supports mixing audio (i.e. recording TTS command and playing audio).</description>
+ </function>
+ <function name="MixingAudioSupported" messagetype="response">
+ <description>If no response received SDL supposes that mixing audio is not supported</description>
+ <param name="attenuatedSupported" type="Boolean" mandatory="true">
+ <description>Must be true if supported</description>
+ </param>
+ </function>
+ <function name="PlayTone" messagetype="notification">
+ <description>Sent by SDL to HMI to notify that the tone should be played.</description>
+ </function>
+ <!-- Policies -->
+
+ <!-- SyncP RPC-->
+ <function name="OnSystemRequest" messagetype="notification" >
+ <description>
+ An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
+ Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
+ </description>
+ <param name="requestType" type="Common.RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
+ <description>Optional array of URL(s) for HTTP requests.</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="false">
+ <description>Optional file type (meant for HTTP file requests).</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ </param>
+ <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+ <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SystemRequest" messagetype="request">
+ <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
+ <param name="requestType" type="Common.RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
+ <description>The path to file.</description>
+ </param>
+ <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SystemRequest" messagetype="response">
+ </function>
+ <function name="PolicyUpdate" messagetype="request">
+ <description>
+ From: SDL
+ To: SYNCP Manager
+ Asks SYNCP Manager to send given Policy Table snapshot to the backend
+ </description>
+ <param name="file" type="String" minlength="1" maxlength="255" mandatory="true">
+ <description>
+ Location of policy table snapshot
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>
+ Send attempt timeout in seconds
+ </description>
+ </param>
+ <param name="retry" type="Integer" minvalue="0" maxvalue="65535" array="true" minsize="1" maxsize="5" mandatory="true">
+ <description>
+ Array of delays to wait after failed atempts
+ </description>
+ </param>
+ </function>
+ <function name="PolicyUpdate" messagetype="response">
+ </function>
+ <!-- End of SyncP RPC-->
+
+ <function name="OnSDLClose" messagetype="notification">
+ <description>SDL must notify HMI about finish working application</description>
+ </function>
+
+ <function name="OnPutFile" messagetype="notification" >
+ <description>
+ Notification, that comes to HMI when mobile sents file with systemFile flag
+ </description>
+
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+
+ <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Full Size of file. sends in first OnPutFile notification if file is splited
+ into many PutFiles
+ </description>
+ </param>
+
+ <param name="FileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ <param name="fileType" type="Common.FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
+
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+ </function>
+
+<!-- Policies -->
+ <function name="GetSystemInfo" messagetype="request">
+ <description>Request from SDL to HMI to obtain information about head unit system.</description>
+ </function>
+ <function name="GetSystemInfo" messagetype="response">
+ <param name="ccpu_version" type="String" maxlength="500" mandatory="true">
+ <description>Software version of the module</description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>ISO 639-1 combined with ISO 3166 alpha-2 country code (i.e. en-us)</description>
+ </param>
+ <param name="wersCountryCode" type="String" maxlength="500" mandatory="true">
+ <description>Country code from the Ford system WERS (i.e.WAEGB).</description>
+ </param>
+ </function>
+ <function name="OnSystemInfoChanged" messagetype="notification">
+ <description>Issued by system to SDL to notify that some system param has changed. Currently applied for Sync Language.</description>
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="OnIgnitionCycleOver" messagetype="notification">
+ <description>Notification from system to SDL to let it know that ignition cycle is over.</description>
+ </function>
+ <!-- End of Policies -->
+</interface>
+
+<interface name="VR" version="1.0" date="2013-04-17">
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response provides information about presence of VR module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if VR is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="Started" messagetype="notification">
+ <description>Must be initiated by VR module to let SDL know that VR session has started.</description>
+ </function>
+ <function name="Stopped" messagetype="notification">
+ <description>Must be initiated by VR module to let SDL know that VR session has stopped.</description>
+ </function>
+ <function name="AddCommand" messagetype="request">
+ <description>Request from SDL to add a command(string with associated id) to VR.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of a command (further to be used in OnCommand notification).</description>
+ </param>
+ <param name="vrCommands" type="String" mandatory="true" maxlength="99" minsize="1" maxsize="100" array="true">
+ <description>List of strings to be used as VR commands.</description>
+ </param>
+ <param name="type" type="Common.VRCommandType" mandatory="true">
+ <description>Type of added command. See VRCommandType.</description>
+ </param>
+ <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>
+ ID of the specific grammar, whether top-level or choice set.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="AddCommand" messagetype="response">
+ </function>
+ <function name="DeleteCommand" messagetype="request">
+ <description>Request from SDL to delete a command from VR.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Id of a command (list of strings), previously sent by AddCommand.</description>
+ </param>
+ <param name="type" type="Common.VRCommandType" mandatory="true">
+ <description>Type of added command. See VRCommandType.</description>
+ </param>
+ <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the specific grammar.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="DeleteCommand" messagetype="response">
+ </function>
+ <function name="PerformInteraction" messagetype="request">
+ <description>
+ Sets some properties for the application initiated request.
+ </description>
+ <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ The help prompt. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
+ </description>
+ </param>
+ <param name="initialPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ This is the intial prompt spoken to the user at the start of an interaction. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
+ </description>
+ </param>
+ <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text for a wait timeout. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" mandatory="true">
+ <description>Timeout initiate timeoutPrompt</description>
+ </param>
+ <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ IDs of the specific compiled grammars for this voice interaction.
+ </description>
+ </param>
+ </function>
+ <function name="PerformInteraction" messagetype="response">
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ ID of the choice that was selected in response to PerformInteraction.
+ </description>
+ </param>
+ </function>
+ <function name="OnCommand" messagetype="notification">
+ <description>Notifies SDL about command trigerred via VR</description>
+ <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
+ <description>ID of of the command (list of strings)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to change language of VR.</description>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Request new VR synonyms registration
+ Defines an additional voice recognition command.
+ Must not interfere with any name of previously registered applications(SDL makes check).
+ </description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>The language application wants to switch to.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="response">
+ </function>
+ <function name="OnLanguageChange" messagetype="notification">
+ <description>Notification from HMI to SmartDeviceLink about change of language.</description>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>Language VR has switched to.</description>
+ </param>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="request">
+ <description>Method is invoked at system start-up. Response must provide the information about VR supported languages.</description>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="response">
+ <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of languages supported in VR.</description>
+ </param>
+ </function>
+ <function name="GetLanguage" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to get currently active VR language</description>
+ </function>
+ <function name="GetLanguage" messagetype="response">
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about VR capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="vrCapabilities" type="Common.VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Types of input recognized by VR module.</description>
+ </param>
+ </function>
+</interface>
+
+<interface name="TTS" version="1.0" date="2013-04-18">
+ <description>RPCs for communication between TTS and SDL.</description>
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
+ <description>See SpeechCapabilities</description>
+ </param>
+ <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
+ <description>See PrerecordedSpeech</description>
+ </param>
+ </function>
+ <function name="Started" messagetype="notification">
+ <description>Must be initiated by TTS module to let SDL know that TTS session has started.</description>
+ </function>
+ <function name="Stopped" messagetype="notification">
+ <description>Must be initiated by TTS module to let SDL know that TTS session has stopped.</description>
+ </function>
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system start-up. Response must provide the information about presence of TTS module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if TTS is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="Speak" messagetype="request">
+ <description>RPC from SDL to TTS for speaking the text.</description>
+ <param name="ttsChunks" type="Common.TTSChunk" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of strings to be spoken.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ <param name="speakType" type="Common.SpeakType" mandatory="false">
+ <description>Defines the type of the request which causes text-to-speech</description>
+ </param>
+ </function>
+ <function name="Speak" messagetype="response">
+ <description>Provides information about success of operation.</description>
+ </function>
+ <function name="StopSpeaking" messagetype="request">
+ <description>Initiated by SDL to stop speaking the text.</description>
+ </function>
+ <function name="StopSpeaking" messagetype="response">
+ </function>
+ <function name="ChangeRegistration" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to change language of TTS.</description>
+ <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ Request new ttsName registration
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ May not be empty.
+ May not start with a new line character.
+ Not unique value (SDL makes all the checks)
+ </description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>The language application wants to switch to.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="response">
+ </function>
+ <function name="OnLanguageChange" messagetype="notification">
+ <description>Notification from HMI to SmartDeviceLink about change of language.</description>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>Language TTS has switched to.</description>
+ </param>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="request">
+ <description>Method is invoked at system start-up by SDL. Response must provide the information about TTS supported languages.</description>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="response">
+ <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of languages supported in TTS.</description>
+ </param>
+ </function>
+ <function name="GetLanguage" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to get currently active TTS language</description>
+ </function>
+ <function name="GetLanguage" messagetype="response">
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="SetGlobalProperties" messagetype="request">
+ <description>Sets some properties for the application initiated request.</description>
+ <param name="helpPrompt" type="Common.TTSChunk" minsize="0" maxsize="100" array="true" mandatory="false" >
+ <description>
+ The help prompt.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ </description>
+ </param>
+ <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ Help text for a wait timeout.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetGlobalProperties" messagetype="response">
+ </function>
+ <function name="OnResetTimeout" messagetype="notification">
+ <description>
+ Sender: HMI->SDL. HMI must send this notification every 10 sec. in case the 'methodName'
+ results long processing on HMI
+ </description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Id of application that concerns the 'methodName'.</description>
+ </param>
+ <param name="methodName" type="String" mandatory="true">
+ <description>The name of the method, the renew of timeout is required for</description>
+ </param>
+ </function>
+</interface>
+
+<interface name="UI" version="1.0" date="2013-04-16">
+ <function name="Alert" messagetype="request">
+ <description>Request from SDL to show an alert message on the display.</description>
+ <param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
+ <description>Array of lines of alert text fields. See TextFieldStruct. Uses alertText1, alertText2, alertText3.</description>
+ </param>
+ <param name="duration" type="Integer" mandatory="true" minvalue="3000" maxvalue="10000">
+ <description>Timeout in milliseconds.</description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" mandatory="false" minsize="0" maxsize="4" array="true">
+ <description>App defined SoftButtons</description>
+ </param>
+ <param name="progressIndicator" type="Boolean" mandatory="false">
+ <description>If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.</description>
+ </param>
+ <param name="alertType" type="Common.AlertType" mandatory="true">
+ <description>Defines if only UI or BOTH portions of the Alert request are being sent to HMI Side</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="Alert" messagetype="response">
+ <param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
+ <description>Amount of time (in milliseconds) that SDL must wait before resending an alert. Must be provided if another system event or overlay currently has a higher priority than this alert.</description>
+ </param>
+ </function>
+ <function name="Show" messagetype="request">
+ <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="7">
+ <description>Array of lines of show text fields. See TextFieldStruct. Uses mainField1, mainField2, mainField3, mainField4. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
+ mainField1: The text that should be displayed in a single or upper display line.
+ mainField2: The text that should be displayed on the second display line.
+ mainField3: The text that should be displayed on the second "page" first display line.
+ mainField4: The text that should be displayed on the second "page" second display line.
+ statusBar: statusBar.
+ mediaClock: Text value for MediaClock field.
+ mediaTrack: The text that should be displayed in the track field. This field is only valid for media applications on NGN type ACMs.
+ </description>
+ </param>
+ <param name="alignment" type="Common.TextAlignment" mandatory="false">
+ <description>Specifies how mainField1 and mainField2 texts should be aligned on the display.</description>
+ <description>If omitted, texts must be centered</description>
+ </param>
+ <param name="graphic" type="Common.Image" mandatory="false">
+ <description>Path to optional dynamic image or the static binary image itself. See Image. If omitted, the displayed graphic should not change.</description>
+ </param>
+ <param name="secondaryGraphic" type="Common.Image" mandatory="false">
+ <description>
+ Image struct determining whether static or dynamic secondary image to display in app.
+ If omitted on supported displays, the displayed secondary graphic shall not change.
+ </description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>App defined SoftButtons.</description>
+ <description>If omitted, the currently displayed SoftButton values should not change.</description>
+ </param>
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
+ <description>App labeled on-screen presets (i.e. GEN3 media presets or dynamic search suggestions).</description>
+ <description>If omitted on supported displays, the presets will be shown as not defined.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Id of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="Show" messagetype="response">
+ </function>
+ <function name="AddCommand" messagetype="request">
+ <description>Request from SDL to add a command to the application menu.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the command to be added.</description>
+ </param>
+ <param name="menuParams" type="Common.MenuParams" mandatory="false">
+ <description>Optional sub value containing parameters of the command (position, name, etc.). See MenuParams. If omitted the command should be added to the end of the list of commands.</description>
+ </param>
+ <param name="cmdIcon" type="Common.Image" mandatory="false">
+ <description>Image to be displayed for representing the command. See Image.</description>
+ <description>If omitted, no (or the default if applicable) icon should be displayed.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="AddCommand" messagetype="response">
+ </function>
+ <function name="DeleteCommand" messagetype="request">
+ <description>Request from SDL to delete a command from the in-application menu with the specified command id.</description>
+ <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
+ <description>cmdId previously sent via AddCommand request - id of the command to be deleted.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="DeleteCommand" messagetype="response">
+ </function>
+ <function name="AddSubMenu" messagetype="request">
+ <description>Request from SDL to add a sub menu to the in-application menu.</description>
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>ID of the sub menu to be added. Unique for the application.</description>
+ </param>
+ <param name="menuParams" type="Common.MenuParams" mandatory="true">
+ <description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="AddSubMenu" messagetype="response">
+ </function>
+ <function name="DeleteSubMenu" messagetype="request">
+ <description>Request from SDL to delete a submenu from the in-application menu.</description>
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true" >
+ <description>The "menuID" of the sub-menu to be deleted. (See addSubMenu.menuID)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="DeleteSubMenu" messagetype="response">
+ </function>
+ <function name="PerformInteraction" messagetype="request">
+ <description>Request from SDL for triggering an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+ <param name="initialText" type="Common.TextFieldStruct" mandatory="false">
+ <description>Uses initialInteractionText. See TextFieldStruct.</description>
+ </param>
+ <param name="choiceSet" type="Common.Choice" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The list of choices to be used for the interaction with the user</description>
+ </param>
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <description>VR Help Title text.</description>
+ <description>If omitted on supported displays, the default HU system help title should be used.</description>
+ </param>
+ <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="true">
+ <description>Timeout in milliseconds.</description>
+ </param>
+ <param name="interactionLayout" type="Common.LayoutMode" mandatory="false">
+ <description>See LayoutMode.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="PerformInteraction" messagetype="response">
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>ID of the choice that was selected in response to PerformInteraction.</description>
+ </param>
+ <param name="manualTextEntry" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ Manually entered text selection, e.g. through keyboard
+ Can be returned in lieu of choiceID, depending on trigger source
+ </description>
+ </param>
+ </function>
+ <function name="SetMediaClockTimer" messagetype="request">
+ <description>Sets the initial media clock value and automatic update method.</description>
+ <param name="startTime" type="Common.TimeFormat" mandatory="false">
+ <description>startTime should be ignored for "PAUSE", "RESUME", and "CLEAR"</description>
+ </param>
+ <param name="endTime" type="Common.TimeFormat" mandatory="false">
+ <description>
+ See TimeFormat.
+ endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
+ If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
+ endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
+ </description>
+ </param>
+ <param name="updateMode" type="Common.ClockUpdateMode" mandatory="true">
+ <description>The update method of the media clock.</description>
+ <description>In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SetMediaClockTimer" messagetype="response">
+ </function>
+ <function name="SetGlobalProperties" messagetype="request">
+ <description>Request from SDL to set some properties for VR help.</description>
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <description>VR Help Title text.</description>
+ <description>If omitted on supported displays, the default HU system help title should be used.</description>
+ </param>
+ <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
+ </param>
+ <param name="menuTitle" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </param>
+ <param name="menuIcon" type="Common.Image" mandatory="false">
+ <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ </param>
+ <param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
+ <description>On-screen keybaord configuration (if available).</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="SetGlobalProperties" messagetype="response">
+ </function>
+ <function name="OnCommand" messagetype="notification">
+ <description>Notification must be initiated by HMI on user choosing menu item.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Command ID, which is related to a specific menu entry (previously sent with AddCommand).</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that is related to this RPC.</description>
+ </param>
+ </function>
+ <function name="OnSystemContext" messagetype="notification">
+ <description>
+ Notification must be initiated by HMI when the user changes the context of application: goes to menu (in-application menu or system menu);
+ switches to VR; pop-up appears on screen etc.
+ </description>
+ <param name="systemContext" type="Common.SystemContext" mandatory="true">
+ <description>The context the application is brought into.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>ID of application that is related to this RPC.</description>
+ </param>
+ </function>
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about UI capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="true">
+ <description>Information about the capabilities of the display: its type, text field supported, etc. See DisplayCapabilities. </description>
+ </param>
+ <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true"/>
+ <param name="hmiZoneCapabilities" type="Common.HmiZoneCapabilities" mandatory="true"/>
+ <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" mandatory="false">
+ <description>Must be returned if the platform supports on-screen SoftButtons.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to change language for app.</description>
+ <param name="appName" type="String" maxlength="100" mandatory="false">
+ <description>
+ Request new app name registration
+ Needs to be unique over all applications.
+ May not be empty. May not start with a new line character.
+ May not interfere with any name or synonym of any registered applications.
+ Applications with the same name will be rejected. (SDL makes all the checks)
+ </description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Request new app short name registration</description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>The language application wants to switch to.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="response">
+ </function>
+ <function name="OnLanguageChange" messagetype="notification">
+ <description>Notification from HMI to SmartDeviceLink about change of language.</description>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>Language UI has switched to.</description>
+ </param>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="request">
+ <description>Method should be invoked at system startup. Response provides information about UI supported languages.</description>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="response">
+ <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of languages supported in UI.</description>
+ </param>
+ </function>
+ <function name="GetLanguage" messagetype="request">
+ <description>Request from SmartDeviceLink to HMI to get currently active UI language</description>
+ </function>
+ <function name="GetLanguage" messagetype="response">
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="OnDriverDistraction" messagetype="notification">
+ <description>Notification must be sent from HMI to SDL when driver distraction state is changed. Driver distraction rules are defined by the platform.</description>
+ <param name="state" type="Common.DriverDistractionState" mandatory="true">
+ <description>See DriverDistractionState. </description>
+ </param>
+ </function>
+ <function name="SetAppIcon" messagetype="request">
+ <description>Used to set existing local file on SYNC as the app's icon.</description>
+ <param name="syncFileName" type="Common.Image" mandatory="true">
+ <description>Either the path to the dynamic image stored on HY or the static binary image itself. See Image</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetAppIcon" messagetype="response">
+ </function>
+ <function name="SetDisplayLayout" messagetype="request">
+ <param name="displayLayout" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetDisplayLayout" messagetype="response">
+ <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+ <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+ <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ </param>
+ <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ </param>
+ </function>
+ <function name="ShowCustomForm" messagetype="request">
+ <description>Used to show a custom form; it can be a parent or child screen. If no parent screen is designated, it is set as a parent screen.</description>
+ <param name="customFormID" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined forms are defined.
+ Predefined layouts include:
+ "DEFAULT" - Default media / non-media screen
+ "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
+ "KEYBOARD_SEARCH" - Custom template containing app-configured on-screen keyboard with active search updating; user also can trigger voice search.
+ "NAV_FULLSCREEN_MAP" - Custom root template screen containing full screen map with navigation controls.
+ "NAV_POI_MENU" - Custom template containing app-defined POI options.
+ "NAV_SEARCH_RESULTS" - Custom template containing a list of app-defined search results
+ "NAV_POI_INFO" - Custom template containing app-defined POI information (and potentially map data).
+ </description>
+ </param>
+ <param name="parentFormID" type="String" maxlength="500" defvalue="DEFAULT" mandatory="false">
+ <description>
+ Parent screen of predefined form to display.
+ Currently only predefined forms are defined.
+ If not provided, then set to "DEFAULT".
+ Predefined layouts include:
+ "DEFAULT" - Default media / non-media screen
+ "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
+ "NAV_FULLSCREEN_MAP" - Custom template containing full screen map with navigation controls.
+ </description>
+ </param>
+ </function>
+ <function name="ShowCustomForm" messagetype="response">
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="OnKeyboardInput" messagetype="notification">
+ <description>On-screen keyboard event.</description>
+ <description>Can be full string or individual keypresses depending on keyboard mode.</description>
+ <param name="event" type="Common.KeyboardEvent" mandatory="true">
+ <description>On-screen keyboard input data.</description>
+ </param>
+ <param name="data" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>On-screen keyboard input data.</description>
+ <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
+ <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
+ <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
+ </param>
+ </function>
+ <function name="OnTouchEvent" messagetype="notification">
+ <description>Notifies about touch events on the screen's prescribed area</description>
+ <param name="type" type="Common.TouchType" mandatory="true">
+ <description>The type of touch event.</description>
+ </param>
+ <param name="event" type="Common.TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
+ <description>List of all individual touches involved in this event.</description>
+ </param>
+ </function>
+ <function name="Slider" messagetype="request">
+ <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
+ <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
+ <description>Number of selectable items on a horizontal axis</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
+ <description>Initial position of slider control (cannot exceed numTicks)</description>
+ </param>
+ <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
+ <description>Text header to be displayed.</description>
+ </param>
+ <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
+ <description>Text footer to be displayed (meant to display min/max threshold descriptors).</description>
+ <description>For a static text footer, only one footer string shall be provided in the array.</description>
+ <description>For a dynamic text footer, the number of footer text string in the array must match the numTicks value.</description>
+ <description>For a dynamic text footer, text array string should correlate with potential slider position index.</description>
+ <description>If omitted on supported displays, no footer text shall be displayed.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" mandatory="true">
+ <description>Timeout. The slider should be displayed until the defined amount of time has elapsed. </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="Slider" messagetype="response">
+ <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
+ <description>Current slider position. Must be returned when the user has clicked the ‘Save’ or ‘Canceled’ button or by the timeout </description>
+ </param>
+ </function>
+ <function name="ScrollableMessage" messagetype="request">
+ <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
+ <param name="messageText" type="Common.TextFieldStruct" mandatory="true">
+ <description>Body of text that can include newlines and tabs. Uses scrollableMessageBody.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Timeout in milliseconds. The message should be displayed until the time defined is up.</description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>App defined SoftButtons.</description>
+ <description>If omitted on supported displays, only the system defined "Close" SoftButton should be displayed.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ScrollableMessage" messagetype="response">
+ </function>
+ <function name="PerformAudioPassThru" messagetype="request">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ <param name="audioPassThruDisplayTexts" type="Common.TextFieldStruct" mandatory="true" minsize="0" maxsize="2" array="true">
+ <description>Uses
+ audioPassThruDisplayText1: First line of text displayed during audio capture.
+ audioPassThruDisplayText2: Second line of text displayed during audio capture.</description>
+ </param>
+ <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
+ <description>The maximum duration of audio recording in milliseconds. If not provided, the recording should be performed until EndAudioPassThru arrives.</description>
+ </param>
+ <param name="muteAudio" type="Boolean" mandatory="true">
+ <description>
+ Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
+ If omitted, the value is set to true.
+ </description>
+ </param>
+ </function>
+ <function name="PerformAudioPassThru" messagetype="response">
+ </function>
+ <function name="EndAudioPassThru" messagetype="request">
+ <description>Request is sent by SDL to stop the audio capturing.</description>
+ </function>
+ <function name="EndAudioPassThru" messagetype="response">
+ </function>
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response provides information about presence of UI module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if UI is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="ClosePopUp" messagetype="request">
+ <description>Initiated by SDL to close currently active pop-up on HMI.</description>
+ <param name="methodName" type="String" mandatory="false">
+ <description>Method to be closed</description>
+ </param>
+ </function>
+ <function name="ClosePopUp" messagetype="response">
+ <description>Provides the result of operation.</description>
+ </function>
+ <function name="OnResetTimeout" messagetype="notification">
+ <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Id of application that invoked notifcation.</description>
+ </param>
+ <param name="methodName" type="String" mandatory="true">
+ <description>Currently used method name on which was triggered action</description>
+ </param>
+ </function>
+ <function name="OnRecordStart" messagetype="notification">
+ <description>Issued by SDL to notify HMI about capturing mic data should be started</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+</interface>
+
+<interface name="Navigation" version="1.0" date="2013-05-22">
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if Navigation is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="SendLocation" messagetype="request">
+ <description>That allows the app to send a destination to the embedded nav system.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description> Name / title of intended location </description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description> Description intended location / establishment (if applicable) </description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description> Location address (if applicable) </description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description> Phone number of intended location / establishment (if applicable) </description>
+ </param>
+ <param name="locationImage" type="Common.Image" mandatory="false">
+ <description> Image / icon of intended location (if applicable and supported) </description>
+ </param>
+ </function>
+ <function name="SendLocation" messagetype="response" >
+ </function>
+ <function name="ShowConstantTBT" messagetype="request">
+ <description>Request from SmartDeviceLinkCore to HMI to show info about navigation.</description>
+ <param name="navigationTexts" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="5">
+ <description>See TextFieldStruct. Uses:
+ navigationText1
+ navigationText2
+ ETA
+ totalDistance
+ timeToDestination.
+ </description>
+ </param>
+ <param name="turnIcon" type="Common.Image" mandatory="false">
+ </param>
+ <param name="nextTurnIcon" type="Common.Image" mandatory="false">
+ </param>
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
+ <description>Fraction of distance till next maneuver (from previous maneuver).</description>
+ <description>May be used to calculate progress bar.</description>
+ </param>
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
+ <description>Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).</description>
+ <description>May be used to calculate progress bar.</description>
+ </param>
+ <param name="maneuverComplete" type="Boolean" mandatory="false">
+ <description>If and when a maneuver has completed while an AlertManeuver is active, SDL will send this value set to TRUE in order to clear the AlertManeuver overlay.</description>
+ <description>If omitted the value should be assumed as FALSE.</description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>Three dynamic SoftButtons available</description>
+ <description>If omitted on supported displays, the currently displayed SoftButton values will not change.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ShowConstantTBT" messagetype="response">
+ </function>
+ <function name="AlertManeuver" messagetype="request">
+ <description>Request from SmartDeviceLinkCore to HMI to announce navigation maneuver</description>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>If omitted, only the system defined "Close" SoftButton should be displayed.</description>
+ </param>
+ </function>
+ <function name="AlertManeuver" messagetype="response">
+ </function>
+ <function name="UpdateTurnList" messagetype="request">
+ <description>Request from SmartDeviceLinkCore to HMI to update turn list.</description>
+ <param name="turnList" type="Common.Turn" minsize="1" maxsize="100" array="true" mandatory="false">
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
+ <description>If omitted, app-defined SoftButton should be left blank.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="UpdateTurnList" messagetype="response">
+ </function>
+ <function name="OnTBTClientState" messagetype="notification">
+ <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
+ <param name="state" type="Common.TBTState" mandatory="true">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+ <function name="StartStream" messagetype="request">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
+ <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
+ <description>URL that HMI start playing.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StartStream" messagetype="response">
+ </function>
+ <function name="StopStream" messagetype="request">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StopStream" messagetype="response">
+ </function>
+ <function name="StartAudioStream" messagetype="request">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
+ <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
+ <description>URL that HMI start playing.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StartAudioStream" messagetype="response">
+ </function>
+ <function name="StopAudioStream" messagetype="request">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StopAudioStream" messagetype="response">
+ </function>
+
+</interface>
+
+<interface name="VehicleInfo" version="1.0" date="2013-04-21">
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if vehicle data modules are present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="GetVehicleType" messagetype="request">
+ <description>Request from SmartDeviceLinkCore to HMI to get info about the vehicle (type, model, etc.).</description>
+ </function>
+ <function name="GetVehicleType" messagetype="response">
+ <param name="vehicleType" type="Common.VehicleType" mandatory="true"/>
+ </function>
+ <function name="ReadDID" messagetype="request">
+ <description>Request from SDL for vehicle data reading.</description>
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
+ <description>Get raw data from vehicle data DID location(s).</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ReadDID" messagetype="response">
+ <param name="didResult" type="Common.DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>Array of requested DID results (with data if available).</description>
+ </param>
+ </function>
+ <function name="GetDTCs" messagetype="request">
+ <description>Vehicle module diagnostic trouble code request.</description>
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+ <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
+ <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetDTCs" messagetype="response">
+ <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
+ </param>
+ <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
+ <description>
+ Array of all reported DTCs on module. Each DTC is represented with 4 bytes:
+ 3 bytes for data
+ 1 byte for status
+ </description>
+ </param>
+ </function>
+ <function name="DiagnosticMessage" messagetype="request">
+ <description>Non periodic vehicle diagnostic request</description>
+ <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of target ECU.</description>
+ </param>
+ <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Length of message (in bytes).</description>
+ </param>
+ <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="DiagnosticMessage" messagetype="response">
+ <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message result.
+ </description>
+ </param>
+ </function>
+ <function name="SubscribeVehicleData" messagetype="request">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="SubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="UnsubscribeVehicleData" messagetype="request">
+ <description>
+ This function is used to unsubscribe the notifications from the subscribeVehicleData function.
+ </description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="UnsubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="GetVehicleData" messagetype="request">
+ <description>Non periodic vehicle data read request.</description>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetVehicleData" messagetype="response">
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <function name="OnVehicleData" messagetype="notification">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+</interface>
+
+ <!-- Policies -->
+<interface name="SDL" version="1.0" date="2014-03-12">
+<function name="ActivateApp" messagetype="request">
+ <param name="appID" type="Integer" mandatory="true">
+ </param>
+ </function>
+ <function name="ActivateApp" messagetype="response">
+ <param name="isSDLAllowed" type="Boolean" mandatory="true" scope="internal"/>
+ <param name="device" type="Common.DeviceInfo" mandatory="false" scope="internal">
+ <description>If isSDLAllowed is false, consent for sending PT through specified device is required.</description>
+ </param>
+ <param name="isPermissionsConsentNeeded" type="Boolean" mandatory="true"/>
+ <param name="isAppPermissionsRevoked" type="Boolean" mandatory="true"/>
+ <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
+ </param>
+ <param name="isAppRevoked" type="Boolean" mandatory="true"/>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ </function>
+
+ <function name="GetUserFriendlyMessage" messagetype="request" scope="internal">
+ <description>Request from HMI to SDL to get user friendly messages for UI/TTS info boxes/texts (i.e. for help/dialogs etc) from Policy Table.</description>
+ <param name="messageCodes" type="String" array="true" minsize="1" maxsize="100" maxlength="500" mandatory="true">
+ <description>Id of message to be received according to Policy Table i.e. StatusNeeded, Notifications, DrivingCharacteristics etc.</description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="false">
+ <description>Optional parameter if HMI wants message in some other language then its current one already known to SDL.</description>
+ </param>
+ </function>
+ <function name="GetUserFriendlyMessage" messagetype="response">
+ <param name="messages" type="Common.UserFriendlyMessage" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>If no message was found in PT for specified message code and for HMI current or specified language, this parameter will be omitted.</description>
+ </param>
+ </function>
+
+ <function name="OnAllowSDLFunctionality" messagetype="notification">
+ <description>Initiated by HMI. Notifies about user/HMI allowing SDL functionality or disallowing access to all mobile apps. Needed if HMI has additional ways of asking user about this (i.e. Settings etc)</description>
+ <param name="device" type="Common.DeviceInfo" mandatory="false">
+ <description>If no device is specified permission counts for SDL functionality in general.</description>
+ </param>
+ <param name="allowed" type="Boolean" mandatory="true">
+ <description>Must be true if allowed</description>
+ </param>
+ <param name="source" type="Common.ConsentSource" mandatory="true"/>
+ </function>
+
+ <!-- SyncP RPC-->
+ <function name="OnReceivedPolicyUpdate" messagetype="notification">
+ <description>
+ From: SYNCP Manager
+ To: SDL
+ Notification sent to SDL when SYNCP Manager receives and decrypts updated policy table
+ </description>
+ <param name="policyfile" type="String" minlength="1" maxlength="255" mandatory="true">
+ <description>Location of decrypted policy table Json file on target</description>
+ </param>
+ </function>
+
+ <function name="OnPolicyUpdate" messagetype="notification">
+ <description>
+ From: SYNCP Manager
+ To: SDL
+ Notifies SDL to supply a new "PolicyUpdate" request with more recent snapshot data
+ </description>
+ </function>
+ <!-- End of SyncP RPC-->
+
+ <function name="GetListOfPermissions" messagetype="request">
+ <description>Request from HMI to SDL to get list of permissions for app. If no app specified - list of permissions for all apps.</description>
+ <param name="appID" type="Integer" mandatory="false"/>
+ </function>
+ <function name="GetListOfPermissions" messagetype="response">
+ <param name="allowedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="0" maxsize="100">
+ <description>If no permissions were specified for application the array will come empty.</description>
+ </param>
+ </function>
+
+ <function name="OnAppPermissionConsent" messagetype="notification">
+ <description>Initiated by HMI for specifying the allowance for the application to perform some functionality. Duplicates functionality of the request, needed if HMI has specific ways to allow/disallow functionality (i.e.Setting Menu)</description>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
+ </param>
+ <param name="consentedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="1" maxsize="100">
+ </param>
+ <param name="source" type="Common.ConsentSource" mandatory="true"/>
+ </function>
+
+ <function name="OnAppPermissionChanged" messagetype="notification">
+ <description>Notification from SDL to HMI. Occurs when app permissions were reduced. If no permission specified means that app was dissallowed and has to be unregitstered.</description>
+ <param name="appID" type="Integer" mandatory="true"/>
+ <param name="isAppPermissionsRevoked" type="Boolean" mandatory="false"/>
+ <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
+ </param>
+ <param name="appRevoked" type="Boolean" mandatory="false">
+ <description>If present then specified application was prohibited to used with Sync.</description>
+ </param>
+ <param name="appPermissionsConsentNeeded" type="Boolean" mandatory="false">
+ <description>If present specifies that permissions were added to application that require User Consent, then HMI can send GetListOfPermissions request to obtain list of permissions.</description>
+ </param>
+ <param name="appUnauthorized" type="Boolean" mandatory="false">
+ <description>When present and set to true (should be if present) then this means that application was not authorized (nickname check failed.)</description>
+ </param>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ </function>
+
+ <function name="OnSDLConsentNeeded" messagetype="notification">
+ <description>Send from SDL to HMI to notify that data consent is needed for device either because PT update or Retry strategy.</description>
+ <param name="device" type="Common.DeviceInfo" mandatory="true"/>
+ </function>
+
+ <function name="UpdateSDL" messagetype="request">
+ <description>Request from HMI to SDL to start update of Policy Table.</description>
+ </function>
+ <function name="UpdateSDL" messagetype="response">
+ <description>Specify result: no update needed, update was successful/unsuccessful etc</description>
+ <param name="result" type="Common.UpdateResult" mandatory="true"/>
+ </function>
+
+ <function name="GetStatusUpdate" messagetype="request">
+ <description>Request from HMI to SDL to find out current status of PT exchange process.</description>
+ </function>
+ <function name="GetStatusUpdate" messagetype="response">
+ <param name="status" type="Common.UpdateResult" mandatory="true"/>
+ </function>
+ <function name="OnStatusUpdate" messagetype="notification">
+ <description>Notification from SDL to HMI when current status of PT exchange changed (i.e. it Succeded or Failed etc)</description>
+ <param name="status" type="Common.UpdateResult" mandatory="true" />
+ </function>
+
+ <function name="OnSystemError" messagetype="notification">
+ <param name="error" type="Common.SystemError" mandatory="true"/>
+ </function>
+
+ <function name="AddStatisticsInfo" messagetype="notification">
+ <description>Sent by system to record statiscs and error counts. Increases statistics specified by statisticType by one.</description>
+ <param name="statisticType" type="Common.StatisticsType" mandatory="true"/>
+ </function>
+
+ <function name="GetURLS" messagetype="request" scope="internal">
+ <description>Sent by system to SDL to get list of URL for specified service type and optionally policy's application id.</description>
+ <param name="service" type="Integer" minvalue="0" maxvalue="100" mandatory="true"/>
+ </function>
+ <function name="GetURLS" messagetype="response" scope="internal">
+ <param name="urls" type="Common.ServiceInfo" array="true" mandatory="false" minsize="1" maxsize="100"/>
+ </function>
+ <function name="OnDeviceStateChanged" messagetype="notification" scope="internal">
+ <param name="deviceState" type="Common.DeviceState" mandatory="true" />
+ <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500" />
+ <param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
+ </function>
+</interface>
+</interfaces>
diff --git a/src/components/interfaces/Json_HMI_message_specification.txt b/src/components/interfaces/Json_HMI_message_specification.txt
new file mode 100644
index 0000000000..9f5b20a3c4
--- /dev/null
+++ b/src/components/interfaces/Json_HMI_message_specification.txt
@@ -0,0 +1,317 @@
+/*
+* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+Version = 1.0
+
+This file describes message structure for communication between SDL and HMI.
+JSON RPC 2.0 format is taken as basis. Please refer to http://www.jsonrpc.org/specification. Additions to this format are marked as 'Additions' hereinafter. Blocks marked as 'Spec' are excerpt from oficial specification of JSON RPC 2.0. Samples are also provided.
+This document comes in pair with HMI_API.xml.
+
+#########################################################################################
+
+Notifications:
+
+/****
+
+ * Spec (from http://www.jsonrpc.org/specification):
+ A Notification is a Request object without an "id" member. A Request object that is a Notification signifies the Client's lack of interest in the corresponding Response object, and as such no Response object needs to be returned to the client. The Server MUST NOT reply to a Notification, including those that are within a batch request.
+***/
+
+//No params:
+{
+ "jsonrpc" : "2.0",
+ "method" : "UI.OnReady"
+}
+
+//With params:
+
+{
+ "jsonrpc" : "2.0",
+ "method" : "BasicCommunication.OnDeviceListUpdated",
+ "params" :
+ {
+ "deviceList" : [ "XT910", "GT-I9300", "HTC Explorer A310e" ]
+ }
+}
+
+{
+ "jsonrpc" : "2.0",
+ "method" : "Buttons.OnButtonPress",
+ "params" :
+ {
+ "mode" : "SHORT",
+ "name" : "OK"
+ }
+}
+
+#########################################################################################
+
+/*****
+ Request-response pairs
+
+ * Spec (from http://www.jsonrpc.org/specification):
+ Request object
+ A rpc call is represented by sending a Request object to a Server. The Request object has the following members:
+
+ jsonrpc
+ A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0".
+ method
+ A String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.
+ params
+ A Structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.
+ id
+ An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null and Numbers SHOULD NOT contain fractional parts
+*****/
+
+//Params in request
+{
+ "id" : 36,
+ "jsonrpc" : "2.0",
+ "method" : "UI.Alert",
+ "params" :
+ {
+ "alertText1" : "Alert Line 1",
+ "alertText2" : "Alert Line 2",
+ "alertText3" : "Alert Line 3",
+ "appId" : 65537,
+ "duration" : 5000,
+ "playTone" : true,
+ "ttsChunks" :
+ [
+
+ {
+ "text" : "Text to Speak"
+ }
+ ]
+ }
+}
+
+//No params in request
+{
+ "id" : 19,
+ "jsonrpc" : "2.0",
+ "method" : "Buttons.GetCapabilities"
+}
+
+/****
+ * Spec (from http://www.jsonrpc.org/specification):
+ Response object
+ When a rpc call is made, the Server MUST reply with a Response, except for in the case of Notifications. The Response is expressed as a single JSON Object, with the following members:
+
+ jsonrpc
+ A String specifying the version of the JSON-RPC protocol. MUST be exactly "2.0".
+ result
+ This member is REQUIRED on success.
+ This member MUST NOT exist if there was an error invoking the method.
+ The value of this member is determined by the method invoked on the Server.
+ error
+ This member is REQUIRED on error.
+ This member MUST NOT exist if there was no error triggered during invocation.
+ The value for this member MUST be an Object as defined below.
+ id
+ This member is REQUIRED.
+ It MUST be the same as the value of the id member in the Request Object.
+ If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.
+ * Additions:
+ result MUST contain 'method' which has to be the same as in 'request'.
+
+
+****/
+
+/****
+ * Error object
+ When a rpc call encounters an error, the Response Object MUST contain the error member with a value that is a Object with the following members:
+
+ code
+ A Number that indicates the error type that occurred.
+ This MUST be an integer.
+ message
+ A String providing a short description of the error.
+ The message SHOULD be limited to a concise single sentence.
+ data
+ A Primitive or Structured value that contains additional information about the error.
+ This may be omitted.
+ The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
+
+
+ * Additions:
+ result along with error MUST contain 'code' which is value from Result enum provided in HMI_API.xml
+ error MUST contain 'method' which is the same as 'method' in request for this error in field 'data'.
+****/
+
+//Response with no params in it (code and method are necessary)
+{
+ "id" : 36,
+ "jsonrpc" : "2.0",
+ "result" :
+ {
+ "code" : 0,
+ "method": "UI.Alert"
+ }
+}
+
+// extra params in response
+{
+ "id" : 19,
+ "jsonrpc" : "2.0",
+ "result" :
+ {
+ "capabilities" :
+ [
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_0",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_1",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_2",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_3",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_4",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_5",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_6",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_7",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_8",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "PRESET_9",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "OK",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "SEEKLEFT",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "SEEKRIGHT",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "TUNEUP",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ },
+
+ {
+ "longPressAvailable" : true,
+ "name" : "TUNEDOWN",
+ "shortPressAvailable" : true,
+ "upDownAvailable" : true
+ }
+ ],
+ "presetBankCapabilities" :
+ {
+ "onScreenPresetsAvailable" : true
+ },
+ "code" : 0,
+ "method" : "Buttons.GetCapabilities"
+ }
+}
+
+//Erroneous response
+{
+ "id" : 35,
+ "jsonrpc" : "2.0",
+ "error" :
+ {
+ "code" : 12,
+ "message" : "File with this name is not available",
+ "data" : {
+ "method" : "Buttons.GetCapabilities"
+ }
+ }
+}
diff --git a/src/components/interfaces/Json_Mobile_side_message_spec.txt b/src/components/interfaces/Json_Mobile_side_message_spec.txt
new file mode 100644
index 0000000000..02d1233bb6
--- /dev/null
+++ b/src/components/interfaces/Json_Mobile_side_message_spec.txt
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+Version = 1.0
+
+This file describes message structure for communication between SDL and Mobile SDK.
+
+Json string used for communication consists of parameter names and values which can be either objects, arrays or 'simple' values such as strings, numbers and boolean values.
+Example:
+{"syncFileName":"action.png","fileType":"GRAPHIC_PNG"}
+where
+- syncFileName - name of parameter with value of type string ("action.png")
+- fileType - name of parameter with value passed as type string ("GRAPHIC_PNG").
+{"resultCode" : "SUCCESS", "success" : true}
+- resultCode - name of parameter with value passed as type string("SUCCESS")
+- success - name of parameter with value of type boolean (true)
+
+Parameter names, types, fields of possible values are provided in specification stored in MOBILE_API.xml file.
+
+Each RPC described in this document can be represented in json format;
+RPC type (Request/Response/Notification) is passed in binary header which comes along with json string as well as ID representing particular RPC. For instance, according to MOBILE_API.xml PutFile RPC has functionID="PutFileID" which can be found in FunctionID enum with value equal to 32. Hence binary header for this RPC Request will contain RPC Type half-byte set to 0 (Request), RPC Function ID 3.5 bytes set to 32.
+PutFile RPC Request has mandatory params:
+syncFileName of type String
+fileType of enum type FileType
+and optional parameter:
+persistentFile of type Boolean.
+Hence with file name set to 'action.png' and file type to PNG, optional parameter ommited, json string of PutFile RPC Request will look like:
+{"syncFileName":"action.png","fileType":"GRAPHIC_PNG"}
+
+PutFile Response RPC as any other Response RPC in MOBILE_API.xml must have resultCode (with values from provided enum) and success (with value of type boolean) parameters and optional info parameter (with value of type string). PutFile Response RPC also has mandatory parameter spaceAvailable with value of type Integer in range from 0 to 2000000000.
+Hence, Json string for PutFile Response RPC can look like follows:
+{"resultCode":"SUCCESS","spaceAvailable":104845882,"success":true}
+for successful execution of RPC.
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
new file mode 100644
index 0000000000..4580edd940
--- /dev/null
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -0,0 +1,4898 @@
+<?xml version="1.0" standalone="no"?>
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+
+<interface name="Ford Sync RAPI" version="2.1B" date="2013-05-30">
+
+ <enum name="Result" internal_scope="base">
+ <element name="SUCCESS">
+ <description>The request succeeded</description>
+ </element>
+ <element name="UNSUPPORTED_REQUEST">
+ <description>The request is not supported by Sync</description>
+ </element>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>
+ A button that was requested for subscription is not supported under the current system.
+ NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHIVLE_DATA_NOT_AVAILABLE.
+ </description>
+ </element>
+ <element name="DISALLOWED">
+ <description>RPC is not authorized in local policy table.</description>
+ </element>
+ <element name="REJECTED">
+ <description>
+ The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.
+ Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.
+ </description>
+ </element>
+ <element name="ABORTED">
+ <description>
+ A command was aborted, for example due to user interaction (e.g. user pressed button).
+ Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.
+ </description>
+ </element>
+ <element name="IGNORED">
+ <description>
+ A command was ignored, because the intended result is already in effect.
+ For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.
+ NOTE: potentially replaces SUBSCRIBED_ALREADY
+ </description>
+ </element>
+ <element name="RETRY">
+ <description>The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC.</description>
+ </element>
+ <element name="IN_USE">
+ <description>
+ The data may not be changed, because it is currently in use.
+ For example when trying to delete a command set that is currently involved in an interaction.
+ </description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE">
+ <description>The requested vehicle data is not available on this vehicle or is not published.</description>
+ </element>
+ <element name="TIMED_OUT">
+ <description>Overlay reached the maximum timeout and closed.</description>
+ </element>
+ <element name="INVALID_DATA">
+ <description>
+ The data sent is invalid. For example:
+ Invalid Json syntax
+ Parameters out of bounds (number or enum range)
+ Mandatory parameters not provided
+ Parameter provided with wrong type
+ Invalid characters
+ Empty string
+ </description>
+ </element>
+ <element name="CHAR_LIMIT_EXCEEDED"/>
+ <element name="INVALID_ID">
+ <description>
+ One of the provided IDs is not valid. For example
+ This applies to CorrelationID, SubscriptionID [@TODO if SubscriptionID is used], CommandID, MenuID, [@TODO: missed one?]
+ </description>
+ </element>
+ <element name="DUPLICATE_NAME">
+ <description>There was a conflict with an registered name (application or menu item) or vr command</description>
+ </element>
+ <element name="APPLICATION_NOT_REGISTERED">
+ <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
+ </element>
+ <element name="WRONG_LANGUAGE">
+ <description>
+ The requested language is currently not supported.
+ Might be because of a mismatch of the currently active language on Sync and the requested language
+ </description>
+ </element>
+ <element name="OUT_OF_MEMORY">
+ <description>The system could not process the request because the necessary memory couldn't be allocated</description>
+ </element>
+ <element name="TOO_MANY_PENDING_REQUESTS">
+ <description>There are too many requests pending (means, that the response has not been delivered, yet).</description>
+ <designdescription>There may be a maximum of 1000 pending requests at a time.</designdescription>
+ </element>
+ <element name="TOO_MANY_APPLICATIONS">
+ <description>There are already too many registered applications</description>
+ </element>
+ <element name="APPLICATION_REGISTERED_ALREADY">
+ <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
+ </element>
+ <element name="WARNINGS">
+ <description>The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure.</description>
+ </element>
+ <element name="GENERIC_ERROR">
+ <description>Provided data is valid but something went wrong in the lower layers.</description>
+ </element>
+ <element name="USER_DISALLOWED">
+ <description>RPC is included in a functional group explicitly blocked by the user.</description>
+ </element>
+ <element name="UNSUPPORTED_VERSION">
+ <description>Sync doesn't support the protocol that is requested by the mobile application</description>
+ </element>
+ <element name="VEHICLE_DATA_NOT_ALLOWED">
+ <description>The user has turned off access to vehicle data, and it is globally unavailable to mobile applications.</description>
+ </element>
+ <element name="FILE_NOT_FOUND">
+ <description>A specified file could not be found on Sync.</description>
+ </element>
+ <element name="CANCEL_ROUTE">
+ <description>User selected to Cancel Route.</description>
+ </element>
+ <element name="TRUNCATED_DATA">
+ <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
+ </element>
+ <element name="SAVED">
+ <description>The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value.</description>
+ </element>
+ <element name="INVALID_CERT">
+ <description>The certificate provided during authentication is invalid.</description>
+ </element>
+ <element name="EXPIRED_CERT">
+ <description>The certificate provided during authentication is expired.</description>
+ </element>
+ <element name="RESUME_FAILED">
+ <description>The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data.</description>
+ </element>
+ </enum>
+
+ <enum name="ButtonPressMode">
+ <element name="LONG">
+ <description>
+ A button was released, after it was pressed for a long time
+ Actual timing is defined by Sync and may vary
+ </description>
+ </element>
+ <element name="SHORT">
+ <description>
+ A button was released, after it was pressed for a short time
+ Actual timing is defined by Sync and may vary
+ </description>
+ </element>
+ </enum>
+
+ <enum name="ButtonEventMode">
+ <element name="BUTTONUP">
+ <description>A button has been released up</description>
+ </element>
+ <element name="BUTTONDOWN">
+ <description>A button has been pressed down</description>
+ </element>
+ </enum>
+
+ <enum name="Language">
+ <element name="EN-US" internal_name="EN_US">
+ <description>English - US</description>
+ </element>
+ <element name="ES-MX" internal_name="ES_MX">
+ <description>Spanish - Mexico</description>
+ </element>
+ <element name="FR-CA" internal_name="FR_CA">
+ <description>French - Canada</description>
+ </element>
+ <element name="DE-DE" internal_name="DE_DE">
+ <description>German - Germany</description>
+ </element>
+ <element name="ES-ES" internal_name="ES_ES">
+ <description>Spanish - Spain</description>
+ </element>
+ <element name="EN-GB" internal_name="EN_GB">
+ <description>English - GB</description>
+ </element>
+ <element name="RU-RU" internal_name="RU_RU">
+ <description>Russian - Russia</description>
+ </element>
+ <element name="TR-TR" internal_name="TR_TR">
+ <description>Turkish - Turkey</description>
+ </element>
+ <element name="PL-PL" internal_name="PL_PL">
+ <description>Polish - Poland</description>
+ </element>
+ <element name="FR-FR" internal_name="FR_FR">
+ <description>French - France</description>
+ </element>
+ <element name="IT-IT" internal_name="IT_IT">
+ <description>Italian - Italy</description>
+ </element>
+ <element name="SV-SE" internal_name="SV_SE">
+ <description>Swedish - Sweden</description>
+ </element>
+ <element name="PT-PT" internal_name="PT_PT">
+ <description>Portuguese - Portugal</description>
+ </element>
+ <element name="NL-NL" internal_name="NL_NL">
+ <description>Dutch (Standard) - Netherlands</description>
+ </element>
+ <element name="EN-AU" internal_name="EN_AU">
+ <description>English - Australia</description>
+ </element>
+ <element name="ZH-CN" internal_name="ZH_CN">
+ <description>Mandarin - China</description>
+ </element>
+ <element name="ZH-TW" internal_name="ZH_TW">
+ <description>Mandarin - Taiwan</description>
+ </element>
+ <element name="JA-JP" internal_name="JA_JP">
+ <description>Japanese - Japan</description>
+ </element>
+ <element name="AR-SA" internal_name="AR_SA">
+ <description>Arabic - Saudi Arabia</description>
+ </element>
+ <element name="KO-KR" internal_name="KO_KR">
+ <description>Korean - South Korea</description>
+ </element>
+ <element name="PT-BR" internal_name="PT_BR">
+ <description>Portuguese - Brazil</description>
+ </element>
+ <element name="CS-CZ" internal_name="CS_CZ">
+ <description>Czech - Czech Republic</description>
+ </element>
+ <element name="DA-DK" internal_name="DA_DK">
+ <description>Danish - Denmark</description>
+ </element>
+ <element name="NO-NO" internal_name="NO_NO">
+ <description>Norwegian - Norway</description>
+ </element>
+</enum>
+
+ <enum name="UpdateMode">
+ <description>Describes how the media clock timer should behave on the platform</description>
+ <element name="COUNTUP" />
+ <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
+ <element name="COUNTDOWN" />
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ <element name="PAUSE" />
+ <description>Pauses the media clock timer</description>
+ <element name="RESUME" />
+ <description>Resume the media clock timer</description>
+ <element name="CLEAR" />
+ <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
+ </enum>
+
+ <enum name="TimerMode">
+ <element name="UP" />
+ <description>Causes the media clock timer to update from 0:00 to a specified time</description>
+ <element name="DOWN" />
+ <description>Causes the media clock timer to update from a specified time to 0:00</description>
+ <element name="NONE" />
+ <description>Indicates to not use the media clock timer</description>
+ </enum>
+
+ <enum name="InteractionMode">
+ <description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
+ <element name="MANUAL_ONLY" />
+ <description>
+ This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display.
+ Selections are made with the OK and Seek Right and Left, Tune Up and Down buttons.
+ </description>
+ <element name="VR_ONLY" />
+ <description>
+ This mode causes the interaction to only occur using V4.
+ Selections are made by saying the command.
+ </description>
+ <element name="BOTH" />
+ <description>
+ This mode causes both a VR and display selection option for an interaction.
+ Selections can be made either from the menu display or by speaking the command.
+ </description>
+ </enum>
+
+ <enum name="LayoutMode">
+ <description>For touchscreen interactions, the mode of how the choices are presented.</description>
+ <element name="ICON_ONLY" />
+ <description>
+ This mode causes the interaction to display the previous set of choices as icons.
+ </description>
+ <element name="ICON_WITH_SEARCH" />
+ <description>
+ This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.
+ </description>
+ <element name="LIST_ONLY" />
+ <description>
+ This mode causes the interaction to display the previous set of choices as a list.
+ </description>
+ <element name="LIST_WITH_SEARCH" />
+ <description>
+ This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.
+ </description>
+ <element name="KEYBOARD" />
+ <description>
+ This mode causes the interaction to immediately display a keyboard entry through the HMI.
+ </description>
+ </enum>
+
+ <enum name="HMILevel">
+ <description>Enumeraction that describes current levels of HMI.</description>
+ <element name="FULL" internal_name="HMI_FULL" />
+ <element name="LIMITED" internal_name="HMI_LIMITED" />
+ <element name="BACKGROUND" internal_name="HMI_BACKGROUND" />
+ <element name="NONE" internal_name="HMI_NONE" />
+ </enum>
+
+ <enum name="AudioStreamingState">
+ <description>Enumeraction that describes possible states of audio streaming.</description>
+ <element name="AUDIBLE" />
+ <element name="ATTENUATED" />
+ <element name="NOT_AUDIBLE" />
+ </enum>
+
+ <enum name="SystemAction">
+ <description>Enumeration that describes system actions that can be triggered.</description>
+ <element name="DEFAULT_ACTION">
+ <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
+ </element>
+ <element name="STEAL_FOCUS">
+ <description>App is brought into HMI_FULL.</description>
+ </element>
+ <element name="KEEP_CONTEXT">
+ <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
+ </element>
+ </enum>
+
+ <enum name="SystemContext">
+ <description>Enumeration that describes possible contexts an app's HMI might be in.</description>
+ <description>Communicated to whichever app is in HMI FULL, except Alert.</description>
+ <element name="MAIN" internal_name="SYSCTXT_MAIN">
+ <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
+ </element>
+ <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
+ <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
+ </element>
+ <element name="MENU" internal_name="SYSCTXT_MENU">
+ <description>The system is currently displaying an in-App menu onscreen.</description>
+ </element>
+ <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
+ <description>The app's display HMI is currently being obscured by either a system or other app's overlay.</description>
+ </element>
+ <element name="ALERT" internal_name="SYSCTXT_ALERT">
+ <description>Broadcast only to whichever app has an alert currently being displayed.</description>
+ </element>
+ </enum>
+
+ <enum name="SoftButtonType">
+ <description>Contains information about the SoftButton capabilities.</description>
+ <element name="TEXT" internal_name="SBT_TEXT"/>
+ <element name="IMAGE" internal_name="SBT_IMAGE"/>
+ <element name="BOTH" internal_name="SBT_BOTH"/>
+ </enum>
+
+ <enum name="AppInterfaceUnregisteredReason">
+ <description>Error code, which comes from sync side.</description>
+ <element name="USER_EXIT" />
+ <element name="IGNITION_OFF" />
+ <element name="BLUETOOTH_OFF" />
+ <element name="USB_DISCONNECTED" />
+ <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL" />
+ <element name="TOO_MANY_REQUESTS" />
+ <element name="DRIVER_DISTRACTION_VIOLATION" />
+ <element name="LANGUAGE_CHANGE" />
+ <element name="MASTER_RESET" />
+ <element name="FACTORY_DEFAULTS" />
+ <element name="APP_UNAUTHORIZED" />
+ <element name="PROTOCOL_VIOLATION" />
+ </enum>
+
+ <enum name="TriggerSource">
+ <description>Indicates the source from where the command was triggered.</description>
+ <element name="MENU" internal_name="TS_MENU" />
+ <element name="VR" internal_name="TS_VR" />
+ <element name="KEYBOARD" internal_name="TS_KEYBOARD" />
+ </enum>
+
+ <enum name="HmiZoneCapabilities">
+ <description>Contains information about the HMI zone capabilities.</description>
+ <description>For future use.</description>
+ <element name="FRONT" />
+ <element name="BACK" />
+ </enum>
+
+ <enum name="SpeechCapabilities">
+ <description>Contains information about the TTS capabilities.</description>
+ <element name="TEXT" internal_name="SC_TEXT"/>
+ <element name="SAPI_PHONEMES" />
+ <element name="LHPLUS_PHONEMES" />
+ <element name="PRE_RECORDED" />
+ <element name="SILENCE" />
+ </enum>
+
+ <enum name="VrCapabilities">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="TEXT" internal_name="VR_TEXT"/>
+ </enum>
+
+ <enum name="PrerecordedSpeech">
+ <description>Contains a list of prerecorded speech items present on the platform.</description>
+ <element name="HELP_JINGLE" />
+ <element name="INITIAL_JINGLE" />
+ <element name="LISTEN_JINGLE" />
+ <element name="POSITIVE_JINGLE" />
+ <element name="NEGATIVE_JINGLE" />
+ </enum>
+
+ <enum name="SamplingRate">
+ <description>Describes different sampling options for PerformAudioPassThru.</description>
+ <element name="8KHZ" internal_name="SamplingRate_8KHZ"/>
+ <element name="16KHZ" internal_name="SamplingRate_16KHZ"/>
+ <element name="22KHZ" internal_name="SamplingRate_22KHZ"/>
+ <element name="44KHZ" internal_name="SamplingRate_44KHZ"/>
+ </enum>
+
+ <enum name="BitsPerSample">
+ <description>Describes different quality options for PerformAudioPassThru.</description>
+ <element name="8_BIT" internal_name="BitsPerSample_8_BIT"/>
+ <element name="16_BIT" internal_name="BitsPerSample_16_BIT"/>
+ </enum>
+
+ <enum name="AudioType">
+ <description>Describes different audio type options for PerformAudioPassThru.</description>
+ <element name="PCM" />
+ </enum>
+
+ <struct name="AudioPassThruCapabilities">
+ <description>Describes different audio type configurations for PerformAudioPassThru.</description>
+ <description>e.g. {8kHz,8-bit,PCM}</description>
+ <param name="samplingRate" type="SamplingRate"/>
+ <param name="bitsPerSample" type="BitsPerSample"/>
+ <param name="audioType" type="AudioType"/>
+ </struct>
+
+ <enum name="VehicleDataType">
+ <description>Defines the data types that can be published and subscribed to.</description>
+ <element name="VEHICLEDATA_GPS">
+ <description>Notifies GPSData may be subscribed</description>
+ </element>
+ <element name="VEHICLEDATA_SPEED" />
+ <element name="VEHICLEDATA_RPM" />
+ <element name="VEHICLEDATA_FUELLEVEL" />
+ <element name="VEHICLEDATA_FUELLEVEL_STATE" />
+ <element name="VEHICLEDATA_FUELCONSUMPTION" />
+ <element name="VEHICLEDATA_EXTERNTEMP" />
+ <element name="VEHICLEDATA_VIN" />
+ <element name="VEHICLEDATA_PRNDL" />
+ <element name="VEHICLEDATA_TIREPRESSURE" />
+ <element name="VEHICLEDATA_ODOMETER" />
+ <element name="VEHICLEDATA_BELTSTATUS" />
+ <element name="VEHICLEDATA_BODYINFO" />
+ <element name="VEHICLEDATA_DEVICESTATUS" />
+ <element name="VEHICLEDATA_ECALLINFO" />
+ <element name="VEHICLEDATA_AIRBAGSTATUS" />
+ <element name="VEHICLEDATA_EMERGENCYEVENT" />
+ <element name="VEHICLEDATA_CLUSTERMODESTATUS" />
+ <element name="VEHICLEDATA_MYKEY" />
+ <element name="VEHICLEDATA_BRAKING" />
+ <element name="VEHICLEDATA_WIPERSTATUS" />
+ <element name="VEHICLEDATA_HEADLAMPSTATUS" />
+ <element name="VEHICLEDATA_BATTVOLTAGE" />
+ <element name="VEHICLEDATA_ENGINETORQUE" />
+ <element name="VEHICLEDATA_ACCPEDAL" />
+ <element name="VEHICLEDATA_STEERINGWHEEL" />
+ </enum>
+
+ <enum name="ButtonName">
+ <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
+ <element name="OK" />
+ <element name="SEEKLEFT" />
+ <element name="SEEKRIGHT" />
+ <element name="TUNEUP" />
+ <element name="TUNEDOWN" />
+ <element name="PRESET_0" />
+ <element name="PRESET_1" />
+ <element name="PRESET_2" />
+ <element name="PRESET_3" />
+ <element name="PRESET_4" />
+ <element name="PRESET_5" />
+ <element name="PRESET_6" />
+ <element name="PRESET_7" />
+ <element name="PRESET_8" />
+ <element name="PRESET_9" />
+ <element name="CUSTOM_BUTTON" />
+ <element name="SEARCH" />
+ </enum>
+
+ <enum name="MediaClockFormat">
+ <element name="CLOCK1">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
+ used for Type II and CID headunits
+ </description>
+ </element>
+ <element name="CLOCK2">
+ <description>
+ minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
+ used for Type V headunit
+ </description>
+ </element>
+ <element name="CLOCK3">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
+ used for GEN1.1 MFD3/4/5 headunits
+ </description>
+ </element>
+ <element name="CLOCKTEXT1">
+ <description>
+ 5 characters possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]]
+ :|sp : colon or space
+ used for Type II headunit
+ </description>
+ </element>
+ <element name="CLOCKTEXT2">
+ <description>
+ 5 chars possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]]
+ :|sp : colon or space
+ used for CID headunit
+ NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set
+ </description>
+ </element>
+ <element name="CLOCKTEXT3">
+ <description>
+ 6 chars possible
+ Format: 1|sp c c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref]
+ :|sp : colon or space
+ used for Type V headunit
+ </description>
+ </element>
+ <element name="CLOCKTEXT4">
+ <description>
+ 6 chars possible
+ Format: c :|sp c c : c c
+ :|sp : colon or space
+ c : character out of following character set: sp|0-9|[letters].
+ used for GEN1.1 MFD3/4/5 headunits
+ </description>
+ </element>
+ </enum>
+
+ <enum name="DisplayType">
+ <description>See DAES for further infos regarding the displays</description>
+ <element name="CID"/>
+ <element name="TYPE2" />
+ <element name="TYPE5" />
+ <element name="NGN" />
+ <element name="GEN2_8_DMA" />
+ <element name="GEN2_6_DMA" />
+ <element name="MFD3" />
+ <element name="MFD4" />
+ <element name="MFD5" />
+ <element name="GEN3_8-INCH" internal_name="GEN3_8_INCH" />
+ </enum>
+
+ <enum name="TextFieldName">
+ <element name="mainField1">
+ <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="mainField2">
+ <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="mainField3">
+ <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="mainField4">
+ <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+
+ <element name="statusBar">
+ <description>The status bar on NGN; applies to "Show"</description>
+ </element>
+
+ <element name="mediaClock">
+ <description>Text value for MediaClock field; applies to "Show"</description>
+ </element>
+
+ <element name="mediaTrack">
+ <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
+ </element>
+
+ <element name="alertText1">
+ <description>The first line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="alertText2">
+ <description>The second line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="alertText3">
+ <description>The third line of the alert text field; applies to "Alert"</description>
+ </element>
+
+ <element name="scrollableMessageBody">
+ <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
+ </element>
+
+ <element name="initialInteractionText">
+ <description> First line suggestion for a user response (in the case of VR enabled interaction)</description>
+ </element>
+
+ <element name="navigationText1">
+ <description> First line of navigation text</description>
+ </element>
+
+ <element name="navigationText2">
+ <description> Second line of navigation text</description>
+ </element>
+
+ <element name="ETA">
+ <description> Estimated Time of Arrival time for navigation</description>
+ </element>
+
+ <element name="totalDistance">
+ <description> Total distance to destination for navigation</description>
+ </element>
+
+ <element name="audioPassThruDisplayText1">
+ <description> First line of text for audio pass thru</description>
+ </element>
+
+ <element name="audioPassThruDisplayText2">
+ <description> Second line of text for audio pass thru</description>
+ </element>
+
+ <element name="sliderHeader">
+ <description> Header text for slider</description>
+ </element>
+
+ <element name="sliderFooter">
+ <description> Footer text for slider</description>
+ </element>
+
+ <element name="menuName">
+ <description> Primary text for Choice</description>
+ </element>
+
+ <element name="secondaryText">
+ <description> Secondary text for Choice</description>
+ </element>
+
+ <element name="tertiaryText">
+ <description> Tertiary text for Choice</description>
+ </element>
+
+ <element name="menuTitle">
+ <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </element>
+
+ <element name="timeToDestination">
+ <description> Time to destination</description>
+ </element>
+
+ <element name="navigationText">
+ <description>Navigation text for UpdateTurnList.</description>
+ </element>
+
+ <element name="notificationText">
+ <description> Footer text for slider</description>
+ </element>
+
+ <element name="turnText">
+ <description> Turn text</description>
+ </element>
+
+ </enum>
+
+ <enum name="ImageFieldName">
+ <element name="softButtonImage">
+ <description>The image field for SoftButton</description>
+ </element>
+
+ <element name="choiceImage">
+ <description>The first image field for Choice</description>
+ </element>
+
+ <element name="choiceSecondaryImage">
+ <description>The secondary image field for Choice</description>
+ </element>
+
+ <element name="vrHelpItem">
+ <description>The image field for vrHelpItem</description>
+ </element>
+
+ <element name="turnIcon">
+ <description>The image field for Turn</description>
+ </element>
+
+ <element name="menuIcon">
+ <description>The image field for the menu icon in SetGlobalProperties</description>
+ </element>
+
+ <element name="cmdIcon">
+ <description>The image field for AddCommand</description>
+ </element>
+
+ <element name="appIcon">
+ <description>The image field for the app icon (set by setAppIcon)</description>
+ </element>
+
+ <element name="graphic">
+ <description>The image field for Show</description>
+ </element>
+
+ <element name="showConstantTBTIcon">
+ <description>The primary image field for ShowConstantTBT</description>
+ </element>
+
+ <element name="showConstantTBTNextTurnIcon">
+ <description>The secondary image field for ShowConstantTBT</description>
+ </element>
+
+ <element name="locationImage">
+ <description>The optional image of a destination / location</description>
+ </element>
+ </enum>
+
+ <enum name="PredefinedLayout" platform="documentation">
+ <description>Predefined screen layout.</description>
+
+ <element name="DEFAULT" rootscreen="true">
+ <description>
+ Default media / non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="MEDIA" rootscreen="true">
+ <description>
+ Default Media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NON-MEDIA" internal_name="NON_MEDIA" rootscreen="true">
+ <description>
+ Default Non-media screen.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="ONSCREEN_PRESETS" rootscreen="true">
+ <description>
+ Custom root media screen containing app-defined onscreen presets.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_FULLSCREEN_MAP" rootscreen="true">
+ <description>
+ Custom root template screen containing full screen map with navigation controls.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_LIST" rootscreen="true">
+ <description>
+ Custom root template screen containing video represented list.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="NAV_KEYBOARD" rootscreen="true">
+ <description>
+ Custom root template screen containing video represented keyboard.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with lines of text.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing lines of text with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only text SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TILES" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with tiled SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TILES_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing tiled SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text and SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="GRAPHIC_WITH_TEXTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing half-screen graphic with text only SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="TEXTBUTTONS_WITH_GRAPHIC" rootscreen="true">
+ <description>
+ Custom root template screen containing text only SoftButtons with half-screen graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing a large graphic and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="DOUBLE_GRAPHIC_WITH_SOFTBUTTONS" rootscreen="true">
+ <description>
+ Custom root template screen containing two graphics and SoftButtons.
+ Can be set as a root screen.
+ </description>
+ </element>
+ <element name="LARGE_GRAPHIC_ONLY" rootscreen="true">
+ <description>
+ Custom root template screen containing only a large graphic.
+ Can be set as a root screen.
+ </description>
+ </element>
+ </enum>
+
+ <enum name="CharacterSet">
+ <description>The list of potential character sets</description>
+ <element name="TYPE2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="TYPE5SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID1SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ </enum>
+
+ <enum name="TextAlignment">
+ <description>The list of possible alignments, left, right, or centered</description>
+ <element name="LEFT_ALIGNED" />
+ <element name="RIGHT_ALIGNED" />
+ <element name="CENTERED" />
+ </enum>
+
+ <enum name="TBTState">
+ <description>Enumeration that describes possible states of turn-by-turn client or AppLink app.</description>
+ <element name="ROUTE_UPDATE_REQUEST" />
+ <element name="ROUTE_ACCEPTED" />
+ <element name="ROUTE_REFUSED" />
+ <element name="ROUTE_CANCELLED" />
+ <element name="ETA_REQUEST" />
+ <element name="NEXT_TURN_REQUEST" />
+ <element name="ROUTE_STATUS_REQUEST" />
+ <element name="ROUTE_SUMMARY_REQUEST" />
+ <element name="TRIP_STATUS_REQUEST" />
+ <element name="ROUTE_UPDATE_REQUEST_TIMEOUT" />
+ </enum>
+
+ <enum name="DriverDistractionState">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON" />
+ <element name="DD_OFF" />
+ </enum>
+
+ <enum name="ImageType">
+ <description>Contains information about the type of image.</description>
+ <element name="STATIC" />
+ <element name="DYNAMIC" />
+ </enum>
+
+ <struct name="Image">
+ <param name="value" minlength="0" maxlength="65535" type="String">
+ <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
+ </param>
+ <param name="imageType" type="ImageType">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="SoftButton">
+ <param name="type" type="SoftButtonType">
+ <description>Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType</description>
+ </param>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to display (if defined as TEXT or BOTH)</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
+ </param>
+ <param name="isHighlighted" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ True, if highlighted
+ False, if not highlighted
+ </description>
+ </param>
+ <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535">
+ <description>Value which is returned via OnButtonPress / OnButtonEvent</description>
+ </param>
+ <param name="systemAction" type="SystemAction" defvalue="DEFAULT_ACTION" mandatory="false">
+ <description>Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.</description>
+ </param>
+ </struct>
+
+ <struct name="Choice">
+ <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="menuName" type="String" maxlength="500" />
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" />
+ <param name="image" type="Image" mandatory="false"/>
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
+ </param>
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
+ </param>
+ <param name="secondaryImage" type="Image" mandatory="false">
+ <description>Optional secondary image struct for choice</description>
+ </param>
+ </struct>
+
+ <struct name="VrHelpItem">
+ <param name="text" maxlength="500" type="String">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100">
+ <description>Position to display item in VR Help list</description>
+ </param>
+ </struct>
+
+ <struct name="SyncMsgVersion">
+ <description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
+
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
+ <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
+ </param>
+ </struct>
+
+ <enum name="GlobalProperty">
+ <description>The different global properties.</description>
+ <element name="HELPPROMPT">
+ <description>The property helpPrompt of setGlobalProperties</description>
+ </element>
+ <element name="TIMEOUTPROMPT">
+ <description>The property timeoutPrompt of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPTITLE">
+ <description>The property vrHelpTitle of setGlobalProperties</description>
+ </element>
+ <element name="VRHELPITEMS">
+ <description>The property array of vrHelp of setGlobalProperties</description>
+ </element>
+ <element name="MENUNAME">
+ <description>The property in-app menu name of setGlobalProperties</description>
+ </element>
+ <element name="MENUICON">
+ <description>The property in-app menu icon of setGlobalProperties</description>
+ </element>
+ <element name="KEYBOARDPROPERTIES">
+ <description>The on-screen keyboard configuration of setGlobalProperties</description>
+ </element>
+ </enum>
+
+ <enum name="CompassDirection">
+ <description>The list of potential compass directions</description>
+ <element name="NORTH">
+ </element>
+ <element name="NORTHWEST">
+ </element>
+ <element name="WEST">
+ </element>
+ <element name="SOUTHWEST">
+ </element>
+ <element name="SOUTH">
+ </element>
+ <element name="SOUTHEAST">
+ </element>
+ <element name="EAST">
+ </element>
+ <element name="NORTHEAST">
+ </element>
+ </enum>
+
+ <enum name="Dimension">
+ <description>The supported dimensions of the GPS</description>
+ <element name="NO_FIX" internal_name="Dimension_NO_FIX">
+ <description>No GPS at all</description>
+ </element>
+ <element name="2D" internal_name="Dimension_2D">
+ <description>Longitude and lattitude</description>
+ </element>
+ <element name="3D" internal_name="Dimension_3D">
+ <description>Longitude and lattitude and altitude</description>
+ </element>
+ </enum>
+
+ <enum name="PRNDL">
+ <description>The selected gear.</description>
+ <element name="PARK">
+ <description>Parking</description>
+ </element>
+ <element name="REVERSE">
+ <description>Reverse gear</description>
+ </element>
+ <element name="NEUTRAL">
+ <description>No gear</description>
+ </element>
+ <element name="DRIVE">
+ </element>
+ <element name="SPORT">
+ <description>Drive Sport mode</description>
+ </element>
+ <element name="LOWGEAR">
+ <description>1st gear hold</description>
+ </element>
+ <element name="FIRST">
+ </element>
+ <element name="SECOND">
+ </element>
+ <element name="THIRD">
+ </element>
+ <element name="FOURTH">
+ </element>
+ <element name="FIFTH">
+ </element>
+ <element name="SIXTH">
+ </element>
+ <element name="SEVENTH">
+ </element>
+ <element name="EIGHTH">
+ </element>
+ <element name="UNKNOWN">
+ </element>
+ <element name="FAULT">
+ </element>
+ </enum>
+
+ <enum name="ComponentVolumeStatus">
+ <description>The volume status of a vehicle component.</description>
+ <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
+ </element>
+ <element name="NORMAL" internal_name="CVS_NORMAL">
+ </element>
+ <element name="LOW" internal_name="CVS_LOW">
+ </element>
+ <element name="FAULT" internal_name="CVS_FAULT">
+ </element>
+ <element name="ALERT" internal_name="CVS_ALERT">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
+ </element>
+ </enum>
+
+ <struct name="SingleTireStatus">
+ <param name="status" type="ComponentVolumeStatus">
+ <description>See ComponentVolumeStatus.</description>
+ </param>
+ </struct>
+
+ <enum name="WarningLightStatus">
+ <description>Reflects the status of a cluster instrument warning light.</description>
+ <element name="OFF" internal_name="WLS_OFF">
+ </element>
+ <element name="ON" internal_name="WLS_ON">
+ </element>
+ <element name="FLASH" internal_name="WLS_FLASH">
+ </element>
+ <element name="NOT_USED" internal_name="WLS_NOT_USED">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataNotificationStatus">
+ <description>Reflects the status of a vehicle data notification.</description>
+ <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
+ </element>
+ <element name="NORMAL" internal_name="VDNS_NORMAL">
+ </element>
+ <element name="ACTIVE" internal_name="VDNS_ACTIVE">
+ </element>
+ <element name="NOT_USED" internal_name="VDNS_NOT_USED">
+ </element>
+ </enum>
+
+ <enum name="IgnitionStableStatus">
+ <description>Reflects the ignition switch stability.</description>
+ <element name="IGNITION_SWITCH_NOT_STABLE">
+ </element>
+ <element name="IGNITION_SWITCH_STABLE">
+ </element>
+ <element name="MISSING_FROM_TRANSMITTER">
+ </element>
+ </enum>
+
+ <enum name="IgnitionStatus">
+ <description>Reflects the status of ignition.</description>
+ <element name="UNKNOWN" internal_name="IS_UNKNOWN">
+ </element>
+ <element name="OFF" internal_name="IS_OFF">
+ </element>
+ <element name="ACCESSORY" internal_name="IS_ACCESSORY">
+ </element>
+ <element name="RUN" internal_name="IS_RUN">
+ </element>
+ <element name="START" internal_name="IS_START">
+ </element>
+ <element name="INVALID" internal_name="IS_INVALID">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataEventStatus">
+ <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
+ <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
+ </element>
+ <element name="NO" internal_name="VDES_NO">
+ </element>
+ <element name="YES" internal_name="VDES_YES">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="VDES_FAULT">
+ </element>
+ </enum>
+
+ <enum name="DeviceLevelStatus">
+ <description>Reflects the reported battery status of the connected device, if reported.</description>
+ <element name="ZERO_LEVEL_BARS">
+ </element>
+ <element name="ONE_LEVEL_BARS">
+ </element>
+ <element name="TWO_LEVEL_BARS">
+ </element>
+ <element name="THREE_LEVEL_BARS">
+ </element>
+ <element name="FOUR_LEVEL_BARS">
+ </element>
+ <element name="NOT_PROVIDED">
+ </element>
+ </enum>
+
+ <enum name="PrimaryAudioSource">
+ <description>Reflects the current primary audio source (if selected).</description>
+ <element name="NO_SOURCE_SELECTED">
+ </element>
+ <element name="USB">
+ </element>
+ <element name="USB2">
+ </element>
+ <element name="BLUETOOTH_STEREO_BTST">
+ </element>
+ <element name="LINE_IN">
+ </element>
+ <element name="IPOD">
+ </element>
+ <element name="MOBILE_APP">
+ </element>
+ </enum>
+
+ <enum name="WiperStatus">
+ <description>Reflects the status of the wipers.</description>
+ <element name="OFF" />
+ <element name="AUTO_OFF" />
+ <element name="OFF_MOVING" />
+ <element name="MAN_INT_OFF" />
+ <element name="MAN_INT_ON" />
+ <element name="MAN_LOW" />
+ <element name="MAN_HIGH" />
+ <element name="MAN_FLICK" />
+ <element name="WASH" />
+ <element name="AUTO_LOW" />
+ <element name="AUTO_HIGH" />
+ <element name="COURTESYWIPE" />
+ <element name="AUTO_ADJUST" />
+ <element name="STALLED" />
+ <element name="NO_DATA_EXISTS" />
+ </enum>
+
+ <enum name="VehicleDataStatus">
+ <description>Reflects the status of a binary vehicle data item.</description>
+ <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
+ </element>
+ <element name="OFF" internal_name="VDS_OFF">
+ </element>
+ <element name="ON" internal_name="VDS_ON">
+ </element>
+ </enum>
+
+ <enum name="MaintenanceModeStatus">
+ <description>Reflects the status of a vehicle maintenance mode.</description>
+ <element name="NORMAL" internal_name="MMS_NORMAL">
+ </element>
+ <element name="NEAR" internal_name="MMS_NEAR">
+ </element>
+ <element name="ACTIVE" internal_name="MMS_ACTIVE">
+ </element>
+ <element name="FEATURE_NOT_PRESENT" internal_name="MMS_FEATURE_NOT_PRESENT">
+ </element>
+ </enum>
+
+ <enum name="VehicleDataActiveStatus">
+ <description>Reflects the status of given vehicle component.</description>
+ <element name="INACTIVE_NOT_CONFIRMED" internal_name="VDAS_INACTIVE_NOT_CONFIRMED">
+ </element>
+ <element name="INACTIVE_CONFIRMED" internal_name="VDAS_INACTIVE_CONFIRMED">
+ </element>
+ <element name="ACTIVE_NOT_CONFIRMED" internal_name="VDAS_ACTIVE_NOT_CONFIRMED">
+ </element>
+ <element name="ACTIVE_CONFIRMED" internal_name="VDAS_ACTIVE_CONFIRMED">
+ </element>
+ <element name="FAULT" internal_name="VDAS_FAULT">
+ </element>
+ </enum>
+
+ <enum name="AmbientLightStatus">
+ <description>Reflects the status of the ambient light sensor.</description>
+ <element name="NIGHT" />
+ <element name="TWILIGHT_1" />
+ <element name="TWILIGHT_2" />
+ <element name="TWILIGHT_3" />
+ <element name="TWILIGHT_4" />
+ <element name="DAY" />
+ <element name="UNKNOWN" />
+ <element name="INVALID" />
+ </enum>
+
+ <struct name="BeltStatus">
+ <param name="driverBeltDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus">
+ <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="BodyInformation">
+ <param name="parkBrakeActive" type="Boolean">
+ <description>References signal "PrkBrkActv_B_Actl".</description>
+ </param>
+ <param name="ignitionStableStatus" type="IgnitionStableStatus">
+ <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="IgnitionStatus">
+ <description>References signal "Ignition_status". See IgnitionStatus.</description>
+ </param>
+ <param name="driverDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatDrv_B_Actl".</description>
+ </param>
+ <param name="passengerDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatPsngr_B_Actl".</description>
+ </param>
+ <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRl_B_Actl".</description>
+ </param>
+ <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRr_B_Actl".</description>
+ </param>
+ </struct>
+
+ <struct name="DeviceStatus">
+ <param name="voiceRecOn" type="Boolean">
+ <description>References signal "CPM_VoiceRec_STAT".</description>
+ </param>
+ <param name="btIconOn" type="Boolean">
+ <description>References signal "BT_ICON".</description>
+ </param>
+ <param name="callActive" type="Boolean">
+ <description>References signal "CPM_Call_Active_STAT".</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean">
+ <description>References signal "CPM_Phone_Roaming_STAT".</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean">
+ <description>References signal "CPM_TextMsg_AVAL".</description>
+ </param>
+ <param name="battLevelStatus" type="DeviceLevelStatus">
+ <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean">
+ <description>References signal "CPM_Stereo_Audio_Output".</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean">
+ <description>References signal "CPM_Mono_Audio_Output".</description>
+ </param>
+ <param name="signalLevelStatus" type="DeviceLevelStatus">
+ <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="PrimaryAudioSource">
+ <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean">
+ <description>References signal "eCall_Event".</description>
+ </param>
+ </struct>
+
+ <struct name="HeadLampStatus">
+ <param name="lowBeamsOn" type="Boolean">
+ <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean">
+ <description>Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat".</description>
+ </param>
+ <param name="ambientLightSensorStatus" type="AmbientLightStatus">
+ <description>Status of the ambient light sensor.</description>
+ </param>
+ </struct>
+
+ <struct name="engineInfo">
+ <param name="electricFuelConsumption" type="Float" minvalue="0" maxvalue="30000">
+ <description>
+ Indicates the electric fuel consumption in terms of gasoline equivalent volume to support fuel economy equivalent calculations.
+ Note:Plug-in vehicle use only!
+ References signal "ElFuelFlw_Vl_Dsply".
+ </description>
+ </param>
+ <param name="stateOfCharge" type="Float" minvalue="0" maxvalue="100">
+ <description>Percent state of charge for the high voltage battery. References signal "BattTracSoc_Pc_Dsply".</description>
+ </param>
+ <param name="fuelMaintenanceMode" type="MaintenanceModeStatus">
+ <description>Current status of fuel maintenance mode (if present on hybrid vehicles). References signal "FuelMaintMde_D_Dsply".</description>
+ </param>
+ <param name="distanceToEmpty" type="Float" minvalue="0" maxvalue="1000">
+ <description>
+ Electric range (DTE) in km. References signal "VehElRnge_L_Dsply".
+ 0xFFE = No Data Exists
+ 0xFFF = Fault
+ </description>
+ </param>
+ </struct>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- Ford Specific Data Items -->
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <enum name="FuelCutoffStatus">
+ <description>Reflects the status of the RCM fuel cutoff.</description>
+ <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
+ </element>
+ <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
+ </element>
+ <element name="FAULT" internal_name="FCS_FAULT">
+ </element>
+ </enum>
+
+ <enum name="EmergencyEventType">
+ <description>Reflects the emergency event status of the vehicle.</description>
+ <element name="NO_EVENT" internal_name="EET_NO_EVENT">
+ </element>
+ <element name="FRONTAL" internal_name="EET_FRONTAL">
+ </element>
+ <element name="SIDE" internal_name="EET_SIDE">
+ </element>
+ <element name="REAR" internal_name="EET_REAR">
+ </element>
+ <element name="ROLLOVER" internal_name="EET_ROLLOVER">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="EET_FAULT">
+ </element>
+ </enum>
+
+ <enum name="ECallConfirmationStatus">
+ <description>Reflects the status of the eCall Notification.</description>
+ <element name="NORMAL" internal_name="ECCS_NORMAL">
+ </element>
+ <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
+ </element>
+ <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
+ </element>
+ <element name="CALL_COMPLETED">
+ </element>
+ <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
+ </element>
+ <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
+ </element>
+ <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
+ </element>
+ </enum>
+
+ <struct name="DeviceInfo">
+ <description>Various information abount connecting device.</description>
+
+ <param name="hardware" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device model</description>
+ </param>
+ <param name="firmwareRev" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device firmware revision</description>
+ </param>
+ <param name="os" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS</description>
+ </param>
+ <param name="osVersion" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device OS version</description>
+ </param>
+ <param name="carrier" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Device mobile carrier (if applicable)</description>
+ </param>
+ <param name="maxNumberRFCOMMPorts" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Omitted if connected not via BT.</description>
+ </param>
+
+ </struct>
+
+ <enum name="FileType">
+ <description>Enumeration listing possible file types.</description>
+ <element name="GRAPHIC_BMP" />
+ <element name="GRAPHIC_JPEG" />
+ <element name="GRAPHIC_PNG" />
+ <element name="AUDIO_WAVE" />
+ <element name="AUDIO_MP3" />
+ <element name="AUDIO_AAC" />
+ <element name="BINARY" />
+ <element name="JSON" />
+ </enum>
+
+ <enum name="PowerModeQualificationStatus">
+ <description>Reflects the status of the current power mode qualification.</description>
+ <element name="POWER_MODE_UNDEFINED">
+ </element>
+ <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
+ </element>
+ <element name="NOT_DEFINED">
+ </element>
+ <element name="POWER_MODE_OK">
+ </element>
+ </enum>
+
+ <enum name="PowerModeStatus">
+ <description>Reflects the status of the current power mode.</description>
+ <element name="KEY_OUT">
+ </element>
+ <element name="KEY_RECENTLY_OUT">
+ </element>
+ <element name="KEY_APPROVED_0">
+ </element>
+ <element name="POST_ACCESORY_0">
+ </element>
+ <element name="ACCESORY_1">
+ </element>
+ <element name="POST_IGNITION_1">
+ </element>
+ <element name="IGNITION_ON_2">
+ </element>
+ <element name="RUNNING_2">
+ </element>
+ <element name="CRANK_3">
+ </element>
+ </enum>
+
+ <enum name="CarModeStatus">
+ <description>Reflects the status of the current car mode.</description>
+ <element name="NORMAL" internal_name="CMS_NORMAL">
+ </element>
+ <element name="FACTORY" internal_name="CMS_FACTORY">
+ </element>
+ <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
+ </element>
+ <element name="CRASH" internal_name="CMS_CRASH">
+ </element>
+ </enum>
+
+ <struct name="ECallInfo">
+ <param name="eCallNotificationStatus" type="VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="ECallConfirmationStatus">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="AirbagStatus">
+ <param name="driverAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="EmergencyEvent">
+ <param name="emergencyEventType" type="EmergencyEventType">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="FuelCutoffStatus">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="VehicleDataEventStatus">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+
+ <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255">
+ <description>References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values:
+ 0x00 No event
+ 0xFE Not supported
+ 0xFF Fault
+ </description>
+ </param>
+ <param name="multipleEvents" type="VehicleDataEventStatus">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="ClusterModeStatus">
+ <param name="powerModeActive" type="Boolean">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="CarModeStatus">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="PowerModeStatus">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+ </struct>
+
+ <struct name="MyKey">
+ <param name="e911Override" type="VehicleDataStatus">
+ <description>Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus.</description>
+ </param>
+ </struct>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+<!-- / Ford Specific Data Items -->
+<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <enum name="VehicleDataResultCode">
+ <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
+ <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
+ <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
+ <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
+ <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
+ <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
+ <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
+ <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
+ <element name="IGNORED" internal_name="VDRC_IGNORED"/>
+ </enum>
+
+ <struct name="TireStatus">
+ <description>The status and pressure of the tires.</description>
+
+ <param name="pressureTelltale" type="WarningLightStatus">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="SingleTireStatus">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="SingleTireStatus">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="SingleTireStatus">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="SingleTireStatus">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="SingleTireStatus">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="SingleTireStatus">
+ <description>The status of the inner right rear.</description>
+ </param>
+ </struct>
+
+ <struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="CompassDirection">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
+ <description>PDOP. If undefined or unavailable, then value shall be set to 0.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
+ <description>HDOP. If value is unknown, value shall be set to 0.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" defvalue="0">
+ <description>VDOP. If value is unknown, value shall be set to 0.</description>
+ </param>
+ <param name="actual" type="Boolean">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Dimension">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+
+ <struct name="VehicleDataResult">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="VehicleDataType">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="VehicleDataResultCode">
+ <description>Published data result code.</description>
+ </param>
+ </struct>
+
+ <struct name="DIDResult">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="VehicleDataResultCode">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data from vehicle data DID</description>
+ </param>
+ <param name="data" type="String" maxlength="5000" mandatory="false">
+ <description>Raw DID-based data returned for requested element.</description>
+ </param>
+ </struct>
+
+ <struct name="StartTime">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59">
+ <description>
+ The hour of the media clock.
+ Some radios only support a max of 19 hours. If out of range, it will be rejected.
+ </description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" />
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" />
+ </struct>
+
+ <struct name="TextField">
+ <param name="name" type="TextFieldName">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="CharacterSet">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageResolution">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000">
+ <description>The image resolution height.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageField">
+ <param name="name" type="ImageFieldName">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="FileType" array="true">
+ <description>The image types that are supported in this field. See FileType.</description>
+ </param>
+ <param name="imageResolution" type="ImageResolution">
+ <description>The image resolution of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="TouchCoord">
+ <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The x coordinate of the touch.</description>
+ </param>
+ <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The y coordinate of the touch.</description>
+ </param>
+ </struct>
+
+ <enum name="TouchType">
+ <element name="BEGIN"/>
+ <element name="MOVE"/>
+ <element name="END"/>
+ </enum>
+
+ <struct name="TouchEvent">
+ <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
+ <description>
+ A touch's unique identifier. The application can track the current touch events by id.
+ If a touch event has type begin, the id should be added to the set of touches.
+ If a touch event has type end, the id should be removed from the set of touches.
+ </description>
+ </param>
+ <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
+ <description>
+ The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
+ The timestamp is used to determined the rate of change of position of a touch.
+ The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
+ If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
+ </description>
+ </param>
+ <param name="c" type="TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
+ </param>
+ </struct>
+
+ <struct name="Coordinate">
+ <param name="xCoord" type="Integer" mandatory="true">
+ </param>
+ <param name="yCoord" type="Integer" mandatory="true">
+ </param>
+ </struct>
+
+ <struct name="TouchArea">
+ <param name="rotationAngle" type="Float" mandatory="false" minvalue="0" maxvalue="360">
+ </param>
+ <param name="radiusCoord" type="Coordinate" mandatory="true">
+ </param>
+ </struct>
+
+ <struct name="TouchEventCapabilities">
+ <param name="pressAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="multiTouchAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="doublePressAvailable" type="Boolean" mandatory="true">
+ </param>
+ </struct>
+
+ <struct name="ScreenParams">
+ <param name="resolution" type="ImageResolution" mandatory="true">
+ <description>The resolution of the prescribed screen area.</description>
+ </param>
+ <param name="touchEventAvailable" type="TouchEventCapabilities" mandatory="false">
+ <description>Types of screen touch events available in screen area.</description>
+ </param>
+ </struct>
+
+ <enum name="PermissionStatus">
+ <description>Enumeration that describes possible permission states of a policy table entry.</description>
+ <element name="ALLOWED" internal_name="PS_ALLOWED"/>
+ <element name="DISALLOWED" internal_name="PS_DISALLOWED"/>
+ <element name="USER_DISALLOWED" internal_name="PS_USER_DISALLOWED"/>
+ <element name="USER_CONSENT_PENDING" internal_name="PS_USER_CONSENT_PENDING"/>
+ </enum>
+
+ <struct name="HMIPermissions">
+ <param name="allowed" type="HMILevel" minsize="0" maxsize="100" array="true">
+ <description>A set of all HMI levels that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="HMILevel" minsize="0" maxsize="100" array="true">
+ <description>A set of all HMI levels that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="ParameterPermissions">
+ <param name="allowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
+ <description>A set of all parameters that are permitted for this given RPC.</description>
+ </param>
+ <param name="userDisallowed" type="String" minsize="0" maxsize="100" maxlength = "100" array="true">
+ <description>A set of all parameters that are prohibited for this given RPC.</description>
+ </param>
+ </struct>
+
+ <struct name="PermissionItem">
+ <param name="rpcName" type="String" maxlength="100">
+ <description>Name of the individual RPC in the policy table.</description>
+ </param>
+ <param name="hmiPermissions" type="HMIPermissions" />
+ <param name="parameterPermissions" type="ParameterPermissions" />
+ </struct>
+
+ <struct name="DisplayCapabilities">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="DisplayType">
+ <description>The type of the display. See DisplayType</description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="imageFields" type="ImageField" minsize="1" maxsize="100" array="true">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="0" maxsize="100" array="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="graphicSupported" type="Boolean">
+ <description>The display's persistent screen supports referencing a static or dynamic image.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true">
+ <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
+ </param>
+ <param name="screenParams" type="ScreenParams" mandatory="false">
+ <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
+ </param>
+ </struct>
+
+ <struct name="ButtonCapabilities">
+ <description>Contains information about a button's capabilities.</description>
+ <param name="name" type="ButtonName">
+ <description>The name of the button. See ButtonName.</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="SoftButtonCapabilities">
+ <description>Contains information about a SoftButton's capabilities.</description>
+ <param name="shortPressAvailable" type="Boolean">
+ <description>
+ The button supports a short press.
+ Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.
+ </description>
+ </param>
+ <param name="longPressAvailable" type="Boolean">
+ <description>
+ The button supports a LONG press.
+ Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.
+ </description>
+ </param>
+ <param name="upDownAvailable" type="Boolean">
+ <description>
+ The button supports "button down" and "button up".
+ Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.
+ Whenever the button is released, onButtonEvent( UP) will be invoked.
+ </description>
+ </param>
+ <param name="imageSupported" type="Boolean">
+ <description>The button supports referencing a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="PresetBankCapabilities">
+ <description>Contains information about on-screen preset capabilities.</description>
+ <param name="onScreenPresetsAvailable" type="Boolean">
+ <description>Onscreen custom presets are available.</description>
+ </param>
+ </struct>
+
+ <struct name="MenuParams">
+ <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" defvalue="0" mandatory="false">
+ <description>
+ unique ID of the sub menu, the command will be added to.
+ If not provided, it will be provided to the top level of the in application menu.
+ </description>
+ </param>
+
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+
+ <param name="menuName" type="String" maxlength="500">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </struct>
+
+ <struct name="TTSChunk">
+ <description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
+ <param name="text" minlength="0" maxlength="500" type="String">
+ <description>
+ The text or phonemes to speak.
+ May not be empty.
+ </description>
+ </param>
+ <param name="type" type="SpeechCapabilities">
+ <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
+ </param>
+ </struct>
+
+ <struct name="Turn">
+ <param name="navigationText" type="String" maxlength="500" mandatory="false">
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="VehicleType">
+ <param name="make" type="String" maxlength="500" mandatory="false">
+ <description>Make of the vehicle, e.g. Ford</description>
+ </param>
+ <param name="model" type="String" maxlength="500" mandatory="false">
+ <description>Model of the vehicle, e.g. Fiesta</description>
+ </param>
+ <param name="modelYear" type="String" maxlength="500" mandatory="false">
+ <description>Model Year of the vehicle, e.g. 2013</description>
+ </param>
+ <param name="trim" type="String" maxlength="500" mandatory="false">
+ <description>Trim of the vehicle, e.g. SE</description>
+ </param>
+ </struct>
+
+ <enum name="KeyboardLayout">
+ <description>Enumeration listing possible keyboard layouts.</description>
+ <element name="QWERTY" />
+ <element name="QWERTZ" />
+ <element name="AZERTY" />
+ </enum>
+
+ <enum name="KeyboardEvent" platform="MobileNav">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="KEYPRESS" />
+ <element name="ENTRY_SUBMITTED" />
+ <element name="ENTRY_CANCELLED" />
+ <element name="ENTRY_ABORTED" />
+ </enum>
+
+ <enum name="KeypressMode">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="SINGLE_KEYPRESS">
+ <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
+ </element>
+ <element name="QUEUE_KEYPRESSES">
+ <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
+ </element>
+ <element name="RESEND_CURRENT_ENTRY">
+ <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
+ </element>
+ </enum>
+
+ <struct name="KeyboardProperties">
+ <description>Configuration of on-screen keyboard (if available).</description>
+
+ <param name="language" type="Language" mandatory="false">
+ <description>The keyboard language.</description>
+ </param>
+
+ <param name="keyboardLayout" type="KeyboardLayout" mandatory="false" >
+ <description>Desired keyboard layout.</description>
+ </param>
+
+ <param name="keypressMode" type="KeypressMode" mandatory="false" >
+ <description>
+ Desired keypress mode.
+ If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ </description>
+ </param>
+
+ <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Array of keyboard characters to enable.</description>
+ <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
+ <description>If omitted, the entire keyboard will be enabled.</description>
+ </param>
+
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
+ <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ </param>
+ </struct>
+
+ <enum name="RequestType">
+ <description>Enumeration listing possible asynchronous requests.</description>
+ <element name="HTTP" />
+ <element name="FILE_RESUME" />
+ <element name="AUTH_REQUEST" />
+ <element name="AUTH_CHALLENGE" />
+ <element name="AUTH_ACK" />
+ <element name="PROPRIETARY" />
+ </enum>
+
+ <enum name="AppHMIType">
+ <description>Enumeration listing possible app types.</description>
+ <element name="DEFAULT" />
+ <element name="COMMUNICATION" />
+ <element name="MEDIA" />
+ <element name="MESSAGING" />
+ <element name="NAVIGATION" />
+ <element name="INFORMATION" />
+ <element name="SOCIAL" />
+ <element name="BACKGROUND_PROCESS" />
+ <element name="TESTING" />
+ <element name="SYSTEM" />
+ </enum>
+
+ <enum name="FunctionID" internal_scope="base">
+ <description>Enumeration linking function names with function IDs in AppLink protocol.</description>
+ <description>Assumes enumeration starts at value 0.</description>
+ <element name="RESERVED" value="0" />
+<!--
+ Base Request / Response RPCs
+ Range = 0x 0000 0001 - 0x 0000 7FFF
+-->
+ <element name="RegisterAppInterfaceID" value="1" hexvalue="1" />
+ <element name="UnregisterAppInterfaceID" value="2" hexvalue="2" />
+ <element name="SetGlobalPropertiesID" value="3" hexvalue="3" />
+ <element name="ResetGlobalPropertiesID" value="4" hexvalue="4" />
+ <element name="AddCommandID" value="5" hexvalue="5" />
+ <element name="DeleteCommandID" value="6" hexvalue="6" />
+ <element name="AddSubMenuID" value="7" hexvalue="7" />
+ <element name="DeleteSubMenuID" value="8" hexvalue="8" />
+ <element name="CreateInteractionChoiceSetID" value="9" hexvalue="9" />
+ <element name="PerformInteractionID" value="10" hexvalue="A" />
+ <element name="DeleteInteractionChoiceSetID" value="11" hexvalue="B" />
+ <element name="AlertID" value="12" hexvalue="C" />
+ <element name="ShowID" value="13" hexvalue="D" />
+ <element name="SpeakID" value="14" hexvalue="E" />
+ <element name="SetMediaClockTimerID" value="15" hexvalue="F" />
+ <element name="PerformAudioPassThruID" value="16" hexvalue="10" />
+ <element name="EndAudioPassThruID" value="17" hexvalue="11" />
+ <element name="SubscribeButtonID" value="18" hexvalue="12" />
+ <element name="UnsubscribeButtonID" value="19" hexvalue="13" />
+ <element name="SubscribeVehicleDataID" value="20" hexvalue="14" />
+ <element name="UnsubscribeVehicleDataID" value="21" hexvalue="15" />
+ <element name="GetVehicleDataID" value="22" hexvalue="16" />
+ <element name="ReadDIDID" value="23" hexvalue="17" />
+ <element name="GetDTCsID" value="24" hexvalue="18" />
+ <element name="ScrollableMessageID" value="25" hexvalue="19" />
+ <element name="SliderID" value="26" hexvalue="1A" />
+ <element name="ShowConstantTBTID" value="27" hexvalue="1B" />
+ <element name="AlertManeuverID" value="28" hexvalue="1C" />
+ <element name="UpdateTurnListID" value="29" hexvalue="1D" />
+ <element name="ChangeRegistrationID" value="30" hexvalue="1E" />
+ <element name="GenericResponseID" value="31" hexvalue="1F" />
+ <element name="PutFileID" value="32" hexvalue="20" />
+ <element name="DeleteFileID" value="33" hexvalue="21" />
+ <element name="ListFilesID" value="34" hexvalue="22" />
+ <element name="SetAppIconID" value="35" hexvalue="23" />
+ <element name="SetDisplayLayoutID" value="36" hexvalue="24" />
+ <element name="DiagnosticMessageID" value="37" hexvalue="25" />
+ <element name="SystemRequestID" value="38" hexvalue="26" />
+ <element name="SendLocationID" value="39" hexvalue="27" />
+
+
+
+<!--
+ Base Notifications
+ Range = 0x 0000 8000 - 0x 0000 FFFF
+-->
+
+ <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
+ <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
+ <element name="OnButtonEventID" value="32770" hexvalue="8002" />
+ <element name="OnButtonPressID" value="32771" hexvalue="8003" />
+ <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
+ <element name="OnCommandID" value="32773" hexvalue="8005" />
+ <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
+ <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
+ <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
+ <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
+ <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
+ <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
+ <element name="OnTouchEventID" value="32780" hexvalue="800C" />
+ <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
+ <element name="OnHashChangeID" value="32782" hexvalue="800E" />
+<!--
+ Ford Specific Request / Response RPCs
+ Range = 0x 0001 0000 - 0x 0001 7FFF
+-->
+
+
+<!--
+ Ford Specific Notifications
+ Range = 0x 0001 8000 - 0x 0001 FFFF
+-->
+
+ </enum>
+
+ <enum name="messageType">
+ <description>
+ Enumeration linking message types with function types in WiPro protocol.
+ Assumes enumeration starts at value 0.
+ </description>
+ <element name="request" value="0" />
+ <element name="response" value="1" />
+ <element name="notification" value="2" />
+ </enum>
+
+ <!-- Requests/Responses -->
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="request">
+ <description>
+ Establishes an interface with a mobile application.
+ Before registerAppInterface no other commands will be accepted/executed.
+ </description>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="appName" type="String" maxlength="100">
+ <description>
+ The mobile application name, e.g. "Ford Drive Green".
+ Needs to be unique over all applications.
+ May not be empty.
+ May not start with a new line character.
+ May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands)
+ Needs to be unique over all applications. Applications with the same name will be rejected.
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ Needs to be unique over all applications.
+ May not be empty.
+ May not start with a new line character.
+ </description>
+ </param>
+
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>
+ Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.
+ If not provided, the appName is used instead (and will be truncated if too long)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Defines an additional voice recognition command.
+ May not interfere with any app name of previously registered applications and any predefined blacklist of words
+ (global commands)
+ Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.
+ </description>
+ </param>
+
+ <param name="isMediaApplication" type="Boolean">
+ <description>
+ Indicates if the application is a media or a non-media application.
+ Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.
+ </description>
+ </param>
+ <param name="languageDesired" type="Language" mandatory="true">
+ <description>
+ See Language
+ Current app’s expected VR+TTS language
+ If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+ <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true">
+ <description>
+ See Language
+ Current app’s expected display language
+ If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+ <param name="appHMIType" type="AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ See AppHMIType
+ List of all applicable app HMI types stating which HMI classifications to be given to the app.
+ e.g. for platforms like GEN2, this will determine which "corner(s)" the app can populate.
+ </description>
+ </param>
+ <param name="hashID" type="String" maxlength="100" mandatory="false">
+ <description>
+ ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles).
+ This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece.
+ If omitted, then the previous state of an app's commands, etc. will not be restored.
+ </description>
+ </param>
+ <param name="deviceInfo" type="DeviceInfo" mandatory="false">
+ <description>
+ See DeviceInfo.
+ </description>
+ </param>
+ <param name="appID" type="String" maxlength="100" mandatory="true">
+ <description>ID used to validate app with policy table entries</description>
+ </param>
+ </function>
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
+ <description>The response to registerAppInterface</description>
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TOO_MANY_APPLICATIONS"/>
+ <element name="APPLICATION_REGISTERED_ALREADY"/>
+ <element name="UNSUPPORTED_VERSION"/>
+ <element name="WRONG_LANGUAGE"/>
+ <element name="DISALLOWED"/>
+ <element name="WARNINGS"/>
+ <element name="RESUME_FAILED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="language" type="Language" mandatory="false">
+ <description>The currently active VR+TTS language on Sync. See "Language" for options.</description>
+ </param>
+
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false">
+ <description>The currently active display language on Sync. See "Language" for options.</description>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ </param>
+
+ <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <issue creator="rs">If not used yet => remove</issue>
+ <description>See HmiZoneCapabilities</description>
+ </param>
+
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See SpeechCapabilities</description>
+ </param>
+
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See VrCapabilities</description>
+ </param>
+
+ <param name="audioPassThruCapabilities" type="AudioPassThruCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See AudioPassThruCapability</description>
+ </param>
+
+ <param name="vehicleType" type="VehicleType" mandatory="false">
+ <description>Specifies the vehicle's type. See VehicleType.</description>
+ </param>
+
+ <param name="prerecordedSpeech" type="PrerecordedSpeech" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See PrerecordedSpeech</description>
+ </param>
+
+ <param name="supportedDiagModes" type="Integer" minvalue="0" maxvalue="255" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>
+ Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests.
+ If a mode outside this list is requested, it will be rejected.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="request">
+ <description>
+ Closes an interface from a mobile application.
+ After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.
+ Will fail, if no registerAppInterface was completed successfully before.
+ </description>
+ </function>
+
+ <function name="UnregisterAppInterface" functionID="UnregisterAppInterfaceID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request">
+ <description>Allows setting global properties.</description>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ The help prompt.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ Help text for a wait timeout.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <description>
+ VR Help Title text.
+ If omitted on supported displays, the default SYNC help title shall be used.
+ If omitted and one or more vrHelp items are provided, the request will be rejected.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ VR Help Items.
+ If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used.
+ If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected.
+ If omitted and a vrHelpTitle is provided, the request will be rejected.
+ </description>
+ </param>
+ <param name="menuTitle" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="menuIcon" type="Image" mandatory="false">
+ <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ </param>
+
+ <param name="keyboardProperties" type="KeyboardProperties" mandatory="false">
+ <description>On-screen keybaord configuration (if available).</description>
+ </param>
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="request">
+ <description>Allows resetting global properties.</description>
+
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" >
+ <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
+ </param>
+ </function>
+
+ <function name="ResetGlobalProperties" functionID="ResetGlobalPropertiesID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="request">
+ <description>
+ Adds a command to the in application menu.
+ Either menuParams or vrCommands must be provided.
+ </description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>unique ID of the command to add.</description>
+ </param>
+
+ <param name="menuParams" type="MenuParams" mandatory="false">
+ <description>Optional sub value containing menu parameters</description>
+ </param>
+
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
+ <description>
+ An array of strings to be used as VR synonyms for this command.
+ If this array is provided, it may not be empty.
+ </description>
+ </param>
+
+ <param name="cmdIcon" type="Image" mandatory="false">
+ <description>
+ Image struct determining whether static or dynamic icon.
+ If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="AddCommand" functionID="AddCommandID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="request">
+ <description>Deletes all commands from the in-application menu with the specified command id.</description>
+
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>ID of the command(s) to delete.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteCommand" functionID="DeleteCommandID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="request">
+ <description>Adds a sub menu to the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
+ <description>unique ID of the sub menu to add.</description>
+ </param>
+
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" defvalue="1000" mandatory="false">
+ <description>
+ Position within the items that are are at top level of the in application menu.
+ 0 will insert at the front.
+ 1 will insert at the second position.
+ If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.
+ Position of any submenu will always be located before the return and exit options
+ If this param was omitted the entry will be added at the end.
+ </description>
+ </param>
+
+ <param name="menuName" maxlength="500" type="String">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </function>
+
+ <function name="AddSubMenu" functionID="AddSubMenuID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="request">
+ <description>Deletes a submenu from the in-application menu.</description>
+
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000">
+ <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteSubMenu" functionID="DeleteSubMenuID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="request">
+ <description>creates interaction choice set to be used later by performInteraction</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Unique ID used for this interaction choice set.</description>
+ </param>
+
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" />
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="request">
+ <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+
+ <param name="initialText" type="String" maxlength="500" >
+ <description>Text to be displayed first.</description>
+ </param>
+
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ This is the intial prompt spoken to the user at the start of an interaction.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="interactionMode" type="InteractionMode">
+ <description>See InteractionMode.</description>
+ </param>
+
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
+ <description>List of interaction choice set IDs to use with an interaction.</description>
+ </param>
+
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text. This is the spoken string when a user speaks "help" when the interaction is occuring.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Timeout text. This text is spoken when a VR interaction times out.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ If omitted a standard value of 10000 milliseconds is used.
+ Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform.
+ </description>
+ </param>
+
+ <param name="vrHelp" type="VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Ability to send suggested VR Help Items to display on-screen during Perform Interaction.
+ If omitted on supported displays, the default SYNC generated list of suggested choices shall be displayed.
+ </description>
+ </param>
+
+ <param name="interactionLayout" type="LayoutMode" mandatory="false">
+ <description>See LayoutMode.</description>
+ </param>
+
+ </function>
+
+ <function name="PerformInteraction" functionID="PerformInteractionID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TIMED_OUT"/>
+ <element name="ABORTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ ID of the choice that was selected in response to PerformInteraction.
+ Only is valid if resultCode is SUCCESS.
+ </description>
+ </param>
+
+ <param name="manualTextEntry" type="String" maxlength="500" mandatory="false">
+ <description>
+ Manually entered text selection, e.g. through keyboard
+ Can be returned in lieu of choiceID, depending on trigger source
+ </description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource" mandatory="false">
+ <description>
+ See TriggerSource
+ Only is valid if resultCode is SUCCESS.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="request">
+ <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
+ <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
+
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>ID of the interaction choice set to delete.</description>
+ </param>
+ </function>
+
+ <function name="DeleteInteractionChoiceSet" functionID="DeleteInteractionChoiceSetID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="request">
+ <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
+
+ <param name="alertText1" type="String" maxlength="500" mandatory="false">
+ <description>The first line of the alert text field</description>
+ </param>
+
+ <param name="alertText2" type="String" maxlength="500" mandatory="false">
+ <description>The second line of the alert text field</description>
+ </param>
+
+ <param name="alertText3" type="String" maxlength="500" mandatory="false">
+ <description>The optional third line of the alert text field</description>
+ </param>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" defvalue="5000" mandatory="false">
+ <description>
+ Timeout in milliseconds.
+ Typical timeouts are 3-5 seconds.
+ If omitted, timeout is set to 5s.
+ </description>
+ </param>
+
+ <param name="playTone" type="Boolean" mandatory="false">
+ <description>
+ Defines if tone should be played. Tone is played before TTS.
+ If omitted, no tone is played.
+ </description>
+ </param>
+
+ <param name="progressIndicator" type="Boolean" mandatory="false" platform="MobileNav">
+ <description>
+ If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.
+ </description>
+ </param>
+
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, the displayed alert shall not have any SoftButtons.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Alert" functionID="AlertID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="tryAgainTime" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Amount of time (in seconds) that an app must wait before resending an alert.
+ If provided, another system event or overlay currently has a higher priority than this alert.
+ An app must not send an alert without waiting at least the amount of time dictated.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="request">
+ <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
+
+ <param name="mainField1" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ The text that should be displayed in a single or upper display line.
+ If this text is not set, the text of mainField1 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField2" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ The text that should be displayed on the second display line.
+ If this text is not set, the text of mainField2 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField3" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ The text that should be displayed on the second "page" first display line.
+ If this text is not set, the text of mainField3 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="mainField4" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ The text that should be displayed on the second "page" second display line.
+ If this text is not set, the text of mainField4 stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="alignment" type="TextAlignment" mandatory="false">
+ <description>
+ Specifies how mainField1 and mainField2 texts should be aligned on display.
+ If omitted, texts will be centered.
+ </description>
+ </param>
+
+ <param name="statusBar" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
+ </param>
+
+ <param name="mediaClock" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync capabilities.
+ If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
+ </description>
+ </param>
+
+ <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ The text that should be displayed in the track field.
+ This field is only valid for media applications on NGN type ACMs.
+ If this text is not set, the text of mediaTrack stays unchanged.
+ If this text is empty "", the field will be cleared.
+ </description>
+ </param>
+
+ <param name="graphic" type="Image" mandatory="false">
+ <description>
+ Image struct determining whether static or dynamic image to display in app.
+ If omitted on supported displays, the displayed graphic shall not change.
+ </description>
+ </param>
+
+ <param name="secondaryGraphic" type="Image" mandatory="false">
+ <description>
+ Image struct determining whether static or dynamic secondary image to display in app.
+ If omitted on supported displays, the displayed secondary graphic shall not change.
+ </description>
+ </param>
+
+
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
+ <description>
+ App labeled on-screen presets (i.e. GEN2).
+ If omitted on supported displays, the presets will be shown as not defined.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="request">
+ <description>Speaks a text.</description>
+
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <description>
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="Speak" functionID="SpeakID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="request">
+ <description>Sets the initial media clock value and automatic update method.</description>
+
+ <param name="startTime" type="StartTime" mandatory="false">
+ <description>
+ See StartTime.
+ startTime must be provided for "COUNTUP" and "COUNTDOWN".
+ startTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
+ </description>
+ </param>
+
+ <param name="endTime" type="StartTime" mandatory="false">
+ <description>
+ See StartTime.
+ endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
+ If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
+ endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
+ </description>
+ </param>
+
+ <param name="updateMode" type="UpdateMode" mandatory="true">
+ <description>
+ Enumeration to control the media clock.
+ In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.
+ </description>
+ </param>
+ </function>
+
+ <function name="SetMediaClockTimer" functionID="SetMediaClockTimerID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="request">
+ <description>Starts audio pass thru session </description>
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ SYNC will speak this prompt before opening the audio pass thru session.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ If omitted, then no initial prompt is spoken.
+ </description>
+ </param>
+ <param name="audioPassThruDisplayText1" type="String" mandatory="false" maxlength="500">
+ <description>First line of text displayed during audio capture.</description>
+ </param>
+ <param name="audioPassThruDisplayText2" type="String" mandatory="false" maxlength="500">
+ <description>Second line of text displayed during audio capture.</description>
+ </param>
+ <param name="samplingRate" type="SamplingRate" mandatory="true">
+ <description> This value shall be allowed at 8 khz or 16 or 22 or 44 khz.</description>
+ </param>
+ <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
+ <description>The maximum duration of audio recording in milliseconds. </description>
+ </param>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true">
+ <description>Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.</description>
+ </param>
+ <param name="audioType" type="AudioType" mandatory="true">
+ <description>Specifies the type of audio data being requested.</description>
+ </param>
+ <param name="muteAudio" type="Boolean" mandatory="false">
+ <description>
+ Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
+ If omitted, the value is set to true.
+ </description>
+ </param>
+ </function>
+
+ <function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ <element name="RETRY"/>
+ <element name="WARNINGS"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="request">
+ <description>When this request is invoked, the audio capture stops.</description>
+ </function>
+
+ <function name="EndAudioPassThru" functionID="EndAudioPassThruID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="request">
+ <description>
+ Subscribes to built-in HMI buttons.
+ The application will be notified by the OnButtonEvent and OnButtonPress.
+ To unsubscribe the notifications, use unsubscribeButton.
+ </description>
+
+ <param name="buttonName" type="ButtonName">
+ <description>Name of the button to subscribe.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="request">
+ <description>Unsubscribes from built-in HMI buttons.</description>
+
+ <param name="buttonName" type="ButtonName">
+ <description>Name of the button to unsubscribe.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_RESOURCE" />
+ <element name="IGNORED" />
+ <element name="REJECTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="request">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="SubscribeVehicleData" functionID="SubscribeVehicleDataID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="request">
+ <description>This function is used to unsubscribe the notifications from the subscribeVehicleData function.</description>
+
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="UnsubscribeVehicleData" functionID="UnsubscribeVehicleDataID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="WARNINGS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="IGNORED" />
+ <element name="DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="request">
+ <description>Non periodic vehicle data read request.</description>
+
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="GetVehicleData" functionID="GetVehicleDataID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="VEHICLE_DATA_NOT_ALLOWED"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE"/>
+ <element name="USER_DISALLOWED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="gps" type="GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+
+ </function>
+
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="request">
+ <description>Non periodic vehicle data read request</description>
+
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
+ <description>Get raw data from vehicle data DID location(s)</description>
+ </param>
+ </function>
+
+ <function name="ReadDID" functionID="ReadDIDID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="didResult" type="DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>Array of requested DID results (with data if available).</description>
+ </param>
+
+ </function>
+
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="request">
+ <description>Vehicle module diagnostic trouble code request.</description>
+
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+
+ <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
+ <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
+ </param>
+
+ </function>
+
+ <function name="GetDTCs" functionID="GetDTCsID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
+ </param>
+
+ <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
+ <description>
+ Array of all reported DTCs on module (ecuHeader contains information if list is truncated).
+ Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf).
+ </description>
+ </param>
+
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="request">
+ <description>Non periodic vehicle diagnostic request</description>
+
+ <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of target ECU.</description>
+ </param>
+
+ <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Length of message (in bytes).</description>
+ </param>
+
+ <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message.
+ </description>
+ </param>
+ </function>
+
+ <function name="DiagnosticMessage" functionID="DiagnosticMessageID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="TRUNCATED_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message result.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="request">
+ <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
+ <param name="scrollableMessageBody" type="String" maxlength="500">
+ <description>Body of text that can include newlines and tabs.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="30000" mandatory="false">
+ <description>App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout).</description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>
+ App defined SoftButtons.
+ If omitted on supported displays, only the system defined "Close" SoftButton will be displayed.
+ </description>
+ </param>
+ </function>
+
+ <function name="ScrollableMessage" functionID="ScrollableMessageID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="CHAR_LIMIT_EXCEEDED"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="request">
+ <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
+ <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
+ <description>Number of selectable items on a horizontal axis</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
+ <description>Initial position of slider control (cannot exceed numTicks)</description>
+ </param>
+ <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
+ <description>Text header to display</description>
+ </param>
+ <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
+ <description>
+ Text footer to display (meant to display min/max threshold descriptors).
+ For a static text footer, only one footer string shall be provided in the array.
+ For a dynamic text footer, the number of footer text string in the array must match the numTicks value.
+ For a dynamic text footer, text array string should correlate with potential slider position index.
+ If omitted on supported displays, no footer text shall be displayed.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" defvalue="10000" mandatory="false">
+ <description>
+ App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout).
+ If omitted, the value is set to 10000.
+ </description>
+ </param>
+ </function>
+
+ <function name="Slider" functionID="SliderID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="SAVED"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
+ <description>
+ Current slider value returned when saved or canceled (aborted)
+ This value is only returned for resultCodes "SAVED" or "ABORTED"
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="request">
+ <param name="navigationText1" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="navigationText2" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="eta" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="timeToDestination" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="totalDistance" type="String" minlength="0" maxlength="500" mandatory="false">
+ </param>
+ <param name="turnIcon" type="Image" mandatory="false">
+ </param>
+ <param name="nextTurnIcon" type="Image" mandatory="false">
+ </param>
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <description>
+ Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).
+ Used to calculate progress bar.
+ </description>
+ </param>
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="false">
+ <description>
+ Distance till next maneuver (starting from) from previous maneuver.
+ Used to calculate progress bar.
+ </description>
+ </param>
+ <param name="maneuverComplete" type="Boolean" mandatory="false">
+ <description>
+ If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay.
+ If omitted the value will be assumed as FALSE.
+ </description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>
+ Three dynamic SoftButtons available (first SoftButton is fixed to "Turns").
+ If omitted on supported displays, the currently displayed SoftButton values will not change.
+ </description>
+ </param>
+ </function>
+
+ <function name="ShowConstantTBT" functionID="ShowConstantTBTID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="request">
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed.</description>
+ </param>
+ </function>
+
+ <function name="AlertManeuver" functionID="AlertManeuverID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="ABORTED"/>
+ <element name="WARNINGS"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="request">
+ <param name="turnList" type="Turn" minsize="1" maxsize="100" array="true" mandatory="false">
+ </param>
+ <param name="softButtons" type="SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
+ <description>If omitted on supported displays, app-defined SoftButton will be left blank.</description>
+ </param>
+ </function>
+
+ <function name="UpdateTurnList" functionID="UpdateTurnListID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="request">
+ <param name="language" type="Language" mandatory="true">
+ <description>Requested voice engine (VR+TTS) language registration</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language" mandatory="true">
+ <description>Request display language registration</description>
+ </param>
+ <param name="appName" type="String" maxlength="100" mandatory="false">
+ <description>Request new app name registration</description>
+ </param>
+ <param name="ttsName" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>Request new ttsName registration</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Request new app short name registration</description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Request new VR synonyms registration</description>
+ </param>
+
+</function>
+
+
+
+ <function name="ChangeRegistration" functionID="ChangeRegistrationID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description>
+ true, if successful
+ false, if failed
+ </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="DISALLOWED"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="GenericResponse" functionID="GenericResponseID" messagetype="response">
+ <description>
+ Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.
+ Currently, only resultCode INVALID_DATA is used.
+ </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="INVALID_DATA"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="request">
+ <description>
+ Used to push a binary data onto the SYNC module from a mobile device, such as icons and album art
+ Not supported on first generation SYNC vehicles.
+ Binary data is in binary part of hybrid msg.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ <param name="fileType" type="FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
+
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+
+ <param name="systemFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>Indicates if the file is meant to be passed thru core to elsewhere on the system.
+ If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. If omitted, the value will be set to false.</description>
+ </param>
+
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+
+ </function>
+
+ <function name="PutFile" functionID="PutFileID" messagetype="response">
+ <description>Response is sent, when the file data was copied (success case). Or when an error occured.</description>
+ <description>Not supported on First generation SYNC vehicles. </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>
+ Provides the total local space available on SYNC for the registered app.
+ If the transfer has systemFile enabled, then the value will be set to 0 automatically.
+ </description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="request">
+ <description>
+ Used to delete a file resident on the SYNC module in the app's local cache.
+ Not supported on first generation SYNC vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="DeleteFile" functionID="DeleteFileID" messagetype="response">
+ <description>
+ Response is sent, when the file data was deleted (success case). Or when an error occured.
+ Not supported on First generation SYNC vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Provides the total local space available on SYNC for the registered app.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="request">
+ <description>
+ Requests the current list of resident filenames for the registered app.
+ Not supported on first generation SYNC vehicles.
+ </description>
+ </function>
+
+ <function name="ListFiles" functionID="ListFilesID" messagetype="response">
+ <description>
+ Returns the current list of resident filenames for the registered app along with the current space available
+ Not supported on First generation SYNC vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="filenames" type="String" maxlength="500" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>
+ An array of all filenames resident on SYNC for the given registered app.
+ If omitted, then no files currently reside on the system.
+ </description>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Provides the total local space available on SYNC for the registered app.</description>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="request">
+ <description>
+ Used to set existing local file on SYNC as the app's icon
+ Not supported on first generation SYNC vehicles.
+ </description>
+
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+
+ </function>
+
+ <function name="SetAppIcon" functionID="SetAppIconID" messagetype="response">
+ <description>
+ Response is sent, when the file data was copied (success case). Or when an error occured.
+ Not supported on First generation SYNC vehicles.
+ </description>
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request">
+ <description>
+ Used to set an alternate display layout.
+ If not sent, default screen for given platform will be shown
+ </description>
+
+ <param name="displayLayout" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
+ </description>
+ </param>
+ </function>
+
+ <function name="OnHashChange" functionID="OnHashChangeID" messagetype="notification">
+ <description>
+ Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.).
+ Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data.
+ </description>
+
+ <param name="hashID" type="String" maxlength="100" mandatory="true">
+ <description>Calculated hash ID to be referenced during RegisterAppInterface.</description>
+ </param>
+ </function>
+
+ <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description >
+ </param>
+
+ <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description >
+ </param>
+
+ <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description >
+ </param>
+
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="request">
+ <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
+ <param name="requestType" type="RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="fileName" type="String" maxlength="255" mandatory="false">
+ <description>The name of file.</description>
+ </param>
+ </function>
+
+ <function name="SystemRequest" functionID="SystemRequestID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_CERT"/>
+ <element name="EXPIRED_CERT"/>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="request">
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>
+ Name / title of intended location
+ </description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>
+ Description intended location / establishment (if applicable)
+ </description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>
+ Location address (if applicable)
+ </description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>
+ Phone number of intended location / establishment (if applicable)
+ </description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>
+ Image / icon of intended location (if applicable and supported)
+ </description>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="DISALLOWED"/>
+ </param>
+ </function>
+
+
+ <!-- Notifications -->
+
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
+ <param name="hmiLevel" type="HMILevel">
+ <description>See HMILevel</description>
+ </param>
+
+ <param name="audioStreamingState" type="AudioStreamingState">
+ <description>See AudioStreamingState</description>
+ </param>
+
+ <param name="systemContext" type="SystemContext">
+ <description>See SystemContext</description>
+ </param>
+ </function>
+
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
+ <param name="reason" type="AppInterfaceUnregisteredReason">
+ <description>See AppInterfaceUnregisteredReason</description>
+ </param>
+ </function>
+
+ <function name="OnButtonEvent" functionID="OnButtonEventID" messagetype="notification">
+ <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName"/>
+ <param name="buttonEventMode" type="ButtonEventMode">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
+ </param>
+ </function>
+
+ <function name="OnButtonPress" functionID="OnButtonPressID" messagetype="notification">
+ <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName"/>
+ <param name="buttonPressMode" type="ButtonPressMode">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <description>If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)</description>
+ </param>
+ </function>
+
+ <function name="OnVehicleData" functionID="OnVehicleDataID" messagetype="notification">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
+ </param>
+ <param name="prndl" type="PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+
+ <!-- Ford Specific Vehicle Data -->
+ <param name="eCallInfo" type="ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Vehicle Data -->
+
+ </function>
+
+ <function name="OnCommand" functionID="OnCommandID" messagetype="notification">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Command ID, which is related to a specific menu entry</description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource">
+ <description>See TriggerSource</description>
+ </param>
+ </function>
+
+ <function name="OnTBTClientState" functionID="OnTBTClientStateID" messagetype="notification" >
+ <description>Provides applications with notifications specific to the current TBT client status on the module</description>
+ <param name="state" type="TBTState">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+
+ <function name="OnDriverDistraction" functionID="OnDriverDistractionID" messagetype="notification" >
+ <description>Provides driver distraction state to mobile applications</description>
+ <param name="state" type="DriverDistractionState">
+ <description>Current State of Driver Distraction</description>
+ </param>
+ </function>
+
+ <function name="OnPermissionsChange" functionID="OnPermissionsChangeID" messagetype="notification" >
+ <description>Provides update to app of which policy-table-enabled functions are available</description>
+ <param name="permissionItem" type="PermissionItem" minsize="0" maxsize="500" array="true">
+ <description>Change in permissions for a given set of RPCs</description>
+ </param>
+ </function>
+
+ <function name="OnAudioPassThru" functionID="OnAudioPassThruID" messagetype="notification">
+ <description>Binary data is in binary part of hybrid msg</description>
+ </function>
+
+ <function name="OnLanguageChange" functionID="OnLanguageChangeID" messagetype="notification">
+ <param name="language" type="Language">
+ <description>Current SYNC voice engine (VR+TTS) language</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language">
+ <description>Current display language</description>
+ </param>
+ </function>
+
+ <function name="OnKeyboardInput" functionID="OnKeyboardInputID" messagetype="notification" platform="MobileNav">
+
+ <description>On-screen keyboard event.</description>
+ <description>Can be full string or individual keypresses depending on keyboard mode.</description>
+
+ <param name="event" type="KeyboardEvent" mandatory="true">
+ <description>On-screen keyboard input data.</description>
+ </param>
+
+ <param name="data" type="String" maxlength="500" mandatory="false">
+ <description>On-screen keyboard input data.</description>
+ <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
+ <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
+ <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
+ </param>
+
+ </function>
+
+
+ <function name="OnTouchEvent" functionID="OnTouchEventID" messagetype="notification" platform="MobileNav">
+ <description>Notifies about touch events on the screen's prescribed area</description>
+ <param name="type" type="TouchType" mandatory="true">
+ <description>The type of touch event.</description>
+ </param>
+ <param name="event" type="TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
+ <description>List of all individual touches involved in this event.</description>
+ </param>
+ </function>
+
+ <function name="OnSystemRequest" functionID="OnSystemRequestID" messagetype="notification">
+ <description> An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
+ </description>
+ <param name="requestType" type="RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="url" type="String" maxlength="1000" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Optional array of URL(s) for HTTP requests.
+ If blank, the binary data shall be forwarded to the app.
+ If not blank, the binary data shall be forwarded to the url(s) with a provided timeout in seconds.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ Optional timeout for HTTP requests
+ Required if a URL is provided
+ </description>
+ </param>
+ <param name="fileType" type="FileType" mandatory="false">
+ <description>Optional file type (meant for HTTP file requests).</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ </function>
+
+<!-- ~~~~~~~~~~~~~~~~~~ -->
+<!-- Ford Specific APIs -->
+<!-- ~~~~~~~~~~~~~~~~~~ -->
+</interface>
diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml
new file mode 100644
index 0000000000..08e0a60d0f
--- /dev/null
+++ b/src/components/interfaces/QT_HMI_API.xml
@@ -0,0 +1,4077 @@
+<?xml version="1.0" standalone="yes"?>
+<!--
+* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. -->
+<interfaces name="SmartDeviceLink HMI API">
+ <interface name="Common" version="1.1" date="2013-10-02">
+ <enum name="Result">
+ <element name="SUCCESS" value="0"/>
+ <element name="UNSUPPORTED_REQUEST" value="1"/>
+ <element name="UNSUPPORTED_RESOURCE" value="2"/>
+ <element name="DISALLOWED" value="3"/>
+ <element name="REJECTED" value="4"/>
+ <element name="ABORTED" value="5"/>
+ <element name="IGNORED" value="6"/>
+ <element name="RETRY" value="7"/>
+ <element name="IN_USE" value="8"/>
+ <element name="DATA_NOT_AVAILABLE" value="9"/>
+ <element name="TIMED_OUT" value="10"/>
+ <element name="INVALID_DATA" value="11"/>
+ <element name="CHAR_LIMIT_EXCEEDED" value="12"/>
+ <element name="INVALID_ID" value="13"/>
+ <element name="DUPLICATE_NAME" value="14"/>
+ <element name="APPLICATION_NOT_REGISTERED" value="15"/>
+ <element name="WRONG_LANGUAGE" value="16"/>
+ <element name="OUT_OF_MEMORY" value="17"/>
+ <element name="TOO_MANY_PENDING_REQUESTS" value="18"/>
+ <element name="NO_APPS_REGISTERED" value="19"/>
+ <element name="NO_DEVICES_CONNECTED" value="20"/>
+ <element name="WARNINGS" value="21"/>
+ <element name="GENERIC_ERROR" value="22"/>
+ <element name="USER_DISALLOWED" value="23"/>
+ </enum>
+ <enum name="ButtonName">
+ <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
+ <element name="OK"/>
+ <element name="SEEKLEFT"/>
+ <element name="SEEKRIGHT"/>
+ <element name="TUNEUP"/>
+ <element name="TUNEDOWN"/>
+ <element name="PRESET_0"/>
+ <element name="PRESET_1"/>
+ <element name="PRESET_2"/>
+ <element name="PRESET_3"/>
+ <element name="PRESET_4"/>
+ <element name="PRESET_5"/>
+ <element name="PRESET_6"/>
+ <element name="PRESET_7"/>
+ <element name="PRESET_8"/>
+ <element name="PRESET_9"/>
+ <element name="CUSTOM_BUTTON"/>
+ <element name="SEARCH"/>
+ </enum>
+ <enum name="ButtonEventMode">
+ <element name="BUTTONUP">
+ <description>A button has been released up</description>
+ </element>
+ <element name="BUTTONDOWN">
+ <description>A button has been pressed down</description>
+ </element>
+ </enum>
+ <enum name="ButtonPressMode">
+ <element name="LONG">
+ <description>A button was released, after it was pressed for a long time. Actual timing is defined by head unit and may vary</description>
+ </element>
+ <element name="SHORT">
+ <description>A button was released, after it was pressed for a short time. Actual timing is defined by head unit and may vary</description>
+ </element>
+ </enum>
+ <enum name="Language">
+ <element name="EN-US" internal_name="EN_US">
+ <description>English - US</description>
+ </element>
+ <element name="ES-MX" internal_name="ES_MX">
+ <description>Spanish - Mexico</description>
+ </element>
+ <element name="FR-CA" internal_name="FR_CA">
+ <description>French - Canada</description>
+ </element>
+ <element name="DE-DE" internal_name="DE_DE">
+ <description>German - Germany</description>
+ </element>
+ <element name="ES-ES" internal_name="ES_ES">
+ <description>Spanish - Spain</description>
+ </element>
+ <element name="EN-GB" internal_name="EN_GB">
+ <description>English - GB</description>
+ </element>
+ <element name="RU-RU" internal_name="RU_RU">
+ <description>Russian - Russia</description>
+ </element>
+ <element name="TR-TR" internal_name="TR_TR">
+ <description>Turkish - Turkey</description>
+ </element>
+ <element name="PL-PL" internal_name="PL_PL">
+ <description>Polish - Poland</description>
+ </element>
+ <element name="FR-FR" internal_name="FR_FR">
+ <description>French - France</description>
+ </element>
+ <element name="IT-IT" internal_name="IT_IT">
+ <description>Italian - Italy</description>
+ </element>
+ <element name="SV-SE" internal_name="SV_SE">
+ <description>Swedish - Sweden</description>
+ </element>
+ <element name="PT-PT" internal_name="PT_PT">
+ <description>Portuguese - Portugal</description>
+ </element>
+ <element name="NL-NL" internal_name="NL_NL">
+ <description>Dutch (Standard) - Netherlands</description>
+ </element>
+ <element name="EN-AU" internal_name="EN_AU">
+ <description>English - Australia</description>
+ </element>
+ <element name="ZH-CN" internal_name="ZH_CN">
+ <description>Mandarin - China</description>
+ </element>
+ <element name="ZH-TW" internal_name="ZH_TW">
+ <description>Mandarin - Taiwan</description>
+ </element>
+ <element name="JA-JP" internal_name="JA_JP">
+ <description>Japanese - Japan</description>
+ </element>
+ <element name="AR-SA" internal_name="AR_SA">
+ <description>Arabic - Saudi Arabia</description>
+ </element>
+ <element name="KO-KR" internal_name="KO_KR">
+ <description>Korean - South Korea</description>
+ </element>
+ <element name="PT-BR" internal_name="PT_BR">
+ <description>Portuguese - Brazil</description>
+ </element>
+ <element name="CS-CZ" internal_name="CS_CZ">
+ <description>Czech - Czech Republic</description>
+ </element>
+ <element name="DA-DK" internal_name="DA_DK">
+ <description>Danish - Denmark</description>
+ </element>
+ <element name="NO-NO" internal_name="NO_NO">
+ <description>Norwegian - Norway</description>
+ </element>
+ </enum>
+ <enum name="SoftButtonType">
+ <description>Contains information about the SoftButton capabilities.</description>
+ <element name="TEXT" internal_name="SBT_TEXT"/>
+ <element name="IMAGE" internal_name="SBT_IMAGE"/>
+ <element name="BOTH" internal_name="SBT_BOTH"/>
+ </enum>
+ <enum name="SystemAction">
+ <description>Enumeration that describes system actions that can be triggered.</description>
+ <element name="DEFAULT_ACTION">
+ <description>Default action occurs. Standard behavior (e.g. SoftButton clears overlay).</description>
+ </element>
+ <element name="STEAL_FOCUS">
+ <description>The calling app's dialog or related event should clear and the app should be brought into HMI_FULL.</description>
+ </element>
+ <element name="KEEP_CONTEXT">
+ <description>Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent.</description>
+ </element>
+ </enum>
+ <enum name="AppHMIType">
+ <description>Enumeration listing possible app types.</description>
+ <element name="DEFAULT"/>
+ <element name="COMMUNICATION"/>
+ <element name="MEDIA"/>
+ <element name="MESSAGING"/>
+ <element name="NAVIGATION"/>
+ <element name="INFORMATION"/>
+ <element name="SOCIAL"/>
+ <element name="BACKGROUND_PROCESS"/>
+ <element name="TESTING"/>
+ <element name="SYSTEM"/>
+ </enum>
+ <enum name="LayoutMode">
+ <description>For touchscreen interactions, the mode of how the choices are presented.</description>
+ <element name="ICON_ONLY"/>
+ <description>This mode causes the interaction to display the previous set of choices as icons.</description>
+ <element name="ICON_WITH_SEARCH"/>
+ <description>This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI.</description>
+ <element name="LIST_ONLY"/>
+ <description>This mode causes the interaction to display the previous set of choices as a list.</description>
+ <element name="LIST_WITH_SEARCH"/>
+ <description>This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI.</description>
+ <element name="KEYBOARD"/>
+ <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
+ </enum>
+ <enum name="DeactivateReason">
+ <description>Specifies the functionality the User has switched to.</description>
+ <element name="AUDIO">
+ <description>Navigated to audio(radio, etc)</description>
+ </element>
+ <element name="PHONECALL">
+ <description>Navigated to make a call.</description>
+ </element>
+ <element name="NAVIGATIONMAP">
+ <description>Navigated to navigation screen.</description>
+ </element>
+ <element name="PHONEMENU">
+ <description>Navigated to phone menu.</description>
+ </element>
+ <element name="SYNCSETTINGS">
+ <description>Navigated to settings menu.</description>
+ </element>
+ <element name="GENERAL">
+ <description>Other screens navigation apart from other mobile app.</description>
+ </element>
+ </enum>
+ <enum name="ClockUpdateMode">
+ <description>Describes how the media clock timer should behave on the platform</description>
+ <element name="COUNTUP"/>
+ <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
+ <element name="COUNTDOWN"/>
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ <element name="PAUSE"/>
+ <description>Pauses the media clock timer</description>
+ <element name="RESUME"/>
+ <description>Resume the media clock timer</description>
+ <element name="CLEAR"/>
+ <description>Clears the media clock timer (previously done through Show-&gt;mediaClock)</description>
+ </enum>
+ <enum name="SystemContext">
+ <description>Enumeration that describes possible contexts the application might be in on HU.</description>
+ <description>Communicated to whichever app is in HMI FULL, except Alert.</description>
+ <element name="MAIN" internal_name="SYSCTXT_MAIN">
+ <description>The app's persistent display (whether media/non-media/navigation) is fully visible onscreen.</description>
+ <description> There is currently no user interaction (user-initiated or app-initiated) with the head-unit</description>
+ </element>
+ <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION">
+ <description>The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen).</description>
+ </element>
+ <element name="MENU" internal_name="SYSCTXT_MENU">
+ <description>The system is currently displaying a system or in-App menu onscreen.</description>
+ </element>
+ <element name="HMI_OBSCURED" internal_name="SYSCTXT_HMI_OBSCURED">
+ <description>The app's display HMI is currently obscuring with either a system or other app's overlay (except of Alert element).</description>
+ </element>
+ <element name="ALERT" internal_name="SYSCTXT_ALERT">
+ <description>Broadcast only to whichever app has an alert currently being displayed.</description>
+ </element>
+ </enum>
+ <enum name="HmiZoneCapabilities">
+ <description>Contains information about the HMI zone capabilities.</description>
+ <description>For future use.</description>
+ <element name="FRONT"/>
+ <element name="BACK"/>
+ </enum>
+ <enum name="SpeechCapabilities">
+ <description>Contains information about the TTS capabilities.</description>
+ <element name="TEXT" internal_name="SC_TEXT"/>
+ <element name="SAPI_PHONEMES"/>
+ <element name="LHPLUS_PHONEMES"/>
+ <element name="PRE_RECORDED"/>
+ <element name="SILENCE"/>
+ </enum>
+ <enum name="VrCapabilities">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="TEXT" internal_name="VR_TEXT"/>
+ </enum>
+ <enum name="PrerecordedSpeech">
+ <description>Contains a list of prerecorded speech items present on the platform.</description>
+ <element name="HELP_JINGLE"/>
+ <element name="INITIAL_JINGLE"/>
+ <element name="LISTEN_JINGLE"/>
+ <element name="POSITIVE_JINGLE"/>
+ <element name="NEGATIVE_JINGLE"/>
+ </enum>
+ <enum name="TBTState">
+ <description>Enumeration that describes possible states of turn-by-turn client or SmartDeviceLink app.</description>
+ <element name="ROUTE_UPDATE_REQUEST"/>
+ <element name="ROUTE_ACCEPTED"/>
+ <element name="ROUTE_REFUSED"/>
+ <element name="ROUTE_CANCELLED"/>
+ <element name="ETA_REQUEST"/>
+ <element name="NEXT_TURN_REQUEST"/>
+ <element name="ROUTE_STATUS_REQUEST"/>
+ <element name="ROUTE_SUMMARY_REQUEST"/>
+ <element name="TRIP_STATUS_REQUEST"/>
+ <element name="ROUTE_UPDATE_REQUEST_TIMEOUT"/>
+ </enum>
+ <enum name="ApplicationsCloseReason">
+ <description>Describes the reasons for exiting all of applications.</description>
+ <element name="IGNITION_OFF"/>
+ <element name="MASTER_RESET"/>
+ <element name="FACTORY_DEFAULTS"/>
+ <element name="SUSPEND" />
+ </enum>
+ <enum name="DisplayType">
+ <description>The possible types of HU display.</description>
+ <element name="CID">
+ <description> A 2-line x 20 character "dot matrix" display </description>
+ </element>
+ <element name="TYPE2">
+ <description> 1 line older radio head unit.</description>
+ </element>
+ <element name="TYPE5">
+ <description> Old radio head unit.</description>
+ </element>
+ <element name="NGN">
+ <description> Next Generation Navigation display.</description>
+ </element>
+ <element name="GEN2_8_DMA">
+ <description> GEN-2, 8 inch display.</description>
+ </element>
+ <element name="GEN2_6_DMA">
+ <description> GEN-2, 6 inch display.</description>
+ </element>
+ <element name="MFD3">
+ <description> 3 inch GEN1.1 display </description>
+ </element>
+ <element name="MFD4">
+ <description> 4 inch GEN1.1 display </description>
+ </element>
+ <element name="MFD5">
+ <description> 5 inch GEN1.1 display </description>
+ </element>
+ <element name="GEN3_8_INCH"/>
+ </enum>
+ <enum name="ImageType">
+ <description>Contains information about the type of image.</description>
+ <element name="STATIC"/>
+ <element name="DYNAMIC"/>
+ </enum>
+ <enum name="ApplicationToNONEReason">
+ <description>Describes the reasons of moving the app to NONE.</description>
+ <element name="DRIVER_DISTRACTION_VIOLATION" />
+ <element name="USER_EXIT" />
+ </enum>
+ <enum name="TextFieldName">
+ <element name="mainField1">
+ <description>The first line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+ <element name="mainField2">
+ <description>The second line of first set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+ <element name="mainField3">
+ <description>The first line of second set of main fields of persistent display; applies to "Show"</description>
+ </element>
+ <element name="mainField4">
+ <description>The second line of second set of main fields of the persistent display; applies to "Show"</description>
+ </element>
+ <element name="statusBar">
+ <description>The status bar on NGN; applies to "Show"</description>
+ </element>
+ <element name="mediaClock">
+ <description>Text value for MediaClock field; applies to "Show"</description>
+ </element>
+ <element name="mediaTrack">
+ <description>The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show"</description>
+ </element>
+ <element name="alertText1">
+ <description>The first line of the alert text field; applies to "Alert"</description>
+ </element>
+ <element name="alertText2">
+ <description>The second line of the alert text field; applies to "Alert"</description>
+ </element>
+ <element name="alertText3">
+ <description>The third line of the alert text field; applies to "Alert"</description>
+ </element>
+ <element name="scrollableMessageBody">
+ <description>Long form body of text that can include newlines and tabs; applies to "ScrollableMessage"</description>
+ </element>
+ <element name="initialInteractionText">
+ <description> First line suggestion for a user response (in the case of VR enabled interaction</description>
+ </element>
+ <element name="navigationText1">
+ <description> First line of navigation text</description>
+ </element>
+ <element name="navigationText2">
+ <description> Second line of navigation text</description>
+ </element>
+ <element name="ETA">
+ <description> Estimated Time of Arrival time for navigation</description>
+ </element>
+ <element name="totalDistance">
+ <description> Total distance to destination for navigation</description>
+ </element>
+ <element name="audioPassThruDisplayText1">
+ <description> First line of text for audio pass thru</description>
+ </element>
+ <element name="audioPassThruDisplayText2">
+ <description> Second line of text for audio pass thru</description>
+ </element>
+ <element name="sliderHeader">
+ <description> Header text for slider</description>
+ </element>
+ <element name="sliderFooter">
+ <description> Footer text for slider</description>
+ </element>
+ <element name="menuName">
+ <description> Primary text for Choice</description>
+ </element>
+ <element name="secondaryText">
+ <description> Secondary text for Choice</description>
+ </element>
+ <element name="tertiaryText">
+ <description> Tertiary text for Choice</description>
+ </element>
+ <element name="menuTitle">
+ <description> Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </element>
+ <element name="timeToDestination"/>
+ <element name="navigationText">
+ <description>Navigation text for UpdateTurnList.</description>
+ </element>
+ <element name="notificationText">
+ <description>Text of notification to be displayed on screen.</description>
+ </element>
+ <!-- TO DO to be removed -->
+ <element name="turnText"/>
+ </enum>
+ <enum name="ImageFieldName">
+ <element name="softButtonImage">
+ <description>The image field for SoftButton</description>
+ </element>
+ <element name="choiceImage">
+ <description>The first image field for Choice</description>
+ </element>
+ <element name="choiceSecondaryImage">
+ <description>The secondary image field for Choice</description>
+ </element>
+ <element name="vrHelpItem">
+ <description>The image field for vrHelpItem</description>
+ </element>
+ <element name="turnIcon">
+ <description>The image field for Turn</description>
+ </element>
+ <element name="menuIcon">
+ <description>The image field for the menu icon in SetGlobalProperties</description>
+ </element>
+ <element name="cmdIcon">
+ <description>The image field for AddCommand</description>
+ </element>
+ <element name="appIcon">
+ <description>The image field for the app icon (set by setAppIcon)</description>
+ </element>
+ <element name="graphic">
+ <description>The image field for Show</description>
+ </element>
+ <element name="showConstantTBTIcon">
+ <description>The primary image field for ShowConstantTBT</description>
+ </element>
+ <element name="showConstantTBTNextTurnIcon">
+ <description>The secondary image field for ShowConstantTBT</description>
+ </element>
+ <element name="locationImage">
+ <description>The optional image of a destination / location</description>
+ </element>
+ </enum>
+ <enum name="TextAlignment">
+ <description>The list of possible alignments, left, right, or centered</description>
+ <element name="LEFT_ALIGNED"/>
+ <element name="RIGHT_ALIGNED"/>
+ <element name="CENTERED"/>
+ </enum>
+ <enum name="DriverDistractionState">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON"/>
+ <element name="DD_OFF"/>
+ </enum>
+ <enum name="MediaClockFormat">
+ <element name="CLOCK1">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;
+ Is used for Type II, NGN and CID head units.
+ </description>
+ </element>
+ <element name="CLOCK2">
+ <description>
+ minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;
+ Is used for Type V head units.
+ </description>
+ </element>
+ <element name="CLOCK3">
+ <description>
+ minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59;
+ Is used for GEN1.1 (i.e. MFD3/4/5) head units.
+ </description>
+ </element>
+ <element name="CLOCKTEXT1">
+ <description>
+ 5 characters possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters
+ :|sp : colon or space
+ Is used for Type II head unit
+ </description>
+ </element>
+ <element name="CLOCKTEXT2">
+ <description>
+ 5 chars possible
+ Format: 1|sp c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters
+ :|sp : colon or space
+ Is used for CID and NGN head unit
+ </description>
+ </element>
+ <element name="CLOCKTEXT3">
+ <description>
+ 6 chars possible
+ Format: 1|sp c c :|sp c c
+ 1|sp : digit "1" or space
+ c : character out of following character set: sp|0-9|[letters
+ :|sp : colon or space
+ Is used for Type V head unit
+ </description>
+ </element>
+ <element name="CLOCKTEXT4">
+ <description>
+ 6 chars possible
+ Format: c :|sp c c : c c
+ :|sp : colon or space
+ c : character out of following character set: sp|0-9|[letters].
+ Is used for GEN1.1 (i.e. MFD3/4/5) head units
+ </description>
+ </element>
+ </enum>
+ <enum name="VRCommandType">
+ <element name="Choice">
+ <description>Type that expound that current AddCommand should be pocessed as choise for initiated PerformInteraction request for current active on HMI.</description>
+ </element>
+ <element name="Command">
+ <description>Type that expound that current AddCommand should be pocessed as common command for current application on HMI.</description>
+ </element>
+ </enum>
+ <!--IVI part-->
+ <enum name="ComponentVolumeStatus">
+ <description>The volume status of a vehicle component.</description>
+ <element name="UNKNOWN" internal_name="CVS_UNKNOWN">
+ <description> The data is unknown.</description>
+ </element>
+ <element name="NORMAL" internal_name="CVS_NORMAL">
+ <description> The volume is normal.</description>
+ </element>
+ <element name="LOW" internal_name="CVS_LOW">
+ <description> The volume is low.</description>
+ </element>
+ <element name="FAULT" internal_name="CVS_FAULT">
+ <description> The module/sensor is currently faulted. </description>
+ </element>
+ <element name="ALERT" internal_name="CVS_ALERT">
+ <description> The component`s volume is in critical level.</description>
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="CVS_NOT_SUPPORTED">
+ <description> The data is not supported.</description>
+ </element>
+ </enum>
+ <enum name="PRNDL">
+ <description>The selected gear.</description>
+ <element name="PARK">
+ <description>Parking</description>
+ </element>
+ <element name="REVERSE">
+ <description>Reverse gear</description>
+ </element>
+ <element name="NEUTRAL">
+ <description>No gear</description>
+ </element>
+ <element name="DRIVE">
+ </element>
+ <element name="SPORT">
+ <description>Drive Sport mode</description>
+ </element>
+ <element name="LOWGEAR">
+ <description>1st gear hold</description>
+ </element>
+ <element name="FIRST">
+ </element>
+ <element name="SECOND">
+ </element>
+ <element name="THIRD">
+ </element>
+ <element name="FOURTH">
+ </element>
+ <element name="FIFTH">
+ </element>
+ <element name="SIXTH">
+ </element>
+ <element name="SEVENTH">
+ </element>
+ <element name="EIGHTH">
+ </element>
+ <element name="FAULT">
+ </element>
+ </enum>
+ <enum name="VehicleDataEventStatus">
+ <description>Reflects the status of a vehicle data event; e.g. a seat belt event status.</description>
+ <element name="NO_EVENT" internal_name="VDES_NO_EVENT">
+ <description> The system does not have the adequate information to send valid YES or NO states.</description>
+ </element>
+ <element name="NO" internal_name="VDES_NO">
+ <description> The requested event is in NO state.</description>
+ </element>
+ <element name="YES" internal_name="VDES_YES">
+ <description> The requested event is in YES state.</description>
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="VDES_NOT_SUPPORTED">
+ <description> The requested data is not supported </description>
+ </element>
+ <element name="FAULT" internal_name="VDES_FAULT">
+ <description> The module/sensor is currently faulted.</description>
+ </element>
+ </enum>
+ <enum name="VehicleDataStatus">
+ <description>Reflects the status of a binary vehicle data item.</description>
+ <element name="NO_DATA_EXISTS" internal_name="VDS_NO_DATA_EXISTS">
+ </element>
+ <element name="OFF" internal_name="VDS_OFF">
+ </element>
+ <element name="ON" internal_name="VDS_ON">
+ </element>
+ </enum>
+ <enum name="IgnitionStableStatus">
+ <description>Reflects the ignition switch stability.</description>
+ <element name="IGNITION_SWITCH_NOT_STABLE">
+ </element>
+ <element name="IGNITION_SWITCH_STABLE">
+ </element>
+ <element name="MISSING_FROM_TRANSMITTER">
+ <description> Either the data is not accessible or the sensor is broken.</description>
+ </element>
+ </enum>
+ <enum name="IgnitionStatus">
+ <description>Reflects the status of ignition.</description>
+ <element name="UNKNOWN" internal_name="IS_UNKNOWN">
+ <description> The information is not acceptable. </description>
+ </element>
+ <element name="OFF" internal_name="IS_OFF">
+ <description> The ignition is off.</description>
+ </element>
+ <element name="ACCESSORY" internal_name="IS_ACCESSORY">
+ <description> The accessories are active (power windows, audio, display, etc.).</description>
+ </element>
+ <element name="RUN" internal_name="IS_RUN">
+ <description> Ignition is active.</description>
+ </element>
+ <element name="START" internal_name="IS_START">
+ <description> Starter is switched.</description>
+ </element>
+ <element name="INVALID" internal_name="IS_INVALID">
+ <description> The data is provided, but there is some sort of fault or problem.</description>
+ </element>
+ </enum>
+ <enum name="DeviceLevelStatus">
+ <description>Reflects the reported component status of the connected device, if reported.</description>
+ <element name="ZERO_LEVEL_BARS">
+ </element>
+ <element name="ONE_LEVEL_BARS">
+ </element>
+ <element name="TWO_LEVEL_BARS">
+ </element>
+ <element name="THREE_LEVEL_BARS">
+ </element>
+ <element name="FOUR_LEVEL_BARS">
+ </element>
+ <element name="NOT_PROVIDED">
+ </element>
+ </enum>
+ <enum name="PrimaryAudioSource">
+ <description>Reflects the current primary audio source (if selected).</description>
+ <element name="NO_SOURCE_SELECTED">
+ </element>
+ <element name="USB">
+ </element>
+ <element name="USB2">
+ </element>
+ <element name="BLUETOOTH_STEREO_BTST">
+ </element>
+ <element name="LINE_IN">
+ </element>
+ <element name="IPOD">
+ </element>
+ <element name="MOBILE_APP">
+ </element>
+ </enum>
+ <enum name="CompassDirection">
+ <description>The list of potential compass directions</description>
+ <element name="NORTH">
+ </element>
+ <element name="NORTHWEST">
+ </element>
+ <element name="WEST">
+ </element>
+ <element name="SOUTHWEST">
+ </element>
+ <element name="SOUTH">
+ </element>
+ <element name="SOUTHEAST">
+ </element>
+ <element name="EAST">
+ </element>
+ <element name="NORTHEAST">
+ </element>
+ </enum>
+ <enum name="Dimension">
+ <description>The supported dimensions of the GPS</description>
+ <element name="NO_FIX" internal_name="Dimension_NO_FIX">
+ <description>No GPS at all</description>
+ </element>
+ <element name="2D" internal_name="Dimension_2D">
+ <description>Longitude and lattitude</description>
+ </element>
+ <element name="3D" internal_name="Dimension_3D">
+ <description>Longitude and lattitude and altitude</description>
+ </element>
+ </enum>
+ <enum name="TouchType">
+ <element name="BEGIN"/>
+ <element name="MOVE"/>
+ <element name="END"/>
+ </enum>
+ <enum name="WarningLightStatus">
+ <description>Reflects the status of a cluster instrument warning light.</description>
+ <element name="OFF" internal_name="WLS_OFF">
+ </element>
+ <element name="ON" internal_name="WLS_ON">
+ </element>
+ <element name="FLASH" internal_name="WLS_FLASH">
+ </element>
+ <element name="NOT_USED" internal_name="WLS_NOT_USED">
+ </element>
+ </enum>
+ <enum name="VehicleDataResultCode">
+ <description>Enumeration that describes possible result codes of a vehicle data entry request.</description>
+ <element name="SUCCESS" internal_name="VDRC_SUCCESS"/>
+ <element name="TRUNCATED_DATA" internal_name="VDRC_TRUNCATED_DATA"/>
+ <element name="DISALLOWED" internal_name="VDRC_DISALLOWED"/>
+ <element name="USER_DISALLOWED" internal_name="VDRC_USER_DISALLOWED"/>
+ <element name="INVALID_ID" internal_name="VDRC_INVALID_ID"/>
+ <element name="VEHICLE_DATA_NOT_AVAILABLE" internal_name="VDRC_DATA_NOT_AVAILABLE"/>
+ <element name="DATA_ALREADY_SUBSCRIBED" internal_name="VDRC_DATA_ALREADY_SUBSCRIBED"/>
+ <element name="DATA_NOT_SUBSCRIBED" internal_name="VDRC_DATA_NOT_SUBSCRIBED"/>
+ <element name="IGNORED" internal_name="VDRC_IGNORED"/>
+ </enum>
+ <enum name="VehicleDataType">
+ <description>Defines the data types that can be published and subscribed to.</description>
+ <element name="VEHICLEDATA_GPS">
+ <description>Notifies GPSData may be subscribed</description>
+ </element>
+ <element name="VEHICLEDATA_SPEED"/>
+ <element name="VEHICLEDATA_RPM"/>
+ <element name="VEHICLEDATA_FUELLEVEL"/>
+ <element name="VEHICLEDATA_FUELLEVEL_STATE"/>
+ <element name="VEHICLEDATA_FUELCONSUMPTION"/>
+ <element name="VEHICLEDATA_EXTERNTEMP"/>
+ <element name="VEHICLEDATA_VIN"/>
+ <element name="VEHICLEDATA_PRNDL"/>
+ <element name="VEHICLEDATA_TIREPRESSURE"/>
+ <element name="VEHICLEDATA_ODOMETER"/>
+ <element name="VEHICLEDATA_BELTSTATUS"/>
+ <element name="VEHICLEDATA_BODYINFO"/>
+ <element name="VEHICLEDATA_DEVICESTATUS"/>
+ <element name="VEHICLEDATA_ECALLINFO"/>
+ <element name="VEHICLEDATA_AIRBAGSTATUS"/>
+ <element name="VEHICLEDATA_EMERGENCYEVENT"/>
+ <element name="VEHICLEDATA_CLUSTERMODESTATUS"/>
+ <element name="VEHICLEDATA_MYKEY"/>
+ <element name="VEHICLEDATA_BRAKING"/>
+ <element name="VEHICLEDATA_WIPERSTATUS"/>
+ <element name="VEHICLEDATA_HEADLAMPSTATUS"/>
+ <element name="VEHICLEDATA_BATTVOLTAGE"/>
+ <element name="VEHICLEDATA_ENGINETORQUE"/>
+ <element name="VEHICLEDATA_ACCPEDAL"/>
+ <element name="VEHICLEDATA_STEERINGWHEEL"/>
+ </enum>
+ <enum name="WiperStatus">
+ <description>Reflects the status of the wipers.</description>
+ <element name="OFF">
+ <description> The wipers are off.</description>
+ </element>
+ <element name="AUTO_OFF">
+ <description> The wipers are automatically off </description>
+ </element>
+ <element name="OFF_MOVING">
+ <description> Means that though set to off, somehow the wipers have been engaged (physically moved enough to engage a wiping motion).</description>
+ </element>
+ <element name="MAN_INT_OFF">
+ <description> The wipers are manually off after having been working.</description>
+ </element>
+ <element name="MAN_INT_ON">
+ <description> The wipers are manually on.</description>
+ </element>
+ <element name="MAN_LOW">
+ <description> The wipers are manually set to low speed.</description>
+ </element>
+ <element name="MAN_HIGH">
+ <description> The wipers are manually set to high speed.</description>
+ </element>
+ <element name="MAN_FLICK">
+ <description> The wipers are manually set for doing a flick.</description>
+ </element>
+ <element name="WASH">
+ <description> The wipers are set to use the water from vehicle washer bottle for cleaning the windscreen.</description>
+ </element>
+ <element name="AUTO_LOW">
+ <description> The wipers are automatically set to low speed.</description>
+ </element>
+ <element name="AUTO_HIGH">
+ <description> The wipers are automatically set to high speed.</description>
+ </element>
+ <element name="COURTESYWIPE">
+ <description> This is for when a user has just initiated a WASH and several seconds later a secondary wipe is automatically initiated to clear remaining fluid.</description>
+ </element>
+ <element name="AUTO_ADJUST">
+ <description> This is set as the user moves between possible automatic wiper speeds.</description>
+ </element>
+ <element name="STALLED">
+ <description> The wiper is stalled to its place. </description>
+ </element>
+ <element name="NO_DATA_EXISTS">
+ <description> The sensor / module cannot provide any information for wiper.</description>
+ </element>
+ </enum>
+ <enum name="SamplingRate">
+ <description>Describes different sampling options for PerformAudioPassThru.</description>
+ <element name="8KHZ" internal_name="RATE_8KHZ"/>
+ <element name="16KHZ" internal_name="RATE_16KHZ"/>
+ <element name="22KHZ" internal_name="RATE_22KHZ"/>
+ <element name="44KHZ" internal_name="RATE_44KHZ"/>
+ </enum>
+ <enum name="BitsPerSample">
+ <description>Describes different quality options for PerformAudioPassThru.</description>
+ <element name="8_BIT" internal_name="RATE_8_BIT"/>
+ <element name="16_BIT" internal_name="RATE_16_BIT"/>
+ </enum>
+ <enum name="AudioType">
+ <description>Describes different audio type options for PerformAudioPassThru.</description>
+ <element name="PCM"/>
+ </enum>
+ <enum name="KeyboardLayout">
+ <description>Enumeration listing possible keyboard layouts.</description>
+ <element name="QWERTY"/>
+ <element name="QWERTZ"/>
+ <element name="AZERTY"/>
+ </enum>
+ <enum name="KeyboardEvent">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="KEYPRESS"/>
+ <element name="ENTRY_SUBMITTED"/>
+ <element name="ENTRY_CANCELLED"/>
+ <element name="ENTRY_ABORTED"/>
+ </enum>
+ <enum name="KeypressMode">
+ <description>Enumeration listing possible keyboard events.</description>
+ <element name="SINGLE_KEYPRESS">
+ <description>Each keypress is individually sent as the user presses the keyboard keys.</description>
+ </element>
+ <element name="QUEUE_KEYPRESSES">
+ <description>The keypresses are queued and a string is eventually sent once the user chooses to submit their entry.</description>
+ </element>
+ <element name="RESEND_CURRENT_ENTRY">
+ <description>The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry.</description>
+ </element>
+ </enum>
+ <enum name="AmbientLightStatus">
+ <description>Reflects the status of the ambient light sensor.</description>
+ <element name="NIGHT"/>
+ <element name="TWILIGHT_1"/>
+ <element name="TWILIGHT_2"/>
+ <element name="TWILIGHT_3"/>
+ <element name="TWILIGHT_4"/>
+ <element name="DAY"/>
+ <element name="UNKNOWN"/>
+ <element name="INVALID"/>
+ </enum>
+ <enum name="FileType">
+ <description>Enumeration listing possible file types.</description>
+ <element name="GRAPHIC_BMP"/>
+ <element name="GRAPHIC_JPEG"/>
+ <element name="GRAPHIC_PNG"/>
+ <element name="AUDIO_WAVE"/>
+ <element name="AUDIO_MP3"/>
+ <element name="AUDIO_AAC"/>
+ <element name="BINARY"/>
+ <element name="JSON"/>
+ </enum>
+ <enum name="RequestType">
+ <description>Enumeration listing possible asynchronous requests.</description>
+ <element name="HTTP"/>
+ <element name="FILE_RESUME"/>
+ <element name="AUTH_REQUEST"/>
+ <element name="AUTH_CHALLENGE"/>
+ <element name="AUTH_ACK"/>
+ <element name="PROPRIETARY"/>
+ </enum>
+ <enum name="ECallConfirmationStatus">
+ <description>Reflects the status of the eCall Notification.</description>
+ <element name="NORMAL" internal_name="ECCS_NORMAL">
+ </element>
+ <element name="CALL_IN_PROGRESS" internal_name="ECCS_CALL_IN_PROGRESS">
+ </element>
+ <element name="CALL_CANCELLED" internal_name="ECCS_CALL_CANCELLED">
+ </element>
+ <element name="CALL_COMPLETED">
+ </element>
+ <element name="CALL_UNSUCCESSFUL" internal_name="ECCS_CALL_UNSUCCESSFUL">
+ </element>
+ <element name="ECALL_CONFIGURED_OFF" internal_name="ECCS_ECALL_CONFIGURED_OFF">
+ </element>
+ <element name="CALL_COMPLETE_DTMF_TIMEOUT" internal_name="ECCS_CALL_COMPLETE_DTMF_TIMEOUT">
+ </element>
+ </enum>
+ <enum name="VehicleDataNotificationStatus">
+ <description>Reflects the status of a vehicle data notification.</description>
+ <element name="NOT_SUPPORTED" internal_name="VDNS_NOT_SUPPORTED">
+ </element>
+ <element name="NORMAL" internal_name="VDNS_NORMAL">
+ </element>
+ <element name="ACTIVE" internal_name="VDNS_ACTIVE">
+ </element>
+ <element name="NOT_USED" internal_name="VDNS_NOT_USED">
+ </element>
+ </enum>
+ <enum name="EmergencyEventType">
+ <description>Reflects the emergency event status of the vehicle.</description>
+ <element name="NO_EVENT" internal_name="EET_NO_EVENT">
+ </element>
+ <element name="FRONTAL" internal_name="EET_FRONTAL">
+ </element>
+ <element name="SIDE" internal_name="EET_SIDE">
+ </element>
+ <element name="REAR" internal_name="EET_REAR">
+ </element>
+ <element name="ROLLOVER" internal_name="EET_ROLLOVER">
+ </element>
+ <element name="NOT_SUPPORTED" internal_name="EET_NOT_SUPPORTED">
+ </element>
+ <element name="FAULT" internal_name="EET_FAULT">
+ </element>
+ </enum>
+ <enum name="FuelCutoffStatus">
+ <description>Reflects the status of the RCM fuel cutoff.</description>
+ <element name="TERMINATE_FUEL" internal_name="FCS_TERMINATE_FUEL">
+ </element>
+ <element name="NORMAL_OPERATION" internal_name="FCS_NORMAL_OPERATION">
+ </element>
+ <element name="FAULT" internal_name="FCS_FAULT">
+ </element>
+ </enum>
+ <enum name="PowerModeQualificationStatus">
+ <description>Reflects the status of the current power mode qualification.</description>
+ <element name="POWER_MODE_UNDEFINED">
+ </element>
+ <element name="POWER_MODE_EVALUATION_IN_PROGRESS">
+ </element>
+ <element name="NOT_DEFINED">
+ </element>
+ <element name="POWER_MODE_OK">
+ </element>
+ </enum>
+ <enum name="CarModeStatus">
+ <description>Reflects the status of the current car mode.</description>
+ <element name="NORMAL" internal_name="CMS_NORMAL">
+ </element>
+ <element name="FACTORY" internal_name="CMS_FACTORY">
+ </element>
+ <element name="TRANSPORT" internal_name="CMS_TRANSPORT">
+ </element>
+ <element name="CRASH" internal_name="CMS_CRASH">
+ </element>
+ </enum>
+ <enum name="PowerModeStatus">
+ <description>Reflects the status of the current power mode.</description>
+ <element name="KEY_OUT">
+ </element>
+ <element name="KEY_RECENTLY_OUT">
+ </element>
+ <element name="KEY_APPROVED_0">
+ </element>
+ <element name="POST_ACCESORY_0">
+ </element>
+ <element name="ACCESORY_1">
+ </element>
+ <element name="POST_IGNITION_1">
+ </element>
+ <element name="IGNITION_ON_2">
+ </element>
+ <element name="RUNNING_2">
+ </element>
+ <element name="CRANK_3">
+ </element>
+ </enum>
+ <enum name="CharacterSet">
+ <description>The list of potential character sets</description>
+ <element name="TYPE2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="TYPE5SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID1SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ </enum>
+ <!-- End of IVI part-->
+ <enum name="AppPriority">
+ <element name="EMERGENCY"/>
+ <element name="NAVIGATION"/>
+ <element name="VOICE_COMMUNICATION"/>
+ <element name="COMMUNICATION"/>
+ <element name="NORMAL"/>
+ <element name="NONE"/>
+ </enum>
+<enum name="SpeakType">
+ <description>Defines the type of the request which causes text-to-speech prompt</description>
+ <element name="ALERT" />
+ <element name="SPEAK" />
+</enum>
+
+<enum name="AlertType">
+<description>Defines the type of the request which causes text-to-speech prompt</description>
+<element name="UI" />
+<element name="BOTH" />
+</enum>
+
+<enum name="HMILevel">
+ <element name="FULL"/>
+ <element name="LIMITED" />
+ <element name="BACKGROUND"/>
+ <element name="NONE"/>
+</enum>
+
+ <!-- Policies -->
+ <enum name="UpdateResult">
+ <element name="UP_TO_DATE"/>
+ <element name="UPDATING"/>
+ <element name="UPDATE_NEEDED"/>
+ </enum>
+ <enum name="SystemError">
+ <element name="SYNC_REBOOTED"/>
+ <element name="SYNC_OUT_OF_MEMMORY"/>
+ </enum>
+ <enum name="StatisticsType">
+ <element name="iAPP_BUFFER_FULL"/>
+ </enum>
+ <enum name="ConsentSource">
+ <element name="GUI"/>
+ <element name="VUI"/>
+ </enum>
+ <enum name="DeviceState">
+ <element name="UNKNOWN"/>
+ <element name="UNPAIRED"/>
+ </enum>
+ <struct name="UserFriendlyMessage" scope="internal">
+ <param name="messageCode" type="String" mandatory="true"/>
+ <param name="ttsString" type="String" mandatory="false"/>
+ <param name="label" type="String" mandatory="false"/>
+ <param name="line1" type="String" mandatory="false"/>
+ <param name="line2" type="String" mandatory="false"/>
+ <param name="textBody" type="String" mandatory="false"/>
+ </struct>
+ <struct name="PermissionItem">
+ <param name="name" type="String" mandatory="true">
+ <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
+ </param>
+ <param name="id" type="Integer" mandatory="true">
+ <description>Id of corresponding functional group, needed by SDL.</description>
+ </param>
+ <param name="allowed" type="Boolean" mandatory="false">
+ <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
+ </param>
+ </struct>
+ <struct name="ServiceInfo">
+ <param name="url" type="String" mandatory="true">
+ <description>Get URL based on service type.</description>
+ </param>
+ <param name="policyAppId" type="String" mandatory="false">
+ <description>Used if URL needed are specific for application.</description>
+ </param>
+ </struct>
+ <!-- End of Policies -->
+ <struct name="TextField">
+ <param name="name" type="Common.TextFieldName">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="Common.CharacterSet">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+ <struct name="ButtonCapabilities">
+ <description>Contains the information about capabilities of a button.</description>
+ <param name="name" type="Common.ButtonName" mandatory="true">
+ <description>The name of the Button from the ButtonName enum</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a short press. Whenever the button is pressed short, onButtonPressed(SHORT) should be invoked.</description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a LONG press. Whenever the button is pressed long, onButtonPressed(LONG) should be invoked.</description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent(DOWN) should be invoked. Whenever the button is released, onButtonEvent(UP) should be invoked.</description>
+ </param>
+ </struct>
+ <struct name="VehicleDataResult">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="Common.VehicleDataType">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="Common.VehicleDataResultCode">
+ <description>Published data result code.</description>
+ </param>
+ </struct>
+ <struct name="TouchCoord">
+ <param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The x coordinate of the touch.</description>
+ </param>
+ <param name="y" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
+ <description>The y coordinate of the touch.</description>
+ </param>
+ </struct>
+ <struct name="TouchEvent">
+ <param name="id" type="Integer" mandatory="true" minvalue="0" maxvalue="9">
+ <description>
+ A touch's unique identifier. The application can track the current touch events by id.
+ If a touch event has type begin, the id should be added to the set of touches.
+ If a touch event has type end, the id should be removed from the set of touches.
+ </description>
+ </param>
+ <param name="ts" type="Integer" mandatory="true" array="true" minvalue="0" maxvalue="2147483647" minsize="1" maxsize="1000">
+ <description>
+ The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds.
+ The timestamp is used to determined the rate of change of position of a touch.
+ The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user.
+ If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array.
+ </description>
+ </param>
+ <param name="c" type="Common.TouchCoord" mandatory="true" array="true" minsize="1" maxsize="1000">
+ </param>
+ </struct>
+ <struct name="PresetBankCapabilities">
+ <description>Contains information about on-screen preset capabilities (whether the HW preset buttons could be duplicated with onscreen buttons).</description>
+ <param name="onScreenPresetsAvailable" type="Boolean" mandatory="true">
+ <description>Must be true if onscreen custom presets are available.</description>
+ </param>
+ </struct>
+ <struct name="Image">
+ <param name="value" maxlength="65535" type="String" mandatory="true">
+ <description>The path to the dynamic image stored on HU or the static binary image itself.</description>
+ </param>
+ <param name="imageType" type="Common.ImageType" mandatory="true">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+ </struct>
+ <struct name="SoftButton">
+ <param name="type" type="Common.SoftButtonType" mandatory="true">
+ <description>Describes, whether text, icon or both text and image should be displayed on the soft button. See softButtonType</description>
+ </param>
+ <param name="text" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to be displayed (if defined as TEXT or BOTH)</description>
+ </param>
+ <param name="image" type="Common.Image" mandatory="false">
+ <description>Optional image struct for SoftButton (if defined as IMAGE or BOTH)</description>
+ </param>
+ <param name="isHighlighted" type="Boolean" mandatory="false">
+ <description>If true, must be highlighted</description>
+ <description>If false, must be not</description>
+ </param>
+ <param name="softButtonID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Value which must be returned via OnButtonPress / OnButtonEvent</description>
+ </param>
+ <param name="systemAction" type="Common.SystemAction" mandatory="true">
+ <description>Parameter indicates whether clicking a SoftButton must call a specific system action. See SystemAction</description>
+ </param>
+ </struct>
+ <struct name="TTSChunk">
+ <description>A TTS chunk, that consists of the text/phonemes to be spoken</description>
+ <param name="text" type="String" mandatory="true" maxlength="500">
+ <description>The text or phonemes to be spoken.</description>
+ </param>
+ <param name="type" type="Common.SpeechCapabilities" mandatory="true">
+ <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities.</description>
+ </param>
+ </struct>
+ <struct name="HMIApplication">
+ <description>Data type containing information about application needed by HMI.</description>
+ <param name="appName" type="String" maxlength="100" mandatory="true">
+ <description>The mobile application name, e.g. "Ford Drive Green".</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Provides an abbreviated version of the app name (if needed), that may be displayed on the NGN media screen.</description>
+ <description>If not provided, the appName should be used instead (and may be truncated if too long)</description>
+ </param>
+ <param name="icon" type="String" mandatory="false">
+ <description>Path to application icon stored on HU.</description>
+ </param>
+ <param name="deviceName" type="String" mandatory="true">
+ <description>The name of device which the provided application is running on.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Unique (during ignition cycle) id of the application. To be used in all RPCs sent by both HU system and SDL</description>
+ </param>
+ <param name="hmiDisplayLanguageDesired" type="Common.Language" mandatory="true">
+ <description>The language the application intends to use on HU </description>
+ </param>
+ <param name="isMediaApplication" type="Boolean" mandatory="true">
+ <description>Indicates whether it is a media or a non-media application.</description>
+ </param>
+ <param name="appType" type="Common.AppHMIType" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>List of all applicable app types stating which classifications to be given to the app.</description>
+ <description>e.g. for platforms like GEN2, this determines which "corner(s)" the app can populate.</description>
+ </param>
+ </struct>
+ <struct name="MenuParams">
+ <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>unique ID of the sub menu, the command must be added to.</description>
+ <description>If not provided, the command must be added to the top level of the in application menu.</description>
+ </param>
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>Position within the items that are at the top level of the in application menu.</description>
+ <description>0 should insert at the front.</description>
+ <description>1 should insert at the second position.</description>
+ <description>if position is greater than or equal to the number of items on the top level, the the sub menu/command should be appended to the end.</description>
+ <description>If this param is omitted the entry should be added at the end.</description>
+ </param>
+ <param name="menuName" type="String" maxlength="500" mandatory="true">
+ <description>The name of the sub menu/command.</description>
+ </param>
+ </struct>
+ <struct name="Choice">
+ <description>A choice is an option given to the user which can be selected either by menu, or through voice recognition system.</description>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description> The unique within the concerned application identifier for this choice </description>
+ </param>
+ <param name="menuName" type="String" maxlength="500" mandatory="false">
+ <description> The name of the choice </description>
+ </param>
+ <param name="image" type="Common.Image" mandatory="false">
+ <description> The image for representing the choice </description>
+ </param>
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
+ </param>
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
+ </param>
+ <param name="secondaryImage" type="Image" mandatory="false">
+ <description>Optional secondary image struct for choice</description>
+ </param>
+ </struct>
+ <struct name="VrHelpItem">
+ <param name="text" maxlength="500" type="String" mandatory="true">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Common.Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
+ <description>Position to display item in VR Help list</description>
+ </param>
+ </struct>
+ <struct name="TimeFormat">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <description>The hour of the media clock.</description>
+ <description>Some units only support a max of 19 hours. If out of range, it should be rejected.</description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ </struct>
+ <struct name="TouchEventCapabilities">
+ <param name="pressAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="multiTouchAvailable" type="Boolean" mandatory="true">
+ </param>
+ <param name="doublePressAvailable" type="Boolean" mandatory="true">
+ </param>
+ </struct>
+ <struct name="ImageResolution">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution height.</description>
+ </param>
+ </struct>
+ <struct name="ScreenParams">
+ <param name="resolution" type="Common.ImageResolution" mandatory="true">
+ <description>The resolution of the prescribed screen area.</description>
+ </param>
+ <param name="touchEventAvailable" type="Common.TouchEventCapabilities" mandatory="false">
+ <description>Types of screen touch events available in screen area.</description>
+ </param>
+ </struct>
+ <struct name="ImageField">
+ <param name="name" type="Common.ImageFieldName" mandatory="true">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="Common.FileType" maxsize="100" array="true" mandatory="false" minsize="1">
+ <description>The image types that are supported in this field. See FileType.</description>
+ </param>
+ <param name="imageResolution" type="Common.ImageResolution" mandatory="false">
+ <description>The image resolution of this field.</description>
+ </param>
+ </struct>
+ <struct name="DisplayCapabilities">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="Common.DisplayType" mandatory="true">
+ <description>The type of the display. See DisplayType</description>
+ </param>
+ <param name="textFields" type="Common.TextField" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all fields for text displaying supported by HU. See TextFieldName.</description>
+ <description>If there are no textfields supported, the empty array must be returned</description>
+ </param>
+ <param name="imageFields" type="Common.ImageField" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>A set of all fields that support images. See ImageField</description>
+ </param>
+ <param name="mediaClockFormats" type="Common.MediaClockFormat" minsize="0" maxsize="100" array="true" mandatory="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="imageCapabilities" type="Common.ImageType" array="true" minsize="0" maxsize="2" mandatory="false">
+ </param>
+ <param name="graphicSupported" type="Boolean" mandatory="true">
+ <description>The display's persistent screen supports referencing a static or dynamic image.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="true">
+ <description>A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout.</description>
+ </param>
+ <param name="screenParams" type="Common.ScreenParams" mandatory="false">
+ <description>A set of all parameters related to a prescribed screen area (e.g. for video / touch input).</description>
+ </param>
+ <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
+ <description>The number of on-screen custom presets available (if any); otherwise omitted.</description>
+ </param>
+ </struct>
+ <struct name="SoftButtonCapabilities">
+ <description>Contains information about a SoftButton's capabilities.</description>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a short press.</description>
+ <description>Whenever the button is pressed short, onButtonPressed( SHORT) must be invoked.</description>
+ </param>
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
+ <description>The button supports a LONG press.</description>
+ <description>Whenever the button is pressed long, onButtonPressed( LONG) must be invoked.</description>
+ </param>
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
+ <description>The button supports "button down" and "button up".</description>
+ <description>Whenever the button is pressed, onButtonEvent( DOWN) must be invoked.</description>
+ <description>Whenever the button is released, onButtonEvent( UP) must be invoked.</description>
+ </param>
+ <param name="imageSupported" type="Boolean" mandatory="true">
+ <description>Must be true if the button supports referencing a static or dynamic image.</description>
+ </param>
+ </struct>
+ <struct name="AudioPassThruCapabilities">
+ <description>
+ Describes different audio type configurations for PerformAudioPassThru.
+ e.g. 8kHz,8-bit,PCM
+ </description>
+ <param name="samplingRate" type="Common.SamplingRate" mandatory="true"/>
+ <param name="bitsPerSample" type="Common.BitsPerSample" mandatory="true"/>
+ <param name="audioType" type="Common.AudioType" mandatory="true"/>
+ </struct>
+ <struct name="TextFieldStruct">
+ <param name="fieldName" type="Common.TextFieldName" mandatory="true">
+ <description>The name of the field for displaying the text.</description>
+ </param>
+ <param name="fieldText" type="String" maxlength="500" mandatory="true">
+ <description>The text itself.</description>
+ </param>
+ </struct>
+ <struct name="KeyboardProperties">
+ <description>Configuration of on-screen keyboard (if available).</description>
+ <param name="language" type="Common.Language" mandatory="false">
+ <description>The keyboard language.</description>
+ </param>
+ <param name="keyboardLayout" type="Common.KeyboardLayout" mandatory="false">
+ <description>Desired keyboard layout.</description>
+ </param>
+ <param name="keypressMode" type="Common.KeypressMode" mandatory="false">
+ <description>
+ Desired keypress mode.
+ If omitted, this value will be set to RESEND_CURRENT_ENTRY.
+ </description>
+ </param>
+ <param name="limitedCharacterList" type="String" maxlength="1" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Array of keyboard characters to enable.</description>
+ <description>All omitted characters will be greyed out (disabled) on the keyboard.</description>
+ <description>If omitted, the entire keyboard will be enabled.</description>
+ </param>
+ <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false">
+ <description>Allows an app to prepopulate the text field with a suggested or completed entry as the user types</description>
+ </param>
+ </struct>
+ <struct name="Turn">
+ <param name="navigationText" type="Common.TextFieldStruct" mandatory="false">
+ <description>Uses navigationText from TextFieldStruct.</description>
+ </param>
+ <param name="turnIcon" type="Common.Image" mandatory="false">
+ </param>
+ </struct>
+ <struct name="VehicleType">
+ <param name="make" type="String" maxlength="500" mandatory="false">
+ <description>Make of the vehicle</description>
+ <description>e.g. Ford</description>
+ </param>
+ <param name="model" type="String" maxlength="500" mandatory="false">
+ <description>Model of the vehicle</description>
+ <description>e.g. Fiesta</description>
+ </param>
+ <param name="modelYear" type="String" maxlength="500" mandatory="false">
+ <description>Model Year of the vehicle</description>
+ <description>e.g. 2013</description>
+ </param>
+ <param name="trim" type="String" maxlength="500" mandatory="false">
+ <description>Trim of the vehicle</description>
+ <description>e.g. SE</description>
+ </param>
+ </struct>
+ <struct name="DeviceInfo">
+ <param name="name" type="String" mandatory="true">
+ <description>The name of the device connected.</description>
+ </param>
+ <param name="id" type="Integer" mandatory="true">
+ <description>The ID of the device connected</description>
+ </param>
+ <param name="isSDLAllowed" type="Boolean" mandatory="false">
+ <description>Sent by SDL in UpdateDeviceList. ’true’ – if device is allowed for PolicyTable Exchange; ‘false’ – if device is NOT allowed for PolicyTable Exchange </description>
+ </param>
+ </struct>
+ <!--IVI part-->
+ <struct name="GPSData">
+ <description>Struct with the GPS data.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="false">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="false">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="Common.CompassDirection" mandatory="false">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
+ <description>PDOP.</description>
+ </param>
+ <param name="hdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
+ <description>HDOP.</description>
+ </param>
+ <param name="vdop" type="Float" minvalue="0" maxvalue="10" mandatory="false">
+ <description>VDOP.</description>
+ </param>
+ <param name="actual" type="Boolean" mandatory="false">
+ <description>
+ True, if actual.
+ False, if infered.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Common.Dimension" mandatory="false">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="false">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="false">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="false">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+ <struct name="SingleTireStatus">
+ <param name="status" type="Common.ComponentVolumeStatus" mandatory="true">
+ <description>The status of component volume. See ComponentVolumeStatus.</description>
+ </param>
+ </struct>
+ <struct name="DIDResult">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data (the address from ReadDID request)</description>
+ </param>
+ <param name="data" type="String" maxlength="5000" mandatory="false">
+ <description>Raw DID-based data returned for requested element.</description>
+ </param>
+ </struct>
+ <struct name="HeadLampStatus">
+ <param name="lowBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the low beam lamps.</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the high beam lamps.</description>
+ </param>
+ <param name="ambientLightSensorStatus" type="Common.AmbientLightStatus" mandatory="true">
+ <description>Status of the ambient light sensor.</description>
+ </param>
+ </struct>
+ <struct name="TireStatus">
+ <description>The status and pressure of the tires.</description>
+ <param name="pressureTelltale" type="Common.WarningLightStatus" mandatory="false">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="Common.SingleTireStatus" mandatory="false">
+ <description>The status of the inner right rear.</description>
+ </param>
+ </struct>
+ <struct name="BeltStatus">
+ <param name="driverBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+ <struct name="BodyInformation">
+ <param name="parkBrakeActive" type="Boolean" mandatory="true">
+ <description>Must be true if the park brake is active</description>
+ </param>
+ <param name="ignitionStableStatus" type="Common.IgnitionStableStatus" mandatory="true">
+ <description>Information about the ignition switch. See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="Common.IgnitionStatus" mandatory="true">
+ <description>The status of the ignition. See IgnitionStatus.</description>
+ </param>
+ <param name="driverDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatDrv_B_Actl".</description>
+ </param>
+ <param name="passengerDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatPsngr_B_Actl".</description>
+ </param>
+ <param name="rearLeftDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRl_B_Actl".</description>
+ </param>
+ <param name="rearRightDoorAjar" type="Boolean" mandatory="false">
+ <description>References signal "DrStatRr_B_Actl".</description>
+ </param>
+ </struct>
+ <struct name="DeviceStatus">
+ <param name="voiceRecOn" type="Boolean" mandatory="false">
+ <description>Must be true if the voice recording is on.</description>
+ </param>
+ <param name="btIconOn" type="Boolean" mandatory="false">
+ <description>Must be true if Bluetooth icon is displayed.</description>
+ </param>
+ <param name="callActive" type="Boolean" mandatory="false">
+ <description>Must be true if there is an active call..</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean" mandatory="false">
+ <description>Must be true if ther is a phone roaming.</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean" mandatory="false">
+ <description>Must be true if the text message is available.</description>
+ </param>
+ <param name="battLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
+ <description>Device battery level status. See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean" mandatory="false">
+ <description>Must be true if stereo audio output is muted.</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean" mandatory="false">
+ <description>Must be true if mono audio output is muted.</description>
+ </param>
+ <param name="signalLevelStatus" type="Common.DeviceLevelStatus" mandatory="false">
+ <description>Device signal level status. See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="Common.PrimaryAudioSource" mandatory="false">
+ <description>See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean" mandatory="false">
+ <description>Must be true if emergency call event is active.</description>
+ </param>
+ </struct>
+ <struct name="ECallInfo">
+ <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+ </struct>
+ <struct name="AirbagStatus">
+ <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+ <struct name="EmergencyEvent">
+ <param name="emergencyEventType" type="Common.EmergencyEventType">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="multipleEvents" type="Common.VehicleDataEventStatus">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+ <struct name="ClusterModeStatus">
+ <param name="powerModeActive" type="Boolean">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="Common.CarModeStatus">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="Common.PowerModeStatus">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+ </struct>
+ <struct name="MyKey">
+ <param name="e911Override" type="Common.VehicleDataStatus" mandatory="true">
+ <description>Indicates whether e911 override is on. See VehicleDataStatus.</description>
+ </param>
+ </struct>
+ <!--end of IVI part-->
+ </interface>
+ <interface name="Buttons" version="1.0" date="2013-04-12">
+ <function name="GetCapabilities" messagetype="request" provider="hmi">
+ <description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="capabilities" type="Common.ButtonCapabilities" array="true" minsize="1" maxsize="100" mandatory="true">
+ <description>Response must provide the names of available buttons and their capabilities.See ButtonCapabilities</description>
+ </param>
+ <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
+ <description>Must be returned if the platform supports custom on-screen Presets</description>
+ </param>
+ </function>
+ <function name="OnButtonEvent" messagetype="notification" provider="hmi">
+ <description>HU system must notify about every UP/DOWN event for buttons</description>
+ <param name="name" type="Common.ButtonName" mandatory="true"/>
+ <param name="mode" type="Common.ButtonEventMode" mandatory="true">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
+ <description>Must be provided if ButtonName is CUSTOM_BUTTON, this references the integer ID passed by a custom button. (e.g. softButtonName)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>
+ In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
+ Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
+ </description>
+ </param>
+ </function>
+ <function name="OnButtonPress" messagetype="notification" provider="hmi">
+ <param name="name" type="Common.ButtonName" mandatory="true"/>
+ <param name="mode" type="Common.ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" mandatory="false" minvalue="0" maxvalue="65536">
+ <description>Must be returned if ButtonName is CUSTOM_BUTTON, this references the string passed by a custom button. (e.g. softButtonName)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>
+ In case the ButtonName is CUSTOM_BUTTON, HMI must include appID parameters to OnButtonPress notification sent to SDL.
+ Otherwise, if appID is not sent together with CUSTOM_BUTTON, this notification will be ignored by SDL.
+ </description>
+ </param>
+ </function>
+ </interface>
+ <interface name="BasicCommunication" version="1.0" date="2013-04-12">
+ <function name="OnReady" messagetype="notification" provider="hmi">
+ <description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
+ </function>
+ <function name="OnStartDeviceDiscovery" messagetype="notification" provider="hmi">
+ <description>Initiated by HMI user for getting the list of connected devices.</description>
+ </function>
+ <function name="OnUpdateDeviceList" messagetype="notification" provider="hmi">
+ <description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
+ </function>
+ <function name="OnResumeAudioSource" messagetype="notification" provider="sdl">
+ <description>This method must be invoked by SDL to update audio state.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>The ID of app to be resumed audio source.</description>
+ </param>
+ </function>
+ <function name="OnSDLPersistenceComplete" messagetype="notification" provider="sdl">
+ </function>
+ <function name="UpdateAppList" messagetype="request" provider="hmi">
+ <description>Issued by SDL to notify HMI about new applications registered.</description>
+ <param name="applications" type="Common.HMIApplication" mandatory="true" array="true" minsize="1" maxsize="100"/>
+ </function>
+ <function name="UpdateAppList" messagetype="response">
+ </function>
+ <function name="UpdateDeviceList" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to change device list.</description>
+ <param name="deviceList" type="Common.DeviceInfo" mandatory="true" array="true" minsize="0" maxsize="100">
+ <description>The array of names/IDs of connected devices</description>
+ </param>
+ </function>
+ <function name="UpdateDeviceList" messagetype="response">
+ </function>
+ <function name="OnFileRemoved" messagetype="notification" provider="sdl">
+ <description>Notifies HMI in case some application file has been removed</description>
+ <param name="fileName" type="String" minlength="1" maxlength="30" mandatory="true">
+ <description>The name of the removed file</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="true">
+ <description>The file type. See FileType.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application.</description>
+ </param>
+ </function>
+ <function name="AllowDeviceToConnect" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to get the permissions of new device connection.</description>
+ <param name="device" type="Common.DeviceInfo" mandatory="true"/>
+ </function>
+ <function name="AllowDeviceToConnect" messagetype="response">
+ <param name="allow" type="Boolean" mandatory="true"/>
+ </function>
+ <function name="OnDeviceChosen" messagetype="notification" provider="hmi">
+ <description>Notification must be initiated by HMI on user selecting device in the list of devices.</description>
+ <param name="deviceInfo" type="Common.DeviceInfo" mandatory="true">
+ <description>The name and ID of the device chosen</description>
+ </param>
+ </function>
+ <function name="OnFindApplications" messagetype="notification" provider="hmi">
+ <description>This method must be invoked by HMI to get list of registered apps.</description>
+ <param name="deviceInfo" type="Common.DeviceInfo" mandatory="false">
+ <description>The name and ID of the device the list of registered applications is required for.</description>
+ </param>
+ </function>
+ <function name="ActivateApp" messagetype="request" provider="hmi">
+ <description>Request from SDL to HMI to bring specified application to front on UI e.g make it HMI status 'FULL'.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of deactivated application.</description>
+ </param>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ <param name="level" type="Common.HMILevel" mandatory="false">
+ <description>If level for application is to be changed to something else then FULL then this parameter should be used.</description>
+ </param>
+ </function>
+ <function name="ActivateApp" messagetype="response">
+ </function>
+ <function name="OnAppActivated" messagetype="notification" provider="hmi">
+ <description>Must be sent by HU system when the user clicks on app in the list of registered apps or on soft button with 'STEAL_FOCUS' action.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of selected application.</description>
+ </param>
+ </function>
+ <function name="OnAppDeactivated" messagetype="notification" provider="hmi">
+ <description>Must be sent by HU system when the user switches to any functionality which is not other mobile application.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of deactivated application.</description>
+ </param>
+ <param name="reason" type="Common.DeactivateReason" mandatory="true">
+ <description>Specifies the functionality the user has switched to.</description>
+ </param>
+ </function>
+ <function name="OnAppRegistered" messagetype="notification" provider="sdl">
+ <description>Issued by SDL to notify HMI about new application registered.</description>
+ <param name="application" type="Common.HMIApplication" mandatory="true">
+ <description>The information about application registered. See HMIApplication. </description>
+ </param>
+ <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ May not be empty.
+ May not start with a new line character.
+ Not unique value
+ </description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Defines an additional voice recognition command.
+ Must not interfere with any name of previously registered applications(SDL makes check).
+ </description>
+ </param>
+ <param name="resumeVrGrammars" type="Boolean" mandatory="false">
+ <description>The flag if VR grammars resume is required</description>
+ </param>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ </function>
+ <function name="OnAppUnregistered" messagetype="notification" provider="sdl">
+ <description>
+ Issued by SDL to notify HMI about application unregistered.
+ Application then to be removed from application list; all data connected with application has to be cleared up.
+ </description>
+ <param name="unexpectedDisconnect" type="Boolean" mandatory="true">
+ <description>
+ SDL sends 'true' in case the connection is unexpectedly lost.
+ SDL sends 'false' in case the mobile app is unregistered gracefully (via appropriate RPC)
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application unregistered</description>
+ </param>
+ </function>
+ <function name="OnExitApplication" messagetype="notification" provider="hmi">
+ <description>Must be sent by HMI when the User chooses to exit the application..</description>
+ <param name="reason" type="Common.ApplicationToNONEReason" mandatory="true">
+ <description>Specifies reason of moving the app to NONE</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application to be exited.</description>
+ </param>
+ </function>
+ <function name="OnExitAllApplications" messagetype="notification" provider="hmi">
+ <description>Sent by HMI to SDL to close all registered applications.</description>
+ <param name="reason" type="Common.ApplicationsCloseReason" mandatory="true">
+ <description>Specifies reason for exiting all apllications.</description>
+ </param>
+ </function>
+ <function name="MixingAudioSupported" messagetype="request" provider="hmi">
+ <description>Request from SDL to HMI to find out if the last one supports mixing audio (i.e. recording TTS command and playing audio).</description>
+ </function>
+ <function name="MixingAudioSupported" messagetype="response">
+ <description>If no response received SDL supposes that mixing audio is not supported</description>
+ <param name="attenuatedSupported" type="Boolean" mandatory="true">
+ <description>Must be true if supported</description>
+ </param>
+ </function>
+ <function name="PlayTone" messagetype="notification" provider="sdl">
+ <description>Sent by SDL to HMI to notify that the tone should be played.</description>
+ </function>
+ <!-- Policies -->
+ <!-- SyncP RPC-->
+ <function name="OnSystemRequest" messagetype="notification" provider="hmi">
+ <description>
+ An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud
+ Binary data can be included in hybrid part of message for some requests (such as Authentication request responses)
+ </description>
+ <param name="requestType" type="Common.RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="url" type="String" maxlength="1000" minlength="1" mandatory="false">
+ <description>Optional array of URL(s) for HTTP requests.</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="false">
+ <description>Optional file type (meant for HTTP file requests).</description>
+ </param>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ </param>
+ <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+ <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SystemRequest" messagetype="request" provider="hmi">
+ <description>An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as Authentication requests)</description>
+ <param name="requestType" type="Common.RequestType" mandatory="true">
+ <description>The type of system request.</description>
+ </param>
+ <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
+ <description>The path to file.</description>
+ </param>
+ <param name="appID" type="String" maxlength="50" minlength="1" mandatory="false">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SystemRequest" messagetype="response">
+ </function>
+ <function name="PolicyUpdate" messagetype="request" provider="hmi">
+ <description>
+ From: SDL
+ To: SYNCP Manager
+ Asks SYNCP Manager to send given Policy Table snapshot to the backend
+ </description>
+ <param name="file" type="String" minlength="1" maxlength="255" mandatory="true">
+ <description>
+ Location of policy table snapshot
+ </description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>
+ Send attempt timeout in seconds
+ </description>
+ </param>
+ <param name="retry" type="Integer" minvalue="0" maxvalue="65535" array="true" minsize="1" maxsize="5" mandatory="true">
+ <description>
+ Array of delays to wait after failed atempts
+ </description>
+ </param>
+ </function>
+ <function name="PolicyUpdate" messagetype="response">
+ </function>
+ <!-- End of SyncP RPC-->
+ <function name="OnSDLClose" messagetype="notification" provider="sdl">
+ <description>SDL must notify HMI about finish working application</description>
+ </function>
+ <function name="OnPutFile" messagetype="notification" provider="sdl">
+ <description>
+ Notification, that comes to HMI when mobile sents file with systemFile flag
+ </description>
+ <param name="offset" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional offset in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="length" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Optional length in bytes for resuming partial data chunks</description>
+ </param>
+ <param name="fileSize" type="Integer" minvalue="0" maxvalue="100000000000" mandatory="false">
+ <description>Full Size of file. sends in first OnPutFile notification if file is splited
+ into many PutFiles
+ </description>
+ </param>
+ <param name="FileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+ <param name="syncFileName" type="String" maxlength="255" mandatory="true">
+ <description>File reference name.</description>
+ </param>
+ <param name="fileType" type="Common.FileType" mandatory="true">
+ <description>Selected file type.</description>
+ </param>
+ <param name="persistentFile" type="Boolean" defvalue="false" mandatory="false">
+ <description>
+ Indicates if the file is meant to persist between sessions / ignition cycles.
+ If set to TRUE, then the system will aim to persist this file through session / cycles.
+ While files with this designation will have priority over others, they are subject to deletion by the system at any time.
+ In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file.
+ If omitted, the value will be set to false.
+ </description>
+ </param>
+ </function>
+ <!-- Policies -->
+ <function name="GetSystemInfo" messagetype="request" provider="hmi">
+ <description>Request from SDL to HMI to obtain information about head unit system.</description>
+ </function>
+ <function name="GetSystemInfo" messagetype="response">
+ <param name="ccpu_version" type="String" maxlength="500" mandatory="true">
+ <description>Software version of the module</description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>ISO 639-1 combined with ISO 3166 alpha-2 country code (i.e. en-us)</description>
+ </param>
+ <param name="wersCountryCode" type="String" maxlength="500" mandatory="true">
+ <description>Country code from the Ford system WERS (i.e.WAEGB).</description>
+ </param>
+ </function>
+ <function name="OnSystemInfoChanged" messagetype="notification" provider="hmi">
+ <description>Issued by system to SDL to notify that some system param has changed. Currently applied for Sync Language.</description>
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="OnIgnitionCycleOver" messagetype="notification" provider="hmi">
+ <description>Notification from system to SDL to let it know that ignition cycle is over.</description>
+ </function>
+ <!-- End of Policies -->
+ </interface>
+ <interface name="VR" version="1.0" date="2013-04-17">
+ <function name="IsReady" messagetype="request" provider="hmi">
+ <description>Method is invoked at system startup. Response provides information about presence of VR module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if VR is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="Started" messagetype="notification" provider="hmi">
+ <description>Must be initiated by VR module to let SDL know that VR session has started.</description>
+ </function>
+ <function name="Stopped" messagetype="notification" provider="hmi">
+ <description>Must be initiated by VR module to let SDL know that VR session has stopped.</description>
+ </function>
+ <function name="AddCommand" messagetype="request" provider="hmi">
+ <description>Request from SDL to add a command(string with associated id) to VR.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of a command (further to be used in OnCommand notification).</description>
+ </param>
+ <param name="vrCommands" type="String" mandatory="true" maxlength="99" minsize="1" maxsize="100" array="true">
+ <description>List of strings to be used as VR commands.</description>
+ </param>
+ <param name="type" type="Common.VRCommandType" mandatory="true">
+ <description>Type of added command. See VRCommandType.</description>
+ </param>
+ <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>
+ ID of the specific grammar, whether top-level or choice set.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="AddCommand" messagetype="response">
+ </function>
+ <function name="DeleteCommand" messagetype="request" provider="hmi">
+ <description>Request from SDL to delete a command from VR.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Id of a command (list of strings), previously sent by AddCommand.</description>
+ </param>
+ <param name="type" type="Common.VRCommandType" mandatory="true">
+ <description>Type of added command. See VRCommandType.</description>
+ </param>
+ <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the specific grammar.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="DeleteCommand" messagetype="response">
+ </function>
+ <function name="PerformInteraction" messagetype="request" provider="hmi">
+ <description>
+ Sets some properties for the application initiated request.
+ </description>
+ <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ The help prompt. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
+ </description>
+ </param>
+ <param name="initialPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ This is the intial prompt spoken to the user at the start of an interaction. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
+ </description>
+ </param>
+ <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text for a wait timeout. An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.
+ </description>
+ </param>
+ <param name="timeout" type="Integer" mandatory="true">
+ <description>Timeout initiate timeoutPrompt</description>
+ </param>
+ <param name="grammarID" type="Integer" minvalue="0" maxvalue="2000000000" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ IDs of the specific compiled grammars for this voice interaction.
+ </description>
+ </param>
+ </function>
+ <function name="PerformInteraction" messagetype="response">
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>
+ ID of the choice that was selected in response to PerformInteraction.
+ </description>
+ </param>
+ </function>
+ <function name="OnCommand" messagetype="notification" provider="hmi">
+ <description>Notifies SDL about command trigerred via VR</description>
+ <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
+ <description>ID of of the command (list of strings)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to change language of VR.</description>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Request new VR synonyms registration
+ Defines an additional voice recognition command.
+ Must not interfere with any name of previously registered applications(SDL makes check).
+ </description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>The language application wants to switch to.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="response">
+ </function>
+ <function name="OnLanguageChange" messagetype="notification" provider="hmi">
+ <description>Notification from HMI to SmartDeviceLink about change of language.</description>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>Language VR has switched to.</description>
+ </param>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
+ <description>Method is invoked at system start-up. Response must provide the information about VR supported languages.</description>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="response">
+ <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of languages supported in VR.</description>
+ </param>
+ </function>
+ <function name="GetLanguage" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to get currently active VR language</description>
+ </function>
+ <function name="GetLanguage" messagetype="response">
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="GetCapabilities" messagetype="request" provider="hmi">
+ <description>Method is invoked at system startup by SDL to request information about VR capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="vrCapabilities" type="Common.VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Types of input recognized by VR module.</description>
+ </param>
+ </function>
+ </interface>
+ <interface name="TTS" version="1.0" date="2013-04-18">
+ <description>RPCs for communication between TTS and SDL.</description>
+ <function name="GetCapabilities" messagetype="request" provider="hmi">
+ <description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="speechCapabilities" type="Common.SpeechCapabilities" minsize="1" maxsize="5" array="true" mandatory="true">
+ <description>See SpeechCapabilities</description>
+ </param>
+ <param name="prerecordedSpeechCapabilities" type="Common.PrerecordedSpeech" minsize="1" maxsize="5" array="true" mandatory="true">
+ <description>See PrerecordedSpeech</description>
+ </param>
+ </function>
+ <function name="Started" messagetype="notification" provider="hmi">
+ <description>Must be initiated by TTS module to let SDL know that TTS session has started.</description>
+ </function>
+ <function name="Stopped" messagetype="notification" provider="hmi">
+ <description>Must be initiated by TTS module to let SDL know that TTS session has stopped.</description>
+ </function>
+ <function name="IsReady" messagetype="request" provider="hmi">
+ <description>Method is invoked at system start-up. Response must provide the information about presence of TTS module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if TTS is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="Speak" messagetype="request" provider="hmi">
+ <description>RPC from SDL to TTS for speaking the text.</description>
+ <param name="ttsChunks" type="Common.TTSChunk" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of strings to be spoken.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ <param name="speakType" type="Common.SpeakType" mandatory="false">
+ <description>Defines the type of the request which causes text-to-speech</description>
+ </param>
+ </function>
+ <function name="Speak" messagetype="response">
+ <description>Provides information about success of operation.</description>
+ </function>
+ <function name="StopSpeaking" messagetype="request" provider="hmi">
+ <description>Initiated by SDL to stop speaking the text.</description>
+ </function>
+ <function name="StopSpeaking" messagetype="response">
+ </function>
+ <function name="ChangeRegistration" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to change language of TTS.</description>
+ <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <description>
+ Request new ttsName registration
+ TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
+ Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
+ May not be empty.
+ May not start with a new line character.
+ Not unique value (SDL makes all the checks)
+ </description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>The language application wants to switch to.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="response">
+ </function>
+ <function name="OnLanguageChange" messagetype="notification" provider="hmi">
+ <description>Notification from HMI to SmartDeviceLink about change of language.</description>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>Language TTS has switched to.</description>
+ </param>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
+ <description>Method is invoked at system start-up by SDL. Response must provide the information about TTS supported languages.</description>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="response">
+ <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of languages supported in TTS.</description>
+ </param>
+ </function>
+ <function name="GetLanguage" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to get currently active TTS language</description>
+ </function>
+ <function name="GetLanguage" messagetype="response">
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="SetGlobalProperties" messagetype="request" provider="hmi">
+ <description>Sets some properties for the application initiated request.</description>
+ <param name="helpPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ The help prompt.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+ <param name="timeoutPrompt" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ Help text for a wait timeout.
+ An array of text chunks of type TTSChunk. See TTSChunk.
+ The array must have at least one item.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetGlobalProperties" messagetype="response">
+ </function>
+ <function name="OnResetTimeout" messagetype="notification">
+ <description>
+ Sender: HMI->SDL. HMI must send this notification every 10 sec. in case the 'methodName'
+ results long processing on HMI
+ </description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Id of application that concerns the 'methodName'.</description>
+ </param>
+ <param name="methodName" type="String" mandatory="true">
+ <description>The name of the method, the renew of timeout is required for</description>
+ </param>
+ </function>
+ </interface>
+ <interface name="UI" version="1.0" date="2013-04-16">
+ <function name="Alert" messagetype="request" provider="hmi">
+ <description>Request from SDL to show an alert message on the display.</description>
+ <param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
+ <description>Array of lines of alert text fields. See TextFieldStruct. Uses alertText1, alertText2, alertText3.</description>
+ </param>
+ <param name="duration" type="Integer" mandatory="true" minvalue="3000" maxvalue="10000">
+ <description>Timeout in milliseconds.</description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" mandatory="false" minsize="0" maxsize="4" array="true">
+ <description>App defined SoftButtons</description>
+ </param>
+ <param name="progressIndicator" type="Boolean" mandatory="false">
+ <description>If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc.</description>
+ </param>
+ <param name="alertType" type="Common.AlertType" mandatory="true">
+ <description>Defines if only UI or BOTH portions of the Alert request are being sent to HMI Side</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="Alert" messagetype="response">
+ <param name="tryAgainTime" type="Integer" mandatory="false" minvalue="0" maxvalue="2000000000">
+ <description>Amount of time (in milliseconds) that SDL must wait before resending an alert. Must be provided if another system event or overlay currently has a higher priority than this alert.</description>
+ </param>
+ </function>
+ <function name="Show" messagetype="request" provider="hmi">
+ <param name="showStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="7">
+ <description>Array of lines of show text fields. See TextFieldStruct. Uses mainField1, mainField2, mainField3, mainField4. If some field is not set, the corresponding text should stay unchanged. If field's text is empty "", the field must be cleared.
+ mainField1: The text that should be displayed in a single or upper display line.
+ mainField2: The text that should be displayed on the second display line.
+ mainField3: The text that should be displayed on the second "page" first display line.
+ mainField4: The text that should be displayed on the second "page" second display line.
+ statusBar: statusBar.
+ mediaClock: Text value for MediaClock field.
+ mediaTrack: The text that should be displayed in the track field. This field is only valid for media applications on NGN type ACMs.
+ </description>
+ </param>
+ <param name="alignment" type="Common.TextAlignment" mandatory="false">
+ <description>Specifies how mainField1 and mainField2 texts should be aligned on the display.</description>
+ <description>If omitted, texts must be centered</description>
+ </param>
+ <param name="graphic" type="Common.Image" mandatory="false">
+ <description>Path to optional dynamic image or the static binary image itself. See Image. If omitted, the displayed graphic should not change.</description>
+ </param>
+ <param name="secondaryGraphic" type="Common.Image" mandatory="false">
+ <description>
+ Image struct determining whether static or dynamic secondary image to display in app.
+ If omitted on supported displays, the displayed secondary graphic shall not change.
+ </description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>App defined SoftButtons.</description>
+ <description>If omitted, the currently displayed SoftButton values should not change.</description>
+ </param>
+ <param name="customPresets" type="String" maxlength="500" minsize="0" maxsize="10" array="true" mandatory="false">
+ <description>App labeled on-screen presets (i.e. GEN3 media presets or dynamic search suggestions).</description>
+ <description>If omitted on supported displays, the presets will be shown as not defined.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Id of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="Show" messagetype="response">
+ </function>
+ <function name="AddCommand" messagetype="request" provider="hmi">
+ <description>Request from SDL to add a command to the application menu.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>ID of the command to be added.</description>
+ </param>
+ <param name="menuParams" type="Common.MenuParams" mandatory="false">
+ <description>Optional sub value containing parameters of the command (position, name, etc.). See MenuParams. If omitted the command should be added to the end of the list of commands.</description>
+ </param>
+ <param name="cmdIcon" type="Common.Image" mandatory="false">
+ <description>Image to be displayed for representing the command. See Image.</description>
+ <description>If omitted, no (or the default if applicable) icon should be displayed.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="AddCommand" messagetype="response">
+ </function>
+ <function name="DeleteCommand" messagetype="request" provider="hmi">
+ <description>Request from SDL to delete a command from the in-application menu with the specified command id.</description>
+ <param name="cmdID" type="Integer" mandatory="true" minvalue="0" maxvalue="2000000000">
+ <description>cmdId previously sent via AddCommand request - id of the command to be deleted.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="DeleteCommand" messagetype="response">
+ </function>
+ <function name="AddSubMenu" messagetype="request" provider="hmi">
+ <description>Request from SDL to add a sub menu to the in-application menu.</description>
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>ID of the sub menu to be added. Unique for the application.</description>
+ </param>
+ <param name="menuParams" type="Common.MenuParams" mandatory="true">
+ <description>Position and name of menu to be added. 'parent' field is omitted for this RPC. </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="AddSubMenu" messagetype="response">
+ </function>
+ <function name="DeleteSubMenu" messagetype="request" provider="hmi">
+ <description>Request from SDL to delete a submenu from the in-application menu.</description>
+ <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="true">
+ <description>The "menuID" of the sub-menu to be deleted. (See addSubMenu.menuID)</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="DeleteSubMenu" messagetype="response">
+ </function>
+ <function name="PerformInteraction" messagetype="request" provider="hmi">
+ <description>Request from SDL for triggering an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+ <param name="initialText" type="Common.TextFieldStruct" mandatory="false">
+ <description>Uses initialInteractionText. See TextFieldStruct.</description>
+ </param>
+ <param name="choiceSet" type="Common.Choice" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The list of choices to be used for the interaction with the user</description>
+ </param>
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <description>VR Help Title text.</description>
+ <description>If omitted on supported displays, the default HU system help title should be used.</description>
+ </param>
+ <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" defvalue="10000" mandatory="true">
+ <description>Timeout in milliseconds.</description>
+ </param>
+ <param name="interactionLayout" type="Common.LayoutMode" mandatory="false">
+ <description>See LayoutMode.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="PerformInteraction" messagetype="response">
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>ID of the choice that was selected in response to PerformInteraction.</description>
+ </param>
+ <param name="manualTextEntry" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>
+ Manually entered text selection, e.g. through keyboard
+ Can be returned in lieu of choiceID, depending on trigger source
+ </description>
+ </param>
+ </function>
+ <function name="SetMediaClockTimer" messagetype="request" provider="hmi">
+ <description>Sets the initial media clock value and automatic update method.</description>
+ <param name="startTime" type="Common.TimeFormat" mandatory="false">
+ <description>startTime should be ignored for "PAUSE", "RESUME", and "CLEAR"</description>
+ </param>
+ <param name="endTime" type="Common.TimeFormat" mandatory="false">
+ <description>
+ See TimeFormat.
+ endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored)
+ If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA.
+ endTime will be ignored for "PAUSE", "RESUME", and "CLEAR"
+ </description>
+ </param>
+ <param name="updateMode" type="Common.ClockUpdateMode" mandatory="true">
+ <description>The update method of the media clock.</description>
+ <description>In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SetMediaClockTimer" messagetype="response">
+ </function>
+ <function name="SetGlobalProperties" messagetype="request" provider="hmi">
+ <description>Request from SDL to set some properties for VR help.</description>
+ <param name="vrHelpTitle" type="String" maxlength="500" mandatory="false">
+ <description>VR Help Title text.</description>
+ <description>If omitted on supported displays, the default HU system help title should be used.</description>
+ </param>
+ <param name="vrHelp" type="Common.VrHelpItem" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>VR Help Items. If omitted on supported displays, the default HU system generated help items should be used.</description>
+ </param>
+ <param name="menuTitle" maxlength="500" type="String" mandatory="false">
+ <description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
+ </param>
+ <param name="menuIcon" type="Common.Image" mandatory="false">
+ <description>&gt;Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ </param>
+ <param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
+ <description>On-screen keybaord configuration (if available).</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="SetGlobalProperties" messagetype="response">
+ </function>
+ <function name="OnCommand" messagetype="notification" provider="hmi">
+ <description>Notification must be initiated by HMI on user choosing menu item.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Command ID, which is related to a specific menu entry (previously sent with AddCommand).</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that is related to this RPC.</description>
+ </param>
+ </function>
+ <function name="OnSystemContext" messagetype="notification" provider="hmi">
+ <description>
+ Notification must be initiated by HMI when the user changes the context of application: goes to menu (in-application menu or system menu);
+ switches to VR; pop-up appears on screen etc.
+ </description>
+ <param name="systemContext" type="Common.SystemContext" mandatory="true">
+ <description>The context the application is brought into.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>ID of application that is related to this RPC.</description>
+ </param>
+ </function>
+ <function name="GetCapabilities" messagetype="request" provider="hmi">
+ <description>Method is invoked at system startup by SDL to request information about UI capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="true">
+ <description>Information about the capabilities of the display: its type, text field supported, etc. See DisplayCapabilities. </description>
+ </param>
+ <param name="audioPassThruCapabilities" type="Common.AudioPassThruCapabilities" mandatory="true"/>
+ <param name="hmiZoneCapabilities" type="Common.HmiZoneCapabilities" mandatory="true"/>
+ <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" mandatory="false">
+ <description>Must be returned if the platform supports on-screen SoftButtons.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to change language for app.</description>
+ <param name="appName" type="String" maxlength="100" mandatory="false">
+ <description>
+ Request new app name registration
+ Needs to be unique over all applications.
+ May not be empty. May not start with a new line character.
+ May not interfere with any name or synonym of any registered applications.
+ Applications with the same name will be rejected. (SDL makes all the checks)
+ </description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Request new app short name registration</description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>The language application wants to switch to.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="ChangeRegistration" messagetype="response">
+ </function>
+ <function name="OnLanguageChange" messagetype="notification" provider="hmi">
+ <description>Notification from HMI to SmartDeviceLink about change of language.</description>
+ <param name="language" type="Common.Language" mandatory="true">
+ <description>Language UI has switched to.</description>
+ </param>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="request" provider="hmi">
+ <description>Method should be invoked at system startup. Response provides information about UI supported languages.</description>
+ </function>
+ <function name="GetSupportedLanguages" messagetype="response">
+ <param name="languages" type="Common.Language" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>List of languages supported in UI.</description>
+ </param>
+ </function>
+ <function name="GetLanguage" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLink to HMI to get currently active UI language</description>
+ </function>
+ <function name="GetLanguage" messagetype="response">
+ <param name="language" type="Common.Language" mandatory="true"/>
+ </function>
+ <function name="OnDriverDistraction" messagetype="notification" provider="hmi">
+ <description>Notification must be sent from HMI to SDL when driver distraction state is changed. Driver distraction rules are defined by the platform.</description>
+ <param name="state" type="Common.DriverDistractionState" mandatory="true">
+ <description>See DriverDistractionState. </description>
+ </param>
+ </function>
+ <function name="SetAppIcon" messagetype="request" provider="hmi">
+ <description>Used to set existing local file on SYNC as the app's icon.</description>
+ <param name="syncFileName" type="Common.Image" mandatory="true">
+ <description>Either the path to the dynamic image stored on HY or the static binary image itself. See Image</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetAppIcon" messagetype="response">
+ </function>
+ <function name="SetDisplayLayout" messagetype="request" provider="hmi">
+ <param name="displayLayout" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined screen layouts are defined.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetDisplayLayout" messagetype="response">
+ <param name="displayCapabilities" type="Common.DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+ <param name="buttonCapabilities" type="Common.ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description>
+ </param>
+ <param name="softButtonCapabilities" type="Common.SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.</description>
+ </param>
+ <param name="presetBankCapabilities" type="Common.PresetBankCapabilities" mandatory="false">
+ <description>If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.</description>
+ </param>
+ </function>
+ <function name="ShowCustomForm" messagetype="request" provider="hmi">
+ <description>Used to show a custom form; it can be a parent or child screen. If no parent screen is designated, it is set as a parent screen.</description>
+ <param name="customFormID" type="String" maxlength="500" mandatory="true">
+ <description>
+ Predefined or dynamically created screen layout.
+ Currently only predefined forms are defined.
+ Predefined layouts include:
+ "DEFAULT" - Default media / non-media screen
+ "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
+ "KEYBOARD_SEARCH" - Custom template containing app-configured on-screen keyboard with active search updating; user also can trigger voice search.
+ "NAV_FULLSCREEN_MAP" - Custom root template screen containing full screen map with navigation controls.
+ "NAV_POI_MENU" - Custom template containing app-defined POI options.
+ "NAV_SEARCH_RESULTS" - Custom template containing a list of app-defined search results
+ "NAV_POI_INFO" - Custom template containing app-defined POI information (and potentially map data).
+ </description>
+ </param>
+ <param name="parentFormID" type="String" maxlength="500" defvalue="DEFAULT" mandatory="false">
+ <description>
+ Parent screen of predefined form to display.
+ Currently only predefined forms are defined.
+ If not provided, then set to "DEFAULT".
+ Predefined layouts include:
+ "DEFAULT" - Default media / non-media screen
+ "ONSCREEN_PRESETS" - Custom root media screen containing app-defined onscreen presets.
+ "NAV_FULLSCREEN_MAP" - Custom template containing full screen map with navigation controls.
+ </description>
+ </param>
+ </function>
+ <function name="ShowCustomForm" messagetype="response">
+ <param name="info" type="String" maxlength="1000" mandatory="false" platform="documentation">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="OnKeyboardInput" messagetype="notification" provider="hmi">
+ <description>On-screen keyboard event.</description>
+ <description>Can be full string or individual keypresses depending on keyboard mode.</description>
+ <param name="event" type="Common.KeyboardEvent" mandatory="true">
+ <description>On-screen keyboard input data.</description>
+ </param>
+ <param name="data" type="String" minlength="0" maxlength="500" mandatory="false">
+ <description>On-screen keyboard input data.</description>
+ <description>For dynamic keypress events, this will be the current compounded string of entry text.</description>
+ <description>For entry submission events, this will be the full text entry (this will always return regardless of the mode).</description>
+ <description>For entry cancelled and entry aborted events, this data param will be omitted.</description>
+ </param>
+ </function>
+ <function name="OnTouchEvent" messagetype="notification" provider="hmi">
+ <description>Notifies about touch events on the screen's prescribed area</description>
+ <param name="type" type="Common.TouchType" mandatory="true">
+ <description>The type of touch event.</description>
+ </param>
+ <param name="event" type="Common.TouchEvent" mandatory="true" minsize="1" maxsize="10" array="true">
+ <description>List of all individual touches involved in this event.</description>
+ </param>
+ </function>
+ <function name="Slider" messagetype="request" provider="hmi">
+ <description>Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.</description>
+ <param name="numTicks" type="Integer" minvalue="2" maxvalue="26" mandatory="true">
+ <description>Number of selectable items on a horizontal axis</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="26" mandatory="true">
+ <description>Initial position of slider control (cannot exceed numTicks)</description>
+ </param>
+ <param name="sliderHeader" type="String" maxlength="500" mandatory="true">
+ <description>Text header to be displayed.</description>
+ </param>
+ <param name="sliderFooter" type="String" maxlength="500" minsize="1" maxsize="26" array="true" mandatory="false">
+ <description>Text footer to be displayed (meant to display min/max threshold descriptors).</description>
+ <description>For a static text footer, only one footer string shall be provided in the array.</description>
+ <description>For a dynamic text footer, the number of footer text string in the array must match the numTicks value.</description>
+ <description>For a dynamic text footer, text array string should correlate with potential slider position index.</description>
+ <description>If omitted on supported displays, no footer text shall be displayed.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="1000" maxvalue="65535" mandatory="true">
+ <description>Timeout. The slider should be displayed until the defined amount of time has elapsed. </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="Slider" messagetype="response">
+ <param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
+ <description>Current slider position. Must be returned when the user has clicked the &#x2018;Save&#x2019; or &#x2018;Canceled&#x2019; button or by the timeout </description>
+ </param>
+ </function>
+ <function name="ScrollableMessage" messagetype="request" provider="hmi">
+ <description>Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined</description>
+ <param name="messageText" type="Common.TextFieldStruct" mandatory="true">
+ <description>Body of text that can include newlines and tabs. Uses scrollableMessageBody.</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Timeout in milliseconds. The message should be displayed until the time defined is up.</description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="8" array="true" mandatory="false">
+ <description>App defined SoftButtons.</description>
+ <description>If omitted on supported displays, only the system defined "Close" SoftButton should be displayed.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ScrollableMessage" messagetype="response">
+ </function>
+ <function name="PerformAudioPassThru" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ <param name="audioPassThruDisplayTexts" type="Common.TextFieldStruct" mandatory="true" minsize="0" maxsize="2" array="true">
+ <description>Uses
+ audioPassThruDisplayText1: First line of text displayed during audio capture.
+ audioPassThruDisplayText2: Second line of text displayed during audio capture.</description>
+ </param>
+ <param name="maxDuration" type="Integer" minvalue="1" maxvalue="1000000" mandatory="true">
+ <description>The maximum duration of audio recording in milliseconds. If not provided, the recording should be performed until EndAudioPassThru arrives.</description>
+ </param>
+ <param name="muteAudio" type="Boolean" mandatory="true">
+ <description>
+ Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption.
+ If omitted, the value is set to true.
+ </description>
+ </param>
+ </function>
+ <function name="PerformAudioPassThru" messagetype="response">
+ </function>
+ <function name="EndAudioPassThru" messagetype="request" provider="hmi">
+ <description>Request is sent by SDL to stop the audio capturing.</description>
+ </function>
+ <function name="EndAudioPassThru" messagetype="response">
+ </function>
+ <function name="IsReady" messagetype="request" provider="hmi">
+ <description>Method is invoked at system startup. Response provides information about presence of UI module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if UI is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="ClosePopUp" messagetype="request" provider="hmi">
+ <description>Initiated by SDL to close currently active pop-up on HMI.</description>
+ <param name="methodName" type="String" mandatory="false">
+ <description>Method to be closed</description>
+ </param>
+ </function>
+ <function name="ClosePopUp" messagetype="response">
+ <description>Provides the result of operation.</description>
+ </function>
+ <function name="OnResetTimeout" messagetype="notification" provider="hmi">
+ <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Id of application that invoked notifcation.</description>
+ </param>
+ <param name="methodName" type="String" mandatory="true">
+ <description>Currently used method name on which was triggered action</description>
+ </param>
+ </function>
+ <function name="OnRecordStart" messagetype="notification" provider="sdl">
+ <description>Issued by SDL to notify HMI about capturing mic data should be started</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ </interface>
+ <interface name="Navigation" version="1.0" date="2013-05-22">
+ <function name="IsReady" messagetype="request" provider="hmi">
+ <description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if Navigation is present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="SendLocation" messagetype="request">
+ <description>That allows the app to send a destination to the embedded nav system.</description>
+ <param name="longitudeDegrees" type="Float" minvalue="-180" maxvalue="180" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description> Name / title of intended location </description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description> Description intended location / establishment (if applicable) </description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description> Location address (if applicable) </description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description> Phone number of intended location / establishment (if applicable) </description>
+ </param>
+ <param name="locationImage" type="Common.Image" mandatory="false">
+ <description> Image / icon of intended location (if applicable and supported) </description>
+ </param>
+ </function>
+ <function name="SendLocation" messagetype="response" >
+ </function>
+ <function name="ShowConstantTBT" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLinkCore to HMI to show info about navigation.</description>
+ <param name="navigationTexts" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="5">
+ <description>See TextFieldStruct. Uses:
+ navigationText1
+ navigationText2
+ ETA
+ totalDistance
+ timeToDestination.
+ </description>
+ </param>
+ <param name="turnIcon" type="Common.Image" mandatory="false">
+ </param>
+ <param name="nextTurnIcon" type="Common.Image" mandatory="false">
+ </param>
+ <param name="distanceToManeuver" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
+ <description>Fraction of distance till next maneuver (from previous maneuver).</description>
+ <description>May be used to calculate progress bar.</description>
+ </param>
+ <param name="distanceToManeuverScale" type="Float" minvalue="0" maxvalue="1000000000" mandatory="true">
+ <description>Fraction of distance till next maneuver (starting from when AlertManeuver is triggered).</description>
+ <description>May be used to calculate progress bar.</description>
+ </param>
+ <param name="maneuverComplete" type="Boolean" mandatory="false">
+ <description>If and when a maneuver has completed while an AlertManeuver is active, SDL will send this value set to TRUE in order to clear the AlertManeuver overlay.</description>
+ <description>If omitted the value should be assumed as FALSE.</description>
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>Three dynamic SoftButtons available</description>
+ <description>If omitted on supported displays, the currently displayed SoftButton values will not change.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ShowConstantTBT" messagetype="response">
+ </function>
+ <function name="AlertManeuver" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLinkCore to HMI to announce navigation maneuver</description>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="3" array="true" mandatory="false">
+ <description>If omitted, only the system defined "Close" SoftButton should be displayed.</description>
+ </param>
+ </function>
+ <function name="AlertManeuver" messagetype="response">
+ </function>
+ <function name="UpdateTurnList" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLinkCore to HMI to update turn list.</description>
+ <param name="turnList" type="Common.Turn" minsize="1" maxsize="100" array="true" mandatory="false">
+ </param>
+ <param name="softButtons" type="Common.SoftButton" minsize="0" maxsize="1" array="true" mandatory="false">
+ <description>If omitted, app-defined SoftButton should be left blank.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="UpdateTurnList" messagetype="response">
+ </function>
+ <function name="OnTBTClientState" messagetype="notification" provider="hmi">
+ <description>HMI must provide SDL with notifications specific to the current Turn-By-Turn client status on the module</description>
+ <param name="state" type="Common.TBTState" mandatory="true">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+ <function name="StartStream" messagetype="request" provider="hmi">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
+ <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
+ <description>URL that HMI start playing.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StartStream" messagetype="response">
+ </function>
+ <function name="StopStream" messagetype="request" provider="hmi">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StopStream" messagetype="response">
+ </function>
+ <function name="StartAudioStream" messagetype="request" provider="hmi">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
+ <param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
+ <description>URL that HMI start playing.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StartAudioStream" messagetype="response">
+ </function>
+ <function name="StopAudioStream" messagetype="request" provider="hmi">
+ <description>Notification from SmartDeviceLinkCore to HMI to start playing audio streaming.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="StopAudioStream" messagetype="response">
+ </function>
+ </interface>
+ <interface name="VehicleInfo" version="1.0" date="2013-04-21">
+ <function name="IsReady" messagetype="request" provider="hmi">
+ <description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if vehicle data modules are present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+ <function name="GetVehicleType" messagetype="request" provider="hmi">
+ <description>Request from SmartDeviceLinkCore to HMI to get info about the vehicle (type, model, etc.).</description>
+ </function>
+ <function name="GetVehicleType" messagetype="response">
+ <param name="vehicleType" type="Common.VehicleType" mandatory="true"/>
+ </function>
+ <function name="ReadDID" messagetype="request" provider="hmi">
+ <description>Request from SDL for vehicle data reading.</description>
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" minsize="1" maxsize="1000" array="true" mandatory="true">
+ <description>Get raw data from vehicle data DID location(s).</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="ReadDID" messagetype="response">
+ <param name="didResult" type="Common.DIDResult" minsize="0" maxsize="1000" array="true" mandatory="false">
+ <description>Array of requested DID results (with data if available).</description>
+ </param>
+ </function>
+ <function name="GetDTCs" messagetype="request" provider="hmi">
+ <description>Vehicle module diagnostic trouble code request.</description>
+ <param name="ecuName" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of ECU.</description>
+ </param>
+ <param name="dtcMask" type="Integer" minvalue="0" maxvalue="255" mandatory="false">
+ <description>DTC Mask Byte to be sent in diagnostic request to module .</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetDTCs" messagetype="response">
+ <param name="ecuHeader" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf)</description>
+ </param>
+ <param name="dtc" type="String" mandatory="false" minsize="1" maxsize="15" maxlength="10" array="true">
+ <description>
+ Array of all reported DTCs on module. Each DTC is represented with 4 bytes:
+ 3 bytes for data
+ 1 byte for status
+ </description>
+ </param>
+ </function>
+ <function name="DiagnosticMessage" messagetype="request" provider="hmi">
+ <description>Non periodic vehicle diagnostic request</description>
+ <param name="targetID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Name of target ECU.</description>
+ </param>
+ <param name="messageLength" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Length of message (in bytes).</description>
+ </param>
+ <param name="messageData" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message.
+ </description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ </function>
+ <function name="DiagnosticMessage" messagetype="response">
+ <param name="messageDataResult" type="Integer" minvalue="0" maxvalue="255" minsize="1" maxsize="65535" array="true" mandatory="true">
+ <description>
+ Array of bytes comprising CAN message result.
+ </description>
+ </param>
+ </function>
+ <!--Qt HMI version of GetVehicleData-->
+ <function name="GetGpsData" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetGpsData" messagetype="response">
+ <param name="gps" type="Common.GPSData" mandatory="true">
+ <description>See GPSData</description>
+ </param>
+ </function>
+ <function name="GetSpeed" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetSpeed" messagetype="response">
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ </function>
+ <function name="GetRpm" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetRpm" messagetype="response">
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ </function>
+ <function name="GetFuelLevel" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetFuelLevel" messagetype="response">
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ </function>
+ <function name="GetFuelLevelState" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetFuelLevelState" messagetype="response">
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <description>The fuel level state</description>
+ </param>
+ </function>
+ <function name="GetInstantFuelConsumption" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetInstantFuelConsumption" messagetype="response">
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ </function>
+ <function name="GetExternalTemperature" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetExternalTemperature" messagetype="response">
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ </function>
+ <function name="GetVin" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetVin" messagetype="response">
+ <param name="vin" type="String" maxlength="17" mandatory="true">
+ <description>Vehicle identification number</description>
+ </param>
+ </function>
+ <function name="GetPrndl" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetPrndl" messagetype="response">
+ <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <description>See PRNDL</description>
+ </param>
+ </function>
+ <function name="GetTirePressure" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetTirePressure" messagetype="response">
+ <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <description>See TireStatus</description>
+ </param>
+ </function>
+ <function name="GetOdometer" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetOdometer" messagetype="response">
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
+ <description>Odometer in km</description>
+ </param>
+ </function>
+ <function name="GetBeltStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetBeltStatus" messagetype="response">
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <description>The status of the seat belts</description>
+ </param>
+ </function>
+ <function name="GetBodyInformation" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetBodyInformation" messagetype="response">
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <description>The body information including power modes</description>
+ </param>
+ </function>
+ <function name="GetDeviceStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetDeviceStatus" messagetype="response">
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ </function>
+ <function name="GetDriverBraking" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetDriverBraking" messagetype="response">
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <description>The status of the brake pedal</description>
+ </param>
+ </function>
+ <function name="GetWiperStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetWiperStatus" messagetype="response">
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <description>The status of the wipers</description>
+ </param>
+ </function>
+ <function name="GetHeadLampStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetHeadLampStatus" messagetype="response">
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <description>Status of the head lamps</description>
+ </param>
+ </function>
+ <function name="GetEngineTorque" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetEngineTorque" messagetype="response">
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ </function>
+ <function name="GetAccPedalPosition" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetAccPedalPosition" messagetype="response">
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ </function>
+ <function name="GetSteeringWheelAngle" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetSteeringWheelAngle" messagetype="response">
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="GetECallInfo" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetECallInfo" messagetype="response">
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ </function>
+ <function name="GetAirbagStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetAirbagStatus" messagetype="response">
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
+ <description>The status of the air bags</description>
+ </param>
+ </function>
+ <function name="GetEmergencyEvent" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetEmergencyEvent" messagetype="response">
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ </function>
+ <function name="GetClusterModeStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetClusterModeStatus" messagetype="response">
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
+ <description>The status modes of the cluster</description>
+ </param>
+ </function>
+ <function name="GetMyKey" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="GetMyKey" messagetype="response">
+ <param name="myKey" type="Common.MyKey" mandatory="true">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <!--end Qt HMI version of GetVehicleData-->
+ <!--Qt HMI version of OnVehicleData-->
+ <function name="OnGpsData" messagetype="notification" provider="hmi">
+ <param name="gps" type="Common.GPSData" mandatory="true">
+ <description>See GPSData</description>
+ </param>
+ </function>
+ <function name="OnSpeed" messagetype="notification" provider="hmi">
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="true">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ </function>
+ <function name="OnRpm" messagetype="notification" provider="hmi">
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="true">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ </function>
+ <function name="OnFuelLevel" messagetype="notification" provider="hmi">
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="true">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ </function>
+ <function name="OnFuelLevelState" messagetype="notification" provider="hmi">
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="true">
+ <description>The fuel level state</description>
+ </param>
+ </function>
+ <function name="OnInstantFuelConsumption" messagetype="notification" provider="hmi">
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="true">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ </function>
+ <function name="OnExternalTemperature" messagetype="notification" provider="hmi">
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="true">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ </function>
+ <function name="OnVin" messagetype="notification" provider="hmi">
+ <param name="vin" type="String" maxlength="17" mandatory="true">
+ <description>Vehicle identification number.</description>
+ </param>
+ </function>
+ <function name="OnPrndl" messagetype="notification" provider="hmi">
+ <param name="prndl" type="Common.PRNDL" mandatory="true">
+ <description>See PRNDL</description>
+ </param>
+ </function>
+ <function name="OnTirePressure" messagetype="notification" provider="hmi">
+ <param name="tirePressure" type="Common.TireStatus" mandatory="true">
+ <description>See TireStatus</description>
+ </param>
+ </function>
+ <function name="OnOdometer" messagetype="notification" provider="hmi">
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="true">
+ <description>Odometer in km</description>
+ </param>
+ </function>
+ <function name="OnBeltStatus" messagetype="notification" provider="hmi">
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="true">
+ <description>The status of the seat belts</description>
+ </param>
+ </function>
+ <function name="OnBodyInformation" messagetype="notification" provider="hmi">
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="true">
+ <description>The body information including power modes</description>
+ </param>
+ </function>
+ <function name="OnDeviceStatus" messagetype="notification" provider="hmi">
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="true">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ </function>
+ <function name="OnDriverBraking" messagetype="notification" provider="hmi">
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="true">
+ <description>The status of the brake pedal</description>
+ </param>
+ </function>
+ <function name="OnWiperStatus" messagetype="notification" provider="hmi">
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="true">
+ <description>The status of the wipers</description>
+ </param>
+ </function>
+ <function name="OnHeadLampStatus" messagetype="notification" provider="hmi">
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="true">
+ <description>Status of the head lamps</description>
+ </param>
+ </function>
+ <function name="OnEngineTorque" messagetype="notification" provider="hmi">
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="true">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ </function>
+ <function name="OnAccPedalPosition" messagetype="notification" provider="hmi">
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="true">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ </function>
+ <function name="OnSteeringWheelAngle" messagetype="notification" provider="hmi">
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="OnECallInfo" messagetype="notification" provider="hmi">
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="OnAirbagStatus" messagetype="notification" provider="hmi">
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="OnEmergencyEvent" messagetype="notification" provider="hmi">
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="OnClusterModeStatus" messagetype="notification" provider="hmi">
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="OnMyKey" messagetype="notification" provider="hmi">
+ <param name="myKey" type="Common.MyKey" mandatory="true">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <!--end Qt HMI version of OnVehicleData-->
+ <!--Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
+ <function name="SubscribeGps" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeGps" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="true">
+ <description>See GPSData</description>
+ </param>
+ </function>
+ <function name="UnsubscribeGps" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeGps" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="true">
+ <description>See GPSData</description>
+ </param>
+ </function>
+ <function name="SubscribeSpeed" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeSpeed" messagetype="response">
+ <param name="speed" type="Common.VehicleDataResult" mandatory="true">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ </function>
+ <function name="UnsubscribeSpeed" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeSpeed" messagetype="response">
+ <param name="speed" type="Common.VehicleDataResult" mandatory="true">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ </function>
+ <function name="SubscribeRpm" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeRpm" messagetype="response">
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ </function>
+ <function name="UnsubscribeRpm" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeRpm" messagetype="response">
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="true">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ </function>
+ <function name="SubscribeFuelLevel" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeFuelLevel" messagetype="response">
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ </function>
+ <function name="UnsubscribeFuelLevel" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeFuelLevel" messagetype="response">
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="true">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ </function>
+ <function name="SubscribeFuelLevel_State" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeFuelLevel_State" messagetype="response">
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
+ <description>The fuel level state</description>
+ </param>
+ </function>
+ <function name="UnsubscribeFuelLevel_State" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeFuelLevel_State" messagetype="response">
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="true">
+ <description>The fuel level state</description>
+ </param>
+ </function>
+ <function name="SubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeInstantFuelConsumption" messagetype="response">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ </function>
+ <function name="UnsubscribeInstantFuelConsumption" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeInstantFuelConsumption" messagetype="response">
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="true">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ </function>
+ <function name="SubscribeExternalTemperature" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeExternalTemperature" messagetype="response">
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ </function>
+ <function name="UnsubscribeExternalTemperature" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeExternalTemperature" messagetype="response">
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="true">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ </function>
+ <function name="SubscribePrndl" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribePrndl" messagetype="response">
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
+ <description>See PRNDL</description>
+ </param>
+ </function>
+ <function name="UnsubscribePrndl" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribePrndl" messagetype="response">
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="true">
+ <description>See PRNDL</description>
+ </param>
+ </function>
+ <function name="SubscribeVin" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeVin" messagetype="response">
+ <param name="vin" type="String" maxlength="17" mandatory="true">
+ <description>Vehicle identification number</description>
+ </param>
+ </function>
+ <function name="UnsubscribeVin" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeVin" messagetype="response">
+ <param name="vin" type="String" maxlength="17" mandatory="true">
+ <description>Vehicle identification number</description>
+ </param>
+ </function>
+ <function name="SubscribeTirePressure" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeTirePressure" messagetype="response">
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
+ <description>See TireStatus</description>
+ </param>
+ </function>
+ <function name="UnsubscribeTirePressure" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeTirePressure" messagetype="response">
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="true">
+ <description>See TireStatus</description>
+ </param>
+ </function>
+ <function name="SubscribeOdometer" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeOdometer" messagetype="response">
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
+ <description>Odometer in km</description>
+ </param>
+ </function>
+ <function name="UnsubscribeOdometer" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeOdometer" messagetype="response">
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="true">
+ <description>Odometer in km</description>
+ </param>
+ </function>
+ <function name="SubscribeBeltStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeBeltStatus" messagetype="response">
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the seat belts</description>
+ </param>
+ </function>
+ <function name="UnsubscribeBeltStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeBeltStatus" messagetype="response">
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the seat belts</description>
+ </param>
+ </function>
+ <function name="SubscribeBodyInformation" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeBodyInformation" messagetype="response">
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
+ <description>The body information including power modes</description>
+ </param>
+ </function>
+ <function name="UnsubscribeBodyInformation" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeBodyInformation" messagetype="response">
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="true">
+ <description>The body information including power modes</description>
+ </param>
+ </function>
+ <function name="SubscribeDeviceStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeDeviceStatus" messagetype="response">
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ </function>
+ <function name="UnsubscribeDeviceStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeDeviceStatus" messagetype="response">
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ </function>
+ <function name="SubscribeDriverBraking" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeDriverBraking" messagetype="response">
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the brake pedal</description>
+ </param>
+ </function>
+ <function name="UnsubscribeDriverBraking" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeDriverBraking" messagetype="response">
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the brake pedal</description>
+ </param>
+ </function>
+ <function name="SubscribeWiperStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeWiperStatus" messagetype="response">
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the wipers</description>
+ </param>
+ </function>
+ <function name="UnsubscribeWiperStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeWiperStatus" messagetype="response">
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the wipers</description>
+ </param>
+ </function>
+ <function name="SubscribeHeadLampStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeHeadLampStatus" messagetype="response">
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>Status of the head lamps</description>
+ </param>
+ </function>
+ <function name="UnsubscribeHeadLampStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeHeadLampStatus" messagetype="response">
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>Status of the head lamps</description>
+ </param>
+ </function>
+ <function name="SubscribeEngineTorque" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeEngineTorque" messagetype="response">
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ </function>
+ <function name="UnsubscribeEngineTorque" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeEngineTorque" messagetype="response">
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="true">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ </function>
+ <function name="SubscribeAccPedalPosition" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeAccPedalPosition" messagetype="response">
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ </function>
+ <function name="UnsubscribeAccPedalPosition" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeAccPedalPosition" messagetype="response">
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="true">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ </function>
+ <function name="SubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeSteeringWheelAngle" messagetype="response">
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="UnsubscribeSteeringWheelAngle" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeSteeringWheelAngle" messagetype="response">
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="true">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ </function>
+ <function name="SubscribeECallInfo" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeECallInfo" messagetype="response">
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ </function>
+ <function name="UnsubscribeECallInfo" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeECallInfo" messagetype="response">
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="true">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ </function>
+ <function name="SubscribeAirbagStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeAirbagStatus" messagetype="response">
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the air bags</description>
+ </param>
+ </function>
+ <function name="UnsubscribeAirbagStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeAirbagStatus" messagetype="response">
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status of the air bags</description>
+ </param>
+ </function>
+ <function name="SubscribeEmergencyEvent" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeEmergencyEvent" messagetype="response">
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ </function>
+ <function name="UnsubscribeEmergencyEvent" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeEmergencyEvent" messagetype="response">
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="true">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ </function>
+ <function name="SubscribeClusterModeStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeClusterModeStatus" messagetype="response">
+ <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status modes of the cluster</description>
+ </param>
+ </function>
+ <function name="UnsubscribeClusterModeStatus" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeClusterModeStatus" messagetype="response">
+ <param name="clusterModeStatus" type="Common.VehicleDataResult" mandatory="true">
+ <description>The status modes of the cluster</description>
+ </param>
+ </function>
+ <function name="SubscribeMyKey" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="SubscribeMyKey" messagetype="response">
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <function name="UnsubscribeMyKey" messagetype="request" provider="hmi">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application requested this RPC.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeMyKey" messagetype="response">
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="true">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <!--end Qt HMI version of SubscribeVehicleData/UnsubscribeVehicleData-->
+ </interface>
+ <!-- Policies -->
+ <interface name="SDL" version="1.0" date="2014-03-12">
+ <function name="ActivateApp" messagetype="request" provider="sdl">
+ <param name="appID" type="Integer" mandatory="true">
+ </param>
+ </function>
+ <function name="ActivateApp" messagetype="response">
+ <param name="isSDLAllowed" type="Boolean" mandatory="true" scope="internal"/>
+ <param name="device" type="Common.DeviceInfo" mandatory="false" scope="internal">
+ <description>If isSDLAllowed is false, consent for sending PT through specified device is required.</description>
+ </param>
+ <param name="isPermissionsConsentNeeded" type="Boolean" mandatory="true"/>
+ <param name="isAppPermissionsRevoked" type="Boolean" mandatory="true"/>
+ <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
+ </param>
+ <param name="isAppRevoked" type="Boolean" mandatory="true"/>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ </function>
+ <function name="GetUserFriendlyMessage" messagetype="request" scope="internal" provider="sdl">
+ <description>Request from HMI to SDL to get user friendly messages for UI/TTS info boxes/texts (i.e. for help/dialogs etc) from Policy Table.</description>
+ <param name="messageCodes" type="String" array="true" minsize="1" maxsize="100" maxlength="500" mandatory="true">
+ <description>Id of message to be received according to Policy Table i.e. StatusNeeded, Notifications, DrivingCharacteristics etc.</description>
+ </param>
+ <param name="language" type="Common.Language" mandatory="false">
+ <description>Optional parameter if HMI wants message in some other language then its current one already known to SDL.</description>
+ </param>
+ </function>
+ <function name="GetUserFriendlyMessage" messagetype="response">
+ <param name="messages" type="Common.UserFriendlyMessage" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>If no message was found in PT for specified message code and for HMI current or specified language, this parameter will be omitted.</description>
+ </param>
+ </function>
+ <function name="OnAllowSDLFunctionality" messagetype="notification" provider="hmi">
+ <description>Initiated by HMI. Notifies about user/HMI allowing SDL functionality or disallowing access to all mobile apps. Needed if HMI has additional ways of asking user about this (i.e. Settings etc)</description>
+ <param name="device" type="Common.DeviceInfo" mandatory="false">
+ <description>If no device is specified permission counts for SDL functionality in general.</description>
+ </param>
+ <param name="allowed" type="Boolean" mandatory="true">
+ <description>Must be true if allowed</description>
+ </param>
+ <param name="source" type="Common.ConsentSource" mandatory="true"/>
+ </function>
+ <!-- SyncP RPC-->
+ <function name="OnReceivedPolicyUpdate" messagetype="notification" provider="hmi">
+ <description>
+ From: SYNCP Manager
+ To: SDL
+ Notification sent to SDL when SYNCP Manager receives and decrypts updated policy table
+ </description>
+ <param name="policyfile" type="String" minlength="1" maxlength="255" mandatory="true">
+ <description>Location of decrypted policy table Json file on target</description>
+ </param>
+ </function>
+ <function name="OnPolicyUpdate" messagetype="notification" provider="hmi">
+ <description>
+ From: SYNCP Manager
+ To: SDL
+ Notifies SDL to supply a new "PolicyUpdate" request with more recent snapshot data
+ </description>
+ </function>
+ <!-- End of SyncP RPC-->
+ <function name="GetListOfPermissions" messagetype="request" provider="sdl">
+ <description>Request from HMI to SDL to get list of permissions for app. If no app specified - list of permissions for all apps.</description>
+ <param name="appID" type="Integer" mandatory="false"/>
+ </function>
+ <function name="GetListOfPermissions" messagetype="response">
+ <param name="allowedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="0" maxsize="100">
+ <description>If no permissions were specified for application the array will come empty.</description>
+ </param>
+ </function>
+ <function name="OnAppPermissionConsent" messagetype="notification" provider="hmi">
+ <description>Initiated by HMI for specifying the allowance for the application to perform some functionality. Duplicates functionality of the request, needed if HMI has specific ways to allow/disallow functionality (i.e.Setting Menu)</description>
+ <param name="appID" type="Integer" mandatory="false">
+ <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
+ </param>
+ <param name="consentedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="1" maxsize="100">
+ </param>
+ <param name="source" type="Common.ConsentSource" mandatory="true"/>
+ </function>
+ <function name="OnAppPermissionChanged" messagetype="notification" provider="sdl">
+ <description>Notification from SDL to HMI. Occurs when app permissions were reduced. If no permission specified means that app was dissallowed and has to be unregitstered.</description>
+ <param name="appID" type="Integer" mandatory="true"/>
+ <param name="isAppPermissionsRevoked" type="Boolean" mandatory="false"/>
+ <param name="appRevokedPermissions" type="Common.PermissionItem" array="true" minsize="1" maxsize="100" mandatory="false">
+ <description>If app permissions were reduced (isAppPermissionsRevoked == true), then this array specifies list of removed permissions. </description>
+ </param>
+ <param name="appRevoked" type="Boolean" mandatory="false">
+ <description>If present then specified application was prohibited to used with Sync.</description>
+ </param>
+ <param name="appPermissionsConsentNeeded" type="Boolean" mandatory="false">
+ <description>If present specifies that permissions were added to application that require User Consent, then HMI can send GetListOfPermissions request to obtain list of permissions.</description>
+ </param>
+ <param name="appUnauthorized" type="Boolean" mandatory="false">
+ <description>When present and set to true (should be if present) then this means that application was not authorized (nickname check failed.)</description>
+ </param>
+ <param name="priority" type="Common.AppPriority" mandatory="false">
+ <description>Send to HMI so that it can coordinate order of requests/notifications correspondingly.</description>
+ </param>
+ </function>
+ <function name="OnSDLConsentNeeded" messagetype="notification" provider="sdl">
+ <description>Send from SDL to HMI to notify that data consent is needed for device either because PT update or Retry strategy.</description>
+ <param name="device" type="Common.DeviceInfo" mandatory="true"/>
+ </function>
+ <function name="UpdateSDL" messagetype="request" provider="sdl">
+ <description>Request from HMI to SDL to start update of Policy Table.</description>
+ </function>
+ <function name="UpdateSDL" messagetype="response">
+ <description>Specify result: no update needed, update was successful/unsuccessful etc</description>
+ <param name="result" type="Common.UpdateResult" mandatory="true"/>
+ </function>
+ <function name="GetStatusUpdate" messagetype="request" provider="sdl">
+ <description>Request from HMI to SDL to find out current status of PT exchange process.</description>
+ </function>
+ <function name="GetStatusUpdate" messagetype="response">
+ <param name="status" type="Common.UpdateResult" mandatory="true"/>
+ </function>
+ <function name="OnStatusUpdate" messagetype="notification" provider="sdl">
+ <description>Notification from SDL to HMI when current status of PT exchange changed (i.e. it Succeded or Failed etc)</description>
+ <param name="status" type="Common.UpdateResult" mandatory="true"/>
+ </function>
+ <function name="OnSystemError" messagetype="notification" provider="hmi">
+ <param name="error" type="Common.SystemError" mandatory="true"/>
+ </function>
+ <function name="AddStatisticsInfo" messagetype="notification" provider="hmi">
+ <description>Sent by system to record statiscs and error counts. Increases statistics specified by statisticType by one.</description>
+ <param name="statisticType" type="Common.StatisticsType" mandatory="true"/>
+ </function>
+ <function name="GetURLS" messagetype="request" scope="internal" provider="sdl">
+ <description>Sent by system to SDL to get list of URL for specified service type and optionally policy's application id.</description>
+ <param name="service" type="Integer" minvalue="0" maxvalue="100" mandatory="true"/>
+ </function>
+ <function name="GetURLS" messagetype="response" scope="internal">
+ <param name="urls" type="Common.ServiceInfo" array="true" mandatory="false" minsize="1" maxsize="100"/>
+ </function>
+ <function name="OnDeviceStateChanged" messagetype="notification" scope="internal" provider="hmi">
+ <param name="deviceState" type="Common.DeviceState" mandatory="true"/>
+ <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500" />
+ <param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
+ </function>
+ </interface>
+</interfaces>
diff --git a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
new file mode 100644
index 0000000000..ead8596ee6
--- /dev/null
+++ b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
@@ -0,0 +1,1153 @@
+<?xml version="1.0" standalone="no"?>
+<!-- edited with XMLSpy v2011 rel. 3 sp1 (x64) (http://www.altova.com) by Olesksandr Leshchenko (HP) -->
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+<interface name="Ford Sync RAPI" version="1.2" date="2011-05-17">
+ <enum name="Result">
+ <element name="SUCCESS">
+ <description>The request succeeded</description>
+ </element>
+ <element name="INVALID_DATA">
+ <description>The data sent is invalid. For example</description>
+ <description>Invalid Json syntax</description>
+ <description>Parameters out of bounds (number or enum range)</description>
+ <description>Mandatory parameters not provided</description>
+ <description>Parameter provided with wrong type</description>
+ <description>Invalid characters</description>
+ <description>Empty string</description>
+ </element>
+ <element name="UNSUPPORTED_REQUEST">
+ <description>The request is not supported by Sync</description>
+ </element>
+ <element name="OUT_OF_MEMORY">
+ <description>The system could not process the request because the necessary memory couldn't be allocated</description>
+ </element>
+ <element name="TOO_MANY_PENDING_REQUESTS">
+ <description>There are too many requests pending (means, that the response has not been delivered, yet).</description>
+ <designdescription>There may be a maximum of 1000 pending requests at a time.</designdescription>
+ </element>
+ <element name="INVALID_ID">
+ <description>One of the provided IDs is not valid. For example</description>
+ <description>This applies to CorrelationID, SubscriptionID [@TODO if SubscriptionID is used], CommandID, MenuID, [@TODO: missed one?]</description>
+ </element>
+ <element name="DUPLICATE_NAME">
+ <description>There was a conflict with an registered name (application or menu item) or vr command</description>
+ </element>
+ <element name="TOO_MANY_APPLICATIONS">
+ <description>There are already too many registered applications</description>
+ </element>
+ <element name="APPLICATION_REGISTERED_ALREADY">
+ <description>RegisterApplication has been called again, after a RegisterApplication was successful before.</description>
+ </element>
+ <element name="UNSUPPORTED_VERSION">
+ <description>Sync doesn't support the protocol that is requested by the mobile application</description>
+ </element>
+ <element name="WRONG_LANGUAGE">
+ <description>The requested language is currently not supported.</description>
+ <description>Might be because of a mismatch of the currently active language on Sync and the requested language</description>
+ </element>
+ <element name="APPLICATION_NOT_REGISTERED">
+ <description>An command can not be executed because no application has been registered with RegisterApplication.</description>
+ </element>
+ <element name="IN_USE">
+ <description>The data may not be changed, because it is currently in use.</description>
+ <description>For example when trying to delete a command set that is currently involved in an interaction.</description>
+ </element>
+ <element name="SUBSCRIBED_ALREADY">
+ <description>The item to subscribe to is already subscribed to.</description>
+ </element>
+ <element name="REJECTED">
+ <description>The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands.</description>
+ <description>Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing.</description>
+ </element>
+ <element name="ABORTED">
+ <description>A command was aborted, for example due to user interaction (e.g. user pressed button).</description>
+ <description>Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested.</description>
+ </element>
+ <element name="IGNORED">
+ <description>A command was ignored, because the intended result is already in effect.</description>
+ <description>For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already.</description>
+ <description>NOTE: potentially replaces SUBSCRIBED_ALREADY</description>
+ </element>
+ <element name="UNSUPPORTED_BUTTON">
+ <description>A button that was requested for subscription is not supported under the current system.</description>
+ <description>NOTE: could become a more generic UNSUPPORTED_RESOURCE by merging with VEHIVLE_DATA_NOT_AVAILABLE.</description>
+ </element>
+ <element name="FILE_NOT_FOUND">
+ <description>A specified file could not be found on Sync.</description>
+ </element>
+ <element name="GENERIC_ERROR">
+ <description>Provided data is valid but something went wrong in the lower layers.</description>
+ </element>
+ </enum>
+ <enum name="ButtonPressMode">
+ <element name="LONG">
+ <description>A button was released, after it was pressed for a long time</description>
+ <description>Actual timing is defined by Sync and may vary</description>
+ </element>
+ <element name="SHORT">
+ <description>A button was released, after it was pressed for a short time</description>
+ <description>Actual timing is defined by Sync and may vary</description>
+ </element>
+ </enum>
+ <enum name="ButtonEventMode">
+ <element name="BUTTONUP">
+ <description>A button has been released up</description>
+ </element>
+ <element name="BUTTONDOWN">
+ <description>A button has been pressed down</description>
+ </element>
+ </enum>
+ <enum name="Language">
+ <description>The set of potential languages</description>
+ <element name="EN-US" internal_name="EN_US">
+ <description>US English</description>
+ </element>
+ <element name="ES-MX" internal_name="ES_MX">
+ <description>Mexican Spanish</description>
+ </element>
+ <element name="FR-CA" internal_name="FR_CA">
+ <description>Canadian French</description>
+ </element>
+ </enum>
+ <enum name="UpdateMode">
+ <description>Describes how the media clock timer should behave on the platform</description>
+ <element name="COUNTUP"/>
+ <description>Starts the media clock timer counting upwards, as in time elapsed.</description>
+ <element name="COUNTDOWN"/>
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ <element name="PAUSE"/>
+ <description>Pauses the media clock timer</description>
+ <element name="RESUME"/>
+ <description>Resume the media clock timer</description>
+ </enum>
+ <enum name="InteractionMode">
+ <description>For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction.</description>
+ <element name="MANUAL_ONLY"/>
+ <description>This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display.</description>
+ <description>Selections are made with the OK and Seek Right and Left, Tune Up and Down buttons.</description>
+ <element name="VR_ONLY"/>
+ <description>This mode causes the interaction to only occur using V4.</description>
+ <description>Selections are made by saying the command.</description>
+ <element name="BOTH"/>
+ <description>This mode causes both a VR and display selection option for an interaction.</description>
+ <description>Selections can be made either from the menu display or by speaking the command.</description>
+ </enum>
+ <enum name="HMILevel">
+ <description>Enumeraction that describes current levels of HMI.</description>
+ <element name="FULL" internal_name="HMI_FULL"/>
+ <element name="LIMITED" internal_name="HMI_LIMITED"/>
+ <element name="BACKGROUND" internal_name="HMI_BACKGROUND"/>
+ <element name="NONE" internal_name="HMI_NONE"/>
+ </enum>
+ <enum name="AudioStreamingState">
+ <description>Enumeraction that describes possible states of audio streaming.</description>
+ <element name="AUDIBLE"/>
+ <element name="NOT_AUDIBLE"/>
+ </enum>
+ <enum name="SystemContext">
+ <description>Enumeraction that describes possible contexts and app's HMI might be in.</description>
+ <element name="MAIN" internal_name="SYSCTXT_MAIN"/>
+ <element name="VRSESSION" internal_name="SYSCTXT_VRSESSION"/>
+ <element name="MENU" internal_name="SYSCTXT_MENU"/>
+ </enum>
+ <enum name="AppInterfaceUnregisteredReason">
+ <description>Error code, which comes from sync side.</description>
+ <element name="USER_EXIT"/>
+ <element name="IGNITION_OFF"/>
+ <element name="BLUETOOTH_OFF"/>
+ <element name="USB_DISCONNECTED"/>
+ <element name="REQUEST_WHILE_IN_NONE_HMI_LEVEL"/>
+ <element name="TOO_MANY_REQUESTS"/>
+ <element name="DRIVER_DISTRACTION_VIOLATION"/>
+ <element name="LANGUAGE_CHANGE"/>
+ <element name="MASTER_RESET"/>
+ <element name="FACTORY_DEFAULTS"/>
+ </enum>
+ <enum name="TriggerSource">
+ <description>Indicates the source from where the command was triggered.</description>
+ <element name="MENU" internal_name="TS_MENU"/>
+ <element name="VR" internal_name="TS_VR"/>
+ </enum>
+ <enum name="HmiZoneCapabilities">
+ <description>Contains information about the HMI zone capabilities.</description>
+ <description>For future use.</description>
+ <element name="FRONT"/>
+ <element name="BACK"/>
+ </enum>
+ <enum name="SpeechCapabilities">
+ <description>Contains information about the TTS capabilities.</description>
+ <element name="TEXT"/>
+ <element name="SAPI_PHONEMES"/>
+ <element name="LHPLUS_PHONEMES"/>
+ <element name="PRE_RECORDED"/>
+ <element name="SILENCE"/>
+ </enum>
+ <enum name="VrCapabilities">
+ <description>Contains information about the VR capabilities.</description>
+ <element name="Text"/>
+ </enum>
+ <enum name="AudioCaptureQuality" platform="pending">
+ <description>Describes different quality options for PerformAudioCapture.</description>
+ <element name="8KHZ" internal_name="QUALITY_8KHZ"/>
+ <element name="16KHZ" internal_name="QUALITY_16KHZ"/>
+ </enum>
+ <enum name="ButtonName">
+ <description>Defines the hard (physical) and soft (touchscreen) buttons available from SYNC</description>
+ <element name="OK"/>
+ <element name="SEEKLEFT"/>
+ <element name="SEEKRIGHT"/>
+ <element name="TUNEUP"/>
+ <element name="TUNEDOWN"/>
+ <element name="PRESET_0"/>
+ <element name="PRESET_1"/>
+ <element name="PRESET_2"/>
+ <element name="PRESET_3"/>
+ <element name="PRESET_4"/>
+ <element name="PRESET_5"/>
+ <element name="PRESET_6"/>
+ <element name="PRESET_7"/>
+ <element name="PRESET_8"/>
+ <element name="PRESET_9"/>
+ <issue creator="rs">Are these all supported buttons?</issue>
+ </enum>
+ <enum name="MediaClockFormat">
+ <element name="CLOCK1">
+ <description>minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59;</description>
+ <description>used for Type II and CID headunits</description>
+ </element>
+ <element name="CLOCK2">
+ <description>minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59;</description>
+ <description>used for Type V headunit</description>
+ </element>
+ <element name="CLOCKTEXT1">
+ <description>5 characters possible</description>
+ <description>Format: 1|sp c :|sp c c</description>
+ <description>1|sp : digit "1" or space</description>
+ <description>c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]]</description>
+ <description>:|sp : colon or space</description>
+ <description>used for Type II headunit</description>
+ </element>
+ <element name="CLOCKTEXT2">
+ <description>5 chars possible</description>
+ <description>Format: 1|sp c :|sp c c</description>
+ <description>1|sp : digit "1" or space</description>
+ <description>c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]]</description>
+ <description>:|sp : colon or space</description>
+ <description>used for CID headunit</description>
+ <description>NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set</description>
+ </element>
+ <element name="CLOCKTEXT3">
+ <description>6 chars possible</description>
+ <description>Format: 1|sp c c :|sp c c</description>
+ <description>1|sp : digit "1" or space</description>
+ <description>c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref]</description>
+ <description>:|sp : colon or space</description>
+ <description>used for Type V headunit</description>
+ </element>
+ <issue creator="mf">First complete values draft. Review needed.</issue>
+ </enum>
+ <enum name="DisplayType">
+ <description>See DAES for further infos regarding the displays]</description>
+ <issue creator="rs">Meaningful description is missing</issue>
+ <element name="CID"/>
+ <element name="TYPE2"/>
+ <element name="TYPE5"/>
+ <element name="NGN"/>
+ <element name="GEN2_8_DMA"/>
+ <element name="GEN2_6_DMA"/>
+ <element name="MFD3"/>
+ <element name="MFD4"/>
+ <element name="MFD5"/>
+ </enum>
+ <enum name="TextFieldName">
+ <element name="mainField1">
+ <description>The first line of the main field of persistent display</description>
+ <description>Applies to "Show"</description>
+ </element>
+ <element name="mainField2">
+ <description>The second line of the main field of persistent display</description>
+ <description>Applies to "Show"</description>
+ </element>
+ <element name="statusBar">
+ <description>The status bar on Nav</description>
+ <description>Applies to "Show"</description>
+ </element>
+ <element name="mediaClock">
+ <description>Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync capabilities.</description>
+ <description>Applies to "Show"</description>
+ </element>
+ <element name="mediaTrack">
+ <description>The track field of NGN type ACMs.</description>
+ <description>This field is only available for media applications.</description>
+ <description>Applies to "Show"</description>
+ </element>
+ <element name="alertText1">
+ <description>The first line of the alert text field</description>
+ <description>Applies to "Alert"</description>
+ </element>
+ <element name="alertText2">
+ <description>The second line of the alert text field</description>
+ <description>Applies to "Alert"</description>
+ </element>
+ </enum>
+ <enum name="CharacterSet">
+ <description>The list of potential character sets</description>
+ <element name="TYPE2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="TYPE5SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID1SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <element name="CID2SET">
+ <description>See [@TODO: create file ref]</description>
+ </element>
+ <issue creator="rs">Real sets have not been defined yet?</issue>
+ </enum>
+ <enum name="TextAlignment">
+ <description>The list of possible alignments, left, right, or centered</description>
+ <element name="LEFT_ALIGNED"/>
+ <element name="RIGHT_ALIGNED"/>
+ <element name="CENTERED"/>
+ </enum>
+ <enum name="TBTState">
+ <description>Enumeration that describes possible states of turn-by-turn module.</description>
+ <element name="ROUTE_UPDATE_REQUEST"/>
+ <element name="ROUTE_ACCEPTED"/>
+ <element name="ROUTE_REFUSED"/>
+ <element name="ROUTE_CANCELLED"/>
+ </enum>
+ <enum name="DriverDistractionState">
+ <description>Enumeration that describes possible states of driver distraction.</description>
+ <element name="DD_ON"/>
+ <element name="DD_OFF"/>
+ </enum>
+ <struct name="Choice">
+ <description>A choice is an option given to the user, which can be selected either by menu, or through voice recognition system.</description>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="65535"/>
+ <param name="menuName" type="String" maxlength="500"/>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true"/>
+ </struct>
+ <struct name="SyncMsgVersion">
+ <description>Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application</description>
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="1">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
+ <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
+ </param>
+ </struct>
+ <enum name="GlobalProperty">
+ <description>The different global properties.</description>
+ <element name="HELPPROMPT">
+ <description>The property helpPrompt of setGlobalProperties</description>
+ </element>
+ <element name="TIMEOUTPROMPT">
+ <description>The property timeoutPrompt of setGlobalProperties</description>
+ </element>
+ </enum>
+ <struct name="StartTime">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59">
+ <description>The hour of the media clock.</description>
+ <description>Some radios only support a max of 19 hours. If out of range, it will be rejected.</description>
+ </param>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59"/>
+ </struct>
+ <struct name="TextField">
+ <param name="name" type="TextFieldName">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="CharacterSet">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="40">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="3">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+ <struct name="DisplayCapabilities">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="DisplayType">
+ <description>The type of the display. See DisplayType</description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
+ <description>A set of all fields that support text data. See TextField</description>
+ </param>
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="1" maxsize="100" array="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ </struct>
+ <struct name="ButtonCapabilities">
+ <description>Contains information about a buttons capabilities.</description>
+ <param name="name" type="ButtonName">
+ <description>The name of the button. See ButtonName.</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean">
+ <description>The button supports a short press.</description>
+ <description>Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.</description>
+ </param>
+ <param name="longPressAvailable" type="Boolean">
+ <description>The button supports a LONG press.</description>
+ <description>Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.</description>
+ </param>
+ <param name="upDownAvailable" type="Boolean">
+ <description>The button supports "button down" and "button up".</description>
+ <description>Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.</description>
+ <description>Whenever the button is released, onButtonEvent( UP) will be invoked.</description>
+ </param>
+ </struct>
+ <struct name="MenuParams">
+ <param name="parentID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>unique ID of the sub menu, the command will be added to.</description>
+ <description>If not provided, it will be provided to the top level of the in application menu.</description>
+ </param>
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>Position within the items that are are at top level of the in application menu.</description>
+ <description>0 will insert at the front.</description>
+ <description>1 will insert at the second position.</description>
+ <description>if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.</description>
+ <description>If this param was omitted the entry will be added at the end.</description>
+ </param>
+ <param name="menuName" type="String" maxlength="500">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </struct>
+ <struct name="TTSChunk">
+ <description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
+ <param name="text" maxlength="500" type="String">
+ <description>The text or phonemes to speak.</description>
+ <description>May not be empty.</description>
+ </param>
+ <param name="type" type="SpeechCapabilities">
+ <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
+ </param>
+ </struct>
+ <!-- Requests/Responses -->
+ <function name="RegisterAppInterface" messagetype="request">
+ <description>Establishes an interface with a mobile application.</description>
+ <description>Before registerAppInterface no other commands will be accepted/executed.</description>
+ <param name="syncMsgVersion" type="SyncMsgVersion">
+ <description>See SyncMsgVersion</description>
+ </param>
+ <param name="appName" type="String" maxlength="100">
+ <description>The mobile application name, e.g. "Ford Drive Green".</description>
+ <description>Needs to be unique over all applications.</description>
+ <description>May not be empty.</description>
+ <description>May not start with a new line character.</description>
+ <description>May not interfere with any name or synonym of previously registered applications and the following list of words @TODO: Create list(global commands)</description>
+ <description>Needs to be unique over all applications. Applications with the same name will be rejected.</description>
+ <description>Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.</description>
+ </param>
+ <param name="ngnMediaScreenAppName" type="String" maxlength="100" mandatory="false">
+ <description>Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen.</description>
+ <description>If not provided, the appName is used instead (and will be truncated if too long)</description>
+ <description>Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.</description>
+ </param>
+ <param name="vrSynonyms" type="String" maxlength="40" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Defines an additional voice recognition command.</description>
+ <description>May not interfere with any name or synonym of previously registered applications and the following list of words @TODO: Create list(global commands)</description>
+ <description>Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported.</description>
+ </param>
+ <param name="usesVehicleData" type="Boolean" platform="pending" mandatory="false">
+ <description>If not provided, the default is equal to False"</description>
+ <description>Indicates if the mobile application wants to use vehicle data like GPS or speed.</description>
+ </param>
+ <param name="isMediaApplication" type="Boolean">
+ <description>Indicates if the application is a media or a non-media application.</description>
+ <description>Only media applications will be able to stream audio to Sync that is audible outside of the BT media source.</description>
+ </param>
+ <param name="languageDesired" type="Language">
+ <description>See Language</description>
+ <description>If the language doesn't match the active language on Sync, it will be rejected.</description>
+ <description>If the language is changed, while an app is registered, it will get disconnected.</description>
+ </param>
+ <param name="autoActivateID" type="String" maxlength="16" mandatory="false">
+ <description>Used to support auto activation after an initial successful registerAppInterface (for example after an ignition cycle).</description>
+ <description>The app should always provide the id that was provided by the most recent registerAppInterface response.</description>
+ <description>If this is the first call to registerAppInterface, then do not provide this parameter at all.</description>
+ <description>If not provided or not matching with the id of the last registerAppInterface response, the app will not be automatically put into foreground on startup.</description>
+ </param>
+ </function>
+ <function name="RegisterAppInterface" messagetype="response">
+ <description>The response to registerAppInterface</description>
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="TOO_MANY_APPLICATIONS"/>
+ <element name="APPLICATION_REGISTERED_ALREADY"/>
+ <element name="UNSUPPORTED_VERSION"/>
+ <element name="WRONG_LANGUAGE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="false">
+ <description>See SyncMsgVersion</description>
+ </param>
+ <param name="autoActivateID" type="String" maxlength="16" mandatory="false">
+ <description>Provides an id that the app may use on a subsequent registerAppInterface to allow for auto activation (for example after an ignition cycle).</description>
+ </param>
+ <param name="language" type="Language" mandatory="false">
+ <description>The currently active language on Sync. See "Language" for options.</description>
+ </param>
+ <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false">
+ <description>See DisplayCapabilities</description>
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See ButtonCapabilities</description>
+ </param>
+ <param name="hmiZoneCapabilities" type="HmiZoneCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <issue creator="rs">If not used yet => remove</issue>
+ <description>See HmiZoneCapabilities</description>
+ </param>
+ <param name="speechCapabilities" type="SpeechCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See SpeechCapabilities</description>
+ </param>
+ <param name="vrCapabilities" type="VrCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>See VrCapabilities</description>
+ </param>
+ </function>
+ <function name="UnregisterAppInterface" messagetype="request">
+ <description>Closes an interface from a mobile application.</description>
+ <description>After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed.</description>
+ <description>Will fail, if no registerAppInterface was completed successfully before.</description>
+ </function>
+ <function name="UnregisterAppInterface" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="SetGlobalProperties" messagetype="request">
+ <description>Allows setting global properties.</description>
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>The help prompt.</description>
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Help text for a wait timeout.</description>
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ <issue creator="rs">Do we want to add VR threshold params?</issue>
+ </function>
+ <function name="SetGlobalProperties" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="ResetGlobalProperties" messagetype="request">
+ <description>Allows resetting global properties.</description>
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true">
+ <description>Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default)</description>
+ </param>
+ </function>
+ <function name="ResetGlobalProperties" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="AddCommand" messagetype="request">
+ <description>Adds a command to the in application menu.</description>
+ <description>Either menuParams or vrCommands must be provided.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>unique ID of the command to add.</description>
+ </param>
+ <param name="menuParams" type="MenuParams" mandatory="false">
+ <description>Optional sub value containing menu parameters</description>
+ </param>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="false">
+ <description>An array of strings to be used as VR sysnonyms for this command.</description>
+ <description>If this array is provided, it may not be empty.</description>
+ </param>
+ </function>
+ <function name="AddCommand" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="DeleteCommand" messagetype="request">
+ <description>Deletes all commands from the in-application menu with the specified command id.</description>
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>ID of the command(s) to delete.</description>
+ </param>
+ </function>
+ <function name="DeleteCommand" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="AddSubMenu" messagetype="request">
+ <description>Adds a sub menu to the in-application menu.</description>
+ <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>unique ID of the sub menu to add.</description>
+ </param>
+ <param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>Position within the items that are are at top level of the in application menu.</description>
+ <description>0 will insert at the front.</description>
+ <description>1 will insert at the second position.</description>
+ <description>If position is greater or equal than the number of items on top level, the sub menu will be appended to the end.</description>
+ <description>Position of any submenu will always be located before the return and exit options</description>
+ <description>If this param was omitted the entry will be added at the end.</description>
+ </param>
+ <param name="menuName" maxlength="500" type="String">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </function>
+ <function name="AddSubMenu" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="DeleteSubMenu" messagetype="request">
+ <description>Deletes a submenu from the in-application menu.</description>
+ <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
+ </param>
+ </function>
+ <function name="DeleteSubMenu" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="CreateInteractionChoiceSet" messagetype="request">
+ <description>creates interaction choice set to be used later by performInteraction</description>
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Unique ID used for this interaction choice set.</description>
+ </param>
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true"/>
+ </function>
+ <function name="CreateInteractionChoiceSet" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="PerformInteraction" messagetype="request">
+ <description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
+ <param name="initialText" type="String" maxlength="500">
+ <description>Text to be displayed first.</description>
+ </param>
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <description>This is the intial prompt spoken to the user at the start of an interaction</description>
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ <param name="interactionMode" type="InteractionMode">
+ <description>See InteractionMode.</description>
+ </param>
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="1" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
+ <description>List of interaction choice set IDs to use with an interaction.</description>
+ </param>
+ <param name="helpPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Help text. This is the spoken string when a user speaks "help" when the interaction is occuring.</description>
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ <param name="timeoutPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>Timeout text. This text is spoken when a VR interaction times out.</description>
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ <param name="timeout" type="Integer" minvalue="5000" maxvalue="100000" mandatory="false">
+ <description>Timeout in milliseconds.</description>
+ <description>If omitted a standard value of 10000 milliseconds is used.</description>
+ </param>
+ </function>
+ <function name="PerformInteraction" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="DUPLICATE_NAME"/>
+ <element name="ABORTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="choiceID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="false">
+ <description>ID of the choice that was selected in response to PerformInteraction.</description>
+ </param>
+ <param name="triggerSource" type="TriggerSource" mandatory="false">
+ <description>See TriggerSource</description>
+ </param>
+ </function>
+ <function name="DeleteInteractionChoiceSet" messagetype="request">
+ <description>Deletes interaction choice set that has been created with "CreateInteractionChoiceSet".</description>
+ <description>The interaction may only be deleted when not currently in use by a "performInteraction".</description>
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>ID of the interaction choice set to delete.</description>
+ </param>
+ </function>
+ <function name="DeleteInteractionChoiceSet" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="INVALID_ID"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="Alert" messagetype="request">
+ <description>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</description>
+ <param name="alertText1" type="String" maxlength="500" mandatory="false">
+ <description>The first line of the alert text field</description>
+ </param>
+ <param name="alertText2" type="String" maxlength="500" mandatory="false">
+ <description>The second line of the alert text field</description>
+ </param>
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ <param name="duration" type="Integer" minvalue="3000" maxvalue="10000" mandatory="false">
+ <description>Timeout in milliseconds.</description>
+ <description>Typical timeouts are 3-5 seconds</description>
+ <description>If omitted, timeout is set to 5s.</description>
+ </param>
+ <param name="playTone" type="Boolean" mandatory="false">
+ <description>Defines if tone should be played. Tone is played before TTS.</description>
+ <description>If omitted, no tone is played.</description>
+ </param>
+ </function>
+ <function name="Alert" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="Show" messagetype="request">
+ <description>Updates the persistent display. Supported fields depend on display capabilities.</description>
+ <param name="mainField1" type="String" maxlength="500" mandatory="false">
+ <description>The text that should be displayed in a single or upper display line.</description>
+ <description>If this text is not set, the text of mainField1 stays unchanged.</description>
+ <description>If this text is empty "", the field will be cleared.</description>
+ </param>
+ <param name="mainField2" type="String" maxlength="500" mandatory="false">
+ <description>The text that should be displayed on the second dispay line.</description>
+ <description>If this text is not set, the text of mainField2 stays unchanged.</description>
+ <description>If this text is empty "", the field will be cleared.</description>
+ </param>
+ <param name="alignment" type="TextAlignment" mandatory="false">
+ <description>Specifies how mainField1 and mainField2 texts should be aligned on display.</description>
+ <description>If omitted, texts will be centered</description>
+ </param>
+ <param name="statusBar" type="String" maxlength="500" mandatory="false">
+ <description>Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc.</description>
+ </param>
+ <param name="mediaClock" type="String" maxlength="500" mandatory="false">
+ <description>Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync capabilities.</description>
+ <description>If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.</description>
+ </param>
+ <param name="mediaTrack" type="String" maxlength="500" mandatory="false">
+ <description>The text that should be displayed in the track field.</description>
+ <description>This field is only valid for media applications on NGN type ACMs.</description>
+ <description>If this text is not set, the text of mediaTrack stays unchanged.</description>
+ <description>If this text is empty "", the field will be cleared.</description>
+ </param>
+ </function>
+ <function name="Show" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="Speak" messagetype="request">
+ <description>Speaks a text.</description>
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <description>An array of text chunks of type TTSChunk. See TTSChunk</description>
+ <description>The array must have at least one item</description>
+ </param>
+ </function>
+ <function name="Speak" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="ABORTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="SetMediaClockTimer" messagetype="request">
+ <description>Sets the initial media clock value and automatic update method.</description>
+ <param name="startTime" type="StartTime" mandatory="false">
+ <description>See StartTime</description>
+ <description>startTime must be provided for "run"</description>
+ <description>startTime will be ignored for "pause" and "resum"</description>
+ </param>
+ <param name="updateMode" type="UpdateMode">
+ <description>Enumeration to control the media clock.</description>
+ <description>In case of pause or resume, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused.</description>
+ </param>
+ </function>
+ <function name="SetMediaClockTimer" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="EncodedSyncPData" messagetype="request">
+ <description>Allows encoded data in the form of SyncP packets to be sent to the SYNC module</description>
+ <param name="data" type="String" maxlength="10000" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ <todo>What is the maxlength</todo>
+ </param>
+ </function>
+ <function name="EncodedSyncPData" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="SubscribeButton" messagetype="request">
+ <description>Subscribes to built-in HMI buttons.</description>
+ <description>The application will be notified by the OnButtonEvent and OnButtonPress.</description>
+ <description>To unsubscribe the notifications, use unsubscribeButton.</description>
+ <param name="buttonName" type="ButtonName">
+ <description>Name of the button to subscribe.</description>
+ </param>
+ </function>
+ <function name="SubscribeButton" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_BUTTON"/>
+ <element name="IGNORED"/>
+ <element name="REJECTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeButton" messagetype="request">
+ <description>Unsubscribes from built-in HMI buttons.</description>
+ <param name="buttonName" type="ButtonName">
+ <description>Name of the button to unsubscribe.</description>
+ </param>
+ </function>
+ <function name="UnsubscribeButton" messagetype="response">
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="UNSUPPORTED_BUTTON"/>
+ <element name="IGNORED"/>
+ <element name="REJECTED"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <function name="GenericResponse" messagetype="response">
+ <description>Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.</description>
+ <description>Currently, only resultCode INVALID_DATA is used.</description>
+ <param name="success" type="Boolean">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+ <param name="resultCode" type="Result">
+ <description>See Result</description>
+ <element name="INVALID_DATA"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ </function>
+ <!-- Notifications -->
+ <function name="OnHMIStatus" messagetype="notification">
+ <param name="hmiLevel" type="HMILevel">
+ <description>See HMILevel</description>
+ </param>
+ <param name="audioStreamingState" type="AudioStreamingState">
+ <description>See AudioStreamingState</description>
+ </param>
+ <param name="systemContext" type="SystemContext">
+ <description>See SystemContext</description>
+ </param>
+ </function>
+ <function name="OnAppInterfaceUnregistered" messagetype="notification">
+ <param name="reason" type="AppInterfaceUnregisteredReason">
+ <description>See AppInterfaceUnregisteredReason</description>
+ </param>
+ </function>
+ <function name="OnButtonEvent" messagetype="notification">
+ <description>Notifies application of UP/DOWN events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName"/>
+ <param name="buttonEventMode" type="ButtonEventMode">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ </function>
+ <function name="OnButtonPress" messagetype="notification">
+ <description>Notifies application of LONG/SHORT press events for buttons to which the application is subscribed.</description>
+ <param name="buttonName" type="ButtonName"/>
+ <param name="buttonPressMode" type="ButtonPressMode">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ </function>
+ <function name="OnCommand" messagetype="notification">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <description>Command ID, which is related to a specific menu entry.</description>
+ </param>
+ <param name="triggerSource" type="TriggerSource">
+ <description>See TriggerSource</description>
+ </param>
+ </function>
+ <function name="OnEncodedSyncPData" messagetype="notification">
+ <description>Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device.</description>
+ <param name="data" type="String" maxlength="10000" minsize="1" maxsize="100" mandatory="true" array="true">
+ <description>Contains base64 encoded string of SyncP packets.</description>
+ </param>
+ </function>
+ <function name="OnTBTClientState" messagetype="notification">
+ <description>Provides applications with notifications specific to the current TBT client status on the module</description>
+ <param name="state" type="TBTState">
+ <description>Current State of TBT client</description>
+ </param>
+ </function>
+ <function name="OnDriverDistraction" messagetype="notification">
+ <description>Provides driver distraction state to mobile applications</description>
+ <param name="state" type="DriverDistractionState">
+ <description>Current State of Driver Distraction</description>
+ </param>
+ </function>
+
+
+</interface>
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
new file mode 100644
index 0000000000..b16ec26e2a
--- /dev/null
+++ b/src/components/media_manager/CMakeLists.txt
@@ -0,0 +1,81 @@
+if (EXTENDED_MEDIA_MODE)
+find_package(Gstreamer-1.0 REQUIRED)
+find_package(Glib-2.0 REQUIRED)
+find_package(PkgConfig)
+pkg_check_modules(GLIB2 REQUIRED glib-2.0)
+add_definitions(${GLIB2_CFLAGS})
+set(default_includes
+ ${GSTREAMER_gst_INCLUDE_DIR}
+ ${GLIB_glib_2_INCLUDE_DIR}
+)
+set(default_sources
+ ./src/audio/a2dp_source_player_adapter.cc
+ ./src/audio/from_mic_recorder_adapter.cc
+ ./src/audio/from_mic_to_file_recorder_thread.cc
+ ./src/audio/socket_audio_streamer_adapter.cc
+ ./src/audio/pipe_audio_streamer_adapter.cc
+ ./src/video/socket_video_streamer_adapter.cc
+ ./src/video/pipe_video_streamer_adapter.cc
+ ./src/video/video_stream_to_file_adapter.cc
+ ./src/pipe_streamer_adapter.cc
+ ./src/socket_streamer_adapter.cc
+)
+set(LIBRARIES
+ ${GSTREAMER_gstreamer_LIBRARY}
+ pulse-simple
+ pulse
+ gobject-2.0
+ glib-2.0
+)
+else(EXTENDED_MEDIA_MODE)
+set(default_includes
+)
+set(default_sources
+ ./src/video/video_stream_to_file_adapter.cc
+ ./src/audio/socket_audio_streamer_adapter.cc
+ ./src/audio/pipe_audio_streamer_adapter.cc
+ ./src/video/socket_video_streamer_adapter.cc
+ ./src/video/pipe_video_streamer_adapter.cc
+ ./src/video/video_stream_to_file_adapter.cc
+ ./src/pipe_streamer_adapter.cc
+ ./src/socket_streamer_adapter.cc
+)
+set(LIBRARIES
+ ProtocolLibrary
+)
+endif()
+
+include_directories (
+ ./include
+ ./include/audio/
+ ./include/video/
+ ../utils/include/
+ ../protocol_handler/include/
+ ../connection_handler/include/
+ ../application_manager/include/
+ ../smart_objects/include/
+ ../hmi_message_handler/include/
+ ../formatters/include
+ ../config_profile/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/include/
+ ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/
+ ${default_includes}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ ./src/media_adapter_impl.cc
+ ./src/audio/from_mic_recorder_listener.cc
+ ./src/audio/audio_stream_sender_thread.cc
+ ./src/streamer_listener.cc
+ ./src/media_manager_impl.cc
+)
+
+add_library("MediaManager" ${SOURCES} ${default_sources})
+target_link_libraries("MediaManager" ${LIBRARIES})
+
+if(BUILD_TESTS)
+ #add_subdirectory(test)
+endif()
diff --git a/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
new file mode 100644
index 0000000000..9eb63c2fe8
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
@@ -0,0 +1,65 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_A2DP_SOURCE_PLAYER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_A2DP_SOURCE_PLAYER_ADAPTER_H_
+
+#include <map>
+#include "protocol/common.h"
+#include "media_manager/media_adapter_impl.h"
+
+namespace threads {
+class Thread;
+}
+
+namespace media_manager {
+
+class A2DPSourcePlayerAdapter : public MediaAdapterImpl {
+ public:
+ A2DPSourcePlayerAdapter();
+ ~A2DPSourcePlayerAdapter();
+ void SendData(int32_t application_key,
+ const RawMessagePtr message) {}
+ void StartActivity(int32_t application_key);
+ void StopActivity(int32_t application_key);
+ bool is_app_performing_activity(int32_t application_key);
+
+ private:
+ class A2DPSourcePlayerThread;
+
+ std::map<int32_t, threads::Thread*> sources_;
+ DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerAdapter);
+};
+
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_A2DP_SOURCE_PLAYER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
new file mode 100644
index 0000000000..056ca96607
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
@@ -0,0 +1,137 @@
+//
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_AUDIO_STREAM_SENDER_THREAD_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_AUDIO_STREAM_SENDER_THREAD_H_
+
+#include <string>
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+}
+}
+
+namespace media_manager {
+
+typedef enum {
+ SR_INVALID = -1,
+ SR_8KHZ = 0,
+ SR_16KHZ = 1,
+ SR_22KHZ = 2,
+ SR_44KHZ = 3
+} SamplingRate;
+
+typedef enum {
+ ACQ_INVALID = -1,
+ ACQ_8_BIT = 0,
+ ACQ_16_BIT = 1
+} AudioCaptureQuality;
+
+typedef enum {
+ AT_INVALID = -1,
+ AT_PCM = 0
+} AudioType;
+
+/*
+ * @brief AudioStreamSenderThread class used to read binary data written from microphone
+ * and send it every 1 second to mobile device.
+ */
+class AudioStreamSenderThread : public threads::ThreadDelegate {
+ public:
+ /*
+ * @brief AudioStreamSenderThread class constructor
+ *
+ * @param session_key Session key of connection for Mobile side
+ * @param correlation_id Correlation id for response for Mobile side
+ */
+ AudioStreamSenderThread(const std::string fileName,
+ uint32_t session_key);
+
+ /*
+ * @brief AudioStreamSenderThread class destructor
+ */
+ ~AudioStreamSenderThread();
+
+ /**
+ * @brief Thread procedure.
+ */
+ void threadMain();
+
+ /*
+ * @brief Retrieve session key
+ *
+ * @return Stored session key
+ */
+ uint32_t session_key() const;
+
+ bool exitThreadMain();
+
+ private:
+ /*
+ * @brief Sends AudioPassThru request
+ */
+ bool SendEndAudioPassThru();
+
+ void sendAudioChunkToMobile();
+
+
+ /*
+ * @brief Creates command for corresponding smart object
+ *
+ * @param cmd Smart object representing command
+ */
+ void FactoryCreateCommand(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject* cmd);
+
+ bool getShouldBeStopped();
+ void setShouldBeStopped(bool should_stop);
+
+ uint32_t session_key_;
+ const std::string fileName_;
+ int32_t offset_;
+ volatile bool shouldBeStoped_;
+ sync_primitives::Lock shouldBeStoped_lock_;
+ sync_primitives::ConditionalVariable shouldBeStoped_cv_;
+
+ static const int32_t kAudioPassThruTimeout;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioStreamSenderThread);
+};
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_AUDIO_STREAM_SENDER_THREAD_H_
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
new file mode 100644
index 0000000000..d7d0434a49
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
@@ -0,0 +1,65 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/media_adapter_impl.h"
+
+namespace threads {
+class Thread;
+}
+
+namespace media_manager {
+
+class FromMicRecorderAdapter : public MediaAdapterImpl {
+ public:
+ FromMicRecorderAdapter();
+ ~FromMicRecorderAdapter();
+ void SendData(int32_t application_key,
+ const RawMessagePtr message) {}
+ void StartActivity(int32_t application_key);
+ void StopActivity(int32_t application_key);
+ bool is_app_performing_activity(int32_t application_key);
+ void set_output_file(const std::string& output_file);
+ void set_duration(int32_t duration);
+ private:
+ threads::Thread* recorder_thread_;
+ std::string output_file_;
+ const int32_t kDefaultDuration;
+ int32_t duration_;
+ DISALLOW_COPY_AND_ASSIGN(FromMicRecorderAdapter);
+};
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
new file mode 100644
index 0000000000..b2b70d5a1b
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_LISTENER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_LISTENER_H_
+
+#include <string>
+#include "media_manager/media_adapter_listener.h"
+
+namespace threads {
+class Thread;
+}
+
+namespace media_manager {
+class FromMicRecorderListener : public MediaAdapterListener {
+ public:
+ explicit FromMicRecorderListener(
+ const std::string& file_name);
+ ~FromMicRecorderListener();
+ virtual void OnDataReceived(
+ int32_t application_key,
+ const DataForListener& data);
+ virtual void OnErrorReceived(
+ int32_t application_key,
+ const DataForListener& data);
+ virtual void OnActivityStarted(int32_t application_key);
+ virtual void OnActivityEnded(int32_t application_key);
+
+ private:
+ threads::Thread* reader_;
+ std::string file_name_;
+ int32_t current_application_;
+ DISALLOW_COPY_AND_ASSIGN(FromMicRecorderListener);
+};
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_RECORDER_LISTENER_H_
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
new file mode 100644
index 0000000000..ed40df6906
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
@@ -0,0 +1,98 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
+
+#include <net/if.h>
+#include <gst/gst.h>
+#include <string>
+
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace media_manager {
+
+class FromMicToFileRecorderThread : public threads::ThreadDelegate {
+ public:
+ FromMicToFileRecorderThread(const std::string& output_file,
+ int32_t duration);
+
+ void threadMain();
+
+ bool exitThreadMain();
+
+ void set_output_file(const std::string& output_file);
+ void set_record_duration(int32_t duration);
+
+ private:
+ int32_t argc_;
+ gchar** argv_;
+
+ const std::string oKey_;
+ const std::string tKey_;
+
+ static GMainLoop* loop;
+ threads::Thread* sleepThread_;
+ bool shouldBeStoped_;
+ sync_primitives::Lock stopFlagLock_;
+
+ std::string outputFileName_, durationString_;
+
+ typedef struct {
+ GstElement* pipeline;
+ gint duration;
+ } GstTimeout;
+
+ void initArgs();
+
+ void psleep(void* timeout);
+
+ class SleepThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit SleepThreadDelegate(GstTimeout timeout);
+
+ void threadMain();
+
+ private:
+ GstTimeout timeout_;
+
+ DISALLOW_COPY_AND_ASSIGN(SleepThreadDelegate);
+ };
+
+ DISALLOW_COPY_AND_ASSIGN(FromMicToFileRecorderThread);
+};
+
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_FROM_MIC_TO_FILE_RECORDER_THREAD_H_
diff --git a/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h b/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h
new file mode 100644
index 0000000000..9e21594463
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/pipe_audio_streamer_adapter.h
@@ -0,0 +1,51 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_PIPE_AUDIO_STREAMER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_PIPE_AUDIO_STREAMER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/pipe_streamer_adapter.h"
+
+namespace media_manager {
+class PipeAudioStreamerAdapter : public PipeStreamerAdapter {
+ public:
+ PipeAudioStreamerAdapter();
+ ~PipeAudioStreamerAdapter();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PipeAudioStreamerAdapter);
+};
+
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_PIPE_AUDIO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h b/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h
new file mode 100644
index 0000000000..e9c4031ab5
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/audio/socket_audio_streamer_adapter.h
@@ -0,0 +1,50 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_SOCKET_AUDIO_STREAMER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_SOCKET_AUDIO_STREAMER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/socket_streamer_adapter.h"
+
+namespace media_manager {
+class SocketAudioStreamerAdapter : public SocketStreamerAdapter {
+ public:
+ SocketAudioStreamerAdapter();
+ virtual ~SocketAudioStreamerAdapter();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SocketAudioStreamerAdapter);
+};
+} // namespace media_manager
+
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_AUDIO_SOCKET_AUDIO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/media_adapter.h b/src/components/media_manager/include/media_manager/media_adapter.h
new file mode 100644
index 0000000000..66f23df6bc
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/media_adapter.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_H_
+
+#include <cstdint>
+#include "protocol/common.h"
+
+namespace media_manager {
+
+class MediaAdapter {
+ public:
+ virtual void SendData(int32_t application_key,
+ const RawMessagePtr message) = 0;
+ virtual void StartActivity(int32_t application_key) = 0;
+ virtual void StopActivity(int32_t application_key) = 0;
+ virtual bool is_app_performing_activity(int32_t application_key) = 0;
+
+ virtual ~MediaAdapter() { ;}
+};
+} // namespace media_manager
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/media_adapter_impl.h b/src/components/media_manager/include/media_manager/media_adapter_impl.h
new file mode 100644
index 0000000000..5fa385e036
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/media_adapter_impl.h
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_H_
+
+#include <set>
+#include "media_manager/media_adapter.h"
+#include "media_manager/media_adapter_listener.h"
+#include "utils/macro.h"
+
+namespace media_manager {
+
+typedef utils::SharedPtr<MediaAdapterListener> MediaListenerPtr;
+
+class MediaAdapterImpl : public MediaAdapter {
+ public:
+ virtual ~MediaAdapterImpl();
+ virtual void AddListener(const MediaListenerPtr& listener);
+ virtual void RemoveListener(const MediaListenerPtr& listener);
+
+ protected:
+ MediaAdapterImpl();
+ std::set<MediaListenerPtr> media_listeners_;
+ int32_t current_application_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
+};
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_H_
diff --git a/src/components/media_manager/include/media_manager/media_adapter_listener.h b/src/components/media_manager/include/media_manager/media_adapter_listener.h
new file mode 100644
index 0000000000..2f11119e3b
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/media_adapter_listener.h
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_H_
+
+#include <stdint.h>
+
+namespace media_manager {
+
+typedef int32_t DataForListener;
+
+class MediaAdapterListener {
+ public:
+ virtual ~MediaAdapterListener() {
+ }
+ virtual void OnDataReceived(
+ int32_t application_key,
+ const DataForListener& data) = 0;
+ virtual void OnErrorReceived(
+ int32_t application_key,
+ const DataForListener& data) = 0;
+ virtual void OnActivityStarted(int32_t application_key) = 0;
+ virtual void OnActivityEnded(int32_t application_key) = 0;
+};
+} // namespace media_manager
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_H_
diff --git a/src/components/media_manager/include/media_manager/media_manager.h b/src/components/media_manager/include/media_manager/media_manager.h
new file mode 100644
index 0000000000..458481ca24
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/media_manager.h
@@ -0,0 +1,55 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
+
+#include <string>
+
+namespace media_manager {
+class MediaManager {
+ public:
+ virtual void PlayA2DPSource(int32_t application_key) = 0;
+ virtual void StopA2DPSource(int32_t application_key) = 0;
+ virtual void StartMicrophoneRecording(int32_t application_key,
+ const std::string& outputFileName,
+ int32_t duration) = 0;
+ virtual void StopMicrophoneRecording(int32_t application_key) = 0;
+ virtual void StartVideoStreaming(int32_t application_key) = 0;
+ virtual void StopVideoStreaming(int32_t application_key) = 0;
+ virtual void StartAudioStreaming(int32_t application_key) = 0;
+ virtual void StopAudioStreaming(int32_t application_key) = 0;
+
+ virtual ~MediaManager(){}
+};
+} // namespace media_manager
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
new file mode 100644
index 0000000000..7f997bf8c3
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
+
+#include <string>
+#include "utils/singleton.h"
+#include "protocol_handler/protocol_observer.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol/service_type.h"
+#include "media_manager/media_manager.h"
+#include "media_manager/media_adapter_impl.h"
+#include "media_manager/media_adapter_listener.h"
+
+namespace media_manager {
+
+class MediaManagerImpl : public MediaManager,
+ public protocol_handler::ProtocolObserver,
+ public utils::Singleton<MediaManagerImpl> {
+ public:
+ virtual ~MediaManagerImpl();
+ virtual void SetProtocolHandler(
+ protocol_handler::ProtocolHandler* protocol_handler);
+ virtual void PlayA2DPSource(int32_t application_key);
+ virtual void StopA2DPSource(int32_t application_key);
+ virtual void StartMicrophoneRecording(int32_t application_key,
+ const std::string& outputFileName,
+ int32_t duration);
+ virtual void StopMicrophoneRecording(int32_t application_key);
+ virtual void StartVideoStreaming(int32_t application_key);
+ virtual void StopVideoStreaming(int32_t application_key);
+ virtual void StartAudioStreaming(int32_t application_key);
+ virtual void StopAudioStreaming(int32_t application_key);
+ virtual void OnMessageReceived(
+ const RawMessagePtr message);
+ virtual void OnMobileMessageSent(
+ const RawMessagePtr message);
+ virtual void FramesProcessed(int32_t application_key, int32_t frame_number);
+
+ protected:
+ MediaManagerImpl();
+ virtual void Init();
+ protocol_handler::ProtocolHandler* protocol_handler_;
+ MediaAdapter* a2dp_player_;
+ MediaAdapterImpl* from_mic_recorder_;
+ MediaListenerPtr from_mic_listener_;
+ MediaAdapterImpl* video_streamer_;
+ MediaAdapterImpl* audio_streamer_;
+ MediaListenerPtr video_streamer_listener_;
+ MediaListenerPtr audio_streamer_listener_;
+ bool video_stream_active_;
+ bool audio_stream_active_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaManagerImpl);
+ FRIEND_BASE_SINGLETON_CLASS(MediaManagerImpl);
+};
+
+} // namespace media_manager
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_IMPL_H_
diff --git a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
new file mode 100644
index 0000000000..9a33dd4744
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h
@@ -0,0 +1,114 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_PIPE_STREAMER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_PIPE_STREAMER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/media_adapter_impl.h"
+#include "utils/shared_ptr.h"
+#include "utils/message_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace media_manager {
+class PipeStreamerAdapter : public MediaAdapterImpl {
+ public:
+ PipeStreamerAdapter();
+ virtual ~PipeStreamerAdapter();
+ virtual void SendData(int32_t application_key,
+ const RawMessagePtr message);
+ virtual void StartActivity(int32_t application_key);
+ virtual void StopActivity(int32_t application_key);
+ virtual bool is_app_performing_activity(int32_t application_key);
+
+ protected:
+ std::string named_pipe_path_;
+
+ /*
+ * @brief Start streamer thread
+ */
+ virtual void Init();
+
+ private:
+ class Streamer : public threads::ThreadDelegate {
+ public:
+ /*
+ * Default constructor
+ *
+ * @param server Server pointer
+ */
+ explicit Streamer(PipeStreamerAdapter* server);
+
+ /*
+ * Destructor
+ */
+ ~Streamer();
+
+ /*
+ * @brief Function called by thread on start
+ */
+ void threadMain();
+
+ /*
+ * @brief Function called by thread on exit
+ */
+ bool exitThreadMain();
+
+ /*
+ * @brief Opens pipe
+ */
+ void open();
+
+ /*
+ * @brief Closes pipe
+ */
+ void close();
+
+ private:
+ PipeStreamerAdapter* server_;
+ int32_t pipe_fd_;
+ volatile bool stop_flag_;
+
+ DISALLOW_COPY_AND_ASSIGN(Streamer);
+ };
+
+ bool is_ready_;
+ threads::Thread* thread_;
+ MessageQueue<RawMessagePtr> messages_;
+
+ DISALLOW_COPY_AND_ASSIGN(PipeStreamerAdapter);
+};
+
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_PIPE_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
new file mode 100644
index 0000000000..87c705a20a
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h
@@ -0,0 +1,136 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_SOCKET_STREAMER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_SOCKET_STREAMER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/media_adapter_impl.h"
+#include "utils/logger.h"
+#include "utils/shared_ptr.h"
+#include "utils/message_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace media_manager {
+class SocketStreamerAdapter : public MediaAdapterImpl {
+ public:
+ SocketStreamerAdapter();
+ virtual ~SocketStreamerAdapter();
+ virtual void SendData(int32_t application_key,
+ const RawMessagePtr message);
+ virtual void StartActivity(int32_t application_key);
+ virtual void StopActivity(int32_t application_key);
+ virtual bool is_app_performing_activity(int32_t application_key);
+
+ protected:
+
+ /*
+ * @brief Start streamer thread
+ */
+ virtual void Init();
+
+ int32_t port_;
+ std::string ip_;
+
+ private:
+ class Streamer : public threads::ThreadDelegate {
+ public:
+ /*
+ * Default constructor
+ *
+ * @param server Server pointer
+ */
+ explicit Streamer(SocketStreamerAdapter* const server);
+
+ /*
+ * Destructor
+ */
+ ~Streamer();
+
+ /*
+ * Function called by thread on start
+ */
+ void threadMain();
+
+ /*
+ * Function called by thread on exit
+ */
+ bool exitThreadMain();
+
+ /*
+ * Checks if server is ready
+ *
+ * @return TRUE if socket is ready otherwise FALSE
+ */
+ bool is_ready() const;
+
+ /*
+ * Starts server
+ *
+ */
+ void start();
+
+ /*
+ * Stops server
+ *
+ */
+ void stop();
+
+ /*
+ * Sends data to connected client
+ *
+ * @param block Pointer to the data
+ */
+ bool send(const RawMessagePtr msg);
+
+ private:
+ SocketStreamerAdapter* const server_;
+ int32_t new_socket_fd_;
+ bool is_first_loop_;
+ volatile bool is_client_connected_;
+ volatile bool stop_flag_;
+ sync_primitives::Lock thread_lock;
+ DISALLOW_COPY_AND_ASSIGN(Streamer);
+ };
+
+ int32_t socket_fd_;
+ bool is_ready_;
+ threads::Thread* thread_;
+ Streamer* streamer_;
+ MessageQueue<RawMessagePtr> messages_;
+ DISALLOW_COPY_AND_ASSIGN(SocketStreamerAdapter);
+};
+} // namespace media_manager
+
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_SOCKET_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/streamer_listener.h b/src/components/media_manager/include/media_manager/streamer_listener.h
new file mode 100644
index 0000000000..38e89a2cb9
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/streamer_listener.h
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_STREAMER_LISTENER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_STREAMER_LISTENER_H_
+
+#include <stdint.h>
+#include "media_manager/media_adapter_listener.h"
+#include "utils/macro.h"
+
+namespace media_manager {
+class StreamerListener : public MediaAdapterListener {
+ public:
+ StreamerListener();
+ ~StreamerListener();
+ virtual void OnDataReceived(
+ int32_t application_key,
+ const DataForListener& data);
+ virtual void OnErrorReceived(
+ int32_t application_key,
+ const DataForListener& data);
+ virtual void OnActivityStarted(int32_t application_key);
+ virtual void OnActivityEnded(int32_t application_key);
+ private:
+ int32_t current_application_;
+ DISALLOW_COPY_AND_ASSIGN(StreamerListener);
+};
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_STREAMER_LISTENER_H_
diff --git a/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h b/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h
new file mode 100644
index 0000000000..50328cc43c
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/video/pipe_video_streamer_adapter.h
@@ -0,0 +1,51 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_PIPE_VIDEO_STREAMER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_PIPE_VIDEO_STREAMER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/pipe_streamer_adapter.h"
+
+namespace media_manager {
+class PipeVideoStreamerAdapter : public PipeStreamerAdapter {
+ public:
+ PipeVideoStreamerAdapter();
+ ~PipeVideoStreamerAdapter();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PipeVideoStreamerAdapter);
+};
+
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_PIPE_VIDEO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h b/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
new file mode 100644
index 0000000000..8752efc5ee
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/video/socket_video_streamer_adapter.h
@@ -0,0 +1,51 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
+
+#include <string>
+#include "media_manager/socket_streamer_adapter.h"
+
+namespace media_manager {
+class SocketVideoStreamerAdapter : public SocketStreamerAdapter {
+ public:
+ SocketVideoStreamerAdapter();
+ virtual ~SocketVideoStreamerAdapter();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SocketVideoStreamerAdapter);
+};
+} // namespace media_manager
+
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_SOCKET_VIDEO_STREAMER_ADAPTER_H_
diff --git a/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h b/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h
new file mode 100644
index 0000000000..819c4f5edb
--- /dev/null
+++ b/src/components/media_manager/include/media_manager/video/video_stream_to_file_adapter.h
@@ -0,0 +1,111 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_VIDEO_STREAM_TO_FILE_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_VIDEO_STREAM_TO_FILE_ADAPTER_H_
+
+#include <string>
+#include <fstream>
+#include "media_manager/media_adapter_impl.h"
+#include "utils/message_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace media_manager {
+
+class VideoStreamToFileAdapter : public MediaAdapterImpl {
+ public:
+ explicit VideoStreamToFileAdapter(const std::string& file_name);
+ virtual ~VideoStreamToFileAdapter();
+ virtual void SendData(int32_t application_key,
+ const RawMessagePtr message);
+ virtual void StartActivity(int32_t application_key);
+ virtual void StopActivity(int32_t application_key);
+ virtual bool is_app_performing_activity(int32_t application_key);
+
+ /*
+ * @brief Start streamer thread
+ */
+ virtual void Init();
+
+ private:
+ class Streamer : public threads::ThreadDelegate {
+ public:
+ /*
+ * Default constructor
+ *
+ * @param server Server pointer
+ */
+ explicit Streamer(VideoStreamToFileAdapter* server);
+
+ /*
+ * Destructor
+ */
+ ~Streamer();
+
+ /*
+ * @brief Function called by thread on start
+ */
+ void threadMain();
+
+ /*
+ * @brief Function called by thread on exit
+ */
+ bool exitThreadMain();
+
+ /*
+ * @brief Opens file
+ */
+ void open();
+
+ /*
+ * @brief Closes file
+ */
+ void close();
+
+ private:
+ VideoStreamToFileAdapter* server_;
+ volatile bool stop_flag_;
+ std::ofstream* file_stream_;
+
+ DISALLOW_COPY_AND_ASSIGN(Streamer);
+ };
+
+ private:
+ std::string file_name_;
+ bool is_ready_;
+ threads::Thread* thread_;
+ MessageQueue<RawMessagePtr> messages_;
+};
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_VIDEO_VIDEO_STREAM_TO_FILE_ADAPTER_H_
diff --git a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
new file mode 100644
index 0000000000..91604d22c9
--- /dev/null
+++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
@@ -0,0 +1,278 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <net/if.h>
+#include <pulse/simple.h>
+#include <pulse/error.h>
+#include <string.h>
+#include <utility>
+#include "utils/threads/thread.h"
+#include "media_manager/audio/a2dp_source_player_adapter.h"
+#include "utils/lock.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/logger.h"
+#include "connection_handler/connection_handler_impl.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "A2DPSourcePlayerAdapter")
+
+class A2DPSourcePlayerAdapter::A2DPSourcePlayerThread
+ : public threads::ThreadDelegate {
+ public:
+ explicit A2DPSourcePlayerThread(const std::string& device);
+
+ void threadMain();
+
+ bool exitThreadMain();
+
+ private:
+ // The Sample format to use
+ static const pa_sample_spec sSampleFormat_;
+
+ pa_simple* s_in, *s_out;
+ std::string device_;
+ const int32_t BUFSIZE_;
+ bool should_be_stopped_;
+ sync_primitives::Lock should_be_stopped_lock_;
+
+ void freeStreams();
+
+ DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerThread);
+};
+
+A2DPSourcePlayerAdapter::A2DPSourcePlayerAdapter() {
+}
+
+A2DPSourcePlayerAdapter::~A2DPSourcePlayerAdapter() {
+ for (std::map<int32_t, threads::Thread*>::iterator it = sources_.begin();
+ sources_.end() != it;
+ ++it) {
+ if (NULL != it->second) {
+ if (it->second->is_running()) {
+ it->second->stop();
+ }
+ delete(it->second);
+ }
+ }
+ sources_.clear();
+}
+
+void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "Starting a2dp playing music for "
+ << application_key << " application.");
+ if (application_key != current_application_) {
+ current_application_ = application_key;
+
+ std::map<int32_t, threads::Thread*>::iterator it =
+ sources_.find(application_key);
+ if (sources_.end() != it) {
+ if (NULL != it->second && !it->second->is_running()) {
+ it->second->start();
+ } else {
+ current_application_ = 0;
+ }
+ } else {
+ uint32_t device_id = 0;
+ connection_handler::ConnectionHandlerImpl::instance()->
+ GetDataOnSessionKey(application_key, 0, NULL, &device_id);
+ std::string mac_adddress;
+ connection_handler::ConnectionHandlerImpl::instance()->GetDataOnDeviceID(
+ device_id,
+ NULL,
+ NULL,
+ &mac_adddress);
+
+ // TODO(PK): Convert mac_adddress to the
+ // following format : "bluez_source.XX_XX_XX_XX_XX_XX" if needed
+ // before passing to the A2DPSourcePlayerThread constructor
+
+ threads::Thread* new_activity = new threads::Thread(
+ mac_adddress.c_str(),
+ new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_adddress));
+ if (NULL != new_activity) {
+ sources_.insert(std::pair<int32_t, threads::Thread*>(
+ application_key, new_activity));
+
+ new_activity->start();
+ } else {
+ current_application_ = 0;
+ }
+ }
+ }
+}
+
+void A2DPSourcePlayerAdapter::StopActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "Stopping 2dp playing for "
+ << application_key << " application.");
+ if (application_key != current_application_) {
+ return;
+ }
+ std::map<int32_t, threads::Thread*>::iterator it =
+ sources_.find(application_key);
+ if (sources_.end() != it) {
+ LOG4CXX_DEBUG(logger_, "Source exists.");
+ if (NULL != it->second) {
+ LOG4CXX_DEBUG(logger_, "Sources thread was allocated");
+ if ((*it).second->is_running()) {
+ // Sources thread was started - stop it
+ LOG4CXX_DEBUG(logger_, "Sources thread was started - stop it");
+ (*it).second->stop();
+ }
+ }
+ current_application_ = 0;
+ }
+}
+
+bool A2DPSourcePlayerAdapter::is_app_performing_activity(int32_t
+ application_key) {
+ return (application_key == current_application_);
+}
+
+const pa_sample_spec A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::
+sSampleFormat_ = {
+ /*format*/ PA_SAMPLE_S16LE,
+ /*rate*/ 44100,
+ /*channels*/ 2
+};
+
+A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::A2DPSourcePlayerThread(
+ const std::string& device)
+ : threads::ThreadDelegate(),
+ device_(device),
+ BUFSIZE_(32) {
+}
+
+void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::freeStreams() {
+ LOG4CXX_INFO(logger_, "Free streams in A2DPSourcePlayerThread.");
+ if (s_in) {
+ pa_simple_free(s_in);
+ }
+
+ if (s_out) {
+ pa_simple_free(s_out);
+ }
+}
+
+bool A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::exitThreadMain() {
+ sync_primitives::AutoLock auto_lock(should_be_stopped_lock_);
+ should_be_stopped_ = true;
+ return true;
+}
+
+void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::threadMain() {
+ LOG4CXX_INFO(logger_, "Main thread of A2DPSourcePlayerThread.");
+
+ {
+ sync_primitives::AutoLock auto_lock(should_be_stopped_lock_);
+ should_be_stopped_ = false;
+ }
+
+ int32_t error;
+
+ const char* a2dpSource = device_.c_str();
+
+ LOG4CXX_DEBUG(logger_, device_);
+
+ LOG4CXX_DEBUG(logger_, "Creating streams");
+
+ /* Create a new playback stream */
+ if (!(s_out = pa_simple_new(NULL, "AudioManager", PA_STREAM_PLAYBACK, NULL,
+ "playback", &sSampleFormat_, NULL, NULL, &error))) {
+ LOG4CXX_ERROR(logger_, "pa_simple_new() failed: " << pa_strerror(error));
+ freeStreams();
+ return;
+ }
+
+ if (!(s_in = pa_simple_new(NULL, "AudioManager", PA_STREAM_RECORD, a2dpSource,
+ "record", &sSampleFormat_, NULL, NULL, &error))) {
+ LOG4CXX_ERROR(logger_, "pa_simple_new() failed: " << pa_strerror(error));
+ freeStreams();
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Entering main loop");
+
+ for (;;) {
+ uint8_t buf[BUFSIZE_];
+
+ pa_usec_t latency;
+
+ if ((latency = pa_simple_get_latency(s_in, &error)) == (pa_usec_t) - 1) {
+ LOG4CXX_ERROR(logger_, "pa_simple_get_latency() failed: "
+ << pa_strerror(error));
+ break;
+ }
+
+ // LOG4CXX_INFO(logger_, "In: " << static_cast<float>(latency));
+
+ if ((latency = pa_simple_get_latency(s_out, &error)) == (pa_usec_t) - 1) {
+ LOG4CXX_ERROR(logger_, "pa_simple_get_latency() failed: "
+ << pa_strerror(error));
+ break;
+ }
+
+ // LOG4CXX_INFO(logger_, "Out: " << static_cast<float>(latency));
+
+ if (pa_simple_read(s_in, buf, sizeof(buf), &error) < 0) {
+ LOG4CXX_ERROR(logger_, "read() failed: " << strerror(error));
+ break;
+ }
+
+ /* ... and play it */
+ if (pa_simple_write(s_out, buf, sizeof(buf), &error) < 0) {
+ LOG4CXX_ERROR(logger_, "pa_simple_write() failed: "
+ << pa_strerror(error));
+ break;
+ }
+
+ bool should_be_stopped;
+ {
+ sync_primitives::AutoLock auto_lock(should_be_stopped_lock_);
+ should_be_stopped = should_be_stopped_;
+ }
+
+ if (should_be_stopped) {
+ break;
+ }
+ }
+
+ /* Make sure that every single sample was played */
+ if (pa_simple_drain(s_out, &error) < 0) {
+ LOG4CXX_ERROR(logger_, "pa_simple_drain() failed: " << pa_strerror(error));
+ freeStreams();
+ return;
+ }
+
+ freeStreams();
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
new file mode 100644
index 0000000000..a3ef5af0bf
--- /dev/null
+++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc
@@ -0,0 +1,149 @@
+//
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+
+
+#if defined(OS_POSIX) && defined(OS_LINUX)
+#include <pthread.h> // TODO(DK): Need to remove
+#include <unistd.h>
+#endif
+
+
+#include <string>
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mobile_command_factory.h"
+#include "application_manager/application_impl.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+
+#include "media_manager/audio/audio_stream_sender_thread.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/message.h"
+
+namespace media_manager {
+using sync_primitives::AutoLock;
+
+const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1;
+const uint32_t kMqueueMessageSize = 4095;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "AudioPassThruThread")
+
+AudioStreamSenderThread::AudioStreamSenderThread(
+ const std::string fileName, uint32_t session_key)
+ : session_key_(session_key),
+ fileName_(fileName),
+ shouldBeStoped_(false),
+ shouldBeStoped_lock_(),
+ shouldBeStoped_cv_() {
+ LOG4CXX_TRACE_ENTER(logger_);
+}
+
+AudioStreamSenderThread::~AudioStreamSenderThread() {
+}
+
+void AudioStreamSenderThread::threadMain() {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ offset_ = 0;
+
+ while (false == getShouldBeStopped()) {
+ AutoLock auto_lock(shouldBeStoped_lock_);
+ shouldBeStoped_cv_.WaitFor(auto_lock, kAudioPassThruTimeout * 1000);
+ sendAudioChunkToMobile();
+ }
+
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void AudioStreamSenderThread::sendAudioChunkToMobile() {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ std::vector<uint8_t> binaryData;
+ std::vector<uint8_t>::iterator from;
+ std::vector<uint8_t>::iterator to;
+
+ if (!file_system::ReadBinaryFile(fileName_, binaryData)) {
+ LOG4CXX_ERROR_EXT(logger_, "Unable to read file." << fileName_);
+
+ return;
+ }
+
+ if (binaryData.empty()) {
+ LOG4CXX_ERROR_EXT(logger_, "Binary data is empty.");
+ return;
+ }
+
+ LOG4CXX_INFO_EXT(logger_, "offset = " << offset_);
+
+ from = binaryData.begin() + offset_;
+ to = binaryData.end();
+
+ if (from < binaryData.end() /*from != binaryData.end()*/) {
+ LOG4CXX_INFO_EXT(logger_, "from != binaryData.end()");
+
+ offset_ = offset_ + to - from;
+
+ application_manager::ApplicationManagerImpl::instance()->
+ SendAudioPassThroughNotification(session_key_,
+ std::vector<uint8_t>(from, to));
+ binaryData.clear();
+ }
+#if !defined(EXTENDED_MEDIA_MODE)
+ // without recording stream restart reading 1-sec file
+ offset_ = 0;
+#endif
+}
+
+bool AudioStreamSenderThread::getShouldBeStopped() {
+ AutoLock auto_lock(shouldBeStoped_lock_);
+
+ return shouldBeStoped_;
+}
+
+void AudioStreamSenderThread::setShouldBeStopped(bool should_stop) {
+ AutoLock auto_lock(shouldBeStoped_lock_);
+ shouldBeStoped_ = should_stop;
+ shouldBeStoped_cv_.NotifyOne();
+}
+
+bool AudioStreamSenderThread::exitThreadMain() {
+ LOG4CXX_INFO(logger_, "AudioStreamSenderThread::exitThreadMain");
+ setShouldBeStopped(true);
+ return true;
+}
+
+uint32_t AudioStreamSenderThread::session_key() const {
+ return session_key_;
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc b/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
new file mode 100644
index 0000000000..ba5e7ec54a
--- /dev/null
+++ b/src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
@@ -0,0 +1,110 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <string>
+#include "utils/threads/thread.h"
+#include "utils/logger.h"
+#include "media_manager/audio/from_mic_to_file_recorder_thread.h"
+#include "media_manager/audio/from_mic_recorder_adapter.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "FromMicRecorderAdapter")
+
+FromMicRecorderAdapter::FromMicRecorderAdapter()
+ : recorder_thread_(NULL)
+ , output_file_("default_recorded_audio.wav")
+ , kDefaultDuration(1000)
+ , duration_(0) {
+ duration_ = kDefaultDuration;
+}
+
+FromMicRecorderAdapter::~FromMicRecorderAdapter() {
+ LOG4CXX_INFO(logger_, "FromMicRecorderAdapter::~FromMicRecorderAdapter()");
+ StopActivity(current_application_);
+}
+
+void FromMicRecorderAdapter::StartActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "FromMicRecorderAdapter::StartActivity "
+ << application_key);
+ if (application_key == current_application_) {
+ LOG4CXX_WARN(logger_, "Running recording from mic for "
+ << current_application_);
+ return;
+ }
+
+// Todd: No gstreamer recorder thread
+ if (!recorder_thread_) {
+ FromMicToFileRecorderThread* thread_delegate =
+ new FromMicToFileRecorderThread(
+ output_file_, duration_);
+ recorder_thread_ = new threads::Thread("MicrophoneRec",
+ thread_delegate);
+ }
+
+ if (NULL != recorder_thread_) {
+ recorder_thread_->start();
+ current_application_ = application_key;
+ }
+}
+
+void FromMicRecorderAdapter::StopActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "FromMicRecorderAdapter::StopActivity "
+ << application_key);
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger_, "Running activity on other app key "
+ << current_application_);
+ return;
+ }
+
+ if (NULL != recorder_thread_) {
+ recorder_thread_->stop();
+ delete recorder_thread_;
+ recorder_thread_ = NULL;
+ }
+ current_application_ = 0;
+}
+
+bool FromMicRecorderAdapter::is_app_performing_activity(int32_t
+ application_key) {
+ return (application_key == current_application_);
+}
+
+void FromMicRecorderAdapter::set_output_file(const std::string& output_file) {
+ output_file_ = output_file;
+}
+
+void FromMicRecorderAdapter::set_duration(int32_t duration) {
+ duration_ = duration;
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
new file mode 100644
index 0000000000..cec85ca4e6
--- /dev/null
+++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc
@@ -0,0 +1,99 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/threads/thread.h"
+#include "utils/logger.h"
+#include "media_manager/audio/from_mic_recorder_listener.h"
+#include "media_manager/audio/audio_stream_sender_thread.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "FromMicRecorderListener")
+
+FromMicRecorderListener::FromMicRecorderListener(
+ const std::string& file_name)
+ : reader_(NULL)
+ , file_name_(file_name) {
+}
+
+FromMicRecorderListener::~FromMicRecorderListener() {
+ if (reader_) {
+ reader_->stop();
+ delete reader_;
+ reader_ = NULL;
+ }
+}
+
+void FromMicRecorderListener::OnDataReceived(
+ int32_t application_key,
+ const DataForListener& data) {
+}
+
+void FromMicRecorderListener::OnErrorReceived(
+ int32_t application_key,
+ const DataForListener& data) {
+}
+
+void FromMicRecorderListener::OnActivityStarted(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "FromMicRecorderListener::OnActivityStarted "
+ << application_key);
+ if (application_key == current_application_) {
+ return;
+ }
+ if (!reader_) {
+ AudioStreamSenderThread* thread_delegate =
+ new AudioStreamSenderThread(file_name_, application_key);
+ reader_ = new threads::Thread("RecorderSender", thread_delegate);
+ }
+ if (reader_) {
+ reader_->start();
+ current_application_ = application_key;
+ }
+}
+
+void FromMicRecorderListener::OnActivityEnded(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "FromMicRecorderListener::OnActivityEnded "
+ << application_key);
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger_, "Not performing activity on " << application_key
+ << " but on " << current_application_);
+ return;
+ }
+ if (reader_) {
+ reader_->stop();
+ delete reader_;
+ reader_ = NULL;
+ }
+ current_application_ = 0;
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
new file mode 100644
index 0000000000..02ccd1f2b7
--- /dev/null
+++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "media_manager/audio/from_mic_to_file_recorder_thread.h"
+#include <unistd.h>
+#include <sstream>
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "FromMicToFileRecorderThread")
+
+GMainLoop* FromMicToFileRecorderThread::loop = NULL;
+
+FromMicToFileRecorderThread::FromMicToFileRecorderThread(
+ const std::string& output_file, int32_t duration)
+ : threads::ThreadDelegate(),
+ argc_(5),
+ oKey_("-o"),
+ tKey_("-t"),
+ sleepThread_(NULL),
+ outputFileName_(output_file) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ set_record_duration(duration);
+}
+
+void FromMicToFileRecorderThread::set_output_file(
+ const std::string& output_file) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ outputFileName_ = output_file;
+}
+
+void FromMicToFileRecorderThread::set_record_duration(int32_t duration) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ std::stringstream stringStream;
+ stringStream << duration / 1000;
+ durationString_ = stringStream.str();
+}
+
+void FromMicToFileRecorderThread::initArgs() {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ argv_ = new gchar*[argc_];
+
+ argv_[0] = new gchar[14];
+ argv_[1] = new gchar[3];
+ argv_[2] = new gchar[outputFileName_.length() + 1];
+ argv_[3] = new gchar[3];
+ argv_[4] = new gchar[durationString_.length() + 1];
+
+ argv_[0] = const_cast<gchar*>(std::string("AudioManager").c_str());
+ argv_[1] = const_cast<gchar*>(oKey_.c_str());
+ argv_[2] = const_cast<gchar*>(outputFileName_.c_str());
+ argv_[3] = const_cast<gchar*>(tKey_.c_str());
+ argv_[4] = const_cast<gchar*>(durationString_.c_str());
+}
+
+void FromMicToFileRecorderThread::threadMain() {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ {
+ sync_primitives::AutoLock auto_lock(stopFlagLock_);
+ shouldBeStoped_ = false;
+ }
+
+ initArgs();
+
+ GstElement* pipeline;
+ GstElement* alsasrc, *wavenc, *filesink;
+ GstBus* bus;
+
+ const gchar* device = "hw:0,0";
+ gchar* outfile = NULL;
+ gint duration = -1;
+ GOptionContext* context = NULL;
+ GError* err = NULL;
+ GOptionEntry entries[] = { {
+ "device", 'd', 0, G_OPTION_ARG_FILENAME, &device,
+ "device file (Default: hw:0,0)", "SRC"
+ }, {
+ "output", 'o', 0, G_OPTION_ARG_FILENAME, &outfile,
+ "save output of the stream to DEST", "DEST"
+ }, {
+ "duration", 't', 0, G_OPTION_ARG_INT, &duration,
+ "length of time in seconds to capture", "int32_t"
+ }, {
+ NULL
+ }
+ };
+#ifndef GLIB_VERSION_2_32 // g_thread_init() does nothing since 2.32
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+ // Parse the arguments
+ context = g_option_context_new("-- M-AUDIO RAW");
+ g_option_context_add_main_entries(context, entries, NULL);
+ g_option_context_add_group(context, gst_init_get_option_group());
+ if (!g_option_context_parse(context, &argc_, &argv_, &err)) {
+ g_error("%s\n", err->message);
+ }
+
+ // Check for proper arguments
+ if (outfile == NULL) {
+ g_error("Must supply destination (-d FILE)\n");
+ }
+
+ LOG4CXX_TRACE(logger_, "Reading from device: " << device);
+ LOG4CXX_TRACE(logger_, "Saving pipeline output to: " << outfile);
+ LOG4CXX_TRACE(logger_, "Duration set to: " << duration);
+
+ // Initialize gstreamer and setup the main loop information
+ gst_init(&argc_, &argv_);
+
+ pipeline = gst_pipeline_new("vga2usb-h264");
+
+ // Set up error handling
+ bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
+ gst_bus_add_watch(bus,
+ reinterpret_cast<int32_t (*)(_GstBus*, _GstMessage*, void*)>
+ (recvmsg),
+ NULL);
+ gst_object_unref(bus);
+
+ // Create all of the elements to be added to the pipeline
+ alsasrc = gst_element_factory_make("alsasrc", "alsasrc0");
+ wavenc = gst_element_factory_make("wavenc", "wavenc0");
+ filesink = gst_element_factory_make("filesink", "filesink0");
+
+ // Assert that all the elements were created
+ if (!alsasrc || !wavenc || !filesink) {
+ g_error("Failed creating one or more of the pipeline elements.\n");
+ }
+
+ // Set input and output destinations
+ g_object_set(G_OBJECT(alsasrc), "device", device, NULL);
+ g_object_set(G_OBJECT(filesink), "location", outfile, NULL);
+
+ // Add the elements to the pipeline
+ gst_bin_add_many(GST_BIN(pipeline), alsasrc, wavenc, filesink, NULL);
+
+ // Link the elements
+ gst_element_link_many(alsasrc, wavenc, filesink, NULL);
+
+ gst_element_set_state(pipeline, GST_STATE_PLAYING);
+
+ LOG4CXX_TRACE(logger_, "Initializing pipeline ...");
+ while (GST_STATE(pipeline) != GST_STATE_PLAYING) {
+ LOG4CXX_TRACE(logger_, "GST_STATE(pipeline) != GST_STATE_PLAYING");
+
+ bool shouldBeStoped;
+ {
+ sync_primitives::AutoLock auto_lock(stopFlagLock_);
+ shouldBeStoped = shouldBeStoped_;
+ }
+
+ if (shouldBeStoped) {
+ return;
+ }
+ }
+
+ LOG4CXX_TRACE(logger_, "Pipeline started ...\n");
+
+ // Start up a timer for the pipeline
+ if (duration > 0) {
+ GstTimeout timeout;
+ timeout.pipeline = pipeline;
+ timeout.duration = duration;
+
+ sleepThread_ = new threads::Thread("SleepThread"
+ , new SleepThreadDelegate(timeout));
+
+ if (NULL != sleepThread_) {
+ sleepThread_->start();
+ }
+ }
+
+ loop = g_main_loop_new(NULL, FALSE);
+
+ g_main_loop_run(loop);
+
+ gst_element_set_state(pipeline, GST_STATE_NULL);
+
+ LOG4CXX_TRACE(logger_, "Deleting pipeline\n");
+ gst_object_unref(GST_OBJECT(pipeline));
+ g_main_loop_unref(loop);
+
+ loop = NULL;
+}
+
+FromMicToFileRecorderThread::SleepThreadDelegate::SleepThreadDelegate(GstTimeout
+ timeout)
+ : threads::ThreadDelegate(),
+ timeout_(timeout) {
+}
+
+void FromMicToFileRecorderThread::SleepThreadDelegate::threadMain() {
+ LOG4CXX_TRACE(logger_, "Sleep for " << timeout_.duration << " seconds");
+
+ sleep(timeout_.duration);
+
+ if (NULL != loop) {
+ if (g_main_loop_is_running(loop)) {
+ gst_element_send_event(timeout_.pipeline, gst_event_new_eos());
+ }
+ }
+}
+
+bool FromMicToFileRecorderThread::exitThreadMain() {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (NULL != loop) {
+ if (g_main_loop_is_running(loop)) {
+ LOG4CXX_TRACE(logger_, "Quit loop\n");
+ g_main_loop_quit(loop);
+ }
+ }
+
+ if (NULL != sleepThread_) {
+ LOG4CXX_TRACE(logger_, "Stop sleep thread\n");
+ sleepThread_->stop();
+ delete sleepThread_;
+ sleepThread_ = NULL;
+ }
+
+ LOG4CXX_TRACE(logger_, "Set should be stopped flag\n");
+ {
+ sync_primitives::AutoLock auto_lock(stopFlagLock_);
+ shouldBeStoped_ = true;
+ }
+
+ return true;
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc b/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc
new file mode 100644
index 0000000000..5faebf93d5
--- /dev/null
+++ b/src/components/media_manager/src/audio/pipe_audio_streamer_adapter.cc
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "media_manager/audio/pipe_audio_streamer_adapter.h"
+#include "config_profile/profile.h"
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "PipeAudioStreamerAdapter")
+
+PipeAudioStreamerAdapter::PipeAudioStreamerAdapter() {
+ LOG4CXX_INFO(logger, "PipeAudioStreamerAdapter::PipeAudioStreamerAdapter");
+ named_pipe_path_ = profile::Profile::instance()->named_audio_pipe_path();
+
+ Init();
+}
+
+PipeAudioStreamerAdapter::~PipeAudioStreamerAdapter() {
+ LOG4CXX_INFO(logger, "PipeAudioStreamerAdapter::~PipeAudioStreamerAdapter");
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc b/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
new file mode 100644
index 0000000000..eb93032e42
--- /dev/null
+++ b/src/components/media_manager/src/audio/socket_audio_streamer_adapter.cc
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config_profile/profile.h"
+#include "media_manager/audio/socket_audio_streamer_adapter.h"
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "SocketAudioStreamerAdapter")
+
+SocketAudioStreamerAdapter::SocketAudioStreamerAdapter() {
+ LOG4CXX_INFO(logger, "SocketAudioStreamerAdapter::SocketAudioStreamerAdapter");
+ port_ = profile::Profile::instance()->audio_streaming_port();
+ ip_ = profile::Profile::instance()->server_address();
+
+ Init();
+}
+
+SocketAudioStreamerAdapter::~SocketAudioStreamerAdapter() {
+}
+} // namespace media_manager
diff --git a/src/components/media_manager/src/media_adapter_impl.cc b/src/components/media_manager/src/media_adapter_impl.cc
new file mode 100644
index 0000000000..1a52b003ff
--- /dev/null
+++ b/src/components/media_manager/src/media_adapter_impl.cc
@@ -0,0 +1,58 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "media_manager/media_adapter_impl.h"
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "MediaAdapterImpl")
+
+MediaAdapterImpl::MediaAdapterImpl()
+ : current_application_(0) {
+}
+
+MediaAdapterImpl::~MediaAdapterImpl() {
+ media_listeners_.clear();
+}
+
+void MediaAdapterImpl::AddListener(const MediaListenerPtr& listener) {
+ LOG4CXX_INFO(logger_, "MediaAdapterImpl::AddListener");
+ media_listeners_.insert(listener);
+}
+
+void MediaAdapterImpl::RemoveListener(const MediaListenerPtr& listener) {
+ LOG4CXX_INFO(logger_, "MediaAdapterImpl::RemoveListener");
+ media_listeners_.erase(listener);
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
new file mode 100644
index 0000000000..72e0ba1779
--- /dev/null
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -0,0 +1,291 @@
+/**
+* Copyright (c) 2013, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "config_profile/profile.h"
+#include "media_manager/media_manager_impl.h"
+#include "media_manager/audio/from_mic_recorder_listener.h"
+#include "media_manager/streamer_listener.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/application.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_impl.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+#if defined(EXTENDED_MEDIA_MODE)
+#include "media_manager/audio/a2dp_source_player_adapter.h"
+#include "media_manager/audio/from_mic_recorder_adapter.h"
+#endif
+#include "media_manager/video/socket_video_streamer_adapter.h"
+#include "media_manager/audio/socket_audio_streamer_adapter.h"
+#include "media_manager/video/pipe_video_streamer_adapter.h"
+#include "media_manager/audio/pipe_audio_streamer_adapter.h"
+#include "media_manager/video/video_stream_to_file_adapter.h"
+
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManagerImpl")
+
+MediaManagerImpl::MediaManagerImpl()
+ : protocol_handler_(NULL)
+ , a2dp_player_(NULL)
+ , from_mic_recorder_(NULL)
+ , video_streamer_(NULL)
+ , audio_streamer_(NULL)
+ , video_stream_active_(false)
+ , audio_stream_active_(false) {
+ Init();
+}
+
+MediaManagerImpl::~MediaManagerImpl() {
+ if (a2dp_player_) {
+ delete a2dp_player_;
+ a2dp_player_ = NULL;
+ }
+
+ if (from_mic_recorder_) {
+ delete from_mic_recorder_;
+ from_mic_recorder_ = NULL;
+ }
+
+ if (video_streamer_) {
+ delete video_streamer_;
+ video_streamer_ = NULL;
+ }
+
+ if (audio_streamer_) {
+ delete audio_streamer_;
+ audio_streamer_ = NULL;
+ }
+}
+
+void MediaManagerImpl::SetProtocolHandler(
+ protocol_handler::ProtocolHandler* protocol_handler) {
+ protocol_handler_ = protocol_handler;
+}
+
+void MediaManagerImpl::Init() {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::Init()");
+
+#if defined(EXTENDED_MEDIA_MODE)
+ LOG4CXX_INFO(logger_, "Called Init with default configuration.");
+ a2dp_player_ = new A2DPSourcePlayerAdapter();
+ from_mic_recorder_ = new FromMicRecorderAdapter();
+#endif
+
+ if ("socket" == profile::Profile::instance()->video_server_type()) {
+ video_streamer_ = new SocketVideoStreamerAdapter();
+ } else if ("pipe" == profile::Profile::instance()->video_server_type()) {
+ video_streamer_ = new PipeVideoStreamerAdapter();
+ } else if ("file" == profile::Profile::instance()->video_server_type()) {
+ video_streamer_ = new VideoStreamToFileAdapter(
+ profile::Profile::instance()->video_stream_file());
+ }
+
+ if ("socket" == profile::Profile::instance()->audio_server_type()) {
+ audio_streamer_ = new SocketAudioStreamerAdapter();
+ } else if ("pipe" == profile::Profile::instance()->audio_server_type()) {
+ audio_streamer_ = new PipeAudioStreamerAdapter();
+ } else if ("file" == profile::Profile::instance()->audio_server_type()) {
+ audio_streamer_ = new VideoStreamToFileAdapter(
+ profile::Profile::instance()->audio_stream_file());
+ }
+
+ video_streamer_listener_ = new StreamerListener();
+ audio_streamer_listener_ = new StreamerListener();
+
+ if (NULL != video_streamer_) {
+ video_streamer_->AddListener(video_streamer_listener_);
+ }
+
+ if (NULL != audio_streamer_) {
+ audio_streamer_->AddListener(audio_streamer_listener_);
+ }
+}
+
+void MediaManagerImpl::PlayA2DPSource(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::PlayA2DPSource");
+ if (a2dp_player_) {
+ a2dp_player_->StartActivity(application_key);
+ }
+}
+
+void MediaManagerImpl::StopA2DPSource(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StopA2DPSource");
+ if (a2dp_player_) {
+ a2dp_player_->StopActivity(application_key);
+ }
+}
+
+void MediaManagerImpl::StartMicrophoneRecording(
+ int32_t application_key,
+ const std::string& output_file,
+ int32_t duration) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StartMicrophoneRecording to "
+ << output_file);
+ application_manager::ApplicationSharedPtr app =
+ application_manager::ApplicationManagerImpl::instance()->
+ application(application_key);
+ std::string file_path =
+ profile::Profile::instance()->app_storage_folder();
+ file_path += "/";
+ file_path += output_file;
+ from_mic_listener_ = new FromMicRecorderListener(file_path);
+#if defined(EXTENDED_MEDIA_MODE)
+ if (from_mic_recorder_) {
+ from_mic_recorder_->AddListener(from_mic_listener_);
+ (static_cast<FromMicRecorderAdapter*>(from_mic_recorder_))
+ ->set_output_file(file_path);
+ (static_cast<FromMicRecorderAdapter*>(from_mic_recorder_))
+ ->set_duration(duration);
+ from_mic_recorder_->StartActivity(application_key);
+ }
+#else
+ if (file_system::FileExists(file_path)) {
+ LOG4CXX_INFO(logger_, "File " << output_file << " exists, removing");
+ if (file_system::DeleteFile(file_path)) {
+ LOG4CXX_INFO(logger_, "File " << output_file << " removed");
+ }
+ else {
+ LOG4CXX_WARN(logger_, "Could not remove file " << output_file);
+ }
+ }
+ const std::string record_file_source =
+ profile::Profile::instance()->app_resourse_folder() + "/" +
+ profile::Profile::instance()->recording_file_source();
+ std::vector<uint8_t> buf;
+ if (file_system::ReadBinaryFile(record_file_source, buf)) {
+ if (file_system::Write(file_path, buf)) {
+ LOG4CXX_INFO(logger_,
+ "File " << record_file_source << " copied to " << output_file);
+ }
+ else {
+ LOG4CXX_WARN(logger_, "Could not write to file " << output_file);
+ }
+ }
+ else {
+ LOG4CXX_WARN(logger_, "Could not read file " << record_file_source);
+ }
+#endif
+ from_mic_listener_->OnActivityStarted(application_key);
+}
+
+void MediaManagerImpl::StopMicrophoneRecording(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StopMicrophoneRecording");
+#if defined(EXTENDED_MEDIA_MODE)
+ if (from_mic_recorder_) {
+ from_mic_recorder_->StopActivity(application_key);
+ }
+#endif
+ if (from_mic_listener_) {
+ from_mic_listener_->OnActivityEnded(application_key);
+ }
+}
+
+void MediaManagerImpl::StartVideoStreaming(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StartVideoStreaming");
+
+ if (video_streamer_) {
+ if (!video_stream_active_) {
+ video_stream_active_ = true;
+ video_streamer_->StartActivity(application_key);
+ application_manager::MessageHelper::SendNaviStartStream(application_key);
+ }
+ }
+}
+
+void MediaManagerImpl::StopVideoStreaming(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StopVideoStreaming");
+ if (video_streamer_) {
+ video_stream_active_ = false;
+ application_manager::MessageHelper::SendNaviStopStream(application_key);
+ video_streamer_->StopActivity(application_key);
+ }
+}
+
+void MediaManagerImpl::StartAudioStreaming(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StartAudioStreaming");
+
+ if (audio_streamer_) {
+ if (!audio_stream_active_) {
+ audio_stream_active_ = true;
+ audio_streamer_->StartActivity(application_key);
+ application_manager::MessageHelper::SendAudioStartStream(application_key);
+ }
+ }
+}
+
+void MediaManagerImpl::StopAudioStreaming(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "MediaManagerImpl::StopAudioStreaming");
+ if (audio_streamer_) {
+ audio_stream_active_ = false;
+ application_manager::MessageHelper::SendAudioStopStream(application_key);
+ audio_streamer_->StopActivity(application_key);
+ }
+}
+
+void MediaManagerImpl::OnMessageReceived(
+ const RawMessagePtr message) {
+ if (message->service_type()
+ == protocol_handler::kMobileNav) {
+ if (!(application_manager::ApplicationManagerImpl::instance()->
+ IsVideoStreamingAllowed(message->connection_key()))) {
+ return;
+ }
+ if (video_streamer_) {
+ video_streamer_->SendData(message->connection_key(), message);
+ }
+ } else if (message->service_type()
+ == protocol_handler::kAudio) {
+ if (!(application_manager::ApplicationManagerImpl::instance()->
+ IsAudioStreamingAllowed(message->connection_key()))) {
+ return;
+ }
+ if (audio_streamer_) {
+ audio_streamer_->SendData(message->connection_key(), message);
+ }
+ }
+}
+
+void MediaManagerImpl::OnMobileMessageSent(
+ const RawMessagePtr message) {
+}
+
+void MediaManagerImpl::FramesProcessed(int32_t application_key,
+ int32_t frame_number) {
+ if (protocol_handler_) {
+ protocol_handler_->SendFramesNumber(application_key,
+ frame_number);
+ }
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/pipe_streamer_adapter.cc b/src/components/media_manager/src/pipe_streamer_adapter.cc
new file mode 100644
index 0000000000..4f2985c43d
--- /dev/null
+++ b/src/components/media_manager/src/pipe_streamer_adapter.cc
@@ -0,0 +1,227 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "utils/logger.h"
+#include "utils/file_system.h"
+#include "config_profile/profile.h"
+#include "media_manager/pipe_streamer_adapter.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "PipeStreamerAdapter")
+
+PipeStreamerAdapter::PipeStreamerAdapter()
+ : is_ready_(false),
+ thread_(NULL),
+ messages_() {
+ LOG4CXX_INFO(logger, "PipeStreamerAdapter::PipeStreamerAdapter");
+}
+
+PipeStreamerAdapter::~PipeStreamerAdapter() {
+ LOG4CXX_INFO(logger, "PipeStreamerAdapter::~PipeStreamerAdapter");
+
+ if ((0 != current_application_ ) && (is_ready_)) {
+ StopActivity(current_application_);
+ }
+
+ thread_->stop();
+ delete thread_;
+}
+
+void PipeStreamerAdapter::SendData(
+ int32_t application_key,
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger, "PipeStreamerAdapter::SendData");
+
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger, "Wrong application " << application_key);
+ return;
+ }
+
+ if (is_ready_) {
+ messages_.push(message);
+ }
+}
+
+void PipeStreamerAdapter::StartActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger, "PipeStreamerAdapter::StartActivity");
+
+ if (application_key == current_application_) {
+ LOG4CXX_WARN(logger, "Already started activity for " << application_key);
+ return;
+ }
+
+ current_application_ = application_key;
+ is_ready_ = true;
+
+ for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
+ media_listeners_.end() != it;
+ ++it) {
+ (*it)->OnActivityStarted(application_key);
+ }
+
+ LOG4CXX_TRACE(logger, "Pipe was opened for writing " << named_pipe_path_);
+}
+
+void PipeStreamerAdapter::StopActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger, "PipeStreamerAdapter::StopActivity");
+
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger, "Not performing activity for " << application_key);
+ return;
+ }
+
+ is_ready_ = false;
+ current_application_ = 0;
+
+ for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
+ media_listeners_.end() != it;
+ ++it) {
+ (*it)->OnActivityEnded(application_key);
+ }
+}
+
+bool PipeStreamerAdapter::is_app_performing_activity(
+ int32_t application_key) {
+ return (application_key == current_application_);
+}
+
+void PipeStreamerAdapter::Init() {
+ if (!thread_) {
+ LOG4CXX_INFO(logger, "Create and start sending thread");
+ thread_ = new threads::Thread("PipeStreamer", new Streamer(this));
+ const size_t kStackSize = 16384;
+ thread_->startWithOptions(threads::ThreadOptions(kStackSize));
+ }
+}
+
+PipeStreamerAdapter::Streamer::Streamer(
+ PipeStreamerAdapter* server)
+ : server_(server),
+ pipe_fd_(0),
+ stop_flag_(false) {
+}
+
+PipeStreamerAdapter::Streamer::~Streamer() {
+ server_ = NULL;
+}
+
+void PipeStreamerAdapter::Streamer::threadMain() {
+ LOG4CXX_INFO(logger, "Streamer::threadMain");
+
+ open();
+
+ while (!stop_flag_) {
+ while (!server_->messages_.empty()) {
+ RawMessagePtr msg = server_->messages_.pop();
+ if (!msg) {
+ LOG4CXX_ERROR(logger, "Null pointer message");
+ continue;
+ }
+
+ ssize_t ret = write(pipe_fd_, msg.get()->data(),
+ msg.get()->data_size());
+
+ if (ret == -1) {
+ LOG4CXX_ERROR(logger, "Failed writing data to pipe "
+ << server_->named_pipe_path_);
+
+ std::set<MediaListenerPtr>::iterator it =
+ server_->media_listeners_.begin();
+ for (;server_->media_listeners_.end() != it; ++it) {
+ (*it)->OnErrorReceived(server_->current_application_, -1);
+ }
+ } else if (static_cast<uint32_t>(ret) != msg.get()->data_size()) {
+ LOG4CXX_WARN(logger, "Couldn't write all the data to pipe "
+ << server_->named_pipe_path_);
+ }
+
+ static int32_t messsages_for_session = 0;
+ ++messsages_for_session;
+
+ LOG4CXX_INFO(logger, "Handling map streaming message. This is "
+ << messsages_for_session << " the message for "
+ << server_->current_application_);
+ std::set<MediaListenerPtr>::iterator it =
+ server_->media_listeners_.begin();
+ for (; server_->media_listeners_.end() != it; ++it) {
+ (*it)->OnDataReceived(server_->current_application_,
+ messsages_for_session);
+ }
+ }
+ server_->messages_.wait();
+ }
+ close();
+}
+
+bool PipeStreamerAdapter::Streamer::exitThreadMain() {
+ LOG4CXX_INFO(logger, "Streamer::exitThreadMain");
+ stop_flag_ = true;
+ server_->messages_.Shutdown();
+ return false;
+}
+
+void PipeStreamerAdapter::Streamer::open() {
+
+ LOG4CXX_INFO(logger, "Streamer::open() " << server_->named_pipe_path_.c_str());
+
+ DCHECK(file_system::CreateDirectoryRecursively(
+ profile::Profile::instance()->app_storage_folder()));
+
+ if ((mkfifo(server_->named_pipe_path_.c_str(),
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0)
+ && (errno != EEXIST)) {
+ LOG4CXX_ERROR(logger, "Cannot create pipe " << server_->named_pipe_path_);
+ return;
+ }
+
+ pipe_fd_ = ::open(server_->named_pipe_path_.c_str(), O_RDWR, 0);
+ if (-1 == pipe_fd_) {
+ LOG4CXX_ERROR(logger, "Cannot open pipe for writing "
+ << server_->named_pipe_path_);
+ return;
+ }
+
+ LOG4CXX_TRACE(logger, "Pipe " << server_->named_pipe_path_
+ << " was successfully created");
+}
+
+void PipeStreamerAdapter::Streamer::close() {
+ ::close(pipe_fd_);
+ unlink(server_->named_pipe_path_.c_str());
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc
new file mode 100644
index 0000000000..708b37dbe7
--- /dev/null
+++ b/src/components/media_manager/src/socket_streamer_adapter.cc
@@ -0,0 +1,324 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include "config_profile/profile.h"
+#include "media_manager/video/socket_video_streamer_adapter.h"
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "SocketStreamerAdapter")
+
+SocketStreamerAdapter::SocketStreamerAdapter()
+ : socket_fd_(0),
+ is_ready_(false),
+ thread_(NULL),
+ streamer_(NULL),
+ messages_() {
+}
+
+SocketStreamerAdapter::~SocketStreamerAdapter() {
+ thread_->stop();
+ streamer_ = NULL;
+ delete thread_;
+}
+
+void SocketStreamerAdapter::StartActivity(int32_t application_key) {
+ LOG4CXX_TRACE(logger, "enter " << application_key);
+
+ if (application_key == current_application_) {
+ LOG4CXX_INFO(logger, "Already running for app " << application_key);
+ } else {
+ is_ready_ = true;
+ current_application_ = application_key;
+
+ messages_.Reset();
+
+ for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
+ media_listeners_.end() != it;
+ ++it) {
+ (*it)->OnActivityStarted(application_key);
+ }
+ }
+ LOG4CXX_TRACE(logger, "exit");
+}
+
+void SocketStreamerAdapter::StopActivity(int32_t application_key) {
+ LOG4CXX_TRACE(logger, "enter " << application_key);
+
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger, "Streaming is not active for " << application_key);
+ } else {
+ is_ready_ = false;
+ current_application_ = 0;
+
+ if (streamer_) {
+ streamer_->stop();
+ messages_.Shutdown();
+ }
+
+ for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
+ media_listeners_.end() != it;
+ ++it) {
+ (*it)->OnActivityEnded(application_key);
+ }
+ }
+ LOG4CXX_TRACE(logger, "exit");
+}
+
+bool SocketStreamerAdapter::is_app_performing_activity(
+ int32_t application_key) {
+ return (application_key == current_application_);
+}
+
+void SocketStreamerAdapter::Init() {
+ if (!thread_) {
+ LOG4CXX_INFO(logger, "Create and start sending thread");
+ streamer_ = new Streamer(this);
+ thread_ = new threads::Thread("SocketStreamer", streamer_);
+ const size_t kStackSize = 16384;
+ thread_->startWithOptions(threads::ThreadOptions(kStackSize));
+ } else {
+ LOG4CXX_WARN(logger, "thread is already exist");
+ }
+}
+
+void SocketStreamerAdapter::SendData(
+ int32_t application_key,
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger, "SendData(application_key = " << application_key << ")");
+
+
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger, "Currently working with other app "
+ << current_application_);
+ return;
+ }
+
+ if (is_ready_) {
+ messages_.push(message);
+ }
+}
+
+SocketStreamerAdapter::Streamer::Streamer(
+ SocketStreamerAdapter* const server)
+ : server_(server),
+ new_socket_fd_(0),
+ is_first_loop_(true),
+ is_client_connected_(false),
+ stop_flag_(false) {
+}
+
+SocketStreamerAdapter::Streamer::~Streamer() {
+ stop();
+}
+
+void SocketStreamerAdapter::Streamer::threadMain() {
+ LOG4CXX_TRACE(logger,"enter " << this);
+ sync_primitives::AutoLock auto_lock(thread_lock);
+ start();
+
+ while (!stop_flag_) {
+ new_socket_fd_ = accept(server_->socket_fd_, NULL, NULL);
+ LOG4CXX_INFO(logger, "Client connectd " << new_socket_fd_);
+ if (0 > new_socket_fd_) {
+ LOG4CXX_ERROR(logger, "Socket is closed " << strerror(errno));
+ sleep(1);
+ continue;
+ }
+
+ is_client_connected_ = true;
+ is_first_loop_ = true;
+ while (is_client_connected_) {
+ while (!server_->messages_.empty()) {
+ RawMessagePtr msg = server_->messages_.pop();
+ if (!msg) {
+ LOG4CXX_ERROR(logger, "Null pointer message");
+ continue;
+ }
+
+ is_client_connected_ = send(msg);
+ static int32_t messsages_for_session = 0;
+ ++messsages_for_session;
+
+ LOG4CXX_INFO(logger, "Handling map streaming message. This is "
+ << messsages_for_session << " the message for "
+ << server_->current_application_);
+ std::set<MediaListenerPtr>::iterator it = server_->media_listeners_
+ .begin();
+ for (; server_->media_listeners_.end() != it; ++it) {
+ (*it)->OnDataReceived(server_->current_application_,
+ messsages_for_session);
+ }
+ }
+
+ if (!is_ready()) {
+ LOG4CXX_INFO(logger, "Client disconnected.");
+ stop();
+ break;
+ }
+ server_->messages_.wait();
+ }
+ }
+ LOG4CXX_TRACE(logger,"exit " << this);
+}
+
+bool SocketStreamerAdapter::Streamer::exitThreadMain() {
+ LOG4CXX_TRACE(logger,"enter " << this);
+ stop_flag_ = true;
+ stop();
+ server_->messages_.Shutdown();
+ //exith threadMainshould whait while threadMain will be finished
+ if (server_->socket_fd_ != -1) {
+ shutdown(server_->socket_fd_, SHUT_RDWR);
+ close(server_->socket_fd_);
+ }
+ sync_primitives::AutoLock auto_lock(thread_lock);
+ LOG4CXX_TRACE(logger,"exit " << this);
+ return true;
+}
+
+void SocketStreamerAdapter::Streamer::start() {
+ server_->socket_fd_ = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (0 >= server_->socket_fd_) {
+ LOG4CXX_ERROR_EXT(logger, "Server open error");
+ return;
+ }
+
+ int32_t optval = 1;
+ if (-1 == setsockopt(server_->socket_fd_, SOL_SOCKET, SO_REUSEADDR,
+ &optval, sizeof optval)) {
+ LOG4CXX_ERROR_EXT(logger, "Unable to set sockopt");
+ return;
+ }
+
+ struct sockaddr_in serv_addr_;
+ memset(&serv_addr_, 0, sizeof(serv_addr_));
+ serv_addr_.sin_addr.s_addr = inet_addr(server_->ip_.c_str());
+ serv_addr_.sin_family = AF_INET;
+ serv_addr_.sin_port = htons(server_->port_);
+
+ if (-1 == bind(server_->socket_fd_,
+ reinterpret_cast<struct sockaddr*>(&serv_addr_),
+ sizeof(serv_addr_))) {
+ LOG4CXX_ERROR_EXT(logger, "Unable to bind");
+ return;
+ }
+
+ LOG4CXX_INFO(logger, "SocketStreamerAdapter::listen for connections");
+ if (-1 == listen(server_->socket_fd_, 5)) {
+ LOG4CXX_ERROR_EXT(logger, "Unable to listen");
+ return;
+ }
+}
+
+void SocketStreamerAdapter::Streamer::stop() {
+ LOG4CXX_TRACE(logger,"enter " << this);
+ if (0 == new_socket_fd_) {
+ LOG4CXX_ERROR(logger, "Client Socket does not exits: ");
+ } else if (-1 == shutdown(new_socket_fd_, SHUT_RDWR)) {
+ LOG4CXX_ERROR(logger, "Unable to shutdown socket " << strerror(errno));
+ } else if (-1 == ::close(new_socket_fd_)) {
+ LOG4CXX_ERROR(logger, "Unable to close socket " << strerror(errno));
+ }
+
+ new_socket_fd_ = 0;
+ is_client_connected_ = false;
+ LOG4CXX_TRACE(logger,"exit" << this);
+}
+
+bool SocketStreamerAdapter::Streamer::is_ready() const {
+ bool result = true;
+ fd_set fds;
+ FD_ZERO(&fds);
+ FD_SET(new_socket_fd_, &fds);
+ struct timeval tv;
+ tv.tv_sec = 5; // set a 5 second timeout
+ tv.tv_usec = 0;
+
+ int32_t retval = 0;
+ retval = select(new_socket_fd_ + 1, 0, &fds, 0, &tv);
+
+ if (-1 == retval) {
+ LOG4CXX_ERROR_EXT(logger, "An error occurred");
+ result = false;
+ } else if (0 == retval) {
+ LOG4CXX_ERROR_EXT(logger, "The timeout expired");
+ result = false;
+ }
+ return result;
+}
+
+bool SocketStreamerAdapter::Streamer::send(
+ const RawMessagePtr msg) {
+ if (!is_ready()) {
+ LOG4CXX_ERROR_EXT(logger, " Socket is not ready");
+ return false;
+ }
+
+ if (is_first_loop_) {
+ is_first_loop_ = false;
+ char hdr[] = {"HTTP/1.1 200 OK\r\n "
+ "Connection: Keep-Alive\r\n"
+ "Keep-Alive: timeout=15, max=300\r\n"
+ "Server: SDL\r\n"
+ "Content-Type: video/mp4\r\n\r\n"
+ };
+
+ if (-1 == ::send(new_socket_fd_, hdr, strlen(hdr), MSG_NOSIGNAL)) {
+ LOG4CXX_ERROR_EXT(logger, " Unable to send");
+ return false;
+ }
+ }
+
+ if (-1 == ::send(new_socket_fd_, (*msg).data(),
+ (*msg).data_size(), MSG_NOSIGNAL)) {
+ LOG4CXX_ERROR_EXT(logger, " Unable to send");
+ return false;
+ }
+
+ LOG4CXX_INFO(logger, "Streamer::sent " << (*msg).data_size());
+ return true;
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/streamer_listener.cc b/src/components/media_manager/src/streamer_listener.cc
new file mode 100644
index 0000000000..17306f486a
--- /dev/null
+++ b/src/components/media_manager/src/streamer_listener.cc
@@ -0,0 +1,80 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "media_manager/streamer_listener.h"
+#include "media_manager/media_manager_impl.h"
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "StreamerListener")
+
+StreamerListener::StreamerListener()
+ : current_application_(0) {
+}
+
+StreamerListener::~StreamerListener() {
+ OnActivityEnded(current_application_);
+}
+
+void StreamerListener::OnDataReceived(
+ int32_t application_key,
+ const DataForListener& data) {
+ MediaManagerImpl::instance()->FramesProcessed(application_key, data);
+}
+
+void StreamerListener::OnErrorReceived(
+ int32_t application_key,
+ const DataForListener& data) {
+ LOG4CXX_ERROR(logger_, "StreamerListener::OnErrorReceived");
+}
+
+void StreamerListener::OnActivityStarted(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "StreamerListener::OnActivityStarted");
+ if (current_application_ == application_key) {
+ LOG4CXX_WARN(logger_, "Already performing activity for "
+ << application_key);
+ return;
+ }
+ current_application_ = application_key;
+}
+
+void StreamerListener::OnActivityEnded(int32_t application_key) {
+ LOG4CXX_INFO(logger_, "StreamerListener::OnActivityEnded");
+ if (current_application_ != application_key) {
+ LOG4CXX_WARN(logger_, "Already not performing activity for "
+ << application_key);
+ return;
+ }
+ current_application_ = 0;
+}
+} // namespace media_manager
diff --git a/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc b/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc
new file mode 100644
index 0000000000..fc0668b8d3
--- /dev/null
+++ b/src/components/media_manager/src/video/pipe_video_streamer_adapter.cc
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "media_manager/video/pipe_video_streamer_adapter.h"
+#include "config_profile/profile.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "PipeVideoStreamerAdapter")
+
+PipeVideoStreamerAdapter::PipeVideoStreamerAdapter() {
+ LOG4CXX_INFO(logger, "PipeVideoStreamerAdapter::PipeVideoStreamerAdapter");
+ named_pipe_path_ = profile::Profile::instance()->named_video_pipe_path();
+
+ Init();
+}
+
+PipeVideoStreamerAdapter::~PipeVideoStreamerAdapter() {
+ LOG4CXX_INFO(logger, "PipeVideoStreamerAdapter::~PipeVideoStreamerAdapter");
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/video/socket_video_streamer_adapter.cc b/src/components/media_manager/src/video/socket_video_streamer_adapter.cc
new file mode 100644
index 0000000000..9fe16d6e93
--- /dev/null
+++ b/src/components/media_manager/src/video/socket_video_streamer_adapter.cc
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config_profile/profile.h"
+#include "media_manager/video/socket_video_streamer_adapter.h"
+#include "utils/logger.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "SocketVideoStreamerAdapter")
+
+SocketVideoStreamerAdapter::SocketVideoStreamerAdapter() {
+ LOG4CXX_INFO(logger, "SocketVideoStreamerAdapter::SocketVideoStreamerAdapter");
+ port_ = profile::Profile::instance()->video_streaming_port();
+ ip_ = profile::Profile::instance()->server_address();
+
+ Init();
+}
+
+SocketVideoStreamerAdapter::~SocketVideoStreamerAdapter() {
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/src/video/video_stream_to_file_adapter.cc b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
new file mode 100644
index 0000000000..cf32b79b97
--- /dev/null
+++ b/src/components/media_manager/src/video/video_stream_to_file_adapter.cc
@@ -0,0 +1,203 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/logger.h"
+#include "utils/file_system.h"
+#include "config_profile/profile.h"
+#include "media_manager/video/video_stream_to_file_adapter.h"
+
+namespace media_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "VideoStreamToFileAdapter")
+
+VideoStreamToFileAdapter::VideoStreamToFileAdapter(const std::string& file_name)
+ : file_name_(file_name),
+ is_ready_(false),
+ thread_(NULL) {
+ Init();
+}
+
+VideoStreamToFileAdapter::~VideoStreamToFileAdapter() {
+ if ((0 != current_application_ ) && (is_ready_)) {
+ StopActivity(current_application_);
+ }
+
+ thread_->stop();
+ delete thread_;
+}
+
+void VideoStreamToFileAdapter::Init() {
+ if (!thread_) {
+ LOG4CXX_INFO(logger, "Create and start sending thread");
+ thread_ = new threads::Thread("VideoStreamer",
+ new Streamer(this));
+ const size_t kStackSize = 16384;
+ thread_->startWithOptions(threads::ThreadOptions(kStackSize));
+ }
+}
+
+void VideoStreamToFileAdapter::SendData(
+ int32_t application_key,
+ const RawMessagePtr message) {
+ LOG4CXX_INFO(logger, "VideoStreamToFileAdapter::SendData "
+ << application_key);
+
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger, "Wrong application " << application_key);
+ return;
+ }
+
+ if (is_ready_) {
+ messages_.push(message);
+ }
+}
+
+void VideoStreamToFileAdapter::StartActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger, "VideoStreamToFileAdapter::StartActivity "
+ << application_key);
+ if (application_key == current_application_) {
+ LOG4CXX_WARN(logger, "Already running video stream to file for "
+ << application_key);
+ return;
+ }
+
+ current_application_ = application_key;
+ is_ready_ = true;
+
+ for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
+ media_listeners_.end() != it;
+ ++it) {
+ (*it)->OnActivityStarted(application_key);
+ }
+}
+
+void VideoStreamToFileAdapter::StopActivity(int32_t application_key) {
+ LOG4CXX_INFO(logger, "VideoStreamToFileAdapter::StopActivity "
+ << application_key);
+ if (application_key != current_application_) {
+ LOG4CXX_WARN(logger, "Performing activity for another key "
+ << current_application_);
+ return;
+ }
+
+ is_ready_ = false;
+ current_application_ = 0;
+
+ for (std::set<MediaListenerPtr>::iterator it = media_listeners_.begin();
+ media_listeners_.end() != it;
+ ++it) {
+ (*it)->OnActivityEnded(application_key);
+ }
+}
+
+bool VideoStreamToFileAdapter::is_app_performing_activity(int32_t
+ application_key) {
+ return (application_key == current_application_ && is_ready_);
+}
+
+VideoStreamToFileAdapter::Streamer::Streamer(
+ VideoStreamToFileAdapter* server)
+ : server_(server),
+ stop_flag_(false),
+ file_stream_(NULL) {
+}
+
+VideoStreamToFileAdapter::Streamer::~Streamer() {
+ server_ = NULL;
+ file_stream_ = NULL;
+}
+
+void VideoStreamToFileAdapter::Streamer::threadMain() {
+ LOG4CXX_INFO(logger, "Streamer::threadMain");
+
+ open();
+
+ while (!stop_flag_) {
+ while (!server_->messages_.empty()) {
+ RawMessagePtr msg = server_->messages_.pop();
+ if (!msg) {
+ LOG4CXX_ERROR(logger, "Null pointer message");
+ continue;
+ }
+
+ if (file_stream_) {
+ file_system::Write(file_stream_, msg->data(), msg->data_size());
+
+ static int32_t messsages_for_session = 0;
+ ++messsages_for_session;
+ std::set<MediaListenerPtr>::iterator it =
+ server_->media_listeners_.begin();
+ for (; server_->media_listeners_.end() != it; ++it) {
+ (*it)->OnDataReceived(server_->current_application_,
+ messsages_for_session);
+ }
+ } else {
+ LOG4CXX_WARN(logger, "Can't open File stream! " << server_->file_name_);
+ }
+ }
+ server_->messages_.wait();
+ }
+
+ close();
+}
+
+bool VideoStreamToFileAdapter::Streamer::exitThreadMain() {
+ LOG4CXX_INFO(logger, "Streamer::exitThreadMain");
+ stop_flag_ = true;
+ server_->messages_.Shutdown();
+ return false;
+}
+
+void VideoStreamToFileAdapter::Streamer::open() {
+ LOG4CXX_INFO(logger, "Streamer::open()" << server_->file_name_.c_str());
+
+ DCHECK(file_system::CreateDirectoryRecursively(
+ profile::Profile::instance()->app_storage_folder()));
+
+ file_stream_ = file_system::Open(server_->file_name_);
+ if (!file_stream_) {
+ LOG4CXX_WARN(logger, "Can't open file stream! " << server_->file_name_);
+ } else {
+ LOG4CXX_INFO(logger, "file_stream_ opened :" << file_stream_);
+ }
+}
+
+void VideoStreamToFileAdapter::Streamer::close() {
+ if (file_stream_) {
+ file_system::Close(file_stream_);
+ delete file_stream_;
+ file_stream_ = NULL;
+ }
+ file_system::DeleteFile(server_->file_name_);
+}
+
+} // namespace media_manager
diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt
new file mode 100644
index 0000000000..bb5e076ce0
--- /dev/null
+++ b/src/components/media_manager/test/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories (
+${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
+${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include)
+
+set(testSources
+ main.cc
+ media_adapter_impl_test.cc)
+
+set(testLibraries
+ gmock
+ gtest)
+
+add_executable(media_manager_test ${testSources})
+target_link_libraries(media_manager_test ${testLibraries})
diff --git a/src/components/media_manager/test/main.cc b/src/components/media_manager/test/main.cc
new file mode 100644
index 0000000000..d8242c89a0
--- /dev/null
+++ b/src/components/media_manager/test/main.cc
@@ -0,0 +1,7 @@
+#include "gmock/gmock.h"
+
+int main(int argc, char** argv) {
+ testing::InitGoogleMock(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+
diff --git a/src/components/media_manager/test/media_adapter_impl_test.cc b/src/components/media_manager/test/media_adapter_impl_test.cc
new file mode 100644
index 0000000000..f6a6ffa518
--- /dev/null
+++ b/src/components/media_manager/test/media_adapter_impl_test.cc
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "gmock/gmock.h"
+
+TEST(MediaAdapterImplTest, DummyTest) {
+ ASSERT_TRUE(true);
+}
diff --git a/src/components/policy b/src/components/policy
new file mode 160000
+Subproject cb6247b686e3686ca0496125cb1e62799e9d60d
diff --git a/src/components/protocol/CMakeLists.txt b/src/components/protocol/CMakeLists.txt
new file mode 100644
index 0000000000..2459bbc493
--- /dev/null
+++ b/src/components/protocol/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ./include
+ ${APR_INCLUDE_DIRECTORY}
+)
+
+set(SOURCES
+ ./src/raw_message.cc
+ ./src/service_type.cc
+ ./src/message_priority.cc
+ ./src/rpc_type.cc
+)
+
+add_library(ProtocolLibrary ${SOURCES})
+target_link_libraries(ProtocolLibrary Utils)
diff --git a/src/components/protocol/src/message_priority.cc b/src/components/protocol/src/message_priority.cc
new file mode 100644
index 0000000000..d76cde038c
--- /dev/null
+++ b/src/components/protocol/src/message_priority.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol/message_priority.h"
+
+#include "protocol/service_type.h"
+#include "utils/macro.h"
+
+namespace protocol_handler {
+
+// static
+const MessagePriority MessagePriority::kDefault = MessagePriority(0);
+
+// static
+MessagePriority MessagePriority::FromServiceType(ServiceType service_type) {
+ size_t message_priority_value = size_t(service_type);
+ DCHECK(message_priority_value <= 0xFF);
+ // According to Applink Protocol Specification v5 service with numerically
+ // lower service type identifiers have higher priority
+ return MessagePriority(0xFF - service_type);
+}
+
+MessagePriority::MessagePriority(const MessagePriority& that)
+ : value_(that.value_) {
+}
+
+size_t MessagePriority::OrderingValue() const {
+ return value_;
+}
+} // namespace protocol_handler
diff --git a/src/components/protocol/src/raw_message.cc b/src/components/protocol/src/raw_message.cc
new file mode 100644
index 0000000000..348eb16199
--- /dev/null
+++ b/src/components/protocol/src/raw_message.cc
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol/raw_message.h"
+
+#include <memory.h>
+
+namespace protocol_handler {
+
+RawMessage::RawMessage(uint32_t connection_key, uint32_t protocol_version,
+ const uint8_t *const data_param, uint32_t data_sz,
+ uint8_t type, uint32_t payload_size)
+ : connection_key_(connection_key),
+ data_(NULL),
+ data_size_(data_sz),
+ protocol_version_(protocol_version),
+ service_type_(ServiceTypeFromByte(type)),
+ payload_size_(payload_size),
+ waiting_(false) {
+ if (data_sz > 0) {
+ data_ = new uint8_t[data_sz];
+ memcpy(data_, data_param, sizeof(*data_) * data_sz);
+ }
+}
+
+RawMessage::~RawMessage() {
+ delete[] data_;
+}
+
+uint32_t RawMessage::connection_key() const {
+ return connection_key_;
+}
+
+void RawMessage::set_connection_key(uint32_t key) {
+ connection_key_ = key;
+}
+
+uint8_t *RawMessage::data() const {
+ return data_;
+}
+
+size_t RawMessage::payload_size() const {
+ return payload_size_;
+}
+
+size_t RawMessage::data_size() const {
+ return data_size_;
+}
+
+uint32_t RawMessage::protocol_version() const {
+ return protocol_version_;
+}
+
+bool RawMessage::IsWaiting() const {
+ return waiting_;
+}
+
+void RawMessage::set_waiting(bool v) {
+ waiting_ = v;
+}
+
+} // namespace protocol_handler
diff --git a/src/components/protocol/src/rpc_type.cc b/src/components/protocol/src/rpc_type.cc
new file mode 100644
index 0000000000..ce8ab898f5
--- /dev/null
+++ b/src/components/protocol/src/rpc_type.cc
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol/rpc_type.h"
+
+#include "utils/logger.h"
+#include "utils/macro.h"
+
+namespace protocol_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
+
+namespace {
+bool IsSupported(RpcType rpc_type) {
+ switch (rpc_type) {
+ case kRpcTypeRequest:
+ case kRpcTypeResponse:
+ case kRpcTypeNotification:
+ return true;
+ default:
+ return false;
+ }
+}
+} // namespace
+
+RpcType RpcTypeFromByte(uint8_t byte) {
+ RpcType type = RpcType(byte);
+ bool supported_type = IsSupported(type);
+ if (!supported_type) {
+ LOG4CXX_INFO(logger_, "Invalid service type: " << int32_t(byte));
+ }
+
+ return supported_type ? type : kRpcTypeReserved;
+}
+
+uint8_t RpcTypeToByte(RpcType type) {
+ DCHECK(IsSupported(type));
+ return uint8_t(type);
+}
+
+const char *RpcTypeToString(RpcType type) {
+ switch (type) {
+ case kRpcTypeRequest:
+ return "kRpcTypeRequest";
+ case kRpcTypeResponse:
+ return "kRpcTypeResponse";
+ case kRpcTypeNotification:
+ return "kRpcTypeNotification";
+ default:
+ return "kRpcTypeReserved";
+ }
+}
+
+std::ostream &operator<<(std::ostream &os, RpcType rpc_type) {
+ return os << RpcTypeToString(rpc_type);
+}
+} // namespace protocol_handler
diff --git a/src/components/protocol/src/service_type.cc b/src/components/protocol/src/service_type.cc
new file mode 100644
index 0000000000..09adae23be
--- /dev/null
+++ b/src/components/protocol/src/service_type.cc
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "protocol/service_type.h"
+
+#include "utils/logger.h"
+#include "utils/macro.h"
+
+namespace protocol_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ConnectionHandler")
+
+namespace {
+// Check if provided service value is one of the specified
+bool IsValid(ServiceType service_type) {
+ switch (service_type) {
+ case kControl:
+ case kRpc:
+ case kAudio:
+ case kMobileNav:
+ case kBulk:
+ return true;
+ default:
+ return false;
+ }
+}
+} // namespace
+
+ServiceType ServiceTypeFromByte(uint8_t byte) {
+ ServiceType type = ServiceType(byte);
+ const bool valid_type = IsValid(type);
+ if (!valid_type) {
+ LOG4CXX_INFO(logger_, "Invalid service type: "<< int32_t(byte));
+ }
+ return valid_type ? type : kInvalidServiceType;
+}
+
+uint8_t ServiceTypeToByte(ServiceType type) {
+ DCHECK(IsValid(type));
+ return uint8_t(type);
+}
+
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
new file mode 100644
index 0000000000..5ccfa3bb3d
--- /dev/null
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -0,0 +1,21 @@
+include_directories(
+ ./include
+ ../utils/include/
+ ../connection_handler/include/
+ ../config_profile/include/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set(SOURCES
+ ./src/protocol_handler_impl.cc
+ ./src/protocol_packet.cc
+ ./src/protocol_payload.cc
+)
+
+set(LIBRARIES
+ ProtocolLibrary
+ Utils
+)
+
+add_library(ProtocolHandler ${SOURCES})
+target_link_libraries(ProtocolHandler ${LIBRARIES})
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
new file mode 100644
index 0000000000..3732e23a4c
--- /dev/null
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
@@ -0,0 +1,524 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
+
+#include <map>
+#include <memory>
+#include <set>
+#include "utils/prioritized_queue.h"
+#include "utils/message_queue.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/shared_ptr.h"
+
+#include "protocol_handler/protocol_handler.h"
+#include "protocol_handler/protocol_packet.h"
+#include "protocol_handler/session_observer.h"
+#include "protocol_handler/protocol_observer.h"
+#include "transport_manager/common.h"
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_listener_empty.h"
+#ifdef TIME_TESTER
+#include "time_metric_observer.h"
+#endif // TIME_TESTER
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/security_manager.h"
+#endif // ENABLE_SECURITY
+
+/**
+ *\namespace protocol_handlerHandler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
+namespace protocol_handler {
+class ProtocolObserver;
+class SessionObserver;
+
+class MessagesFromMobileAppHandler;
+class MessagesToMobileAppHandler;
+
+using transport_manager::TransportManagerListenerEmpty;
+
+/**
+ * @brief Type definition for variable that hold shared pointer to raw message.
+ */
+typedef utils::SharedPtr<protocol_handler::ProtocolPacket> ProtocolFramePtr;
+
+typedef std::multimap<int32_t, RawMessagePtr> MessagesOverNaviMap;
+typedef std::set<ProtocolObserver*> ProtocolObservers;
+typedef transport_manager::ConnectionUID ConnectionID;
+
+namespace impl {
+/*
+ * These dummy classes are here to locally impose strong typing on different
+ * kinds of messages
+ * Currently there is no type difference between incoming and outgoing messages
+ * TODO(ik): replace these with globally defined message types
+ * when we have them.
+ */
+struct RawFordMessageFromMobile: public ProtocolFramePtr {
+ explicit RawFordMessageFromMobile(const ProtocolFramePtr message)
+ : ProtocolFramePtr(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return MessagePriority::FromServiceType(
+ ServiceTypeFromByte(get()->service_type())).OrderingValue(); }
+};
+
+struct RawFordMessageToMobile: public ProtocolFramePtr {
+ explicit RawFordMessageToMobile(const ProtocolFramePtr message,
+ bool final_message)
+ : ProtocolFramePtr(message), is_final(final_message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return MessagePriority::FromServiceType(
+ ServiceTypeFromByte(get()->service_type())).OrderingValue(); }
+ // Signals whether connection to mobile must be closed after processing this message
+ bool is_final;
+};
+
+// Short type names for prioritized message queues
+typedef threads::MessageLoopThread<
+ utils::PrioritizedQueue<RawFordMessageFromMobile> > FromMobileQueue;
+typedef threads::MessageLoopThread<
+ utils::PrioritizedQueue<RawFordMessageToMobile> > ToMobileQueue;
+} // namespace impl
+
+/**
+ * \class ProtocolHandlerImpl
+ * \brief Class for handling message exchange between Transport and higher
+ * layers. Receives message in form of array of bytes, parses its protocol,
+ * handles according to parsing results (version number, start/end session etc
+ * and if needed passes message to JSON Handler or notifies Connection Handler
+ * about activities around sessions.
+ */
+class ProtocolHandlerImpl
+ : public ProtocolHandler,
+ public TransportManagerListenerEmpty,
+ public impl::FromMobileQueue::Handler,
+ public impl::ToMobileQueue::Handler {
+ public:
+ /**
+ * \brief Constructor
+ * \param transportManager Pointer to Transport layer handler for
+ * message exchange.
+ */
+ explicit ProtocolHandlerImpl(
+ transport_manager::TransportManager *transport_manager_param);
+
+ /**
+ * \brief Destructor
+ */
+ ~ProtocolHandlerImpl();
+
+ /**
+ * \brief Adds pointer to higher layer handler for message exchange
+ * \param observer Pointer to object of the class implementing
+ * IProtocolObserver
+ */
+ void AddProtocolObserver(ProtocolObserver *observer);
+
+ /**
+ * \brief Removes pointer to higher layer handler for message exchange
+ * \param observer Pointer to object of the class implementing
+ * IProtocolObserver.
+ */
+ void RemoveProtocolObserver(ProtocolObserver *observer);
+
+ /**
+ * \brief Sets pointer for Connection Handler layer for managing sessions
+ * \param observer Pointer to object of the class implementing
+ * ISessionObserver
+ */
+ void set_session_observer(SessionObserver *observer);
+
+#ifdef ENABLE_SECURITY
+ /**
+ * \brief Sets pointer for SecurityManager layer for managing protection routine
+ * \param security_manager Pointer to SecurityManager object
+ */
+ void set_security_manager(security_manager::SecurityManager *security_manager);
+#endif // ENABLE_SECURITY
+
+ /**
+ * \brief Method for sending message to Mobile Application
+ * \param message Message with params to be sent to Mobile App
+ */
+ void SendMessageToMobileApp(const RawMessagePtr message,
+ bool final_message) OVERRIDE;
+
+ /**
+ * \brief Sends number of processed frames in case of binary nav streaming
+ * \param connection_key Id of connection over which message is to be sent
+ * \param number_of_frames Number of frames processed by
+ * streaming server and displayed to user.
+ */
+ void SendFramesNumber(uint32_t connection_key, int32_t number_of_frames);
+
+#ifdef TIME_TESTER
+ /**
+ * @brief Setup observer for time metric.
+ *
+ * @param observer - pointer to observer
+ */
+ void SetTimeMetricObserver(PHMetricObserver *observer);
+#endif // TIME_TESTER
+
+ /*
+ * Prepare and send heartbeat message to mobile
+ */
+ void SendHeartBeat(int32_t connection_id, uint8_t session_id);
+
+ /**
+ * \brief Sends ending session to mobile application
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session to be ended
+ */
+ void SendEndSession(int32_t connection_id, uint8_t session_id);
+
+ // TODO(Ezamakhov): move Ack/Nack as interface for StartSessionHandler
+ /**
+ * \brief Sends acknowledgement of starting session to mobile application
+ * with session number and hash code for second version of protocol
+ * was started
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param hash_code For second version of protocol: identifier of session
+ * to be sent to
+ * mobile app for using when ending session
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param protection Protection flag
+ */
+ void SendStartSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_code,
+ uint8_t service_type,
+ bool protection);
+
+ /**
+ * \brief Sends fail of starting session to mobile application
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ */
+ void SendStartSessionNAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type);
+
+ /**
+ * \brief Sends acknowledgement of end session/service to mobile application
+ * with session number for second version of protocol.
+ * \param connection_id Identifier of connection
+ * \param connection_handle Identifier of connection within which session
+ * was started
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * mobile app for using when ending session.
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ */
+ void SendEndSessionAck(ConnectionID connection_id ,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type);
+
+ /**
+ * \brief Sends fail of ending session to mobile application
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session ment to be ended
+ * \param protocol_version Version of protocol used for communication
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ */
+ void SendEndSessionNAck(ConnectionID connection_id ,
+ uint32_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type);
+
+ private:
+ /*
+ * Prepare and send heartbeat acknowledge message
+ */
+ RESULT_CODE SendHeartBeatAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint32_t message_id);
+
+ /**
+ * @brief Notifies about receiving message from TM.
+ *
+ * @param message Received message
+ **/
+ virtual void OnTMMessageReceived(
+ const RawMessagePtr message);
+
+ /**
+ * @brief Notifies about error on receiving message from TM.
+ *
+ * @param error Occurred error
+ **/
+ virtual void OnTMMessageReceiveFailed(
+ const transport_manager::DataReceiveError &error);
+
+ /**
+ * @brief Notifies about successfully sending message.
+ *
+ **/
+ virtual void OnTMMessageSend(const RawMessagePtr message);
+
+ /**
+ * @brief Notifies about error occurred during
+ * sending message.
+ *
+ * @param error Describes occurred error.
+ * @param message Message during sending which error occurred.
+ **/
+ virtual void OnTMMessageSendFailed(
+ const transport_manager::DataSendError &error,
+ const RawMessagePtr message);
+
+ virtual void OnConnectionEstablished(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id);
+
+ virtual void OnConnectionClosed(
+ const transport_manager::ConnectionUID &connection_id);
+
+ /**
+ * @brief Notifies subscribers about message
+ * received from mobile device.
+ * @param message Message with already parsed header.
+ */
+ void NotifySubscribers(const RawMessagePtr message);
+
+ /**
+ * \brief Sends message which size permits to send it in one frame.
+ * \param connection_handle Identifier of connection through which message
+ * is to be sent.
+ * \param session_id ID of session through which message is to be sent.
+ * \param protocol_version Version of Protocol used in message.
+ * \param service_type Type of session, RPC or BULK Data
+ * \param data_size Size of message excluding protocol header
+ * \param data Message string
+ * \param is_final_message if is_final_message = true - it is last message
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE SendSingleFrameMessage(ConnectionID connection_id,
+ const uint8_t session_id,
+ uint32_t protocol_version,
+ const uint8_t service_type,
+ size_t data_size,
+ const uint8_t *data,
+ const bool is_final_message);
+
+ /**
+ * \brief Sends message which size doesn't permit to send it in one frame.
+ * \param connection_handle Identifier of connection through which message
+ * is to be sent.
+ * \param session_id ID of session through which message is to be sent.
+ * \param protocol_version Version of Protocol used in message.
+ * \param service_type Type of session, RPC or BULK Data
+ * \param data_size Size of message excluding protocol header
+ * \param data Message string
+ * \param max_data_size Maximum allowed size of single frame.
+ * \param is_final_message if is_final_message = true - it is last message
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE SendMultiFrameMessage(ConnectionID connection_id,
+ const uint8_t session_id,
+ uint32_t protocol_version,
+ const uint8_t service_type,
+ const size_t data_size,
+ const uint8_t *data,
+ const size_t max_data_size,
+ const bool is_final_message);
+
+ /**
+ * \brief Sends message already containing protocol header.
+ * \param packet Message with protocol header
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE SendFrame(const ProtocolFramePtr packet);
+
+ /**
+ * \brief Handles received message.
+ * \param connection_handle Identifier of connection through which message
+ * is received.
+ * \param packet Received message with protocol header.
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE HandleMessage(
+ ConnectionID connection_id ,
+ const ProtocolFramePtr packet);
+
+ /**
+ * \brief Handles message received in single frame.
+ * \param connection_handle Identifier of connection through which message
+ * is received.
+ * \param packet Frame of message with protocol header.
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE HandleSingleFrameMessage(
+ ConnectionID connection_id ,
+ const ProtocolFramePtr packet);
+ /**
+ * \brief Handles message received in multiple frames. Collects all frames
+ * of message.
+ * \param connection_handle Identifier of connection through which message
+ * is received.
+ * \param packet Current frame of message with protocol header.
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE HandleMultiFrameMessage(
+ ConnectionID connection_id ,
+ const ProtocolFramePtr packet);
+
+ /**
+ * \brief Handles message received in single frame.
+ * \param connection_handle Identifier of connection through which message
+ * is received.
+ * \param packet Received message with protocol header.
+ * \return \saRESULT_CODE Status of operation
+ */
+ RESULT_CODE HandleControlMessage(
+ ConnectionID connection_id ,
+ const ProtocolFramePtr packet);
+
+ RESULT_CODE HandleControlMessageEndSession(
+ ConnectionID connection_id ,
+ const ProtocolPacket &packet);
+
+ RESULT_CODE HandleControlMessageStartSession(
+ ConnectionID connection_id ,
+ const ProtocolPacket &packet);
+
+ RESULT_CODE HandleControlMessageHeartBeat(
+ ConnectionID connection_id ,
+ const ProtocolPacket &packet);
+
+ /**
+ * \brief Sends Mobile Navi Ack message
+ */
+ RESULT_CODE SendMobileNaviAck(
+ ConnectionID connection_id ,
+ int32_t connection_key);
+
+ // threads::MessageLoopThread<*>::Handler implementations
+ // CALLED ON raw_ford_messages_from_mobile_ thread!
+ void Handle(const impl::RawFordMessageFromMobile message);
+ // CALLED ON raw_ford_messages_to_mobile_ thread!
+ void Handle(const impl::RawFordMessageToMobile message);
+
+#ifdef ENABLE_SECURITY
+ /**
+ * \brief Encryption/Decryption methodes for SecureSecvice check
+ * \param packet frame of message to encrypted/decrypted
+ */
+ RESULT_CODE EncryptFrame(ProtocolFramePtr packet);
+ RESULT_CODE DecryptFrame(ProtocolFramePtr packet);
+#endif // ENABLE_SECURITY
+ private:
+ /**
+ *\brief Pointer on instance of class implementing IProtocolObserver
+ *\brief (JSON Handler)
+ */
+ ProtocolObservers protocol_observers_;
+
+ /**
+ *\brief Pointer on instance of class implementing ISessionObserver
+ *\brief (Connection Handler)
+ */
+ SessionObserver *session_observer_;
+
+ /**
+ *\brief Pointer on instance of Transport layer handler for message exchange.
+ */
+ transport_manager::TransportManager *transport_manager_;
+
+ /**
+ *\brief Map of frames for messages received in multiple frames.
+ */
+ std::map<int32_t, ProtocolFramePtr> incomplete_multi_frame_messages_;
+
+ /**
+ * \brief Map of messages (frames) recieved over mobile nave session
+ * for map streaming.
+ */
+ MessagesOverNaviMap message_over_navi_session_;
+
+ /**
+ * \brief Untill specified otherwise, amount of message recievied
+ * over streaming session to send Ack
+ */
+ const uint32_t kPeriodForNaviAck;
+
+ /**
+ *\brief Counter of messages sent in each session.
+ */
+ std::map<uint8_t, uint32_t> message_counters_;
+
+ /**
+ *\brief map for session last message.
+ */
+ std::map<uint8_t, uint32_t> sessions_last_message_id_;
+
+ /**
+ *\brief Connections that must be closed after their last messages were sent
+ */
+ std::list<uint32_t> ready_to_close_connections_;
+
+
+ class IncomingDataHandler;
+ std::auto_ptr<IncomingDataHandler> incoming_data_handler_;
+
+#ifdef ENABLE_SECURITY
+ security_manager::SecurityManager *security_manager_;
+#endif // ENABLE_SECURITY
+
+ // Thread that pumps non-parsed messages coming from mobile side.
+ impl::FromMobileQueue raw_ford_messages_from_mobile_;
+ // Thread that pumps messages prepared to being sent to mobile side.
+ impl::ToMobileQueue raw_ford_messages_to_mobile_;
+
+ sync_primitives::Lock protocol_observers_lock_;
+
+#ifdef TIME_TESTER
+ PHMetricObserver *metric_observer_;
+#endif // TIME_TESTER
+};
+} // namespace protocol_handler
+
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_HANDLER_IMPL_H_
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
new file mode 100644
index 0000000000..2e3d39fd47
--- /dev/null
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_
+
+#include "utils/macro.h"
+#include "protocol/common.h"
+#include "protocol/common.h"
+
+/**
+ *\namespace protocol_handlerHandler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
+namespace protocol_handler {
+/**
+ * \class ProtocolPacket
+ * \brief Class for forming/parsing protocol headers of the message and
+ * handling multiple frames of the message.
+ */
+class ProtocolPacket {
+ private:
+ /**
+ * \struct ProtocolData
+ * \brief Used for storing message and its size.
+ */
+ struct ProtocolData {
+ ProtocolData()
+ : data(0), totalDataBytes(0x00) {
+ }
+ uint8_t *data;
+ uint32_t totalDataBytes;
+ };
+
+ /**
+ * \struct ProtocolHeader
+ * \brief Used for storing protocol header of a message.
+ */
+ struct ProtocolHeader {
+ /**
+ * \brief Constructor
+ */
+ ProtocolHeader()
+ : version(0x00),
+ protection_flag(PROTECTION_OFF),
+ frameType(0x00),
+ serviceType(0x00),
+ frameData(0x00),
+ sessionId(0x00),
+ dataSize(0x00),
+ messageId(0x00) {
+ }
+ /**
+ * \brief Constructor
+ */
+ ProtocolHeader(uint8_t version, bool protection,
+ uint8_t frameType,
+ uint8_t serviceType,
+ uint8_t frameData, uint8_t sessionID,
+ uint32_t dataSize, uint32_t messageID)
+ : version(version),
+ protection_flag(protection),
+ frameType(frameType),
+ serviceType(serviceType),
+ frameData(frameData),
+ sessionId(sessionID),
+ dataSize(dataSize),
+ messageId(messageID) {
+ }
+ uint8_t version;
+ bool protection_flag;
+ uint8_t frameType;
+ uint8_t serviceType;
+ uint8_t frameData;
+ uint8_t sessionId;
+ uint32_t dataSize;
+ uint32_t messageId;
+ };
+
+ public:
+ /**
+ * \brief Default constructor
+ */
+ ProtocolPacket();
+
+ /**
+ * \brief Constructor
+ *
+ * \param connectionKey Identifier of connection within wich message
+ * is transferred
+ * \param connection_id - Connection Identifier
+ * \param data Message string
+ * \param dataSize Message size
+ */
+ ProtocolPacket(uint8_t connection_id, uint8_t *data,
+ uint32_t dataSize);
+
+ /**
+ * \brief Constructor
+ * \param connection_id - Connection Identifier
+ * \param version Version of protocol
+ * \param protection Protection flag
+ * \param frameType Type of frame (Single/First/Consecutive)
+ * \param serviceType Type of session (RPC/Bulk data)
+ * \param frameData Information about frame: start/end session, number of
+ * frame, etc
+ * \param sessionID Number of frame within connection
+ * \param dataSize Size of message string
+ * \param messageID ID of message or hash code - only for second protocol
+ * \param data Message string if provided
+ * \param packet_id - ID for multiframe messages
+ */
+ ProtocolPacket(uint8_t connection_id,
+ uint8_t version, bool protection, uint8_t frameType,
+ uint8_t serviceType, uint8_t frameData,
+ uint8_t sessionId, uint32_t dataSize,
+ uint32_t messageID, const uint8_t *data = 0,
+ uint32_t packet_id = 0);
+ /**
+ * \brief Destructor
+ */
+ ~ProtocolPacket();
+
+ /*Serialization*/
+ /**
+ * \brief Serializes info about message into protocol header.
+ * \return RawMessagePtr with all data (header and message)
+ */
+ RawMessagePtr serializePacket() const;
+ /**
+ * \brief Appends message frame to existing message in
+ * recieving multiframe messages.
+ * \param chunkData Current frame's message string
+ * \param chunkDataSize Size of current message string
+ * \return \saRESULT_CODE Status of serialization
+ */
+ RESULT_CODE appendData(uint8_t *chunkData, uint32_t chunkDataSize);
+
+ /**
+ * \brief Getter of message size including protocol header
+ * \return uint32_t size of message string
+ */
+ size_t packet_size() const;
+
+ /**
+ * \brief Getter of message ID
+ * \return uint32_t message ID
+ */
+ uint32_t packet_id() const;
+
+ /*End of Serialization*/
+
+ /*Deserialization*/
+
+ /**
+ * \brief Parses protocol header
+ * \param message Incoming message string containing both header and
+ * message body
+ * \param messageSize Incoming message size
+ * \return \saRESULT_CODE Status of serialization
+ */
+ RESULT_CODE deserializePacket(const uint8_t *message,
+ uint32_t messageSize);
+
+ /**
+ * \brief Getter of protocol version.
+ */
+ uint8_t protocol_version() const;
+
+ /**
+ * \brief Getter of protection flag
+ */
+ bool protection_flag() const;
+
+ /**
+ * \brief Setter of protection flag
+ */
+ void set_protection_flag(const bool protection);
+
+ /**
+ * \brief Getter of frame type (single/first/etc)
+ */
+ uint8_t frame_type() const;
+
+ /**
+ *\brief Getter of service type (RPC/Bulk data)
+ */
+ uint8_t service_type() const;
+
+ /**
+ *\brief Getter of frame data (start/end session, number of frame etc)
+ */
+ uint8_t frame_data() const;
+
+ /**
+ *\brief Getter of session number
+ */
+ uint8_t session_id() const;
+
+ /**
+ *\brief Getter of size of message body
+ */
+ uint32_t data_size() const;
+
+ /**
+ *\brief Getter of message id for second version of protocol
+ */
+ uint32_t message_id() const;
+
+ /**
+ *\brief Getter of message string
+ */
+ uint8_t *data() const;
+
+ /**
+ *\brief Setter for size of multiframe message
+ */
+ void set_total_data_bytes(size_t dataBytes);
+
+ /**
+ *\brief Setter for new data
+ */
+ void set_data(const uint8_t *const new_data,
+ const size_t new_data_size);
+
+ /**
+ *\brief Getter for size of multiframe message
+ */
+ uint32_t total_data_bytes() const;
+ /*End of Deserialization*/
+
+ /**
+ * \brief Getter for Connection Identifier
+ */
+ uint8_t connection_id() const;
+
+ /**
+ * \brief Getter for data payload size
+ */
+ uint32_t payload_size() const;
+
+ private:
+ /**
+ *\brief Protocol header
+ */
+ ProtocolHeader packet_header_;
+
+ /**
+ *\brief Message body (without header)
+ */
+ ProtocolData packet_data_;
+
+ /**
+ *\brief Actual size of received data
+ */
+ uint32_t payload_size_;
+
+ /**
+ *\brief Offset for multiframe messages
+ */
+ uint32_t data_offset_;
+
+ /**
+ *\brief ID for multiframe messages
+ */
+ uint32_t packet_id_;
+
+ /**
+ * \brief Connection Identifier
+ * Obtained from connection_handler
+ */
+ uint8_t connection_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProtocolPacket);
+};
+} // namespace protocol_handler
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PACKET_H_
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_payload.h b/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
new file mode 100644
index 0000000000..6fda9bdd96
--- /dev/null
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
+
+#include <stdint.h>
+#include <ostream>
+#include <string>
+#include <vector>
+
+#include "protocol/rpc_type.h"
+
+namespace utils {
+class BitStream;
+}
+
+namespace protocol_handler {
+
+// Applink Protocolv5 4.1.2 Protocol Payload Binary header
+struct ProtocolPayloadHeaderV2 {
+ ProtocolPayloadHeaderV2()
+ : rpc_type(kRpcTypeReserved),
+ rpc_function_id(0), corellation_id(0), json_size(0) {}
+ RpcType rpc_type;
+ uint32_t rpc_function_id;
+ uint32_t corellation_id;
+ uint32_t json_size;
+};
+
+// Applink Protocolv5 4.1.1 Protocol Message Payload
+struct ProtocolPayloadV2 {
+ ProtocolPayloadHeaderV2 header;
+ std::string json;
+ std::vector<uint8_t> data;
+};
+
+// Procedures that extract and validate defined protocol structures from
+// a bit stream.
+// If error during parsing is detected, bit stream is marked as invalid
+void Extract(utils::BitStream *bs, ProtocolPayloadHeaderV2 *headerv2);
+void Extract(utils::BitStream *bs, ProtocolPayloadV2 *payload, size_t payload_size);
+
+std::ostream &operator<<(std::ostream &os, const ProtocolPayloadHeaderV2 &payload_header);
+std::ostream &operator<<(std::ostream &os, const ProtocolPayloadV2 &payload);
+
+//Add for tests
+size_t ProtocolPayloadV2SizeBits();
+} // namespace protocol_handler
+
+#endif /* SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_ */
diff --git a/src/components/protocol_handler/include/protocol_handler/time_metric_observer.h b/src/components/protocol_handler/include/protocol_handler/time_metric_observer.h
new file mode 100644
index 0000000000..1d3d83ea48
--- /dev/null
+++ b/src/components/protocol_handler/include/protocol_handler/time_metric_observer.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_TIME_METRIC_OBSERVER_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_TIME_METRIC_OBSERVER_H_
+#include "protocol/common.h"
+
+#include <stdint.h>
+#include "utils/date_time.h"
+
+namespace protocol_handler {
+
+class PHMetricObserver {
+ public:
+ struct MessageMetric {
+ RawMessagePtr raw_msg;
+ uint32_t message_id;
+ uint8_t connection_key;
+ TimevalStruct begin;
+ TimevalStruct end;
+ };
+ virtual void StartMessageProcess(uint32_t message_id, const TimevalStruct &start_time) = 0;
+ virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m) = 0;
+ virtual ~PHMetricObserver(){}
+};
+} // protocol_handler
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_TIME_METRIC_OBSERVER_H_
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
new file mode 100644
index 0000000000..acf968f3a0
--- /dev/null
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -0,0 +1,1339 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol_handler/protocol_handler_impl.h"
+#include <memory.h>
+#include <algorithm> // std::find
+
+#include "connection_handler/connection_handler_impl.h"
+#include "config_profile/profile.h"
+#include "utils/byte_order.h"
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/ssl_context.h"
+#include "security_manager/security_manager.h"
+#endif // ENABLE_SECURITY
+
+namespace protocol_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
+
+/**
+ * Function return packet data as std::string.
+ * If packet data is not printable return error message
+ */
+std::string ConvertPacketDataToString(const uint8_t *data,
+ const size_t data_size);
+
+const size_t kStackSize = 32768;
+
+class ProtocolHandlerImpl::IncomingDataHandler {
+ public:
+ IncomingDataHandler() : connections_data_() {}
+
+ bool ProcessData(const RawMessagePtr tm_message,
+ std::vector<ProtocolFramePtr> *out_frames) {
+ DCHECK(tm_message);
+ DCHECK(out_frames != NULL);
+ const ConnectionID connection_id = tm_message->connection_key();
+ const uint8_t *data = tm_message->data();
+ const size_t size = tm_message->data_size();
+ DCHECK(size > 0); DCHECK(data != NULL);
+ LOG4CXX_TRACE(logger_, "Start of processing incoming data of size "
+ << size << " for connection " << connection_id);
+ const uint32_t kBytesForSizeDetection = 8;
+ ConnectionsData::iterator it = connections_data_.find(connection_id);
+ if (connections_data_.end() == it) {
+ LOG4CXX_ERROR(logger_, "ProcessData requested for unknown connection");
+ return false;
+ }
+ std::vector<uint8_t> &connection_data = it->second;
+ connection_data.insert(connection_data.end(), data, data + size);
+
+ LOG4CXX_TRACE(logger_, "Total data size for connection "
+ << connection_id << " is "
+ << connection_data.size());
+ while (connection_data.size() >= kBytesForSizeDetection) {
+ const uint32_t packet_size = GetPacketSize(&connection_data[0]);
+ if (0 == packet_size) {
+ LOG4CXX_ERROR(logger_, "Failed to get packet size");
+ return false;
+ }
+ LOG4CXX_TRACE(logger_, "Packet size " << packet_size);
+ if (connection_data.size() >= packet_size) {
+ ProtocolFramePtr frame(new protocol_handler::ProtocolPacket(
+ connection_id, &connection_data[0], packet_size));
+ out_frames->push_back(frame);
+ connection_data.erase(connection_data.begin(),
+ connection_data.begin() + packet_size);
+ LOG4CXX_TRACE(logger_,
+ "Packet created and passed, new data size for connection "
+ << connection_id << " is " << connection_data.size());
+ } else {
+ LOG4CXX_TRACE(logger_, "Packet data is not available yet");
+ return true;
+ }
+ }
+ return true;
+ }
+
+ void AddConnection(ConnectionID connection_id) {
+ // Add empty list of session to new connection
+ connections_data_[connection_id] = std::vector<uint8_t>();
+ }
+
+ void RemoveConnection(ConnectionID connection_id) {
+ connections_data_.erase(connection_id);
+ }
+
+ private:
+ /**
+ * @brief Returns size of frame to be formed from raw bytes.
+ * expects first bytes of message which will be treated as frame header.
+ */
+ uint32_t GetPacketSize(unsigned char *received_bytes) {
+ DCHECK(received_bytes != NULL);
+ unsigned char offset = sizeof(uint32_t);
+ unsigned char version = received_bytes[0] >> 4u;
+ uint32_t frame_body_size = received_bytes[offset++] << 24u;
+ frame_body_size |= received_bytes[offset++] << 16u;
+ frame_body_size |= received_bytes[offset++] << 8u;
+ frame_body_size |= received_bytes[offset++];
+
+ uint32_t required_size = frame_body_size;
+ switch (version) {
+ case PROTOCOL_VERSION_1:
+ required_size += PROTOCOL_HEADER_V1_SIZE;
+ break;
+ case PROTOCOL_VERSION_3:
+ case PROTOCOL_VERSION_2:
+ required_size += PROTOCOL_HEADER_V2_SIZE;
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "Unknown protocol version.");
+ return 0;
+ }
+ return required_size;
+ }
+
+ typedef std::map<ConnectionID, std::vector<uint8_t> > ConnectionsData;
+ ConnectionsData connections_data_;
+};
+
+ProtocolHandlerImpl::ProtocolHandlerImpl(
+ transport_manager::TransportManager *transport_manager_param)
+ : protocol_observers_(),
+ session_observer_(0),
+ transport_manager_(transport_manager_param),
+ kPeriodForNaviAck(5),
+ incoming_data_handler_(new IncomingDataHandler),
+#ifdef ENABLE_SECURITY
+ security_manager_(NULL),
+#endif // ENABLE_SECURITY
+ raw_ford_messages_from_mobile_("PH FromMobile", this,
+ threads::ThreadOptions(kStackSize)),
+ raw_ford_messages_to_mobile_("PH ToMobile", this,
+ threads::ThreadOptions(kStackSize))
+#ifdef TIME_TESTER
+ , metric_observer_(NULL)
+#endif // TIME_TESTER
+
+{
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+ProtocolHandlerImpl::~ProtocolHandlerImpl() {
+ sync_primitives::AutoLock lock(protocol_observers_lock_);
+ if (!protocol_observers_.empty()) {
+ LOG4CXX_WARN(logger_, "Not all observers have unsubscribed"
+ " from ProtocolHandlerImpl");
+ }
+}
+
+void ProtocolHandlerImpl::AddProtocolObserver(ProtocolObserver *observer) {
+ if (!observer) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to IProtocolObserver.");
+ return;
+ }
+ sync_primitives::AutoLock lock(protocol_observers_lock_);
+ protocol_observers_.insert(observer);
+}
+
+void ProtocolHandlerImpl::RemoveProtocolObserver(ProtocolObserver* observer) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (!observer) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to IProtocolObserver.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return;
+ }
+ sync_primitives::AutoLock lock(protocol_observers_lock_);
+ protocol_observers_.erase(observer);
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::set_session_observer(SessionObserver *observer) {
+ if (!observer) {
+ LOG4CXX_WARN(logger_, "Invalid (NULL) pointer to ISessionObserver.");
+ // Do not return from here!
+ }
+ session_observer_ = observer;
+}
+
+void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) {
+ if (HASH_ID_NOT_SUPPORTED == hash_id ||
+ HASH_ID_WRONG == hash_id) {
+ return;
+ }
+ if (packet.protocol_version() < PROTOCOL_VERSION_2) {
+ LOG4CXX_DEBUG(logger_, "Packet needs no hash data (protocol version less 2)");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "Set hash_id 0x" << std::hex << hash_id <<
+ " to the packet 0x" << &packet);
+ // Hash id shall be 4 bytes according Ford Protocol v8
+ DCHECK(sizeof(hash_id) == 4);
+ const uint32_t hash_id_be = LE_TO_BE32(hash_id);
+ packet.set_data(reinterpret_cast<const uint8_t*>(&hash_id_be), sizeof(hash_id_be));
+}
+
+void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t ,
+ uint32_t hash_id,
+ uint8_t service_type,
+ bool protection) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ uint8_t protocolVersion;
+
+ if (0 == profile::Profile::instance()->heart_beat_timeout()) {
+ protocolVersion = PROTOCOL_VERSION_2;
+ LOG4CXX_INFO(logger_, "Heart beat timeout == 0 => SET PROTOCOL_VERSION_2");
+ } else {
+ protocolVersion = PROTOCOL_VERSION_3;
+ LOG4CXX_INFO(logger_, "Heart beat timeout != 0 => SET PROTOCOL_VERSION_3");
+ }
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ protocolVersion, protection, FRAME_TYPE_CONTROL,
+ service_type, FRAME_DATA_START_SERVICE_ACK, session_id,
+ 0u, message_counters_[session_id]++));
+
+ set_hash_id(hash_id, *ptr);
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_INFO(logger_,
+ "SendStartSessionAck() for connection " << connection_id
+ << " for service_type " << static_cast<int32_t>(service_type)
+ << " session_id " << static_cast<int32_t>(session_id)
+ << " protection " << (protection ? "ON" : "OFF"));
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ service_type, FRAME_DATA_START_SERVICE_NACK,
+ session_id, 0u, message_counters_[session_id]++));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_INFO(logger_,
+ "SendStartSessionNAck() for connection " << connection_id
+ << " for service_type " << static_cast<int32_t>(service_type)
+ << " session_id " << static_cast<int32_t>(session_id));
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
+ uint32_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ service_type, FRAME_DATA_END_SERVICE_NACK,
+ session_id, 0u, message_counters_[session_id]++));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_INFO(logger_, "SendEndSessionNAck() for connection " << connection_id
+ << " for service_type " << static_cast<int32_t>(service_type)
+ << " session_id " << static_cast<int32_t>(session_id));
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::SendEndSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ service_type, FRAME_DATA_END_SERVICE_ACK, session_id,
+ 0u, message_counters_[session_id]++));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_INFO(logger_,
+ "SendEndSessionAck() for connection " << connection_id
+ << " for service_type " << static_cast<int32_t>(service_type)
+ << " session_id " << static_cast<int32_t>(session_id));
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::SendEndSession(int32_t connection_id,
+ uint8_t session_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_RPC, FRAME_DATA_END_SERVICE, session_id, 0,
+ message_counters_[session_id]++));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_INFO(logger_, "SendEndSession() for connection " << connection_id
+ << " for service_type " << static_cast<int32_t>(SERVICE_TYPE_RPC)
+ << " session_id " << static_cast<int32_t>(session_id));
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendHeartBeatAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint32_t message_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL, FRAME_DATA_HEART_BEAT_ACK, session_id,
+ 0u, message_id));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+void ProtocolHandlerImpl::SendHeartBeat(int32_t connection_id,
+ uint8_t session_id) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_CONTROL, FRAME_DATA_HEART_BEAT, session_id,
+ 0u, message_counters_[session_id]++));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
+ bool final_message) {
+#ifdef TIME_TESTER
+ const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+#endif // TIME_TESTER
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (!message) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid message for sending to mobile app is received.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return;
+ }
+
+
+ if (!session_observer_) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Cannot handle message to mobile app:" <<
+ " ISessionObserver doesn't exist.");
+ return;
+ }
+ uint32_t connection_handle = 0;
+ uint8_t sessionID = 0;
+ session_observer_->PairFromKey(message->connection_key(), &connection_handle,
+ &sessionID);
+#ifdef TIME_TESTER
+ uint32_t message_id = message_counters_[sessionID];
+ if (metric_observer_) {
+ metric_observer_->StartMessageProcess(message_id, start_time);
+ }
+#endif // TIME_TESTER
+
+ const uint32_t header_size = (PROTOCOL_VERSION_1 == message->protocol_version())
+ ? PROTOCOL_HEADER_V1_SIZE : PROTOCOL_HEADER_V2_SIZE;
+ uint32_t maxDataSize = MAXIMUM_FRAME_DATA_SIZE - header_size;
+#ifdef ENABLE_SECURITY
+ const security_manager::SSLContext *ssl_context = session_observer_->
+ GetSSLContext(message->connection_key(), message->service_type());
+ if (ssl_context && ssl_context->IsInitCompleted()) {
+ maxDataSize = ssl_context->get_max_block_size(maxDataSize);
+ DCHECK(maxDataSize);
+ }
+ LOG4CXX_DEBUG(logger_, "Optimal packet size is " << maxDataSize);
+#endif // ENABLE_SECURITY
+ DCHECK(MAXIMUM_FRAME_DATA_SIZE > maxDataSize);
+
+
+
+ if (message->data_size() <= maxDataSize) {
+ RESULT_CODE result = SendSingleFrameMessage(connection_handle, sessionID,
+ message->protocol_version(),
+ message->service_type(),
+ message->data_size(),
+ message->data(),
+ final_message);
+ if (result != RESULT_OK) {
+ LOG4CXX_ERROR(logger_,
+ "ProtocolHandler failed to send single frame message.");
+ }
+ } else {
+ LOG4CXX_INFO_EXT(
+ logger_,
+ "Message will be sent in multiple frames; max size is " << maxDataSize);
+
+ RESULT_CODE result = SendMultiFrameMessage(connection_handle, sessionID,
+ message->protocol_version(),
+ message->service_type(),
+ message->data_size(),
+ message->data(),
+ maxDataSize, final_message);
+ if (result != RESULT_OK) {
+ LOG4CXX_ERROR(logger_,
+ "ProtocolHandler failed to send multiframe messages.");
+ }
+ }
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ PHMetricObserver::MessageMetric *metric
+ = new PHMetricObserver::MessageMetric();
+ metric->message_id = message_id;
+ metric->connection_key = message->connection_key();
+ metric->raw_msg = message;
+ metric_observer_->EndMessageProcess(metric);
+ }
+#endif
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::OnTMMessageReceived(const RawMessagePtr tm_message) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (tm_message) {
+ LOG4CXX_INFO(logger_,
+ "Received data from TM with connection id " << tm_message->connection_key() <<
+ " msg data_size " << tm_message->data_size());
+ } else {
+ LOG4CXX_ERROR(
+ logger_,
+ "Invalid incoming message received in"
+ << " ProtocolHandler from Transport Manager.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return;
+ }
+
+ std::vector<ProtocolFramePtr> protocol_frames;
+ const bool ok =
+ incoming_data_handler_->ProcessData(tm_message, &protocol_frames);
+ if (!ok) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming data processing failed. Terminating connection.");
+ transport_manager_->DisconnectForce(tm_message->connection_key());
+ }
+
+ for (std::vector<ProtocolFramePtr>::const_iterator it =
+ protocol_frames.begin(); it != protocol_frames.end(); ++it) {
+#ifdef TIME_TESTER
+ const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
+#endif // TIME_TESTER
+ ProtocolFramePtr frame = *it;
+#ifdef ENABLE_SECURITY
+ const RESULT_CODE result = DecryptFrame(frame);
+ if (result != RESULT_OK) {
+ LOG4CXX_WARN(logger_, "Error frame decryption. Frame skipped.");
+ continue;
+ }
+#endif // ENABLE_SECURITY
+ impl::RawFordMessageFromMobile msg(frame);
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ metric_observer_->StartMessageProcess(msg->message_id(), start_time);
+ }
+#endif // TIME_TESTER
+
+ raw_ford_messages_from_mobile_.PostMessage(msg);
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::OnTMMessageReceiveFailed(
+ const transport_manager::DataReceiveError &error) {
+ // TODO(PV): implement
+ LOG4CXX_ERROR(logger_, "Received error on attemping to recieve message.");
+}
+
+void ProtocolHandlerImpl::NotifySubscribers(const RawMessagePtr message) {
+ sync_primitives::AutoLock lock(protocol_observers_lock_);
+ for (ProtocolObservers::iterator it = protocol_observers_.begin();
+ protocol_observers_.end() != it; ++it) {
+ (*it)->OnMessageReceived(message);
+ }
+}
+
+void ProtocolHandlerImpl::OnTMMessageSend(const RawMessagePtr message) {
+ LOG4CXX_DEBUG(logger_, "Sending message finished successfully.");
+
+ uint32_t connection_handle = 0;
+ uint8_t sessionID = 0;
+ const ProtocolPacket sent_message(message->connection_key(),
+ message->data(),
+ message->data_size());
+
+ session_observer_->PairFromKey(message->connection_key(),
+ &connection_handle,
+ &sessionID);
+
+ std::list<uint32_t>::iterator connection_it =
+ std::find(ready_to_close_connections_.begin(),
+ ready_to_close_connections_.end(), connection_handle);
+
+ if (ready_to_close_connections_.end() != connection_it) {
+ ready_to_close_connections_.erase(connection_it);
+ transport_manager_->Disconnect(connection_handle);
+ return;
+ }
+
+ std::map<uint8_t, uint32_t>::iterator it =
+ sessions_last_message_id_.find(sent_message.session_id());
+
+ if (sessions_last_message_id_.end() != it) {
+ uint32_t last_message_id = it->second;
+ sessions_last_message_id_.erase(it);
+ if ((sent_message.message_id() == last_message_id) &&
+ ((FRAME_TYPE_SINGLE == sent_message.frame_type()) ||
+ ((FRAME_TYPE_CONSECUTIVE == sent_message.frame_type()) &&
+ (0 == sent_message.frame_data())))) {
+ ready_to_close_connections_.push_back(connection_handle);
+ SendEndSession(connection_handle, sent_message.session_id());
+ }
+ }
+ sync_primitives::AutoLock lock(protocol_observers_lock_);
+ for (ProtocolObservers::iterator it = protocol_observers_.begin();
+ protocol_observers_.end() != it; ++it) {
+ (*it)->OnMobileMessageSent(message);
+ }
+}
+
+void ProtocolHandlerImpl::OnTMMessageSendFailed(
+ const transport_manager::DataSendError &error,
+ const RawMessagePtr message) {
+ // TODO(PV): implement
+ LOG4CXX_ERROR(logger_, "Sending message " << message->data_size()
+ << " bytes failed: " << error.text());
+}
+
+void ProtocolHandlerImpl::OnConnectionEstablished(
+ const transport_manager::DeviceInfo &device_info,
+ const transport_manager::ConnectionUID &connection_id) {
+ incoming_data_handler_->AddConnection(connection_id);
+}
+
+void ProtocolHandlerImpl::OnConnectionClosed(
+ const transport_manager::ConnectionUID &connection_id) {
+ incoming_data_handler_->RemoveConnection(connection_id);
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (!packet) {
+ LOG4CXX_ERROR(logger_, "Failed to send empty packet.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+#ifdef ENABLE_SECURITY
+ // and return protect flag to Packet constructor for makeing design by Policy
+ const RESULT_CODE result = EncryptFrame(packet);
+ if (result != RESULT_OK) {
+ LOG4CXX_WARN(logger_, "Error frame encryption. Frame droped.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+#endif // ENABLE_SECURITY
+
+ LOG4CXX_INFO_EXT(logger_, "Packet to be sent: " <<
+ ConvertPacketDataToString(packet->data(), packet->data_size()) <<
+ " of size: " << packet->data_size());
+ const RawMessagePtr message_to_send = packet->serializePacket();
+ if (!message_to_send) {
+ LOG4CXX_ERROR(logger_, "Serialization error");
+ return RESULT_FAIL;
+ };
+ LOG4CXX_INFO(logger_,
+ "Message to send with connection id " <<
+ static_cast<int>(packet->connection_id()));
+
+ if (!transport_manager_) {
+ LOG4CXX_WARN(logger_, "No Transport Manager found.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+ if (transport_manager::E_SUCCESS !=
+ transport_manager_->SendMessageToDevice(message_to_send)) {
+ LOG4CXX_WARN(logger_, "Can't send message to device");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ };
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendSingleFrameMessage(
+ ConnectionID connection_id, const uint8_t session_id,
+ uint32_t protocol_version, const uint8_t service_type,
+ size_t data_size, const uint8_t *data,
+ const bool is_final_message) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version, PROTECTION_OFF, FRAME_TYPE_SINGLE, service_type, FRAME_DATA_SINGLE,
+ session_id, data_size, message_counters_[session_id]++, data));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, is_final_message));
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::SendMultiFrameMessage(
+ ConnectionID connection_id, const uint8_t session_id,
+ uint32_t protocol_version, const uint8_t service_type,
+ const size_t data_size, const uint8_t *data,
+ const size_t maxdata_size, const bool is_final_message) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ LOG4CXX_INFO_EXT(
+ logger_, " data size " << data_size << " maxdata_size " << maxdata_size);
+
+ // remainder of last frame
+ const size_t lastframe_remainder = data_size % maxdata_size;
+ // size of last frame (full fill or not)
+ const size_t lastframe_size =
+ lastframe_remainder > 0 ? lastframe_remainder : maxdata_size;
+
+ const size_t frames_count = data_size / maxdata_size +
+ // add last frame if not empty
+ (lastframe_remainder > 0 ? 1 : 0);
+
+ LOG4CXX_INFO_EXT(
+ logger_,
+ "Data " << data_size << " bytes in " << frames_count <<
+ " frames with last frame size " << lastframe_size);
+
+ DCHECK(maxdata_size >= FIRST_FRAME_DATA_SIZE);
+ DCHECK(FIRST_FRAME_DATA_SIZE >= 8);
+ uint8_t out_data[FIRST_FRAME_DATA_SIZE];
+ out_data[0] = data_size >> 24;
+ out_data[1] = data_size >> 16;
+ out_data[2] = data_size >> 8;
+ out_data[3] = data_size;
+
+ out_data[4] = frames_count >> 24;
+ out_data[5] = frames_count >> 16;
+ out_data[6] = frames_count >> 8;
+ out_data[7] = frames_count;
+
+ // TODO(EZamakhov): investigate message_id for CONSECUTIVE frames
+ const uint8_t message_id = message_counters_[session_id]++;
+ const ProtocolFramePtr firstPacket(
+ new protocol_handler::ProtocolPacket(
+ connection_id, protocol_version, PROTECTION_OFF, FRAME_TYPE_FIRST,
+ service_type, FRAME_DATA_FIRST, session_id, FIRST_FRAME_DATA_SIZE,
+ message_id, out_data));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(firstPacket, false));
+ LOG4CXX_INFO_EXT(logger_, "First frame is sent.");
+
+ for (uint32_t i = 0; i < frames_count; ++i) {
+ const bool is_last_frame = (i == (frames_count - 1));
+ const size_t frame_size = is_last_frame ? lastframe_size : maxdata_size;
+ const uint8_t data_type =
+ is_last_frame
+ ? FRAME_DATA_LAST_CONSECUTIVE
+ : (i % FRAME_DATA_MAX_CONSECUTIVE + 1);
+ const bool is_final_packet = is_last_frame ? is_final_message : false;
+
+ const ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ protocol_version, PROTECTION_OFF, FRAME_TYPE_CONSECUTIVE,
+ service_type, data_type, session_id, frame_size, message_id,
+ data + maxdata_size * i));
+
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, is_final_packet));
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::HandleMessage(ConnectionID connection_id,
+ const ProtocolFramePtr packet) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ switch (packet->frame_type()) {
+ case FRAME_TYPE_CONTROL:
+ LOG4CXX_TRACE(logger_, "handleMessage() - case FRAME_TYPE_CONTROL");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return HandleControlMessage(connection_id, packet);
+ case FRAME_TYPE_SINGLE:
+ LOG4CXX_TRACE_EXIT(logger_);
+ return HandleSingleFrameMessage(connection_id, packet);
+ case FRAME_TYPE_FIRST:
+ case FRAME_TYPE_CONSECUTIVE:
+ LOG4CXX_TRACE(logger_, "handleMessage() - case FRAME_TYPE_CONSECUTIVE");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return HandleMultiFrameMessage(connection_id, packet);
+ default: {
+ LOG4CXX_WARN(logger_, "handleMessage() - case unknown frame type"
+ << packet->frame_type());
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+ }
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage(
+ ConnectionID connection_id, const ProtocolFramePtr packet) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ LOG4CXX_INFO(logger_,
+ "FRAME_TYPE_SINGLE message of size " << packet->data_size() << "; message "
+ << ConvertPacketDataToString(packet->data(), packet->data_size()));
+
+ if (!session_observer_) {
+ LOG4CXX_ERROR(logger_,
+ "Cannot handle message from Transport"
+ << " Manager: ISessionObserver doesn't exist.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+
+ const uint32_t connection_key =
+ session_observer_->KeyFromPair(connection_id, packet->session_id());
+
+ const RawMessagePtr rawMessage(
+ new RawMessage(connection_key,
+ packet->protocol_version(),
+ packet->data(),
+ packet->total_data_bytes(),
+ packet->service_type(),
+ packet->payload_size()));
+ if (!rawMessage) {
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ PHMetricObserver::MessageMetric *metric
+ = new PHMetricObserver::MessageMetric();
+ metric->message_id = packet->message_id();
+ metric->connection_key = connection_key;
+ metric->raw_msg = rawMessage;
+ metric_observer_->EndMessageProcess(metric);
+ }
+#endif
+
+ // TODO(EZamakhov): check service in session
+ NotifySubscribers(rawMessage);
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::HandleMultiFrameMessage(
+ ConnectionID connection_id, const ProtocolFramePtr packet) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (!session_observer_) {
+ LOG4CXX_ERROR(logger_, "No ISessionObserver set.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+
+ const uint32_t key = session_observer_->KeyFromPair(connection_id,
+ packet->session_id());
+ LOG4CXX_INFO_EXT(
+ logger_,
+ "Packet " << packet << "; session id " << static_cast<int32_t>(key));
+
+ if (packet->frame_type() == FRAME_TYPE_FIRST) {
+ LOG4CXX_INFO(logger_, "handleMultiFrameMessage() - FRAME_TYPE_FIRST "
+ << packet->data_size());
+ incomplete_multi_frame_messages_[key] = packet;
+ } else {
+ LOG4CXX_INFO(logger_, "handleMultiFrameMessage() - Consecutive frame");
+
+ std::map<int32_t, ProtocolFramePtr>::iterator it =
+ incomplete_multi_frame_messages_.find(key);
+
+ if (it == incomplete_multi_frame_messages_.end()) {
+ LOG4CXX_ERROR(
+ logger_, "Frame of multiframe message for non-existing session id");
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+
+ if (it->second->appendData(packet->data(), packet->data_size())
+ != RESULT_OK) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to append frame for multiframe message.");
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+
+ if (packet->frame_data() == FRAME_DATA_LAST_CONSECUTIVE) {
+ LOG4CXX_INFO(
+ logger_,
+ "Last frame of multiframe message size " << packet->data_size()
+ << "; connection key " << key);
+ {
+ sync_primitives::AutoLock lock(protocol_observers_lock_);
+ if (protocol_observers_.empty()) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Cannot handle multiframe message: no IProtocolObserver is set.");
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+ }
+
+ ProtocolFramePtr completePacket = it->second;
+ const uint32_t connection_key =
+ session_observer_->KeyFromPair(connection_id,
+ completePacket->session_id());
+ const RawMessagePtr rawMessage(
+ new RawMessage(connection_key,
+ completePacket->protocol_version(),
+ completePacket->data(),
+ completePacket->total_data_bytes(),
+ completePacket->service_type(),
+ completePacket->payload_size()));
+
+ LOG4CXX_INFO(logger_,
+ "total_data_bytes " << completePacket->total_data_bytes() <<
+ " packet_size " << completePacket->packet_size() <<
+ " data size " << completePacket->data_size() <<
+ " payload_size " << completePacket->payload_size());
+
+ if (!rawMessage) {
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ PHMetricObserver::MessageMetric *metric =
+ new PHMetricObserver::MessageMetric();
+ metric->raw_msg = rawMessage;
+ metric_observer_->EndMessageProcess(metric);
+ }
+#endif // TIME_TESTER
+ // TODO(EZamakhov): check service in session
+ NotifySubscribers(rawMessage);
+
+ incomplete_multi_frame_messages_.erase(it);
+ }
+ }
+
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
+ ConnectionID connection_id, const ProtocolFramePtr packet) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (!session_observer_) {
+ LOG4CXX_ERROR(logger_, "ISessionObserver is not set.");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_FAIL;
+ }
+
+ switch (packet->frame_data()) {
+ case FRAME_DATA_START_SERVICE:
+ return HandleControlMessageStartSession(connection_id, *(packet.get()));
+ case FRAME_DATA_END_SERVICE:
+ return HandleControlMessageEndSession(connection_id, *(packet.get()));
+ case FRAME_DATA_HEART_BEAT: {
+ LOG4CXX_DEBUG(logger_,
+ "Received heart beat for connection " << connection_id);
+ LOG4CXX_TRACE_EXIT(logger_);
+ return HandleControlMessageHeartBeat(connection_id, *(packet.get()));
+ }
+ case FRAME_DATA_HEART_BEAT_ACK: {
+ LOG4CXX_DEBUG(logger_, "Received heart beat ack from mobile app"
+ " for connection " << connection_id);
+ return RESULT_OK;
+ }
+ default:
+ LOG4CXX_WARN(logger_,
+ "Control message of type " << static_cast<int>(packet->frame_data())
+ << " ignored");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return RESULT_OK;
+ }
+ return RESULT_OK;
+}
+
+uint32_t get_hash_id(const ProtocolPacket &packet) {
+ if (packet.protocol_version() < PROTOCOL_VERSION_2) {
+ LOG4CXX_DEBUG(logger_, "Packet without hash data (protocol version less 2)");
+ return HASH_ID_NOT_SUPPORTED;
+ }
+ if (packet.data_size() < 4) {
+ LOG4CXX_WARN(logger_, "Packet without hash data (data size less 4)");
+ return HASH_ID_WRONG;
+ }
+ const uint32_t hash_be = *(reinterpret_cast<uint32_t*>(packet.data()));
+ const uint32_t hash_le = BE_TO_LE32(hash_be);
+ // null hash is wrong hash value
+ return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le;
+}
+
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
+ ConnectionID connection_id, const ProtocolPacket &packet) {
+ LOG4CXX_INFO(logger_,
+ "ProtocolHandlerImpl::HandleControlMessageEndSession()");
+
+ const uint8_t current_session_id = packet.session_id();
+ const uint32_t hash_id = get_hash_id(packet);
+ const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
+
+ const uint32_t session_key = session_observer_->OnSessionEndedCallback(
+ connection_id, current_session_id, hash_id, service_type);
+
+ // TODO(EZamakhov): add clean up output queue (for removed service)
+ if (session_key != 0) {
+ SendEndSessionAck( connection_id, current_session_id,
+ packet.protocol_version(), service_type);
+ message_counters_.erase(current_session_id);
+ } else {
+ LOG4CXX_INFO_EXT(
+ logger_,
+ "Refused to end session " << static_cast<int>(service_type) << " type.");
+ SendEndSessionNAck(connection_id, current_session_id, packet.protocol_version(),
+ service_type);
+ }
+ return RESULT_OK;
+}
+#ifdef ENABLE_SECURITY
+namespace {
+/**
+ * \brief SecurityManagerListener for send Ack/NAck on success or fail
+ * SSL handshake
+ */
+class StartSessionHandler : public security_manager::SecurityManagerListener {
+ public:
+ StartSessionHandler(
+ uint32_t connection_key,
+ ProtocolHandlerImpl *protocol_handler,
+ SessionObserver *session_observer,
+ ConnectionID connection_id,
+ int32_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_id,
+ ServiceType service_type)
+ : connection_key_(connection_key),
+ protocol_handler_(protocol_handler),
+ session_observer_(session_observer),
+ connection_id_(connection_id),
+ session_id_(session_id),
+ protocol_version_(protocol_version),
+ hash_id_(hash_id),
+ service_type_(service_type) {
+ }
+ bool OnHandshakeDone(const uint32_t connection_key, const bool success) OVERRIDE {
+ if (connection_key != connection_key_) {
+ return false;
+ }
+ // check current service protection
+ const bool was_service_protection_enabled =
+ session_observer_->GetSSLContext(connection_key_, service_type_) != NULL;
+ if (was_service_protection_enabled) {
+ // On Success handshake
+ if (success) {
+// const std::string error_text("Connection is already protected");
+// LOG4CXX_WARN(logger_, error_text << ", key " << connection_key);
+// security_manager_->SendInternalError(
+// connection_key, security_manager::SecurityManager::ERROR_SERVICE_ALREADY_PROTECTED, error_text);
+ protocol_handler_->SendStartSessionNAck(connection_id_, session_id_,
+ protocol_version_, service_type_);
+ } else {
+ // Could not be success handshake and not already protected service
+ NOTREACHED();
+ }
+ } else {
+ if (success) {
+ session_observer_->SetProtectionFlag(connection_key_, service_type_);
+ }
+ protocol_handler_->SendStartSessionAck(connection_id_, session_id_,
+ protocol_version_, hash_id_, service_type_, success);
+ }
+ delete this;
+ return true;
+ }
+ private:
+ const uint32_t connection_key_;
+ ProtocolHandlerImpl *protocol_handler_;
+ SessionObserver *session_observer_;
+
+ const ConnectionID connection_id_;
+ const int32_t session_id_;
+ const uint8_t protocol_version_;
+ const uint32_t hash_id_;
+ const ServiceType service_type_;
+};
+} // namespace
+#endif // ENABLE_SECURITY
+
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
+ ConnectionID connection_id, const ProtocolPacket &packet) {
+ LOG4CXX_TRACE(logger_,
+ "Protocol version: " <<
+ static_cast<int>(packet.protocol_version()));
+ const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
+ const uint8_t protocol_version = packet.protocol_version();
+
+#ifdef ENABLE_SECURITY
+ const bool protection =
+ // Protocolo version 1 is not support protection
+ (protocol_version > PROTOCOL_VERSION_1) ? packet.protection_flag() : false;
+#else
+ const bool protection = false;
+#endif // ENABLE_SECURITY
+
+ DCHECK(session_observer_);
+ uint32_t hash_id;
+ const uint32_t session_id = session_observer_->OnSessionStartedCallback(
+ connection_id, packet.session_id(), service_type, protection, &hash_id);
+
+ if (0 == session_id) {
+ LOG4CXX_WARN_EXT(logger_, "Refused to create service " <<
+ static_cast<int32_t>(service_type) << " type.");
+ SendStartSessionNAck(connection_id, packet.session_id(),
+ protocol_version, packet.service_type());
+ return RESULT_OK;
+ }
+ const uint32_t connection_key =
+ session_observer_->KeyFromPair(connection_id, session_id);
+
+#ifdef ENABLE_SECURITY
+ // for packet is encrypted and security plugin is enable
+ if (protection && security_manager_) {
+ security_manager::SSLContext *ssl_context =
+ security_manager_->CreateSSLContext(connection_key);
+ if (!ssl_context) {
+ const std::string error("CreateSSLContext failed");
+ LOG4CXX_ERROR(logger_, error);
+ security_manager_->SendInternalError(
+ connection_key, security_manager::SecurityManager::ERROR_INTERNAL, error);
+ // Start service without protection
+ SendStartSessionAck(connection_id, session_id, packet.protocol_version(),
+ hash_id, packet.service_type(), PROTECTION_OFF);
+ return RESULT_OK;
+ }
+ if (ssl_context->IsInitCompleted()) {
+ // mark service as protected
+ session_observer_->SetProtectionFlag(connection_key, service_type);
+ // Start service as protected with current SSLContext
+ SendStartSessionAck(connection_id, session_id, packet.protocol_version(),
+ hash_id, packet.service_type(), PROTECTION_ON);
+ } else {
+ security_manager_->AddListener(
+ new StartSessionHandler(
+ connection_key, this, session_observer_,
+ connection_id, session_id, packet.protocol_version(),
+ hash_id, service_type));
+ if (!ssl_context->IsHandshakePending()) {
+ // Start handshake process
+ security_manager_->StartHandshake(connection_key);
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "Protection establishing for connection "
+ << connection_key << " is in progress");
+ return RESULT_OK;
+ }
+#endif // ENABLE_SECURITY
+ // Start service without protection
+ SendStartSessionAck(connection_id, session_id, packet.protocol_version(),
+ hash_id, packet.service_type(), PROTECTION_OFF);
+ return RESULT_OK;
+ }
+
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
+ ConnectionID connection_id, const ProtocolPacket &packet) {
+ LOG4CXX_INFO(
+ logger_,
+ "Sending heart beat acknowledgment for connection " << connection_id);
+ if (session_observer_->IsHeartBeatSupported(
+ connection_id, packet.session_id())) {
+ // TODO(EZamakhov): investigate message_id for HeartBeatAck
+ return SendHeartBeatAck(connection_id, packet.session_id(),
+ packet.message_id());
+ }
+ LOG4CXX_WARN(logger_, "HeartBeat is not supported");
+ return RESULT_HEARTBEAT_IS_NOT_SUPPORTED;
+}
+
+void ProtocolHandlerImpl::Handle(
+ const impl::RawFordMessageFromMobile message) {
+ LOG4CXX_TRACE_ENTER(logger_);
+
+ if (NULL == session_observer_) {
+ LOG4CXX_WARN(logger_, "Session Observer is NULL");
+ return;
+ }
+ connection_handler::ConnectionHandlerImpl *connection_handler =
+ connection_handler::ConnectionHandlerImpl::instance();
+ LOG4CXX_INFO(logger_, "Message : " << message.get());
+ LOG4CXX_INFO(logger_, "session_observer_: " <<session_observer_);
+ uint8_t c_id = message->connection_id();
+ uint32_t m_id = message->session_id();
+
+ if (session_observer_->IsHeartBeatSupported(c_id, m_id)) {
+ connection_handler->KeepConnectionAlive(message->connection_id(),
+ message->session_id());
+ }
+
+ if (((0 != message->data()) && (0 != message->data_size())) ||
+ FRAME_TYPE_CONTROL == message->frame_type() ||
+ FRAME_TYPE_FIRST == message->frame_type()) {
+ LOG4CXX_INFO_EXT(logger_, "Packet: dataSize " << message->data_size());
+ HandleMessage(message->connection_id(), message);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "handleMessagesFromMobileApp() - incorrect or NULL data");
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) {
+ LOG4CXX_INFO_EXT(
+ logger_,
+ "Message to mobile app: connection id " <<
+ static_cast<int>(message->connection_id()) << ";"
+ " dataSize: " << message->data_size() << " ;"
+ " protocolVersion " << static_cast<int>(message->protocol_version()));
+
+ if (message.is_final) {
+ sessions_last_message_id_.insert(
+ std::pair<uint8_t, uint32_t>(message->session_id(),
+ message->message_id()));
+ }
+
+ SendFrame(message);
+}
+
+#ifdef ENABLE_SECURITY
+void ProtocolHandlerImpl::set_security_manager(security_manager::SecurityManager* security_manager) {
+ if (!security_manager) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to SecurityManager.");
+ return;
+ }
+ security_manager_ = security_manager;
+}
+
+RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
+ DCHECK(packet);
+ // Control frames and data over control service shall be unprotected
+ if (packet->service_type() == kControl ||
+ packet->frame_type() == FRAME_TYPE_CONTROL) {
+ return RESULT_OK;
+ }
+ if (!session_observer_) {
+ LOG4CXX_WARN(logger_, "No session_observer_ set.");
+ return RESULT_FAIL;
+ }
+ if (!security_manager_) {
+ LOG4CXX_WARN(logger_, "No security_manager_ set.");
+ return RESULT_FAIL;
+ }
+ const uint32_t connection_key = session_observer_->KeyFromPair(
+ packet->connection_id(), packet->session_id());
+ security_manager::SSLContext *context = session_observer_->GetSSLContext(
+ connection_key, ServiceTypeFromByte(packet->service_type()));
+ if (!context || !context->IsInitCompleted()) {
+ return RESULT_OK;
+ }
+ const uint8_t *out_data;
+ size_t out_data_size;
+ if (!context->Encrypt(packet->data(), packet->data_size(),
+ &out_data, &out_data_size)) {
+ const std::string error_text(context->LastError());
+ LOG4CXX_ERROR(logger_, "Enryption failed: " << error_text);
+ security_manager_->SendInternalError(connection_key,
+ security_manager::SecurityManager::ERROR_ENCRYPTION_FAILED, error_text);
+ // Close session to prevent usage unprotected service/session
+ session_observer_->OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(),
+ packet->message_id(), kRpc);
+ return RESULT_OK;
+ };
+ LOG4CXX_DEBUG(logger_, "Encrypted " << packet->data_size() << " bytes to "
+ << out_data_size << " bytes");
+ DCHECK(out_data);
+ DCHECK(out_data_size);
+ DCHECK(out_data_size <= MAXIMUM_FRAME_DATA_SIZE);
+ packet->set_protection_flag(true);
+ packet->set_data(out_data, out_data_size);
+ return RESULT_OK;
+}
+
+RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
+ DCHECK(packet);
+ if (!packet->protection_flag() ||
+ // Control frames and data over control service shall be unprotected
+ packet->service_type() == kControl ||
+ packet->frame_type() == FRAME_TYPE_CONTROL) {
+ return RESULT_OK;
+ }
+ if (!session_observer_) {
+ LOG4CXX_WARN(logger_, "No session_observer_ set.");
+ return RESULT_FAIL;
+ }
+ if (!security_manager_) {
+ LOG4CXX_WARN(logger_, "No security_manager_ set.");
+ return RESULT_FAIL;
+ }
+ const uint32_t connection_key = session_observer_->KeyFromPair(
+ packet->connection_id(), packet->session_id());
+ security_manager::SSLContext *context = session_observer_->GetSSLContext(
+ connection_key, ServiceTypeFromByte(packet->service_type()));
+ if (!context || !context->IsInitCompleted()) {
+ const std::string error_text("Fail decryption for unprotected service ");
+ LOG4CXX_ERROR(logger_, error_text << static_cast<int>(packet->service_type()));
+ security_manager_->SendInternalError(connection_key,
+ security_manager::SecurityManager::ERROR_SERVICE_NOT_PROTECTED, error_text);
+ return RESULT_ENCRYPTION_FAILED;
+ }
+ const uint8_t *out_data;
+ size_t out_data_size;
+ if (!context->Decrypt(packet->data(), packet->data_size(),
+ &out_data, &out_data_size)) {
+ const std::string error_text(context->LastError());
+ LOG4CXX_ERROR(logger_, "Decryption failed: " << error_text);
+ security_manager_->SendInternalError(connection_key,
+ security_manager::SecurityManager::ERROR_DECRYPTION_FAILED, error_text);
+ // Close session to prevent usage unprotected service/session
+ session_observer_->OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(),
+ packet->message_id(), kRpc);
+ return RESULT_ENCRYPTION_FAILED;
+ };
+ LOG4CXX_DEBUG(logger_, "Decrypted " << packet->data_size() << " bytes to "
+ << out_data_size << " bytes");
+ DCHECK(out_data);
+ DCHECK(out_data_size);
+ packet->set_data(out_data, out_data_size);
+ return RESULT_OK;
+}
+#endif // ENABLE_SECURITY
+
+void ProtocolHandlerImpl::SendFramesNumber(uint32_t connection_key,
+ int32_t number_of_frames) {
+ LOG4CXX_INFO(logger_,
+ "SendFramesNumber MobileNaviAck for session " << connection_key);
+
+ // TODO(EZamakhov): add protocol version check - to avoid send for PROTOCOL_VERSION_1
+ transport_manager::ConnectionUID connection_id = 0;
+ uint8_t session_id = 0;
+ session_observer_->PairFromKey(connection_key, &connection_id, &session_id);
+ ProtocolFramePtr ptr(new protocol_handler::ProtocolPacket(connection_id,
+ PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL,
+ SERVICE_TYPE_NAVI, FRAME_DATA_SERVICE_DATA_ACK,
+ session_id, 0, message_counters_[session_id]++));
+
+ // Flow control data shall be 4 bytes according Ford Protocol
+ DCHECK(sizeof(number_of_frames) == 4);
+ number_of_frames = LE_TO_BE32(number_of_frames);
+ ptr->set_data(reinterpret_cast<const uint8_t*>(&number_of_frames),
+ sizeof(number_of_frames));
+ raw_ford_messages_to_mobile_.PostMessage(
+ impl::RawFordMessageToMobile(ptr, false));
+}
+
+#ifdef TIME_TESTER
+void ProtocolHandlerImpl::SetTimeMetricObserver(PHMetricObserver *observer) {
+ metric_observer_ = observer;
+}
+#endif // TIME_TESTER
+
+std::string ConvertPacketDataToString(const uint8_t *data,
+ const size_t data_size) {
+ if (0 == data_size)
+ return std::string();
+ bool is_printable_array = true;
+ std::locale loc;
+ const char *text = reinterpret_cast<const char*>(data);
+ // Check data for printability
+ for (size_t i = 0; i < data_size; ++i) {
+ if (!std::isprint(text[i], loc)) {
+ is_printable_array = false;
+ break;
+ }
+ }
+ return is_printable_array ? std::string(text) : std::string("is raw data");
+}
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
new file mode 100644
index 0000000000..19c73127cb
--- /dev/null
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <memory.h>
+#include <new>
+#include "protocol_handler/protocol_packet.h"
+#include "utils/macro.h"
+
+namespace protocol_handler {
+
+ProtocolPacket::ProtocolPacket()
+ : payload_size_(0),
+ packet_id_(0),
+ connection_id_(0) {
+}
+
+ProtocolPacket::ProtocolPacket(uint8_t connection_id,
+ uint8_t version, bool protection,
+ uint8_t frameType,
+ uint8_t serviceType,
+ uint8_t frameData, uint8_t sessionID,
+ uint32_t dataSize, uint32_t messageID,
+ const uint8_t *data,
+ uint32_t packet_id)
+ : packet_header_(version, protection, frameType, serviceType,
+ frameData, sessionID, dataSize, messageID),
+ payload_size_(0),
+ packet_id_(packet_id),
+ connection_id_(connection_id) {
+ set_data(data, dataSize);
+ DCHECK(MAXIMUM_FRAME_DATA_SIZE >= dataSize);
+}
+
+ProtocolPacket::ProtocolPacket(uint8_t connection_id, uint8_t *data_param,
+ uint32_t data_size)
+ : payload_size_(0),
+ packet_id_(0),
+ connection_id_(connection_id) {
+ RESULT_CODE result = deserializePacket(data_param, data_size);
+ if (result != RESULT_OK) {
+ //NOTREACHED();
+ }
+}
+
+ProtocolPacket::~ProtocolPacket() {
+ delete[] packet_data_.data;
+}
+
+// Serialization
+RawMessagePtr ProtocolPacket::serializePacket() const {
+ uint8_t *packet = new (std::nothrow) uint8_t[MAXIMUM_FRAME_DATA_SIZE];
+ if (!packet) {
+ return RawMessagePtr();
+ }
+ // version is low byte
+ const uint8_t version_byte = packet_header_.version << 4;
+ // protection is first bit of second byte
+ const uint8_t protection_byte = packet_header_.protection_flag ? (0x8) : 0x0;
+ // frame type is last 3 bits of second byte
+ const uint8_t frame_type_byte = packet_header_.frameType & 0x07;
+
+ uint8_t offset = 0;
+ packet[offset++] = version_byte | protection_byte | frame_type_byte;
+ packet[offset++] = packet_header_.serviceType;
+ packet[offset++] = packet_header_.frameData;
+ packet[offset++] = packet_header_.sessionId;
+
+ packet[offset++] = packet_header_.dataSize >> 24;
+ packet[offset++] = packet_header_.dataSize >> 16;
+ packet[offset++] = packet_header_.dataSize >> 8;
+ packet[offset++] = packet_header_.dataSize;
+
+ if (packet_header_.version != PROTOCOL_VERSION_1) {
+ packet[offset++] = packet_header_.messageId >> 24;
+ packet[offset++] = packet_header_.messageId >> 16;
+ packet[offset++] = packet_header_.messageId >> 8;
+ packet[offset++] = packet_header_.messageId;
+ }
+
+ DCHECK((offset + packet_data_.totalDataBytes) <= MAXIMUM_FRAME_DATA_SIZE);
+
+ size_t total_packet_size = offset;
+ if (packet_data_.data) {
+ memcpy(packet + offset, packet_data_.data, packet_data_.totalDataBytes);
+ total_packet_size += packet_data_.totalDataBytes;
+ }
+
+ const RawMessagePtr out_message(
+ new RawMessage(
+ connection_id(), packet_header_.version,
+ packet, total_packet_size, packet_header_.serviceType) );
+
+ delete[] packet;
+ return out_message;
+}
+
+uint32_t ProtocolPacket::packet_id() const {
+ return packet_id_;
+}
+
+RESULT_CODE ProtocolPacket::appendData(uint8_t *chunkData,
+ uint32_t chunkDataSize) {
+ if (payload_size_ + chunkDataSize <= packet_data_.totalDataBytes) {
+ if (chunkData) {
+ if (packet_data_.data) {
+ memcpy(packet_data_.data + payload_size_, chunkData, chunkDataSize);
+ payload_size_ += chunkDataSize;
+ return RESULT_OK;
+ }
+ }
+ }
+
+ return RESULT_FAIL;
+}
+
+size_t ProtocolPacket::packet_size() const {
+ return packet_header_.dataSize;
+}
+
+RESULT_CODE ProtocolPacket::deserializePacket(const uint8_t *message,
+ uint32_t messageSize) {
+ uint8_t offset = 0;
+ uint8_t firstByte = message[offset];
+ offset++;
+
+ packet_header_.version = firstByte >> 4u;
+
+ if (firstByte & 0x08u) {
+ packet_header_.protection_flag = true;
+ } else {
+ packet_header_.protection_flag = false;
+ }
+
+ packet_header_.frameType = firstByte & 0x07u;
+
+ packet_header_.serviceType = message[offset++];
+ packet_header_.frameData = message[offset++];
+ packet_header_.sessionId = message[offset++];
+
+ packet_header_.dataSize = message[offset++] << 24u;
+ packet_header_.dataSize |= message[offset++] << 16u;
+ packet_header_.dataSize |= message[offset++] << 8u;
+ packet_header_.dataSize |= message[offset++];
+
+ if (packet_header_.version != PROTOCOL_VERSION_1) {
+ packet_header_.messageId = message[offset++] << 24u;
+ packet_header_.messageId |= message[offset++] << 16u;
+ packet_header_.messageId |= message[offset++] << 8u;
+ packet_header_.messageId |= message[offset++];
+ } else {
+ packet_header_.messageId = 0u;
+ }
+
+ packet_data_.totalDataBytes = packet_header_.dataSize;
+
+ uint32_t dataPayloadSize = 0;
+ if ((offset < messageSize) &&
+ packet_header_.frameType != FRAME_TYPE_FIRST) {
+ dataPayloadSize = messageSize - offset;
+ }
+
+ uint8_t *data = 0;
+ if (dataPayloadSize) {
+ data = new (std::nothrow) uint8_t[dataPayloadSize];
+ if (data) {
+ memcpy(data, message + offset, dataPayloadSize);
+ payload_size_ = dataPayloadSize;
+ } else {
+ return RESULT_FAIL;
+ }
+ }
+
+ if (packet_header_.frameType == FRAME_TYPE_FIRST) {
+ payload_size_ = 0;
+ const uint8_t *data = message + offset;
+ uint32_t total_data_bytes = data[0] << 24;
+ total_data_bytes |= data[1] << 16;
+ total_data_bytes |= data[2] << 8;
+ total_data_bytes |= data[3];
+ set_total_data_bytes(total_data_bytes);
+ if (0 == packet_data_.data) {
+ return RESULT_FAIL;
+ }
+ } else {
+ if (packet_data_.data) {
+ delete[] packet_data_.data;
+ }
+ packet_data_.data = data;
+ }
+
+ return RESULT_OK;
+}
+
+uint8_t ProtocolPacket::protocol_version() const {
+ return packet_header_.version;
+}
+
+bool ProtocolPacket::protection_flag() const {
+ return packet_header_.protection_flag;
+}
+
+void ProtocolPacket::set_protection_flag(const bool protection) {
+ packet_header_.protection_flag = protection;
+}
+
+uint8_t ProtocolPacket::frame_type() const {
+ return packet_header_.frameType;
+}
+
+uint8_t ProtocolPacket::service_type() const {
+ return packet_header_.serviceType;
+}
+
+uint8_t ProtocolPacket::frame_data() const {
+ return packet_header_.frameData;
+}
+
+uint8_t ProtocolPacket::session_id() const {
+ return packet_header_.sessionId;
+}
+
+uint32_t ProtocolPacket::data_size() const {
+ return packet_header_.dataSize;
+}
+
+uint32_t ProtocolPacket::message_id() const {
+ return packet_header_.messageId;
+}
+
+uint8_t *ProtocolPacket::data() const {
+ return packet_data_.data;
+}
+
+void ProtocolPacket::set_total_data_bytes(size_t dataBytes) {
+ if (dataBytes) {
+ delete[] packet_data_.data;
+ packet_data_.data = new (std::nothrow) uint8_t[dataBytes];
+ packet_data_.totalDataBytes =
+ packet_data_.data ? dataBytes : 0;
+ }
+}
+
+void ProtocolPacket::set_data(
+ const uint8_t *const new_data, const size_t new_data_size) {
+ if (new_data_size && new_data) {
+ packet_header_.dataSize = packet_data_.totalDataBytes = new_data_size;
+ delete[] packet_data_.data;
+ packet_data_.data = new (std::nothrow) uint8_t[packet_data_.totalDataBytes];
+ if (packet_data_.data) {
+ memcpy(packet_data_.data, new_data, packet_data_.totalDataBytes);
+ } else {
+ // TODO(EZamakhov): add log info about memory problem
+ packet_header_.dataSize = packet_data_.totalDataBytes = 0;
+ }
+ }
+}
+
+uint32_t ProtocolPacket::total_data_bytes() const {
+ return packet_data_.totalDataBytes;
+}
+
+uint8_t ProtocolPacket::connection_id() const {
+ return connection_id_;
+}
+
+uint32_t ProtocolPacket::payload_size() const {
+ return payload_size_;
+}
+
+// End of Deserialization
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_payload.cc b/src/components/protocol_handler/src/protocol_payload.cc
new file mode 100644
index 0000000000..acc6825b36
--- /dev/null
+++ b/src/components/protocol_handler/src/protocol_payload.cc
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "protocol_handler/protocol_payload.h"
+
+#include <climits>
+
+#include "utils/bitstream.h"
+#include "utils/macro.h"
+
+namespace {
+// Protocol header field sizes
+static const size_t kRpcTypeBits = 4;
+static const size_t kRpcFunctionIdBits = 32 - kRpcTypeBits;
+static const size_t kCorellationIdBits = 32;
+static const size_t kJsonSizeBits = 32;
+static const size_t PayloadHeaderBits = kRpcTypeBits +
+ kRpcFunctionIdBits +
+ kCorellationIdBits +
+ kJsonSizeBits;
+}
+
+namespace protocol_handler {
+
+void Extract(utils::BitStream *bs, ProtocolPayloadHeaderV2 *headerv2) {
+ DCHECK(bs && headerv2);
+ if (*bs) {
+ uint8_t rpc_type;
+ utils::Extract(bs, &rpc_type, kRpcTypeBits);
+ headerv2->rpc_type = RpcTypeFromByte(rpc_type);
+ if (headerv2->rpc_type == kRpcTypeReserved) {
+ bs->MarkBad();
+ return;
+ }
+ utils::Extract(bs, &headerv2->rpc_function_id, kRpcFunctionIdBits);
+ utils::Extract(bs, &headerv2->corellation_id); // kCorellationIdBits
+ utils::Extract(bs, &headerv2->json_size); // kJsonSizeBits
+ }
+}
+
+void Extract(utils::BitStream *bs, ProtocolPayloadV2 *payload,
+ size_t payload_size) {
+ DCHECK(bs && payload);
+ if (*bs) {
+ Extract(bs, &payload->header);
+ utils::Extract(bs, &payload->json, payload->header.json_size);
+ size_t data_size = payload_size - payload->header.json_size -
+ PayloadHeaderBits / CHAR_BIT;
+ DCHECK(data_size < payload_size);
+ utils::Extract(bs, &payload->data, data_size);
+ }
+}
+
+std::ostream &operator<<(std::ostream &os,
+ const ProtocolPayloadHeaderV2 &payload_header) {
+ return os << "(ProtocolPayloadHeaderV2" << " rpc_type: "
+ << payload_header.rpc_type << ", rpc_function_id: "
+ << payload_header.rpc_function_id << ", corellation_id: "
+ << payload_header.corellation_id << ", json_size: "
+ << payload_header.json_size << ")";
+}
+
+std::ostream &operator<<(std::ostream &os, const ProtocolPayloadV2 &payload) {
+ return os << "(ProtocolPayloadV2" << " header: " << payload.header
+ << ", json (bytes): " << payload.json.size() << ", data (bytes): "
+ << payload.data.size() << ")";
+}
+
+size_t ProtocolPayloadV2SizeBits() {
+ return PayloadHeaderBits;
+}
+
+} // namespace protocol_handler
diff --git a/src/components/qt_hmi/CMakeLists.txt b/src/components/qt_hmi/CMakeLists.txt
new file mode 100644
index 0000000000..e77a1e23b8
--- /dev/null
+++ b/src/components/qt_hmi/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+
+add_subdirectory(./qml_plugins)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ add_subdirectory(./qml_model_qt4)
+else ()
+ add_subdirectory(./qml_model_qt5)
+endif ()
diff --git a/src/components/qt_hmi/Readme.txt b/src/components/qt_hmi/Readme.txt
new file mode 100644
index 0000000000..55e85db8ec
--- /dev/null
+++ b/src/components/qt_hmi/Readme.txt
@@ -0,0 +1,7 @@
+How to view QML HMI.
+
+1) Run setup_env.sh from root folder of SDL project (this will install right version of Qt and CMake)
+2) Run CMake with option HMI2=ON “cmake -DHMI2=ON <root_SDL_folder>” (this will build core+dbus adapter and QML HMI+ dbus adapter)
+3) Run “<QT510_INSTALL_PATH>/qmlscene <root_SDL_folder>/src/components/qt_hmi/qml_model_qt5/MainWindow.qml”
+4) Run SDL
+
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf
new file mode 100644
index 0000000000..4ae24370af
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf
new file mode 100644
index 0000000000..2186efad6c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf
new file mode 100644
index 0000000000..c0232d069d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf
new file mode 100644
index 0000000000..8b82f0ae0c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf
new file mode 100644
index 0000000000..3595f70135
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf
new file mode 100644
index 0000000000..7be067d905
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/ImageHardkey.qml b/src/components/qt_hmi/References/Look/ImageHardkey.qml
new file mode 100644
index 0000000000..e39bb41605
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/ImageHardkey.qml
@@ -0,0 +1,52 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FHardwareKey {
+ width: 50
+ height: 50
+
+ property alias image : theImage.source
+
+ Rectangle {
+ anchors.fill: parent
+ border.color: "black"
+ border.width: 1
+ radius: 10
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ id: s1
+ color: "#FF646464"
+ position: 0.0
+ }
+ GradientStop {
+ id: s2
+ color: "#FF484848"
+ position: 0.8
+ }
+ GradientStop {
+ id: s3
+ color: "#FF323232"
+ position: 1.0
+ }
+ }
+ }
+
+ FWdgtImage {
+ id: theImage
+ //anchors.fill: parent
+ anchors.centerIn: parent
+ //fillMode: Image.PreserveAspectFit
+ smooth: true
+ }
+
+
+ FViewUseCaseSimple {
+ condition: pressed === true
+ PropertyChanges { target: s1; position: 1.0 }
+ PropertyChanges { target: s2; position: 0.2}
+ PropertyChanges { target: s3; position: 0.0 }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml b/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml
new file mode 100644
index 0000000000..3ee2761be9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml
@@ -0,0 +1,378 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: alphaLayout
+ width: 800
+ height: 480
+
+
+ property alias a: aBtn.touchBtn
+ property alias b: bBtn.touchBtn
+ property alias c: cBtn.touchBtn
+ property alias d: dBtn.touchBtn
+ property alias e: eBtn.touchBtn
+ property alias f: fBtn.touchBtn
+ property alias g: gBtn.touchBtn
+ property alias h: hBtn.touchBtn
+ property alias i: iBtn.touchBtn
+ property alias j: jBtn.touchBtn
+ property alias k: kBtn.touchBtn
+ property alias l: lBtn.touchBtn
+ property alias m: mBtn.touchBtn
+ property alias n: nBtn.touchBtn
+ property alias o: oBtn.touchBtn
+ property alias p: pBtn.touchBtn
+ property alias q: qBtn.touchBtn
+ property alias r: rBtn.touchBtn
+ property alias s: sBtn.touchBtn
+ property alias t: tBtn.touchBtn
+ property alias u: uBtn.touchBtn
+ property alias v: vBtn.touchBtn
+ property alias w: wBtn.touchBtn
+ property alias xB: xBtn.touchBtn
+ property alias yB: yBtn.touchBtn
+ property alias zB: zBtn.touchBtn
+ property alias num: numBtn.touchBtn
+ property alias close: closeTouch
+
+ property string phonEntry: ""
+
+// BaseText{
+// id: phoneEntry
+// x:25
+// y:115
+// text: phonEntry
+// theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+// pxSize: 45
+// horAlignment: Text.AlignLeft
+// vertAlignment: Text.AlignTop
+// }
+
+ TouchButtonClimatePCA{
+ id: aBtn
+ x:48
+ y:131
+ text: "A"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: jBtn
+ x:48
+ y:212
+ text: "J"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: sBtn
+ x:48
+ y:293
+ text: "S"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: bBtn
+ x:129
+ y:131
+ text: "B"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: kBtn
+ x:129
+ y:212
+ text: "K"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: tBtn
+ x:129
+ y:293
+ text: "T"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: cBtn
+ x:210
+ y:131
+ text: "C"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: lBtn
+ x:210
+ y:212
+ text: "L"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: uBtn
+ x:210
+ y:293
+ text: "U"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: dBtn
+ x:291
+ y:131
+ text: "D"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: mBtn
+ x:291
+ y:212
+ text: "M"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: vBtn
+ x:291
+ y:293
+ text: "V"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: eBtn
+ x:372
+ y:131
+ text: "E"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: nBtn
+ x:372
+ y:212
+ text: "N"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: wBtn
+ x:372
+ y:293
+ text: "W"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: fBtn
+ x:453
+ y:131
+ text: "F"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: oBtn
+ x:453
+ y:212
+ text: "O"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: xBtn
+ x:453
+ y:293
+ text: "X"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: gBtn
+ x:534
+ y:131
+ text: "G"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: pBtn
+ x:534
+ y:212
+ text: "P"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: yBtn
+ x:534
+ y:293
+ text: "Y"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: hBtn
+ x:615
+ y:131
+ text: "H"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: qBtn
+ x:615
+ y:212
+ text: "Q"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: zBtn
+ x:615
+ y:293
+ text: "Z"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: iBtn
+ x:696
+ y:131
+ text: "I"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: rBtn
+ x:696
+ y:212
+ text: "R"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: numBtn
+ x:696
+ y:293
+ text: "123"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ BaseText{
+ id: closeTxt
+ anchors.horizontalCenter: alphaLayout.horizontalCenter
+ y:430
+ horAlignment: Text.AlignHCenter
+ vertAlignment: Text.AlignTop
+ text: "CLOSE"
+ color: "#1d81d5"
+ pxSize: 22
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+
+ }
+
+ FWdgtTouchArea{
+ id: closeTouch
+ height: 75
+ width: 750
+ y:430
+ anchors.horizontalCenter: alphaLayout.horizontalCenter
+ }
+
+ FViewUseCase{condition: closeTouch.pressed === true
+ //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
+ PropertyChanges {
+ target: closeTxt; color: "white"
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml b/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml
new file mode 100644
index 0000000000..2a1b2aa5f1
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FLayout {
+ width: 800
+ height: 480
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml
new file mode 100644
index 0000000000..14daa544b7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml
@@ -0,0 +1,69 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: chromelayout
+ width: 800
+ height: 480
+
+ property alias button1: button1
+ property alias button2: button2
+ property alias button3: button3
+
+
+
+ FWdgtTouchArea {
+ id: blockClockTouch
+ anchors.top: chromelayout.top
+ anchors.horizontalCenter: chromelayout.horizontalCenter
+ height: 60
+ width: 160
+ }
+
+ Rectangle{
+ id: clockBackground
+ anchors.fill: blockClockTouch
+ color: "red"
+ }
+
+ BaseText{
+ id: clock
+ anchors.centerIn: blockClockTouch
+ text: "clock"
+ horAlignment: Text.AlignHCenter
+ }
+
+ TouchButton{
+ id: button1
+ anchors.top: blockClockTouch.top
+ anchors.right: blockClockTouch.left
+ anchors.rightMargin: -5
+ height: blockClockTouch.height
+ width: 75
+ text: "Button 1"
+ unpressedColor: "darkRed"
+ }
+
+ TouchButton{
+ id: button2
+ anchors.top: blockClockTouch.top
+ anchors.left: blockClockTouch.right
+ anchors.leftMargin: -5
+ height:blockClockTouch.height
+ width: 75
+ text: "Button 2"
+ unpressedColor:"darkRed"
+ }
+
+ TouchButton{
+ id: button3
+ anchors.bottom: chromelayout.bottom
+ anchors.horizontalCenter: chromelayout.horizontalCenter
+ height:blockClockTouch.height
+ width: 225
+ text: "Button 3"
+ unpressedColor: "red"
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml b/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml
new file mode 100644
index 0000000000..6b6a2761c5
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml
@@ -0,0 +1,111 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: climateLayout
+ width: 800
+ height: 480
+
+ property alias dualBtn: dualBtn.touchBtn
+ property alias drvHeatSeat: drvHeatSeat.touchBtn
+ property alias drvCoolSeat: drvCoolSeat.touchBtn
+ property alias passCoolSeat: passCoolSeat.touchBtn
+ property alias passHeatSeat: passHeatSeat.touchBtn
+ property alias heatWheel: heatWheel.touchBtn
+ property alias heatWinSheild: heatWinSheild.touchBtn
+ property alias defrost: defrost.touchBtn
+ property alias pannel: pannel.touchBtn
+ property alias floor: floor.touchBtn
+
+ property alias dualBtnSt: dualBtn.selected
+ property alias drvHeatSeatSt: drvHeatSeat.selected
+ property alias drvCoolSeatSt: drvCoolSeat.selected
+ property alias passCoolSeatSt: passCoolSeat.selected
+ property alias passHeatSeatSt: passHeatSeat.selected
+ property alias heatWheelSt: heatWheel.selected
+ property alias heatWinSheildSt: heatWinSheild.selected
+ property alias defrostSt: defrost.selected
+ property alias pannelSt: pannel.selected
+ property alias floorSt: floor.selected
+
+
+
+ TouchButtonClimatePCA{
+ id: drvHeatSeat
+ x:105
+ y:178
+ bitmap: "climate/heated seat icon.png"
+ bitmap2: "climate/heated seat iconBlack.png"
+ }
+ TouchButtonClimatePCA{
+ id: drvCoolSeat
+ x:105
+ y:273
+ bitmap: "climate/A_C icon.png"
+ bitmap2: "climate/A_C iconBlack.png"
+ }
+ TouchButtonClimatePCA{
+ id: heatWheel
+ x:200
+ y:178
+ bitmap: "climate/wheel icon.png"
+ bitmap2: "climate/wheel iconBlack.png"
+ }
+ TouchButtonClimatePCA{
+ id: heatWinSheild
+ x:200
+ y:273
+ bitmap: "climate/headed dashBlue.png"
+ bitmap2: "climate/headed dash.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: defrost
+ x:360
+ y:130
+ bitmap: "climate/defrost iconBlue.png"
+ bitmap2: "climate/defrost icon.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: pannel
+ x:360
+ y:226
+ bitmap: "climate/face icon.png"
+ bitmap2: "climate/face iconBlack.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: floor
+ x:360
+ y:322
+ bitmap: "climate/feet icon.png"
+ bitmap2: "climate/feet iconBlack.png"
+ }
+
+
+ TouchButtonClimatePCA{
+ id: dualBtn
+ y:225
+ x:528
+ text: "Dual"
+ }
+
+ TouchButtonClimatePCA{
+ id: passHeatSeat
+ x:615
+ y:178
+ bitmap: "climate/heated seat icon.png"
+ bitmap2: "climate/heated seat iconBlack.png"
+ }
+ TouchButtonClimatePCA{
+ id: passCoolSeat
+ x:615
+ y:273
+ bitmap: "climate/A_C icon.png"
+ bitmap2: "climate/A_C iconBlack.png"
+ }
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml
new file mode 100644
index 0000000000..0abc7db4b7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml
@@ -0,0 +1,57 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: alphaLayout
+ width: 800
+ height: 480
+
+
+ Item {
+ id: _fg
+
+ width: 800; height: 480
+ x:0
+ y:0
+
+ FWdgtTouchArea{
+ id: blockTouch
+ x:0
+ y:0
+ height: 480
+ width: 800
+ }
+
+ Rectangle{
+ anchors.fill: blockTouch
+ color: "black"
+ opacity: 0.8
+ }
+
+ FWdgtImage{
+ id: popupBg
+ anchors.centerIn: blockTouch
+ bitmap: "climate/ring.png"
+ }
+
+ BaseText{
+ id:curTemp
+ anchors.centerIn: popupBg
+ text: dataPool.drvTemp + "\xBA"
+ pxSize: 96
+ }
+
+ BaseText{
+ id:drvPass
+ anchors.horizontalCenter: popupBg.horizontalCenter
+ anchors.bottom: curTemp.top
+ horAlignment: Text.AlignHCenter
+ text: "Driver"
+ pxSize: 28
+ }
+
+ }
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml b/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml
new file mode 100644
index 0000000000..8057ff2e7e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml
@@ -0,0 +1,217 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: fmLayout
+ width: 800
+ height: 480
+
+ property alias sourceBtn: sourceBtn
+ property alias browseBtn: browseBtn
+ property alias albumInfoBtn: albumInfoBtn
+ property alias albumInfoImg: stationLogoImg
+ property alias stationTxt: stationTxt
+ property alias trackTxt: trackTxt
+ property alias artistTxt: artistTxt
+ property alias alertBtn: alertBtn
+ property alias preset1Btn: preset1Btn
+ property alias preset2Btn: preset2Btn
+ property alias preset3Btn: preset3Btn
+ property alias preset4Btn: preset4Btn
+ property alias preset5Btn: preset5Btn
+ property alias preset6Btn: preset6Btn
+ property alias replayBtn: replayBtn
+ property alias tuneBtn: tuneBtn
+ property alias presetsBtn: presetsBtn
+ property bool artShown: true
+
+
+ TouchButton{
+ id: sourceBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 140
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 10
+ height:25
+ width: 130
+ text: "Source"
+ }
+
+ TouchButton{
+ id: browseBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 180
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 10
+ height:25
+ width: 130
+ text: "Browse"
+ }
+
+ TouchButton{
+ id: albumInfoBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 95
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 190
+ height:130
+ width: 130
+ text: "Album"
+ vis: false
+
+ }
+
+ FWdgtImage{
+ id: stationLogoImg
+ anchors.top: fmLayout.top
+ anchors.topMargin: 95
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 190
+ height:70
+ width: 130
+ bitmap: ""
+ }
+
+ TouchButton{
+ id: alertBtn
+ anchors.top: albumInfoImg.bottom
+ anchors.topMargin: 20
+ anchors.left: albumInfoImg.left
+ height:25
+ width: 90
+ text: "Alert"
+ }
+
+ BaseText{
+ id: stationTxt
+ anchors.verticalCenter: trackTxt.verticalCenter
+ anchors.verticalCenterOffset: -45
+ anchors.left: trackTxt.left
+ text: "Ch 22 / Pearl Jam Radio"
+ }
+
+ BaseText{
+ id: trackTxt
+ anchors.verticalCenter: albumInfoBtn.verticalCenter
+ anchors.left: albumInfoBtn.right
+ anchors.leftMargin: 15
+ pxSize: 34
+ text: "State of Love ..."
+
+ }
+
+ BaseText{
+ id: artistTxt
+ anchors.verticalCenter: trackTxt.verticalCenter
+ anchors.verticalCenterOffset: 45
+ anchors.left: trackTxt.left
+ text: "Pearl Jam"
+ }
+
+ TouchButton{
+ id: preset1Btn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 280
+ anchors.left: browseBtn.left
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset2Btn
+ anchors.top: preset1Btn.bottom
+ anchors.left: preset1Btn.left
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset3Btn
+ anchors.top: preset1Btn.top
+ anchors.left: preset1Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset4Btn
+ anchors.top: preset2Btn.top
+ anchors.left: preset2Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset5Btn
+ anchors.top: preset3Btn.top
+ anchors.left: preset3Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset6Btn
+ anchors.top: preset4Btn.top
+ anchors.left: preset4Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: replayBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.verticalCenterOffset: 35
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 725
+ height:40
+ width: 55
+ text: "rply"
+ }
+
+ TouchButton{
+ id: tuneBtn
+ anchors.top: preset1Btn.top
+ anchors.right: replayBtn.right
+ height:40
+ width: 120
+ text: "tune"
+ }
+
+ TouchButton{
+ id: presetsBtn
+ anchors.bottom: preset6Btn.bottom
+ anchors.right: replayBtn.right
+ height:60
+ width: 120
+ text: "presets"
+ }
+
+ FViewUseCaseGroup{
+ FViewUseCase{
+ condition: dataPool.hasArt === 0
+ PropertyChanges { target: albumInfoBtn; vis: false;}
+ PropertyChanges { target: albumInfoImg; visible: false;}
+ PropertyChanges { target: trackTxt; anchors.left: albumInfoBtn.left;}
+ PropertyChanges { target: alertBtn; vis: false;}
+ }
+ FViewUseCase{
+ condition: dataPool.hasArt === 1
+ PropertyChanges { target: albumInfoBtn; vis: false;}
+ PropertyChanges { target: albumInfoImg; visible: false;}
+ PropertyChanges { target: trackTxt; anchors.left: albumInfoBtn.left;}
+ PropertyChanges { target: alertBtn; vis: false;}
+ }
+ FViewUseCase{
+ condition: dataPool.hasArt === 2
+ PropertyChanges { target: albumInfoImg; visible: true;}
+ PropertyChanges { target: albumInfoBtn; vis: true;}
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml
new file mode 100644
index 0000000000..fd211b3c97
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml
@@ -0,0 +1,152 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: fmLayout
+ width: 800
+ height: 480
+
+ property alias sourceBtn: sourceBtn
+ property alias tuneBtn: tuneBtn
+ property alias hdBtn: hdBtn
+ property alias stationTxt: stationTxt.text
+ property alias freqId: freqId.text
+ property alias listModel: thePresets.listModel
+ property alias artist: artistTxt.text
+ property alias curHD: hdBtn.curHD
+ property alias totHD: hdBtn.totHD
+ property alias curPreset: thePresets.currPreset
+ property alias moving: thePresets.moving
+ property alias direction: thePresets.direction
+ property bool page1: true
+
+
+
+
+
+ FWdgtImage{
+ bitmap: "Radio/Ford-HMI-PCA-audio_fm_sirius.png"
+ visible: false
+ }
+
+ TouchButton_PCA{
+ id: sourceBtn
+ x:25
+ y:80
+ textWidth: 100
+ text: "FM Radio"
+
+ }
+
+ TouchButton_PCA{
+ id: tuneBtn
+ anchors.right: fmLayout.right
+ anchors.rightMargin: 25
+ y:80
+ textWidth: 55
+ text: "Tune"
+
+ }
+
+ BaseText{
+ id: stationTxt
+ x:25
+ y:155
+ pxSize: 45
+ text: "96.3"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
+
+ }
+
+ BaseText{
+ id: freqId
+ anchors.left: stationTxt.right
+ anchors.leftMargin: 5
+ anchors.bottom: stationTxt.bottom
+ anchors.bottomMargin: 4
+ text: "FM"
+ color: "#1d81d5"
+ pxSize: 22
+ theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
+
+ }
+
+ BaseText{
+ id: trackTxt
+ x:25
+ y:212
+ text: "So Far Around The Bend"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ pxSize: 22
+
+
+ }
+
+ BaseText{
+ id: artistTxt
+ x:25
+ y:240
+ text: "The National"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ pxSize: 22
+ }
+
+ TouchButtonSpecial_PCA{
+ id: hdBtn
+ x:25
+ y:288
+ textWidth: 120
+ bitmap: "Radio/HD Logo.png"
+ bitmap2: "Radio/HD Logo1.png"
+ imageShift: -9
+ spacing: 0
+ text: " 1 "
+ text1: "2"
+ text2: " 3 4"
+
+ }
+
+ Rectangle{
+ x:25
+ y: 365
+ height:1
+ width: 750
+ color: "#1d81d5"
+ }
+
+
+ PresetsGridPCA{
+ id: thePresets
+ x:0
+ y:365
+
+ }
+
+ FWdgtImage{
+ id: swipeIcon1
+ bitmap: "Radio/whiteBall.png"
+ x: 389
+ y: 381
+ }
+
+ FWdgtImage{
+ id: swipeIcon2
+ bitmap: "Radio/blueBall.png"
+ x: 404
+ y: 381
+ }
+
+ FViewUseCaseSimple{condition: fmLayout.page1===false
+ PropertyChanges{
+ target: swipeIcon2; bitmap: "Radio/whiteBall.png"
+ }
+ PropertyChanges{
+ target: swipeIcon1; bitmap: "Radio/blueBall.png"
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml b/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml
new file mode 100644
index 0000000000..375f96894a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml
@@ -0,0 +1,61 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: home
+ width: 800
+ height: 480
+
+ property alias button1: button1
+ property alias button2: button2
+ property alias button3: button3
+ property alias button4: button4
+
+
+
+
+ TouchButton{
+ id: button1
+ anchors.top: home.top
+ anchors.left: home.left
+ height:235
+ width: 395
+ text: "Button 1"
+ }
+
+ TouchButton{
+ id: button2
+ anchors.top: home.top
+ anchors.right: home.right
+ height:235
+ width: 395
+ text: "Button 2"
+ }
+
+ TouchButton{
+ id: button3
+ anchors.bottom: home.bottom
+ anchors.left: home.left
+ height:235
+ width: 395
+ text: "Button 3"
+ }
+
+ TouchButton{
+ id: button4
+ anchors.bottom: home.bottom
+ anchors.right: home.right
+ height:235
+ width: 395
+ text: "Button 4"
+ }
+
+ BaseText{
+ id: title
+ anchors.centerIn: home
+ text: "Home"
+ }
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml
new file mode 100644
index 0000000000..326d4feb0b
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml
@@ -0,0 +1,59 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+
+FLayout {
+
+ id: theLayout
+ width: 800
+ height: 480
+ x:10
+ y:10
+ property alias list : theListView
+ property alias list_itemWidget: theListView.itemWidget
+ property alias list_data: theListView.data
+ Rectangle{
+ anchors.fill:parent
+ color:"white"
+
+ }
+
+
+ FWdgtListView {
+
+ id: theListView
+ anchors.fill: parent
+ clip: true
+
+ }
+ FWdgtListView {
+ x:400
+ id: filteredListView
+ clip: true
+ data:filtermodel
+ itemWidget:list_itemWidget
+ width:100
+ height:400
+ }
+ TextInput{
+ text:"HelloWorld"
+ x:200
+ y:20
+ onTextChanged: {
+
+ if(text.length > 0 ) {
+ dataPool.filter = text
+ console.log(dataPool.filter)
+
+ sortList.fillFilterModel(theListView.data)//Just backup original
+ sortList.updateFilterModel(text)
+
+ } else {
+ sortList.fillFilterModel(theListView.data)
+ }
+ }
+
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml
new file mode 100644
index 0000000000..d0f240f4b9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml
@@ -0,0 +1,130 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: mapLayout
+ width: 800
+ height: 480
+
+ property alias zoomIn: zoomIn.touchBtn
+ property alias zoomOut: zoomOut.touchBtn
+ property alias compass: compass.touchBtn
+ property alias cancel: cancel.touchBtn
+ property alias mute: mute.touchBtn
+ property alias muteSt: mute.selected
+ property alias options: options.touchBtn
+
+
+
+ FWdgtImage{
+ id: mapImg
+ bitmap: "Nav/Map.png"
+ anchors.fill: mapLayout
+ }
+
+ TouchButtonClimatePCA{
+ id: zoomIn
+ text: "+"
+ x:25
+ y:103
+ image: "buttons/zoom_9_9.png"
+ imageActive: "buttons/zoomSelected.png"
+ imagePressed: "buttons/zoomPressed_9_9.png"
+ txtColor: "white"
+ txtSize: 40
+
+ }
+ TouchButtonClimatePCA{
+ id: zoomOut
+ text: "-"
+ x:25
+ y:223
+ image: "buttons/zoom_9_9.png"
+ imageActive: "buttons/zoomSelected.png"
+ imagePressed: "buttons/zoomPressed_9_9.png"
+ txtColor: "white"
+ txtSize: 40
+ }
+ TouchButtonClimatePCA{
+ id: options
+ x:659
+ y:80
+ image: "Nav/Options_9_9.png"
+ imageActive: "Nav/OptionsInActive.png"
+ imagePressed: "Nav/OptionsPressed_9_9.png"
+ }
+ TouchButtonClimatePCA{
+ id: compass
+ x:34
+ y:352
+ image: "Nav/compass.png"
+ imageActive: "Nav/compass.png"
+ imagePressed: "Nav/compass.png"
+ }
+ TouchButtonClimatePCA{
+ id: mute
+ x:25
+ y:419
+ image: "buttons/mute_9_9.png"
+ imageActive: "buttons/muteActive.png"
+ imagePressed: "buttons/mutePressed_9_9.png"
+ imageInActive: "buttons/muteInActive.png"
+ }
+ FWdgtImage{
+ bitmap: "Nav/turnArrow.png"
+ x:97
+ y:428
+ }
+ BaseText{
+ text: "0.2 mi on Cherry Hill Rd."
+ pxSize: 22
+ x:144
+ y:434
+ color: "white"
+ }
+
+ BaseText{
+ text: "2 hrs 27 min"
+ pxSize: 22
+ anchors.right: cancel.left
+ anchors.rightMargin: 26
+ horAlignment: Text.AlignRight
+ y:434
+ color: "white"
+ }
+
+ TouchButtonSpecial_PCA{
+ id: cancel
+ x:621
+ y:419
+ textWidth: 110
+ bitmap: "Nav/destIcon.png"
+ bitmap2: "Nav/destIconBlack.png"
+ imageShift: -9
+ spacing: 0
+ text: " Cancel"
+ text1: ""
+ text2: ""
+ totHD: -1
+
+ }
+ FWdgtImage{
+ id: currStBkgrnd
+ bitmap: "Nav/current street.png"
+ x:265
+ y:349
+ }
+
+ BaseText{
+ id: currentStreet
+ x:312
+ y:360
+ text: "East Capital St. NE"
+ pxSize: 18
+ theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
+ horAlignment: Text.AlignLeft
+ vertAlignment: Text.AlignTop
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml
new file mode 100644
index 0000000000..6c7a031175
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml
@@ -0,0 +1,547 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: alphaLayout
+ width: 800
+ height: 480
+ property alias list : theListView
+ property alias list_itemWidget: theListView.itemWidget
+ property alias list_data: theListView.data
+
+ property alias a: aBtn.touchBtn
+ property alias b: bBtn.touchBtn
+ property alias c: cBtn.touchBtn
+ property alias d: dBtn.touchBtn
+ property alias e: eBtn.touchBtn
+ property alias f: fBtn.touchBtn
+ property alias g: gBtn.touchBtn
+ property alias h: hBtn.touchBtn
+ property alias i: iBtn.touchBtn
+ property alias j: jBtn.touchBtn
+ property alias k: kBtn.touchBtn
+ property alias l: lBtn.touchBtn
+ property alias m: mBtn.touchBtn
+ property alias n: nBtn.touchBtn
+ property alias o: oBtn.touchBtn
+ property alias p: pBtn.touchBtn
+ property alias q: qBtn.touchBtn
+ property alias r: rBtn.touchBtn
+ property alias s: sBtn.touchBtn
+ property alias t: tBtn.touchBtn
+ property alias u: uBtn.touchBtn
+ property alias v: vBtn.touchBtn
+ property alias w: wBtn.touchBtn
+ property alias xB: xBtn.touchBtn
+ property alias yB: yBtn.touchBtn
+ property alias zB: zBtn.touchBtn
+ property alias num: numBtn.touchBtn
+ property alias sym: symBtn.touchBtn
+ property alias del: delBtn.touchBtn
+ property alias clr: clrBtn.touchBtn
+ property alias space: spaceBtn.touchBtn
+ property alias close: closeTouch
+ property string entry: ""
+ property alias go: goBtn.touchBtn
+ property alias listOpen: listOpen
+
+ FWdgtListView {
+ id: theListView
+ anchors.fill: parent
+ clip: true
+ visible:false
+ }
+
+ FWdgtListView {
+ x:400
+ id: filteredListView
+ clip: true
+ data:filtermodel
+ itemWidget:list_itemWidget
+ width:100
+ height:400
+ visible: true
+ }
+ TextInput{ //Little Trick for Update on List
+ text:dataPool.navEnrty
+ x:200
+ y:20
+ onTextChanged: {
+
+ if(text.length > 0 ) {
+ dataPool.filter = text
+ console.log(dataPool.filter)
+ sortList.fillFilterModel(theListView.data)//Just backup original
+ sortList.updateFilterModel(text)
+
+ } else {
+ sortList.fillFilterModel(theListView.data)
+ dataPool.navList1stItem=""
+
+ }
+
+
+ }
+
+ }
+ BaseText{
+ id: navEntry
+ x:25
+ y:65
+ text: entry
+ theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+ pxSize: 45
+ color: "#1d81d5"
+ horAlignment: Text.AlignLeft
+ vertAlignment: Text.AlignTop
+ }
+ BaseText{
+ id: listFiltEntry
+ x:25
+ y:130
+ color:"#1d81d5"
+ text:dataPool.navList1stItem
+ theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+ pxSize: 45
+ horAlignment: Text.AlignLeft
+ vertAlignment: Text.AlignTop
+ }
+ Rectangle{
+ id:rect
+ x:20
+ y:120
+ height: 60
+ radius:10
+ width:650
+ color:"transparent"
+ border.color: "#1d81d5"
+ border.width: 1
+ visible: false
+ }
+
+ FWdgtTouchArea{
+ id: listOpen
+ anchors.fill: rect
+ enabled: rect.visible
+ }
+
+ TouchButton_PCA{
+ id: goBtn
+ x:690
+ y:115
+ textWidth: 40
+ text: "Go"
+
+ }
+
+
+ TouchButtonClimatePCA{
+ id: qBtn
+ x:61
+ y:211
+ text: "Q"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: wBtn
+ x:130
+ y:211
+ text: "W"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: eBtn
+ x:199
+ y:211
+ text: "E"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: rBtn
+ x:268
+ y:211
+ text: "R"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: tBtn
+ x:337
+ y:211
+ text: "T"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: yBtn
+ x:406
+ y:211
+ text: "Y"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: uBtn
+ x:475
+ y:211
+ text: "U"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: iBtn
+ x:544
+ y:211
+ text: "I"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: oBtn
+ x:613
+ y:211
+ text: "O"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: pBtn
+ x:682
+ y:211
+ text: "P"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: numBtn
+ x:27
+ y:272
+ text: "123"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 22
+ }
+
+ TouchButtonClimatePCA{
+ id: aBtn
+ x:96
+ y:272
+ text: "A"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: sBtn
+ x:165
+ y:272
+ text: "S"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: dBtn
+ x:234
+ y:272
+ text: "D"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: fBtn
+ x:303
+ y:272
+ text: "F"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: gBtn
+ x:372
+ y:272
+ text: "G"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: hBtn
+ x:441
+ y:272
+ text: "H"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: jBtn
+ x:510
+ y:272
+ text: "J"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: kBtn
+ x:579
+ y:272
+ text: "K"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: lBtn
+ x:648
+ y:272
+ text: "L"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: delBtn
+ x:717
+ y:272
+ bitmap: "Nav/deleteIcon.png"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: symBtn
+ x:61
+ y:333
+ text: "!@#"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 22
+ }
+
+ TouchButtonClimatePCA{
+ id: zBtn
+ x:130
+ y:333
+ text: "Z"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: xBtn
+ x:199
+ y:333
+ text: "X"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: cBtn
+ x:268
+ y:333
+ text: "C"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: vBtn
+ x:337
+ y:333
+ text: "V"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: bBtn
+ x:406
+ y:333
+ text: "B"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: nBtn
+ x:475
+ y:333
+ text: "N"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: mBtn
+ x:544
+ y:333
+ text: "M"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ txtSize: 30
+ }
+
+ TouchButtonClimatePCA{
+ id: clrBtn
+ x:613
+ y:333
+ text: "Clear"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ newFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ txtSize: 16
+ }
+
+ TouchButtonClimatePCA{
+ id: spaceBtn
+ x:682
+ y:333
+ text: "Space"
+ image: "buttons/key_9_9.png"
+ imagePressed: "buttons/keyPressed_9_9.png"
+ imageActive: "buttons/keySelected.png"
+ imageInActive: "buttons/keySelected.png"
+ newFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ txtSize: 16
+ }
+
+ BaseText{
+ id: closeTxt
+ anchors.horizontalCenter: alphaLayout.horizontalCenter
+ y:430
+ horAlignment: Text.AlignHCenter
+ vertAlignment: Text.AlignTop
+ text: "CLOSE"
+ color: "#1d81d5"
+ pxSize: 22
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+
+ }
+
+ FWdgtTouchArea{
+ id: closeTouch
+ height: 75
+ width: 750
+ y:430
+ anchors.horizontalCenter: alphaLayout.horizontalCenter
+ }
+
+ FViewUseCase{condition: closeTouch.pressed === true
+ //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
+ PropertyChanges {
+ target: closeTxt; color: "white"
+ }
+ }
+
+ FViewUseCaseSimple{condition: listFiltEntry.text !== ""
+ PropertyChanges {
+ target: rect; visible: true
+ }
+ }
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml
new file mode 100644
index 0000000000..7c65e911a7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml
@@ -0,0 +1,78 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: mapLayout
+ width: 800
+ height: 480
+
+ property alias zoomIn: zoomIn.touchBtn
+ property alias zoomOut: zoomOut.touchBtn
+ property alias compass: compass.touchBtn
+ property alias destSearch: destSearch.touchBtn
+ property alias options: options.touchBtn
+
+
+
+ FWdgtImage{
+ id: mapImg
+ bitmap: "Nav/Map.png"
+ anchors.fill: mapLayout
+ }
+
+ TouchButtonClimatePCA{
+ id: zoomIn
+ text: "+"
+ x:25
+ y:103
+ image: "buttons/zoom_9_9.png"
+ imageActive: "buttons/zoomSelected.png"
+ imagePressed: "buttons/zoomPressed_9_9.png"
+ txtColor: "white"
+ txtSize: 40
+
+ }
+ TouchButtonClimatePCA{
+ id: zoomOut
+ text: "-"
+ x:25
+ y:223
+ image: "buttons/zoom_9_9.png"
+ imageActive: "buttons/zoomSelected.png"
+ imagePressed: "buttons/zoomPressed_9_9.png"
+ txtColor: "white"
+ txtSize: 40
+ }
+ TouchButtonClimatePCA{
+ id: options
+ x:659
+ y:80
+ image: "Nav/Options_9_9.png"
+ imageActive: "Nav/OptionsInActive.png"
+ imagePressed: "Nav/OptionsPressed_9_9.png"
+ }
+ TouchButtonClimatePCA{
+ id: compass
+ x:34
+ y:352
+ image: "Nav/compass.png"
+ imageActive: "Nav/compass.png"
+ imagePressed: "Nav/compass.png"
+ }
+ TouchButtonSpecial_PCA{
+ id: destSearch
+ x:601
+ y:419
+ textWidth: 130
+ bitmap: "Nav/destIcon.png"
+ bitmap2: "Nav/destIconBlack.png"
+ imageShift: -9
+ spacing: 0
+ text: " Destination"
+ text1: ""
+ text2: ""
+ totHD: -1
+
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml b/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml
new file mode 100644
index 0000000000..f5cc5d57a6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml
@@ -0,0 +1,71 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FLayout {
+ width: 800
+ height: 480
+
+ property alias offTouch: offTouch
+
+ Rectangle {
+ id: bk
+ anchors.fill: parent
+ color: "black"
+ }
+
+ FWdgtTouchArea{
+ id: offTouch
+ anchors.fill: bk
+ }
+
+/* RectangularGlow {
+ id: effect
+ anchors.fill: rect
+ glowRadius: 4
+ spread: 0.7
+ color: "#1d81d5"
+ cornerRadius: rect.radius //+ glowRadius
+ }
+
+ Rectangle {
+ id: rect
+ color: "black"
+ x:40
+ y:40
+ width: 160
+ height: 45
+ radius: 23
+ border.width: 1
+ border.color: "#1d81d5"
+ }
+
+ FWdgtImage{
+ id: img
+ x:40
+ y:90
+ bitmap: "OButton.png"
+ }
+
+ FWdgtImage{
+ id: img
+ x:40
+ y:40
+ bitmap: "Radio/ButtonEnd_8_8.png"
+ }
+
+ FWdgtImage{
+ id: img1
+ anchors.left: img.right
+ anchors.top: img.top
+ width:2
+ fillMode: Image.Stretch
+ bitmap: "Radio/ButtonCenter_0_8.png"
+ }
+
+ FWdgtImage{
+ id: img2
+ anchors.left: img1.right
+ anchors.top: img1.top
+ bitmap: "Radio/ButtonOtherEnd_8_8.png"
+ }*/
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml b/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml
new file mode 100644
index 0000000000..1236ea4201
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml
@@ -0,0 +1,123 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: statusLayout
+ width: 800
+ height: 480
+
+ property alias menuTouch: menuTouch
+
+ Rectangle{
+ id: ln1
+ anchors.horizontalCenter: statusLayout.horizontalCenter
+ y:15
+ height:1
+ width: 14
+ color: "#1d81d5"
+ }
+ Rectangle{
+ id: ln2
+ anchors.horizontalCenter: statusLayout.horizontalCenter
+ y:19
+ height:1
+ width: 14
+ color: "#1d81d5"
+ }
+ Rectangle{
+ id: ln3
+ anchors.horizontalCenter: statusLayout.horizontalCenter
+ y:23
+ height:1
+ width: 14
+ color: "#1d81d5"
+ }
+
+
+
+ BaseText{
+ id: menuTxt
+ anchors.horizontalCenter: statusLayout.horizontalCenter
+ anchors.bottom: statusLayout.top
+ anchors.bottomMargin: -50
+ horAlignment: Text.AlignHCenter
+ vertAlignment: Text.AlignBottom
+ text: "MENU"
+ color: "#1d81d5"
+ pxSize: 22
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+
+ }
+
+ BaseText{
+ id: tempTxt
+ x:25
+ anchors.bottom: statusLayout.top
+ anchors.bottomMargin: -50
+ horAlignment: Text.AlignLeft
+ vertAlignment: Text.AlignBottom
+ text: "75" + "\xBA"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+ pxSize: 28
+
+
+ }
+
+ BaseText{
+ id: clockTxt
+ anchors.right: statusLayout.right
+ anchors.rightMargin: 25
+ anchors.bottom: statusLayout.top
+ anchors.bottomMargin: -50
+ horAlignment: Text.AlignRight
+ vertAlignment: Text.AlignBottom
+ text: "12:45"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+ pxSize: 28
+ }
+
+ FWdgtTouchArea{
+ id: menuTouch
+ height: 75
+ width: 80
+ y:0
+ anchors.horizontalCenter: statusLayout.horizontalCenter
+ }
+
+ FViewUseCase{condition: menuTouch.pressed === true
+ //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
+ PropertyChanges {
+ target: ln1; color: "white"
+ }
+ PropertyChanges {
+ target: ln2; color: "white"
+ }
+ PropertyChanges {
+ target: ln3; color: "white"
+ }
+ PropertyChanges {
+ target: menuTxt; color: "white"
+ }
+ }
+
+ FViewUseCase{
+ condition: dataPool.mainPCAmenuShown ===true
+ PropertyChanges {
+ target: ln1; visible: false
+ }
+ PropertyChanges {
+ target: ln2; visible: false
+ }
+ PropertyChanges {
+ target: ln3; visible: false
+ }
+ PropertyChanges {
+ target: menuTxt; visible: false
+ }
+ }
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml b/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml
new file mode 100644
index 0000000000..9e119d9900
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml
@@ -0,0 +1,40 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+
+FLayout {
+
+ id: theLayout
+ width: 800
+ height: 480
+
+ property alias list : theListPhoneView
+ property alias list_itemWidget: theListPhoneView.itemWidget
+ property alias list_data: theListPhoneView.data
+ property alias back: back.touchBtn
+ TouchButtonClimatePCA{
+ id: back
+ text: "+"
+ x:25
+ y:80
+ image: "buttons/zoom_9_9.png"
+ imageActive: "buttons/zoomSelected.png"
+ imagePressed: "buttons/zoomPressed_9_9.png"
+ txtColor: "white"
+ txtSize: 40
+ visible: false
+
+ }
+ FWdgtListView {
+
+ width:600
+ height:400
+ id: theListPhoneView
+ x:150
+ y:80
+ clip: true
+ visible:true
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml b/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml
new file mode 100644
index 0000000000..e275c055a7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml
@@ -0,0 +1,195 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: fmLayout
+ width: 800
+ height: 480
+
+ property alias sourceBtn: sourceBtn
+ property alias browseBtn: browseBtn
+ property alias albumInfoBtn: albumInfoBtn
+ property alias albumInfoImg: stationLogoImg
+ property alias stationTxt: stationTxt
+ property alias trackTxt: trackTxt
+ property alias artistTxt: artistTxt
+ property alias alertBtn: alertBtn
+ property alias preset1Btn: preset1Btn
+ property alias preset2Btn: preset2Btn
+ property alias preset3Btn: preset3Btn
+ property alias preset4Btn: preset4Btn
+ property alias preset5Btn: preset5Btn
+ property alias preset6Btn: preset6Btn
+ property alias replayBtn: replayBtn
+ property alias tuneBtn: tuneBtn
+ property alias presetsBtn: presetsBtn
+
+
+ TouchButton{
+ id: sourceBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 140
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 10
+ height:25
+ width: 130
+ text: "Source"
+ }
+
+ TouchButton{
+ id: browseBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 180
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 10
+ height:25
+ width: 130
+ text: "Browse"
+ }
+
+ TouchButton{
+ id: albumInfoBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 95
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 190
+ height:130
+ width: 130
+ text: "Album"
+ vis: false
+
+ }
+
+ FWdgtImage{
+ id: stationLogoImg
+ anchors.top: fmLayout.top
+ anchors.topMargin: 95
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 190
+ height:70
+ width: 130
+ bitmap: ""
+ }
+
+ TouchButton{
+ id: alertBtn
+ anchors.top: albumInfoImg.bottom
+ anchors.topMargin: 20
+ anchors.left: albumInfoImg.left
+ height:25
+ width: 90
+ text: "Alert"
+ }
+
+ BaseText{
+ id: stationTxt
+ anchors.verticalCenter: trackTxt.verticalCenter
+ anchors.verticalCenterOffset: -45
+ anchors.left: trackTxt.left
+ text: "Ch 22 / Pearl Jam Radio"
+ }
+
+ BaseText{
+ id: trackTxt
+ anchors.verticalCenter: albumInfoBtn.verticalCenter
+ anchors.left: albumInfoBtn.right
+ anchors.leftMargin: 15
+ pxSize: 34
+ text: "State of Love ..."
+
+ }
+
+ BaseText{
+ id: artistTxt
+ anchors.verticalCenter: trackTxt.verticalCenter
+ anchors.verticalCenterOffset: 45
+ anchors.left: trackTxt.left
+ text: "Pearl Jam"
+ }
+
+ TouchButton{
+ id: preset1Btn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 280
+ anchors.left: browseBtn.left
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset2Btn
+ anchors.top: preset1Btn.bottom
+ anchors.left: preset1Btn.left
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset3Btn
+ anchors.top: preset1Btn.top
+ anchors.left: preset1Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset4Btn
+ anchors.top: preset2Btn.top
+ anchors.left: preset2Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset5Btn
+ anchors.top: preset3Btn.top
+ anchors.left: preset3Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: preset6Btn
+ anchors.top: preset4Btn.top
+ anchors.left: preset4Btn.right
+ height:60
+ width: 208
+ text: "WWWWWWWW"
+ }
+
+ TouchButton{
+ id: replayBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.verticalCenterOffset: 35
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 725
+ height:40
+ width: 55
+ text: "rply"
+ }
+
+ TouchButton{
+ id: tuneBtn
+ anchors.top: preset1Btn.top
+ anchors.right: replayBtn.right
+ height:40
+ width: 120
+ text: "tune"
+ }
+
+ TouchButton{
+ id: presetsBtn
+ anchors.bottom: preset6Btn.bottom
+ anchors.right: replayBtn.right
+ height:60
+ width: 120
+ text: "presets"
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml b/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml
new file mode 100644
index 0000000000..3968438447
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: chrome
+ width: 800
+ height: 480
+
+ //property alias bg: _bg
+ //property alias btnIndicatorState: button1.indicatorState
+ property alias button1: button1
+
+
+
+
+ BaseText{
+ id: title
+ anchors.centerIn: chrome
+ text: "Chrome"
+ }
+
+ TouchButton{
+ id: button1
+ anchors.top: title.bottom
+ anchors.horizontalCenter: title.horizontalCenter
+ text: "Button 1"
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml b/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml
new file mode 100644
index 0000000000..d898a0c07f
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml
@@ -0,0 +1,37 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ width: 800
+ height: 480
+
+ property alias m1: m1.children
+ property alias list: listView
+ property alias list_data: listView.list_data
+ property alias list_itemWidget: listView.list_itemWidget
+ property alias listWrap: listView.listWrap
+ property alias fg: _fg
+
+
+
+ Item {
+ id: _fg
+
+ width: 800; height: 480
+
+ GridViewWidget {
+ id: listView
+ x: 135; y: 170
+ width: 530; height: 200
+ gridItemHeight: 100; gridItemWidth: 180
+
+ }
+
+ FWdgtContainer {
+ id: m1
+ width: 530; height: 55
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml
new file mode 100644
index 0000000000..a1a0d32538
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml
@@ -0,0 +1,76 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: layout
+ width: 800
+ height: 480
+
+ property alias m1: m1.children
+ property alias list: listView
+ property alias list_data: listView.list_data
+ property alias list_itemWidget: listView.list_itemWidget
+ property alias listWrap: listView.listWrap
+ property alias fg: _fg
+ property alias theX: listView.x
+ property alias theY: listView.y
+ property alias theWidth: listView.width
+ property alias theHeight: listView.height
+ property alias itemWidth: listView.gridItemWidth
+ property alias itemHeight: listView.gridItemHeight
+ property alias close: closeTouch
+ property bool useClose: false
+
+
+ Item {
+ id: _fg
+
+ width: 800; height: 480
+
+
+ GridViewWidget {
+ id: listView
+ x: 0; y: 75
+ width: 800; height: 356
+ gridItemHeight: 178; gridItemWidth: 200
+
+ }
+
+ FWdgtContainer {
+ id: m1
+ width: 530; height: 55
+ }
+ }
+ BaseText{
+ id: closeTxt
+ anchors.horizontalCenter: layout.horizontalCenter
+ y:430
+ horAlignment: Text.AlignHCenter
+ vertAlignment: Text.AlignTop
+ text: "CLOSE"
+ color: "#1d81d5"
+ pxSize: 22
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ visible: useClose
+
+ }
+
+ FWdgtTouchArea{
+ id: closeTouch
+ height: 75
+ width: 750
+ y:430
+ anchors.horizontalCenter: layout.horizontalCenter
+ visible: useClose
+ enabled: useClose
+ }
+
+ FViewUseCase{condition: closeTouch.pressed === true
+ //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
+ PropertyChanges {
+ target: closeTxt; color: "white"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml
new file mode 100644
index 0000000000..0aed708e35
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml
@@ -0,0 +1,107 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: tileLayout
+ width: 800
+ height: 480
+
+ property alias button1: button1
+ property alias button2: button2
+ property alias button3: button3
+ property alias button4: button4
+ property alias button5: button5
+ property alias button6: button6
+ property alias button7: button7
+ property alias button8: button8
+ property alias backBtn: backBtn
+
+
+
+ Grid {
+ id: theGrid
+ flow: Grid.TopToBottom
+ anchors.top: tileLayout.top
+ anchors.topMargin: 130
+ anchors.horizontalCenter: tileLayout.horizontalCenter
+ anchors.leftMargin: 100
+ columns: 4
+ spacing: 20
+ TouchButton{
+ id: button1
+ height:125
+ width: 135
+ text: "Button 1"
+ }
+
+ TouchButton{
+ id: button2
+ height:125
+ width: 135
+ text: "Button 2"
+ }
+
+ TouchButton{
+ id: button3
+ height:125
+ width: 135
+ text: "Button 3"
+ }
+
+ TouchButton{
+ id: button4
+ height:125
+ width: 135
+ text: "Button 4"
+ }
+
+ TouchButton{
+ id: button5
+ height:125
+ width: 135
+ text: "Button 5"
+ }
+
+ TouchButton{
+ id: button6
+ height:125
+ width: 135
+ text: "Button 6"
+ }
+
+ TouchButton{
+ id: button7
+ height:125
+ width: 135
+ text: "Button 7"
+ }
+
+ TouchButton{
+ id: button8
+ height:125
+ width: 135
+ text: "Button 8"
+ }
+ }
+
+
+
+ BaseText{
+ id: title
+ anchors.top: tileLayout.top
+ anchors.topMargin: 80
+ anchors.horizontalCenter: tileLayout.horizontalCenter
+ text: "Select a Source"
+ }
+
+ TouchButton{
+ id: backBtn
+ anchors.verticalCenter: title.verticalCenter
+ anchors.left: tileLayout.left
+ anchors.leftMargin: 20
+ height:40
+ width: 60
+ text: "<"
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml
new file mode 100644
index 0000000000..bc7545b6fd
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml
@@ -0,0 +1,73 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: layout
+ width: 800
+ height: 480
+
+ property alias m1: m1.children
+ property alias list: listView
+ property alias list_data: listView.list_data
+ property alias list_itemWidget: listView.list_itemWidget
+ property alias listWrap: listView.listWrap
+ property alias fg: _fg
+ property alias theX: listView.x
+ property alias theY: listView.y
+ property alias theWidth: listView.width
+ property alias theHeight: listView.height
+ property alias itemWidth: listView.gridItemWidth
+ property alias itemHeight: listView.gridItemHeight
+ property alias close: closeTouch
+ property bool useClose: true
+
+
+
+
+ Item {
+ id: _fg
+
+ width: 800; height: 480
+
+ GridViewWidget {
+ id: listView
+ x: 130; y: 170
+ width: 540; height: 200
+ gridItemHeight: 100; gridItemWidth: 180
+
+ }
+
+ FWdgtContainer {
+ id: m1
+ width: 530; height: 55
+ }
+
+
+ }
+
+ BaseText{
+ id: closeTxt
+ anchors.horizontalCenter: layout.horizontalCenter
+ y:430
+ horAlignment: Text.AlignHCenter
+ vertAlignment: Text.AlignTop
+ text: "CLOSE"
+ color: "#1d81d5"
+ pxSize: 22
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ visible: useClose
+
+ }
+
+ FWdgtTouchArea{
+ id: closeTouch
+ height: 75
+ width: 750
+ y:430
+ anchors.horizontalCenter: layout.horizontalCenter
+ visible: useClose
+ enabled: useClose
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml b/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml
new file mode 100644
index 0000000000..178fe6fc1a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml
@@ -0,0 +1,132 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: fmLayout
+ width: 800
+ height: 480
+
+ property alias sourceBtn: sourceBtn
+ property alias browseBtn: browseBtn
+ property alias albumInfoBtn: albumInfoBtn
+ property alias stationTxt: stationTxt
+ property alias trackTxt: trackTxt
+ property alias artistTxt: artistTxt
+ property alias seekBkBtn: seekBkBtn
+ property alias playBtn: playBtn
+ property alias seekFdBtn: seekFdBtn
+ property alias repeatBtn: repeatBtn
+ property alias shuffleBtn: shuffleBtn
+
+
+ TouchButton{
+ id: sourceBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 140
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 10
+ height:25
+ width: 130
+ text: "Source"
+ }
+
+ TouchButton{
+ id: browseBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 290
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 10
+ height:25
+ width: 130
+ text: "Browse"
+ }
+
+ TouchButton{
+ id: albumInfoBtn
+ anchors.top: fmLayout.top
+ anchors.topMargin: 95
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 190
+ height:130
+ width: 130
+ text: "Album"
+ }
+
+ BaseText{
+ id: stationTxt
+ anchors.verticalCenter: trackTxt.verticalCenter
+ anchors.verticalCenterOffset: -45
+ anchors.left: trackTxt.left
+ text: "Ch 22 / Pearl Jam Radio"
+ }
+
+ BaseText{
+ id: trackTxt
+ anchors.verticalCenter: albumInfoBtn.verticalCenter
+ anchors.left: albumInfoBtn.right
+ anchors.leftMargin: 15
+ pxSize: 34
+ text: "State of Love ..."
+
+ }
+
+ BaseText{
+ id: artistTxt
+ anchors.verticalCenter: trackTxt.verticalCenter
+ anchors.verticalCenterOffset: 45
+ anchors.left: trackTxt.left
+ text: "Pearl Jam"
+ }
+
+ TouchButton{
+ id: seekBkBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.horizontalCenter: playBtn.horizontalCenter
+ anchors.horizontalCenterOffset: -150
+ height:100
+ width: 100
+ text: "<<"
+ }
+
+ TouchButton{
+ id: playBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.horizontalCenter: fmLayout.horizontalCenter
+ height:120
+ width: 120
+ text: "||"
+ }
+
+ TouchButton{
+ id: seekFdBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.horizontalCenter: playBtn.horizontalCenter
+ anchors.horizontalCenterOffset: 150
+ height:100
+ width: 100
+ text: ">>"
+ }
+
+ TouchButton{
+ id: repeatBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.verticalCenterOffset: -35
+ anchors.left: fmLayout.left
+ anchors.leftMargin: 670
+ height:40
+ width: 55
+ text: "rpt"
+ }
+
+ TouchButton{
+ id: shuffleBtn
+ anchors.verticalCenter: browseBtn.verticalCenter
+ anchors.verticalCenterOffset: 35
+ anchors.left: repeatBtn.left
+ height:40
+ width: 55
+ text: "sfl"
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml
new file mode 100644
index 0000000000..d82077b555
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml
@@ -0,0 +1,155 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: fmLayout
+ width: 800
+ height: 480
+
+ property alias sourceBtn: sourceBtn
+ property alias browseBtn: browseBtn
+ property alias trackNumTxt: trackNumTxt.text
+ property alias artist: artistTxt.text
+ property alias play: play.touchBtn
+ property alias pause: pause.touchBtn
+ property bool playing: true
+
+
+
+
+ FWdgtImage{
+ id: albumArt
+ x:25
+ y:176
+ bitmap: "USB/albumArt.png"
+ }
+
+ TouchButton_PCA{
+ id: sourceBtn
+ x:25
+ y:80
+ textWidth: 100
+ text: "FM Radio"
+
+ }
+
+ TouchButton_PCA{
+ id: browseBtn
+ anchors.right: fmLayout.right
+ anchors.rightMargin: 25
+ y:80
+ textWidth: 75
+ text: "Browse"
+
+ }
+
+ BaseText{
+ id: trackNumTxt
+ x:181
+ y:188
+ pxSize: 22
+ text: "Track 13/ 16"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
+
+ }
+
+ BaseText{
+ id: trackTxt
+ x:181
+ y:225
+ text: "The Dog Days Are Over"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ pxSize: 45
+
+
+ }
+
+ BaseText{
+ id: artistTxt
+ x:181
+ y:280
+ text: "Florence and the Machine"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ pxSize: 22
+ }
+
+
+ TouchButtonClimatePCA{
+ id: play
+ x:367
+ y:390
+ image: "USB/play_9_9.png"
+ imagePressed: "USB/playPressed_9_9.png"
+ visible: playing
+ enabled: playing
+ }
+
+ TouchButtonClimatePCA{
+ id: pause
+ x:367
+ y:390
+ image: "USB/pause_9_9.png"
+ imagePressed: "USB/pausePressed_9_9.png"
+ visible: !playing
+ enabled: !playing
+ }
+
+ TouchButtonClimatePCA{
+ id: seekBack
+ x:287
+ y:399
+ image: "USB/Prev_9_9.png"
+ imagePressed: "USB/PrevPressed_9_9.png"
+ }
+
+ TouchButtonClimatePCA{
+ id: seekNext
+ x:463
+ y:399
+ image: "USB/Next_9_9.png"
+ imagePressed: "USB/NextPressed_9_9.png"
+ }
+
+ Rectangle{
+ x:92
+ y: 365
+ height:1
+ width: 616
+ color: "#1d81d5"
+ }
+
+ Rectangle{
+ x:92
+ y: 365
+ height:1
+ width: 138
+ color: "white"
+ }
+
+ BaseText{
+ id: elapsedTime
+ x:25
+ y:358
+ text: "02:36"
+ color: "white"
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ pxSize: 18
+ }
+
+ BaseText{
+ id: totTime
+ y:358
+ anchors.right: fmLayout.right
+ anchors.rightMargin: 25
+ horAlignment: Text.AlignRight
+ text: "04:23"
+ color: "#1d81d5"
+ theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
+ pxSize: 18
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml
new file mode 100644
index 0000000000..22e408c716
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml
@@ -0,0 +1,373 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "Models"
+import "Widgets"
+import "Styles"
+
+Rectangle {
+ width: 1360
+ height: 768
+ color: "black"
+
+ // global events
+ FEvent { id: cornerClicked }
+ FEvent { id: closeNormalScreens }
+
+ //global timers
+ FTimer {id: testTimer; interval: 5000; repeat: false}
+
+ // global datapools
+ FDataPool {
+ id: dataPool
+
+ property string version: "V1.0.0"
+ property string currSource: "FM"
+ property string currStation: "91.9"
+ property string currStatText: "WUOM"
+ property string currSong: "Fresh Air"
+ property string currAlbumArt: "album artRazorFish.png"
+ property int layout: 2 //AM/FM:0, AMhd:1, FMhd:2, Sirius:3, USB:4, BT:5
+ property int currFMpreset: 2
+ property int currAMpreset: 1
+ property int currSATpreset: 3
+ property string curStationDT: ""
+ property int statusBarChange: 0
+ property int curFanSpeed: 1
+ property int drvTemp: 70
+ property int passTemp: 70
+
+ property bool mainPCAmenuShown: false
+
+
+ property string fm1pre1: "101.1"
+ property string fm1pre2: "97.1"
+ property string fm1pre3: "94.7"
+ property string fm1pre4: "91.7"
+ property string fm1pre5: "101.9"
+ property string fm1pre6: "88.7"
+
+ property string fm1stat1: "WRIF"
+ property string fm1stat2: "WXYT"
+ property string fm1stat3: "WCSX"
+ property string fm1stat4: "WUOM"
+ property string fm1stat5: "WDET"
+ property string fm1stat6: "CIMX"
+
+ property string fm1song1: "Ace of Spades"
+ property string fm1song2: "Sports Talk"
+ property string fm1song3: "Born to Run"
+ property string fm1song4: "Fresh Air"
+ property string fm1song5: "The Craig Fahle Show"
+ property string fm1song6: "State of Love and Trust"
+
+ property string fm2pre1: "101.1"
+ property string fm2pre2: "97.1"
+ property string fm2pre3: "94.7"
+ property string fm2pre4: "91.7"
+ property string fm2pre5: "101.9"
+ property string fm2pre6: "88.7"
+
+ property string fm2stat1: "WRIF"
+ property string fm2stat2: "WXYT"
+ property string fm2stat3: "WCSX"
+ property string fm2stat4: "WUOM"
+ property string fm2stat5: "WDET"
+ property string fm2stat6: "CIMX"
+
+ property string fm2song1: "Ace of Spades"
+ property string fm2song2: "Sports Talk"
+ property string fm2song3: "Born to Run"
+ property string fm2song4: "Fresh Air"
+ property string fm2song5: "The Craig Fahle Show"
+ property string fm2song6: "State of Love and Trust"
+
+ property string fm3pre1: "101.1"
+ property string fm3pre2: "97.1"
+ property string fm3pre3: "94.7"
+ property string fm3pre4: "91.7"
+ property string fm3pre5: "101.9"
+ property string fm3pre6: "88.7"
+
+ property string fm3stat1: "WRIF"
+ property string fm3stat2: "WXYT"
+ property string fm3stat3: "WCSX"
+ property string fm3stat4: "WUOM"
+ property string fm3stat5: "WDET"
+ property string fm3stat6: "CIMX"
+
+ property string fm3song1: "Ace of Spades"
+ property string fm3song2: "Sports Talk"
+ property string fm3song3: "Born to Run"
+ property string fm3song4: "Fresh Air"
+ property string fm3song5: "The Craig Fahle Show"
+ property string fm3song6: "State of Love and Trust"
+
+
+ /*List Filtered Variables*/
+ property string navEnrty:""
+ property string filter: ""
+ property variant uniqueChars: undefined
+ property string navList1stItem:""
+ property string filterPhone:""
+ }
+
+ // global conditions
+ FConditionPool {
+ id: condPool
+
+ property bool amfmActiveSource: true
+ property bool settingsOpen: false
+ property bool dualBtnSt: true
+ property bool drvHeatSeatSt: false
+ property bool drvCoolSeatSt: false
+ property bool passCoolSeatSt: false
+ property bool passHeatSeatSt: false
+ property bool heatWheelSt: false
+ property bool heatWinSheildSt: true
+ property bool defrostSt: true
+ property bool pannelSt: false
+ property bool floorSt: false
+
+ property bool showMenu: true
+
+ }
+
+
+ Component.onCompleted: {
+ FThemeProvider.resourcePath = Qt.resolvedUrl("Resources");
+ FThemeProvider.theme = "Theme1";
+
+
+ }
+ property QtObject filtermodel: ListModel {
+ ListElement { staticItem: "Five Guys" }
+ ListElement { staticItem: "Archers Of Loaf" }
+ ListElement { staticItem: "Bob Mould" }
+ ListElement { staticItem: "Cat Power" }
+ ListElement { staticItem: "Cloud Nothings"}
+ ListElement { staticItem: "Dentist"}
+ ListElement { staticItem: "Dirty Frank's" }
+ ListElement { staticItem: "Grouplove" }
+ ListElement { staticItem: "Hudson Bell"}
+ ListElement { staticItem: "Japandroids" }
+ ListElement { staticItem: "Macklemore & Ryan Lewis"}
+ ListElement { staticItem: "The National"}
+ ListElement { staticItem: "Titus Andronicus" }
+ ListElement { staticItem: "Tito" }
+ ListElement { staticItem: "Tamal" }
+ ListElement { staticItem: "Taco" }
+ }
+
+ QtObject{
+ id:sortList
+
+ //Check if char exist on Phone DataModel
+ function existChar(model, character){
+ //console.log(model.get(3).staticItem.charAt(0).toLowerCase())
+ for (var i = 0; i < model.count; i++) {
+ var u =model.get(i).staticItem.charAt(0).toLowerCase()
+ if (character=== u){
+ console.log(i)
+ return i;
+ }
+
+ }
+
+ }
+
+ // Check whether given character exists in array
+ function exist(array, character) {
+ console.log(array[0]);
+ for (var i = 0; i < array.length; i++) {
+
+ if (array[i] == character) return true;
+ }
+ return false;
+ }
+
+ // Check whether given filter matches the string (e.g. "ce" would match "Cecilia")
+ // The check is case-insensitive
+ function checkFilter(filter, string) {
+ if (filter.length > string.length) return false;
+
+ var filterlower = filter.toLowerCase();
+ var stringlower = string.toLowerCase();
+
+ for (var i = 0; i < filter.length; i++) {
+ if (filterlower[i] != stringlower[i])
+ return false;
+ }
+
+ return true;
+ }
+
+ // Updates the filtermodel based on the current filter
+ function updateFilterModel(name) {
+ if (dataPool.filter.length > 0) {
+ for (var i = filtermodel.count-1; i >= 0; i--) {
+ if (!checkFilter(dataPool.filter, filtermodel.get(i).staticItem))
+ filtermodel.remove(i)
+ }
+ }
+
+ updateUniqueChars()
+ }
+
+ // Updates the array of unique first letters in the current index of the model
+ function updateUniqueChars() {
+
+ if (filtermodel.get(0) === undefined)
+ {
+ dataPool.navList1stItem=""
+ return;
+
+ }
+
+ var characters = new Array();
+
+ // If filter model has at most 1 item in it, no point in going
+ // any further with filtering
+ dataPool.navList1stItem=filtermodel.get(0).staticItem
+ if (filtermodel.count > 1) {
+
+ for (var i = 0; i < filtermodel.count; i++) {
+ var name = filtermodel.get(i).staticItem;
+
+ if (!exist(characters, name[dataPool.filter.length])) {
+ characters.push(name[dataPool.filter.length])
+ }
+ }
+
+ characters.sort()
+
+
+ }
+
+
+ dataPool.uniqueChars = characters
+
+ }
+
+
+ // Fills the filtermodel with contents from the source list's model
+ function fillFilterModel(fullModel) {
+ if (fullModel === undefined) return;
+ filtermodel.clear();
+ for (var i = 0; i < fullModel.count; i++) {
+ filtermodel.append(fullModel.get(i))
+ }
+
+ }
+
+ }
+
+ FDisplay {
+
+ /* modelPath:Qt.resolvedUrl(".")
+ id: display
+ //activeVariant: "ClassicTop"
+ //activeVariant: "ClassicBottom"
+ //activeVariant: "Tangier"
+ viewCacheSize:0
+
+ //width: 800
+ //height: 480
+// xPixel: 800
+// yPixel: 480
+ anchors.fill: parent
+// anchors { left: parent.left; top: parent.top;}
+
+ priorityLayerCount: 9
+ //initialView: "AutocompleteList"
+ initialView: "Off"*/
+
+
+
+ modelPath:Qt.resolvedUrl(".")
+ id: display
+ //activeVariant: "ClassicTop"
+ //activeVariant: "ClassicBottom"
+ //activeVariant: "Tangier"
+ viewCacheSize:0
+
+
+ width: 800
+ height: 480
+
+ xPixel: 800
+ yPixel: 480
+
+ anchors {
+ horizontalCenter: parent.horizontalCenter;
+ verticalCenter: parent.verticalCenter;
+ verticalCenterOffset: 55
+ }
+
+ priorityLayerCount: 9
+ initialView: "Off"
+ //initialView: "NavTilesView"
+ }
+
+ Item
+ {
+ id: fHardwareKeybezel1
+ width: 800
+ height: 375
+ x:10
+ y:500
+
+ // function keys
+ TextHardkey {
+ id: hk_OnOff
+ width: 100
+ height: 50
+ anchors.left: parent.left
+ anchors.leftMargin: 0
+ anchors.top: parent.top
+ anchors.topMargin: 0
+ label: "On/Off"
+ }
+
+ BaseText {
+ id: info
+ text: dataPool.version
+ color: "black"
+ anchors.top: hk_OnOff.top
+ anchors.left: hk_OnOff.right
+ anchors.leftMargin: 20
+ }
+
+
+ FHardwareKey {
+ id: buttonUp
+ hardwareControlID: "buttonUp"
+ //commName: "buttonBack"
+
+ x:0
+ y:0
+ width: 60
+ height:25
+
+
+ keyboardKey: Qt.Key_Up
+ visible: false
+ }
+
+ FHardwareKey {
+ id: buttonDown
+ hardwareControlID: "buttonDown"
+ //commName: "buttonBack"
+
+ x:0
+ y:0
+ width: 60
+ height:25
+
+
+ keyboardKey: Qt.Key_Down
+ visible: false
+ }
+
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject
new file mode 100644
index 0000000000..e9402cbac7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject
@@ -0,0 +1,20 @@
+/* File generated by Qt Creator, version 2.6.1 */
+
+import QmlProject 1.1
+
+Project {
+ mainFile: "PCA_HMI_v1_0.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ "plugins" ]
+}
diff --git a/src/components/qt_hmi/References/Look/Resources/CButton.png b/src/components/qt_hmi/References/Look/Resources/CButton.png
new file mode 100644
index 0000000000..aeebdb64ca
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/CButton.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd b/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd
new file mode 100644
index 0000000000..982bd5882c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png b/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png
new file mode 100644
index 0000000000..805236eaf6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/Map.png b/src/components/qt_hmi/References/Look/Resources/Nav/Map.png
new file mode 100644
index 0000000000..4b39af9b22
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/Map.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png
new file mode 100644
index 0000000000..601b242bbe
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png
new file mode 100644
index 0000000000..42c352a7e8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png b/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png
new file mode 100644
index 0000000000..46887f1061
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/compass.png b/src/components/qt_hmi/References/Look/Resources/Nav/compass.png
new file mode 100644
index 0000000000..b78041307b
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/compass.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png
new file mode 100644
index 0000000000..826b5faacf
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png
new file mode 100644
index 0000000000..56e35c759b
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png b/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png
new file mode 100644
index 0000000000..dadcfe25cf
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png b/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png
new file mode 100644
index 0000000000..75c99bc4aa
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png b/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png
new file mode 100644
index 0000000000..f37731f5af
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/OButton.png b/src/components/qt_hmi/References/Look/Resources/OButton.png
new file mode 100644
index 0000000000..2811770953
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/OButton.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png
new file mode 100644
index 0000000000..9933dbcc72
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png
new file mode 100644
index 0000000000..672e57bf39
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png
new file mode 100644
index 0000000000..cc9cb83ede
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png b/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png
new file mode 100644
index 0000000000..efe0b7b586
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png
new file mode 100644
index 0000000000..6ed0293aab
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png
new file mode 100644
index 0000000000..375195bec3
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png
new file mode 100644
index 0000000000..99f5e90c3d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png b/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png
new file mode 100644
index 0000000000..d4db3f96ae
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png b/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png
new file mode 100644
index 0000000000..1422e00b42
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png b/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png
new file mode 100644
index 0000000000..3c1cad7c33
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png b/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png
new file mode 100644
index 0000000000..952714ebe6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png
new file mode 100644
index 0000000000..aab3df8914
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png
new file mode 100644
index 0000000000..c432068d4a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png
new file mode 100644
index 0000000000..c6eefc09c9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png
new file mode 100644
index 0000000000..acc2a71de3
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png b/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png
new file mode 100644
index 0000000000..9000680276
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pause.png b/src/components/qt_hmi/References/Look/Resources/USB/pause.png
new file mode 100644
index 0000000000..71a7574d25
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/pause.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png
new file mode 100644
index 0000000000..a26cf2e4ea
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png
new file mode 100644
index 0000000000..417bdbf248
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png
new file mode 100644
index 0000000000..ecbb4f2ef0
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png
new file mode 100644
index 0000000000..f185e94461
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png
new file mode 100644
index 0000000000..94d5d44b5a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png
new file mode 100644
index 0000000000..c5985043df
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png
new file mode 100644
index 0000000000..a8e5d9d66c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png
new file mode 100644
index 0000000000..6424d9d210
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png
new file mode 100644
index 0000000000..b0f8863423
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png
new file mode 100644
index 0000000000..d264e201ad
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png
new file mode 100644
index 0000000000..3add8dd21c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png b/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png
new file mode 100644
index 0000000000..e14b9fb751
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png b/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png
new file mode 100644
index 0000000000..a2c1cb831a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png
new file mode 100644
index 0000000000..9a9ae59346
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png
new file mode 100644
index 0000000000..f7306d96ae
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png
new file mode 100644
index 0000000000..fd7606fbd6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png
new file mode 100644
index 0000000000..2b567e237e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png
new file mode 100644
index 0000000000..58c296a4e4
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png
new file mode 100644
index 0000000000..c67d2c7c55
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png
new file mode 100644
index 0000000000..36bba93d8c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png
new file mode 100644
index 0000000000..0df4d25109
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png
new file mode 100644
index 0000000000..55e2cac50a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png
new file mode 100644
index 0000000000..9f84a139e6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png
new file mode 100644
index 0000000000..691f6e3bf8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png b/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png
new file mode 100644
index 0000000000..411f003938
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ring.png b/src/components/qt_hmi/References/Look/Resources/climate/ring.png
new file mode 100644
index 0000000000..9908bf71be
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/climate/ring.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/dn-arrow.png b/src/components/qt_hmi/References/Look/Resources/dn-arrow.png
new file mode 100644
index 0000000000..bb1322277d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/dn-arrow.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/g136p.png b/src/components/qt_hmi/References/Look/Resources/g136p.png
new file mode 100644
index 0000000000..1d49f184a1
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/g136p.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/g137p.png b/src/components/qt_hmi/References/Look/Resources/g137p.png
new file mode 100644
index 0000000000..8e674d75b7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/g137p.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/arrow.png b/src/components/qt_hmi/References/Look/Resources/menu/arrow.png
new file mode 100644
index 0000000000..4c215b2bf7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/menu/arrow.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/car.png b/src/components/qt_hmi/References/Look/Resources/menu/car.png
new file mode 100644
index 0000000000..18a21656d0
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/menu/car.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/gear.png b/src/components/qt_hmi/References/Look/Resources/menu/gear.png
new file mode 100644
index 0000000000..b1eeba091c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/menu/gear.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/notes.png b/src/components/qt_hmi/References/Look/Resources/menu/notes.png
new file mode 100644
index 0000000000..8b4a92fffc
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/menu/notes.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/phone.png b/src/components/qt_hmi/References/Look/Resources/menu/phone.png
new file mode 100644
index 0000000000..346f36cc33
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/menu/phone.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/snow.png b/src/components/qt_hmi/References/Look/Resources/menu/snow.png
new file mode 100644
index 0000000000..54756bb2f6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/menu/snow.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png b/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png
new file mode 100644
index 0000000000..04bb2476c1
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png b/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png
new file mode 100644
index 0000000000..56b9fe7065
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/contacts.png b/src/components/qt_hmi/References/Look/Resources/phone/contacts.png
new file mode 100644
index 0000000000..a16d518ba8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/contacts.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/keypad.png b/src/components/qt_hmi/References/Look/Resources/phone/keypad.png
new file mode 100644
index 0000000000..1792c8fac8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/keypad.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/messages.png b/src/components/qt_hmi/References/Look/Resources/phone/messages.png
new file mode 100644
index 0000000000..b5cbb8e8af
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/messages.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/more.png b/src/components/qt_hmi/References/Look/Resources/phone/more.png
new file mode 100644
index 0000000000..908ebf654e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/more.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/recent.png b/src/components/qt_hmi/References/Look/Resources/phone/recent.png
new file mode 100644
index 0000000000..db54c2f16e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/recent.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/texts.png b/src/components/qt_hmi/References/Look/Resources/phone/texts.png
new file mode 100644
index 0000000000..31c024b1df
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/phone/texts.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/scrollbar.png b/src/components/qt_hmi/References/Look/Resources/scrollbar.png
new file mode 100644
index 0000000000..c849382ae2
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/scrollbar.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/slider.png b/src/components/qt_hmi/References/Look/Resources/slider.png
new file mode 100644
index 0000000000..83c54f854a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/slider.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/up-arrow.png b/src/components/qt_hmi/References/Look/Resources/up-arrow.png
new file mode 100644
index 0000000000..b0e710a409
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Resources/up-arrow.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/TextHardkey.qml b/src/components/qt_hmi/References/Look/TextHardkey.qml
new file mode 100644
index 0000000000..b73b991164
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/TextHardkey.qml
@@ -0,0 +1,52 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "Widgets"
+
+FHardwareKey {
+ width: 50
+ height: 50
+
+ property alias label : theText.text
+
+ Rectangle {
+ anchors.fill: parent
+ border.color: "black"
+ border.width: 1
+ radius: 10
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ id: s1
+ color: "#FF646464"
+ position: 0.0
+ }
+ GradientStop {
+ id: s2
+ color: "#FF484848"
+ position: 0.8
+ }
+ GradientStop {
+ id: s3
+ color: "#FF323232"
+ position: 1.0
+ }
+ }
+ }
+
+ CondText {
+ id: theText
+ anchors.fill: parent
+ horizontalAlignment: Text.AlignHCenter
+
+ }
+
+
+ FViewUseCaseSimple {
+ condition: pressed === true
+ PropertyChanges { target: s1; position: 1.0 }
+ PropertyChanges { target: s2; position: 0.2}
+ PropertyChanges { target: s3; position: 0.0 }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Views/AM.qml b/src/components/qt_hmi/References/Look/Views/AM.qml
new file mode 100644
index 0000000000..2ed7d8085d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/AM.qml
@@ -0,0 +1,86 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: FMLayout {
+ id:home
+ albumInfoBtn.vis: false
+ albumInfoImg.visible: false
+ alertBtn.vis: false
+ browseBtn.vis: false
+ replayBtn.vis: false
+ preset1Btn.text: "WJR"
+ preset2Btn.text: "1130"
+ preset3Btn.text: "950"
+ preset4Btn.text: "WWJ"
+ preset5Btn.text: "WXYZ"
+ preset6Btn.text: "1330"
+ artistTxt.text: ""
+ stationTxt.text: ""
+ trackTxt.text: "950"
+
+
+ }
+
+
+ }
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChange" }
+ },
+ FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.tuneBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/AMPCA.qml b/src/components/qt_hmi/References/Look/Views/AMPCA.qml
new file mode 100644
index 0000000000..9a0a99f832
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/AMPCA.qml
@@ -0,0 +1,122 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ attachedViews: ["PCAstatusBar"]
+
+
+
+
+ view: FView {
+ id: v
+
+ layout: FMLayoutPCA {
+ id:home
+ sourceBtn.text: "AM Radio"
+ freqId: "AM"
+ sourceBtn.textWidth: 100
+ curPreset: dataPool.currAMpreset
+ hdBtn.visible: false
+
+ listModel: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ }
+
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: preset1; menuText: "1130"; menuData: false; }
+ FMenuElement { id: preset2; menuText: "950"; menuData: false }
+ FMenuElement { id: preset3; menuText: "760"; menuData: true }
+ FMenuElement { id: preset4; menuText: "1270"; menuData: false }
+ FMenuElement { id: preset5; menuText: "1310"; menuData: false }
+ FMenuElement { id: preset6; menuText: "800"; menuData: false }
+ FMenuElement { id: preset7; menuText: "610"; menuData: false }
+ FMenuElement { id: preset8; menuText: "820"; menuData: false}
+ }
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgEntry{
+ FGrdCondition{condition: dataPool.currAMpreset === 1
+ FActScriptCall { onScript: home.stationTxt = "1130" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 2
+ FActScriptCall { onScript: home.stationTxt = "950" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 3
+ FActScriptCall { onScript: home.stationTxt = "760" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 4
+ FActScriptCall { onScript: home.stationTxt = "1270" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 5
+ FActScriptCall { onScript: home.stationTxt = "1310" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 6
+ FActScriptCall { onScript: home.stationTxt = "800" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 7
+ FActScriptCall { onScript: home.stationTxt = "610" }
+ }
+ FGrdCondition{condition: dataPool.currAMpreset === 8
+ FActScriptCall { onScript: home.stationTxt = "820" }
+ }
+ },
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgMenuElement { menuElement: preset1
+ FActScriptCall { onScript: home.stationTxt = "1130" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 1 }
+ },
+ FTrgMenuElement { menuElement: preset2
+ FActScriptCall { onScript: home.stationTxt = "950" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 2 }
+ },
+ FTrgMenuElement { menuElement: preset3
+ FActScriptCall { onScript: home.stationTxt = "760" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 3 }
+ },
+ FTrgMenuElement { menuElement: preset4
+ FActScriptCall { onScript: home.stationTxt = "1270" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 4 }
+ },
+ FTrgMenuElement { menuElement: preset5
+ FActScriptCall { onScript: home.stationTxt = "1310" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 5 }
+ },
+ FTrgMenuElement { menuElement: preset6
+ FActScriptCall { onScript: home.stationTxt = "800" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 6 }
+ },
+ FTrgMenuElement { menuElement: preset7
+ FActScriptCall { onScript: home.stationTxt = "610" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 7 }
+ },
+ FTrgMenuElement { menuElement: preset8
+ FActScriptCall { onScript: home.stationTxt = "820" }
+ FActScriptCall { onScript: dataPool.currAMpreset = 8 }
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml b/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml
new file mode 100644
index 0000000000..0158451113
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml
@@ -0,0 +1,151 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ attachedViews: ["PCAstatusBar"]
+
+
+
+
+ view: FView {
+ id: v
+
+ layout: AlphaSortLayout {
+ id:home
+ phonEntry: dataPool.filterPhone
+
+ }
+
+
+ }
+
+ triggers: [
+
+ FTrgEntry{
+ FActScriptCall { onScript: dataPool.filterPhone= ""}
+ },
+ FTrgTouchArea { touchArea:home.a; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "a"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.b; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "b"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.c; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "c"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.d; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "d"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.e; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "e"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.f; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "f"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.g; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "g"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.h; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "h"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.i; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "i"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.j; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "j"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.k; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "k"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.l; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "l"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.m; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "m"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.n; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "n"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.o; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "o"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.p; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "p"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.q; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "q"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.r; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "r"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.s; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "s"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.t; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "t"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.u; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "u"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.v; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "v"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.w; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "w"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.xB; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "x"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.yB; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "y"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.zB; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "z"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.num; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.filterPhone= "a"}
+ FActViewShow { view: "PhoneContactsListView" }
+ },
+ FTrgTouchArea { touchArea:home.close; touchAction: TA.Out
+
+ FActViewShow { view: "PhonePCA" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+
+}
diff --git a/src/components/qt_hmi/References/Look/Views/AuxPCA.qml b/src/components/qt_hmi/References/Look/Views/AuxPCA.qml
new file mode 100644
index 0000000000..478d1e55d9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/AuxPCA.qml
@@ -0,0 +1,41 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: FMLayoutPCA {
+ id:home
+ sourceBtn.text: "Line In"
+ sourceBtn.textWidth: 90
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml b/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml
new file mode 100644
index 0000000000..83a83147f0
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml
@@ -0,0 +1,48 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: USBLayoutPCA {
+ id:home
+ sourceBtn.text: "BT Audio"
+ sourceBtn.textWidth: 100
+ playing: true
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = false }
+ },
+ FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = true }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/CDPCA.qml b/src/components/qt_hmi/References/Look/Views/CDPCA.qml
new file mode 100644
index 0000000000..bc6e6ab2fd
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/CDPCA.qml
@@ -0,0 +1,48 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: USBLayoutPCA {
+ id:home
+ sourceBtn.text: "CD"
+ sourceBtn.textWidth: 40
+ playing: true
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = false }
+ },
+ FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = true }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/Chrome.qml b/src/components/qt_hmi/References/Look/Views/Chrome.qml
new file mode 100644
index 0000000000..e8029fb10a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/Chrome.qml
@@ -0,0 +1,55 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 8
+
+
+
+ view: FView {
+ id: v
+
+ layout: ChromeLayout {
+ id:chrome
+ button2.indicatorState: condPool.settingsOpen
+
+ }
+
+
+ }
+
+ /*FViewUseCaseSimple{condition:condPool.settingsOpen
+ PropertyChanges {
+ target: chrome.button2; indicatorState: true
+ }
+ }*/
+
+ triggers: [
+ FTrgEntry {
+
+ },
+
+ FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ FActEventFire { event: closeNormalScreens }
+ FActViewShow { view: "Off" }
+ },
+ FTrgTouchArea { touchArea:chrome.button1; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:chrome.button2; touchAction: TA.Out
+ FActViewShow { view: "List" }
+ },
+ FTrgTouchArea { touchArea:chrome.button3; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml b/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml
new file mode 100644
index 0000000000..812e6afac3
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml
@@ -0,0 +1,74 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+
+
+ view: FView {
+ id: v
+
+ layout: ClimatePCALayout {
+ id:climate
+ dualBtnSt: condPool.dualBtnSt
+ drvHeatSeatSt: condPool.drvHeatSeatSt
+ drvCoolSeatSt: condPool.drvCoolSeatSt
+ passCoolSeatSt: condPool.passCoolSeatSt
+ passHeatSeatSt: condPool.passHeatSeatSt
+ heatWheelSt: condPool.heatWheelSt
+ heatWinSheildSt: condPool.heatWinSheildSt
+ defrostSt: condPool.defrostSt
+ pannelSt: condPool.pannelSt
+ floorSt: condPool.floorSt
+
+ }
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:climate.dualBtn; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.dualBtnSt = !condPool.dualBtnSt }
+ },
+ FTrgTouchArea { touchArea:climate.drvHeatSeat; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.drvHeatSeatSt = !condPool.drvHeatSeatSt }
+ },
+ FTrgTouchArea { touchArea:climate.drvCoolSeat; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.drvCoolSeatSt = !condPool.drvCoolSeatSt }
+ },
+ FTrgTouchArea { touchArea:climate.passCoolSeat; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.passCoolSeatSt = !condPool.passCoolSeatSt }
+ },
+ FTrgTouchArea { touchArea:climate.passHeatSeat; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.passHeatSeatSt = !condPool.passHeatSeatSt }
+ },
+ FTrgTouchArea { touchArea:climate.heatWheel; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.heatWheelSt = !condPool.heatWheelSt }
+ },
+ FTrgTouchArea { touchArea:climate.heatWinSheild; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.heatWinSheildSt = !condPool.heatWinSheildSt }
+ },
+ FTrgTouchArea { touchArea:climate.defrost; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.defrostSt = !condPool.defrostSt }
+ },
+ FTrgTouchArea { touchArea:climate.pannel; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.pannelSt = !condPool.pannelSt }
+ },
+ FTrgTouchArea { touchArea:climate.floor; touchAction: TA.Out
+ FActScriptCall { onScript: condPool.floorSt = !condPool.floorSt }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/ControlMirror.qml b/src/components/qt_hmi/References/Look/Views/ControlMirror.qml
new file mode 100644
index 0000000000..4cd1472c0d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/ControlMirror.qml
@@ -0,0 +1,55 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 5
+ property string dirTuneEntry: ""
+
+
+ FTimer { id: popupEnd; interval: 2500; repeat: false }
+
+ view: FView {
+ id: v
+
+ layout: ControlMirrorLayout {
+ id:home
+ }
+
+
+ }
+
+
+
+
+ triggers: [
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ },
+ FTrgEntry{
+ FActTimer { timer: popupEnd; action: TM.Start }
+ },
+ FTrgTimer{timer: popupEnd
+ FActTimer { timer: popupEnd; action: TM.Stop }
+ FActViewHide { }
+ },
+ FTrgHardwareKey { hardkeys: buttonUp; keyAction: HK.In
+ FActTimer { timer: popupEnd; action: TM.Restart }
+ // FActScriptCall { onScript: condPool.climateOnOff = true }
+ FGrdCondition { condition: dataPool.drvTemp !== 80
+ FActScriptCall { onScript: dataPool.drvTemp = (dataPool.drvTemp+1) }
+ }
+ },
+ FTrgHardwareKey { hardkeys: buttonDown; keyAction: HK.In
+ FActTimer { timer: popupEnd; action: TM.Restart }
+ // FActScriptCall { onScript: condPool.climateOnOff = true }
+ FGrdCondition { condition: dataPool.drvTemp !== 65
+ FActScriptCall { onScript: dataPool.drvTemp = (dataPool.drvTemp-1) }
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/FM.qml b/src/components/qt_hmi/References/Look/Views/FM.qml
new file mode 100644
index 0000000000..6aa98303bd
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/FM.qml
@@ -0,0 +1,94 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: FMLayout {
+ id:home
+ preset1Btn.text: dataPool.fm1pre1
+ preset2Btn.text: dataPool.fm1pre2
+ preset3Btn.text: dataPool.fm1pre3
+ preset4Btn.text: dataPool.fm1pre4
+ preset5Btn.text: dataPool.fm1pre5
+ preset6Btn.text: dataPool.fm1pre6
+ trackTxt.text: dataPool.currStation
+ stationTxt.text: dataPool.currStatText
+ artistTxt.text: dataPool.currSong
+ albumInfoBtn.bitmap: dataPool.currAlbumArt
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChange" }
+ },
+ FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre1 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat1}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song1 }
+ },
+ FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre2 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat2}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song2 }
+ },
+ FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre3 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat3}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song3 }
+ },
+ FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre4 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat4}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song4 }
+ },
+ FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre5 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat5}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song5 }
+ },
+ FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre6 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat6}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song6 }
+ },
+ FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.tuneBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/FMPCA.qml b/src/components/qt_hmi/References/Look/Views/FMPCA.qml
new file mode 100644
index 0000000000..1e9a46a0b3
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/FMPCA.qml
@@ -0,0 +1,175 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ attachedViews: ["PCAstatusBar"]
+ property int currHD: 1
+ property int totalHD: 4
+
+
+
+ view: FView {
+ id: v
+
+ layout: FMLayoutPCA {
+ id:home
+ sourceBtn.text: "FM Radio"
+ sourceBtn.textWidth: 100
+ freqId: "FM"
+ curHD: currHD
+ totHD: totalHD
+ curPreset: dataPool.currFMpreset
+
+ listModel: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ }
+
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: preset1; menuText: "96.3"; menuData: false; }
+ FMenuElement { id: preset2; menuText: "107.9"; menuData: false }
+ FMenuElement { id: preset3; menuText: "104.3"; menuData: false }
+ FMenuElement { id: preset4; menuText: "101.9"; menuData: false }
+ FMenuElement { id: preset5; menuText: "97.1"; menuData: false }
+ FMenuElement { id: preset6; menuText: "91.7"; menuData: false }
+ FMenuElement { id: preset7; menuText: "101.1"; menuData: false }
+ FMenuElement { id: preset8; menuText: "91.9"; menuData: false}
+ }
+ }
+
+
+ triggers: [
+
+ FTrgCondition{ condition: home.moving === true
+ FActScriptCall { onScript: home.page1=!home.page1 }
+ },
+ FTrgEntry{
+ FGrdCondition{condition: dataPool.currFMpreset === 1
+ FActScriptCall { onScript: home.stationTxt = "96.3" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 2
+ FActScriptCall { onScript: home.stationTxt = "107.9" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 3
+ FActScriptCall { onScript: home.stationTxt = "104.3" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 4
+ FActScriptCall { onScript: home.stationTxt = "101.9" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 5
+ FActScriptCall { onScript: home.stationTxt = "97.1" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 6
+ FActScriptCall { onScript: home.stationTxt = "91.7" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 7
+ FActScriptCall { onScript: home.stationTxt = "101.1" }
+ }
+ FGrdCondition{condition: dataPool.currFMpreset === 8
+ FActScriptCall { onScript: home.stationTxt = "91.9" }
+ }
+ },
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgTouchArea { touchArea:home.hdBtn.touchBtn; touchAction: TA.Out
+ FGrdCondition { condition: currHD === totalHD
+ FActScriptCall { onScript: currHD = 1 }
+ }
+ FGrdCondition { condition: currHD !== totalHD
+ FActScriptCall { onScript: currHD ++}
+ }
+ },
+ FTrgMenuElement { menuElement: preset1
+ FActScriptCall { onScript: home.stationTxt = "96.3" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 1 }
+ },
+ FTrgMenuElement { menuElement: preset2
+ FActScriptCall { onScript: home.stationTxt = "107.9" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 2 }
+ },
+ FTrgMenuElement { menuElement: preset3
+ FActScriptCall { onScript: home.stationTxt = "104.3" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 3 }
+ },
+ FTrgMenuElement { menuElement: preset4
+ FActScriptCall { onScript: home.stationTxt = "101.9" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 4 }
+ },
+ FTrgMenuElement { menuElement: preset5
+ FActScriptCall { onScript: home.stationTxt = "97.1" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 5 }
+ },
+ FTrgMenuElement { menuElement: preset6
+ FActScriptCall { onScript: home.stationTxt = "91.7" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 6 }
+ },
+ FTrgMenuElement { menuElement: preset7
+ FActScriptCall { onScript: home.stationTxt = "101.1" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 7 }
+ },
+ FTrgMenuElement { menuElement: preset8
+ FActScriptCall { onScript: home.stationTxt = "91.9" }
+ FActScriptCall { onScript: dataPool.currFMpreset = 8 }
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ /*FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre1 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat1}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song1 }
+ },
+ FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre2 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat2}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song2 }
+ },
+ FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre3 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat3}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song3 }
+ },
+ FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre4 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat4}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song4 }
+ },
+ FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre5 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat5}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song5 }
+ },
+ FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre6 }
+ FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat6}
+ FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song6 }
+ },
+ FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+
+ FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },*/
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/GenListHandling.qml b/src/components/qt_hmi/References/Look/Views/GenListHandling.qml
new file mode 100644
index 0000000000..9abdb899fc
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/GenListHandling.qml
@@ -0,0 +1,14 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FState {
+
+
+ triggers: [
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml b/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml
new file mode 100644
index 0000000000..fd43775f0d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml
@@ -0,0 +1,87 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FStateView {
+ id:sv
+ priority: 2
+
+ view: FView {
+ //viewClass: baseScreen
+ layout: TileBackImgLayoutPCA {
+ id:l
+ itemWidth: 266
+
+
+
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewImgItemWidget {
+ width: 266
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: climate; menuIcon: "menu/snow.png"}
+ FMenuElement { id: phone; menuIcon: "menu/phone.png" }
+ FMenuElement { id: navigation; menuIcon: "menu/arrow.png" }
+ FMenuElement { id: myVeh; menuIcon: "menu/car.png" }
+ FMenuElement { id: entertainment; menuIcon: "menu/notes.png" }
+ FMenuElement { id: settings; menuIcon: "menu/gear.png" }
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+ }
+
+ baseBehavior: GenListHandling {}
+
+ triggers: [
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: climate
+ FActViewShow { view: "ClimatePCA" }
+ },
+ FTrgMenuElement { menuElement: phone
+ FActViewShow { view: "PhonePCA" }
+ },
+ FTrgMenuElement { menuElement: navigation
+ FActViewShow { view: "NavNoRoute" }
+ },
+ FTrgMenuElement { menuElement: myVeh
+ FActViewShow { view: "MyVehiclePCA" }
+ },
+ FTrgMenuElement { menuElement: entertainment
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: settings
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEntry {
+ FActScriptCall { onScript: dataPool.mainPCAmenuShown = true }
+ FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
+ },
+ FTrgEntryComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
+ },
+ FTrgExit {
+ FActScriptCall { onScript: dataPool.mainPCAmenuShown = false }
+ FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
+ },
+ FTrgExitComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/Home.qml b/src/components/qt_hmi/References/Look/Views/Home.qml
new file mode 100644
index 0000000000..3a7edc353d
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/Home.qml
@@ -0,0 +1,50 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: HomeLayout {
+ id:home
+
+ }
+
+
+ }
+
+ triggers: [
+
+
+ /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ FActEventFire { event: closeNormalScreens }
+ FActViewShow { view: "Off" }
+ },*/
+ FTrgTouchArea { touchArea:home.button1; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.button2; touchAction: TA.Out
+ FActViewShow { view: "RadioEventHandling" }
+ },
+ FTrgTouchArea { touchArea:home.button3; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.button4; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/List.qml b/src/components/qt_hmi/References/Look/Views/List.qml
new file mode 100644
index 0000000000..5f63b77461
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/List.qml
@@ -0,0 +1,74 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+
+
+
+ view: FView {
+ id: v
+
+ layout: ListLayout {
+ id:list
+
+
+ listWrap: true
+ list_data: menuItemData
+ list_itemWidget: MenuListItemWidget { }
+
+ }
+
+
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: menuAudio; menuText: "Audio Settings"; menuType: FMenuElement.Submenu
+ FMenuElement { id: menuAudio1; menuText: "Audio 1"; menuType: FMenuElement.Submenu
+ FMenuElement { id: menuAudio11; menuText: "Audio 11"; menuType: FMenuElement.Popup }
+ FMenuElement { id: menuAudio12; menuText: "Audio 12"; menuType: FMenuElement.Popup }
+ }
+ FMenuElement { id: menuAudio2; menuText: "Audio 2"; menuType: FMenuElement.Popup }
+ FMenuElement { id: menuAudio3; menuText: "Audio 3"; menuType: FMenuElement.Popup }
+ }
+ FMenuElement { id: menuVehicle; menuText: "Vehicle Settings"; menuType: FMenuElement.Submenu; isVisible: false }
+ FMenuElement { id: menuClock; menuText: "Clock Settings"; menuType: FMenuElement.Submenu }
+ FMenuElement { id: menuDisplay; menuText: "Display Settings"; menuType: FMenuElement.Submenu }
+ FMenuElement { id: menuMC; menuText: "Message Centre"; menuType: FMenuElement.Popup }
+ }
+
+ triggers: [
+ FTrgEntry {
+ FActScriptCall {onScript: condPool.settingsOpen=true}
+
+ },
+ FTrgExit {
+ FActScriptCall {onScript: condPool.settingsOpen=false}
+ },
+
+ /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ FActEventFire { event: closeNormalScreens }
+ FActViewShow { view: "Off" }
+ },*/
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ },
+
+
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: menuAudio
+ FActScriptCall { onScript: menuAudio.isOpened = !menuAudio.isOpened }
+ },
+ // Example to use a list model trigger. This will work for all classes derived from FAbstractListModel (E.g. TreeModel, MenuModel)
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml b/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml
new file mode 100644
index 0000000000..ce477a12a7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml
@@ -0,0 +1,85 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FStateView {
+ id:sv
+ priority: 2
+
+ view: FView {
+ //viewClass: baseScreen
+ layout: TC1_B1_Grid {
+ id:l
+
+
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewItemWidget {
+
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: menuAudio; menuText: "AM"; menuType: FMenuElement.Submenu}
+ FMenuElement { id: menuVehicle; menuText: "FM"; menuType: FMenuElement.Submenu; isVisible: false}
+ FMenuElement { id: menuClock; menuText: "Sirius"; menuType: FMenuElement.Submenu }
+ FMenuElement { id: menuDisplay; menuText: "CD"; menuType: FMenuElement.Submenu }
+ FMenuElement { id: menuMC; menuText: "BT Audio"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "USB"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 2"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 3"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 4"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 5"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 6"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 7"; menuType: FMenuElement.Popup }
+ FMenuElement { menuText: "Dummy 8"; menuType: FMenuElement.Popup }
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+ }
+
+ baseBehavior: GenListHandling {}
+
+ triggers: [
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: menuAudio
+ FGrdCondition { condition: menuAudio.isEnabled
+ FActViewShow { view: "MenuAudioSettings"; animation: "AnimWiperRight" }
+ }
+ },
+ FTrgMenuElement { menuElement: menuClock
+ FActViewShow { view: "MenuTopLevelMenu" }
+ },
+ FTrgMenuElement { menuElement: menuVehicle
+ FActViewShow { view: "MenuTopLevelMenu"; animation: "AnimWiperRight" }
+ },
+ // Example to use a list model trigger. This will work for all classes derived from FAbstractListModel (E.g. TreeModel, MenuModel)
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEntry {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
+ },
+ FTrgEntryComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
+ },
+ FTrgExit {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
+ },
+ FTrgExitComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml b/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml
new file mode 100644
index 0000000000..6ecc512b60
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml
@@ -0,0 +1,85 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FStateView {
+ id:sv
+ priority: 2
+
+ view: FView {
+ //viewClass: baseScreen
+ layout: TileBackImgLayoutPCA {
+ id:l
+
+
+ //useClose: true
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewImgItemWidget {
+
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: ev; menuIcon: "Vehicle/EV Icon.png"}
+ FMenuElement { id: aLight; menuIcon: "Vehicle/Ambient Lighti Icon.png" }
+ FMenuElement { id: mcs; menuIcon: "Vehicle/MCS Icon.png" }
+ FMenuElement { id: weather; menuIcon: "Vehicle/sun.png" }
+ FMenuElement { id: kepad; menuIcon: "Vehicle/key_car.png" }
+ FMenuElement { id: calendar; menuIcon: "Vehicle/cal.png" }
+ FMenuElement { id: browse; menuIcon: "Vehicle/folders.png" }
+ FMenuElement { id: syncServices; menuIcon: "Vehicle/SYNC Services.png"}
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+ }
+
+ baseBehavior: GenListHandling {}
+
+ triggers: [
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: ev
+ },
+ FTrgMenuElement { menuElement: aLight
+ },
+ FTrgMenuElement { menuElement: mcs
+ },
+ FTrgMenuElement { menuElement: weather
+ },
+ FTrgMenuElement { menuElement: kepad
+ },
+ FTrgMenuElement { menuElement: calendar
+ },
+ FTrgMenuElement { menuElement: browse
+ },
+ FTrgMenuElement { menuElement: syncServices
+ },
+ FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
+ FActViewShow { view: "GridMenuPCA" }
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEntry {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
+ },
+ FTrgEntryComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
+ },
+ FTrgExit {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
+ },
+ FTrgExitComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/NavInRoute.qml b/src/components/qt_hmi/References/Look/Views/NavInRoute.qml
new file mode 100644
index 0000000000..e21d60a3cd
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/NavInRoute.qml
@@ -0,0 +1,38 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+
+
+ view: FView {
+ id: v
+
+ layout: NavInRouteLayout {
+ id:map
+
+
+ }
+
+ }
+
+
+
+ triggers: [
+ FTrgTouchArea { touchArea:map.cancel; touchAction: TA.Out
+ FActViewShow { view: "NavNoRoute" }
+ },
+ FTrgTouchArea { touchArea:map.mute; touchAction: TA.Out
+ FActScriptCall { onScript: { map.muteSt = !map.muteSt} }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml b/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml
new file mode 100644
index 0000000000..a3499f89d3
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml
@@ -0,0 +1,159 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ attachedViews: ["PCAstatusBar"]
+
+
+ view: FView {
+ id: v
+
+ layout: NavKeyboardLayout {
+ id:nav
+ entry:dataPool.navEnrty
+ list_data:sItemData
+ list_itemWidget: VerySimpleListItemWidget {
+ vis: false
+
+ }
+ }
+
+ }
+ ListModel
+ {
+
+ id:sItemData
+ ListElement { staticItem: "Five Guys" }
+ ListElement { staticItem: "Archers Of Loaf" }
+ ListElement { staticItem: "Bob Mould" }
+ ListElement { staticItem: "Cat Power" }
+ ListElement { staticItem: "Cloud Nothings"}
+ ListElement { staticItem: "Dentist"}
+ ListElement { staticItem: "Dirty Frank's" }
+ ListElement { staticItem: "Grouplove" }
+ ListElement { staticItem: "Hudson Bell"}
+ ListElement { staticItem: "Japandroids" }
+ ListElement { staticItem: "Macklemore & Ryan Lewis"}
+ ListElement { staticItem: "The National"}
+ ListElement { staticItem: "Titus Andronicus" }
+ ListElement { staticItem: "Tito" }
+ ListElement { staticItem: "Tamal" }
+ ListElement { staticItem: "Taco" }
+
+ }
+
+ triggers: [
+
+ FTrgTouchArea { touchArea:nav.listOpen; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= ""}
+ FActViewShow { view: "NavInRoute" }
+ },
+ FTrgTouchArea { touchArea:nav.a; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"a"}
+ },
+ FTrgTouchArea { touchArea:nav.b; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"b"}
+ },
+ FTrgTouchArea { touchArea:nav.c; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"c"}
+ },
+ FTrgTouchArea { touchArea:nav.d; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"d"}
+ },
+ FTrgTouchArea { touchArea:nav.e; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"e"}
+ },
+ FTrgTouchArea { touchArea:nav.f; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"f"}
+ },
+ FTrgTouchArea { touchArea:nav.g; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"g"}
+ },
+ FTrgTouchArea { touchArea:nav.h; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"h"}
+ },
+ FTrgTouchArea { touchArea:nav.i; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"i"}
+ },
+ FTrgTouchArea { touchArea:nav.j; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"j"}
+ },
+ FTrgTouchArea { touchArea:nav.k; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"k"}
+ },
+ FTrgTouchArea { touchArea:nav.l; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"l"}
+ },
+ FTrgTouchArea { touchArea:nav.m; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"m"}
+ },
+ FTrgTouchArea { touchArea:nav.n; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"n"}
+ },
+ FTrgTouchArea { touchArea:nav.o; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"o"}
+ },
+ FTrgTouchArea { touchArea:nav.p; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"p"}
+ },
+ FTrgTouchArea { touchArea:nav.q; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"q"}
+ },
+ FTrgTouchArea { touchArea:nav.r; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"r"}
+ },
+ FTrgTouchArea { touchArea:nav.s; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"s"}
+ },
+ FTrgTouchArea { touchArea:nav.t; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"t"}
+ },
+ FTrgTouchArea { touchArea:nav.u; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"u"}
+ },
+ FTrgTouchArea { touchArea:nav.v; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"v"}
+ },
+ FTrgTouchArea { touchArea:nav.w; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"w"}
+ },
+ FTrgTouchArea { touchArea:nav.xB; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"x"}
+ },
+ FTrgTouchArea { touchArea:nav.yB; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"y"}
+ },
+ FTrgTouchArea { touchArea:nav.zB; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"z"}
+ },
+ FTrgTouchArea { touchArea:nav.num; touchAction: TA.Out
+ },
+ FTrgTouchArea { touchArea:nav.clr; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= ""}
+ },
+ FTrgTouchArea { touchArea:nav.space; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+" "}
+ },
+ FTrgTouchArea { touchArea:nav.del; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty.substring(0,dataPool.navEnrty.length-1)}
+ },
+ FTrgTouchArea { touchArea:nav.sym; touchAction: TA.Out
+ },
+ FTrgTouchArea { touchArea:nav.go; touchAction: TA.Out
+ FActViewShow { view: "NavInRoute" }
+ },
+ FTrgTouchArea { touchArea:nav.close; touchAction: TA.Out
+ FActViewShow { view: "NavNoRoute" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/NavMenu.qml b/src/components/qt_hmi/References/Look/Views/NavMenu.qml
new file mode 100644
index 0000000000..8d22aa77ea
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/NavMenu.qml
@@ -0,0 +1,85 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FStateView {
+ id:sv
+ priority: 2
+
+ view: FView {
+ //viewClass: baseScreen
+ layout: TileBackLayoutPCA {
+ id:l
+
+
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewItemWidget {
+
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: sourceAM; menuText: "Home"; }
+ FMenuElement { id: sourceFM; menuText: "Work"; }
+ FMenuElement { id: sourceCD; menuText: "Keyboard"; }
+ FMenuElement { id: sourceSat; menuText: "Recent"; }
+ FMenuElement { id: sourceBt; menuText: "Favorites"; }
+ FMenuElement { id: sourceIpod; menuText: "POI"; }
+ FMenuElement { id: sourceUSB; menuText: "Scout"; }
+ FMenuElement { id: sourceLineIn; menuText: "Waze";}
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+ }
+
+ baseBehavior: GenListHandling {}
+
+ triggers: [
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: sourceAM
+ },
+ FTrgMenuElement { menuElement: sourceFM
+ },
+ FTrgMenuElement { menuElement: sourceSat
+ },
+ FTrgMenuElement { menuElement: sourceCD
+ FActViewShow { view: "NavKeyboardPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceBt
+ },
+ FTrgMenuElement { menuElement: sourceIpod
+ },
+ FTrgMenuElement { menuElement: sourceUSB
+ },
+ FTrgMenuElement { menuElement: sourceLineIn
+ },
+ FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
+ FActViewShow { view: "NavNoRoute" }
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEntry {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
+ },
+ FTrgEntryComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
+ },
+ FTrgExit {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
+ },
+ FTrgExitComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml b/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml
new file mode 100644
index 0000000000..0299c182e8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml
@@ -0,0 +1,35 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+
+
+ view: FView {
+ id: v
+
+ layout: NavNoRouteLayout {
+ id:map
+
+
+ }
+
+ }
+
+
+
+ triggers: [
+ FTrgTouchArea { touchArea:map.destSearch; touchAction: TA.Out
+ FActViewShow { view: "NavMenu" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/Off.qml b/src/components/qt_hmi/References/Look/Views/Off.qml
new file mode 100644
index 0000000000..3e75999c66
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/Off.qml
@@ -0,0 +1,34 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 1
+
+ view: FView {
+ layout: OffLayout {
+ id:l
+ }
+ }
+
+ triggers: [
+ FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ FActViewShow { view: "On" }
+ },
+ FTrgTouchArea { touchArea:l.offTouch; touchAction: TA.Out
+ FActViewShow { view: "On" }
+ },
+ /*FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ },*/
+ FTrgEntry {
+ //FActScriptCall { onScript: dataPool.phoneCrnIcons = false}
+ //FActScriptCall { onScript: dataPool.phonePaired = false}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/On.qml b/src/components/qt_hmi/References/Look/Views/On.qml
new file mode 100644
index 0000000000..6e09534309
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/On.qml
@@ -0,0 +1,38 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 1
+
+ view: FView {
+ layout: OffLayout {
+ id:l
+ offTouch.enabled: false
+ }
+ }
+
+ triggers: [
+ FTrgEntry {
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewShow { view: "Off" }
+ },
+ FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ //FActViewShow { view: "Off" }
+ FActEventFire{ event: closeNormalScreens }
+ },
+ FTrgHardwareKey { hardkeys: buttonUp; keyAction: HK.In
+ FActViewShow { view: "ControlMirror" }
+ },
+ FTrgHardwareKey { hardkeys: buttonDown; keyAction: HK.In
+ FActViewShow { view: "ControlMirror" }
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml b/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml
new file mode 100644
index 0000000000..e235f9c159
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml
@@ -0,0 +1,37 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 8
+
+
+ view: FView {
+ id: v
+
+ layout: PCAstatusBarLayout {
+ id:statusBar
+
+ }
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:statusBar.menuTouch; touchAction: TA.Out
+ FActViewShow { view: "GridMenuPCA" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml b/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml
new file mode 100644
index 0000000000..f64062f3ab
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml
@@ -0,0 +1,104 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+
+FStateView {
+ priority: 2
+ view: FView {
+ layout: PhoneContactsLayout {
+ id:l
+ list_data:phoneItemData
+ list_itemWidget: PhoneContactListItemWdgt {
+ itemClicked: childClicked
+
+ }
+ }
+ }
+
+ FEvent {id: browseSelected}
+
+ ListModel
+ {
+
+ id:phoneItemData
+ ListElement { staticItem: "Aaron" ; staticNumber:"(614)555-2444";type:"Mobile"}
+ ListElement { staticItem: "Adrian" ; staticNumber:"(740)245-3434";type:"Mobile" }
+ ListElement { staticItem: "Albert" ; staticNumber:"(614)245-5584";type:"Mobile" }
+ ListElement { staticItem: "Alice" ; staticNumber:"(313)878-3566";type:"Office"}
+ ListElement { staticItem: "Alec" ; staticNumber:"(917)608-2418";type:"Mobile"}
+ ListElement { staticItem: "Alexander" ; staticNumber:"(614)608-2400";type:"Home"}
+ ListElement { staticItem: "Alexander" ; staticNumber:"(614)608-2400";type:"Mobile"}
+ ListElement { staticItem: "Amber" ; staticNumber:"(614)608-2111";type:"Mobile"}
+ ListElement { staticItem: "Amy" ; staticNumber:"(440)245-3434";type:"Mobile" }
+ ListElement { staticItem: "Andy" ; staticNumber:"(313)245-3434";type:"Mobile" }
+ ListElement { staticItem: "Antje" ; staticNumber:"(567)245-3434";type:"Home" }
+ ListElement { staticItem: "Barry" ; staticNumber:"(313)555-2211";type:"Mobile" }
+ ListElement { staticItem: "Bea" ; staticNumber:"(614)455-3434";type:"Mobile" }
+ ListElement { staticItem: "Ben" ; staticNumber:"(614)882-1843";type:"Office" }
+ ListElement { staticItem: "Blake" ; staticNumber:"(330)149-7778";type:"Mobile" }
+ ListElement { staticItem: "Bob Mould" ; staticNumber:"(313)245-3434";type:"Mobile" }
+ ListElement { staticItem: "Brian" ; staticNumber:"(614)332-7499";type:"Mobile" }
+ ListElement { staticItem: "Calvin" ; staticNumber:"(614)442-9974";type:"Mobile" }
+ ListElement { staticItem: "Carl" ; staticNumber:"(567)773-3434";type:"Home" }
+ ListElement { staticItem: "Cat Power" ; staticNumber:"(313)608-3434";type:"Home"}
+ ListElement { staticItem: "Cathy" ; staticNumber:"(313)444-456";type:"Home"}
+ ListElement { staticItem: "Chris" ; staticNumber:"(734)997-6514";type:"Home" }
+ ListElement { staticItem: "Cloud Nothings"; staticNumber:"(444)608-543";type:"Mobile"}
+ ListElement { staticItem: "Cody" ; staticNumber:"(567)365-8413";type:"Home" }
+ ListElement { staticItem: "Curtis" ; staticNumber:"(614)245-1547";type:"Office" }
+ ListElement { staticItem: "Dakota" ; staticNumber:"(567)555-4444";type:"Home" }
+ ListElement { staticItem: "Dale" ; staticNumber:"(567)723-1974";type:"Mobile" }
+ ListElement { staticItem: "Dallas"; staticNumber:"(614)556-879";type:"Home"}
+ ListElement { staticItem: "Damian" ; staticNumber:"(614)245-3434";type:"Office" }
+ ListElement { staticItem: "Daniel"; staticNumber:"(614)556-879";type:"Home"}
+ ListElement { staticItem: "Darina"; staticNumber:"(313)895-888";type:"Mobile"}
+ ListElement { staticItem: "Dee "; staticNumber:"(313)432-3434";type:"Home"}
+ ListElement { staticItem: "Edward" ; staticNumber:"(917)608-975";type:"Office"}
+ ListElement { staticItem: "Ferdinand" ; staticNumber:"(917)879-795";type:"Mobile"}
+ ListElement { staticItem: "Gomez" ; staticNumber:"(313)455-543";type:"Mobile"}
+ ListElement { staticItem: "Harry Potter"; staticNumber:"(313)888-432";type:"Home"}
+ ListElement { staticItem: "Ivan"; staticNumber:"(313)996-225";type:"Home"}
+ ListElement { staticItem: "James" ; staticNumber:"(917)608-3434";type:"Mobile"}
+ ListElement { staticItem: "Karen"; staticNumber:"(313)998-332";type:"Home"}
+ ListElement { staticItem: "Luis Torres"; staticNumber:"(313)779-111";type:"Home"}
+ ListElement { staticItem: "Mary"; staticNumber:"(313)234-098";type:"Mobile"}
+ ListElement { staticItem: "Neil"; staticNumber:"(313)444-112";type:"Mobile"}
+ ListElement { staticItem: "Oswald"; staticNumber:"(313)456-921";type:"Mobile"}
+ ListElement { staticItem: "Oscar"; staticNumber:"(313)332-778";type:"Home"}
+ ListElement { staticItem: "Patrice"; staticNumber:"(313)789-111";type:"Mobile"}
+ ListElement { staticItem: "Queen Elizabeth"; staticNumber:"(313)897-666";type:"Mobile"}
+ ListElement { staticItem: "Rose"; staticNumber:"(313)111-211";type:"Mobile"}
+ ListElement { staticItem: "Susell"; staticNumber:"(313)345-122";type:"Home"}
+ ListElement { staticItem: "Susell"; staticNumber:"(313)345-122";type:"Home"}
+ ListElement { staticItem: "Thomas"; staticNumber:"(917)608-342";type:"Mobile"}
+ ListElement { staticItem: "Titus Andronicus" ; staticNumber:"(917)608-321";type:"Office"}
+ ListElement { staticItem: "Toretto" ; staticNumber:"(917)608-3434";type:"Home"}
+ ListElement { staticItem: "Uhl" ; staticNumber:"(313)444-654";type:"Office"}
+ ListElement { staticItem: "Zara" ; staticNumber:"(313)231-009";type:"Mobile"}
+
+ }
+ FEvent { id: childClicked }
+
+ triggers:[
+ FTrgEntry {
+ FActScriptCall{onScript: l.list.positionViewAtIndex(sortList.existChar(phoneItemData,dataPool.filterPhone),l.list.Beginning)}
+ },
+ FTrgTouchArea { touchArea:l.back; touchAction: TA.Out
+ FActViewShow { view: "AlphaSortPCA" }
+ },
+ FTrgEvent { id: trig2; event: childClicked
+ FActScriptCall { onScript:console.log(trig2.data) }
+ }
+
+
+
+ ]
+
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Views/PhonePCA.qml b/src/components/qt_hmi/References/Look/Views/PhonePCA.qml
new file mode 100644
index 0000000000..40969a3a64
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/PhonePCA.qml
@@ -0,0 +1,85 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FStateView {
+ id:sv
+ priority: 2
+
+ view: FView {
+ //viewClass: baseScreen
+ layout: TileBackImgLayoutPCA {
+ id:l
+
+ //useClose: true
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewImgItemWidget {
+
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: phone; menuIcon: "menu/phone.png"}
+ FMenuElement { id: dnd; menuIcon: "phone/DNDoff.png" }
+ FMenuElement { id: phoneBook; menuIcon: "phone/contacts.png" }
+ FMenuElement { id: recent; menuIcon: "phone/recent.png" }
+ FMenuElement { id: messages; menuIcon: "phone/messages.png" }
+ FMenuElement { id: keyPad; menuIcon: "phone/keypad.png" }
+ FMenuElement { id: textMsg; menuIcon: "phone/texts.png" }
+ FMenuElement { id: more; menuIcon: "phone/more.png"}
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+ }
+
+ baseBehavior: GenListHandling {}
+
+ triggers: [
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: phone
+ },
+ FTrgMenuElement { menuElement: dnd
+ },
+ FTrgMenuElement { menuElement: phoneBook
+ FActViewShow { view: "AlphaSortPCA" }
+ },
+ FTrgMenuElement { menuElement: recent
+ },
+ FTrgMenuElement { menuElement: more
+ },
+ FTrgMenuElement { menuElement: messages
+ },
+ FTrgMenuElement { menuElement: keyPad
+ },
+ FTrgMenuElement { menuElement: textMsg
+ },
+ FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
+ FActViewShow { view: "GridMenuPCA" }
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEntry {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
+ },
+ FTrgEntryComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
+ },
+ FTrgExit {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
+ },
+ FTrgExitComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml b/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml
new file mode 100644
index 0000000000..ef693d924c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml
@@ -0,0 +1,37 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 0
+
+ view: FView {
+ layout: BlankLayout {
+ id:l
+ }
+ }
+
+ triggers: [
+ FTrgEntry {
+ FGrdCondition{ condition: dataPool.currSource==="FM"
+ FActViewShow{ view: "FMPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="USB"
+ FActViewShow{ view: "USB"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="AM"
+ FActViewShow{ view: "AM"}
+ FActViewHide{}
+ }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml b/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml
new file mode 100644
index 0000000000..90bf0a801a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml
@@ -0,0 +1,61 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 0
+
+ view: FView {
+ layout: BlankLayout {
+ id:l
+ }
+ }
+
+ triggers: [
+ FTrgEntry {
+ FGrdCondition{ condition: dataPool.currSource==="FM"
+ FActViewShow{ view: "FMPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="USB"
+ FActViewShow{ view: "USBPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="AM"
+ FActViewShow{ view: "AMPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="Sirius"
+ FActViewShow{ view: "SiriusPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="CD"
+ FActViewShow{ view: "CDPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="BT_Audio"
+ FActViewShow{ view: "BT_AudioPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="iPod"
+ FActViewShow{ view: "iPodPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="LineIn"
+ FActViewShow{ view: "AuxPCA"}
+ FActViewHide{}
+ }
+ FGrdCondition{ condition: dataPool.currSource==="SDL_Music"
+ FActViewShow{ view: "SDL_MusicPCA"}
+ FActViewHide{}
+ }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml b/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml
new file mode 100644
index 0000000000..a68956518b
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml
@@ -0,0 +1,48 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: USBLayoutPCA {
+ id:home
+ sourceBtn.text: "SDL Music"
+ sourceBtn.textWidth: 100
+ playing: true
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = false }
+ },
+ FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = true }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/Sirius.qml b/src/components/qt_hmi/References/Look/Views/Sirius.qml
new file mode 100644
index 0000000000..bf16b810a5
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/Sirius.qml
@@ -0,0 +1,71 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: SiriusLayout {
+ id:home
+
+ }
+
+
+ }
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChange" }
+ },
+ FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.tuneBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml b/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml
new file mode 100644
index 0000000000..afb5c42fc7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml
@@ -0,0 +1,115 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: FMLayoutPCA {
+ id:home
+ sourceBtn.text: "Sirius"
+ sourceBtn.textWidth: 70
+ freqId: ""
+ curPreset: dataPool.currSATpreset
+ hdBtn.visible: false
+
+
+ listModel: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ }
+
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: preset1; menuText: "Lithium"; menuData: true; }
+ FMenuElement { id: preset2; menuText: "Spectrum"; menuData: false }
+ FMenuElement { id: preset3; menuText: "ESPN"; menuData: false }
+ FMenuElement { id: preset4; menuText: "Alt Nation"; menuData: false }
+ FMenuElement { id: preset5; menuText: "NHL"; menuData: false }
+ FMenuElement { id: preset6; menuText: "the Highway"; menuData: false }
+ FMenuElement { id: preset7; menuText: "SiriusXMU"; menuData: false }
+ FMenuElement { id: preset8; menuText: "First Wave"; menuData: false}
+ }
+ }
+
+ triggers: [
+
+ FTrgEntry{
+ FGrdCondition{condition: dataPool.currSATpreset === 1
+ FActScriptCall { onScript: home.stationTxt = "Lithium" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 2
+ FActScriptCall { onScript: home.stationTxt = "Spectrum" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 3
+ FActScriptCall { onScript: home.stationTxt = "ESPN" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 4
+ FActScriptCall { onScript: home.stationTxt = "Alt Nation" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 5
+ FActScriptCall { onScript: home.stationTxt = "NHL" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 6
+ FActScriptCall { onScript: home.stationTxt = "the Highway" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 7
+ FActScriptCall { onScript: home.stationTxt = "SiriusXMU" }
+ }
+ FGrdCondition{condition: dataPool.currSATpreset === 8
+ FActScriptCall { onScript: home.stationTxt = "First Wave" }
+ }
+ },
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgMenuElement { menuElement: preset1
+ FActScriptCall { onScript: home.stationTxt = "Lithium" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 1 }
+ },
+ FTrgMenuElement { menuElement: preset2
+ FActScriptCall { onScript: home.stationTxt = "Spectrum" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 2 }
+ },
+ FTrgMenuElement { menuElement: preset3
+ FActScriptCall { onScript: home.stationTxt = "ESPN" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 3 }
+ },
+ FTrgMenuElement { menuElement: preset4
+ FActScriptCall { onScript: home.stationTxt = "Alt Nation" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 4 }
+ },
+ FTrgMenuElement { menuElement: preset5
+ FActScriptCall { onScript: home.stationTxt = "NHL" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 5 }
+ },
+ FTrgMenuElement { menuElement: preset6
+ FActScriptCall { onScript: home.stationTxt = "the Highway" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 6 }
+ },
+ FTrgMenuElement { menuElement: preset7
+ FActScriptCall { onScript: home.stationTxt = "SiriusXMU" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 7 }
+ },
+ FTrgMenuElement { menuElement: preset8
+ FActScriptCall { onScript: home.stationTxt = "First Wave" }
+ FActScriptCall { onScript: dataPool.currSATpreset = 8 }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/SourceChange.qml b/src/components/qt_hmi/References/Look/Views/SourceChange.qml
new file mode 100644
index 0000000000..42680f9e80
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/SourceChange.qml
@@ -0,0 +1,73 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: TileBackLayout {
+ id:source
+ button1.text: "AM"
+ button2.text: "FM"
+ button3.text: "Sirius"
+ button4.text: "USB"
+ button5.text: "BT Audio"
+ button6.text: "Line In"
+ button7.vis: false
+ button8.vis: false
+ }
+
+
+ }
+
+ triggers: [
+
+
+ /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ FActEventFire { event: closeNormalScreens }
+ FActViewShow { view: "Off" }
+ },*/
+ FTrgTouchArea { touchArea:source.button1; touchAction: TA.Out
+ FActScriptCall { onScript: dataPool.currSource = "AM" }
+ FActViewShow { view: "RadioEventHandling" }
+ },
+ FTrgTouchArea { touchArea:source.button2; touchAction: TA.Out
+ FActViewShow { view: "FM" }
+ },
+ FTrgTouchArea { touchArea:source.button3; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:source.button4; touchAction: TA.Out
+ FActViewShow { view: "USB" }
+ },
+ FTrgTouchArea { touchArea:source.button5; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:source.button6; touchAction: TA.Out
+ FActViewShow { view: "RadioEventHandling" }
+ },
+ FTrgTouchArea { touchArea:source.button7; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:source.button8; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:source.backBtn; touchAction: TA.Out
+ FActViewShow { view: "RadioEventHandling" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml b/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
new file mode 100644
index 0000000000..bb87d41c2c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
@@ -0,0 +1,105 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+
+FStateView {
+ id:sv
+ priority: 2
+
+ view: FView {
+ //viewClass: baseScreen
+ layout: TileBackLayoutPCA {
+ id:l
+
+
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewItemWidget {
+
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: sourceAM; menuText: "AM"; }
+ FMenuElement { id: sourceFM; menuText: "FM"; }
+ FMenuElement { id: sourceSat; menuText: "Sirius"; }
+ FMenuElement { id: sourceCD; menuText: "CD"; }
+ FMenuElement { id: sourceBt; menuText: "BT Audio"; }
+ FMenuElement { id: sourceIpod; menuText: "iPod"; }
+ FMenuElement { id: sourceUSB; menuText: "USB"; }
+ FMenuElement { id: sourceLineIn; menuText: "Line In";}
+ FMenuElement { id: sourceSDL; menuText: "SDL Music";}
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+ }
+
+ baseBehavior: GenListHandling {}
+
+ triggers: [
+ // Example for a menu element trigger. This will only work for FMenuModels.
+ FTrgMenuElement { menuElement: sourceAM
+ FActScriptCall { onScript: dataPool.currSource = "AM" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceFM
+ FActScriptCall { onScript: dataPool.currSource = "FM" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceSat
+ FActScriptCall { onScript: dataPool.currSource = "Sirius" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceCD
+ FActScriptCall { onScript: dataPool.currSource = "CD" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceBt
+ FActScriptCall { onScript: dataPool.currSource = "BT_Audio" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceIpod
+ FActScriptCall { onScript: dataPool.currSource = "iPod" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceUSB
+ FActScriptCall { onScript: dataPool.currSource = "USB" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceLineIn
+ FActScriptCall { onScript: dataPool.currSource = "LineIn" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgMenuElement { menuElement: sourceSDL
+ FActScriptCall { onScript: dataPool.currSource = "SDL_Music" }
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
+ FActViewShow { view: "RadioEventHandlingPCA" }
+ },
+ FTrgListModel { id: trgList; model: menuItemData
+ FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
+ },
+ FTrgEntry {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
+ },
+ FTrgEntryComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
+ },
+ FTrgExit {
+ FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
+ },
+ FTrgExitComplete {
+ FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/Start.qml b/src/components/qt_hmi/References/Look/Views/Start.qml
new file mode 100644
index 0000000000..4858474011
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/Start.qml
@@ -0,0 +1,43 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: StartLayout {
+ id:corner
+
+ }
+
+
+ }
+
+ triggers: [
+ FTrgEntry {
+
+ },
+
+ /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
+ FActEventFire { event: closeNormalScreens }
+ FActViewShow { view: "Off" }
+ },*/
+ FTrgTouchArea { touchArea:corner.button1; touchAction: TA.Out
+ FActViewShow { view: "Home" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/USB.qml b/src/components/qt_hmi/References/Look/Views/USB.qml
new file mode 100644
index 0000000000..8931d61ff8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/USB.qml
@@ -0,0 +1,59 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: USBLayout {
+ id:home
+
+ }
+
+
+ }
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChange" }
+ },
+ FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.seekBkBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.seekFdBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.playBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.shuffleBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgTouchArea { touchArea:home.repeatBtn; touchAction: TA.Out
+ FActViewShow { view: "Start" }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/USBPCA.qml b/src/components/qt_hmi/References/Look/Views/USBPCA.qml
new file mode 100644
index 0000000000..0b1b47270e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/USBPCA.qml
@@ -0,0 +1,49 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+
+ view: FView {
+ id: v
+
+ layout: USBLayoutPCA {
+ id:home
+ sourceBtn.text: "USB"
+ sourceBtn.textWidth: 50
+ playing: true
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = false }
+ },
+ FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = true }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Views/iPodPCA.qml b/src/components/qt_hmi/References/Look/Views/iPodPCA.qml
new file mode 100644
index 0000000000..f4d3f68b78
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Views/iPodPCA.qml
@@ -0,0 +1,48 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Layouts"
+import "../Animations"
+import "../Widgets"
+import ".."
+
+FStateView {
+ priority: 2
+ //attachedViews: ["Chrome"]
+
+
+
+ view: FView {
+ id: v
+
+ layout: USBLayoutPCA {
+ id:home
+ sourceBtn.text: "iPod"
+ sourceBtn.textWidth: 50
+ playing: true
+ }
+
+
+ }
+
+
+
+ triggers: [
+
+
+
+ FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
+ FActViewShow { view: "SourceChangePCA" }
+ },
+ FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = false }
+ },
+ FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
+ FActScriptCall { onScript: home.playing = true }
+ },
+ FTrgEvent { event: closeNormalScreens
+ FActViewHide{}
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml
new file mode 100644
index 0000000000..2e89924a20
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml
@@ -0,0 +1,34 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: theLayout
+
+ property alias list : theListView
+ property alias list_itemWidget: theListView.itemWidget
+ property alias list_data: theListView.data
+ property bool listWrap: false
+
+ FWdgtListView {
+ id: theListView
+ anchors.fill: theLayout
+ clip: true
+ //interactive: false
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration: 100
+ highlightMoveVelocity: -1
+ keyNavigationWraps: listWrap
+ highlight:
+ Rectangle {
+ id: focus
+ height: 51
+ width: theLayout.width
+ radius: 10
+ color: "transparent"
+ border { color: "white"; width: 2 }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml
new file mode 100644
index 0000000000..cbe1737984
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml
@@ -0,0 +1,25 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: theItem
+ width: 200
+ height: 178
+
+ property alias bitmap : _img.bitmap
+ property alias touch: _touch
+
+
+ FWdgtImage{
+ id: _img
+ anchors.centerIn: theItem
+ }
+
+ FWdgtTouchArea{
+ id: _touch
+ anchors.fill: theItem
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml
new file mode 100644
index 0000000000..2e7712a65e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml
@@ -0,0 +1,24 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: theItem
+
+ property alias cx_text : _btn.text
+ property int indentLevel: 0
+ property alias touch: _btn.touchBtn
+ property alias pressed: _btn.pressed
+
+
+ TouchButton_PCA{
+ id: _btn
+ anchors.left: theItem.left
+ anchors.leftMargin: 10
+ anchors.top: theItem.top
+ anchors.topMargin: 10
+ textWidth: 100
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml
new file mode 100644
index 0000000000..d5fb962461
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml
@@ -0,0 +1,56 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: theLayout
+
+ property alias list : theGridView
+ property alias list_itemWidget: theGridView.itemWidget
+ property alias list_data: theGridView.data
+ property bool listWrap: false
+ property alias gridItemHeight: theGridView.cellHeight
+ property alias gridItemWidth: theGridView.cellWidth
+
+ FWdgtGridView {
+ id: theGridView
+ anchors.fill: theLayout
+ clip: true
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration: 100
+ keyNavigationWraps: listWrap
+ flow: GridView.TopToBottom
+ snapMode: GridView.SnapOneRow
+
+
+
+
+ populate: Transition {
+ id: populateTransition
+ SequentialAnimation {
+ PropertyAction { property: "opacity"; value: 0 }
+ PauseAnimation { duration: populateTransition.ViewTransition.index * 100 }
+ NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 300 }
+ }
+ }
+
+ add: Transition {
+ NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 200 }
+ }
+
+ addDisplaced: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+
+ remove: Transition {
+ NumberAnimation { properties: "opacity"; from: 1; to: 0; duration: 200 }
+ }
+
+ removeDisplaced: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml
new file mode 100644
index 0000000000..9b28e961f9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml
@@ -0,0 +1,22 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FLayout {
+ id: theItem
+
+ property alias presetName : _preset.presetName
+ property alias presetNumber: _preset.presetNumber
+ property alias pressed: _preset.active
+ property alias touchBtn: _preset.touchBtn
+
+
+ PresetPCA{
+ id: _preset
+ anchors.horizontalCenter: theItem.horizontalCenter
+ anchors.horizontalCenterOffset: 0
+ y:20
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml
new file mode 100644
index 0000000000..82068b5560
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml
@@ -0,0 +1,61 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: theLayout
+
+ property alias list : theGridView
+ property alias list_itemWidget: theGridView.itemWidget
+ property alias list_data: theGridView.data
+ property bool listWrap: false
+ property alias gridItemHeight: theGridView.cellHeight
+ property alias gridItemWidth: theGridView.cellWidth
+ property alias curItem: theGridView.currentIndex
+ property alias moving: theGridView.moving
+ property alias direction: theGridView.flickDeceleration
+
+
+ FWdgtGridView {
+ id: theGridView
+ anchors.fill: theLayout
+ clip: true
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration: 100
+ keyNavigationWraps: listWrap
+ flow: GridView.TopToBottom
+ snapMode: GridView.SnapToRow
+
+
+
+
+
+ /* populate: Transition {
+ id: populateTransition
+ SequentialAnimation {
+ PropertyAction { property: "opacity"; value: 0 }
+ PauseAnimation { duration: populateTransition.ViewTransition.index * 100 }
+ NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 300 }
+ }
+ }
+
+ add: Transition {
+ NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 200 }
+ }
+
+ addDisplaced: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+
+ remove: Transition {
+ NumberAnimation { properties: "opacity"; from: 1; to: 0; duration: 200 }
+ }
+
+ removeDisplaced: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }*/
+
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml
new file mode 100644
index 0000000000..ee2c0369f0
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml
@@ -0,0 +1,50 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+
+ id: theItem
+ height: 50; width: 50
+
+ property alias cx_text: cx.text
+ property alias cn_text: cn.text
+ property alias ct_text: ct.text
+ property alias touch:_touch
+
+ FWdgtTouchArea {
+ id: touch
+ anchors.fill: theItem
+ }
+
+ Item{
+
+
+ BaseText{
+ color:"#9deaec"
+ id: cx
+ width: 100; height: 50
+
+ }
+ BaseText{
+ color:"#9deaec"
+ id: cn
+ width: 302; height: 50
+ x:300
+ }
+
+ BaseText{
+ color:"#9deaec"
+ id: ct
+ width: 302; height: 50
+ x:500
+ }
+
+ }
+ FWdgtTouchArea {
+ id: _touch
+ height: 50; width: 600
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml
new file mode 100644
index 0000000000..c927433f16
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml
@@ -0,0 +1,40 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ width: 800
+ height: 115
+
+ property alias m1: m1.children
+ property alias list: listView
+ property alias list_data: listView.list_data
+ property alias list_itemWidget: listView.list_itemWidget
+ property alias listWrap: listView.listWrap
+ property alias fg: _fg
+ property alias gridCurItem: listView.gridCurItem
+ property alias moving: listView.moving
+ property alias direction: listView.direction
+
+
+
+ Item {
+ id: _fg
+
+ width: 800; height: 115
+
+ GridViewPresetWidget {
+ id: listView
+ x: 0; y: 0
+ width: 800; height: 115
+ gridItemHeight: 115; gridItemWidth: 200
+
+ }
+
+ FWdgtContainer {
+ id: m1
+ width: 676; height: 115
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml
new file mode 100644
index 0000000000..2b832f4878
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml
@@ -0,0 +1,40 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: button
+ property alias active: presetBtn.selected
+ property alias text: presetBtn.text
+ property alias touchBtn: presetBtn
+ property alias presetText: presetTxt.text
+
+
+ TouchButtonClimatePCA{
+ id: presetBtn
+ text: "X"
+ image: "buttons/preset_9_9.png"
+ imageActive: "buttons/presetSelected.png"
+ imagePressed: "buttons/presetPressed_9_9.png"
+ }
+
+ BaseText{
+ id: presetTxt
+ anchors.horizontalCenter: presetBtn.horizontalCenter
+ anchors.horizontalCenterOffset: -16
+ y:59
+ horAlignment: Text.AlignHCenter
+ text: "104.3"
+ color: "#1d81d5"
+ }
+
+ FViewUseCaseSimple{
+ condition: presetBtn.active === true
+ PropertyChanges {
+ target: presetTxt; color: "white"
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml
new file mode 100644
index 0000000000..d2dc8092bd
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml
@@ -0,0 +1,24 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+
+ id: theItem
+ height: 50; width: 50
+ property bool vis: true
+
+ property alias cx_text : cx.text
+
+ Item{
+
+ FWdgtText{
+ color:"White"
+ id: cx
+ width: 302; height: 45
+ visible: vis
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml
new file mode 100644
index 0000000000..7708d3ca56
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml
@@ -0,0 +1,50 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: theItem
+ height: 50; width: parent.width
+
+ property alias cx_text : cx.text
+ property alias cx_width : cx.width
+ property alias ax_width : ax.width
+ property alias ax_bitmap : ax.bitmap
+ property alias activeMarker_visible: activeMarker.visible
+ property alias touch: _touch
+ property int indentLevel: 0
+
+ Rectangle {
+ id: activeMarker
+ anchors.fill: theItem
+ height: 50
+ radius: 10
+ color: "lightgray"
+ }
+
+ Item {
+ x: 1; y: 0
+ width: 502; height: 45
+
+ BaseText {
+ id: cx
+ anchors.fill: parent
+ anchors.leftMargin: 20*indentLevel+5
+ vertAlignment: Text.AlignVCenter
+ }
+ }
+
+ FWdgtImage {
+ id: ax
+ x: 549; y: 3
+ width: 37; height: 45
+ }
+
+ FWdgtTouchArea {
+ id: _touch
+ width: 400
+ height: 50
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
new file mode 100644
index 0000000000..ff6671cef6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
@@ -0,0 +1,97 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: button
+ property string bitmap: ""
+ property bool selected: false
+ property string text: ""
+ property alias touchBtn: myButton
+ property string image: "climate/Button_9_9.png"
+ property string imageActive: "climate/ButtonActive_0_0.png"
+ property string imagePressed: "climate/ButtonPressed_9_9.png"
+ property string imageInActive: "climate/ButtonInActive_0_0.png"
+ property bool active: true
+
+
+ FWdgtImage{
+ id: img
+ x:-9
+ y:-9
+ bitmap: "Radio/PresetBtnNotSelected_9_9.png"
+ }
+
+ FWdgtImage{
+ id: imgSelected
+ x:-9
+ y:-9
+ bitmap: "Radio/PresetBtn_9_9.png"
+ visible: false
+ }
+
+ FWdgtTouchArea {
+ id: myButton
+ anchors.fill: img
+ }
+
+ Rectangle {
+ id: btnFill
+ color: "#1d81d5"
+ anchors.centerIn: myButton
+ height: 46
+ width: 46
+ radius: 23
+ visible: false
+ }
+
+ BaseText {
+ id: btnTxt
+ anchors.centerIn: myButton
+ text: button.text
+ color: "#1d81d5"
+ }
+
+
+ FViewUseCaseSimple{
+ condition: button.selected === true
+ PropertyChanges {
+ target: img; visible: false
+ }
+ PropertyChanges {
+ target: imgSelected; visible: true
+ }
+ PropertyChanges {
+ target: btnTxt; color: "white"
+ }
+ PropertyChanges {
+ target: btnFill; color: "white"
+ }
+ }
+
+
+
+ FViewUseCaseGroup{
+ FViewUseCase{condition: myButton.pressed === true
+ PropertyChanges {
+ target: btnFill; visible: true
+ }
+ PropertyChanges {
+ target: btnTxt; color: "black"
+ }
+ }
+ FViewUseCase{condition: myButton.indicatorState === true
+ /* PropertyChanges {
+ target: buttonArea; color: pressedColor
+ }*/
+ }
+ FViewUseCase{condition: myButton.pressed === false
+ PropertyChanges {
+ target: btnFill; visible: false
+ }
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml
new file mode 100644
index 0000000000..c03f89c184
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml
@@ -0,0 +1,143 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: button
+ property string bitmap: ""
+ property string bitmap2: ""
+ property bool selected: false
+ property alias touchBtn: myButton
+ property string text: ""
+ property string image: "climate/Button_9_9.png"
+ property string imageActive: "climate/ButtonActive_0_0.png"
+ property string imagePressed: "climate/ButtonPressed_9_9.png"
+ property string imageInActive: "climate/ButtonInActive_0_0.png"
+ property bool active: true
+ property string newFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+ property int txtSize: 24
+ property string txtColor: "#1d81d5"
+
+
+ FWdgtImage{
+ id: img
+ x:-9
+ y:-9
+ bitmap: image
+ }
+
+ FWdgtImage{
+ id: imgSelected
+ x:0
+ y:0
+ bitmap: imageActive
+ visible: false
+ }
+
+ FWdgtImage{
+ id: imgInBtn
+ anchors.centerIn: imgSelected
+ bitmap: button.bitmap
+ visible: false
+ //height: 10
+ //width: 10
+ }
+
+ BaseText {
+ id: btnTxt
+ anchors.horizontalCenter: imgSelected.horizontalCenter
+ anchors.verticalCenter: imgSelected.verticalCenter
+ //anchors.verticalCenterOffset: -1
+ vertAlignment: Text.AlignVCenter
+ horAlignment: Text.AlignHCenter
+ text: button.text
+ color: button.txtColor
+ visible: false
+ theFont: button.newFont
+ pxSize: button.txtSize
+
+ }
+
+ FWdgtTouchArea {
+ id: myButton
+ anchors.fill: imgSelected
+ }
+
+
+
+ FViewUseCaseSimple{
+ condition: button.text !== ""
+ PropertyChanges {
+ target: btnTxt; visible: true
+ }
+ }
+
+ FViewUseCaseSimple{
+ condition: button.bitmap !== ""
+ PropertyChanges {
+ target: imgInBtn; visible: true
+ }
+ }
+
+
+ FViewUseCaseGroup{
+ FViewUseCase{condition: myButton.pressed === true
+ PropertyChanges {
+ target: img; bitmap: imagePressed
+ }
+ PropertyChanges {
+ target: btnTxt; color: "black"
+ }
+ PropertyChanges {
+ target: imgInBtn; bitmap: button.bitmap2
+ }
+ }
+ FViewUseCase{
+ condition: button.active === false
+ PropertyChanges {
+ target: img; visible: false
+ }
+ PropertyChanges {
+ target: imgSelected; visible: true; bitmap: imageInActive
+ }
+ PropertyChanges {
+ target: btnTxt; color: "black"
+ }
+ PropertyChanges {
+ target: myButton; enabled: false
+ }
+ PropertyChanges {
+ target: imgInBtn; bitmap: button.bitmap2
+ }
+ }
+ FViewUseCase{
+ condition: button.selected === true
+ PropertyChanges {
+ target: img; visible: false
+ }
+ PropertyChanges {
+ target: imgSelected; visible: true
+ }
+ PropertyChanges {
+ target: btnTxt; color: "black"
+ }
+ PropertyChanges {
+ target: imgInBtn; bitmap: button.bitmap2
+ }
+ }
+ FViewUseCase{condition: myButton.pressed === false
+ PropertyChanges {
+ target: img; bitmap: image
+ }
+ PropertyChanges {
+ target: btnTxt; color: button.txtColor
+ }
+ PropertyChanges {
+ target: imgInBtn; bitmap: button.bitmap
+ }
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml
new file mode 100644
index 0000000000..db963dc752
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml
@@ -0,0 +1,95 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: button
+ property string text: ""
+ property int centerWidth: 2
+ property alias touchBtn: myButton
+ property alias pressed: myButton.pressed
+
+ FWdgtImage{
+ id: img
+ x:-8
+ y:-8
+ bitmap: "Radio/ButtonEnd_8_8.png"
+ }
+
+ FWdgtImage{
+ id: img1
+ anchors.left: img.right
+ anchors.top: img.top
+ width: centerWidth
+ fillMode: Image.Stretch
+ bitmap: "Radio/ButtonCenter_0_8.png"
+ }
+
+ FWdgtImage{
+ id: img2
+ anchors.left: img1.right
+ anchors.top: img1.top
+ bitmap: "Radio/ButtonOtherEnd_8_8.png"
+ }
+
+ FWdgtTouchArea {
+ id: myButton
+ width:img1.width+44
+ height: 46
+ anchors.left: img1.left
+ anchors.leftMargin: -22
+ anchors.top: img1.top
+ anchors.topMargin: 8
+ }
+
+ Rectangle {
+ id: btnFill
+ color: "#1d81d5"
+ anchors.fill: myButton
+ radius: 23
+ border.width: 1
+ border.color: "#1d81d5"
+ visible: false
+ }
+
+ BaseText {
+ id: btnTxt
+ anchors.centerIn: btnFill
+ text: button.text
+ color: "#1d81d5"
+ visible: false
+ }
+
+
+
+ FViewUseCaseSimple{
+ condition: button.text !== ""
+ PropertyChanges {
+ target: btnTxt; visible: true
+ }
+ }
+
+ FViewUseCaseGroup{
+ FViewUseCase{condition: myButton.pressed === true
+ PropertyChanges {
+ target: btnFill; visible: true
+ }
+ PropertyChanges {
+ target: btnTxt; color: "black"
+ }
+ }
+ FViewUseCase{condition: indicatorState === true
+ /* PropertyChanges {
+ target: buttonArea; color: pressedColor
+ }*/
+ }
+ FViewUseCase{condition: myButton.pressed === false
+ PropertyChanges {
+ target: btnFill; visible: false
+ }
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml
new file mode 100644
index 0000000000..35b27c056f
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml
@@ -0,0 +1,325 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+import "../Widgets"
+
+FLayout {
+ id: button
+ property string bitmap: ""
+ property string bitmap2: ""
+ property bool vis: true
+ property string text: ""
+ property string text1: ""
+ property string text2: ""
+ property int centerWidth: 2
+ property alias touchBtn: myButton
+ property int imageShift: 0
+ property alias spacing: btnArea.spacing
+ property alias pressed: myButton.pressed
+ property int curHD: 4
+ property int totHD: 4
+
+ FWdgtImage{
+ id: img
+ x:-8
+ y:-8
+ bitmap: "Radio/ButtonEnd_8_8.png"
+ }
+
+ FWdgtImage{
+ id: img1
+ anchors.left: img.right
+ anchors.top: img.top
+ width: centerWidth
+ fillMode: Image.Stretch
+ bitmap: "Radio/ButtonCenter_0_8.png"
+ }
+
+ FWdgtImage{
+ id: img2
+ anchors.left: img1.right
+ anchors.top: img1.top
+ bitmap: "Radio/ButtonOtherEnd_8_8.png"
+ }
+
+ FWdgtTouchArea {
+ id: myButton
+ width:img1.width+44
+ height: 46
+ anchors.left: img1.left
+ anchors.leftMargin: -22
+ anchors.top: img1.top
+ anchors.topMargin: 8
+
+ }
+
+ Rectangle {
+ id: btnFill
+ color: "#1d81d5"
+ anchors.fill: myButton
+ radius: 23
+ border.width: 1
+ border.color: "#1d81d5"
+ visible: false
+ }
+
+
+ Row {
+ id: btnArea
+ anchors.fill: img1
+ anchors.left: img1.left
+ anchors.leftMargin: imageShift
+ spacing: 2
+
+
+ FWdgtImage{
+ id: btnImg
+ anchors.verticalCenter: btnArea.verticalCenter
+ bitmap: button.bitmap
+ visible: false
+ }
+
+ BaseText {
+ id: btnTxt
+ anchors.verticalCenter: btnArea.verticalCenter
+ text: button.text
+ color: "#1d81d5"
+ visible: false
+ }
+
+ BaseText {
+ id: btnTxt1
+ anchors.verticalCenter: btnArea.verticalCenter
+ text: button.text1
+ color: "white"
+ visible: false
+ theFont: "../Fonts/HelveticaNeueLTStd-Bold.ttf"
+ //boldTx: true
+ }
+
+ BaseText {
+ id: btnTxt2
+ anchors.verticalCenter: btnArea.verticalCenter
+ text: button.text2
+ color: "#1d81d5"
+ visible: false
+ }
+
+
+ }
+
+ FViewUseCaseSimple{
+ condition: button.bitmap !== ""
+ PropertyChanges {
+ target: btnImg; visible: true
+ }
+ }
+
+ FViewUseCaseSimple{
+ condition: button.text !== ""
+ PropertyChanges {
+ target: btnTxt; visible: true
+ }
+ }
+
+ FViewUseCaseSimple{
+ condition: button.text1 !== ""
+ PropertyChanges {
+ target: btnTxt1; visible: true
+ }
+ }
+
+ FViewUseCaseSimple{
+ condition: button.text2 !== ""
+ PropertyChanges {
+ target: btnTxt2; visible: true
+ }
+ }
+
+ FViewUseCaseGroup{
+ FViewUseCase{condition: myButton.pressed === true
+ PropertyChanges {
+ target: btnFill; visible: true
+ }
+ PropertyChanges {
+ target: btnTxt; color: "black"
+ }
+ PropertyChanges {
+ target: btnTxt2; color: "black"
+ }
+ PropertyChanges {
+ target: btnImg; bitmap: button.bitmap2
+ }
+ }
+ FViewUseCase{condition: indicatorState === true
+ /* PropertyChanges {
+ target: buttonArea; color: pressedColor
+ }*/
+ }
+ FViewUseCase{condition: myButton.pressed === false
+ PropertyChanges {
+ target: btnFill; visible: false
+ }
+ }
+ }
+
+
+ FViewUseCaseGroup{
+ FViewUseCase{condition: totHD === -1
+ PropertyChanges {
+ target: button; visible: true
+ }
+ }
+ FViewUseCase{condition: totHD === 0
+ PropertyChanges {
+ target: button; visible: false
+ }
+ }
+ FViewUseCase{condition: totHD === 1
+ PropertyChanges {
+ target: myButton; enabled: false
+ }
+ PropertyChanges {
+ target: btnTxt; text: ""
+ }
+ PropertyChanges {
+ target: btnTxt1; text: ""
+ }
+ PropertyChanges {
+ target: btnTxt2; text: ""
+ }
+ PropertyChanges {
+ target: img1; width: 4
+ }
+ }
+ FViewUseCase{condition: totHD === 2 && curHD === 1
+ PropertyChanges {
+ target: img1; width: 50
+ }
+ PropertyChanges {
+ target: btnTxt; text: ""
+ }
+ PropertyChanges {
+ target: btnTxt1; text: " 1"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: " 2"
+ }
+ }
+ FViewUseCase{condition: totHD === 2 && curHD === 2
+ PropertyChanges {
+ target: img1; width: 50
+ }
+ PropertyChanges {
+ target: btnTxt; text: " 1 "
+ }
+ PropertyChanges {
+ target: btnTxt1; text: "2"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: ""
+ }
+ }
+ FViewUseCase{condition: totHD === 3 && curHD === 1
+ PropertyChanges {
+ target: img1; width: 65
+ }
+ PropertyChanges {
+ target: btnTxt; text: ""
+ }
+ PropertyChanges {
+ target: btnTxt1; text: " 1"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: " 2 3"
+ }
+ }
+ FViewUseCase{condition: totHD === 3 && curHD === 2
+ PropertyChanges {
+ target: img1; width: 65
+ }
+ PropertyChanges {
+ target: btnTxt; text: " 1 "
+ }
+ PropertyChanges {
+ target: btnTxt1; text: "2"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: " 3"
+ }
+ }
+ FViewUseCase{condition: totHD === 3 && curHD === 3
+ PropertyChanges {
+ target: img1; width: 65
+ }
+ PropertyChanges {
+ target: btnTxt; text: " 1 2 "
+ }
+ PropertyChanges {
+ target: btnTxt1; text: "3"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: ""
+ }
+ }
+ FViewUseCase{condition: totHD === 4 && curHD === 1
+ PropertyChanges {
+ target: img1; width: 85
+ }
+ PropertyChanges {
+ target: btnTxt; text: ""
+ }
+ PropertyChanges {
+ target: btnTxt1; text: " 1"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: " 2 3 4"
+ }
+ }
+ FViewUseCase{condition: totHD === 4 && curHD === 2
+ PropertyChanges {
+ target: img1; width: 85
+ }
+ PropertyChanges {
+ target: btnTxt; text: " 1 "
+ }
+ PropertyChanges {
+ target: btnTxt1; text: "2"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: " 3 4"
+ }
+ }
+ FViewUseCase{condition: totHD === 4 && curHD === 3
+ PropertyChanges {
+ target: img1; width: 85
+ }
+ PropertyChanges {
+ target: btnTxt; text: " 1 2 "
+ }
+ PropertyChanges {
+ target: btnTxt1; text: "3"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: " 4"
+ }
+ }
+ FViewUseCase{condition: totHD === 4 && curHD === 4
+ PropertyChanges {
+ target: img1; width: 85
+ }
+ PropertyChanges {
+ target: btnTxt; text: " 1 2 3 "
+ }
+ PropertyChanges {
+ target: btnTxt1; text: "4"
+ }
+ PropertyChanges {
+ target: btnTxt2; text: ""
+ }
+ }
+
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/BaseText.qml b/src/components/qt_hmi/References/Look/Widgets/BaseText.qml
new file mode 100644
index 0000000000..b9bc380bd2
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/BaseText.qml
@@ -0,0 +1,50 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FWdgtText {
+ id: myText
+
+ property bool enabled: true
+ property bool secondary: false
+ property double secondaryOpacity: 0.7
+ property alias horAlignment: myText.horizontalAlignment
+ property alias vertAlignment: myText.verticalAlignment
+ property int pxSize: 24
+ property bool boldTx: false
+ property alias theFont: testFont.source
+
+ color: "white"
+ smooth: true
+
+ property alias style: _styler.style
+
+ FontLoader {
+ id: testFont; source: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
+ }
+
+ font.family: testFont.name
+ font.pixelSize: pxSize
+ font.bold: boldTx
+ //horizontalAlignment: Text.AlignLeft
+ //verticalAlignment: Text.AlignTop
+
+ states: [
+ State {
+ name: "disabled"
+ when: enabled === false
+ PropertyChanges { target:myText; opacity: secondaryOpacity }
+ },
+
+ State {
+ name: "secondary"
+ when: secondary === true
+ PropertyChanges { target:myText; opacity: secondaryOpacity }
+ }
+ ]
+
+ FStyler {
+ id: _styler
+ styleTarget: myText
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/CondText.qml b/src/components/qt_hmi/References/Look/Widgets/CondText.qml
new file mode 100644
index 0000000000..7b8ae4ada6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/CondText.qml
@@ -0,0 +1,14 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+BaseText {
+ FontLoader {
+ id: testFont; source: "../Fonts/HelveticaNeueLTCom-LtCn.ttf"
+ }
+
+ font.family: testFont.name
+ font.pixelSize: 30
+
+ height: 51
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml b/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
new file mode 100644
index 0000000000..082ebdf881
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
@@ -0,0 +1,45 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../WidgetLayouts"
+
+FWidget {
+ property alias focusNext: _focusNext
+ property alias focusPrevious: _focusPrevious
+ property alias selectElement: _selectElement
+
+ property alias list: l.list
+ property alias list_itemWidget: l.list_itemWidget
+ property alias list_data: l.list_data
+ property alias listWrap: l.listWrap
+
+ FEvent { id: _focusNext; }
+ FEvent { id: _focusPrevious; }
+ FEvent { id: _selectElement; }
+
+ layout: FocusListViewLayout {
+ id: l
+ anchors.fill: parent
+ }
+
+ triggers: [
+ FTrgEvent { event: _focusPrevious
+ FActScriptCall { onScript: {
+ l.list.decrementCurrentIndex();
+ }
+ }
+ },
+ FTrgEvent { event: _focusNext
+ FActScriptCall { onScript: {
+ l.list.incrementCurrentIndex();
+ }
+ }
+ },
+ FTrgEvent { event: _selectElement
+ FActScriptCall { onScript: {
+ list_data.selectElement(l.list.currentIndex);
+ }
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml
new file mode 100644
index 0000000000..f76057722a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml
@@ -0,0 +1,31 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+ id: w
+ height: 178
+ width: 200
+
+
+
+ layout: GridViewImgItemLayout {
+ id: l
+ bitmap: menuIcon
+ }
+
+ FViewUseCaseSimple {
+ condition: isEnabled == false
+ PropertyChanges { target: l
+ opacity: 0.5
+ }
+ }
+
+ triggers: [
+ FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
+ FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml
new file mode 100644
index 0000000000..5b81d7e1bc
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml
@@ -0,0 +1,32 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+ id: w
+ height: 55
+ width: 200
+
+
+
+ layout: GridViewItemLayout {
+ id: l
+ cx_text: menuText
+ indentLevel: 0
+ }
+
+ FViewUseCaseSimple {
+ condition: isEnabled == false
+ PropertyChanges { target: l
+ opacity: 0.5
+ }
+ }
+
+ triggers: [
+ FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
+ FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml
new file mode 100644
index 0000000000..fa2cb44918
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml
@@ -0,0 +1,41 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+ id: w
+ height: 115
+ width: 169
+
+ property int currPreset: 0
+ property bool pressed: false
+
+
+
+ layout: GridViewPresetItemLayout {
+ id: l
+ presetName: menuText
+ pressed: w.pressed
+ presetNumber: index + 1
+ }
+
+ FViewUseCaseSimple {
+ condition: isEnabled == false
+ PropertyChanges { target: l
+ opacity: 0.5
+ }
+ }
+
+ FViewUseCaseSimple {
+ condition: w.currPreset===index+1
+ PropertyChanges { target: w; pressed: true}
+ }
+
+ triggers: [
+ FTrgTouchArea { touchArea: l.touchBtn.touchBtn; touchAction: TA.Out
+ FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml
new file mode 100644
index 0000000000..f232bf2c68
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml
@@ -0,0 +1,35 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../WidgetLayouts"
+
+FWidget {
+
+ property alias selectElement: _selectElement
+ property alias list: l.list
+ property alias list_itemWidget: l.list_itemWidget
+ property alias list_data: l.list_data
+ property alias listWrap: l.listWrap
+ property alias gridItemHeight: l.gridItemHeight
+ property alias gridItemWidth: l.gridItemWidth
+ property alias gridCurItem: l.curItem
+ property alias moving: l.moving
+ property alias direction: l.direction
+
+
+ FEvent { id: _selectElement; }
+
+ layout: GridViewPresetLayout {
+ id: l
+ anchors.fill: parent
+ }
+
+ triggers: [
+ FTrgEvent { event: _selectElement
+ FActScriptCall { onScript: {
+ list_data.selectElement(l.list.currentIndex);
+ }
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml
new file mode 100644
index 0000000000..cfbba62530
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml
@@ -0,0 +1,31 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../WidgetLayouts"
+
+FWidget {
+
+ property alias selectElement: _selectElement
+ property alias list: l.list
+ property alias list_itemWidget: l.list_itemWidget
+ property alias list_data: l.list_data
+ property alias listWrap: l.listWrap
+ property alias gridItemHeight: l.gridItemHeight
+ property alias gridItemWidth: l.gridItemWidth
+
+ FEvent { id: _selectElement; }
+
+ layout: GridViewLayout {
+ id: l
+ anchors.fill: parent
+ }
+
+ triggers: [
+ FTrgEvent { event: _selectElement
+ FActScriptCall { onScript: {
+ list_data.selectElement(l.list.currentIndex);
+ }
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml
new file mode 100644
index 0000000000..48b3bff4a6
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml
@@ -0,0 +1,48 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+ id: w
+ height: 50
+
+ layout: TGListItemLayout {
+ id: l
+ anchors.fill: parent
+ ax_bitmap: ""
+ cx_text: menuText
+ activeMarker_visible: false
+ indentLevel: level
+ }
+
+ FViewUseCaseSimple {
+ condition: isEnabled == false
+ PropertyChanges { target: l
+ opacity: 0.5
+ }
+ }
+
+ FViewUseCaseGroup {
+ FViewUseCase {
+ condition: menuType == FMenuElement.Popup
+ PropertyChanges { target: l
+ ax_bitmap: "../Resources/g137p.png"
+ }
+ }
+
+ FViewUseCase {
+ condition: menuType == FMenuElement.Submenu
+ PropertyChanges { target: l
+ ax_bitmap: "../Resources/g136p.png"
+ }
+ }
+ }
+
+ triggers: [
+ FTrgTouchArea { touchArea: l.touch; touchAction: TA.In
+ FActScriptCall { onScript: w.ListView.view.model.selectElement(index) }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml
new file mode 100644
index 0000000000..df96329060
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml
@@ -0,0 +1,60 @@
+// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+ height: 50
+
+ layout: TGListItemLayout {
+ id: l
+ anchors.fill: parent
+ ax_bitmap: ""
+ cx_text: menuItem
+ activeMarker_visible: false
+ }
+
+ FViewUseCaseGroup {
+ FViewUseCase {
+ condition: type === "popup"
+ PropertyChanges { target: l
+ ax_bitmap: "../Resources/g137p.png"
+ }
+
+ }
+
+ FViewUseCase {
+ condition: type === "arrow"
+ PropertyChanges { target: l
+ ax_bitmap: "../Resources/g136p.png"
+ }
+ }
+
+ FViewUseCase {
+ condition: type === "tickboxChecked"
+ PropertyChanges { target: l
+ gx_bitmap: "../Resources/g134p.png"
+ cx_width: ++ax_width
+ }
+ }
+
+ FViewUseCase {
+ condition: type === "tickboxUnchecked"
+ PropertyChanges { target: l
+ gx_bitmap: "../Resources/g135p.png"
+ cx_width: ++ax_width
+ }
+ }
+
+
+ FViewUseCase {
+ condition: type === ""
+ PropertyChanges { target: l
+ visible: true
+ ax_bitmap: ""
+ cx_width: ++(ax_width+gx_width)
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml b/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml
new file mode 100644
index 0000000000..d357c50dc2
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+
+FWidget {
+ id: w
+ height: 50
+
+ property FEvent itemClicked
+
+ layout: PhoneListWdgtLayout {
+ anchors.fill: parent
+ id: l
+ cx_text: staticItem
+ cn_text: staticNumber
+ ct_text: type
+ }
+ triggers: [
+ FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
+ FActEventFire{ event: itemClicked; data: index }
+ FActScriptCall { onScript: console.log(staticItem) }
+ }
+ ]
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml b/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml
new file mode 100644
index 0000000000..a575ff91eb
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+
+ id:pcaButton
+
+ property alias active: button.active
+ property alias presetNumber: button.text
+ property alias presetName: button.presetText
+ property alias touchBtn: button.touchBtn
+
+
+ clip: false
+
+
+
+ layout: PresetPCALayout{
+ id:button
+ }
+
+
+
+}
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml b/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml
new file mode 100644
index 0000000000..b23375f886
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml
@@ -0,0 +1,48 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+
+
+FWidget {
+ id:sv
+ property int currPreset: 2
+ property alias listModel: l.list_data
+ property alias gridCurItem: l.gridCurItem
+ property alias moving: l.moving
+ property alias direction: l.direction
+
+
+ layout: PresetGridLayoutPCA {
+ id:l
+
+
+ listWrap: false
+ list_data: FProxyListModel {
+ id: menuProxy
+ sourceModel: menuItemData
+ }
+ list_itemWidget: GridViewPresetItemWidget {
+ currPreset: sv.currPreset
+ }
+ }
+
+ FMenuModel {
+ id: menuItemData
+ FMenuElement { id: preset1; menuText: "96.3"; menuData: false; }
+ FMenuElement { id: preset2; menuText: "107.9"; menuData: true }
+ FMenuElement { id: preset3; menuText: "104.3"; menuData: false }
+ FMenuElement { id: preset4; menuText: "101.9"; menuData: false }
+ FMenuElement { id: preset5; menuText: "97.1"; menuData: false }
+ FMenuElement { id: preset6; menuText: "91.7"; menuData: false }
+ FMenuElement { id: preset7; menuText: "101.1"; menuData: false }
+ FMenuElement { id: preset8; menuText: "91.9"; menuData: false}
+ }
+
+ FViewUseCaseSimple { condition: sv.isInEntry
+ PropertyChanges { target: l; list_data: null }
+ }
+
+
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml b/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml
new file mode 100644
index 0000000000..b1f67d043c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml
@@ -0,0 +1,78 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+Item {
+ id: scrollbar
+ property variant target
+
+ clip: true
+
+ //anchors {top: target.top; bottom: target.bottom; right: target.right }
+ visible: (track.height == slider.height) ? false : true //TODO: !visible -> width: 0 (but creates a binding loop)
+
+ Timer {
+ property int scrollAmount
+
+ id: timer
+ repeat: true
+ interval: 20
+ onTriggered: {
+ target.contentY = Math.max(
+ 0, Math.min(
+ target.contentY + scrollAmount,
+ target.contentHeight - target.height));
+ }
+ }
+
+ MouseArea {
+ anchors.fill: scrollbar
+ onPressed: {
+ timer.scrollAmount = target.height * (mouseY < slider.y ? -1 : 1) // scroll by a page
+ timer.running = true;
+ }
+ onReleased: {
+ timer.running = false;
+ }
+ }
+
+ Rectangle {
+ id: track
+
+ color: "red"
+ opacity: 0.3
+ radius: 2
+ smooth: true
+
+ anchors.top: scrollbar.top
+ anchors.bottom: scrollbar.bottom
+ anchors.horizontalCenter: scrollbar.horizontalCenter
+ width: 3
+ }
+
+ Rectangle {
+ id:slider
+
+ width: scrollbar.width
+ color: "red"
+ opacity: 0.7
+ radius: 4
+ smooth: true
+
+ height: Math.min(target.height / target.contentHeight * track.height, track.height)
+ y: target.visibleArea.yPosition * track.height
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent
+ drag.axis: Drag.YAxis
+ drag.minimumY: 0
+ drag.maximumY: track.height - height
+
+ onPositionChanged: {
+ if (pressedButtons == Qt.LeftButton) {
+ target.contentY = slider.y * target.contentHeight / track.height
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml
new file mode 100644
index 0000000000..c05e1ab525
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml
@@ -0,0 +1,77 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+
+FWdgtTouchArea {
+ id: button
+
+ property string text: "Text"
+ property string bitmap: ""
+ property int wrapText: Text.NoWrap
+ property bool indicatorState: false
+ property string unpressedColor: "gray"
+ property string pressEventColor: "lightGray"
+ property string pressedColor: "darkGray"
+ property bool vis: true
+
+
+ width: 120
+ height: 40
+ enabled: button.vis
+
+
+
+ Rectangle {
+ id: buttonArea
+ radius: 10
+ anchors.centerIn: parent
+ width: button.width
+ height: button.height
+ color: "gray"
+ visible: button.vis
+
+ BaseText {
+ id: st
+ anchors.centerIn: parent
+ text: button.text
+ wrapMode: wrapText
+ visible: button.vis
+ }
+
+ FWdgtImage{
+ id: img
+ anchors.fill: buttonArea
+ bitmap: button.bitmap
+ visible: false
+ }
+
+
+ }
+
+ FViewUseCaseSimple{
+ condition: button.bitmap !== ""
+ PropertyChanges {
+ target: img; visible: true
+ }
+ }
+
+ FViewUseCaseGroup{
+ FViewUseCase{condition: pressed === true
+ PropertyChanges {
+ target: buttonArea; color: pressEventColor
+ }
+ }
+ FViewUseCase{condition: indicatorState === true
+ PropertyChanges {
+ target: buttonArea; color: pressedColor
+ }
+ }
+ FViewUseCase{condition: pressed === false
+ PropertyChanges {
+ target: buttonArea; color: unpressedColor
+ }
+ }
+ }
+
+}
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml
new file mode 100644
index 0000000000..2f3ca939a2
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import QtGraphicalEffects 1.0
+import "../Widgets"
+
+
+
+Item {
+ width: 160
+ height: 45
+
+ RectangularGlow {
+ id: effect
+ anchors.fill: rect
+ glowRadius: 10
+ spread: 0.2
+ color: "#1d81d5"
+ cornerRadius: rect.radius + glowRadius
+ }
+
+ Rectangle {
+ id: rect
+ color: "black"
+ anchors.centerIn: parent
+ width: 160
+ height: 45
+ radius: 25
+ border.color: "#1d81d5"
+ }
+}
+
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml
new file mode 100644
index 0000000000..6dbd6b125b
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+
+ id:pcaButton
+
+ property alias bitmap:button.bitmap
+ property alias active: button.selected
+ property alias text: button.text
+ property alias touchBtn: button.touchBtn
+
+
+ clip: false
+
+
+
+ layout: TouchButtonBackGroundPCALayout{
+ id:button
+ }
+
+
+
+}
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml
new file mode 100644
index 0000000000..401e538201
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+
+ id:pcaButton
+
+ property alias bitmap: button.bitmap
+ property alias bitmap2: button.bitmap2
+ property alias selected: button.selected
+ property alias touchBtn: button.touchBtn
+ property alias text: button.text
+ property alias image: button.image
+ property alias imageActive: button.imageActive
+ property alias imagePressed: button.imagePressed
+ property alias imageInActive: button.imageInActive
+ property alias active: button.active
+ property alias newFont: button.newFont
+ property alias txtSize: button.txtSize
+ property alias txtColor: button.txtColor
+
+
+ height: 80
+ width: 80
+ clip: false
+
+
+
+ layout: TouchButtonClimatePCALayout{
+ id:button
+ }
+
+
+
+}
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml
new file mode 100644
index 0000000000..e48c5f2762
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+
+ id:pcaButton
+
+ property alias bitmap:button.bitmap
+ property alias bitmap2: button.bitmap2
+ property alias text: button.text
+ property alias text1: button.text1
+ property alias text2:button.text2
+ property alias textWidth: button.centerWidth
+ property alias touchBtn: button.touchBtn
+ property alias imageShift: button.imageShift
+ property alias spacing: button.spacing
+ property alias pressed: button.pressed
+ property alias curHD: button.curHD
+ property alias totHD: button.totHD
+ width: 164
+ clip: false
+
+
+
+ layout: TouchButtonPCASpecialLayout{
+ id:button
+ }
+
+
+
+}
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml
new file mode 100644
index 0000000000..e46dbf28c5
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+FWidget {
+
+ id:pcaButton
+
+
+ property alias text: button.text
+ property alias textWidth: button.centerWidth
+ property alias touchBtn: button.touchBtn
+ property alias pressed: button.pressed
+ width: textWidth+44
+ clip: false
+
+
+
+ layout: TouchButtonPCALayout{
+ id:button
+ }
+
+
+
+}
+
diff --git a/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml
new file mode 100644
index 0000000000..42049240fd
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+import "../Widgets"
+import "../WidgetLayouts"
+
+
+FWidget {
+ id: w
+ height: 50
+ property alias vis: l.vis
+
+ layout: SimpleItemWdgLayout {
+ anchors.fill: parent
+ id: l
+ cx_text: staticItem
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb
new file mode 100644
index 0000000000..b6a4d31838
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes
new file mode 100644
index 0000000000..b03753aa5c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes
@@ -0,0 +1,682 @@
+import QtQuick.tooling 1.1
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated with the command 'C:\Qt\Qt5.0.1\5.0.1\msvc2010\bin\qmlplugindump.exe -notrelocatable com.ford.hmiframework 1.0 C:\HMIRepository\trunk\Framework\QtHMIFramework\output'.
+
+Module {
+ Component {
+ name: "FAbstractListElement"
+ prototype: "QObject"
+ exports: ["com.ford.hmiframework/FAbstractListElement 1.0"]
+ Signal {
+ name: "elementSelected"
+ Parameter { name: "element"; type: "FAbstractListElement"; isPointer: true }
+ }
+ Method { name: "selectElement" }
+ }
+ Component {
+ name: "FAbstractListModel"
+ prototype: "QAbstractListModel"
+ exports: ["com.ford.hmiframework/FAbstractListModel 1.0"]
+ Signal {
+ name: "elementSelected"
+ Parameter { type: "FAbstractListElement"; isPointer: true }
+ Parameter { type: "int" }
+ }
+ }
+ Component {
+ name: "FActAnimControl"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActAnimControl 1.0"]
+ Property { name: "animation"; type: "FAnimation"; isPointer: true }
+ Property { name: "animAction"; type: "int" }
+ }
+ Component {
+ name: "FActEventFire"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActEventFire 1.0"]
+ Property { name: "event"; type: "FEvent"; isPointer: true }
+ Property { name: "data"; type: "QVariant" }
+ }
+ Component {
+ name: "FActFunction"
+ defaultProperty: "actions"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActFunction 1.0"]
+ Property { name: "data"; type: "QVariant" }
+ Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "FActFunctionCall"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActFunctionCall 1.0"]
+ Property { name: "func"; type: "FActFunction"; isPointer: true }
+ Property { name: "data"; type: "QVariant" }
+ }
+ Component {
+ name: "FActHistoryClear"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActHistoryClear 1.0"]
+ Property { name: "queue"; type: "string" }
+ }
+ Component {
+ name: "FActHistoryPop"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActHistoryPop 1.0"]
+ Property { name: "queue"; type: "string" }
+ }
+ Component {
+ name: "FActHistoryPush"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActHistoryPush 1.0"]
+ Property { name: "queue"; type: "string" }
+ Property { name: "animation"; type: "string" }
+ Property { name: "data"; type: "QVariant" }
+ }
+ Component {
+ name: "FActHistoryShow"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActHistoryShow 1.0"]
+ Property { name: "queue"; type: "string" }
+ Property { name: "animation"; type: "string" }
+ Property { name: "skipMe"; type: "bool" }
+ }
+ Component {
+ name: "FActViewHide"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActViewHide 1.0"]
+ Property { name: "view"; type: "string" }
+ Property { name: "animation"; type: "string" }
+ }
+ Component {
+ name: "FActViewShow"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FActViewShow 1.0"]
+ Property { name: "view"; type: "string" }
+ Property { name: "animation"; type: "string" }
+ Property { name: "data"; type: "QVariant" }
+ }
+ Component {
+ name: "FAction"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FAction 1.0"]
+ Property { name: "passed"; type: "bool" }
+ Signal { name: "execute" }
+ Method { name: "getDisplay"; type: "FDisplay*" }
+ Method { name: "getStateView"; type: "FStateView*" }
+ }
+ Component {
+ name: "FAnimView"
+ defaultProperty: "data"
+ prototype: "FAnimation"
+ exports: ["com.ford.hmiframework/FAnimView 1.0"]
+ Property { name: "inView"; type: "FStateView"; isPointer: true }
+ Property { name: "outView"; type: "FStateView"; isPointer: true }
+ Property { name: "ingoing"; type: "FLayout"; isReadonly: true; isPointer: true }
+ Property { name: "outgoing"; type: "FLayout"; isReadonly: true; isPointer: true }
+ }
+ Component {
+ name: "FAnimation"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["com.ford.hmiframework/FAnimation 1.0"]
+ Property { name: "isRunning"; type: "bool"; isReadonly: true }
+ Signal {
+ name: "animationComplete"
+ Parameter { name: "anim"; type: "FAnimation"; isPointer: true }
+ }
+ }
+ Component {
+ name: "FAnimationCoordinator"
+ defaultProperty: "defaultAnims"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FAnimationCoordinator 1.0"]
+ Property { name: "defaultAnims"; type: "FDefaultAnimation"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "FDefaultAnimation"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FDefaultAnimation 1.0"]
+ Property { name: "from"; type: "FViewClass"; isPointer: true }
+ Property { name: "to"; type: "FViewClass"; isPointer: true }
+ Property { name: "animation"; type: "string" }
+ }
+ Component {
+ name: "FDisplay"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["com.ford.hmiframework/FDisplay 1.0"]
+ Property { name: "xPixel"; type: "int" }
+ Property { name: "yPixel"; type: "int" }
+ Property { name: "initialView"; type: "string" }
+ Property { name: "initialAnim"; type: "string" }
+ Property { name: "modelPath"; type: "QUrl" }
+ Property { name: "activeVariant"; type: "string" }
+ Property { name: "priorityLayerCount"; type: "int" }
+ Property { name: "minPriority"; type: "int" }
+ Property { name: "priorityLayerDebug"; type: "QStringList"; isReadonly: true }
+ Property { name: "viewCacheSize"; type: "int" }
+ Signal { name: "preStartInit" }
+ Method {
+ name: "animationCompleted"
+ Parameter { type: "FAnimation"; isPointer: true }
+ }
+ Method { name: "updateDebugInformation" }
+ }
+ Component {
+ name: "FEvent"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FEvent 1.0"]
+ Signal {
+ name: "fire"
+ Parameter { name: "data"; type: "QVariant" }
+ }
+ Method {
+ name: "doFire"
+ Parameter { name: "data"; type: "QVariant" }
+ }
+ }
+ Component {
+ name: "FGrdCondition"
+ defaultProperty: "actions"
+ prototype: "FGuard"
+ exports: ["com.ford.hmiframework/FGrdCondition 1.0"]
+ Property { name: "condition"; type: "bool" }
+ }
+ Component {
+ name: "FGuard"
+ defaultProperty: "actions"
+ prototype: "FAction"
+ exports: ["com.ford.hmiframework/FGuard 1.0"]
+ Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "FHardwareControl"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["com.ford.hmiframework/FHardwareControl 1.0"]
+ Property { name: "hardwareControlID"; type: "string" }
+ Signal {
+ name: "checkKeyPressed"
+ Parameter { name: "key"; type: "int" }
+ }
+ Signal {
+ name: "checkKeyReleased"
+ Parameter { name: "key"; type: "int" }
+ }
+ Method {
+ name: "sendHardwareControlEvent"
+ Parameter { name: "data"; type: "int" }
+ }
+ }
+ Component {
+ name: "FHardwareKey"
+ defaultProperty: "data"
+ prototype: "FHardwareControl"
+ exports: ["com.ford.hmiframework/FHardwareKey 1.0"]
+ Property { name: "pressed"; type: "bool" }
+ Property { name: "keyboardKey"; type: "int" }
+ Property { name: "longPressMSec"; type: "int" }
+ Property { name: "repeatDelayMSec"; type: "int" }
+ Property { name: "repeatIntervalMSec"; type: "int" }
+ }
+ Component {
+ name: "FHardwareRotary"
+ defaultProperty: "knob"
+ prototype: "FHardwareControl"
+ exports: ["com.ford.hmiframework/FHardwareRotary 1.0"]
+ Property { name: "knob"; type: "QQuickItem"; isPointer: true }
+ Property { name: "stepsPerRotation"; type: "int" }
+ Property { name: "currentAbsPosition"; type: "int" }
+ Property { name: "currentRelPosition"; type: "int" }
+ Property { name: "generateEvents"; type: "bool" }
+ Property { name: "updateInterval"; type: "int" }
+ }
+ Component {
+ name: "FLayer"
+ defaultProperty: "data"
+ prototype: "FWidgetBase"
+ exports: ["com.ford.hmiframework/FLayer 1.0"]
+ Property { name: "layerID"; type: "int" }
+ Property { name: "initialView"; type: "string" }
+ Property { name: "activeViewName"; type: "string" }
+ }
+ Component {
+ name: "FLayout"
+ defaultProperty: "data"
+ prototype: "FMetaInfoItem"
+ exports: ["com.ford.hmiframework/FLayout 1.0"]
+ Property { name: "viewX"; type: "double" }
+ Property { name: "viewY"; type: "double" }
+ Property { name: "viewZ"; type: "double" }
+ }
+ Component {
+ name: "FLogHandlerItem"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["com.ford.hmiframework/FLogHandlerItem 1.0"]
+ Signal {
+ name: "newEntry"
+ Parameter { name: "s"; type: "string" }
+ }
+ }
+ Component {
+ name: "FLogger"
+ prototype: "QObject"
+ exports: ["com.ford.hmiframework/FLogger 1.0"]
+ Property { name: "perfStamp"; type: "bool" }
+ Method {
+ name: "debug"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "s"; type: "string" }
+ }
+ Method {
+ name: "warning"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "s"; type: "string" }
+ }
+ Method {
+ name: "error"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "s"; type: "string" }
+ }
+ Method {
+ name: "info"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "s"; type: "string" }
+ }
+ Method {
+ name: "perf"
+ Parameter { name: "name"; type: "string" }
+ Parameter { name: "s"; type: "string" }
+ }
+ }
+ Component {
+ name: "FLoggerConsole"
+ prototype: "QObject"
+ exports: ["com.ford.hmiframework/FLoggerConsole 1.0"]
+ }
+ Component {
+ name: "FLoggerFile"
+ prototype: "QObject"
+ exports: ["com.ford.hmiframework/FLoggerFile 1.0"]
+ Property { name: "file"; type: "string" }
+ }
+ Component {
+ name: "FMenuElement"
+ defaultProperty: "children"
+ prototype: "FTreeElement"
+ exports: ["com.ford.hmiframework/FMenuElement 1.0"]
+ Enum {
+ name: "MenuElementType"
+ values: {
+ "Undefined": 0,
+ "Submenu": 1,
+ "Popup": 2,
+ "Hyperlink": 3,
+ "Checkbox": 4,
+ "Radiobutton": 5,
+ "Multistate": 6
+ }
+ }
+ Property { name: "isVisible"; type: "bool" }
+ Property { name: "isEnabled"; type: "bool" }
+ Property { name: "menuType"; type: "int" }
+ Property { name: "menuText"; type: "string" }
+ Property { name: "menuIcon"; type: "string" }
+ Property { name: "menuStatus"; type: "int" }
+ Property { name: "menuData"; type: "QVariant" }
+ }
+ Component {
+ name: "FMenuModel"
+ defaultProperty: "children"
+ prototype: "FTreeModel"
+ exports: ["com.ford.hmiframework/FMenuModel 1.0"]
+ }
+ Component {
+ name: "FMetaInfoItem"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["com.ford.hmiframework/FMetaInfoItem 1.0"]
+ Property { name: "metaInfo"; type: "string" }
+ Property { name: "metaID"; type: "string" }
+ Property { name: "metaVersion"; type: "string" }
+ }
+ Component {
+ name: "FMetaInfoObject"
+ prototype: "QObject"
+ exports: ["com.ford.hmiframework/FMetaInfoObject 1.0"]
+ Property { name: "metaInfo"; type: "string" }
+ Property { name: "metaID"; type: "string" }
+ Property { name: "metaVersion"; type: "string" }
+ }
+ Component {
+ name: "FProxyListModel"
+ prototype: "QIdentityProxyModel"
+ exports: ["com.ford.hmiframework/FProxyListModel 1.0"]
+ Property { name: "sourceModel"; type: "FAbstractListModel"; isPointer: true }
+ Property { name: "isFrozen"; type: "bool" }
+ Signal {
+ name: "elementSelected"
+ Parameter { type: "FAbstractListElement"; isPointer: true }
+ Parameter { type: "int" }
+ }
+ Method {
+ name: "selectElement"
+ Parameter { name: "index"; type: "int" }
+ }
+ }
+ Component {
+ name: "FReactiveElementBase"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FReactiveElementBase 1.0"]
+ Property { name: "triggers"; type: "FTrigger"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "FState"
+ prototype: "FStateBase"
+ exports: ["com.ford.hmiframework/FState 1.0"]
+ Property { name: "baseBehavior"; type: "FStateBase"; isPointer: true }
+ }
+ Component {
+ name: "FStateBase"
+ prototype: "FReactiveElementBase"
+ exports: ["com.ford.hmiframework/FStateBase 1.0"]
+ }
+ Component {
+ name: "FStateView"
+ defaultProperty: "childObjects"
+ prototype: "FState"
+ exports: ["com.ford.hmiframework/FStateView 1.0"]
+ Property { name: "priority"; type: "int" }
+ Property { name: "visualPriority"; type: "int" }
+ Property { name: "view"; type: "FView"; isPointer: true }
+ Property { name: "preload"; type: "QVariant" }
+ Property { name: "attachedViews"; type: "QStringList" }
+ Property { name: "childObjects"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "isInEntry"; type: "bool"; isReadonly: true }
+ Property { name: "isInExit"; type: "bool"; isReadonly: true }
+ Signal {
+ name: "entry"
+ Parameter { name: "previousView"; type: "string" }
+ Parameter { name: "data"; type: "QVariant" }
+ }
+ Signal { name: "entryComplete" }
+ Signal { name: "exit" }
+ Signal { name: "exitComplete" }
+ }
+ Component {
+ name: "FThemeProvider"
+ prototype: "QObject"
+ exports: ["com.ford.hmiframework/FThemeProvider 1.0"]
+ Property { name: "theme"; type: "string" }
+ Property { name: "resourcePath"; type: "QUrl" }
+ Method {
+ name: "getFileSubPath"
+ type: "string"
+ Parameter { type: "string" }
+ }
+ Method {
+ name: "getStyle"
+ type: "FStyle*"
+ Parameter { type: "string" }
+ }
+ Method {
+ name: "applyStyle"
+ Parameter { name: "target"; type: "QObject"; isPointer: true }
+ Parameter { name: "styleName"; type: "string" }
+ }
+ }
+ Component {
+ name: "FTreeElement"
+ defaultProperty: "children"
+ prototype: "FAbstractListElement"
+ exports: ["com.ford.hmiframework/FTreeElement 1.0"]
+ Property { name: "children"; type: "FTreeElement"; isList: true; isReadonly: true }
+ Property { name: "level"; type: "int"; isReadonly: true }
+ Property { name: "isOpened"; type: "bool" }
+ }
+ Component {
+ name: "FTreeModel"
+ defaultProperty: "children"
+ prototype: "FAbstractListModel"
+ exports: ["com.ford.hmiframework/FTreeModel 1.0"]
+ Property { name: "children"; type: "FTreeElement"; isList: true; isReadonly: true }
+ Property { name: "root"; type: "FTreeElement"; isPointer: true }
+ Property { name: "rootRoot"; type: "FTreeElement"; isReadonly: true; isPointer: true }
+ Method {
+ name: "openElement"
+ Parameter { name: "numIndex"; type: "int" }
+ }
+ Method {
+ name: "closeElement"
+ Parameter { name: "numIndex"; type: "int" }
+ }
+ Method {
+ name: "selectElement"
+ Parameter { name: "index"; type: "int" }
+ }
+ }
+ Component {
+ name: "FTrgAnimCompleted"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgAnimCompleted 1.0"]
+ Property { name: "animation"; type: "FAnimation"; isPointer: true }
+ Method {
+ name: "animCompleted"
+ Parameter { type: "FAnimation"; isPointer: true }
+ }
+ }
+ Component {
+ name: "FTrgCondition"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgCondition 1.0"]
+ Property { name: "condition"; type: "bool" }
+ Property { name: "checkOnEntry"; type: "bool" }
+ }
+ Component {
+ name: "FTrgEntry"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgEntry 1.0"]
+ Property { name: "previousView"; type: "string"; isReadonly: true }
+ Property { name: "data"; type: "QVariant"; isReadonly: true }
+ Method {
+ name: "entry"
+ Parameter { name: "previousView"; type: "string" }
+ Parameter { name: "data"; type: "QVariant" }
+ }
+ }
+ Component {
+ name: "FTrgEntryComplete"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgEntryComplete 1.0"]
+ }
+ Component {
+ name: "FTrgEvent"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgEvent 1.0"]
+ Property { name: "event"; type: "FEvent"; isPointer: true }
+ Property { name: "data"; type: "QVariant" }
+ Method {
+ name: "eventTrigger"
+ Parameter { name: "data"; type: "QVariant" }
+ }
+ }
+ Component {
+ name: "FTrgExit"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgExit 1.0"]
+ }
+ Component {
+ name: "FTrgExitComplete"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgExitComplete 1.0"]
+ }
+ Component {
+ name: "FTrgHardwareControl"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgHardwareControl 1.0"]
+ Property { name: "hardControls"; type: "QVariant" }
+ Signal {
+ name: "handleHardwareControlEvent"
+ Parameter { name: "action"; type: "int" }
+ }
+ }
+ Component {
+ name: "FTrgHardwareKey"
+ defaultProperty: "actions"
+ prototype: "FTrgHardwareControl"
+ exports: ["com.ford.hmiframework/FTrgHardwareKey 1.0"]
+ Property { name: "keyAction"; type: "int" }
+ Property { name: "hardkeys"; type: "QVariant" }
+ }
+ Component {
+ name: "FTrgHardwareRotary"
+ defaultProperty: "actions"
+ prototype: "FTrgHardwareControl"
+ exports: ["com.ford.hmiframework/FTrgHardwareRotary 1.0"]
+ Property { name: "valueChange"; type: "int" }
+ Property { name: "rotary"; type: "QVariant" }
+ }
+ Component {
+ name: "FTrgListModel"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgListModel 1.0"]
+ Property { name: "model"; type: "FAbstractListModel"; isPointer: true }
+ Property { name: "element"; type: "FAbstractListElement"; isReadonly: true; isPointer: true }
+ Property { name: "index"; type: "int"; isReadonly: true }
+ Method {
+ name: "elementSelected"
+ Parameter { type: "FAbstractListElement"; isPointer: true }
+ Parameter { type: "int" }
+ }
+ }
+ Component {
+ name: "FTrgMenuElement"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgMenuElement 1.0"]
+ Property { name: "menuElement"; type: "FMenuElement"; isPointer: true }
+ Method {
+ name: "elementSelected"
+ Parameter { type: "FAbstractListElement"; isPointer: true }
+ }
+ }
+ Component {
+ name: "FTrgTouchArea"
+ defaultProperty: "actions"
+ prototype: "FTrigger"
+ exports: ["com.ford.hmiframework/FTrgTouchArea 1.0"]
+ Property { name: "touchArea"; type: "FWdgtTouchArea"; isPointer: true }
+ Property { name: "touchAction"; type: "int" }
+ Property { name: "xPos"; type: "int" }
+ Property { name: "yPos"; type: "int" }
+ Method {
+ name: "touchEvent"
+ Parameter { name: "action"; type: "int" }
+ Parameter { name: "x"; type: "int" }
+ Parameter { name: "y"; type: "int" }
+ }
+ }
+ Component {
+ name: "FTrigger"
+ defaultProperty: "actions"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FTrigger 1.0"]
+ Property { name: "initialized"; type: "bool" }
+ Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
+ Signal {
+ name: "init"
+ Parameter { type: "FStateView"; isPointer: true }
+ }
+ Signal {
+ name: "cleanup"
+ Parameter { type: "FStateView"; isPointer: true }
+ }
+ Signal { name: "intializedChanged" }
+ }
+ Component {
+ name: "FView"
+ defaultProperty: "data"
+ prototype: "FWidget"
+ exports: ["com.ford.hmiframework/FView 1.0"]
+ Property { name: "viewClass"; type: "FViewClass"; isPointer: true }
+ }
+ Component {
+ name: "FViewClass"
+ defaultProperty: "derivedClass"
+ prototype: "FMetaInfoObject"
+ exports: ["com.ford.hmiframework/FViewClass 1.0"]
+ Property { name: "derivedClass"; type: "FViewClass"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "FWdgtTouchArea"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["com.ford.hmiframework/FWdgtTouchArea 1.0"]
+ Property { name: "pressed"; type: "bool" }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "longPressMSec"; type: "int" }
+ Property { name: "repeatDelayMSec"; type: "int" }
+ Property { name: "repeatIntervalMSec"; type: "int" }
+ Signal {
+ name: "touchEvent"
+ Parameter { name: "event"; type: "int" }
+ Parameter { name: "x"; type: "int" }
+ Parameter { name: "y"; type: "int" }
+ }
+ }
+ Component {
+ name: "FWidget"
+ defaultProperty: "data"
+ prototype: "FWidgetBase"
+ exports: ["com.ford.hmiframework/FWidget 1.0"]
+ Property { name: "layout"; type: "FLayout"; isPointer: true }
+ Property { name: "triggers"; type: "FTrigger"; isList: true; isReadonly: true }
+ }
+ Component { name: "FWidgetBase"; defaultProperty: "data"; prototype: "FMetaInfoItem" }
+ Component {
+ name: "QAbstractProxyModel"
+ prototype: "QAbstractItemModel"
+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
+ }
+ Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
+ Component {
+ name: "QSortFilterProxyModel"
+ prototype: "QAbstractProxyModel"
+ exports: ["com.ford.hmiframework/FSortFilterProxyListModel 1.0"]
+ Property { name: "filterRegExp"; type: "QRegExp" }
+ Property { name: "filterKeyColumn"; type: "int" }
+ Property { name: "dynamicSortFilter"; type: "bool" }
+ Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
+ Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
+ Property { name: "isSortLocaleAware"; type: "bool" }
+ Property { name: "sortRole"; type: "int" }
+ Property { name: "filterRole"; type: "int" }
+ Method {
+ name: "setFilterRegExp"
+ Parameter { name: "pattern"; type: "string" }
+ }
+ Method {
+ name: "setFilterWildcard"
+ Parameter { name: "pattern"; type: "string" }
+ }
+ Method {
+ name: "setFilterFixedString"
+ Parameter { name: "pattern"; type: "string" }
+ }
+ Method { name: "clear" }
+ Method { name: "invalidate" }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml
new file mode 100644
index 0000000000..c95ebd3191
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml
@@ -0,0 +1,40 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+BorderImage {
+ property string bitmap: ""
+ property bool themed: false
+
+ onBitmapChanged: {
+ applyThemedImage();
+ }
+
+ function applyThemedImage() {
+ if (bitmap !== "") {
+ if (themed) {
+ source = FThemeProvider.resourcePath + "/" + FThemeProvider.theme + "/" + bitmap;
+ }
+ else {
+ source = FThemeProvider.resourcePath + "/" + bitmap;
+ }
+ }
+ else {
+ source = "";
+ }
+ }
+
+ Component.onCompleted: {
+ if (themed)
+ {
+ FThemeProvider.themeChanged.connect(applyThemedImage);
+ }
+ }
+
+ Component.onDestruction: {
+ if (themed)
+ {
+ FThemeProvider.themeChanged.disconnect(applyThemedImage);
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml
new file mode 100644
index 0000000000..f0e4720cce
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml
@@ -0,0 +1,8 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ property alias widget: container.children
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml
new file mode 100644
index 0000000000..61d1832db4
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml
@@ -0,0 +1,35 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+GridView {
+ id: theGrid
+
+ property alias data : theGrid.model
+ property alias itemWidget : theGrid.delegate
+
+ /*
+ Setting rows/columns fundamentally changes how children fit into the GridView.
+ -Normal behaviour: Children have a fixed size (cellWidth/cellHeight) and the NUMBER of them
+ that will fit into the GridView varies with the GridView's size.
+ -Modified behaviour(setting rows and/or columns triggers this mode): A fixed number of children
+ will fit into the GridView (determined by number of rows/columns) and their SIZE
+ (cellWidth/cellHeight) will vary with the GridView's size
+ -rows/columns determines the size of VISIBLE children and simply sets cellWidth/cellHeight at runtime.
+ If the number of children is different than rows * columns, it will either scroll or not
+ fill the GridView completely, same as normal.
+ -the item_Widget component must be designed for fluid layout using anchors, not fixed sizes,
+ for this to have any effect besides spacing
+ */
+ property int rows
+ property int columns
+
+ Component.onCompleted: {
+ if (rows) {
+ theGrid.cellHeight = theGrid.height/rows
+ }
+ if (columns) {
+ theGrid.cellWidth = theGrid.width/columns
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml
new file mode 100644
index 0000000000..89e57bbf0e
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml
@@ -0,0 +1,43 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+Image {
+ property string bitmap: ""
+ property bool themed: false
+
+ fillMode: Image.PreserveAspectFit
+ asynchronous: true
+
+ onBitmapChanged: {
+ applyThemedImage();
+ }
+
+ function applyThemedImage() {
+ if (bitmap !== "") {
+ if (themed) {
+ source = FThemeProvider.resourcePath + "/" + FThemeProvider.getFileSubPath(bitmap) + bitmap;
+ }
+ else {
+ source = FThemeProvider.resourcePath + "/" + bitmap;
+ }
+ }
+ else {
+ source = "";
+ }
+ }
+
+ Component.onCompleted: {
+ if (themed)
+ {
+ FThemeProvider.themeChanged.connect(applyThemedImage);
+ }
+ }
+
+ Component.onDestruction: {
+ if (themed)
+ {
+ FThemeProvider.themeChanged.disconnect(applyThemedImage);
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml
new file mode 100644
index 0000000000..7e1ccd10a3
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml
@@ -0,0 +1,9 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+ListView {
+ id: theList
+
+ property alias data : theList.model
+ property alias itemWidget : theList.delegate
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml
new file mode 100644
index 0000000000..08762015a9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml
@@ -0,0 +1,9 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+PathView {
+ id: thePathView
+
+ property alias data : thePathView.model
+ property alias itemWidget : thePathView.delegate
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml
new file mode 100644
index 0000000000..74c1e27e9b
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml
@@ -0,0 +1,104 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+BorderImage {
+ property variant target
+
+ source: "../Resources/scrollbar.png"
+ border {left: 0; top: 3; right: 0; bottom: 3}
+ width: 17
+
+ //anchors {top: target.top; bottom: target.bottom; right: target.right }
+ visible: (track.height == slider.height) ? false : true //TODO: !visible -> width: 0 (but creates a binding loop)
+
+ Item {
+ anchors {fill: parent; margins: 1; rightMargin: 2; bottomMargin: 2}
+
+ Image {
+ id: upArrow
+ source: "../Resources/up-arrow.png"
+ anchors.top: parent.top
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ timer.scrollAmount = -10
+ timer.running = true;
+ }
+ onReleased: {
+ timer.running = false;
+ }
+ }
+ }
+
+ Timer {
+ property int scrollAmount
+
+ id: timer
+ repeat: true
+ interval: 20
+ onTriggered: {
+ target.contentY = Math.max(
+ 0, Math.min(
+ target.contentY + scrollAmount,
+ target.contentHeight - target.height));
+ }
+ }
+
+ Item {
+ id: track
+ anchors {top: upArrow.bottom; topMargin: 1; bottom: dnArrow.top;}
+ width: parent.width
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ timer.scrollAmount = target.height * (mouseY < slider.y ? -1 : 1) // scroll by a page
+ timer.running = true;
+ }
+ onReleased: {
+ timer.running = false;
+ }
+ }
+
+ BorderImage {
+ id:slider
+
+ source: "../Resources/slider.png"
+ border {left: 0; top: 3; right: 0; bottom: 3}
+ width: parent.width
+
+ height: Math.min(target.height / target.contentHeight * track.height, track.height)
+ y: target.visibleArea.yPosition * track.height
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent
+ drag.axis: Drag.YAxis
+ drag.minimumY: 0
+ drag.maximumY: track.height - height
+
+ onPositionChanged: {
+ if (pressedButtons == Qt.LeftButton) {
+ target.contentY = slider.y * target.contentHeight / track.height
+ }
+ }
+ }
+ }
+ }
+ Image {
+ id: dnArrow
+ source: "../Resources/dn-arrow.png"
+ anchors.bottom: parent.bottom
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ timer.scrollAmount = 10
+ timer.running = true;
+ }
+ onReleased: {
+ timer.running = false;
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml
new file mode 100644
index 0000000000..a42f74c9fe
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml
@@ -0,0 +1,7 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+Flickable {
+ id: theScrollView
+ clip: true
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml
new file mode 100644
index 0000000000..9e7a93773f
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml
@@ -0,0 +1,6 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+Text {
+ id: myText
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js
new file mode 100644
index 0000000000..f21a454065
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js
@@ -0,0 +1,12 @@
+.pragma library
+
+var In = 1
+var Out = 2
+var Short = 4
+var Long = 8
+var Repeat = 16
+var InRepeat = 17
+var All = 31
+var Cancel = 32
+var DragOut = 64
+var DragIn = 128
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml
new file mode 100644
index 0000000000..39862d6f22
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml
@@ -0,0 +1,13 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FAction {
+ id: theAction
+
+ signal script
+
+ onExecute: {
+ script();
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml
new file mode 100644
index 0000000000..5783286ccf
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml
@@ -0,0 +1,14 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+
+FAction {
+ id: theAction
+
+ signal call
+
+ onExecute: {
+ call();
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml
new file mode 100644
index 0000000000..e31937a2b9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml
@@ -0,0 +1,25 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FAction {
+ id: theAction
+
+ property variant timer
+ property int action: 1
+
+ onExecute: {
+ switch(action)
+ {
+ case TM.Start:
+ timer.start();
+ break;
+ case TM.Restart:
+ timer.restart();
+ break;
+ case TM.Stop:
+ timer.stop();
+ break;
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml
new file mode 100644
index 0000000000..6e7048fe9a
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml
@@ -0,0 +1,13 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FAction {
+ id: theAction
+
+ signal call
+
+ onExecute: {
+ call();
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml
new file mode 100644
index 0000000000..040695d298
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml
@@ -0,0 +1,13 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FAction {
+ id: theAction
+
+ signal change
+
+ onExecute: {
+ change();
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml
new file mode 100644
index 0000000000..4eef062bea
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml
@@ -0,0 +1,6 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+FAnimView {
+ supportOutgoing: true
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js
new file mode 100644
index 0000000000..117cb99267
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js
@@ -0,0 +1,7 @@
+.pragma library
+
+var Start = 1
+var Restart = 2
+var Pause = 3
+var Resume = 4
+var Stop = 0
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml
new file mode 100644
index 0000000000..97c502e517
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml
@@ -0,0 +1,5 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+QtObject {
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml
new file mode 100644
index 0000000000..97c502e517
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml
@@ -0,0 +1,5 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+QtObject {
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml
new file mode 100644
index 0000000000..add0413172
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml
@@ -0,0 +1,9 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+QtObject {
+ id: theEventPool
+ default property alias events: theEventPool._events
+ property list<FEvent> _events
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml
new file mode 100644
index 0000000000..1886d54af7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml
@@ -0,0 +1,51 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+// The FGauge allows to transform an input value range into an output value rang using a smooth transition
+// it can be e.g. used to transfrom the speed of a vehicle into an angle of the pointer needle
+// The borders of the input and output ranges are mapped to each other and a linear transformation is executed
+
+Item {
+ id: theGauge
+
+ // the time required to move through the full range from e.g. min to max
+ property int fullSweepTime: 1000
+
+ // minimum border, the input value can reach
+ property double minInput: 0.0
+ // maximum value, the input can reach
+ property double maxInput: 100.0
+ // the current input value. Each change will trigger an animated change of the output
+ property double currentInput: 50.0
+
+ // minimum border, the output value can reach
+ property double minOutput: 0.0
+ // maximum value, the output can reach
+ property double maxOutput: 100.0
+ //
+ property double currentOutput: 50.0
+
+ // this is the targetted output. Changing this, will trigger the animation to be executed
+ property double targetOutput
+ // this is the time required to move to the target value
+ property int targetTime
+
+ PropertyAnimation { id: anim; target: theGauge; properties: "currentOutput"; to: theGauge.targetOutput; duration: theGauge.targetTime }
+
+ onCurrentInputChanged: {
+ // we need to calculate the target and the required time to reach it
+ var target = (currentInput - minInput) * (maxOutput - minOutput) / (maxInput - minInput) + minOutput;
+ if(target < minOutput) {
+ target = minOutput;
+ }
+ else if (target > maxOutput) {
+ target = maxOutput;
+ }
+
+ targetTime = Math.abs((target - currentOutput) / (maxOutput - minOutput)) * fullSweepTime;
+ if(targetTime > 0) {
+ targetOutput = target;
+ anim.restart();
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js
new file mode 100644
index 0000000000..ee1db632a7
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js
@@ -0,0 +1,9 @@
+.pragma library
+
+var In = 1
+var Out = 2
+var Short = 4
+var Long = 8
+var Repeat = 16
+var InRepeat = 17
+var All = 31
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js
new file mode 100644
index 0000000000..1a1d2af589
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js
@@ -0,0 +1,132 @@
+var leadSection = ""
+var trailSection = ""
+var varName = ""
+var formatSection = ""
+
+var digits = 0
+var digitZeros = 0
+var decimals = 0
+var decimalsZeros = 0
+var decimalSymbol = "."
+
+function splitFormatString(format) {
+ // we need to analyze the structure of the string first
+ // a typical notation is like this: "{distance:#00.0#} km", where
+ // "{" "}" variable limiters
+ // "distance" variable name, this will be discarded and has not effect
+ // "#" non-leading/-trailing zero character
+ // "0" leading/trailing zero character
+ // " km" additional text which will remain unchanged
+ leadSection = ""
+ trailSection = ""
+ varName = ""
+ formatSection = ""
+
+ var startPos = 0;
+ var searchStep = 0;
+ for(var i = 0; i < format.length; ++i)
+ {
+ // search for the opening "{"
+ if(searchStep === 0) {
+ if(format.charAt(i)==='{') {
+ leadSection = format.slice(startPos, i);
+ startPos = i + 1;
+ searchStep++;
+ }
+ }
+ // search for the ":" or the closing "}"
+ else if(searchStep === 1) {
+ if(format.charAt(i) === '}') {
+ formatSection = format.slice(startPos, i);
+ startPos = i + 1;
+ trailSection = format.slice(startPos)
+ break;
+ }
+ else if(format.charAt(i) === ':') {
+ varName = format.slice(startPos, i);
+ startPos = i + 1;
+ searchStep++;
+ }
+ }
+ else if(searchStep === 2) {
+ if(format.charAt(i) === '}') {
+ formatSection = format.slice(startPos, i);
+ startPos = i + 1;
+ trailSection = format.slice(startPos)
+ break;
+ }
+ }
+ }
+
+ // finally we need to create the formatting string for sprintf out of the formatSection
+ digits = 0;
+ digitZeros = 0;
+ decimals = 0;
+ decimalsZeros = 0;
+ searchStep = 0;
+ for(var i = 0; i < formatSection.length; ++i) {
+ if(searchStep === 0) {
+ if(formatSection.charAt(i) === '#') {
+ digits++;
+ }
+ else if(formatSection.charAt(i) === '0') {
+ digits++;
+ digitZeros++;
+ }
+ else if(formatSection.charAt(i) === '.' || formatSection.charAt(i) === ',') {
+ decimalSymbol = formatSection.charAt(i);
+ searchStep++;
+ }
+ }
+ else if(searchStep === 1) {
+ if(formatSection.charAt(i) === '#') {
+ decimals++;
+ }
+ else if(formatSection.charAt(i) === '0') {
+ decimals++;
+ decimalsZeros++;
+ }
+ }
+ }
+}
+
+function formatOutput(data)
+{
+ // format the output, first the digits
+ var digitString = Math.floor(data).toString();
+ if(digitString.length < digitZeros) {
+ // zero pad the string
+ var temp = "";
+ for(var i = 0; i < digitZeros - digitString.length; ++i) {
+ temp += '0';
+ }
+ digitString = temp + digitString;
+ }
+ else {
+ digitString = digitString.slice(-digits);
+ }
+
+ var decimalString = (data - Math.floor(data)).toFixed(decimals).slice(2);
+ if (decimalString.length > decimalsZeros) {
+ for (var i = decimalString.length - 1; i >= decimalsZeros; i--)
+ {
+ if(decimalString.charAt(i) === '0')
+ {
+ decimalString = decimalString.slice(0, -1);
+ }
+ }
+ }
+ else {
+ for (var i = decimalString.length; i < decimalsZeros; i++)
+ {
+ decimalString += '0';
+ }
+ }
+
+ if (decimalString.length > 0) {
+ return leadSection + digitString + decimalSymbol + decimalString + trailSection;
+ }
+ else {
+ return leadSection + digitString + trailSection;
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml
new file mode 100644
index 0000000000..c3be3832fa
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml
@@ -0,0 +1,28 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import "FStringFormat.js" as CB
+
+QtObject {
+ // output string for which is used as output
+ property string output
+
+ // this string defines the format of the output
+ property string format
+
+ // this is the data to be formatted into the output
+ property variant data
+
+
+ onFormatChanged: {
+ CB.splitFormatString(format);
+ }
+
+ onDataChanged: {
+ doFormat();
+ }
+
+ function doFormat()
+ {
+ output = CB.formatOutput(data);
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml
new file mode 100644
index 0000000000..5f9106f9af
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml
@@ -0,0 +1,56 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+QtObject {
+ id: _style
+
+ Component.onCompleted: {
+ FThemeProvider.themeChanged.connect(themeChanged);
+ }
+
+ // This property is used to assign a "style" filename to the style. This file loads the style data and updates the properties of the style
+ property string styleFile: ""
+
+ property bool themed: false
+
+ onStyleFileChanged: {
+ loadStyle(_style);
+ }
+
+ function themeChanged() {
+ if (themed)
+ {
+ loadStyle(_style);
+ }
+ }
+
+ // indicate, that the style has been updated to the attached widgets
+ signal styleUpdated
+
+ function loadStyle(style)
+ {
+ if(styleFile.length > 0) {
+ console.log( "Loading style: " + styleFile + " (" + FThemeProvider.theme + ")")
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", FThemeProvider.resourcePath + FThemeProvider.getFileSubPath(styleFile + ".qmlstyle") + "/" + styleFile + ".qmlstyle");
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === XMLHttpRequest.DONE) {
+ try {
+ var a = JSON.parse(xhr.responseText);
+ for (var b in a) {
+ if (style.hasOwnProperty(b)) {
+ style[b] = a[b];
+ }
+ }
+ styleUpdated();
+ }
+ catch (ex) {
+ console.log("Style exception (" + styleFile + "): " + ex);
+ }
+ }
+ }
+ xhr.send();
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml
new file mode 100644
index 0000000000..3fb89882da
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml
@@ -0,0 +1,41 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+QtObject {
+ // this property can be FStyle, but only if the instance is created in place and not assigned. Otherwise we need to use variant
+ //property FStyle style
+ property variant style
+ property variant styleTarget
+
+ onStyleChanged: {
+ if(style !== undefined && style !== null) {
+ style.styleUpdated.connect(applyStyle);
+ applyStyle();
+ }
+ }
+
+ onStyleTargetChanged: {
+ applyStyle();
+ }
+
+ function applyStyle()
+ {
+ if(style !== undefined && style !== null && styleTarget !== undefined && styleTarget !== null) {
+ setStyledProperties(style, styleTarget)
+ }
+ }
+
+ function setStyledProperties(style, target)
+ {
+ for(var prop in style) {
+ // first filter unwanted properties
+ if(prop !== "objectName" && prop.slice(-7) !== "Changed" ) {
+ // process only properties owned by style & target
+ if (target.hasOwnProperty(prop)) {
+ // assign the value
+ target[prop] = style[prop];
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml
new file mode 100644
index 0000000000..bc148998b9
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml
@@ -0,0 +1,6 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+Timer {
+ triggeredOnStart: false
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js
new file mode 100644
index 0000000000..d657de1f0c
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js
@@ -0,0 +1,5 @@
+.pragma library
+
+var Stop = 0
+var Start = 1
+var Restart = 2
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml
new file mode 100644
index 0000000000..b3ac5f8a15
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml
@@ -0,0 +1,19 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+import com.ford.hmiframework 1.0
+
+FTrigger {
+ property QtObject timer
+
+ onInit: {
+ timer.triggered.connect(timerTrigger);
+ }
+
+ onCleanup: {
+ timer.triggered.disconnect(timerTrigger);
+ }
+
+ function timerTrigger() {
+ executeActions();
+ }
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml
new file mode 100644
index 0000000000..258a1da623
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml
@@ -0,0 +1,9 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+State {
+ default property alias propertyChange: myState.changes
+ property alias condition: myState.when
+ id: myState
+ when: true === true
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml
new file mode 100644
index 0000000000..7b1fa6ba51
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml
@@ -0,0 +1,7 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+StateGroup {
+ id: myUseCaseGroup
+ default property alias useCases: myUseCaseGroup.states
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml
new file mode 100644
index 0000000000..44da5a5a79
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml
@@ -0,0 +1,15 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+StateGroup {
+ default property alias propertyChange: theState.changes
+ property alias condition: theState.when
+
+ states: [
+ State {
+ id: theState
+ name: "*"
+ when: true == true
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml
new file mode 100644
index 0000000000..24f6acfa4f
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml
@@ -0,0 +1,6 @@
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 2.0
+
+Transition {
+ to: "*"
+}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir
new file mode 100644
index 0000000000..3ccd0e58e8
--- /dev/null
+++ b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir
@@ -0,0 +1,35 @@
+module com.ford.hmiframework
+plugin QtHMIFramework
+typeinfo plugin.qmltypes
+FActScriptCall 1.0 qml/Framework/FActScriptCall.qml
+FActSystemModelCall 1.0 qml/Framework/FActSystemModelCall.qml
+FActTimer 1.0 qml/Framework/FActTimer.qml
+FActWidgetCall 1.0 qml/Framework/FActWidgetCall.qml
+FActWidgetProperty 1.0 qml/Framework/FActWidgetProperty.qml
+FConditionPool 1.0 qml/Framework/FConditionPool.qml
+FDataPool 1.0 qml/Framework/FDataPool.qml
+FEventPool 1.0 qml/Framework/FEventPool.qml
+FGaugeValue 1.0 qml/Framework/FGaugeValue.qml
+FStringFormat 1.0 qml/Framework/FStringFormat.qml
+FStyle 1.0 qml/Framework/FStyle.qml
+FStyler 1.0 qml/Framework/FStyler.qml
+FTimer 1.0 qml/Framework/FTimer.qml
+FTrgTimer 1.0 qml/Framework/FTrgTimer.qml
+FViewUseCase 1.0 qml/Framework/FViewUseCase.qml
+FViewUseCaseGroup 1.0 qml/Framework/FViewUseCaseGroup.qml
+FViewUseCaseSimple 1.0 qml/Framework/FViewUseCaseSimple.qml
+FViewUseCaseTransition 1.0 qml/Framework/FViewUseCaseTransition.qml
+FWdgtBorderImage 1.0 qml/BaseWidgets/FWdgtBorderImage.qml
+FWdgtContainer 1.0 qml/BaseWidgets/FWdgtContainer.qml
+FWdgtImage 1.0 qml/BaseWidgets/FWdgtImage.qml
+FWdgtListView 1.0 qml/BaseWidgets/FWdgtListView.qml
+FWdgtPathView 1.0 qml/BaseWidgets/FWdgtPathView.qml
+FWdgtGridView 1.0 qml/BaseWidgets/FWdgtGridView.qml
+FWdgtScrollbar 1.0 qml/BaseWidgets/FWdgtScrollbar.qml
+FWdgtScrollview 1.0 qml/BaseWidgets/FWdgtScrollview.qml
+FWdgtScrollText 1.0 qml/BaseWidgets/FWdgtScrollText.qml
+FWdgtText 1.0 qml/BaseWidgets/FWdgtText.qml
+HK 1.0 qml/Framework/FHardwareKeyEnums.js
+TA 1.0 qml/BaseWidgets/FWdgtTouchAreaEnums.js
+ANIM 1.0 qml/Framework/FAnimationEnums.js
+TM 1.0 qml/Framework/FTimerEnums.js
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro b/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro
new file mode 100644
index 0000000000..c20d41ede5
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro
@@ -0,0 +1,21 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/Bananas
+folder_01.target = qml
+
+folder_02.source = plugins/com
+folder_02.target = plugins
+DEPLOYMENTFOLDERS = folder_01 folder_02
+
+SOURCES += main.cpp
+
+linux-g++* {
+ QMAKE_CXXFLAGS += -m32
+ QMAKE_LFLAGS += -m32 -L/usr/lib/i386-linux-gnu/mesa
+}
+
+# Please do not modify the following two lines. Required for deployment.
+include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
+qtcAddDeployment()
+
+OTHER_FILES += \
+ qml/Bananas/Layouts/TitledLayout.qml
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop b/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop
new file mode 100644
index 0000000000..a7bfa0111f
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Bananas
+Exec=/opt/Bananas/bin/Bananas
+Icon=Bananas64
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png b/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png
new file mode 100644
index 0000000000..707d5c4e85
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png b/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png
new file mode 100644
index 0000000000..6ad8096c45
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop b/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop
new file mode 100644
index 0000000000..5ced151d06
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Bananas
+Exec=/usr/bin/single-instance /opt/Bananas/bin/Bananas
+Icon=/usr/share/icons/hicolor/80x80/apps/Bananas80.png
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/README.md b/src/components/qt_hmi/References/Work/bananasnacks/README.md
new file mode 100644
index 0000000000..993a4bf59d
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/README.md
@@ -0,0 +1,37 @@
+#### sudo vi /etc/apt/apt.conf
+
+``ruby
+Acquire::http::proxy "http://proxyvipecc.nb.ford.com:83";
+Acquire::https::proxy "https://proxyvipecc.nb.ford.com:83";
+``
+
+``bash
+sudo apt-get update
+sudo apt-get install git vim build-essential mesa-common-dev libgl1-mesa-dev # for 64bit: libc6-dev-i386 lib32stdc++6 lib32stdc++6-4.7-dev libgl1-mesa-dev:i386
+
+ssh-keygen
+<enter x3>
+cat ~/.ssh/id_rsa.pub # Save this as a public ssh key on your Gitlab account
+
+git clone git@devbox.pd8.ford.com:zchurch/bananasnacks.git # Type 'yes' to trust the remote host
+
+wget http://releases.qt-project.org/qt5/5.0.1/qt-linux-opensource-5.0.1-x86-offline.run
+chmod +x qt-linux-opensource-5.0.1-x86-offline.run
+./qt-linux-opensource-5.0.1-x86-offline.run # Press next, accept, etc... Do install the Tools. This includes Creator.
+
+echo "export PATH=\$PATH:~/Qt5.0.1/5.0.1/gcc/bin" >> ~/.bashrc
+
+cd ~/bananasnacks
+./fetch_plugins.sh
+qmake
+make
+./Bananas
+
+``
+
+
+### Troubleshooting
+
+#### bash: ./qt-linux-opensource-5.0.1-x86-offline.run: No such file or directory
+You didn't install all your apt-get things. You're missing ia32-libs. Or the file isn't there.
+
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject b/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject
new file mode 100644
index 0000000000..f9502d2a90
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject
@@ -0,0 +1,19 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "qml/Bananas/main.qml"
+
+ QmlFiles {
+ directory: "."
+ }
+
+ JavaScriptFiles {
+ directory: "."
+ }
+
+ ImageFiles {
+ directory: "."
+ }
+
+ importPaths: [ "plugins" ]
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh b/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh
new file mode 100755
index 0000000000..0f90baeb58
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+wget http://19.7.95.92/uploads/note/attachment/12/libFordMediaCore.so
+chmod 775 libFordMediaCore.so
+mv libFordMediaCore.so plugins/com/ford/mediacore
+
+wget http://19.7.95.92/uploads/note/attachment/11/libFordPhoneCore.so
+chmod 775 libFordPhoneCore.so
+mv libFordPhoneCore.so plugins/com/ford/phonecore
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh b/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh
new file mode 100755
index 0000000000..0f094b5275
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh
@@ -0,0 +1 @@
+# source ./load_env.sh
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/main.cpp b/src/components/qt_hmi/References/Work/bananasnacks/main.cpp
new file mode 100644
index 0000000000..faa3f175be
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/main.cpp
@@ -0,0 +1,17 @@
+#include <QtGui/QGuiApplication>
+#include <QQmlContext>
+#include "qtquick2applicationviewer.h"
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QtQuick2ApplicationViewer viewer;
+
+ viewer.addImportPath(QStringLiteral("plugins"));
+
+ viewer.setMainQmlFile(QStringLiteral("qml/Bananas/main.qml"));
+ viewer.showExpanded();
+
+ return app.exec();
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir
new file mode 100644
index 0000000000..bb93f40934
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir
@@ -0,0 +1,2 @@
+module com.ford.mediacore
+plugin FordMediaCore
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir
new file mode 100644
index 0000000000..aaacfe020e
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir
@@ -0,0 +1,3 @@
+module com.ford.navcore
+plugin FordNavCore
+
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir
new file mode 100644
index 0000000000..861f2e2232
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir
@@ -0,0 +1,3 @@
+module com.ford.phonecore
+plugin FordPhoneCore
+
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir
new file mode 100644
index 0000000000..da1a7b7f96
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir
@@ -0,0 +1,3 @@
+module com.ford.sdlcore
+plugin FordSdlCore
+
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png
new file mode 100644
index 0000000000..7111c7c932
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png
new file mode 100644
index 0000000000..d8e6079685
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png
new file mode 100644
index 0000000000..1a65f07518
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png
new file mode 100644
index 0000000000..cfb6d6d59e
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png
new file mode 100644
index 0000000000..91ed3ef6e2
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png
new file mode 100644
index 0000000000..d7ba38ab8c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png
new file mode 100644
index 0000000000..4555d71dfb
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png
new file mode 100644
index 0000000000..c21373f220
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png
new file mode 100644
index 0000000000..251db8a7a5
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png
new file mode 100644
index 0000000000..2f8dc5130c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png
new file mode 100644
index 0000000000..49a01feeaf
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png
new file mode 100644
index 0000000000..52430d8c56
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png
new file mode 100644
index 0000000000..f47954968c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png
new file mode 100644
index 0000000000..caa6489154
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png
new file mode 100644
index 0000000000..6c58389891
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png
new file mode 100644
index 0000000000..0871c51503
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png
new file mode 100644
index 0000000000..02548e946d
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png
new file mode 100644
index 0000000000..2bdd652e0a
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png
new file mode 100644
index 0000000000..c6797a440b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png
new file mode 100644
index 0000000000..b9ca08ad02
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png
new file mode 100644
index 0000000000..a70ee397fe
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png
new file mode 100644
index 0000000000..3847da93c8
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png
new file mode 100644
index 0000000000..4405a629ce
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png
new file mode 100644
index 0000000000..482b6821e2
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png
new file mode 100644
index 0000000000..5e86d80c76
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png
new file mode 100644
index 0000000000..525e4b9158
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png
new file mode 100644
index 0000000000..4bce721385
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png
new file mode 100644
index 0000000000..55498b9134
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png
new file mode 100644
index 0000000000..bbede19900
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png
new file mode 100644
index 0000000000..281e20a1f4
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png
new file mode 100644
index 0000000000..e4071e0932
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png
new file mode 100644
index 0000000000..9b36907b33
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png
new file mode 100644
index 0000000000..6af9c10463
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png
new file mode 100644
index 0000000000..1b665e3633
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png
new file mode 100644
index 0000000000..b7b532db7b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png
new file mode 100644
index 0000000000..f660610202
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png
new file mode 100644
index 0000000000..16a31b29ba
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png
new file mode 100644
index 0000000000..4351243d4b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png
new file mode 100644
index 0000000000..798f754801
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png
new file mode 100644
index 0000000000..b1d03d24ae
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png
new file mode 100644
index 0000000000..2c8e7cb2da
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png
new file mode 100644
index 0000000000..571d06c97b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png
new file mode 100644
index 0000000000..caff60c58b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png
new file mode 100644
index 0000000000..63a5a6a9db
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png
new file mode 100644
index 0000000000..4b3fc65c61
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png
new file mode 100644
index 0000000000..0ea1209925
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png
new file mode 100644
index 0000000000..f871a96543
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png
new file mode 100644
index 0000000000..8f0c759edf
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png
new file mode 100644
index 0000000000..79a277b185
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png
new file mode 100644
index 0000000000..b6fb90276f
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png
new file mode 100644
index 0000000000..c27ac4a874
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png
new file mode 100644
index 0000000000..c3f91de709
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png
new file mode 100644
index 0000000000..e3277af0ac
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png
new file mode 100644
index 0000000000..97ce15688d
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png
new file mode 100644
index 0000000000..69e50caa39
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml
new file mode 100644
index 0000000000..61f0311815
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+
+ImageButton {
+ icon: "../Assets/BackIcon.png"
+ height: 42
+ width: 60
+ anchors.top: parent.top
+ anchors.left: parent.left
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml
new file mode 100644
index 0000000000..7f3c30126b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.0
+
+Rectangle {
+ signal press
+ property alias text: clickable.text
+ property alias textAnchors: clickable.textAnchors
+ property alias clickable: clickable
+ id: container
+ border.color: "#333"
+ border.width: 1
+ height: 45
+ width: 150
+ radius: 3
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: clickable.pressed ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
+ }
+ GradientStop {
+ position: 1.0
+ color: clickable.pressed ? "#9C3335" : "black"
+ }
+ }
+ Clickable {
+ anchors.fill: parent
+ id: clickable
+ onPress: container.press()
+
+ textAnchors.horizontalCenter: horizontalCenter
+ textAnchors.verticalCenter: verticalCenter
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml
new file mode 100644
index 0000000000..713d00d1b3
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml
@@ -0,0 +1,36 @@
+import QtQuick 2.0
+
+Rectangle {
+ signal press
+ property alias text: clickable.text
+
+ states: [
+ State {
+ name: 'pressed'
+ }
+ ]
+ id: container
+ border.color: "#333"
+ border.width: 1
+ height: 45
+ width: 150
+ radius: 3
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: (state === 'pressed' || clickable.pressed) ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
+ }
+ GradientStop {
+ position: 1.0
+ color: (state === 'pressed' || clickable.pressed) ? "#9C3335" : "black"
+ }
+ }
+ Clickable {
+ anchors.fill: parent
+ id: clickable
+ onPress: { container.press(); container.state = (container.state === '') ? 'pressed' : '' }
+
+ textAnchors.horizontalCenter: horizontalCenter
+ textAnchors.verticalCenter: verticalCenter
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml
new file mode 100644
index 0000000000..2fdc97d7cd
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+
+Item {
+ property alias text: text.text
+ property alias pressed: mousearea.pressed
+ property alias textAnchors: text.anchors
+ signal press
+
+ id: container
+
+ Text {
+ id: text
+ color: "white"
+ font.pixelSize: 16
+ }
+
+ MouseArea {
+ id: mousearea
+ width: parent.width
+ height: parent.height
+
+ onClicked: container.press()
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
new file mode 100644
index 0000000000..2e670682ee
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
@@ -0,0 +1,40 @@
+import QtQuick 2.0
+
+Rectangle {
+ signal press
+ property alias text: clickable.text
+ property alias image: image.source
+
+ id: container
+ border.color: "#333"
+ border.width: 1
+ height: 110
+ width: 150
+ radius: 3
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: clickable.pressed ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
+ }
+ GradientStop {
+ position: 1.0
+ color: clickable.pressed ? "#9C3335" : "black"
+ }
+ }
+ Clickable {
+ anchors.fill: parent
+ id: clickable
+ onPress: container.press()
+
+ textAnchors.horizontalCenter: horizontalCenter
+ textAnchors.bottom: bottom
+ textAnchors.bottomMargin: 10
+
+ Image {
+ id: image
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml
new file mode 100644
index 0000000000..b68c7f0f1b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.0
+
+Text {
+ color: "#fff"
+ font.pixelSize: 32
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml
new file mode 100644
index 0000000000..775838be06
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+
+Text {
+ color: "#fff"
+ font.pixelSize: 24
+ anchors.margins: 20
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml
new file mode 100644
index 0000000000..81c18a4311
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+
+Button {
+ property alias icon: icon.source
+
+ width: icon.width + 30
+
+ Image {
+ id: icon
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml
new file mode 100644
index 0000000000..7fe5dbab83
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Button {
+ width: 60
+
+ onPress: keyboard.letterClicked(text)
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml
new file mode 100644
index 0000000000..fc5d26aa88
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml
@@ -0,0 +1,129 @@
+import QtQuick 2.0
+
+Item {
+ signal letterClicked(string letter)
+ signal go()
+ id: keyboard
+
+ states: [
+ State {
+ name: 'numpad'
+ PropertyChanges {
+ target: qwerty
+ visible: false
+ }
+ PropertyChanges {
+ target: numpad
+ visible: true
+ }
+ }
+
+ ]
+
+ Column {
+ id: qwerty
+ anchors.fill: parent
+ spacing: 10
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "Q" }
+ Key { text: "W" }
+ Key { text: "E" }
+ Key { text: "R" }
+ Key { text: "T" }
+ Key { text: "Y" }
+ Key { text: "U" }
+ Key { text: "I" }
+ Key { text: "O" }
+ Key { text: "P" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "A" }
+ Key { text: "S" }
+ Key { text: "D" }
+ Key { text: "F" }
+ Key { text: "G" }
+ Key { text: "H" }
+ Key { text: "J" }
+ Key { text: "K" }
+ Key { text: "L" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "Z" }
+ Key { text: "X" }
+ Key { text: "C" }
+ Key { text: "V" }
+ Key { text: "B" }
+ Key { text: "N" }
+ Key { text: "M" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+ Button { text: "123"; width: 60
+ onPress: keyboard.state = 'numpad'
+ }
+ Button { text: "!@#"; width: 60 }
+ Key { text: " "; width: 300 }
+ Key { text: "." }
+ Key { text: "&" }
+ }
+ }
+
+ Column {
+ id: numpad
+ visible: false
+ anchors.fill: parent
+ spacing: 10
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "1" }
+ Key { text: "2" }
+ Key { text: "3" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "4" }
+ Key { text: "5" }
+ Key { text: "6" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "7" }
+ Key { text: "8" }
+ Key { text: "9" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Button {
+ text: "ABC"
+ width: 60
+ onPress: keyboard.state = ''
+ }
+ Key { text: "*" }
+ Key { text: "0" }
+ Key { text: "#" }
+ Button {
+ text: "Go"
+ width: 60
+ onPress: keyboard.go()
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml
new file mode 100644
index 0000000000..0dc0115acf
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml
@@ -0,0 +1,43 @@
+import QtQuick 2.0
+
+Item {
+ signal letterClicked(string letter)
+ id: keyboard
+
+ Column {
+ anchors.fill: parent
+ spacing: 10
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "1" }
+ Key { text: "2" }
+ Key { text: "3" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "4" }
+ Key { text: "5" }
+ Key { text: "6" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "7" }
+ Key { text: "8" }
+ Key { text: "9" }
+ }
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ Key { text: "*" }
+ Key { text: "0" }
+ Key { text: "#" }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
new file mode 100644
index 0000000000..f0ef3ed2ae
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
@@ -0,0 +1,40 @@
+import QtQuick 2.0
+
+ListView {
+ id: listView
+ anchors.fill: parent
+ anchors.topMargin: 120
+ spacing: 10
+ clip: true
+ model: MediaModel
+
+ delegate: Button {
+ width: 500
+ anchors.horizontalCenter: parent.horizontalCenter
+ OverflowableText {
+ text: name
+ fontColor: "#fff"
+ font.pixelSize: 20
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ width: parent.width - 40
+ }
+ Text {
+ text: (model.count === 0) ? "" : model.count
+ anchors.right: parent.right
+ anchors.rightMargin: 20
+ anchors.verticalCenter: parent.verticalCenter
+ color: "#fff"
+ }
+
+ onPress: {
+ if (model.is_file) {
+ MediaPlayer.setPlaylist(model.pid, model.index);
+ usb.state = '';
+ } else {
+ MediaModel.browseToChild(model.id)
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml
new file mode 100644
index 0000000000..3149943613
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml
@@ -0,0 +1,46 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Rectangle {
+ id: oflow_text
+ property alias text: text.text
+ property alias font: text.font
+ property alias fontColor: text.color
+ property string textAlign
+ color: Qt.rgba(0,0,0,0)
+ height: text.font.pixelSize * 1.2
+ clip: true
+ Text {
+ id: text
+ Component.onCompleted: {
+ if (oflow_text.width < width) {
+ anchors.left = parent.left
+ }
+ else if (oflow_text.textAlign == 'center') {
+ anchors.horizontalCenter = parent.horizontalCenter
+ }
+ }
+
+ NumberAnimation on anchors.leftMargin {
+ id: scroll_animation
+ to: oflow_text.width - text.width
+ duration: ((oflow_text.width - text.width) < 0) ? (text.width - oflow_text.width) * 15 : 0
+ running: false
+ onStopped: {
+ restart_timer.start()
+ }
+ }
+ }
+
+ Timer {
+ id: scroll_timer
+ running: true
+ interval: 3000
+ onTriggered: { if (oflow_text.width < text.width) scroll_animation.start();}
+ }
+ Timer {
+ id: restart_timer
+ interval: 3000
+ onTriggered: text.anchors.leftMargin = 0
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml
new file mode 100644
index 0000000000..676d65be39
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+
+Rectangle {
+ signal press
+ property alias text: clickable.text
+ id: container
+ border.color: "#333"
+ border.width: 1
+ height: 45
+ width: 150
+ radius: 3
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: (container.focus || clickable.pressed) ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
+ }
+ GradientStop {
+ position: 1.0
+ color: (container.focus || clickable.pressed) ? "#9C3335" : "black"
+ }
+ }
+ Clickable {
+ anchors.fill: parent
+ id: clickable
+ onPress: { container.forceActiveFocus(); container.press(); }
+
+ textAnchors.horizontalCenter: horizontalCenter
+ textAnchors.verticalCenter: verticalCenter
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml
new file mode 100644
index 0000000000..d4266d149b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+FocusScope {
+
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml
new file mode 100644
index 0000000000..18b5c22f7d
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.0
+
+Loader {
+ anchors.fill: parent
+ asynchronous: true
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml
new file mode 100644
index 0000000000..4c52e05b2a
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.0
+
+Rectangle {
+ property alias text: text.text
+ property alias icon: icon.source
+
+ border.width: 2
+ color: 'black'
+ height: 42
+ radius: 3
+
+ Image {
+ id: icon
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ }
+
+ TextInput {
+ id: text
+ color: "white"
+ font.pixelSize: 24
+ anchors.left: icon.right
+ anchors.right: parent.right
+ anchors.leftMargin: 20
+ anchors.rightMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml
new file mode 100644
index 0000000000..774894c137
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml
@@ -0,0 +1,72 @@
+import QtQuick 2.0
+
+Item {
+ id: textentry
+ property alias input_border: search_text_box.border
+ property alias autocompleteModel: autocomplete.model
+ property alias text: search_text_box.text
+ signal selected
+ anchors.fill: parent
+
+ TextBox {
+ id: search_text_box
+ icon: "../Assets/SearchIcon.png"
+ anchors.top: parent.top
+ width: parent.width - 160
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ onTextChanged: if (autocomplete.model) autocomplete.model.setSearchString(text)
+ }
+
+ BackButton {
+ anchors.top: search_text_box.top
+ anchors.topMargin: 1
+ anchors.right: search_text_box.left
+ anchors.rightMargin: 10
+ onPress: section.state = 'menu'
+ }
+
+ ImageButton {
+ anchors.top: search_text_box.top
+ anchors.topMargin: 1
+ icon: "../Assets/DeleteIcon.png"
+ anchors.left: search_text_box.right
+ anchors.leftMargin: 10
+ height: 42
+
+ onPress: search_text_box.text = search_text_box.text.replace(/.$/, '')
+ }
+
+ Keyboard {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.topMargin: 40
+ anchors.top: search_text_box.bottom
+
+ onLetterClicked: search_text_box.text += letter
+ onGo: textentry.selected()
+ }
+
+ ListView {
+ id: autocomplete
+ anchors.top: search_text_box.bottom
+ anchors.bottom: parent.bottom
+ anchors.right: search_text_box.right
+ anchors.left: search_text_box.left
+ clip: true
+ visible: (count > 0 && count <= 5)
+
+ delegate: Button {
+ text: model.text
+ width: parent.width
+ textAnchors.horizontalCenter: undefined
+ textAnchors.left: clickable.left
+ textAnchors.leftMargin: 70
+
+ onPress: {
+ autocomplete.model.selected = model.text;
+ textentry.selected()
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml
new file mode 100644
index 0000000000..0bcaf77205
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+
+Item {
+ property alias text: text.text
+ property alias temp: temp.text
+ property alias image: image.source
+
+ width: 150
+ height: 75
+
+ Text {
+ id: text
+ text: "Today"
+ anchors.top: parent.top
+ color: "#ffffff"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Text {
+ id: temp
+ text: "72"
+ font.pixelSize: 36
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ color: "#ffffff"
+ }
+
+ Image {
+ id: image
+ source: "../Assets/Cloud.png"
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml
new file mode 100644
index 0000000000..8fe6fcfd7c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import "../Components"
+
+Item {
+ anchors.fill: parent
+ anchors.topMargin: 70
+ anchors.leftMargin: 20
+ anchors.rightMargin: 20
+ anchors.bottomMargin: 70
+ property bool back_button: false
+
+ BackButton {
+ onPress: section.state = ''
+ visible: parent.back_button
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml
new file mode 100644
index 0000000000..b0a7c2f6af
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import "../Components"
+
+FocusScope {
+ anchors.fill: parent
+ property alias header: header.text
+
+ Text {
+ id: header
+ font.pixelSize: 24
+ color: "#ffffff"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: 70
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml
new file mode 100644
index 0000000000..767184de36
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml
@@ -0,0 +1,59 @@
+import QtQuick 2.0
+import "../Components"
+
+FocusScope {
+ anchors.fill: parent
+ property alias header: header.text
+ property alias artwork: artwork.source
+ property alias title: title.text
+ property alias artist: artist.text
+
+ Text {
+ id: title
+ text: ""
+ color: "#ffffff"
+ anchors.top: source_select.bottom
+ anchors.topMargin: 20
+ font.pixelSize: 28
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ }
+ Text {
+ id: artist
+ text: ""
+ color: "#ffffff"
+ anchors.top: title.bottom
+ anchors.topMargin: 10
+ font.pixelSize: 18
+ anchors.left: title.left
+ }
+
+ Text {
+ id: header
+ font.pixelSize: 24
+ color: "#ffffff"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: parent.height / 20 + 60
+ }
+
+ Button {
+ id: source_select
+ text: "Select source"
+ x: 20
+ y: 75
+ onPress: section.state = 'menu'
+ }
+
+ Image {
+ id: artwork
+ anchors.right: parent.right
+ anchors.rightMargin: 40
+ anchors.top: parent.top
+ width: 230
+ height: 230
+ anchors.topMargin: 140
+ source: ""
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml
new file mode 100644
index 0000000000..797815d058
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+import "../Components"
+
+MediaLayout {
+
+ Row {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 100
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ spacing: 10
+
+ ImageButton {
+ icon: "../Assets/Rewind.png"
+ onPress: MediaPlayer.previous()
+ }
+
+ ImageButton {
+ icon: "../Assets/Pause.png"
+ visible: MediaPlayer.playing
+ onPress: MediaPlayer.pause()
+ }
+ ImageButton {
+ icon: "../Assets/Play.png"
+ visible: ! MediaPlayer.playing
+ onPress: MediaPlayer.play()
+ }
+ ImageButton {
+ icon: "../Assets/Forward.png"
+ onPress: MediaPlayer.next()
+ }
+
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml
new file mode 100644
index 0000000000..2ef47fa101
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import "../Components"
+
+EmptyLayout {
+ property alias title: title.text
+ anchors.topMargin: 120
+
+ H1 {
+ id: title
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.top
+ anchors.bottomMargin: 10
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp
new file mode 100644
index 0000000000..a88c240c3a
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml
new file mode 100644
index 0000000000..af5804e72e
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: 62
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml
new file mode 100644
index 0000000000..4f9d281964
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.0
+import com.ford.sdlcore 1.0
+import "../../Components"
+import "../../Layouts"
+
+MediaPlayerLayout {
+ header: "AppLink"
+ id: applink
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+
+ Text {
+ id: title
+ text: AppLink.show1
+ color: "#ffffff"
+ font.pixelSize: 28
+ anchors.leftMargin: 20
+ }
+ Text {
+ id: artist
+ text: AppLink.show2
+ color: "#ffffff"
+ font.pixelSize: 18
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml
new file mode 100644
index 0000000000..397b844698
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+MediaLayout {
+ header: "Bluetooth"
+
+ Image {
+ source: "../../Assets/Content/SiriusArtwork.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml
new file mode 100644
index 0000000000..b5f3ad1c8c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml
@@ -0,0 +1,46 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+MediaLayout {
+ header: "FM"
+
+ Flickable {
+ width: 700
+ height: 50
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 80
+ contentHeight: height
+ contentWidth: row.width
+ clip: true
+
+ RadioButtonGroup {
+ width: row.width
+ height: row.height
+ Row {
+ id: row
+ spacing: 8
+
+ RadioButton {
+ text: "Button"
+ }
+ RadioButton {
+ text: "Button"
+ }
+ RadioButton {
+ text: "Button"
+ }
+ RadioButton {
+ text: "Button"
+ }
+ RadioButton {
+ text: "Button"
+ }
+ RadioButton {
+ text: "Button"
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml
new file mode 100644
index 0000000000..d9d951ef3b
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml
@@ -0,0 +1,54 @@
+import QtQuick 2.0
+import com.ford.sdlcore 1.0
+import "../../Components"
+import "../../Layouts"
+
+LeftThirdSection {
+ header: "Select a source"
+
+ Grid {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ GraphicalButton {
+ text: "Radio"
+ image: "../../Assets/RadioIcon.png"
+ onPress: section.state = 'fm'
+ }
+
+ GraphicalButton {
+ text: "Pandora"
+ image: "../../Assets/PandoraIcon.png"
+ onPress: section.state = 'fm'
+ }
+
+ GraphicalButton {
+ text: "Sirius"
+ image: "../../Assets/SiriusIcon.png"
+ onPress: section.state = 'sirius'
+ }
+
+ GraphicalButton {
+ text: "Bluetooth"
+ image: "../../Assets/BluetoothIcon.png"
+ onPress: section.state = 'bluetooth'
+ }
+
+ GraphicalButton {
+ text: "USB"
+ image: "../../Assets/UsbIcon.png"
+ onPress: section.state = 'usb'
+ }
+
+ Repeater {
+ model: MediaApps
+
+ delegate: GraphicalButton {
+ text: modelData
+ image: "../../Assets/UsbIcon.png"
+ onPress: section.state = 'applink'
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml
new file mode 100644
index 0000000000..dfe9fc4d53
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+MediaLayout {
+ header: "Sirius"
+
+ Image {
+ source: "../../Assets/Content/SiriusArtwork.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml
new file mode 100644
index 0000000000..7236e98cbe
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml
@@ -0,0 +1,59 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+MediaPlayerLayout {
+ header: "USB"
+ id: usb
+
+ Button {
+ text: "Browse Media"
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.rightMargin: 40
+ anchors.topMargin: 75
+
+ onPress: parent.state = 'browse'
+ }
+
+ states: [
+ State {
+ name: 'browse'
+ PropertyChanges { target: browse_interface; visible: true; opacity: 0.9 }
+ }
+
+ ]
+
+ Rectangle {
+ color: "#000000"
+ opacity: 0
+ anchors.fill: parent
+ radius: 10
+ visible: false
+ id: browse_interface
+
+ BackButton {
+ id: back_button
+ anchors.topMargin: 80
+ anchors.leftMargin: 20
+ }
+
+
+ H2 {
+ id: header
+ text: "Browse Media"
+ anchors.topMargin: 80
+ }
+
+ Item {
+ anchors.fill: parent
+ id: browse_container
+ }
+
+ Button {
+ anchors.top: back_button.bottom
+ anchors.left: parent.left
+ text: "Jump"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp
new file mode 100644
index 0000000000..183438e037
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml
new file mode 100644
index 0000000000..db16b994b4
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml
@@ -0,0 +1,70 @@
+import QtQuick 2.0
+import com.ford.navcore 1.0
+import "../../Components"
+import "../../Layouts"
+
+Item {
+ BackButton { onPress: section.state = 'menu' }
+ NavController {
+ id: navController
+ }
+
+ Flickable {
+ height: 300
+ width: 400
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ clip: true
+ contentWidth: content.width
+ contentHeight: content.height
+
+ Column {
+ id: content
+ width: parent.width
+ spacing: 10
+
+ Button {
+ text: "Barry Church's home"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Davison", "Victoria Sta", "3465");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Subway"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Dearborn Heights", "Pelham St", "3929");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Ford World Headquarters"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Dearborn", "American Rd", "1");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Qdoba"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Allen Park", "Fairlane Dr", "48101");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Levagood Park"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Dearborn", "Denwood St", "1100");
+ section.state = 'map';
+ }
+ }
+
+ }
+ }
+}
+
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml
new file mode 100644
index 0000000000..011c761646
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml
@@ -0,0 +1,64 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+Item {
+ anchors.fill: parent
+ id: keyboard_search
+
+ states: [
+ State {
+ name: 'city'
+ PropertyChanges {target: text_entry; autocompleteModel: citySuggestions}
+ },
+ State {
+ name: 'street'
+ PropertyChanges {target: text_entry; autocompleteModel: streetSuggestions}
+ },
+ State {
+ name: 'door'
+ PropertyChanges {target: text_entry; autocompleteModel: undefined}
+ },
+ State {
+ name: 'review'
+ PropertyChanges {target: text_entry; visible: false}
+ PropertyChanges {target: review; visible: true}
+ }
+ ]
+
+ Column {
+ id: review
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 500
+
+ visible: false
+ Button {
+ text: stateSuggestions.selected
+ width: parent.width
+ onPress: keyboard_search.state = ""
+ }
+ Button {
+ text: citySuggestions.selected
+ width: parent.width
+ onPress: keyboard_search.state = "city"
+ }
+ Button {
+ text: streetSuggestions.selected
+ width: parent.width
+ onPress: keyboard_search.state = "city"
+ }
+ Button {
+ id: doornumber
+ width: parent.width
+ onPress: keyboard_search.state = "door"
+ }
+ Button {
+ text: "Begin navigation"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onPress: {
+ section.state = 'map';
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml
new file mode 100644
index 0000000000..8b48efe780
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml
@@ -0,0 +1,63 @@
+import QtQuick 2.0
+import "../../Components"
+
+Item {
+ Column {
+ anchors.left: parent.left;
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: 10
+
+ Button {
+ text: "Zoom in"
+ }
+
+ Button {
+ text: "Zoom out"
+ }
+
+ Button {
+ text: "3D"
+ }
+
+ Button {
+ text: "2D"
+ }
+
+ Button {
+ text: "North up"
+ }
+ }
+
+ Rectangle {
+ width: next_turn.width + 20
+ height: 30
+ anchors.top: parent.top
+ anchors.topMargin: 65
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: "black"
+ opacity: 0.6
+
+ }
+
+ Rectangle {
+ width: current_street.width + 20
+ height: 30
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 65
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: "black"
+ opacity: 0.6
+ visible: navController.current_street.length > 0
+
+ }
+
+
+ Button {
+ text: "Go"
+ anchors.top: parent.top
+ anchors.topMargin: 3
+ anchors.right: parent.right
+ anchors.rightMargin: 20
+ onPress: section.state = 'menu'
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml
new file mode 100644
index 0000000000..fdcae3f58e
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml
@@ -0,0 +1,57 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+EmptyLayout {
+ back_button: true
+
+ Grid {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ GraphicalButton {
+ text: "Home"
+ image: "../../Assets/HomeIcon.png"
+ onPress: {
+ section.state = 'map';
+ }
+ }
+ GraphicalButton {
+ text: "Work"
+ image: "../../Assets/WorkIcon.png"
+ onPress: {
+ section.state = 'map';
+ }
+ }
+ GraphicalButton {
+ text: "Recent Destination"
+ image: "../../Assets/RecentDestinationsIcon.png"
+ onPress: section.state = 'recent_destinations'
+ }
+ GraphicalButton {
+ text: "Keyboard"
+ image: "../../Assets/KeyboardIcon.png"
+ onPress: section.state = 'keyboard_search'
+ }
+ GraphicalButton {
+ text: "Favorites"
+ image: "../../Assets/FavoritesIcon.png"
+ onPress: section.state = 'favorites'
+ }
+ GraphicalButton {
+ text: "Point of Interest"
+ image: "../../Assets/PoiIcon.png"
+ onPress: section.state = 'poi'
+ }
+ GraphicalButton {
+ text: "Scout"
+ image: "../../Assets/ScoutIcon.png"
+ }
+ GraphicalButton {
+ text: "SYNC Services"
+ image: "../../Assets/ServicesIcon.png"
+ onPress: section.state = "video_moving_map"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml
new file mode 100644
index 0000000000..0ecea8a113
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml
@@ -0,0 +1,205 @@
+import QtQuick 2.0
+import com.ford.navcore 1.0
+import "../../Components"
+import "../../Layouts"
+
+EmptyLayout {
+ anchors.fill: parent
+ back_button: true
+ id: poi_search
+
+ Component.onCompleted: state = "search_type"
+
+ states: [
+ State {
+ name: 'search_type'
+ PropertyChanges {
+ target: search_type
+ visible: true
+ }
+ },
+ State {
+ name: 'categories'
+ PropertyChanges {
+ target: category_select
+ visible: true
+ }
+ },
+ State {
+ name: 'select_state'
+ PropertyChanges {
+ target: text_entry
+ visible: true
+ }
+ },
+ State {
+ name: 'results'
+ PropertyChanges {
+ target: results
+ visible: true
+ }
+ },
+ State {
+ name: 'result'
+ PropertyChanges {
+ target: result
+ visible: true
+ }
+ }
+ ]
+
+ NavController {
+ id: navController
+ }
+
+ Grid {
+ id: search_type
+ property string type
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+ visible: false
+
+ GraphicalButton {
+ text: "Near me"
+ image: "../../Assets/HomeIcon.png"
+ onPress: {
+ search_type.type = "nearby"
+ poi_search.state = "categories"
+ }
+ }
+
+ GraphicalButton {
+ text: "Along route"
+ image: "../../Assets/HomeIcon.png"
+ onPress: {
+ search_type.type = "route"
+ poi_search.state = "categories"
+ }
+ }
+
+ GraphicalButton {
+ text: "In city"
+ image: "../../Assets/HomeIcon.png"
+ onPress: {
+ search_type.type = "city"
+ poi_search.state = "select_state"
+ }
+ }
+ }
+
+ ListView {
+ id: category_select
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: parent.height - 120
+ width: parent.width
+ spacing: 10
+ clip: true
+
+ GraphicalButton {
+ text: "Search by name"
+ image: "../../Assets/HomeIcon.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ }
+
+ visible: false
+ model: NavPoiCategoryListModel { id: poi_categories }
+
+ delegate: Button {
+ property int category_id: id
+ text: name
+ width: 400
+ anchors.horizontalCenter: parent.horizontalCenter
+ onPress: {
+ navController.poiSearch(search_type.type, category_id, "USA", state_suggestions.getSelected(), city_suggestions.getSelected());
+ poi_search.state = "results"
+ }
+ }
+ }
+
+ ListView {
+ id: results
+ visible: false
+ anchors.topMargin: 80
+ anchors.top: parent.top
+ anchors.bottomMargin: 80
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 400
+ height: parent.height - 120
+ spacing: 10
+ clip: true
+
+ model: NavPoiSuggestionListModel {
+ id: poi_suggestions
+ }
+
+ delegate: Button {
+ text: name
+ width: parent.width
+ onPress: {
+ results.currentIndex = index
+ poi_search.state = "result"
+ }
+ }
+ }
+
+ Item {
+ anchors.fill: parent
+ anchors.topMargin: 80
+ anchors.bottomMargin: 80
+ id: result
+ visible: false
+
+ H1 {
+ id: poi_name
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: (results.currentItem ? results.currentItem.text : "")
+ }
+
+ Button {
+ text: "Begin navigation"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: poi_name.bottom
+ onPress: {
+ poi_suggestions.navigateToResult(results.currentIndex);
+ section.state = 'map'
+ }
+ }
+ }
+
+ TextEntry {
+ id: text_entry
+ anchors.topMargin: 80
+ input_border.color: "#3C7855"
+
+ states: [
+ State {
+ name: "city_select"
+ PropertyChanges {
+ target: text_entry
+ autocompleteModel: city_suggestions
+ }
+ }
+
+ ]
+
+ NavStateSuggestionListModel { id: state_suggestions }
+ NavCitySuggestionListModel { id: city_suggestions; stateListModel: state_suggestions }
+ autocompleteModel: state_suggestions
+ visible: false
+
+ onSelected: {
+ if (text_entry.state === '') {
+ text = "";
+ text_entry.state = 'city_select';
+ }
+ else {
+ poi_search.state = 'categories'
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml
new file mode 100644
index 0000000000..db16b994b4
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml
@@ -0,0 +1,70 @@
+import QtQuick 2.0
+import com.ford.navcore 1.0
+import "../../Components"
+import "../../Layouts"
+
+Item {
+ BackButton { onPress: section.state = 'menu' }
+ NavController {
+ id: navController
+ }
+
+ Flickable {
+ height: 300
+ width: 400
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ clip: true
+ contentWidth: content.width
+ contentHeight: content.height
+
+ Column {
+ id: content
+ width: parent.width
+ spacing: 10
+
+ Button {
+ text: "Barry Church's home"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Davison", "Victoria Sta", "3465");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Subway"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Dearborn Heights", "Pelham St", "3929");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Ford World Headquarters"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Dearborn", "American Rd", "1");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Qdoba"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Allen Park", "Fairlane Dr", "48101");
+ section.state = 'map';
+ }
+ }
+ Button {
+ text: "Levagood Park"
+ width: parent.width
+ onPress: {
+ navController.beginNavigation("USA", "MI", "Dearborn", "Denwood St", "1100");
+ section.state = 'map';
+ }
+ }
+
+ }
+ }
+}
+
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml
new file mode 100644
index 0000000000..2f6b798d18
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import "../../Components"
+import QtMultimedia 5.0
+
+Item {
+ Video {
+ anchors.fill: parent
+ source: "rtsp://172.20.10.7:8086"
+ autoPlay: true
+ }
+
+ Button {
+ text: "Go"
+ anchors.top: parent.top
+ anchors.topMargin: 3
+ anchors.right: parent.right
+ anchors.rightMargin: 20
+ onPress: section.state = 'menu'
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml
new file mode 100644
index 0000000000..1f409f58e6
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml
@@ -0,0 +1,21 @@
+import QtQuick 2.0
+import "../../Components"
+import com.ford.phonecore 1.0
+
+Item {
+ anchors.fill: parent
+
+ H2 {
+ id: h2
+ text: PhoneCore.device_name
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Button {
+ text: "Forget device"
+ onPress: PhoneCore.unpairDevice()
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: h2.bottom
+ anchors.topMargin: 20
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml
new file mode 100644
index 0000000000..5d7c51be6c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+import com.ford.phonecore 1.0
+import "../../Components"
+
+Item {
+ ListView {
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 300
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ spacing: 10
+
+ delegate: Button {
+ text: name
+ width: parent.width
+ onPress: bluetooth_devices.createPairedDevice(mac)
+ }
+
+ model: BluetoothDiscoveredDevices {
+ id: bluetooth_devices
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml
new file mode 100644
index 0000000000..fd5ed4ff09
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml
@@ -0,0 +1,55 @@
+import QtQuick 2.0
+import com.ford.phonecore 1.0
+import "../../Components"
+import "../../Layouts"
+
+Item {
+ anchors.top: parent.top
+ anchors.topMargin: 80
+
+ TextBox {
+ id: phone_number
+ border.color: Qt.rgba(0.454901961,0.37254902,0.203921569,1)
+ anchors.top: parent.top
+ width: parent.width - 160
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ BackButton {
+ anchors.top: phone_number.top
+ anchors.topMargin: 1
+ anchors.right: phone_number.left
+ anchors.rightMargin: 10
+ onPress: section.state = ''
+ }
+
+ ImageButton {
+ anchors.top: phone_number.top
+ anchors.topMargin: 1
+ icon: "../../Assets/DeleteIcon.png"
+ anchors.left: phone_number.right
+ anchors.leftMargin: 10
+ height: 42
+
+ onPress: phone_number.text = phone_number.text.replace(/.$/, '')
+ }
+
+ Keypad {
+ anchors.topMargin: 40
+ anchors.top: phone_number.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ onLetterClicked: phone_number.text += letter
+ }
+
+ Button {
+ text: "Call"
+ onPress: PhoneCore.dial(phone_number.text);
+ y: 100
+ }
+ Button {
+ text: "End call"
+ onPress: PhoneCore.hangup();
+ y: 160
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml
new file mode 100644
index 0000000000..cf62a9c287
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import com.ford.phonecore 1.0
+import "../../Components"
+import "../../Layouts"
+
+TitledLayout {
+ title: "Manage Bluetooth devices"
+ back_button: true
+
+ Loader {
+ id: view
+
+ anchors.fill: parent
+ source: (PhoneCore.device_name === "") ? "discovery.qml" : "device_info.qml"
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml
new file mode 100644
index 0000000000..2d53656ba0
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml
@@ -0,0 +1,54 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+LeftThirdSection {
+ Grid {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ GraphicalButton {
+ text: "Do Not Disturb"
+ image: "../../Assets/DndIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Phonebook"
+ image: "../../Assets/PhonebookIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Voicemail"
+ image: "../../Assets/VoicemailIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Messages"
+ image: "../../Assets/MessagesIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Recent Calls"
+ image: "../../Assets/RecentCallsIcon.png"
+ onPress: section.state = 'recent_calls'
+ }
+
+ GraphicalButton {
+ text: "Keypad"
+ image: "../../Assets/KeypadIcon.png"
+ onPress: section.state = 'keypad'
+ }
+
+ GraphicalButton {
+ text: "Speed Dial"
+ image: "../../Assets/SpeedDialIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Devices"
+ image: "../../Assets/SpeedDialIcon.png"
+ onPress: section.state = 'manage_devices'
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml
new file mode 100644
index 0000000000..1873ed4382
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml
@@ -0,0 +1,62 @@
+import QtQuick 2.0
+import com.ford.phonecore 1.0
+import "../../Components"
+import "../../Layouts"
+
+TitledLayout {
+ title: "Recent calls"
+ Component.onCompleted: PhoneCore.hangup()
+ back_button: true
+
+ Flickable {
+ height: 300
+ width: 400
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ clip: true
+ contentWidth: content.width
+ contentHeight: content.height
+
+ Column {
+ id: content
+ width: parent.width
+ spacing: 10
+
+ Button {
+ text: "Chris Church: Mobile"
+ onPress: PhoneCore.dial("8106567195")
+ width: parent.width
+ }
+ Button {
+ text: "Barry Church: Mobile"
+ onPress: PhoneCore.dial("3134074522")
+ width: parent.width
+ }
+ Button {
+ text: "Barry Church: Work"
+ onPress: PhoneCore.dial("3134074522")
+ width: parent.width
+ }
+ Button {
+ text: "Aaron Church: Mobile"
+ onPress: PhoneCore.dial("3134074522")
+ width: parent.width
+ }
+ Button {
+ text: "Aaron Church: Mobile"
+ onPress: PhoneCore.dial("3134074522")
+ width: parent.width
+ }
+ Button {
+ text: "Aaron Church: Mobile"
+ onPress: PhoneCore.dial("3134074522")
+ width: parent.width
+ }
+ Button {
+ text: "Aaron Church: Mobile"
+ onPress: PhoneCore.dial("3134074522")
+ width: parent.width
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml
new file mode 100644
index 0000000000..b95bc52da8
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml
@@ -0,0 +1,60 @@
+import QtQuick 2.0
+import "../../Components"
+import "../../Layouts"
+
+LeftThirdSection {
+ MultiPointTouchArea {
+ anchors.fill: parent
+ }
+
+ Grid {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 10
+
+ GraphicalButton {
+ text: "HEV"
+ image: "../../Assets/EvIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Ambient Lighting"
+ image: "../../Assets/LightingIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Wallpaper"
+ image: "../../Assets/WallpaperIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Wi-Fi"
+ image: "../../Assets/WifiIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Health Report"
+ image: "../../Assets/VhrIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Seats"
+ image: "../../Assets/SeatsIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Keypad Entry"
+ image: "../../Assets/KeypadEntryIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Sync Services"
+ image: "../../Assets/ServicesIcon.png"
+ }
+
+ GraphicalButton {
+ text: "Add Shortcut"
+ image: "../../Assets/AddIcon.png"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml
new file mode 100644
index 0000000000..f19539b9be
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml
@@ -0,0 +1,68 @@
+import QtQuick 2.0
+
+Item {
+ property alias text: alert_text.text
+ id: alert_item
+ opacity: 0
+
+ transitions: Transition {
+ NumberAnimation {
+ properties: "opacity"
+ }
+ }
+
+ function alert(message) {
+ text = message;
+ state = 'alerting';
+ alert_timer.start();
+ }
+
+ states: [
+ State {
+ name: 'alerting'
+ PropertyChanges {
+ target: alert_item
+ opacity: 1
+ }
+ }
+ ]
+
+ Timer {
+ id: alert_timer
+ running: false
+ interval: 4000
+ onTriggered: alert_item.state = '';
+ }
+
+
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ color: "#000"
+ opacity: 0.8
+ }
+
+ Rectangle {
+ color: "#111"
+ width: 500
+ height: alert_text.height + 40
+ radius: 8
+ border.color: "#666"
+ border.width: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ id: alert_text
+ text: "This is a really really long long really really long longreally really long longreally really long longreally really long long alert"
+ color: "#fff"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 24
+ width: parent.width
+ wrapMode: Text.WordWrap
+ }
+ }
+
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml
new file mode 100644
index 0000000000..b8f4f09d56
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml
@@ -0,0 +1,144 @@
+import QtQuick 2.0
+import "../Components"
+
+Item {
+ id: container
+ anchors.fill: parent
+
+ property int horizontalLabelMargin: 20
+
+ Image {
+ id: phonetab
+ source: "../Assets/PhoneTab.png"
+ anchors.top: parent.top
+ anchors.topMargin: (root.state === "phone") ? -height : 0
+ Behavior on anchors.topMargin { PropertyAnimation {} }
+ width: parent.width / 2 - 145
+ height: parent.height / 20 + 25
+
+ Clickable {
+ anchors.fill: parent
+ text: "Phone"
+ onPress: go("phone")
+ textAnchors.verticalCenter: verticalCenter
+ textAnchors.leftMargin: horizontalLabelMargin
+ textAnchors.left: left
+ }
+ }
+ Row {
+ anchors.right: phonetab.right
+ anchors.rightMargin: phonetab.width / 4
+ anchors.top: parent.top
+ height: phonetab.height
+ spacing: 10
+
+ Image {
+ source: "../Assets/PhoneCornerIcons.png"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+
+ Image {
+ source: "../Assets/NavigationTab.png"
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.topMargin: (root.state === "navigation") ? -height : 0
+ Behavior on anchors.topMargin { PropertyAnimation {} }
+ width: parent.width / 2 - 145
+ height: parent.height / 20 + 25
+
+ Clickable {
+ anchors.fill: parent
+ text: "Navigation"
+ onPress: go("navigation")
+ textAnchors.verticalCenter: verticalCenter
+ textAnchors.rightMargin: horizontalLabelMargin
+ textAnchors.right: right
+ }
+ }
+
+ Image {
+ id: test1
+ source: "../Assets/MediaTab.png"
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: (root.state === "media") ? -height : 0
+ anchors.left: parent.left
+ Behavior on anchors.bottomMargin { PropertyAnimation {} }
+ width: parent.width / 2 - 145
+ height: parent.height / 20 + 25
+
+ Clickable {
+ anchors.fill: parent
+ text: "Media"
+ onPress: go("media")
+ textAnchors.verticalCenter: verticalCenter
+ textAnchors.leftMargin: horizontalLabelMargin
+ textAnchors.left: left
+ }
+ }
+
+ Image {
+ source: "../Assets/VehicleTab.png"
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: (root.state === "vehicle") ? -height : 0
+ Behavior on anchors.bottomMargin { PropertyAnimation {} }
+ width: parent.width / 2 - 145
+ height: parent.height / 20 + 25
+
+ Clickable {
+ anchors.fill: parent
+ text: "Vehicle"
+ onPress: go("vehicle")
+ textAnchors.verticalCenter: verticalCenter
+ textAnchors.rightMargin: horizontalLabelMargin
+ textAnchors.right: right
+ }
+ }
+
+ Image {
+ id: chrometop
+ source: "../Assets/ChromeTop.png"
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: parent.height / 18 + 35
+ width: parent.width / 2 + 40
+ fillMode: Image.PreserveAspectFit
+ Clickable {
+ onPress: go((root.state === 'home_corners') ? 'home' : 'home_corners')
+ width: parent.width / 5
+ height: parent.height
+ anchors.left: parent.left
+ anchors.leftMargin: (parent.width - parent.paintedWidth)/2 + 20
+ }
+
+ Text {
+ id: clock
+ text: "12:00"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ color: "#ffffff"
+ font.pixelSize: 28
+ }
+ }
+ Image {
+ source: "../Assets/ChromeBottom.png"
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: parent.height / 18 + 35
+ width: parent.width / 2
+ fillMode: Image.PreserveAspectFit
+
+ Text {
+ id: exterior_temp
+ text: "72F Outside"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ color: "#ffffff"
+ anchors.bottomMargin: 15
+ font.pixelSize: 18
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml
new file mode 100644
index 0000000000..c45f66782f
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml
@@ -0,0 +1,51 @@
+import QtQuick 2.0
+import "../Components"
+import "../Layouts"
+import com.ford.phonecore 1.0
+
+LeftThirdSection {
+ header: "Good Morning, Jen"
+
+ Column {
+ anchors.left: parent.left
+ anchors.leftMargin: 60
+ spacing: 40
+ anchors.verticalCenter: parent.verticalCenter
+
+ Weather {}
+ Weather {
+ text: "Tonight"
+ temp: "55"
+ image: "../Assets/CloudNight.png"
+ }
+ }
+
+
+ Image {
+ id: schedule
+ source: "../Assets/CMaxCal.png"
+ anchors.right: parent.right
+ anchors.rightMargin: 70
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Column {
+ anchors.right: schedule.left
+ anchors.rightMargin: 20
+ anchors.top: schedule.top
+ anchors.topMargin: 5
+ spacing: 40
+
+ Button {
+ text: "Dial"
+ }
+ Button {
+ text: "Navigate"
+ }
+ Button {
+ text: "Siri"
+ onPress: PhoneCore.siriEyesFree()
+ visible: PhoneCore.device_state === "connected" || PhoneCore.device_state === "playing"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml
new file mode 100644
index 0000000000..432e978b87
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml
@@ -0,0 +1,133 @@
+import QtQuick 2.0
+import com.ford.phonecore 1.0
+import "../Components"
+import "../Layouts"
+
+Item {
+
+ Image {
+ source: "../Assets/Crosshairs.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Item {
+ width: parent.width / 2
+ height: parent.height / 2
+
+ Image {
+ id: phone_corner_icon
+ visible: (PhoneCore.device_state === "connected")
+ source: "../Assets/PhoneIcons.png"
+ anchors.top: parent.top
+ anchors.topMargin: 80
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ OverflowableText {
+ id: phone_name
+ text: PhoneCore.device_name
+ anchors.top: phone_corner_icon.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ textAlign: 'center'
+ anchors.topMargin: 10
+ width: 350
+ fontColor: (PhoneCore.device_state === "connected") ? "#ffffff" : "#333"
+ font.pixelSize: 24
+ }
+
+ Text {
+ text: "Connecting..."
+ anchors.top: phone_name.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.topMargin: 10
+ color: "#333"
+ visible: (PhoneCore.device_state === "connecting")
+ font.pixelSize: 24
+ }
+
+ CheckButton {
+ text: "Do Not Disturb"
+ visible: (PhoneCore.device_state === "connected")
+ anchors.top: phone_name.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.topMargin: 10
+ }
+
+
+
+ Row {
+ anchors.top: phone_name.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.topMargin: 10
+ visible: (PhoneCore.device_state === "disconnected")
+ spacing: 10
+
+ Button {
+ text: "Connect"
+ onPress: {
+ PhoneCore.initializeDevice()
+ }
+ }
+
+ Button {
+ text: "Manage Phones"
+ onPress: {
+ go("phone");
+ }
+ }
+ }
+
+ }
+
+ Item {
+ width: parent.width / 2
+ height: parent.height / 2
+ anchors.right: parent.right
+ }
+
+ Item {
+ width: parent.width / 2
+ height: parent.height / 2
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+
+ Image {
+ source: "../Assets/VehicleCornerIcon.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Item {
+ width: parent.width / 2
+ height: parent.height / 2
+ anchors.bottom: parent.bottom
+
+ Image {
+ id: media_corner_icon
+ source: "../Assets/UsbIcon.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: 40
+ }
+
+ Text {
+ id: media_artist
+ text: ""
+ font.pixelSize: 18
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: media_corner_icon.bottom
+ color: "#ffffff"
+ anchors.topMargin: 10
+ }
+
+ Text {
+ id: media_title
+ text: ""
+ font.pixelSize: 24
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: media_artist.bottom
+ color: "#ffffff"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml
new file mode 100644
index 0000000000..af33ddaffd
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml
@@ -0,0 +1,55 @@
+import QtQuick 2.0
+import "../Components"
+import "../Layouts"
+
+Rectangle {
+ anchors.fill: parent
+ id: section
+
+ gradient: Gradient {
+ GradientStop { position: 0.8; color: "#000000" }
+ GradientStop { position: 1.0; color: "#7C3232" }
+ }
+
+ states: [
+ State {
+ name: 'menu'
+ PropertyChanges { target: page; source: "Media/menu.qml" }
+ },
+ State {
+ name: 'fm'
+ PropertyChanges { target: page; source: "Media/fm.qml" }
+ },
+ State {
+ name: 'sirius'
+ PropertyChanges { target: page; source: "Media/sirius.qml" }
+ },
+ State {
+ name: 'usb'
+ PropertyChanges { target: page; source: "Media/usb.qml" }
+ },
+ State {
+ name: 'bluetooth'
+ PropertyChanges { target: page; source: "Media/bluetooth.qml" }
+ },
+ State {
+ name: 'applink'
+ PropertyChanges { target: page; source: "Media/applink.qml" }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "bluetooth"
+ },
+ Transition {
+ to: "usb"
+ }
+
+ ]
+
+ Section {
+ id: page
+ source: "Media/usb.qml"
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml
new file mode 100644
index 0000000000..e26326b458
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml
@@ -0,0 +1,49 @@
+import QtQuick 2.0
+import "../Components"
+import "../Layouts"
+
+Rectangle {
+ id: section
+ anchors.fill: parent
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#3C7855" }
+ GradientStop { position: 0.4; color: "#000000" }
+ }
+
+ Section {
+ id: page
+ source: "Navigation/map.qml"
+ }
+
+ states: [
+ State {
+ name: ''
+ PropertyChanges { target: page; source: "Navigation/map.qml" }
+ },
+ State {
+ name: 'menu'
+ PropertyChanges { target: page; source: "Navigation/menu.qml" }
+ },
+ State {
+ name: 'keyboard_search'
+ PropertyChanges { target: page; source: "Navigation/keyboard_search.qml" }
+ },
+ State {
+ name: 'favorites'
+ PropertyChanges { target: page; source: "Navigation/favorites.qml" }
+ },
+ State {
+ name: 'recent_destinations'
+ PropertyChanges { target: page; source: "Navigation/recent_destinations.qml" }
+ },
+ State {
+ name: 'poi'
+ PropertyChanges { target: page; source: "Navigation/poi.qml" }
+ },
+ State {
+ name: 'video_moving_map'
+ PropertyChanges { target: page; source: "Navigation/video_moving_map.qml" }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml
new file mode 100644
index 0000000000..8c2987f2f9
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml
@@ -0,0 +1,37 @@
+import QtQuick 2.0
+import "../Components"
+import "../Layouts"
+
+Rectangle {
+ id: section
+ anchors.fill: parent
+
+ states: [
+ State {
+ name: ''
+ PropertyChanges { target: page; source: "Phone/menu.qml" }
+ },
+ State {
+ name: 'recent_calls'
+ PropertyChanges { target: page; source: "Phone/recent_calls.qml" }
+ },
+ State {
+ name: 'keypad'
+ PropertyChanges { target: page; source: "Phone/keypad.qml" }
+ },
+ State {
+ name: 'manage_devices'
+ PropertyChanges { target: page; source: "Phone/manage_devices.qml" }
+ }
+ ]
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: Qt.rgba(0.454901961,0.37254902,0.203921569,1) }
+ GradientStop { position: 0.4; color: "#000000" }
+ }
+
+ Section {
+ id: page
+ source: "Phone/menu.qml"
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml
new file mode 100644
index 0000000000..9687e7c463
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import "../Components"
+import "../Layouts"
+
+Rectangle {
+ anchors.fill: parent
+
+ gradient: Gradient {
+ GradientStop { position: 0.4; color: "#000000" }
+ GradientStop { position: 1.0; color: "#104369" }
+ }
+
+ Section {
+ id: section
+ source: "Vehicle/menu.qml"
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml
new file mode 100644
index 0000000000..c6f0b0e769
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml
@@ -0,0 +1,79 @@
+import QtQuick 2.0
+import "Components"
+import com.ford.sdlcore 1.0
+import com.ford.phonecore 1.0
+
+Rectangle {
+ id: root
+ width: 800
+ height: 470
+ color: "#000"
+
+ states: [
+ State {
+ name: "home"
+ PropertyChanges { target: maincontent; source: "Sections/home.qml" }
+ },
+ State {
+ name: "home_corners"
+ PropertyChanges { target: maincontent; source: "Sections/home_corners.qml" }
+ },
+ State {
+ name: "phone"
+ PropertyChanges { target: maincontent; source: "Sections/phone.qml" }
+ },
+ State {
+ name: "navigation"
+ PropertyChanges { target: maincontent; source: "Sections/navigation.qml" }
+ },
+ State {
+ name: "media"
+ PropertyChanges { target: maincontent; source: "Sections/media.qml" }
+ },
+ State {
+ name: "vehicle"
+ PropertyChanges { target: maincontent; source: "Sections/vehicle.qml" }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: '*'
+ PropertyAnimation { target: maincontent; property: 'opacity'; from: 0; to: 1}
+ }
+ ]
+
+ function go(string) {
+ state = string
+ }
+
+ Connections {
+ target: AppLink
+ onAlert: root.alert(message);
+ }
+
+ Connections {
+ target: PhoneCore
+ onCallAdded: root.alert("Incoming call: \n" + name + "\n" + number)
+ onCallRemoved: root.alert("Call ended")
+ }
+
+ function alert(message) {
+ alert_loader.item.alert(message)
+ }
+
+ Section {
+ id: maincontent
+ source: "Sections/home.qml"
+ }
+
+ Section {
+ id: alert_loader
+ source: "Sections/alert.qml"
+ }
+
+ Section {
+ id: chrome
+ source: "Sections/chrome.qml"
+ }
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp
new file mode 100644
index 0000000000..547602d83c
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp
@@ -0,0 +1,70 @@
+// checksum 0x56a9 version 0x80001
+/*
+ This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
+ QtQuick2ApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qtquick2applicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtQml/QQmlEngine>
+
+class QtQuick2ApplicationViewerPrivate
+{
+ QString mainQmlFile;
+ friend class QtQuick2ApplicationViewer;
+ static QString adjustPath(const QString &path);
+};
+
+QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#if defined(Q_OS_MAC)
+ if (!QDir::isAbsolutePath(path))
+ return QString::fromLatin1("%1/../Resources/%2")
+ .arg(QCoreApplication::applicationDirPath(), path);
+#elif defined(Q_OS_UNIX)
+ const QString pathInInstallDir =
+ QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path);
+ if (QFileInfo(pathInInstallDir).exists())
+ return pathInInstallDir;
+#endif
+ return path;
+}
+
+QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent)
+ : QQuickView(parent)
+ , d(new QtQuick2ApplicationViewerPrivate())
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QQuickView::SizeRootObjectToView);
+}
+
+QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer()
+{
+ delete d;
+}
+
+void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file)
+{
+ d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file);
+ setSource(QUrl::fromLocalFile(d->mainQmlFile));
+}
+
+void QtQuick2ApplicationViewer::addImportPath(const QString &path)
+{
+ engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path));
+}
+
+void QtQuick2ApplicationViewer::showExpanded()
+{
+#if defined(Q_WS_SIMULATOR)
+ showFullScreen();
+#else
+ show();
+#endif
+}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
new file mode 100644
index 0000000000..baf67f2479
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
@@ -0,0 +1,33 @@
+// checksum 0xfde6 version 0x80001
+/*
+ This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
+ QtQuick2ApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QTQUICK2APPLICATIONVIEWER_H
+#define QTQUICK2APPLICATIONVIEWER_H
+
+#include <QtQuick/QQuickView>
+
+class QtQuick2ApplicationViewer : public QQuickView
+{
+ Q_OBJECT
+
+public:
+ explicit QtQuick2ApplicationViewer(QWindow *parent = 0);
+ virtual ~QtQuick2ApplicationViewer();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ void showExpanded();
+
+private:
+ class QtQuick2ApplicationViewerPrivate *d;
+};
+
+#endif // QTQUICK2APPLICATIONVIEWER_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro b/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro
new file mode 100644
index 0000000000..ea541b24ce
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro
@@ -0,0 +1,48 @@
+TEMPLATE = lib
+TARGET = FordSdlCore
+QT += qml quick
+CONFIG += qt plugin
+
+TARGET = $$qtLibraryTarget($$TARGET)
+uri = com.ford.sdlcore
+
+# Input
+SOURCES += \
+ fordsdlcore_plugin.cpp \
+ smartdevicelink.cpp \
+ sdlalert.cpp \
+ QtWebsocket/QWsSocket.cpp \
+ QtWebsocket/QWsServer.cpp \
+ sdlappslistmodel.cpp
+
+HEADERS += \
+ fordsdlcore_plugin.h \
+ smartdevicelink.h \
+ sdlalert.h \
+ QtWebsocket/QWsSocket.h \
+ QtWebsocket/QWsServer.h \
+ sdlappslistmodel.h
+
+OTHER_FILES = qmldir
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ copy_qmldir.target = $$OUT_PWD/qmldir
+ copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
+ copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
+ QMAKE_EXTRA_TARGETS += copy_qmldir
+ PRE_TARGETDEPS += $$copy_qmldir.target
+}
+
+qmldir.files = qmldir
+unix {
+ installPath = ../BananaSnacks/plugins/com/ford/sdlcore
+ qmldir.path = $$installPath
+ target.path = $$installPath
+ INSTALLS += target qmldir
+}
+
+linux-g++* {
+ QMAKE_CXXFLAGS += -m32
+ QMAKE_LFLAGS += -m32
+}
+QMAKE_LIBDIR += /usr/lib/i386-linux-gnu/mesa
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp
new file mode 100644
index 0000000000..5e86daa2f3
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp
@@ -0,0 +1,470 @@
+#include "QWsServer.h"
+
+#include <QRegExp>
+#include <QStringList>
+#include <QByteArray>
+#include <QCryptographicHash>
+#include <QDateTime>
+
+const QString QWsServer::regExpResourceNameStr( QLatin1String("^GET\\s(.*)\\sHTTP/1.1\r\n") );
+const QString QWsServer::regExpHostStr( QLatin1String("\r\nHost:\\s(.+(:\\d+)?)\r\n") );
+const QString QWsServer::regExpKeyStr( QLatin1String("\r\nSec-WebSocket-Key:\\s(.{24})\r\n") );
+const QString QWsServer::regExpKey1Str( QLatin1String("\r\nSec-WebSocket-Key1:\\s(.+)\r\n") );
+const QString QWsServer::regExpKey2Str( QLatin1String("\r\nSec-WebSocket-Key2:\\s(.+)\r\n") );
+const QString QWsServer::regExpKey3Str( QLatin1String("\r\n(.{8})$") );
+const QString QWsServer::regExpVersionStr( QLatin1String("\r\nSec-WebSocket-Version:\\s(\\d+)\r\n") );
+const QString QWsServer::regExpOriginStr( QLatin1String("\r\nSec-WebSocket-Origin:\\s(.+)\r\n") );
+const QString QWsServer::regExpOrigin2Str( QLatin1String("\r\nOrigin:\\s(.+)\r\n") );
+const QString QWsServer::regExpProtocolStr( QLatin1String("\r\nSec-WebSocket-Protocol:\\s(.+)\r\n") );
+const QString QWsServer::regExpExtensionsStr( QLatin1String("\r\nSec-WebSocket-Extensions:\\s(.+)\r\n") );
+
+QWsServer::QWsServer(QObject * parent)
+ : QObject(parent)
+{
+ tcpServer = new QTcpServer(this);
+ connect( tcpServer, SIGNAL(newConnection()), this, SLOT(newTcpConnection()) );
+ qsrand( QDateTime::currentMSecsSinceEpoch() );
+}
+
+QWsServer::~QWsServer()
+{
+ tcpServer->deleteLater();
+}
+
+bool QWsServer::listen(const QHostAddress & address, quint16 port)
+{
+ return tcpServer->listen(address, port);
+}
+
+void QWsServer::close()
+{
+ tcpServer->close();
+}
+
+QAbstractSocket::SocketError QWsServer::serverError()
+{
+ return tcpServer->serverError();
+}
+
+QString QWsServer::errorString()
+{
+ return tcpServer->errorString();
+}
+
+void QWsServer::newTcpConnection()
+{
+ QTcpSocket * tcpSocket = tcpServer->nextPendingConnection();
+ connect( tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived()) );
+ headerBuffer.insert( tcpSocket, QStringList() );
+}
+
+void QWsServer::closeTcpConnection()
+{
+ QTcpSocket * tcpSocket = qobject_cast<QTcpSocket*>( sender() );
+ if (tcpSocket == 0)
+ return;
+
+ tcpSocket->close();
+}
+
+void QWsServer::dataReceived()
+{
+ QTcpSocket * tcpSocket = qobject_cast<QTcpSocket*>( sender() );
+ if (tcpSocket == 0)
+ return;
+
+ bool allHeadersFetched = false;
+
+ const QLatin1String emptyLine("\r\n");
+
+ while ( tcpSocket->canReadLine() )
+ {
+ QString line = tcpSocket->readLine();
+
+ if (line == emptyLine)
+ {
+ allHeadersFetched = true;
+ break;
+ }
+
+ headerBuffer[ tcpSocket ].append(line);
+ }
+
+ if (!allHeadersFetched)
+ return;
+
+ QString request( headerBuffer[ tcpSocket ].join("") );
+
+ QRegExp regExp;
+ regExp.setMinimal( true );
+
+ // Extract mandatory datas
+ // Version
+ regExp.setPattern( QWsServer::regExpVersionStr );
+ regExp.indexIn(request);
+ QString versionStr = regExp.cap(1);
+ EWebsocketVersion version;
+ if ( ! versionStr.isEmpty() )
+ {
+ version = (EWebsocketVersion)versionStr.toInt();
+ }
+ else if ( tcpSocket->bytesAvailable() >= 8 )
+ {
+ version = WS_V0;
+ request.append( tcpSocket->read(8) );
+ }
+ else
+ {
+ version = WS_VUnknow;
+ }
+
+ // Resource name
+ regExp.setPattern( QWsServer::regExpResourceNameStr );
+ regExp.indexIn(request);
+ QString resourceName = regExp.cap(1);
+
+ // Host (address & port)
+ regExp.setPattern( QWsServer::regExpHostStr );
+ regExp.indexIn(request);
+ QString host = regExp.cap(1);
+ QStringList hostTmp = host.split(':');
+ QString hostAddress = hostTmp[0];
+ QString hostPort;
+ if ( hostTmp.size() > 1 )
+ hostPort = hostTmp.last(); // fix for IPv6
+
+ // Key
+ QString key, key1, key2, key3;
+ if ( version >= WS_V4 )
+ {
+ regExp.setPattern( QWsServer::regExpKeyStr );
+ regExp.indexIn(request);
+ key = regExp.cap(1);
+ }
+ else
+ {
+ regExp.setPattern( QWsServer::regExpKey1Str );
+ regExp.indexIn(request);
+ key1 = regExp.cap(1);
+ regExp.setPattern( QWsServer::regExpKey2Str );
+ regExp.indexIn(request);
+ key2 = regExp.cap(1);
+ regExp.setPattern( QWsServer::regExpKey3Str );
+ regExp.indexIn(request);
+ key3 = regExp.cap(1);
+ }
+
+ ////////////////////////////////////////////////////////////////////
+
+ // If the mandatory fields are not specified, we abord the connection to the Websocket server
+ if ( version == WS_VUnknow || resourceName.isEmpty() || hostAddress.isEmpty() || ( key.isEmpty() && ( key1.isEmpty() || key2.isEmpty() || key3.isEmpty() ) ) )
+ {
+ // Send bad request response
+ QString response = QWsServer::composeBadRequestResponse( QList<EWebsocketVersion>() << WS_V6 << WS_V7 << WS_V8 << WS_V13 );
+ tcpSocket->write( response.toUtf8() );
+ tcpSocket->flush();
+ return;
+ }
+
+ ////////////////////////////////////////////////////////////////////
+
+ // Extract optional datas
+
+ // Origin
+ regExp.setPattern( QWsServer::regExpOriginStr );
+ if ( regExp.indexIn(request) == -1 )
+ {
+ regExp.setPattern( QWsServer::regExpOrigin2Str );
+ regExp.indexIn(request);
+ }
+ QString origin = regExp.cap(1);
+
+ // Protocol
+ regExp.setPattern( QWsServer::regExpProtocolStr );
+ regExp.indexIn(request);
+ QString protocol = regExp.cap(1);
+
+ // Extensions
+ regExp.setPattern( QWsServer::regExpExtensionsStr );
+ regExp.indexIn(request);
+ QString extensions = regExp.cap(1);
+
+ ////////////////////////////////////////////////////////////////////
+
+ // Compose opening handshake response
+ QString response;
+
+ if ( version >= WS_V6 )
+ {
+ QString accept = computeAcceptV4( key );
+ response = QWsServer::composeOpeningHandshakeResponseV6( accept, protocol );
+ }
+ else if ( version >= WS_V4 )
+ {
+ QString accept = computeAcceptV4( key );
+ QString nonce = generateNonce();
+ response = QWsServer::composeOpeningHandshakeResponseV4( accept, nonce, protocol );
+ }
+ else
+ {
+ QString accept = computeAcceptV0( key1, key2, key3 );
+ response = QWsServer::composeOpeningHandshakeResponseV0( accept, origin, hostAddress, hostPort, resourceName , protocol );
+ }
+
+ // Handshake OK, disconnect readyRead
+ disconnect( tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived()) );
+
+ // Send opening handshake response
+ if ( version == WS_V0 )
+ tcpSocket->write( response.toLatin1() );
+ else
+ tcpSocket->write( response.toUtf8() );
+ tcpSocket->flush();
+
+ QWsSocket * wsSocket = new QWsSocket( this, tcpSocket, version );
+ wsSocket->setResourceName( resourceName );
+ wsSocket->setHost( host );
+ wsSocket->setHostAddress( hostAddress );
+ wsSocket->setHostPort( hostPort.toInt() );
+ wsSocket->setOrigin( origin );
+ wsSocket->setProtocol( protocol );
+ wsSocket->setExtensions( extensions );
+ wsSocket->serverSideSocket = true;
+
+ // ORIGINAL CODE
+ //int socketDescriptor = tcpSocket->socketDescriptor();
+ //incomingConnection( socketDescriptor );
+
+ // CHANGED CODE FOR LINUX COMPATIBILITY
+ addPendingConnection( wsSocket );
+ emit newConnection();
+}
+
+void QWsServer::incomingConnection( int socketDescriptor )
+{
+ QTcpSocket * tcpSocket = new QTcpSocket( tcpServer );
+ tcpSocket->setSocketDescriptor( socketDescriptor, QAbstractSocket::ConnectedState );
+ QWsSocket * wsSocket = new QWsSocket( this, tcpSocket );
+
+ addPendingConnection( wsSocket );
+ emit newConnection();
+}
+
+void QWsServer::addPendingConnection( QWsSocket * socket )
+{
+ if ( pendingConnections.size() < maxPendingConnections() )
+ pendingConnections.enqueue( socket );
+}
+
+QWsSocket * QWsServer::nextPendingConnection()
+{
+ return pendingConnections.dequeue();
+}
+
+bool QWsServer::hasPendingConnections()
+{
+ if ( pendingConnections.size() > 0 )
+ return true;
+ return false;
+}
+
+int QWsServer::maxPendingConnections()
+{
+ return tcpServer->maxPendingConnections();
+}
+
+bool QWsServer::isListening()
+{
+ return tcpServer->isListening();
+}
+
+QNetworkProxy QWsServer::proxy()
+{
+ return tcpServer->proxy();
+}
+
+QHostAddress QWsServer::serverAddress()
+{
+ return tcpServer->serverAddress();
+}
+
+quint16 QWsServer::serverPort()
+{
+ return tcpServer->serverPort();
+}
+
+void QWsServer::setMaxPendingConnections( int numConnections )
+{
+ tcpServer->setMaxPendingConnections( numConnections );
+}
+
+void QWsServer::setProxy( const QNetworkProxy & networkProxy )
+{
+ tcpServer->setProxy( networkProxy );
+}
+
+bool QWsServer::setSocketDescriptor( int socketDescriptor )
+{
+ return tcpServer->setSocketDescriptor( socketDescriptor );
+}
+
+int QWsServer::socketDescriptor()
+{
+ return tcpServer->socketDescriptor();
+}
+
+bool QWsServer::waitForNewConnection( int msec, bool * timedOut )
+{
+ return tcpServer->waitForNewConnection( msec, timedOut );
+}
+
+QString QWsServer::computeAcceptV0( QString key1, QString key2, QString key3 )
+{
+ QString numStr1;
+ QString numStr2;
+
+ QChar carac;
+ for ( int i=0 ; i<key1.size() ; i++ )
+ {
+ carac = key1[ i ];
+ if ( carac.isDigit() )
+ numStr1.append( carac );
+ }
+ for ( int i=0 ; i<key2.size() ; i++ )
+ {
+ carac = key2[ i ];
+ if ( carac.isDigit() )
+ numStr2.append( carac );
+ }
+
+ quint32 num1 = numStr1.toUInt();
+ quint32 num2 = numStr2.toUInt();
+
+ int numSpaces1 = key1.count( ' ' );
+ int numSpaces2 = key2.count( ' ' );
+
+ num1 /= numSpaces1;
+ num2 /= numSpaces2;
+
+ QString concat = serializeInt( num1 ) + serializeInt( num2 ) + key3;
+
+ QByteArray md5 = QCryptographicHash::hash( concat.toLatin1(), QCryptographicHash::Md5 );
+
+ return QString( md5 );
+}
+
+QString QWsServer::computeAcceptV4(QString key)
+{
+ key += QLatin1String("258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
+ QByteArray hash = QCryptographicHash::hash ( key.toUtf8(), QCryptographicHash::Sha1 );
+ return hash.toBase64();
+}
+
+QString QWsServer::generateNonce()
+{
+ qsrand( QDateTime::currentDateTime().toTime_t() );
+
+ QByteArray nonce;
+ int i = 16;
+
+ while( i-- )
+ {
+ nonce.append( qrand() % 0x100 );
+ }
+
+ return QString( nonce.toBase64() );
+}
+
+QByteArray QWsServer::serializeInt( quint32 number, quint8 nbBytes )
+{
+ QByteArray ba;
+ quint8 currentNbBytes = 0;
+ while (number > 0 && currentNbBytes < nbBytes)
+ {
+ char car = static_cast<char>(number & 0xFF);
+ ba.prepend( car );
+ number = number >> 8;
+ currentNbBytes++;
+ }
+ char car = 0x00;
+ while (currentNbBytes < nbBytes)
+ {
+ ba.prepend( car );
+ currentNbBytes++;
+ }
+ return ba;
+}
+
+QString QWsServer::composeOpeningHandshakeResponseV0( QString accept, QString origin, QString hostAddress, QString hostPort, QString resourceName, QString protocol )
+{
+ QString response;
+
+ response.append( QLatin1String("HTTP/1.1 101 WebSocket Protocol Handshake\r\n") );
+ response.append( QLatin1String("Upgrade: Websocket\r\n") );
+ response.append( QLatin1String("Connection: Upgrade\r\n") );
+ response.append( QLatin1String("Sec-WebSocket-Origin: ") + origin + QLatin1String("\r\n") );
+ response.append( QLatin1String("Sec-WebSocket-Location: ws://") + hostAddress);
+ if (!hostPort.isEmpty())
+ response.append(QLatin1String(":") + hostPort);
+ response.append(resourceName + QLatin1String("\r\n"));
+ if ( ! protocol.isEmpty() )
+ response.append( QLatin1String("Sec-WebSocket-Protocol: ") + protocol + QLatin1String("\r\n") );
+ response.append( QLatin1String("\r\n") );
+ response.append( accept );
+
+ return response;
+}
+
+QString QWsServer::composeOpeningHandshakeResponseV4( QString accept, QString nonce, QString protocol, QString extensions )
+{
+ QString response;
+
+ response.append( QLatin1String("HTTP/1.1 101 Switching Protocols\r\n") );
+ response.append( QLatin1String("Upgrade: websocket\r\n") );
+ response.append( QLatin1String("Connection: Upgrade\r\n") );
+ response.append( QLatin1String("Sec-WebSocket-Accept: ") + accept + QLatin1String("\r\n") );
+ response.append( QLatin1String("Sec-WebSocket-Nonce: ") + nonce + QLatin1String("\r\n") );
+ if ( ! protocol.isEmpty() )
+ response.append( QLatin1String("Sec-WebSocket-Protocol: ") + protocol + QLatin1String("\r\n") );
+ if ( ! extensions.isEmpty() )
+ response.append( QLatin1String("Sec-WebSocket-Extensions: ") + extensions + QLatin1String("\r\n") );
+ response.append( QLatin1String("\r\n") );
+
+ return response;
+}
+
+QString QWsServer::composeOpeningHandshakeResponseV6( QString accept, QString protocol, QString extensions )
+{
+ QString response;
+
+ response.append( QLatin1String("HTTP/1.1 101 Switching Protocols\r\n") );
+ response.append( QLatin1String("Upgrade: websocket\r\n") );
+ response.append( QLatin1String("Connection: Upgrade\r\n") );
+ response.append( QLatin1String("Sec-WebSocket-Accept: ") + accept + QLatin1String("\r\n") );
+ if ( ! protocol.isEmpty() )
+ response.append( QLatin1String("Sec-WebSocket-Protocol: ") + protocol + QLatin1String("\r\n") );
+ if ( ! extensions.isEmpty() )
+ response.append( QLatin1String("Sec-WebSocket-Extensions: ") + extensions + QLatin1String("\r\n") );
+ response.append( QLatin1String("\r\n") );
+
+ return response;
+}
+
+QString QWsServer::composeBadRequestResponse( QList<EWebsocketVersion> versions )
+{
+ QString response;
+
+ response.append( QLatin1String("HTTP/1.1 400 Bad Request\r\n") );
+ if ( ! versions.isEmpty() )
+ {
+ QString versionsStr = QString::number( (int)versions.takeLast() );
+ int i = versions.size();
+ while ( i-- )
+ {
+ versionsStr.append( QLatin1String(", ") + QString::number( (int)versions.takeLast() ) );
+ }
+ response.append( QLatin1String("Sec-WebSocket-Version: ") + versionsStr + QLatin1String("\r\n") );
+ }
+
+ return response;
+}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h
new file mode 100644
index 0000000000..c526c747ab
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h
@@ -0,0 +1,87 @@
+#ifndef QWSSERVER_H
+#define QWSSERVER_H
+
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QNetworkProxy>
+#include <QString>
+#include <QStringList>
+#include <QMap>
+#include <QQueue>
+
+#include "QWsSocket.h"
+
+class QWsServer : public QObject
+{
+ Q_OBJECT
+
+public:
+ // ctor
+ QWsServer(QObject * parent = 0);
+ // dtor
+ virtual ~QWsServer();
+
+ // public functions
+ void close();
+ QString errorString();
+ bool hasPendingConnections();
+ bool isListening();
+ bool listen(const QHostAddress & address = QHostAddress::Any, quint16 port = 0);
+ int maxPendingConnections();
+ virtual QWsSocket * nextPendingConnection();
+ QNetworkProxy proxy();
+ QHostAddress serverAddress();
+ QAbstractSocket::SocketError serverError();
+ quint16 serverPort();
+ void setMaxPendingConnections( int numConnections );
+ void setProxy( const QNetworkProxy & networkProxy );
+ bool setSocketDescriptor( int socketDescriptor );
+ int socketDescriptor();
+ bool waitForNewConnection( int msec = 0, bool * timedOut = 0 );
+
+signals:
+ void newConnection();
+
+protected:
+ // protected functions
+ void addPendingConnection( QWsSocket * socket );
+ virtual void incomingConnection( int socketDescriptor );
+
+private slots:
+ // private slots
+ void newTcpConnection();
+ void closeTcpConnection();
+ void dataReceived();
+
+private:
+ // private attributes
+ QTcpServer * tcpServer;
+ QQueue<QWsSocket*> pendingConnections;
+ QMap<const QTcpSocket*, QStringList> headerBuffer;
+
+public:
+ // public static functions
+ static QByteArray serializeInt( quint32 number, quint8 nbBytes = 4 );
+ static QString computeAcceptV0( QString key1, QString key2, QString thirdPart );
+ static QString computeAcceptV4( QString key );
+ static QString generateNonce();
+ static QString composeOpeningHandshakeResponseV0( QString accept, QString origin, QString hostAddress, QString hostPort, QString resourceName, QString protocol = "" );
+ static QString composeOpeningHandshakeResponseV4( QString accept, QString nonce, QString protocol = "", QString extensions = "" );
+ static QString composeOpeningHandshakeResponseV6( QString accept, QString protocol = "", QString extensions = "" );
+ static QString composeBadRequestResponse( QList<EWebsocketVersion> versions = QList<EWebsocketVersion>() );
+
+ // public static vars
+ static const QString regExpResourceNameStr;
+ static const QString regExpHostStr;
+ static const QString regExpKeyStr;
+ static const QString regExpKey1Str;
+ static const QString regExpKey2Str;
+ static const QString regExpKey3Str;
+ static const QString regExpVersionStr;
+ static const QString regExpOriginStr;
+ static const QString regExpOrigin2Str;
+ static const QString regExpProtocolStr;
+ static const QString regExpExtensionsStr;
+};
+
+#endif // QWSSERVER_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp
new file mode 100644
index 0000000000..540b909e09
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp
@@ -0,0 +1,792 @@
+#include "QWsSocket.h"
+
+#include <QCryptographicHash>
+#include <QtEndian>
+
+#include "QWsServer.h"
+
+int QWsSocket::maxBytesPerFrame = 1400;
+const QString QWsSocket::regExpAcceptStr(QLatin1String("Sec-WebSocket-Accept:\\s(.{28})\r\n"));
+const QString QWsSocket::regExpUpgradeStr(QLatin1String("Upgrade:\\s(.+)\r\n"));
+const QString QWsSocket::regExpConnectionStr(QLatin1String("Connection:\\s(.+)\r\n"));
+
+QWsSocket::QWsSocket( QObject * parent, QTcpSocket * socket, EWebsocketVersion ws_v ) :
+ QAbstractSocket( QAbstractSocket::UnknownSocketType, parent ),
+ tcpSocket( socket ? socket : new QTcpSocket(this) ),
+ _version( ws_v ),
+ _hostPort( -1 ),
+ closingHandshakeSent( false ),
+ closingHandshakeReceived( false ),
+ readingState( HeaderPending ),
+ isFinalFragment( false ),
+ hasMask( false ),
+ payloadLength( 0 ),
+ maskingKey( 4, 0 ),
+ serverSideSocket( false )
+{
+ tcpSocket->setParent( this );
+
+ QAbstractSocket::setSocketState( tcpSocket->state() );
+ QAbstractSocket::setPeerAddress( tcpSocket->peerAddress() );
+ QAbstractSocket::setPeerPort( tcpSocket->peerPort() );
+
+ if ( _version == WS_V0 )
+ connect( tcpSocket, SIGNAL(readyRead()), this, SLOT(processDataV0()) );
+ else if ( _version >= WS_V4 )
+ connect( tcpSocket, SIGNAL(readyRead()), this, SLOT(processDataV4()) );
+ connect( tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(error(QAbstractSocket::SocketError)) );
+ connect( tcpSocket, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)), this, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)) );
+ connect( tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(processTcpStateChanged(QAbstractSocket::SocketState)) );
+ connect( tcpSocket, SIGNAL(readChannelFinished()), this, SIGNAL(readChannelFinished()) );
+ connect( tcpSocket, SIGNAL(hostFound()), this, SIGNAL(hostFound()) );
+}
+
+QWsSocket::~QWsSocket()
+{
+ QAbstractSocket::SocketState state = QAbstractSocket::state();
+ if ( state != QAbstractSocket::UnconnectedState )
+ {
+ qDebug() << "CloseAway, socket destroyed in server";
+ close( CloseGoingAway, QLatin1String("The server destroyed the socket.") );
+ tcpSocket->abort();
+ QAbstractSocket::setSocketState( QAbstractSocket::UnconnectedState );
+ QAbstractSocket::stateChanged( QAbstractSocket::UnconnectedState );
+ emit QAbstractSocket::disconnected();
+ }
+}
+
+void QWsSocket::connectToHost( const QString & hostName, quint16 port, OpenMode mode )
+{
+ QWsSocket::connectToHost( QHostAddress(hostName), port, mode );
+}
+
+void QWsSocket::connectToHost( const QHostAddress &address, quint16 port, OpenMode mode )
+{
+ handshakeResponse.clear();
+ setPeerAddress( address );
+ setPeerPort( port );
+ setOpenMode( mode );
+ tcpSocket->connectToHost( address, port, mode );
+}
+
+void QWsSocket::disconnectFromHost()
+{
+ QWsSocket::close();
+}
+
+void QWsSocket::abort( QString reason )
+{
+ QWsSocket::close( CloseAbnormalDisconnection, reason );
+ tcpSocket->abort();
+}
+
+void QWsSocket::close( ECloseStatusCode closeStatusCode, QString reason )
+{
+ if ( QAbstractSocket::state() == QAbstractSocket::UnconnectedState )
+ return;
+
+ if ( ! closingHandshakeSent )
+ {
+ switch ( _version )
+ {
+ case WS_V4:
+ case WS_V5:
+ case WS_V6:
+ case WS_V7:
+ case WS_V8:
+ case WS_V13:
+ {
+ // Compose and send close frame
+ QByteArray BA;
+
+ // Body
+ if ( closeStatusCode == NoCloseStatusCode )
+ {
+ // Header
+ BA.append( QWsSocket::composeHeader( true, OpClose, 0 ) );
+ }
+ else
+ {
+ // Header
+ QByteArray maskingKey;
+ if ( ! serverSideSocket )
+ maskingKey = QWsSocket::generateMaskingKey();
+ BA.append( QWsSocket::composeHeader( true, OpClose, reason.size() + 2, maskingKey ) );
+
+ QByteArray body;
+
+ // Close status code (optional)
+ body.append( QWsServer::serializeInt( (int)closeStatusCode, 2 ) );
+
+ // Reason (optional)
+ if ( reason.size() )
+ {
+ QByteArray reason_ba = reason.toUtf8();
+ if ( ! serverSideSocket )
+ {
+ reason_ba = QWsSocket::mask( reason_ba, maskingKey );
+ }
+ body.append( reason_ba );
+ }
+
+ BA.append( body );
+ }
+
+ // Send closing handshake
+ tcpSocket->write( BA );
+
+ break;
+ }
+ case WS_V0:
+ {
+ QByteArray closeFrame;
+ closeFrame.append( (char)0xFF );
+ closeFrame.append( (char)0x00 );
+ tcpSocket->write( closeFrame );
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ closingHandshakeSent = true;
+ }
+
+ if ( QAbstractSocket::state() != QAbstractSocket::ClosingState )
+ {
+ QAbstractSocket::setSocketState( QAbstractSocket::ClosingState );
+ emit QAbstractSocket::stateChanged( QAbstractSocket::ClosingState );
+ emit QAbstractSocket::aboutToClose();
+ }
+
+ if ( closingHandshakeSent && closingHandshakeReceived )
+ {
+ QAbstractSocket::setSocketState( QAbstractSocket::UnconnectedState );
+ emit stateChanged( QAbstractSocket::UnconnectedState );
+ emit disconnected();
+ tcpSocket->disconnectFromHost();
+ }
+}
+
+qint64 QWsSocket::write( const QString & string )
+{
+ if ( _version == WS_V0 )
+ {
+ return QWsSocket::write( string.toUtf8() );
+ }
+
+ const QList<QByteArray>& framesList = QWsSocket::composeFrames( string.toUtf8(), false, maxBytesPerFrame );
+ return writeFrames( framesList );
+}
+
+qint64 QWsSocket::write( const QByteArray & byteArray )
+{
+ if ( _version == WS_V0 )
+ {
+ QByteArray BA;
+ BA.append( (char)0x00 );
+ BA.append( byteArray );
+ BA.append( (char)0xFF );
+ return writeFrame( BA );
+ }
+
+ const QList<QByteArray>& framesList = QWsSocket::composeFrames( byteArray, true, maxBytesPerFrame );
+
+ qint64 nbBytesWritten = writeFrames( framesList );
+ emit bytesWritten( nbBytesWritten );
+
+ return nbBytesWritten;
+}
+
+void QWsSocket::processHandshake()
+{
+ //copy from QWsServer::dataReceived();
+ QTcpSocket * tcpSocket = qobject_cast<QTcpSocket*>( sender() );
+ if (tcpSocket == 0)
+ return;
+
+ bool allHeadersFetched = false;
+
+ const QLatin1String emptyLine("\r\n");
+
+ while ( tcpSocket->canReadLine() )
+ {
+ QString line = tcpSocket->readLine();
+
+ if (line == emptyLine)
+ {
+ allHeadersFetched = true;
+ break;
+ }
+
+ handshakeResponse.append(line);
+ }
+
+ if (!allHeadersFetched)
+ return;
+
+ QRegExp regExp;
+ regExp.setMinimal( true );
+
+ // check accept field
+ regExp.setPattern(regExpAcceptStr);
+ regExp.indexIn(handshakeResponse);
+ QString acceptFromServer = regExp.cap(1);
+
+ // check upgrade field
+ regExp.setPattern(regExpUpgradeStr);
+ regExp.indexIn(handshakeResponse);
+ QString upgrade = regExp.cap(1);
+
+ // check connection field
+ regExp.setPattern(regExpConnectionStr);
+ regExp.indexIn(handshakeResponse);
+ QString connection = regExp.cap(1);
+
+ // check extensions field
+ regExp.setPattern(QWsServer::regExpExtensionsStr);
+ regExp.indexIn(handshakeResponse);
+ QString extensions = regExp.cap(1);
+
+ //TODO: check extensions field
+ // If the mandatory params are not setted, we abord the connection to the Websocket server
+ if((acceptFromServer.isEmpty()) || (!upgrade.contains(QLatin1String("websocket"), Qt::CaseInsensitive)) ||
+ (!connection.contains(QLatin1String("Upgrade"), Qt::CaseInsensitive)))
+ {
+ // emit error(QAbstractSocket::ConnectionRefusedError);
+ // return;
+ }
+
+ //TODO: check HTTP code
+
+ //TODO: check protocol field
+
+ QString accept = QWsServer::computeAcceptV4(key);
+ if(accept != acceptFromServer)
+ {
+ // emit error(QAbstractSocket::ConnectionRefusedError);
+ // return;
+ }
+
+ // handshake procedure succeeded
+ QAbstractSocket::setSocketState( QAbstractSocket::ConnectedState );
+ emit QAbstractSocket::stateChanged( QAbstractSocket::ConnectedState );
+ emit QAbstractSocket::connected();
+}
+
+void QWsSocket::processDataV0()
+{
+ if( state() == QAbstractSocket::ConnectingState )
+ {
+ processHandshake();
+ return;
+ }
+
+ QByteArray BA, buffer;
+ quint8 type, b = 0x00;
+
+ BA = tcpSocket->read(1); //TODO: refactor like processDataV4
+ type = BA[0];
+
+ if ( ( type & 0x80 ) == 0x00 ) // MSB of type not set
+ {
+ if ( type != 0x00 )
+ {
+ // ABORT CONNEXION
+ tcpSocket->readAll();
+ return;
+ }
+
+ // read data
+ do
+ {
+ BA = tcpSocket->read(1);
+ b = BA[0];
+ if ( b != 0xFF )
+ buffer.append( b );
+ } while ( b != 0xFF );
+
+ currentFrame.append( buffer );
+ }
+ else // MSB of type set
+ {
+ if ( type != 0xFF )
+ {
+ // ERROR, ABORT CONNEXION
+ close();
+ return;
+ }
+
+ quint8 length = 0x00;
+
+ bool bIsNotZero = true;
+ do
+ {
+ BA = tcpSocket->read(1);
+ b = BA[0];
+ bIsNotZero = ( b != 0x00 ? true : false );
+ if ( bIsNotZero ) // b must be != 0
+ {
+ quint8 b_v = b & 0x7F;
+ length *= 128;
+ length += b_v;
+ }
+ } while ( ( ( b & 0x80 ) == 0x80 ) && bIsNotZero );
+
+ BA = tcpSocket->read(length); // discard this bytes
+ }
+
+ if ( currentFrame.size() > 0 )
+ {
+ emit frameReceived( QString::fromUtf8(currentFrame) );
+ currentFrame.clear();
+ }
+
+ if ( tcpSocket->bytesAvailable() )
+ processDataV0();
+}
+
+void QWsSocket::processDataV4()
+{
+ if( state() == QAbstractSocket::ConnectingState )
+ {
+ processHandshake();
+ }
+ else
+ while (true)
+ switch ( readingState ) {
+ case HeaderPending: {
+ if (tcpSocket->bytesAvailable() < 2)
+ return;
+
+ // END, RSV1-3, Opcode
+ char header[2];
+ tcpSocket->read(header, 2); // XXX: Handle return value
+ isFinalFragment = (header[0] & 0x80) != 0;
+ opcode = static_cast<EOpcode>(header[0] & 0x0F);
+
+ // Mask, PayloadLength
+ hasMask = (header[1] & 0x80) != 0;
+ quint8 length = (header[1] & 0x7F);
+
+ switch (length)
+ {
+ case 126:
+ readingState = PayloadLengthPending;
+ break;
+ case 127:
+ readingState = BigPayloadLenghPending;
+ break;
+ default:
+ payloadLength = length;
+ readingState = MaskPending;
+ break;
+ }
+ }; break;
+ case PayloadLengthPending: {
+ if (tcpSocket->bytesAvailable() < 2)
+ return;
+
+ uchar length[2];
+ tcpSocket->read(reinterpret_cast<char *>(length), 2); // XXX: Handle return value
+ payloadLength = qFromBigEndian<quint16>(reinterpret_cast<const uchar *>(length));
+ readingState = MaskPending;
+ }; break;
+ case BigPayloadLenghPending: {
+ if (tcpSocket->bytesAvailable() < 8)
+ return;
+
+ uchar length[8];
+ tcpSocket->read(reinterpret_cast<char *>(length), 8); // XXX: Handle return value
+ // Most significant bit must be set to 0 as per http://tools.ietf.org/html/rfc6455#section-5.2
+ // XXX: Check for that?
+ payloadLength = qFromBigEndian<quint64>(length) & ~(1LL << 63);
+ readingState = MaskPending;
+ }; break;
+ case MaskPending: {
+ if (!hasMask) {
+ readingState = PayloadBodyPending;
+ break;
+ }
+
+ if (tcpSocket->bytesAvailable() < 4)
+ return;
+
+ tcpSocket->read(maskingKey.data(), 4); // XXX: Handle return value
+
+ if ( opcode == OpClose )
+ {
+ readingState = CloseDataPending;
+ }
+ else
+ {
+ readingState = PayloadBodyPending;
+ }
+ }; /* Intentional fall-through */
+ case PayloadBodyPending: {
+ // TODO: Handle large payloads
+ if (tcpSocket->bytesAvailable() < static_cast<qint32>(payloadLength))
+ return;
+
+ if ( opcode == OpClose )
+ {
+ if ( payloadLength >= 2 && tcpSocket->bytesAvailable() >= 2 )
+ {
+ uchar bytes[2];
+ tcpSocket->read( reinterpret_cast<char *>(bytes), 2 );
+ closeStatusCode = (ECloseStatusCode)qFromBigEndian<quint16>( reinterpret_cast<const uchar *>(bytes) );
+ }
+ else
+ {
+ closeStatusCode = NoCloseStatusCode;
+ }
+ }
+
+ QByteArray ApplicationData = tcpSocket->read( payloadLength );
+ if ( hasMask )
+ ApplicationData = QWsSocket::mask( ApplicationData, maskingKey );
+ currentFrame.append( ApplicationData );
+
+ readingState = HeaderPending;
+
+ if ( !isFinalFragment )
+ break;
+
+ switch ( opcode )
+ {
+ case OpBinary:
+ emit frameReceived( currentFrame );
+ break;
+ case OpText:
+ emit frameReceived( QString::fromUtf8(currentFrame) );
+ break;
+ case OpPing:
+ write( QWsSocket::composeHeader( true, OpPong, 0 ) );
+ break;
+ case OpPong:
+ emit pong( pingTimer.elapsed() );
+ break;
+ case OpClose:
+ closingHandshakeReceived = true;
+ close( closeStatusCode );
+ break;
+ default:
+ // DO NOTHING
+ break;
+ }
+
+ currentFrame.clear();
+ }; break;
+ case CloseDataPending:
+ default:
+ break;
+ } /* while (true) switch */
+}
+
+qint64 QWsSocket::writeFrame ( const QByteArray & byteArray )
+{
+ return tcpSocket->write( byteArray );
+}
+
+qint64 QWsSocket::writeFrames ( const QList<QByteArray> & framesList )
+{
+ qint64 nbBytesWritten = 0;
+ for ( int i=0 ; i<framesList.size() ; i++ )
+ {
+ nbBytesWritten += writeFrame( framesList[i] );
+ }
+ return nbBytesWritten;
+}
+
+void QWsSocket::processTcpStateChanged( QAbstractSocket::SocketState tcpSocketState )
+{
+ QAbstractSocket::SocketState wsSocketState = QAbstractSocket::state();
+ switch ( tcpSocketState )
+ {
+ case QAbstractSocket::HostLookupState:
+ {
+ QAbstractSocket::setSocketState( QAbstractSocket::HostLookupState );
+ emit QAbstractSocket::stateChanged( QAbstractSocket::HostLookupState );
+ break;
+ }
+ case QAbstractSocket::ConnectingState:
+ {
+ QAbstractSocket::setSocketState( QAbstractSocket::ConnectingState );
+ emit QAbstractSocket::stateChanged( QAbstractSocket::ConnectingState );
+ break;
+ }
+ case QAbstractSocket::ConnectedState:
+ {
+ if ( wsSocketState == QAbstractSocket::ConnectingState )
+ {
+ key = QWsServer::generateNonce();
+ QString handshake = composeOpeningHandShake( QLatin1String("/"), QLatin1String("example.com"), QString(), QString(), key );
+ tcpSocket->write( handshake.toUtf8() );
+ }
+ break;
+ }
+ case QAbstractSocket::ClosingState:
+ {
+ if ( wsSocketState == QAbstractSocket::ConnectedState )
+ {
+ QWsSocket::close( CloseGoingAway );
+ QAbstractSocket::setSocketState( QAbstractSocket::ClosingState );
+ emit QAbstractSocket::stateChanged( QAbstractSocket::ClosingState );
+ emit QAbstractSocket::aboutToClose();
+ }
+ break;
+ }
+ case QAbstractSocket::UnconnectedState:
+ {
+ if ( wsSocketState != QAbstractSocket::UnconnectedState )
+ {
+ QAbstractSocket::setSocketError( QAbstractSocket::NetworkError );
+ emit QAbstractSocket::error( QAbstractSocket::NetworkError );
+ QAbstractSocket::setSocketState( QAbstractSocket::UnconnectedState );
+ emit QAbstractSocket::stateChanged( QAbstractSocket::UnconnectedState );
+ emit QAbstractSocket::disconnected();
+ }
+ closingHandshakeSent = false;
+ closingHandshakeReceived = false;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+QByteArray QWsSocket::generateMaskingKey()
+{
+ QByteArray key;
+ for ( int i=0 ; i<4 ; i++ )
+ {
+ key.append( qrand() % 0x100 );
+ }
+ return key;
+}
+
+QByteArray QWsSocket::generateMaskingKeyV4( QString key, QString nonce )
+{
+ QString concat = key + nonce + QLatin1String("61AC5F19-FBBA-4540-B96F-6561F1AB40A8");
+ QByteArray hash = QCryptographicHash::hash ( concat.toUtf8(), QCryptographicHash::Sha1 );
+ return hash;
+}
+
+QByteArray QWsSocket::mask( QByteArray & data, QByteArray & maskingKey )
+{
+ QByteArray result;
+ result.reserve( data.size() );
+
+ for ( int i=0 ; i<data.size() ; i++ )
+ {
+ result[i] = ( data[i] ^ maskingKey[ i % 4 ] );
+ }
+
+ return result;
+}
+
+QList<QByteArray> QWsSocket::composeFrames( QByteArray byteArray, bool asBinary, int maxFrameBytes )
+{
+ if ( maxFrameBytes == 0 )
+ maxFrameBytes = maxBytesPerFrame;
+
+ QList<QByteArray> framesList;
+
+ QByteArray maskingKey;
+
+ int nbFrames = byteArray.size() / maxFrameBytes + 1;
+
+ for ( int i=0 ; i<nbFrames ; i++ )
+ {
+ QByteArray BA;
+
+ // end, size
+ bool end = false;
+ quint64 size = maxFrameBytes;
+ EOpcode opcode = OpContinue;
+ if ( i == nbFrames-1 ) // for multi-frames
+ {
+ end = true;
+ size = byteArray.size();
+ }
+ if ( i == 0 )
+ {
+ if ( asBinary )
+ opcode = OpBinary;
+ else
+ opcode = OpText;
+ }
+
+ // Header
+ BA.append( QWsSocket::composeHeader( end, opcode, size, maskingKey ) );
+
+ // Application Data
+ QByteArray dataForThisFrame = byteArray.left( size );
+ byteArray.remove( 0, size );
+
+ //dataForThisFrame = QWsSocket::mask( dataForThisFrame, maskingKey );
+ BA.append( dataForThisFrame );
+
+ framesList << BA;
+ }
+
+ return framesList;
+}
+
+QByteArray QWsSocket::composeHeader( bool end, EOpcode opcode, quint64 payloadLength, QByteArray maskingKey )
+{
+ QByteArray BA;
+ quint8 byte;
+
+ // end, RSV1-3, Opcode
+ byte = 0x00;
+ // end
+ if ( end )
+ byte = (byte | 0x80);
+ // Opcode
+ byte = (byte | opcode);
+ BA.append( byte );
+
+ // Mask, PayloadLength
+ byte = 0x00;
+ QByteArray BAsize;
+ // Mask
+ if ( maskingKey.size() == 4 )
+ byte = (byte | 0x80);
+ // PayloadLength
+ if ( payloadLength <= 125 )
+ {
+ byte = (byte | payloadLength);
+ }
+ // Extended payloadLength
+ else
+ {
+ // 2 bytes
+ if ( payloadLength <= 0xFFFF )
+ {
+ byte = ( byte | 126 );
+ BAsize.append( ( payloadLength >> 1*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 0*8 ) & 0xFF );
+ }
+ // 8 bytes
+ else if ( payloadLength <= 0x7FFFFFFF )
+ {
+ byte = ( byte | 127 );
+ BAsize.append( ( payloadLength >> 7*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 6*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 5*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 4*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 3*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 2*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 1*8 ) & 0xFF );
+ BAsize.append( ( payloadLength >> 0*8 ) & 0xFF );
+ }
+ }
+ BA.append( byte );
+ BA.append( BAsize );
+
+ // Masking
+ if ( maskingKey.size() == 4 )
+ BA.append( maskingKey );
+
+ return BA;
+}
+
+void QWsSocket::ping()
+{
+ pingTimer.restart();
+ QByteArray pingFrame = QWsSocket::composeHeader( true, OpPing, 0 );
+ writeFrame( pingFrame );
+}
+
+void QWsSocket::setResourceName( QString rn )
+{
+ _resourceName = rn;
+}
+
+void QWsSocket::setHost( QString h )
+{
+ _host = h;
+}
+
+void QWsSocket::setHostAddress( QString ha )
+{
+ _hostAddress = ha;
+}
+
+void QWsSocket::setHostPort( int hp )
+{
+ _hostPort = hp;
+}
+
+void QWsSocket::setOrigin( QString o )
+{
+ _origin = o;
+}
+
+void QWsSocket::setProtocol( QString p )
+{
+ _protocol = p;
+}
+
+void QWsSocket::setExtensions( QString e )
+{
+ _extensions = e;
+}
+
+EWebsocketVersion QWsSocket::version()
+{
+ return _version;
+}
+
+QString QWsSocket::resourceName()
+{
+ return _resourceName;
+}
+
+QString QWsSocket::host()
+{
+ return _host;
+}
+
+QString QWsSocket::hostAddress()
+{
+ return _hostAddress;
+}
+
+int QWsSocket::hostPort()
+{
+ return _hostPort;
+}
+
+QString QWsSocket::origin()
+{
+ return _origin;
+}
+
+QString QWsSocket::protocol()
+{
+ return _protocol;
+}
+
+QString QWsSocket::extensions()
+{
+ return _extensions;
+}
+
+QString QWsSocket::composeOpeningHandShake( QString resourceName, QString host, QString origin, QString extensions, QString key )
+{
+ QString hs;
+ hs.append(QLatin1String("GET ") + resourceName + QLatin1String(" HTTP/1.1\r\n"));
+ hs.append(QLatin1String("Host: ") + host + "\r\n");
+ hs.append(QLatin1String("Upgrade: websocket\r\n"));
+ hs.append(QLatin1String("Connection: Upgrade\r\n"));
+ hs.append(QLatin1String("Sec-WebSocket-Key: ") + key + QLatin1String("\r\n"));
+ hs.append(QLatin1String("Origin: ") + origin + QLatin1String("\r\n"));
+ hs.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions + QLatin1String("\r\n"));
+ hs.append(QLatin1String("Sec-WebSocket-Version: 13\r\n"));
+ hs.append(QLatin1String("\r\n"));
+ return hs;
+}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h
new file mode 100644
index 0000000000..4bc095aa19
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h
@@ -0,0 +1,170 @@
+#ifndef QWSSOCKET_H
+#define QWSSOCKET_H
+
+#include <QTcpSocket>
+#include <QHostAddress>
+#include <QTime>
+
+enum EWebsocketVersion
+{
+ WS_VUnknow = -1,
+ WS_V0 = 0,
+ WS_V4 = 4,
+ WS_V5 = 5,
+ WS_V6 = 6,
+ WS_V7 = 7,
+ WS_V8 = 8,
+ WS_V13 = 13
+};
+
+class QWsSocket : public QAbstractSocket
+{
+ Q_OBJECT
+
+ friend class QWsServer;
+
+public:
+ enum EOpcode
+ {
+ OpContinue = 0x0,
+ OpText = 0x1,
+ OpBinary = 0x2,
+ OpReserved3 = 0x3,
+ OpReserved4 = 0x4,
+ OpReserved5 = 0x5,
+ OpReserved6 = 0x6,
+ OpReserved7 = 0x7,
+ OpClose = 0x8,
+ OpPing = 0x9,
+ OpPong = 0xA,
+ OpReservedB = 0xB,
+ OpReservedV = 0xC,
+ OpReservedD = 0xD,
+ OpReservedE = 0xE,
+ OpReservedF = 0xF
+ };
+ enum ECloseStatusCode
+ {
+ NoCloseStatusCode = 0,
+ CloseNormal = 1000,
+ CloseGoingAway = 1001,
+ CloseProtocolError = 1002,
+ CloseDataTypeNotSupported = 1003,
+ CloseReserved1004 = 1004,
+ CloseMissingStatusCode = 1005,
+ CloseAbnormalDisconnection = 1006,
+ CloseWrongDataType = 1007,
+ ClosePolicyViolated = 1008,
+ CloseTooMuchData = 1009,
+ CloseMissingExtension = 1010,
+ CloseBadOperation = 1011,
+ CloseTLSHandshakeFailed = 1015
+ };
+
+public:
+ // ctor
+ QWsSocket( QObject * parent = 0, QTcpSocket * socket = 0, EWebsocketVersion ws_v = WS_V13 );
+ // dtor
+ virtual ~QWsSocket();
+
+ // Public methods
+ EWebsocketVersion version();
+ QString resourceName();
+ QString host();
+ QString hostAddress();
+ int hostPort();
+ QString origin();
+ QString protocol();
+ QString extensions();
+
+ void setResourceName( QString rn );
+ void setHost( QString h );
+ void setHostAddress( QString ha );
+ void setHostPort( int hp );
+ void setOrigin( QString o );
+ void setProtocol( QString p );
+ void setExtensions( QString e );
+
+ qint64 write( const QString & string ); // write data as text
+ qint64 write( const QByteArray & byteArray ); // write data as binary
+
+public slots:
+ void connectToHost( const QString & hostName, quint16 port, OpenMode mode = ReadWrite );
+ void connectToHost( const QHostAddress & address, quint16 port, OpenMode mode = ReadWrite );
+ void disconnectFromHost();
+ void abort( QString reason = QString() );
+ void ping();
+
+signals:
+ void frameReceived(QString frame);
+ void frameReceived(QByteArray frame);
+ void pong(quint64 elapsedTime);
+
+protected:
+ qint64 writeFrames ( const QList<QByteArray> & framesList );
+ qint64 writeFrame ( const QByteArray & byteArray );
+
+protected slots:
+ virtual void close( ECloseStatusCode closeStatusCode = NoCloseStatusCode, QString reason = QString() );
+ void processDataV0();
+ void processDataV4();
+ void processHandshake();
+ void processTcpStateChanged( QAbstractSocket::SocketState socketState );
+
+private:
+ enum EReadingState
+ {
+ HeaderPending,
+ PayloadLengthPending,
+ BigPayloadLenghPending,
+ MaskPending,
+ PayloadBodyPending,
+ CloseDataPending
+ };
+
+ // private vars
+ QTcpSocket * tcpSocket;
+ QByteArray currentFrame;
+ QTime pingTimer;
+
+ EWebsocketVersion _version;
+ QString _resourceName;
+ QString _host;
+ QString _hostAddress;
+ int _hostPort;
+ QString _origin;
+ QString _protocol;
+ QString _extensions;
+ bool serverSideSocket;
+
+ bool closingHandshakeSent;
+ bool closingHandshakeReceived;
+
+ EReadingState readingState;
+ EOpcode opcode;
+ bool isFinalFragment;
+ bool hasMask;
+ quint64 payloadLength;
+ QByteArray maskingKey;
+ ECloseStatusCode closeStatusCode;
+
+ static const QString regExpAcceptStr;
+ static const QString regExpUpgradeStr;
+ static const QString regExpConnectionStr;
+ QString handshakeResponse;
+ QString key;
+
+public:
+ // Static functions
+ static QByteArray generateMaskingKey();
+ static QByteArray generateMaskingKeyV4( QString key, QString nonce );
+ static QByteArray mask( QByteArray & data, QByteArray & maskingKey );
+ static QList<QByteArray> composeFrames( QByteArray byteArray, bool asBinary = false, int maxFrameBytes = 0 );
+ static QByteArray composeHeader( bool end, EOpcode opcode, quint64 payloadLength, QByteArray maskingKey = QByteArray() );
+ static QString composeOpeningHandShake( QString resourceName, QString host, QString origin, QString extensions, QString key );
+
+ // static vars
+ static int maxBytesPerFrame;
+};
+
+#endif // QWSSOCKET_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro
new file mode 100644
index 0000000000..f52bda256e
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro
@@ -0,0 +1,21 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2012-03-05T10:38:43
+#
+#-------------------------------------------------
+
+QT += network
+
+QT -= gui
+
+TARGET = QtWebsocket
+TEMPLATE = lib
+CONFIG += staticlib
+
+SOURCES += \
+ QWsServer.cpp \
+ QWsSocket.cpp
+
+HEADERS += \
+ QWsServer.h \
+ QWsSocket.h
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj
new file mode 100644
index 0000000000..306dcada09
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="QtWebsocket"
+ ProjectGUID="{7E3A920C-4257-41A1-B9B9-BFA138C1C8A2}"
+ Keyword="Qt4VSv1.0"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;.\GeneratedFiles&quot;;&quot;.&quot;;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;"
+ PreprocessorDefinitions=",UNICODE,WIN32,QT_LARGEFILE_SUPPORT;QT_DLL;QT_NO_DEBUG,NDEBUG;QT_CORE_LIB;QT_NETWORK_LIB;QTWEBSOCKET_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="false"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)\$(ProjectName).lib"
+ AdditionalLibraryDirectories="$(QTDIR)\lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;.\GeneratedFiles&quot;;&quot;.&quot;;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;"
+ PreprocessorDefinitions=",UNICODE,WIN32,QT_LARGEFILE_SUPPORT;QT_DLL;QT_CORE_LIB;QT_NETWORK_LIB;QTWEBSOCKET_LIB"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)\$(ProjectName).lib"
+ AdditionalLibraryDirectories="$(QTDIR)\lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;cxx;c;def"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\QWsServer.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\QWsSocket.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\QWsServer.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc&apos;ing QWsServer.h..."
+ CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
+ Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc&apos;ing QWsServer.h..."
+ CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
+ Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\QWsSocket.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc&apos;ing QWsSocket.h..."
+ CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
+ Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Moc&apos;ing QWsSocket.h..."
+ CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
+ Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Form Files"
+ Filter="ui"
+ UniqueIdentifier="{99349809-55BA-4b9d-BF79-8FDBB0286EB3}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="qrc;*"
+ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}"
+ ParseFiles="false"
+ >
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ Filter="moc;h;cpp"
+ UniqueIdentifier="{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}"
+ SourceControlFiles="false"
+ >
+ <Filter
+ Name="Release"
+ Filter="cpp;moc"
+ SourceControlFiles="false"
+ >
+ <File
+ RelativePath=".\GeneratedFiles\Release\moc_QWsServer.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\GeneratedFiles\Release\moc_QWsSocket.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Debug"
+ Filter="cpp;moc"
+ SourceControlFiles="false"
+ >
+ <File
+ RelativePath=".\GeneratedFiles\Debug\moc_QWsServer.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\GeneratedFiles\Debug\moc_QWsSocket.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ <Global
+ Name="lreleaseOptions"
+ Value=""
+ />
+ <Global
+ Name="lupdateOnBuild"
+ Value="0"
+ />
+ <Global
+ Name="lupdateOptions"
+ Value=""
+ />
+ <Global
+ Name="MocDir"
+ Value=".\GeneratedFiles\$(ConfigurationName)"
+ />
+ <Global
+ Name="MocOptions"
+ Value=""
+ />
+ <Global
+ Name="QtVersion Win32"
+ Value="4.8.2"
+ />
+ <Global
+ Name="RccDir"
+ Value=".\GeneratedFiles"
+ />
+ <Global
+ Name="UicDir"
+ Value=".\GeneratedFiles"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
new file mode 100644
index 0000000000..a89d1efcb4
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
@@ -0,0 +1,31 @@
+#include "fordsdlcore_plugin.h"
+#include "smartdevicelink.h"
+#include <QDebug>
+#include <qqml.h>
+#include "sdlalert.h"
+#include <QQmlEngine>
+#include <QQmlContext>
+
+QObject* sdlSingleton(QQmlEngine * engine, QJSEngine * js) {
+ Q_UNUSED(engine)
+ Q_UNUSED(js)
+
+ engine->rootContext()->setContextProperty("MediaApps", SmartDeviceLink::getInstance().getMediaApps());
+
+ return (QObject *) &SmartDeviceLink::getInstance();
+}
+
+QObject* mediaAppsSingleton(QQmlEngine * engine, QJSEngine * js) {
+ Q_UNUSED(engine)
+ Q_UNUSED(js)
+
+ return (QObject *) SmartDeviceLink::getInstance().getMediaApps();
+}
+
+void FordSdlCorePlugin::registerTypes(const char *uri)
+{
+ qmlRegisterSingletonType<SdlAppsListModel>(uri, 1, 0, "MediaApps", mediaAppsSingleton);
+ qmlRegisterSingletonType<SmartDeviceLink>(uri, 1, 0, "AppLink", sdlSingleton);
+}
+
+
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h
new file mode 100644
index 0000000000..655dcb5178
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h
@@ -0,0 +1,16 @@
+#ifndef FORDSDLCORE_PLUGIN_H
+#define FORDSDLCORE_PLUGIN_H
+
+#include <QQmlExtensionPlugin>
+
+class FordSdlCorePlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+
+public:
+ void registerTypes(const char *uri);
+};
+
+#endif // FORDSDLCORE_PLUGIN_H
+
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/qmldir b/src/components/qt_hmi/References/Work/fordsdlcore/qmldir
new file mode 100644
index 0000000000..da1a7b7f96
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/qmldir
@@ -0,0 +1,3 @@
+module com.ford.sdlcore
+plugin FordSdlCore
+
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp
new file mode 100644
index 0000000000..f625c16b41
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp
@@ -0,0 +1,6 @@
+#include "sdlalert.h"
+
+SdlAlert::SdlAlert(QObject *parent) :
+ QQuickItem()
+{
+}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h
new file mode 100644
index 0000000000..cb46236db1
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h
@@ -0,0 +1,18 @@
+#ifndef SDLALERT_H
+#define SDLALERT_H
+
+#include <QQuickItem>
+
+class SdlAlert : public QQuickItem
+{
+ Q_OBJECT
+public:
+ explicit SdlAlert(QObject *parent = 0);
+
+signals:
+
+public slots:
+
+};
+
+#endif // SDLALERT_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp
new file mode 100644
index 0000000000..104b31abe0
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp
@@ -0,0 +1,6 @@
+#include "sdlappslistmodel.h"
+
+SdlAppsListModel::SdlAppsListModel(QObject *parent) :
+ QAbstractListModel(parent)
+{
+}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h
new file mode 100644
index 0000000000..9b213e666e
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h
@@ -0,0 +1,47 @@
+#ifndef SDLAPPSLISTMODEL_H
+#define SDLAPPSLISTMODEL_H
+
+#include <QAbstractListModel>
+#include <QStringList>
+
+class SdlAppsListModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ explicit SdlAppsListModel(QObject *parent = 0);
+
+ int rowCount(const QModelIndex &parent) const { return m_data.size(); }
+
+ QVariant data(const QModelIndex &index, int role) const {
+ return m_data.values().at(index.row());
+ }
+
+ virtual QHash<int, QByteArray> roleNames() const {
+ QHash<int, QByteArray> roles;
+ roles['t'] = "text";
+ return roles;
+ }
+
+ void append(int id, QString string) {
+ beginResetModel();
+ m_data.clear();
+ m_data[id] = string;
+ endResetModel();
+ }
+
+ void clear() {
+ beginResetModel();
+ m_data.clear();
+ endResetModel();
+ }
+
+signals:
+
+public slots:
+
+private:
+ QHash<int, QString> m_data;
+
+};
+
+#endif // SDLAPPSLISTMODEL_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp
new file mode 100644
index 0000000000..57cb8ac507
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp
@@ -0,0 +1,263 @@
+#include "smartdevicelink.h"
+#include <QDebug>
+#include "QtWebsocket/QWsSocket.h"
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <unistd.h>
+
+SmartDeviceLink::SmartDeviceLink(QQuickItem *parent):
+ QObject(parent)
+{
+ connect(&m_ws_basic, SIGNAL(connected()), this, SLOT(basic_connected()));
+ connect(&m_ws_basic, SIGNAL(frameReceived(QString)), this, SLOT(basic_receive(QString)));
+ connect(&m_ws_basic, SIGNAL(disconnected()), this, SLOT(disconnected()));
+
+ connect(&m_ws_buttons, SIGNAL(connected()), this, SLOT(buttons_connected()));
+ connect(&m_ws_buttons, SIGNAL(frameReceived(QString)), this, SLOT(buttons_receive(QString)));
+ connect(&m_ws_buttons, SIGNAL(disconnected()), this, SLOT(disconnected()));
+
+ connect(&m_ws_tts, SIGNAL(connected()), this, SLOT(tts_connected()));
+ connect(&m_ws_tts, SIGNAL(frameReceived(QString)), this, SLOT(tts_receive(QString)));
+ connect(&m_ws_tts, SIGNAL(disconnected()), this, SLOT(disconnected()));
+
+ connect(&m_ws_vehicle, SIGNAL(connected()), this, SLOT(vehicle_connected()));
+ connect(&m_ws_vehicle, SIGNAL(frameReceived(QString)), this, SLOT(vehicle_receive(QString)));
+ connect(&m_ws_vehicle, SIGNAL(disconnected()), this, SLOT(disconnected()));
+
+ connect(&m_ws_ui, SIGNAL(connected()), this, SLOT(ui_connected()));
+ connect(&m_ws_ui, SIGNAL(frameReceived(QString)), this, SLOT(ui_receive(QString)));
+ connect(&m_ws_ui, SIGNAL(disconnected()), this, SLOT(disconnected()));
+
+ connect(&m_ws_vr, SIGNAL(connected()), this, SLOT(vr_connected()));
+ connect(&m_ws_vr, SIGNAL(frameReceived(QString)), this, SLOT(vr_receive(QString)));
+ connect(&m_ws_vr, SIGNAL(disconnected()), this, SLOT(disconnected()));
+
+ connect(this, SIGNAL(newAppAvailable(int, QString)), this, SLOT(registerApp(int,QString)));
+
+ m_ws_buttons.connectToHost( QLatin1String("127.0.0.1"), 8087 );
+ m_ws_tts.connectToHost( QLatin1String("127.0.0.1"), 8087 );
+ m_ws_vr.connectToHost( QLatin1String("127.0.0.1"), 8087 );
+ m_ws_basic.connectToHost( QLatin1String("127.0.0.1"), 8087 );
+ m_ws_vehicle.connectToHost( QLatin1String("127.0.0.1"), 8087 );
+ m_ws_ui.connectToHost( QLatin1String("127.0.0.1"), 8087 );
+}
+
+SmartDeviceLink::~SmartDeviceLink()
+{
+ qDebug() << "SmartDeviceLink destroyed";
+}
+
+void SmartDeviceLink::basic_connected() {
+ basic_send("{\"jsonrpc\":\"2.0\",\"id\":600,\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"BasicCommunicationClient\"}}");
+}
+
+void SmartDeviceLink::buttons_connected() {
+ buttons_send("{\"jsonrpc\":\"2.0\",\"id\":200,\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"Buttons\"}}");
+}
+
+void SmartDeviceLink::tts_connected() {
+ tts_send("{\"jsonrpc\":\"2.0\",\"id\":300,\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"TTS\"}}");
+}
+
+void SmartDeviceLink::vehicle_connected() {
+ vehicle_send("{\"jsonrpc\":\"2.0\",\"id\":700,\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"VehicleInfo\"}}");
+}
+
+void SmartDeviceLink::ui_connected() {
+ ui_send("{\"jsonrpc\":\"2.0\",\"id\":400,\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"UI\"}}");
+}
+
+void SmartDeviceLink::vr_connected() {
+ vr_send("{\"jsonrpc\":\"2.0\",\"id\":500,\"method\":\"MB.registerComponent\",\"params\":{\"componentName\":\"VR\"}}");
+}
+
+void SmartDeviceLink::basic_send(QString message) {
+ qDebug() << "Sending (basic):" << message;
+ m_ws_basic.write(message.append('\n'));
+}
+
+void SmartDeviceLink::buttons_send(QString message) {
+ qDebug() << "Sending (buttons):" << message;
+ m_ws_buttons.write(message.append('\n'));
+}
+
+void SmartDeviceLink::tts_send(QString message) {
+ qDebug() << "Sending (tts):" << message;
+ m_ws_tts.write(message.append('\n'));
+}
+
+void SmartDeviceLink::vehicle_send(QString message) {
+ qDebug() << "Sending (vehicle):" << message;
+ m_ws_vehicle.write(message.append('\n'));
+}
+
+void SmartDeviceLink::ui_send(QString message) {
+ qDebug() << "Sending (ui):" << message;
+ m_ws_ui.write(message.append('\n'));
+}
+
+void SmartDeviceLink::vr_send(QString message) {
+ qDebug() << "Sending (vr):" << message;
+ m_ws_vr.write(message.append('\n'));
+}
+
+void SmartDeviceLink::basic_receive(QString message) {
+ qDebug() << "Receiving(basic):" << message;
+ QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
+ int id = root.value("id").toDouble();
+ int result = root.value("result").toDouble();
+ QString method = root.value("method").toString();
+
+ if (id == 600) {
+ char *reg, *unreg, *update;
+
+ asprintf(&reg, "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\",\"params\":{\"propertyName\":\"BasicCommunication.OnAppRegistered\"}}", result+1);
+ basic_send(reg);
+ free(reg);
+
+ asprintf(&unreg, "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\",\"params\":{\"propertyName\":\"BasicCommunication.OnAppUnregistered\"}}", result+2);
+ basic_send(unreg);
+ free(unreg);
+
+ asprintf(&update, "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\",\"params\":{\"propertyName\":\"BasicCommunication.OnDeviceListUpdated\"}} ", result+3);
+ basic_send(update);
+ free(update);
+ }
+ else if (method.compare("BasicCommunication.OnAppRegistered") == 0) {
+ QJsonObject params = root.value("params").toObject();
+ QJsonObject application = params.value("application").toObject();
+ QString appName = application.value("appName").toString();
+ int appId = application.value("appId").toDouble();
+
+ char * update;
+ asprintf(&update, "{\"jsonrpc\":\"2.0\",\"id\":3000,\"method\":\"BasicCommunication.ActivateApp\",\"params\":{\"appName\":\"%s\",\"appId\":%i}}", appName.toLocal8Bit().data(), appId);
+ basic_send(update);
+ free(update);
+ emit newAppAvailable(appId, appName);
+ }
+ else if (method.compare("BasicCommunication.OnAppUnregistered") == 0) {
+ m_media_apps.clear();
+ }
+}
+
+void SmartDeviceLink::buttons_receive(QString message) {
+ qDebug() << "Receiving(buttons):" << message;
+ QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
+ int id = root.value("id").toDouble();
+ QString method = root.value("method").toString();
+
+ if (method.compare("Buttons.GetCapabilities") == 0) {
+ buttons_send("{\"jsonrpc\":\"2.0\",\"id\":19,\"result\":{\"capabilities\":[{\"name\":\"PRESET_0\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_1\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_2\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_3\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_4\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_5\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_6\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_7\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_8\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"PRESET_9\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"OK\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"SEEKLEFT\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"SEEKRIGHT\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"TUNEUP\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":\"TUNEDOWN\",\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true}],\"presetBankCapabilities\":{\"onScreenPresetsAvailable\":true},\"method\":\"Buttons.GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}}");
+ }
+}
+
+void SmartDeviceLink::tts_receive(QString message) {
+ qDebug() << "Receiving(tts):" << message;
+ QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
+ int id = root.value("id").toDouble();
+ QString method = root.value("method").toString();
+
+ if (method.compare("TTS.GetCapabilities") == 0) {
+ tts_send("{\"jsonrpc\":\"2.0\",\"id\":18,\"result\":{\"capabilities\":[\"TEXT\"],\"resultCode\":\"SUCCESS\",\"method\":\"TTS.GetCapabilitiesResponse\"}}");
+ }
+ else if (method.compare("TTS.GetLanguage") == 0) {
+ tts_send("{\"jsonrpc\":\"2.0\",\"id\":26,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"TTS.GetLanguageResponse\",\"language\":\"EN-US\"}}");
+ }
+ else if (method.compare("TTS.GetSupportedLanguages") == 0) {
+ tts_send("{\"jsonrpc\":\"2.0\",\"id\":22,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"TTS.GetSupportedLanguagesResponse\",\"languages\":[\"EN-US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
+ }
+
+}
+
+void SmartDeviceLink::vehicle_receive(QString message) {
+ qDebug() << "Receiving(vehicle):" << message;
+ QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
+ int id = root.value("id").toDouble();
+ QString method = root.value("method").toString();
+
+ if (method.compare("VehicleInfo.GetVehicleType") == 0) {
+ vehicle_send("{\"jsonrpc\":\"2.0\",\"id\":20,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"VehicleInfo.GetVehicleTypeResponse\",\"vehicleType\":{\"make\":\"Ford\",\"model\":\"Fiesta\",\"modelYear\":\"2013\",\"trim\":\"SE\"}}}");
+ }
+}
+
+void SmartDeviceLink::ui_receive(QString message) {
+ qDebug() << "Receiving(ui):" << message;
+ QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
+ int id = root.value("id").toDouble();
+ int result = root.value("result").toDouble();
+ QString method = root.value("method").toString();
+
+ if (id == 400) {
+ char *onchoise;
+ asprintf(&onchoise, "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\",\"params\":{\"propertyName\":\"VR.OnChoise\"}}", result + 1);
+ ui_send(onchoise);
+ free(onchoise);
+
+ ui_send("{\"jsonrpc\":\"2.0\",\"method\":\"UI.OnReady\"}");
+ }
+ else if (method.compare("UI.GetCapabilities") == 0) {
+ ui_send("{\"jsonrpc\":\"2.0\",\"id\":16,\"result\":{\"displayCapabilities\":{\"displayType\":\"GEN2_8_DMA\",\"textFields\":[{\"name\":\"mainField1\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"mainField2\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"statusBar\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"mediaClock\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"mediaTrack\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"alertText1\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"alertText2\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1}],\"mediaClockFormats\":[\"CLOCK1\",\"CLOCK2\",\"CLOCKTEXT1\",\"CLOCKTEXT2\",\"CLOCKTEXT3\"]},\"hmiZoneCapabilities\":[\"FRONT\",\"BACK\"],\"softButtonCapabilities\":[{\"shortPressAvailable\":true,\"longPressAvailable\":true,\"upDownAvailable\":true,\"imageSupported\":true}],\"method\":\"UI.GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}}");
+ }
+ else if (method.compare("UI.GetSupportedLanguages") == 0) {
+ ui_send("{\"jsonrpc\":\"2.0\",\"id\":21,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"UI.GetSupportedLanguagesResponse\",\"languages\":[\"EN-US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
+ }
+ else if (method.compare("UI.GetLanguage") == 0) {
+ ui_send("{\"jsonrpc\":\"2.0\",\"id\":24,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"UI.GetLanguageResponse\",\"hmiDisplayLanguage\":\"EN-US\"}}");
+ }
+ else if (method.compare("UI.Show") == 0) {
+ QJsonObject params = root.value("params").toObject();
+ setShow1(params.value("mainField1").toString());
+ setShow2(params.value("mainField2").toString());
+ char* response;
+ asprintf(&response, "{\"jsonrpc\":\"2.0\",\"id\":%i,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"UI.ShowResponse\"}}", id);
+ ui_send(response);
+ free(response);
+ }
+ else if (method.compare("UI.Alert") == 0) {
+ QJsonObject params = root.value("params").toObject();
+ QString message(params.value("AlertText1").toString());
+ message.append("\n").append(params.value("AlertText2").toString());
+ char * response;
+ asprintf(&response, "{\"jsonrpc\":\"2.0\",\"id\":%i,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"UI.AlertResponse\"}}", id);
+ ui_send(response);
+ free(response);
+ emit alert(message);
+ }
+
+}
+
+void SmartDeviceLink::vr_receive(QString message) {
+ qDebug() << "Receiving(vr):" << message;
+ QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
+ int id = root.value("id").toDouble();
+ QString method = root.value("method").toString();
+
+ if (method.compare("VR.GetCapabilities") == 0) {
+ vr_send("{\"jsonrpc\":\"2.0\",\"id\":17,\"result\":{\"capabilities\":[\"TEXT\"],\"method\":\"VR.GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}}");
+ }
+ else if (method.compare("VR.GetSupportedLanguages") == 0) {
+ vr_send("{\"jsonrpc\":\"2.0\",\"id\":23,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"VR.GetSupportedLanguagesResponse\",\"languages\":[\"EN-US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
+ }
+ else if (method.compare("VR.GetLanguage") == 0) {
+ vr_send("{\"jsonrpc\":\"2.0\",\"id\":25,\"result\":{\"resultCode\":\"SUCCESS\",\"method\":\"VR.GetLanguageResponse\",\"language\":\"EN-US\"}}");
+ }
+}
+
+void SmartDeviceLink::registerApp(int appId, QString appName) {
+ qDebug() << "New app registered:" << appName;
+ m_media_apps.append(appId, appName);
+}
+
+void SmartDeviceLink::setShow1(QString show) {
+ m_show1 = show;
+ emit show1Changed(show);
+}
+
+void SmartDeviceLink::setShow2(QString show) {
+ m_show2 = show;
+ emit show2Changed(show);
+}
+
+void SmartDeviceLink::disconnected() {
+ qDebug() << "Websocket disconnected";
+}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h
new file mode 100644
index 0000000000..f2e7f1b2b4
--- /dev/null
+++ b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h
@@ -0,0 +1,75 @@
+#ifndef SMARTDEVICELINK_H
+#define SMARTDEVICELINK_H
+
+#include <QQuickItem>
+#include <QStringListModel>
+#include "QtWebsocket/QWsSocket.h"
+#include "sdlappslistmodel.h"
+
+class SmartDeviceLink : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString show1 READ getShow1 NOTIFY show1Changed)
+ Q_PROPERTY(QString show2 READ getShow2 NOTIFY show2Changed)
+
+public:
+ SmartDeviceLink(QQuickItem *parent = 0);
+ ~SmartDeviceLink();
+
+ static SmartDeviceLink& getInstance() {
+ static SmartDeviceLink instance;
+ return instance;
+ }
+
+ SdlAppsListModel* getMediaApps() { return &m_media_apps; }
+ QString getShow1() { return m_show1; }
+ QString getShow2() { return m_show2; }
+
+private:
+ QWsSocket m_ws_basic;
+ QWsSocket m_ws_tts;
+ QWsSocket m_ws_buttons;
+ QWsSocket m_ws_vehicle;
+ QWsSocket m_ws_ui;
+ QWsSocket m_ws_vr;
+
+ SdlAppsListModel m_media_apps;
+
+ QString m_show1;
+ QString m_show2;
+
+ void basic_send(QString message);
+ void tts_send(QString message);
+ void buttons_send(QString message);
+ void vehicle_send(QString message);
+ void ui_send(QString message);
+ void vr_send(QString message);
+ void setShow1(QString);
+ void setShow2(QString);
+
+public slots:
+ void basic_connected();
+ void tts_connected();
+ void buttons_connected();
+ void vehicle_connected();
+ void ui_connected();
+ void vr_connected();
+
+ void basic_receive(QString);
+ void tts_receive(QString);
+ void buttons_receive(QString);
+ void vehicle_receive(QString);
+ void ui_receive(QString);
+ void vr_receive(QString);
+ void registerApp(int, QString);
+
+ void disconnected();
+
+signals:
+ void show1Changed(QString);
+ void show2Changed(QString);
+ void newAppAvailable(int, QString);
+ void alert(QString message);
+};
+
+#endif // SMARTDEVICELINK_H
diff --git a/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt b/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt
new file mode 100644
index 0000000000..e6eeb9e525
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt
@@ -0,0 +1,87 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
+set(dbus_dir ${components_dir}/dbus)
+set(codegen_dir ${dbus_dir}/codegen)
+set(codegen ${codegen_dir}/make_qml_dbus_qml.py)
+set(parser ${codegen_dir}/ford_xml_parser.py)
+set(interfaces_dir ${components_dir}/interfaces)
+set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
+set(proxy_dir ${CMAKE_CURRENT_BINARY_DIR}/hmi_api)
+set(qml_dirs hmi_api controls models popups views)
+set(qml_files MainWindow.qml)
+
+add_custom_target(qml_auto ALL
+ COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${proxy_dir}
+ DEPENDS ${api_xml} ${codegen} ${parser}
+ COMMENT "Generating files:
+ ${proxy_dir}/BasicCommunicationProxy.qml
+ ${proxy_dir}/ButtonsProxy.qml
+ ${proxy_dir}/NavigationProxy.qml
+ ${proxy_dir}/TTSProxy.qml
+ ${proxy_dir}/UIProxy.qml
+ ${proxy_dir}/VehicleInfoProxy.qml
+ ${proxy_dir}/VRProxy.qml
+ from:
+ ${api_xml} ..."
+)
+
+add_custom_target(qml_copy_resources ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${CMAKE_CURRENT_BINARY_DIR}/res
+ COMMENT "Copying resources")
+
+if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+ foreach(qml_dir ${qml_dirs})
+ add_custom_target(qml_copy_${qml_dir} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${qml_dir}
+ COMMENT "Copying directory ${qml_dir}")
+ endforeach(qml_dir)
+
+ add_dependencies(qml_auto qml_copy_hmi_api)
+
+ foreach(qml_file ${qml_files})
+ add_custom_target(qml_copy_${qml_file} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${qml_file} ${CMAKE_CURRENT_BINARY_DIR}/${qml_file}
+ COMMENT "Copying file ${qml_file}")
+ endforeach(qml_file)
+endif()
+
+install(DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}/controls
+ ${CMAKE_CURRENT_BINARY_DIR}/hmi_api
+ ${CMAKE_CURRENT_BINARY_DIR}/models
+ ${CMAKE_CURRENT_BINARY_DIR}/popups
+ ${CMAKE_CURRENT_BINARY_DIR}/res
+ ${CMAKE_CURRENT_BINARY_DIR}/views
+ DESTINATION bin/hmi)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainWindow.qml DESTINATION bin/hmi)
diff --git a/src/components/qt_hmi/qml_model_qt4/MainWindow.qml b/src/components/qt_hmi/qml_model_qt4/MainWindow.qml
new file mode 100644
index 0000000000..1a3b06fd41
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/MainWindow.qml
@@ -0,0 +1,356 @@
+/**
+ * @file MainWindow.qml
+ * @brief Implementation of main window.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import "./controls"
+import "./views"
+import "./hmi_api" as HmiApi
+import "./models"
+import "./popups"
+import "hmi_api/Common.js" as Common
+import "./models/Constants.js" as Constants
+import "models/Internal.js" as Internal
+
+Rectangle {
+ width: 1280
+ height: 768
+ property string startQml: "./views/ApplicationListView.qml"
+ property int minWidth: Constants.mainScreenMinWidth
+ property int minHeight: Constants.mainScreenMiHeight
+ color: Constants.secondaryColor
+
+ DataStorage {
+ id: dataContainer
+
+ onSystemContextChanged: {
+ sdlUI.onSystemContext(systemContext)
+ }
+
+ // Please note that applicationContext is changed only after setting currentApplication
+ onApplicationContextChanged: {
+ if (applicationContext) {
+ sdlBasicCommunication.onAppActivated(currentApplication.appId)
+ } else {
+ sdlBasicCommunication.onAppDeactivated(currentApplication.appId, contentLoader.item.category)
+ }
+ }
+ }
+
+// TODO(KKolodiy): find way for play sound
+// Audio {
+// id: beep
+// source: "res/initial.wav"
+// }
+
+ SettingsStorage {
+ id: settingsContainer
+ }
+
+ Item {
+ id: mainScreen
+ anchors.top: parent. top
+ anchors.left: parent.left
+ width: (parent.width - simulationScreen.width < minWidth) ?
+ minWidth : parent.width - simulationScreen.width
+ height: (parent.height - hardwareScreen.height < minHeight) ?
+ minHeight : parent.height - hardwareScreen.height
+ clip: true
+ visible: false
+
+ Item {
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: parent.height * 0.10
+ width: parent.width
+ HeaderMenu {}
+ }
+
+ Item {
+ height: parent.height * 0.90
+ width: parent.width
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Loader {
+ id: contentLoader
+ height: parent.height - Constants.margin
+ width: parent.width - 2 * Constants.margin
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.leftMargin: Constants.margin
+ anchors.rightMargin: Constants.margin
+ anchors.bottomMargin: Constants.margin
+
+
+ source:startQml
+ property variant viewTransitionStack : []
+
+ function reset() {
+ viewTransitionStack = []
+ }
+
+ property string currentLocation
+ function go(path, appId) {
+ console.debug("enter:", path, ", appId:", appId)
+ if (path) {
+ if (currentLocation !== path) {
+ viewTransitionStack.push({ uri: source.toString(), applicationContext: false })
+ if (appId) {
+ dataContainer.setCurrentApplication(appId)
+ }
+ currentLocation = path
+ source = path
+ }
+ }
+ console.debug("exit")
+ }
+
+ function back() {
+ if (viewTransitionStack.length) {
+ source = viewTransitionStack.pop().uri
+ }
+ currentLocation = ""
+ }
+
+ onStatusChanged: {
+ if (status == Component.Ready) {
+ if (!dataContainer.activeAlert) {
+ dataContainer.applicationContext = item.applicationContext
+ }
+ else {
+ dataContainer.applicationSavedContext = item.applicationContext
+ }
+ if (viewTransitionStack && viewTransitionStack.length) {
+ viewTransitionStack[viewTransitionStack.length - 1].applicationContext = item.applicationContext
+ }
+ dataContainer.setSystemContext()
+ }
+ }
+ }
+ }
+
+ WarningInfo { id: warningInfo }
+
+ InteractionPopup {
+ id: interactionPopup
+ popUpName: "UI.PerformInteraction"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ SliderPopup {
+ id: sliderPopup
+ popUpName: "UI.Slider"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ PerformAudioPassThruPopup {
+ id: performAudioPassThruPopup
+ popUpName: "UI.PerformAudioPassThru"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ VRHelpPopup {
+ id: vrHelpPopup
+ popUpName: "UI.VrHelp"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ AlertWindow {
+ id: alertWindow
+ popUpName: "UI.Alert"
+ objectName: "AlertWindow"
+ anchors.fill: parent
+ visible: false
+ }
+ }
+
+ Item {
+ id: simulationScreen
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.left: mainScreen.right
+ width: simulationPanel.width
+ clip: true
+ SimulationView {
+ id: simulationPanel
+
+ VRPopUp {
+ id: vrPopUp
+ visible: false
+ anchors.fill: parent
+ }
+
+ TTSPopUp {
+ id: ttsPopUp
+ anchors.top: parent.top
+ anchors.right: parent.right
+ visible: false
+ }
+ }
+ }
+
+ Item {
+ id: hardwareScreen
+ anchors.top: mainScreen.bottom
+ anchors.left: parent.left
+ anchors.right: simulationScreen.left
+ height: hardwarePanel.height
+ clip: true
+ HardwareButtonsView { id: hardwarePanel }
+ }
+
+ HMIProxy {
+ HmiApi.ButtonsProxy {
+ id: sdlButtons
+ objectName: "Buttons"
+ }
+ HmiApi.BasicCommunicationProxy {
+ id: sdlBasicCommunication
+ objectName: "BasicCommunication"
+ }
+ HmiApi.VRProxy {
+ id: sdlVR
+ objectName: "VR"
+ }
+ HmiApi.TTSProxy {
+ id: sdlTTS
+ objectName: "TTS"
+ }
+ HmiApi.NavigationProxy {
+ id: sdlNavigation
+ objectName: "Navigation"
+ }
+ HmiApi.VehicleInfoProxy {
+ id: sdlVehicleInfo
+ objectName: "VehicleInfo"
+ }
+ HmiApi.UIProxy {
+ id: sdlUI
+ objectName: "UI"
+ }
+ }
+
+ SDLProxy {
+ id: sdlProxy
+
+ onAppRegistered: {
+ dataContainer.addApplication(
+ {
+ appName: application.appName,
+ ngnMediaScreenAppName: application.ngnMediaScreenAppName,
+ icon: application.icon,
+ deviceName: application.deviceName,
+ appId: application.appId,
+ hmiDisplayLanguageDesired: application.hmiDisplayLanguageDesired,
+ isMediaApplication: application.isMediaApplication,
+ appType: application.appType,
+ hmiUIText: { },
+ mediaClock: {
+ "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
+ "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
+ "startTime": -1,
+ "endTime": -1,
+ "startTimeForProgress": -1
+ }
+ });
+ }
+
+ onAppUnregistered: {
+ console.debug("enter")
+ dataContainer.removeApplication(appId);
+ if ((dataContainer.currentApplication.appId === appId)) {
+ if (dataContainer.applicationContext) {
+ contentLoader.go("views/ApplicationListView.qml");
+ }
+ if (contentLoader.viewTransitionStack.filter(function(x) { return x.applicationContext })) {
+ contentLoader.reset();
+ }
+ dataContainer.currentApplication.reset()
+ }
+ console.debug("exit")
+ }
+
+ onPlayTone: {
+ beep.play()
+ }
+
+ }
+
+ Component.onCompleted: {
+ dataContainer.hmiVRAvailable = true
+ dataContainer.hmiTTSAvailable = true
+ dataContainer.hmiNavigationAvailable = true
+ dataContainer.hmiVehicleInfoAvailable = true
+ dataContainer.hmiUIAvailable = true
+
+ sdlBasicCommunication.onReady()
+ }
+
+ /*
+ * Test Support Section
+ *
+ */
+ function getSlider(){
+ return sliderPopup
+ }
+
+ function getDataStorage(){
+ return dataContainer
+ }
+
+ function getUIProxy(){
+ return sdlUI
+ }
+
+ function getMainScreen(){
+ return mainScreen
+ }
+
+ function getContentLoader(){
+ return contentLoader
+ }
+
+ function getWarningInfo(){
+ return warningInfo
+ }
+ /*
+ * Test Support Section End
+ */
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml b/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml
new file mode 100644
index 0000000000..4f33960127
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml
@@ -0,0 +1,68 @@
+/**
+ * @file ArrowKeys.qml
+ * @brief Keys with arrow for cursor movement.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+Item {
+ width: buttonOk.width
+ height: buttonOk.height
+
+ HardwareButton {
+ id: arrowUp
+ buttonId: Common.ButtonName.TUNEUP
+ name: "Up"
+ }
+ HardwareButton {
+ id: arrowDown
+ buttonId: Common.ButtonName.TUNEDOWN
+ name: "Down"
+ }
+ HardwareButton {
+ id: arrowLeft
+ buttonId: Common.ButtonName.SEEKLEFT
+ name: "Left"
+ }
+ HardwareButton {
+ id: arrowRight
+ buttonId: Common.ButtonName.SEEKRIGHT
+ name: "Right"
+ }
+ HardwareButton {
+ id: buttonOk
+ buttonId: Common.ButtonName.OK
+ name: "Ok"
+ longPressAvailable: false
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml
new file mode 100644
index 0000000000..906b3098ba
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml
@@ -0,0 +1,48 @@
+/**
+ * @file BackButton.qml
+ * @brief Button "Back" that return to previous menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+OvalButton {
+ text: "Back"
+ onClicked: { contentLoader.back() }
+ fontSize: Constants.fontSize
+ opacity: 0
+
+ NumberAnimation on opacity {
+ to: 1;
+ duration: Constants.animationDuration
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml b/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml
new file mode 100644
index 0000000000..39d693b971
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml
@@ -0,0 +1,78 @@
+/**
+ * @file CheckBox.qml
+ * @brief Check box
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ property alias text: text.text
+ property alias color: text.color
+ property bool checked: false
+
+ signal clicked
+
+ onCheckedChanged: {
+ selector.color = checked ? Constants.primaryColorPressed : Constants.transparentColor
+ }
+
+ height: checkbox.height + Constants.generalSpacing / 2
+ width: checkbox.width + text.width + 1.5 * Constants.generalSpacing
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { checked = !checked; parent.clicked() }
+ }
+ Rectangle {
+ id: checkbox
+ width: text.font.pixelSize + Constants.generalSpacing / 2
+ height: width
+ anchors.left: parent.left
+ border.color: Constants.controlsBorderColor
+ border.width: Constants.controlsBorderWidth
+ color: Constants.panelTextColor
+ radius: Constants.controlsRadius
+ Rectangle {
+ id: selector
+ anchors.fill: parent
+ anchors.margins: checkbox.width / 8
+ color: Constants.transparentColor
+ }
+ }
+ Text {
+ id: text
+ anchors.left: checkbox.right
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.verticalCenter: checkbox.verticalCenter
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml
new file mode 100644
index 0000000000..818f07ffc5
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml
@@ -0,0 +1,87 @@
+/**
+ * @file CircleButton.qml
+ * @brief Parent class for circle button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Image {
+ id: circleBtn
+ source: imgOff
+ property alias text: btnText.text
+ property alias pixelSize: btnText.font.pixelSize
+ property string dest: ""
+ property bool isPressed: false
+ property string imgOff: "../res/buttons/round_btn.png"
+ property string imgOn: "../res/buttons/round_pressed_btn.png"
+ property string textColorOnPressed: Constants.secondaryColor
+ property string textColorDefault: Constants.primaryColor
+
+ signal clicked()
+ function wasClicked()
+ {
+ clicked()
+ }
+
+ Text {
+ anchors.centerIn: parent
+ id: btnText
+ color: textColorDefault
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ console.log("CircleButton onPressed enter");
+ source = imgOn
+ btnText.color = textColorOnPressed
+ isPressed = true
+ console.log("CircleButton onPressed exit");
+ }
+ onReleased: {
+ console.log("CircleButton onReleased enter");
+ source = imgOff
+ btnText.color = textColorDefault
+ isPressed = false
+ console.log("CircleButton onReleased exit");
+ }
+ onClicked: {
+ console.log("CircleButton onClicked enter");
+ if(dest !== ""){
+ contentLoader.go(dest)
+ }
+ circleBtn.wasClicked()
+ console.log("CircleButton onClicked enter");
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml
new file mode 100644
index 0000000000..f35f7c3020
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml
@@ -0,0 +1,66 @@
+/**
+ * @file ClickableImage.qml
+ * @brief Clickable image item
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Image {
+ signal pressed ()
+ signal released ()
+ signal canceled ()
+ signal clicked()
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ parent.scale = Constants.pressedIconScale
+ parent.pressed()
+ }
+
+ onReleased: {
+ parent.scale = 1
+ parent.released()
+ }
+
+ onCanceled: {
+ parent.scale = 1
+ parent.canceled()
+ }
+
+ onClicked: {
+ parent.clicked()
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml
new file mode 100644
index 0000000000..e6b9fbf246
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml
@@ -0,0 +1,77 @@
+/**
+ * @file ClickableText.qml
+ * @brief Clickable text item
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Text {
+ property string defaultColor
+ property string pressedColor
+ signal pressed ()
+ signal released ()
+ signal canceled ()
+ signal clicked ()
+
+ color: defaultColor
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ press()
+ parent.pressed()
+ }
+
+ onReleased: {
+ release()
+ parent.released()
+ }
+
+ onCanceled: {
+ release()
+ parent.canceled()
+ }
+
+ onClicked: {
+ parent.clicked()
+ }
+ }
+
+ function press () {
+ color = pressedColor
+ }
+
+ function release () {
+ color = defaultColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml
new file mode 100644
index 0000000000..abd344272c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml
@@ -0,0 +1,93 @@
+/**
+ * @file ClimateControlBtn.qml
+ * @brief Round button, which is used at climat menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item
+{
+ id: climateControlBtn
+ width: climateBtnImg.width
+ height: climateBtnImg.height
+ property string name: ""
+ property string txt: ""
+ state: "off"
+
+ Image {
+ id: climateBtnImg
+ source: climateControlBtn.state === "off" ? "../res/climate/climate_round_off_btn.png" : "../res/climate/climate_round_on_btn.png"
+
+ Image {
+ id: hoverImg
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ property string st: climateControlBtn.state === "off" ? "_off" : "_on"
+ source: climateControlBtn.name === "" ? "": "../res/climate/" + climateControlBtn.name + st + ".png"
+ }
+
+ Text {
+ id: hoverText
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ text: climateControlBtn.txt
+ font.pixelSize: Constants.fontSize
+ color: climateControlBtn.state === "off" ? Constants.primaryColor : Constants.secondaryColor
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if(climateControlBtn.state === "on") {
+ climateControlBtn.state = "off"
+ climateBtnImg.source = "../res/climate/climate_round_off_btn.png"
+ if(climateControlBtn.txt != "") {
+ hoverText.color = Constants.primaryColor
+ }
+ if(climateControlBtn.name != "") {
+ hoverImg.source = "../res/climate/" + climateControlBtn.name + "_off.png"
+ }
+ } else {
+ climateControlBtn.state = "on"
+ climateBtnImg.source = "../res/climate/climate_round_on_btn.png"
+ if(climateControlBtn.txt != "") {
+ hoverText.color = Constants.secondaryColor
+ }
+ if(climateControlBtn.name != "") {
+ hoverImg.source = "../res/climate/" + climateControlBtn.name + "_on.png"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml b/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml
new file mode 100644
index 0000000000..d5129a2a10
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml
@@ -0,0 +1,143 @@
+/**
+ * @file ComboBox.qml
+ * @brief Combo box
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ id: container
+ width: Constants.defaultComboboxWidth
+ height: main.height
+
+ property alias model: listView.model
+ property alias currentIndex: listView.currentIndex
+ property alias currentText: textMain.text
+ property string textRole
+
+ function choose(name) {
+ var count = listView.count
+ for (var i = 0; i < count; ++i) {
+ if (name === listView.model.get(i).name) {
+ listView.currentIndex = i
+ break
+ }
+ }
+
+ textMain.text = name
+ }
+
+ Rectangle {
+ id: main
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: label.font.pixelSize + Constants.generalSpacing
+ color: Constants.panelTextColor
+ border.color: Constants.controlsBorderColor
+ border.width: Constants.controlsBorderWidth
+ radius: Constants.controlsRadius
+
+ Text {
+ id: textMain
+ anchors.left: parent.left
+ anchors.right: arrow.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ color: Constants.secondaryColor
+ verticalAlignment: Text.AlignVCenter
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.rightMargin: Constants.generalSpacing
+ elide: Text.ElideRight
+ }
+
+ Rectangle {
+ id: arrow
+ anchors.right: parent.right
+ height: parent.height; width: height
+
+ color: Constants.panelTextColor
+ border.color: Constants.controlsBorderColor
+ border.width: Constants.controlsBorderWidth
+ radius: Constants.controlsRadius
+
+ Text {
+ anchors.fill: parent
+ text: "v"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.secondaryColor
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: listView.visible = !listView.visible
+ }
+ }
+
+ ScrollableListView {
+ id: listView
+ anchors.top: main.bottom
+ anchors.left: main.left
+ anchors.right: main.right
+ height: 150
+ visible: false
+ delegate: Rectangle {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: label.font.pixelSize + Constants.generalSpacing
+ color: Constants.panelTextColor
+ border.color: Constants.controlsBorderColor
+ border.width: Constants.controlsBorderWidth
+ Text {
+ id: label
+ anchors.fill: parent
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.rightMargin: Constants.generalSpacing
+ verticalAlignment: Text.AlignVCenter
+ text: model.name
+ color: Constants.secondaryColor
+ elide: Text.ElideRight
+ }
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: { choose(model.name); listView.visible = false }
+ onEntered: { parent.color = Constants.primaryColorPressed }
+ onExited: { parent.color = Constants.panelTextColor }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml b/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml
new file mode 100644
index 0000000000..7b21bb4567
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml
@@ -0,0 +1,125 @@
+/**
+ * @file GradientRectangle.qml
+ * @brief Rectangle with gradient.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+Rectangle {
+ property string firstColor: "grey"
+ property string secondColor: "#2E2E2E"
+ property alias fontSize: text.font.pixelSize
+ property alias text: text.text
+ property int customButtonID
+ property bool isCustomButton: false
+ property bool clickProcessed
+ signal pressed()
+ signal released()
+
+ radius: 5
+ border.color: "#D3D3D3"
+
+ Text {
+ id: text
+ anchors.fill: parent
+ font.pixelSize: Constants.titleFontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ firstColor = "#2E2E2E"
+ secondColor = "grey"
+ parent.pressed()
+ }
+ onReleased: {
+ firstColor = "grey"
+ secondColor = "#2E2E2E"
+ parent.released()
+ }
+ }
+
+ Timer {
+ id: timer
+ interval: Constants.customButtonTimer
+ repeat: false
+ triggeredOnStart: false
+ }
+
+ onPressed: {
+ if (isCustomButton) {
+ timer.start()
+ clickProcessed = false
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, customButtonID)
+ }
+ }
+
+ onReleased: {
+ if (isCustomButton) {
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, customButtonID)
+ timer.stop()
+ if (!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, customButtonID)
+ }
+ }
+ }
+
+ Connections {
+ target: timer
+ onTriggered: {
+ if (isCustomButton) {
+ if(!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, customButtonID)
+ clickProcessed = true
+ }
+ }
+ }
+ }
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.1
+ color: firstColor
+ }
+ GradientStop {
+ position: 0.5
+ color: secondColor
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml b/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml
new file mode 100644
index 0000000000..84528ab800
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml
@@ -0,0 +1,53 @@
+/**
+ * @file GridItem.qml
+ * @brief Item with animation for GridMenu
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ id: item
+ opacity: 0
+ SequentialAnimation {
+ id: animation
+ PauseAnimation {duration: index * 100 }
+ NumberAnimation {
+ target: item
+ duration: Constants.animationDuration
+ property: "opacity"
+ from: 0; to: 1;
+ }
+ }
+ Component.onCompleted: {
+ animation.start()
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml
new file mode 100644
index 0000000000..ea8e406c6e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml
@@ -0,0 +1,108 @@
+/**
+ * @file HardwareButton.qml
+ * @brief Parent class for hardware button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import com.ford.sdl.hmi.hw_buttons 1.0
+import "../hmi_api/Common.js" as Common
+
+MaskedContainer {
+ property string name
+ property int buttonId: Common.ButtonName.CUSTOM_BUTTON
+ property bool upDownAvailable: true
+ property bool shortPressAvailable: true
+ property bool longPressAvailable: true
+
+ signal hold
+
+ Image {
+ source: "../res/controlButtons/" + name + "Button.png"
+ }
+ Image {
+ id: pressedImg
+ source: "../res/controlButtons/" + name + "Button_pressed.png"
+ visible: false
+ Behavior on opacity {
+ NumberAnimation { duration: 80 }
+ }
+ }
+ Timer {
+ id: timer
+ interval: 2000
+ repeat: false
+ triggeredOnStart: false
+ }
+ property bool clickProcessed
+ onPressed: {
+ clickProcessed = false
+ pressedImg.visible = true
+ timer.start()
+ if (upDownAvailable) {
+ sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+ }
+
+ onReleased: {
+ if (upDownAvailable) {
+ sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONUP, undefined)
+ }
+ timer.stop()
+ if (!clickProcessed && shortPressAvailable) {
+ sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.SHORT, undefined)
+ }
+ pressedImg.visible = false
+ }
+
+ Connections {
+ target: timer
+ onTriggered: {
+ if(!clickProcessed && longPressAvailable) {
+ sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.LONG, undefined)
+ clickProcessed = true
+ hold()
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ if (buttonId !== Common.ButtonName.CUSTOM_BUTTON) {
+ settingsContainer.buttonCapabilities.push(
+ {
+ name: buttonId,
+ upDownAvailable: upDownAvailable,
+ shortPressAvailable: shortPressAvailable,
+ longPressAvailable: longPressAvailable
+ });
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml b/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml
new file mode 100644
index 0000000000..2b0b418c54
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml
@@ -0,0 +1,134 @@
+/**
+ * @file HeaderMenu.qml
+ * @brief Header menu view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ id: headerMenu
+ anchors.fill: parent
+
+ Text {
+ anchors.leftMargin: Constants.margin
+ anchors.topMargin: Constants.margin
+ anchors.left: parent.left
+ anchors.verticalCenter: parent.verticalCenter
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ text: "75°"
+ }
+
+ Item {
+ width: menuText.width
+ height: parent.height
+ anchors.topMargin: Constants.margin
+ anchors.horizontalCenter: headerMenu.horizontalCenter
+ signal clicked ()
+
+ ClickableText {
+ id: menuLogo
+ anchors.horizontalCenter: menuText.horizontalCenter
+ anchors.bottom: parent.verticalCenter
+ text: "≡"
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.fontSize
+
+ onClicked: parent.clicked()
+ onPressed: menuLogo.press()
+ onReleased: menuLogo.release()
+ onCanceled: menuLogo.release()
+ }
+
+ ClickableText {
+ id: menuText
+ anchors.top: parent.verticalCenter
+ text: "MENU";
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.fontSize
+
+ onClicked: parent.clicked()
+ onPressed: menuText.press()
+ onReleased: menuText.release()
+ onCanceled: menuText.release()
+ }
+
+ onClicked: {
+ contentLoader.go("./views/MainMenuView.qml")
+ }
+ }
+
+ Row {
+ id: clock
+ height: childrenRect.height
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: Constants.margin
+ anchors.topMargin: Constants.margin
+ property date date: new Date()
+
+ Timer {
+ running: true
+ repeat: true
+ interval: 1000
+ onTriggered: {
+ clock.date = new Date();
+ }
+ }
+
+ Text {
+ text: Qt.formatTime(clock.date, "hh");
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize;
+ }
+
+ Item {
+ width: 10
+ height: parent.height
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: clock.date.getSeconds() % 2 ? ":" : ""
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize;
+ }
+ }
+
+ Text {
+ text: Qt.formatTime(clock.date, "mm");
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize;
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml b/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml
new file mode 100644
index 0000000000..d0bfdba78b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml
@@ -0,0 +1,65 @@
+/**
+ * @file Navigation.qml
+ * @brief Icon.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+Item {
+ property variant source
+
+ Image {
+ anchors.fill: parent
+ source: url(parent.source)
+
+ function image(turnIcon) {
+ if (turnIcon && turnIcon.imageType === Common.ImageType.STATIC) {
+ return turnIcon.value;
+ } else {
+ return "";
+ }
+ }
+
+ function url(turnIcon) {
+ if (turnIcon && turnIcon.imageType === Common.ImageType.DYNAMIC) {
+ return turnIcon.value;
+ } else {
+ return "";
+ }
+ }
+ }
+
+ function reset () {
+ source = undefined
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml b/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml
new file mode 100644
index 0000000000..c87c24de4d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml
@@ -0,0 +1,70 @@
+/**
+ * @file Entry.qml
+ * @brief Entry with icon and text for list.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: main
+ color: Constants.transparentColor
+
+ property alias text: label.text
+ property alias fontSize: label.font.pixelSize
+ property alias icon: image.source
+
+ Icon {
+ id: image
+ width: Constants.iconItemListSize
+ height: Constants.iconItemListSize
+ anchors.left: parent.left
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.verticalCenter: parent.verticalCenter
+ visible: source ? true : false
+ }
+ Text {
+ id: label
+ anchors.verticalCenter: parent.verticalCenter
+ height: image.height
+ width: parent.width - image.width
+ z: 50
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.fontSize
+ text: "Name Entry"
+ anchors.left: image.right
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.verticalCenterOffset: 0
+ visible: text !== ""
+ color: Constants.primaryColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml
new file mode 100644
index 0000000000..d8a95d1a00
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml
@@ -0,0 +1,64 @@
+/**
+ * @file MaskedButton.qml
+ * @brief Masked button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import com.ford.sdl.hmi.hw_buttons 1.0
+
+MaskedContainer {
+ property string name
+
+ Image {
+ id: icon
+ source: "../res/controlButtons/" + name + "Button.png"
+ }
+
+ onPressed: {
+ state = "pressed";
+ }
+
+ onReleased: {
+ state = "";
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: icon
+ source: "../res/controlButtons/" + name + "Button_pressed.png"
+ }
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml b/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml
new file mode 100644
index 0000000000..e86dcedc8f
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml
@@ -0,0 +1,77 @@
+/**
+ * @file MultiTouchArea.qml
+ * @brief Area for multitouch.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+MultiPointTouchArea {
+ readonly property int created: Date.now()
+
+ signal pressed(var touchPoints)
+ signal released(var touchPoints)
+ signal canceled(var touchPoints)
+ signal updated(var touchPoints)
+
+ function fillEvent(touchPoints) {
+ var event = []
+ for (var i = 0; i < touchPoints.length; ++i) {
+ event.push({
+ id: touchPoints[i].pointId,
+ ts: [Date.now() - created],
+ c: [{ x: touchPoints.x, y: touchPoints.y }] // TODO(KKolodiy): need cast to int
+ })
+ }
+ return event
+ }
+
+ minimumTouchPoints: 1
+ maximumTouchPoints: 10
+
+ onPressed: {
+ sdlUI.onTouchEvent(Common.BEGIN, fillEvent(touchPoints))
+ parent.pressed(touchPoints)
+ }
+ onReleased: {
+ sdlUI.onTouchEvent(Common.END, fillEvent(touchPoints))
+ parent.released(touchPoints)
+ }
+ onCanceled: {
+ sdlUI.onTouchEvent(Common.END, fillEvent(touchPoints))
+ parent.canceled(touchPoints)
+ }
+ onUpdated: {
+ sdlUI.onTouchEvent(Common.MOVE, fillEvent(touchPoints))
+ parent.updated(touchPoints)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml
new file mode 100644
index 0000000000..59458499a7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml
@@ -0,0 +1,240 @@
+/**
+ * @file OvalButton.qml
+ * @brief Oval button with flexible width.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import com.ford.sdl.hmi.hw_buttons 1.0
+import "../models/Constants.js" as Constants
+
+// Don't change constants. It break button
+// TODO (dchmerev@luxoft.com): make this comment more clear
+// todo (ykazakov): eliminate this problem and remove all such comments
+
+Item {
+ id: main
+ width: dynamic ? field.width + 2 * left.width : Constants.ovalButtonWidth
+ height: Constants.ovalButtonHeight
+
+ signal clicked;
+ signal pressed;
+ signal released;
+ signal pressAndHold;
+ property alias text: label.text
+ property alias fontSize: label.font.pixelSize
+ property alias icon: image.source
+ property bool highlighted: false
+ property bool dynamic: false
+ property bool disabled: false
+ property color colorizeColor
+ property real colorizeStrength
+
+ onDisabledChanged: colorize()
+ onHighlightedChanged: colorize()
+ Component.onCompleted: colorize()
+
+ function colorize() {
+ if (disabled) {
+ colorizeColor = "gray";
+ colorizeStrength = 1;
+ } else if (highlighted) {
+ colorizeColor = "cyan";
+ colorizeStrength = 1;
+ } else {
+ colorizeStrength = 0;
+ }
+ }
+
+ Item {
+ id: buttonBorderImage
+ visible: true
+ anchors.fill: parent
+ Image {
+ id: left
+ width: 31
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ anchors.top: parent.top
+ source: "../res/buttons/oval_btn_left.png"
+ effect: Colorize {
+ color: main.colorizeColor
+ strength: main.colorizeStrength
+ }
+ }
+
+ Image {
+ id: right
+ width: 31
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ source: "../res/buttons/oval_btn_right.png"
+ effect: Colorize {
+ color: main.colorizeColor
+ strength: main.colorizeStrength
+ }
+ }
+
+ Image {
+ id: top
+ height: 10
+ anchors.right: parent.right
+ anchors.rightMargin: 31
+ anchors.left: parent.left
+ anchors.leftMargin: 31
+ anchors.top: parent.top
+ fillMode: Image.TileHorizontally
+ source: "../res/buttons/oval_btn_top.png"
+ effect: Colorize {
+ color: main.colorizeColor
+ strength: main.colorizeStrength
+ }
+ }
+
+ Image {
+ id: bottom
+ height: 11
+ anchors.right: parent.right
+ anchors.rightMargin: 31
+ anchors.left: parent.left
+ anchors.leftMargin: 31
+ anchors.bottom: parent.bottom
+ fillMode: Image.TileHorizontally
+ source: "../res/buttons/oval_btn_bottom.png"
+ effect: Colorize {
+ color: main.colorizeColor
+ strength: main.colorizeStrength
+ }
+ }
+ }
+
+ Rectangle {
+ id: background
+ color: Constants.transparentColor
+ anchors.fill: parent
+ anchors.rightMargin: 31
+ anchors.leftMargin: 31
+ anchors.bottomMargin: 10
+ anchors.topMargin: 10
+ visible: true
+ effect: Colorize {
+ color: main.colorizeColor
+ strength: main.colorizeStrength
+ }
+ }
+
+ MouseArea {
+ id: mousearea
+ anchors.rightMargin: 15
+ anchors.leftMargin: 15
+ anchors.bottomMargin: 11
+ anchors.topMargin: 10
+ anchors.fill: parent
+ enabled: !parent.disabled
+ onPressed: {
+ parent.state = "pressed";
+ parent.pressed();
+ }
+ onReleased: {
+ parent.state = "";
+ parent.released();
+ }
+ onClicked: {
+ parent.clicked();
+ }
+ onPressAndHold: {
+ parent.pressAndHold();
+ }
+ onCanceled: {
+ parent.state = "";
+ }
+ }
+
+ Item {
+ id: field
+ anchors.fill: background
+
+ Icon {
+ id: image
+ width: Constants.iconButtonSize
+ height: Constants.iconButtonSize
+ anchors.verticalCenter: parent.verticalCenter
+ visible: source ? true : false
+ }
+ Text {
+ id: label
+ width: image.visible ? parent.width - image.width : parent.width
+ color: Constants.primaryColor
+ anchors.centerIn: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: Constants.ovalButtonFontSize
+ visible: true
+ elide: Text.ElideRight
+ effect: Colorize {
+ id: colorizeLabel
+ color: main.colorizeColor
+ strength: main.colorizeStrength
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: left
+ source: "../res/buttons/oval_btn_pressed_left.png"
+ }
+
+ PropertyChanges {
+ target: right
+ source: "../res/buttons/oval_btn_pressed_right.png"
+ }
+
+ PropertyChanges {
+ target: background
+ color: Constants.primaryColor
+ }
+
+ PropertyChanges {
+ target: label
+ color: Constants.secondaryColor
+ }
+
+ PropertyChanges {
+ target: colorizeLabel
+ strength: 0
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml b/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml
new file mode 100644
index 0000000000..6d40ad6478
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml
@@ -0,0 +1,105 @@
+/**
+ * @file PagedFlickable.qml
+ * @brief Animated row.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Item
+{
+ id: flickablePage
+ height: container.height + pager.height
+ default property alias content: containerRow.children
+ property alias spacing: containerRow.spacing
+ property int elementWidth
+ property int snapTo
+ property int count: 0
+
+ Flickable {
+ id: container
+ anchors.bottom: parent.bottom
+ maximumFlickVelocity: 1500
+ contentWidth: containerRow.width
+ height: containerRow.height
+ width: parent.width
+ interactive: contentWidth > width
+
+ onMovementEnded: {
+ var rest = contentX % snapTo
+ var t = 0.25
+ if (rest > parent.snapTo / 2) {
+ rest = rest - parent.snapTo
+ }
+ var vel = 2 * rest / t
+ flickDeceleration = Math.abs(vel) / t
+ flick(vel, 0)
+ flickDeceleration = 1500
+ }
+ Row {
+ id: containerRow
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Pager {
+ id: pager
+ space: 7
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+
+ pages: {
+ if ( (container.contentWidth % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
+ return Math.ceil(container.contentWidth / container.width)
+ }
+ else {
+ return Math.floor(container.contentWidth / container.width)
+ }
+ }
+
+ activePage: {
+ if (container.contentX <= 0) {
+ return 0
+ }
+ else if ( (container.contentWidth - container.contentX) < container.width) {
+ return pages -1
+ }
+ else {
+ if ( (container.contentX % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
+ return Math.ceil(container.contentX / container.width)
+ }
+ else if ( (container.contentX % container.width) > 0) {
+ return Math.floor(container.contentX / container.width)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml b/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml
new file mode 100644
index 0000000000..471d932113
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml
@@ -0,0 +1,53 @@
+/**
+ * @file Pager.qml
+ * @brief Bubbles that indicate about page switch.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Row {
+ id: pager
+ property int pages
+ property int activePage: 0
+ property int space
+ property int itemsInRowOnScreen: 3
+
+ spacing: space
+ visible: pages !== 1
+
+ Repeater {
+ model: pages
+ Image {
+ source: index === activePage ? "../res/white_ball.png" : "../res/blue_ball.png"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml
new file mode 100644
index 0000000000..825884cc1e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml
@@ -0,0 +1,77 @@
+/**
+ * @file PlayPauseButton.qml
+ * @brief Behavior of Play/Pause button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Image {
+ id: playPauseButton
+ property string sourceOnPressed: ""
+ property string sourceOnReleased: ""
+
+ signal clicked
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ playPauseButton.source = playPauseButton.sourceOnPressed
+ }
+ onReleased: {
+ playPauseButton.source = playPauseButton.sourceOnReleased
+ }
+ onClicked: {
+ playPauseButton.clicked()
+ }
+ }
+ states: [
+ State {
+ name: "Play"
+ PropertyChanges {
+ target: playPauseButton
+ source: "../res/buttons/player_play_btn.png"
+ sourceOnPressed: "../res/buttons/player_play_pressed_btn.png"
+ sourceOnReleased: "../res/buttons/player_pause_btn.png"
+ }
+ },
+
+ State {
+ name: "Pause"
+ PropertyChanges {
+ target: playPauseButton
+ source: "../res/buttons/player_pause_btn.png"
+ sourceOnPressed: "../res/buttons/player_pause_pressed_btn.png"
+ sourceOnReleased: "../res/buttons/player_play_btn.png"
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml
new file mode 100644
index 0000000000..2027e1f592
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml
@@ -0,0 +1,75 @@
+/**
+ * @file PowerSwitchBtn.qml
+ * @brief On/Off button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: powerSwitchBtn
+ state: "Turn ON"
+ width: 120
+ height: 80
+ radius: 5
+ property bool pressed;
+
+ gradient: Gradient {
+ GradientStop { position: pressed ? 1.0 : 0.0; color: "#2c2c2c" }
+ GradientStop { position: pressed ? 0.0 : 1.0; color: "black" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.pressed = true
+ }
+ onReleased: {
+ parent.pressed = false
+ parent.state = parent.state === "Turn ON" ? "Turn OFF" : "Turn ON"
+ btnText.text = parent.state
+ if (parent.state === "Turn OFF") {
+ contentLoader.reset()
+ mainScreen.visible = true
+ warningInfo.showOkButton()
+ }
+ }
+ }
+
+ Text {
+ id: btnText
+ color: "red"
+ text: parent.state
+ anchors.centerIn: parent
+ font.pixelSize: Constants.powerButtonFornSize
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml b/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml
new file mode 100644
index 0000000000..1454ed812d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml
@@ -0,0 +1,106 @@
+/**
+ * @file PresetRow.qml
+ * @brief Animated row with radio stations.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ id: presetRow
+ height: childrenRect.height
+ property variant presets: []
+ property int selectedIndex: 0
+ signal presetSelected
+ signal presetButtonPressed()
+ signal presetButtonReleased()
+ signal presetButtonClicked()
+ signal presetButtonHold()
+
+ Image {
+ id: circleButton
+ source: "../res/buttons/preset_pressed_btn.png"
+ visible: false
+ enabled: false
+ }
+
+ PagedFlickable {
+ width: parent.width
+ spacing: (width - (circleButton.width * 4)) / 3
+ snapTo: spacing + circleButton.width
+ elementWidth: circleButton.width
+
+ Repeater {
+ model: presetRow.presets.length
+ delegate:
+ Column {
+ width: circleButton.width
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ source: presetRow.selectedIndex === index ? "../res/buttons/preset_pressed_btn.png" : "../res/buttons/preset_btn.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ presetRow.selectedIndex = index;
+ presetButtonPressed()
+ }
+ onReleased: {
+ presetRow.selectedIndex = index;
+ presetButtonReleased()
+ }
+ onClicked: {
+ presetRow.selectedIndex = index
+ presetButtonClicked()
+ }
+ onPressAndHold: {
+ presetRow.selectedIndex = index;
+ presetButtonHold()
+ }
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ text: index + 1
+ font.pixelSize: Constants.fontSize
+ color: presetRow.selectedIndex === index ? Constants.secondaryColor : Constants.primaryColor
+ }
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: presetRow.presets[index]
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml
new file mode 100644
index 0000000000..36ee9bbb3f
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml
@@ -0,0 +1,136 @@
+/**
+ * @file PushButton.qml
+ * @brief Simple button
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Rectangle {
+ id: toggleButton
+ width: 160
+ height: 40
+ radius: 2
+ border.width: 2
+ border.color: "#000000"
+ gradient: grUnpressed
+
+ property alias label : label.text
+
+ signal pressed()
+ signal unpressed()
+ signal clicked()
+
+ property bool toggleMode: false
+
+ state: "unpressed"
+ onStateChanged: {
+ if (state == "pressed") {
+ pressed();
+ } else {
+ unpressed();
+ }
+ }
+
+ Text {
+ id: label
+ color: "white"
+ text: "PushButton"
+ font.pixelSize: 18
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.fill: parent
+ }
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onPressed: {
+ if (toggleMode) {
+ if (parent.state == "unpressed") {
+ parent.state = "pressed"
+ } else {
+ parent.state = "unpressed"
+ }
+ } else {
+ parent.state = "pressed"
+ }
+ }
+ onReleased: {
+ if (!toggleMode) {
+ parent.state = "unpressed"
+ if (mouse.isClick) {
+ parent.clicked()
+ }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: toggleButton
+ gradient: grPressed
+ }
+ },
+ State {
+ name: "unpressed"
+ PropertyChanges {
+ target: toggleButton
+ gradient: grUnpressed
+ }
+ }
+ ]
+
+ Gradient {
+ id: grUnpressed
+
+ GradientStop { position: 0.0; color: "#2c2c2c" }
+ GradientStop { position: 1.0; color: "#0c0c0c" }
+ }
+
+ Gradient {
+ id: grPressed
+
+ GradientStop { position: 0.0; color: "black" }
+ GradientStop { position: 1.0; color: "black" }
+ }
+
+ transitions: [
+ Transition {
+ from: "unpressed"
+ to: "pressed"
+ reversible: true
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml
new file mode 100644
index 0000000000..cc26c87271
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml
@@ -0,0 +1,49 @@
+/**
+ * @file ScrollableListView.qml
+ * @brief ListView with scrollbar on the right
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+ListView {
+ clip: true
+
+ Rectangle {
+ visible: parent.height < parent.contentHeight
+ anchors.right: parent.right
+ y: parent.visibleArea.yPosition * parent.height
+ width: Constants.scrollBarWidth
+ height: parent.visibleArea.heightRatio * parent.height
+ color: Constants.primaryColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml
new file mode 100644
index 0000000000..82f568414b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml
@@ -0,0 +1,70 @@
+/**
+ * @file ScrollableText.qml
+ * @brief Text with scrollers if text more than zone
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ property alias text: text.text
+ clip: true
+
+ Flickable {
+ id: flickable
+ anchors.fill: parent
+ contentWidth: text.width
+ contentHeight: text.height
+
+ Text {
+ id: text
+ color: Constants.popUpBorderColor
+ font.pixelSize: Constants.ttsFontSize
+ }
+ }
+ Rectangle {
+ visible: flickable.height < flickable.contentHeight
+ anchors.right: flickable.right
+ y: flickable.visibleArea.yPosition * flickable.height
+ width: Constants.scrollBarWidth
+ height: flickable.visibleArea.heightRatio * flickable.height
+ color: Constants.popUpBorderColor
+ }
+ Rectangle {
+ visible: flickable.width < flickable.contentWidth
+ anchors.bottom: flickable.bottom
+ x: flickable.visibleArea.xPosition * flickable.width
+ height: Constants.scrollBarWidth
+ width: flickable.visibleArea.widthRatio * flickable.width
+ color: Constants.popUpBorderColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js
new file mode 100644
index 0000000000..227f638366
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js
@@ -0,0 +1,39 @@
+/**
+ * @file SoftButton.js
+ * @brief Soft button view constants
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+.pragma library
+
+var Action = {
+ doOnClicked: 0,
+ doOnReleased: 1
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml
new file mode 100644
index 0000000000..b92cd51263
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml
@@ -0,0 +1,104 @@
+/**
+ * @file SoftButton.qml
+ * @brief Soft button view
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "SoftButton.js" as SoftButton
+
+OvalButton {
+ property variant button
+ property int appId
+ visible: !!button
+
+ signal defaultAction;
+ signal stealFocus;
+ signal keepContext;
+
+ property int actionOrder: SoftButton.Action.doOnClicked
+
+ highlighted: button ? button.isHighlighted : false
+ onPressed: {
+ actionOrder = SoftButton.Action.doOnClicked
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID)
+ }
+
+ onReleased: {
+ if (actionOrder === SoftButton.Action.doOnReleased) {
+ switch (button.systemAction) {
+ case Common.SystemAction.DEFAULT_ACTION:
+ defaultAction();
+ break;
+ case Common.SystemAction.STEAL_FOCUS:
+ if (dataContainer.currentApplication.isMediaApplication) {
+ contentLoader.go("views/SDLPlayerView.qml", appId);
+ } else {
+ contentLoader.go("views/SDLNonMediaView.qml", appId);
+ }
+ stealFocus();
+ break;
+ case Common.SystemAction.KEEP_CONTEXT:
+ keepContext();
+ break;
+ }
+ }
+
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID)
+ }
+
+ onClicked: {
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID);
+ switch (button.systemAction) {
+ case Common.SystemAction.DEFAULT_ACTION:
+ defaultAction();
+ break;
+ case Common.SystemAction.STEAL_FOCUS:
+ if (dataContainer.currentApplication.isMediaApplication) { contentLoader.go("views/SDLPlayerView.qml", appId); }
+ else { contentLoader.go("views/SDLNonMediaView.qml", appId); }
+ stealFocus();
+ break;
+ case Common.SystemAction.KEEP_CONTEXT:
+ keepContext();
+ break;
+ }
+ }
+
+ onPressAndHold: {
+ actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID);
+ }
+
+ onButtonChanged: {
+ icon = button && button.type !== Common.SoftButtonType.SBT_TEXT ? button.image : undefined;
+ text = button && button.type !== Common.SoftButtonType.SBT_IMAGE ? button.text : ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml b/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml
new file mode 100644
index 0000000000..a6d7640f36
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml
@@ -0,0 +1,42 @@
+/**
+ * @file StatusBar.qml
+ * @brief Status bar that contains text string.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Text {
+ text: dataContainer.currentApplication.hmiUIText.statusBar
+ color: Constants.primaryColor
+ font.pixelSize: Constants.statusBarFontSize
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js b/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js
new file mode 100644
index 0000000000..ebc5bfa3ca
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js
@@ -0,0 +1,7 @@
+.pragma library
+
+var async_uid = 1;
+
+function AsyncCall() {
+ this.__async_uid = async_uid++;
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml
new file mode 100644
index 0000000000..9d7e0432f2
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml
@@ -0,0 +1,88 @@
+/**
+ * @file BasicCommunication.qml
+ * @brief Implement of interface Basic Communication.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Item {
+ function updateDeviceList (deviceList) {
+ dataContainer.deviceList.clear();
+ for(var i = 0; i < deviceList.length; i++) {
+ dataContainer.deviceList.append({ name: deviceList[i].name, devid: deviceList[i].id })
+ }
+ }
+
+ function updateAppList (applications) {
+ dataContainer.applicationList.clear();
+ for(var i = 0; i < applications.length; i++) {
+ dataContainer.applicationList.append({
+ appName: applications[i].appName,
+ ngnMediaScreenAppName: applications[i].ngnMediaScreenAppName,
+ icon: applications[i].icon,
+ deviceName: applications[i].deviceName,
+ appId: applications[i].appID,
+ hmiDisplayLanguageDesired: applications[i].hmiDisplayLanguageDesired,
+ isMediaApplication: applications[i].isMediaApplication,
+ appType: applications[i].appType
+ });
+ }
+ }
+
+ function allowDeviceToConnect (device) {
+ return {
+ allow: true
+ }
+ }
+
+ function mixingAudioSupported() {
+ return {
+ attenuatedSupport: true
+ }
+ }
+
+ function allowAllApps() {
+ return {
+ allowed: true
+ }
+ }
+
+ function allowApp(app, appPermissions) {
+ return {
+ allowed: true
+ }
+ }
+
+ function activateApp() {
+ contentLoader.go("views/SDLPlayerView.qml", appID);
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml
new file mode 100644
index 0000000000..83ea933eda
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml
@@ -0,0 +1,48 @@
+/**
+ * @file Buttons.qml
+ * @brief Implement of interface Buttons.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+Item
+{
+ function getCapabilities()
+ {
+ return {
+ capabilities: settingsContainer.buttonCapabilities,
+ presetBankCapabilities: {
+ onScreenPresetsAvailable: true
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml
new file mode 100644
index 0000000000..3ec131c8c1
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml
@@ -0,0 +1,127 @@
+/**
+ * @file Navigation.qml
+ * @brief Navigation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "Common.js" as Common
+
+Item {
+ function isReady () {
+ return {
+ available: dataContainer.hmiNavigationAvailable
+ }
+ }
+
+ function showConstantTBT(navigationTexts, turnIcon, nextTurnIcon, distanceToManeuver,
+ distanceToManeuverScale, maneuverComplete,
+ softButtons, appID) {
+ console.debug("enter")
+ navigationTexts.forEach(fillTexts);
+ dataContainer.navigationModel.turnIcon = turnIcon ? turnIcon.value : ""
+ dataContainer.navigationModel.nextTurnIcon = nextTurnIcon ? nextTurnIcon.value : ""
+ dataContainer.navigationModel.distanceToManeuver = distanceToManeuver;
+ dataContainer.navigationModel.distanceToManeuverScale = distanceToManeuverScale;
+ if (maneuverComplete !== undefined) {
+ dataContainer.navigationModel.maneuverComplete = maneuverComplete;
+ }
+ if (softButtons !== undefined) {
+ dataContainer.navigationModel.softButtons.clear();
+ softButtons.forEach(fillSoftButtons, dataContainer.navigationModel.softButtons);
+ }
+ dataContainer.navigationModel.appId = appID;
+ contentLoader.go("./views/TurnByTurnView.qml");
+ console.debug("exit")
+ }
+
+ function alertManeuver(softButtons) {
+ console.debug("enter")
+ if (softButtons !== undefined) {
+ dataContainer.navigationModel.alertManeuverSoftButtons.clear();
+ softButtons.forEach(fillSoftButtons, dataContainer.navigationModel.alertManeuverSoftButtons);
+ }
+ console.debug("exit")
+ }
+
+ function updateTurnList(turnList, softButtons, appID) {
+ console.debug("enter")
+ if (turnList !== undefined) {
+ dataContainer.getApplication(appID).turnList.clear();
+ turnList.forEach(fillTurnList, dataContainer.getApplication(appID).turnList);
+ }
+ if (softButtons !== undefined) {
+ dataContainer.getApplication(appID).turnListSoftButtons.clear();
+ softButtons.forEach(fillSoftButtons, dataContainer.getApplication(appID).turnListSoftButtons);
+ }
+ dataContainer.navigationModel.appId = appID;
+ console.debug("exit")
+ }
+
+ function fillTexts(element, index, array) {
+ switch (element.fieldName) {
+ case Common.TextFieldName.navigationText1:
+ dataContainer.navigationModel.text1 = element.fieldText;
+ break;
+ case Common.TextFieldName.navigationText2:
+ dataContainer.navigationModel.text2 = element.fieldText;
+ break;
+ case Common.TextFieldName.ETA:
+ dataContainer.navigationModel.eta = element.fieldText;
+ break;
+ case Common.TextFieldName.totalDistance:
+ dataContainer.navigationModel.totalDistance = element.fieldText;
+ break;
+ case Common.TextFieldName.timeToDestination:
+ dataContainer.navigationModel.timeToDestination = element.fieldText;
+ break;
+ }
+ }
+
+ function fillSoftButtons(element, index, array) {
+ this.append({
+ type: element.type,
+ text: element.text,
+ image: element.image,
+ isHighlighted: element.isHighlighted,
+ buttonId: element.softButtonID,
+ systemAction: element.systemAction
+ });
+ }
+
+ function fillTurnList(element, index, array) {
+ this.append({
+ navigationText: element.navigationText,
+ turnIcon: element.turnIcon
+ });
+ console.debug(element.navigationText)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml
new file mode 100644
index 0000000000..96aa9b2c29
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "Common.js" as Common
+import "Async.js" as Async
+
+Item {
+ function isReady() {
+ return {
+ available: dataContainer.hmiTTSAvailable
+ }
+ }
+
+ function speak(ttsChunks, appID) {
+ // appID unused
+ console.debug('enter:', ttsChunks, appID);
+ if (ttsPopUp.async) {
+ console.log('speak send abort');
+ throw Common.Result.ABORTED;
+ }
+
+ var message = ttsChunks.map(function(str) { return str.text }).join('\n');
+ ttsPopUp.activate(message);
+ ttsPopUp.async = new Async.AsyncCall();
+ console.debug('exit');
+ return ttsPopUp.async;
+ }
+
+ function stopSpeaking() {
+ console.debug("enter");
+ ttsPopUp.deactivate();
+ console.debug("exit");
+ }
+
+ function getLanguage() {
+ return {
+ language: dataContainer.hmiTTSVRLanguage
+ }
+ }
+
+ function getSupportedLanguages() {
+ return {
+ languages: settingsContainer.sdlLanguagesList
+ }
+ }
+
+ function getCapabilities() {
+ return {
+ capabilities: Common.SpeechCapabilities.SC_TEXT
+ }
+ }
+
+ function changeRegistration(language, appID) {
+ console.debug("enter:", language, appID);
+ dataContainer.changeRegistrationTTSVR(language, appID);
+ console.debug("exit");
+ }
+
+ function setGlobalProperties(helpPrompt, timeoutPrompt, appID) {
+ console.debug("enter: " + helpPrompt + ", " + timeoutPrompt + ", " + appID)
+
+ var newHelpPropmt = helpPrompt ?
+ helpPrompt.map(
+ function (structure) {
+ return structure.text
+ }
+ ).join(", ") :
+ dataContainer.currentApplication.helpPrompt
+
+ var newTimeoutPrompt = timeoutPrompt ?
+ timeoutPrompt.map(
+ function (structure) {
+ return structure.text
+ }
+ ).join(", ") :
+ dataContainer.currentApplication.timeoutPrompt
+
+ dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
+ helpPrompt: newHelpPropmt,
+ timeoutPrompt: newTimeoutPrompt
+ })
+ console.debug("exit")
+ }
+}
+
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml
new file mode 100644
index 0000000000..648cd1397f
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml
@@ -0,0 +1,449 @@
+/**
+ * @file UI.qml
+ * @brief UI interface implementation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "Common.js" as Common
+import "Async.js" as Async
+import "../models/Internal.js" as Internal
+
+Item {
+ function filter (strings, fields) {
+ console.debug("enter")
+// substrings for each allowed field
+ var fieldSubstrings = {}
+// this cycle concatenates allowed lines sorting them by field
+ for (var stringIndex = 0; stringIndex < strings.length; ++stringIndex) {
+ for (var fieldIndex = 0; fieldIndex < fields.length; ++fieldIndex) {
+ var fieldName = strings[stringIndex].fieldName
+ if (fieldName === fields[fieldIndex]) {
+ if (fieldSubstrings[fieldName] !== undefined) {
+ fieldSubstrings[fieldName] += "\n";
+ fieldSubstrings[fieldName] += strings[stringIndex].fieldText
+ }
+ else {
+ fieldSubstrings[fieldName] = strings[stringIndex].fieldText
+ }
+ }
+ }
+ }
+ console.debug("exit")
+ return fieldSubstrings
+ }
+
+ function alert (alertStrings, duration, softButtons, progressIndicator, appID) {
+ var fieldSubstrings = alertStrings
+ .sort(function(a, b) { return a.fieldName - b.fieldName }) // sorting by fieldName
+ .map(function(val) { return val.fieldText }); // mapping to array of strings
+
+ var tryAgainTime = alertWindow.alert(fieldSubstrings, duration, progressIndicator, softButtons, appID)
+ if (tryAgainTime === undefined) {
+ alertWindow.async = new Async.AsyncCall();
+ return alertWindow.async;
+ }
+ else {
+ return {
+ "__retCode": Common.Result.REJECTED,
+ "tryAgainTime": tryAgainTime
+ }
+ }
+ }
+
+ function show (showStrings, alignment, graphic, softButtons, customPresets, appID) {
+ console.debug("enter: " + showStrings + ", " + alignment + ", " + graphic + ", "+ softButtons + ", " + customPresets + ", " + appID)
+ var app = dataContainer.getApplication(appID);
+
+ if (softButtons) {
+ app.softButtons.clear()
+ softButtons.forEach(function(x) { app.softButtons.append(x); });
+ }
+
+ if (customPresets) {
+ app.customPresets.clear()
+ customPresets.forEach( function(x) { app.customPresets.append( {text: x} ); } )
+ }
+
+ var textAlignment
+ switch (alignment) {
+ case Common.TextAlignment.LEFT_ALIGNED:
+ textAlignment = Text.AlignLeft
+ break;
+ case Common.TextAlignment.RIGHT_ALIGNED:
+ textAlignment = Text.AlignRight
+ break;
+ case Common.TextAlignment.CENTERED:
+ textAlignment = Text.AlignHCenter
+ break;
+ default:
+ textAlignment = Text.AlignHCenter
+ break;
+ }
+
+ // with this array we grab only the lines we need
+ var showFields = [
+ Common.TextFieldName.mainField1,
+ Common.TextFieldName.mainField2,
+ Common.TextFieldName.mainField3,
+ Common.TextFieldName.mainField4,
+ Common.TextFieldName.statusBar,
+ Common.TextFieldName.mediaClock,
+ Common.TextFieldName.mediaTrack
+ ]
+ var fieldSubstrings = filter(showStrings, showFields)
+ var showData = { hmiUIText: {} }
+ if (fieldSubstrings[Common.TextFieldName.mainField1] !== undefined) { showData.hmiUIText.mainField1 = fieldSubstrings[Common.TextFieldName.mainField1]; }
+ if (fieldSubstrings[Common.TextFieldName.mainField2] !== undefined) { showData.hmiUIText.mainField2 = fieldSubstrings[Common.TextFieldName.mainField2]; }
+ if (fieldSubstrings[Common.TextFieldName.mainField3] !== undefined) { showData.hmiUIText.mainField3 = fieldSubstrings[Common.TextFieldName.mainField3]; }
+ if (fieldSubstrings[Common.TextFieldName.mainField4] !== undefined) { showData.hmiUIText.mainField4 = fieldSubstrings[Common.TextFieldName.mainField4]; }
+ if (fieldSubstrings[Common.TextFieldName.statusBar] !== undefined) { showData.hmiUIText.statusBar = fieldSubstrings[Common.TextFieldName.statusBar]; }
+ if (fieldSubstrings[Common.TextFieldName.mediaTrack] !== undefined) { showData.hmiUIText.mediaTrack = fieldSubstrings[Common.TextFieldName.mediaTrack]; }
+ if (graphic) { showData.hmiUIText.image = graphic.value; }
+ if (textAlignment) { showData.hmiUITextAlignment = textAlignment; }
+ if (fieldSubstrings[Common.TextFieldName.mediaClock]) {
+ showData.mediaClock = {
+ "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
+ "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
+ "magic": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
+ "total": 0
+ }
+ }
+
+ dataContainer.setApplicationProperties(appID, showData);
+ console.debug("exit")
+ }
+
+ function addCommand (cmdID, menuParams, cmdIcon, appID) {
+ dataContainer.addCommand(cmdID, menuParams, cmdIcon, appID)
+ }
+
+ function deleteCommand (cmdID, appID) {
+ dataContainer.deleteCommand(cmdID, appID)
+ }
+
+ function addSubMenu (menuID, menuParams, appID) {
+ dataContainer.addSubMenu(menuID, menuParams, appID)
+ }
+
+ function deleteSubMenu (menuID, appID) {
+ dataContainer.deleteSubMenu(menuID, appID)
+ }
+
+ function performInteraction (initialText, choiceSet, vrHelp, timeout, appID) {
+ console.debug("enter")
+ var async = dataContainer.interactionModel.performInteraction(initialText, choiceSet, vrHelp, timeout, appID)
+ console.debug("exit")
+ return async
+ }
+
+ function setMediaClockTimer (startTime, endTime, updateMode, appID) {
+ console.debug("enter: {", startTime, ", ", endTime, ", ", updateMode, ", ", appID, "}")
+
+ var app = dataContainer.getApplication(appID)
+ var newStartTime
+ var newEndTime
+ var newUpdateMode
+ var newRunningMode
+ var newStartTimeForProgress
+ var resultCode
+ var sendErrorResponce = false
+
+ switch (updateMode) {
+ case Common.ClockUpdateMode.COUNTUP:
+ if (startTime === undefined) {
+ resultCode = Common.Result.INVALID_DATA
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
+ newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTUP
+ newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
+ newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.COUNTDOWN:
+ if (startTime === undefined) {
+ resultCode = Common.Result.INVALID_DATA
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
+ newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTDOWN
+ newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
+ newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.PAUSE:
+ // Already paused or cleared
+ if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_STOPPED)
+ || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
+ resultCode = Common.Result.IGNORED
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = app.mediaClock.startTime
+ newEndTime = app.mediaClock.endTime
+ newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ newUpdateMode = app.mediaClock.updateMode
+ newStartTimeForProgress = app.mediaClock.startTime
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.RESUME:
+ // Already resumed or cleared
+ if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_RUNNING)
+ || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
+ resultCode = Common.Result.IGNORED
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = app.mediaClock.startTime
+ newEndTime = app.mediaClock.endTime
+ newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
+ newStartTimeForProgress = app.mediaClock.startTime
+ newUpdateMode = app.mediaClock.updateMode
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.CLEAR:
+ newStartTime = -1
+ newEndTime = -1
+ newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ newUpdateMode = app.mediaClock.updateMode
+ newStartTimeForProgress = -1
+ resultCode = Common.Result.SUCCESS
+ break
+ }
+
+ if (sendErrorResponce) {
+ console.debug("exit with result code: ", resultCode)
+ return { __retCode: resultCode }
+ }
+
+ dataContainer.setApplicationProperties(appID, {
+ "mediaClock": {
+ "updateMode": newUpdateMode,
+ "runningMode": newRunningMode,
+ "startTime": newStartTime,
+ "endTime": newEndTime,
+ "startTimeForProgress": newStartTimeForProgress
+ }
+ })
+
+ console.debug("exit")
+ return { __retCode: resultCode }
+ }
+
+ function setGlobalProperties (vrHelpTitle, vrHelp, menuTitle, menuIcon, keyboardProperties, appID) {
+ console.debug("enter: " + vrHelpTitle + ", " + vrHelp + ", " + menuTitle + ", " + menuIcon + ", " + keyboardProperties + ", " + appID)
+ if (vrHelpTitle) {
+ vrHelpPopup.title = vrHelpTitle
+ }
+ dataContainer.setVrHelp(vrHelp)
+ console.debug("exit")
+ }
+
+ function showVrHelp (vrHelpTitle, vrHelp, appID) {
+ console.debug("enter: " + vrHelpTitle + ", " + vrHelp + ", " + appID)
+ if (vrHelpTitle) {
+ vrHelpPopup.title = vrHelpTitle
+ }
+ dataContainer.setVrHelp(vrHelp)
+ vrHelpPopup.show()
+ console.debug("exit")
+ }
+
+ function isReady () {
+ return {
+ available: dataContainer.hmiUIAvailable
+ }
+ }
+
+ function getLanguage () {
+ return {
+ language: dataContainer.hmiUILanguage
+ }
+ }
+
+ function getSupportedLanguages () {
+ return {
+ languages: settingsContainer.sdlLanguagesList
+ }
+ }
+
+ function changeRegistration (language, appID) {
+ dataContainer.changeRegistrationUI(language, appID)
+ }
+
+ function setAppIcon (syncFileName, appID) {
+ dataContainer.setApplicationProperties(appID, { icon: syncFileName.value })
+ }
+
+ function slider (numTicks, position, sliderHeader, sliderFooter, timeout, appID) {
+ console.debug("enter", numTicks, position, sliderHeader, sliderFooter, timeout, appID)
+ if (dataContainer.uiSlider.running) {
+ console.debug("aborted")
+ return {__retCode: Common.Result.ABORTED, sliderPosition: position}
+ }
+
+ dataContainer.uiSlider.appName = dataContainer.getApplication(appID).appName
+ dataContainer.uiSlider.header = sliderHeader
+ dataContainer.uiSlider.footer = sliderFooter
+ dataContainer.uiSlider.numTicks = numTicks
+ dataContainer.uiSlider.position = position
+ dataContainer.uiSlider.timeout = timeout
+
+ if (timeout !== 0) {
+ sliderPopup.showSlider()
+ sliderPopup.async = new Async.AsyncCall();
+ console.debug("exit")
+ return sliderPopup.async;
+ } else {
+ return { sliderPosition: position }
+ }
+ }
+
+ function scrollableMessage (messageText, timeout, softButtons, appID) {
+ console.debug("scrollableMessage ", messageText, timeout, softButtons, appID)
+ if(dataContainer.scrollableMessageModel.running){
+ //send error response if long message already running
+ console.debug("scrollableMessage throw")
+ throw Common.Result.ABORTED
+ }
+
+ dataContainer.scrollableMessageModel.longMessageText = messageText.fieldText
+ dataContainer.scrollableMessageModel.softButtons.clear();
+ if (softButtons !== undefined) {
+ softButtons.forEach(fillSoftButtons, dataContainer.scrollableMessageModel.softButtons);
+ }
+ dataContainer.scrollableMessageModel.timeout = timeout
+ dataContainer.scrollableMessageModel.appId = appID
+ dataContainer.scrollableMessageModel.async = new Async.AsyncCall()
+ contentLoader.go("./views/ScrollableMessageView.qml")
+ console.debug("scrollableMessage exit")
+ return dataContainer.scrollableMessageModel.async
+ }
+
+ function getCapabilities() {
+ return {
+ "audioPassThruCapabilities": {
+ "samplingRate": Common.SamplingRate.RATE_44KHZ,
+ "bitsPerSample": Common.BitsPerSample.RATE_8_BIT,
+ "audioType": Common.AudioType.PCM
+ },
+ "displayCapabilities": settingsContainer.displayCapabilities,
+ "hmiZoneCapabilities": Common.HmiZoneCapabilities.FRONT,
+ "softButtonCapabilities": settingsContainer.softButtonCapabilities
+ }
+ }
+
+ function performAudioPassThru (audioPassThruDisplayTexts, timeout, appID) {
+ console.debug("enter", audioPassThruDisplayTexts, timeout)
+
+ if (dataContainer.uiAudioPassThru.running) {
+ console.debug("aborted")
+ throw Common.Result.ABORTED
+ }
+
+ dataContainer.uiAudioPassThru.appName = dataContainer.getApplication(appID).appName
+ dataContainer.uiAudioPassThru.timeout = timeout
+ if (audioPassThruDisplayTexts.length === 2) {
+ dataContainer.uiAudioPassThru.firstLine = audioPassThruDisplayTexts[0].fieldText
+ dataContainer.uiAudioPassThru.secondLine = audioPassThruDisplayTexts[1].fieldText
+ }
+ performAudioPassThruPopup.async = new Async.AsyncCall();
+ performAudioPassThruPopup.showAudioPassThru()
+ console.debug("exit")
+ return performAudioPassThruPopup.async;
+ }
+
+ function endAudioPassThru () {
+ console.debug("enter")
+ if (!dataContainer.uiAudioPassThru.running) {
+ console.debug("rejected")
+ throw Common.Result.REJECTED
+ }
+ DBus.sendReply({__retCode: Common.Result.SUCCESS})
+ performAudioPassThruPopup.complete(Common.Result.SUCCESS)
+ console.debug("exit")
+ }
+
+ function closePopUp (methodName) {
+ console.debug("enter")
+ var popUpToClose
+
+ if (dataContainer.activePopup.length === 0) {
+ return { __retCode: Common.Result.ABORT, __message: "No active PopUps"}
+ }
+
+ if (methodName !== undefined) {
+ popUpToClose = methodName
+ } else {
+ popUpToClose = dataContainer.activePopup[dataContain.activePopUp.length - 1]
+ }
+
+ switch (popUpToClose) {
+ case "UI.PerformInteraction":
+ interactionPopup.complete(Common.Result.SUCCESS)
+ break
+ case "UI.Slider":
+ sliderPopup.complete(Common.Result.SUCCESS)
+ break
+ case "UI.PerformAudioPassThru":
+ performAudioPassThruPopup.complete(Common.Result.SUCCESS)
+ break
+ case "UI.Alert":
+ alertWindow.complete(Common.Result.SUCCESS)
+ break
+ case "UI.VrHelp":
+ vrHelpPopup.complete(Common.Result.SUCCESS)
+ break
+ }
+ console.debug("exit")
+ }
+
+ function fillSoftButtons(element, index, array) {
+ this.append({
+ type: element.type,
+ text: element.text,
+ image: element.image,
+ isHighlighted: element.isHighlighted,
+ softButtonID: element.softButtonID,
+ systemAction: element.systemAction
+ });
+ }
+
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml
new file mode 100644
index 0000000000..37d19f6a46
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml
@@ -0,0 +1,93 @@
+/**
+ * @file VR.qml
+ * @brief Implement of interface VR.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "Common.js" as Common
+
+Item {
+ function isReady() {
+ return {
+ available: dataContainer.hmiVRAvailable
+ }
+ }
+
+ function addCommand(cmdID, vrCommands, appID) {
+ console.log("VR.AddCommand: cmd ", cmdID, ", app ", appID);
+ for (var i = 0; i < vrCommands.length; ++i) {
+ dataContainer.vrCommands.append({
+ cmdID: cmdID,
+ command: vrCommands[i],
+ appID: appID === undefined ? 0 : appID,
+ });
+ }
+ console.log("exit")
+ }
+
+ function deleteCommand(cmdID, appID) {
+ console.log("VR.DeleteCommand: cmd ", cmdID, ", app ", appID);
+ for (var i = 0; i < dataContainer.vrCommands.count; ) {
+ if ((dataContainer.vrCommands.get(i).cmdID === cmdID) &&
+ ((appID === undefined) || (dataContainer.vrCommands.get(i).appID === appID))) {
+ dataContainer.vrCommands.remove(i);
+ continue;
+ }
+ ++i;
+ }
+ console.log("exit")
+ }
+
+ function getLanguage() {
+ return {
+ language: dataContainer.hmiTTSVRLanguage
+ }
+ }
+
+ function getSupportedLanguages() {
+ return {
+ languages: settingsContainer.sdlLanguagesList
+ }
+ }
+
+ function getCapabilities() {
+ return {
+ vrCapabilities: [ Common.VrCapabilities.VR_TEXT ]
+ }
+ }
+
+ function changeRegistration(language, appID) {
+ console.debug("enter:", language, appID);
+ dataContainer.changeRegistrationTTSVR(language, appID);
+ console.debug("exit");
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml
new file mode 100644
index 0000000000..18f3a1ce9e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml
@@ -0,0 +1,749 @@
+/**
+ * @file VehicleInfo.qml
+ * @brief Vehicle information interface realisation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "Common.js" as Common
+
+Item {
+ function isReady () {
+ return {
+ available: dataContainer.hmiVehicleInfoAvailable
+ }
+ }
+
+ function getVehicleType() {
+ return {
+ "vehicleType": {
+ "make": "Ford",
+ "model": "Fiesta",
+ "modelYear": "2013",
+ "trim": "SE"
+ }
+ }
+ }
+
+ function getGpsData(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { gps: dataContainer.vehicleInfoModel.gps }
+ }
+
+ function getSpeed(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { speed: dataContainer.vehicleInfoModel.speed }
+ }
+
+ function getRpm(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return {
+ rpm: dataContainer.vehicleInfoModel.rpm,
+ __retCode: Common.Result.DATA_NOT_AVAILABLE
+ }
+ }
+
+ function getFuelLevel(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { fuelLevel: dataContainer.vehicleInfoModel.fuelLevel }
+ }
+
+ function getFuelLevelState(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { fuelLevel_State: dataContainer.vehicleInfoModel.fuelLevel_State }
+ }
+
+ function getInstantFuelConsumption(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { instantFuelConsumption: dataContainer.vehicleInfoModel.instantFuelConsumption }
+ }
+
+ function getExternalTemperature(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { externalTemperature: dataContainer.vehicleInfoModel.externalTemperature }
+ }
+
+ function getVin(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { vin: dataContainer.vehicleInfoModel.vin }
+ }
+
+ function getPrndl(appID) {
+ console.debug("enter")
+ if (dataContainer.vehicleInfoModel.prndl === -1) { // Test value, to check response
+ console.debug("exit")
+ return {
+ prndl: dataContainer.vehicleInfoModel.prndl,
+ __retCode: Common.Result.DATA_NOT_AVAILABLE
+ }
+ }
+ console.debug("exit")
+ return { prndl: dataContainer.vehicleInfoModel.prndl }
+ }
+
+ function getTirePressure(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { tirePressure: dataContainer.vehicleInfoModel.tirePressure }
+ }
+
+ function getOdometer(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { odometer: dataContainer.vehicleInfoModel.odometer }
+ }
+
+ function getBeltStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { beltStatus: dataContainer.vehicleInfoModel.beltStatus }
+ }
+
+ function getBodyInformation(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { bodyInformation: dataContainer.vehicleInfoModel.bodyInformation }
+ }
+
+ function getDeviceStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { deviceStatus: dataContainer.vehicleInfoModel.deviceStatus }
+ }
+
+ function getDriverBraking(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { driverBraking: dataContainer.vehicleInfoModel.driverBraking }
+ }
+
+ function getWiperStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { wiperStatus: dataContainer.vehicleInfoModel.wiperStatus }
+ }
+
+ function getHeadLampStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { headLampStatus: dataContainer.vehicleInfoModel.headLampStatus }
+ }
+
+ function getEngineTorque(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { engineTorque: dataContainer.vehicleInfoModel.engineTorque }
+ }
+
+ function getAccPedalPosition(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { accPedalPosition: dataContainer.vehicleInfoModel.accPedalPosition }
+ }
+
+ function getSteeringWheelAngle(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { steeringWheelAngle: dataContainer.vehicleInfoModel.steeringWheelAngle }
+ }
+
+ function getECallInfo(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { eCallInfo: dataContainer.vehicleInfoModel.eCallInfo }
+ }
+
+ function getAirbagStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { airbagStatus: dataContainer.vehicleInfoModel.airbagStatus }
+ }
+
+ function getEmergencyEvent(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { emergencyEvent: dataContainer.vehicleInfoModel.emergencyEvent }
+ }
+
+ function getClusterModeStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { clusterModeStatus: dataContainer.vehicleInfoModel.clusterModeStatus }
+ }
+
+ function getMyKey(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { myKey: dataContainer.vehicleInfoModel.myKey }
+ }
+
+ function getDTCs(ecuName, dtcMask, appID) {
+ var ecuHeader = 2
+ var dtc = []
+
+ for (var i = 0; i < 3; i++) {
+ dtc.push("line" + i)
+ }
+ return {ecuHeader: ecuHeader, dtc: dtc}
+ }
+
+ function readDID(ecuName, didLocation, appID) {
+ console.debug("Enter")
+ //TODO{ALeshin}: refactoring of this function, when we'll have Vehicle Info module
+ var didResult = []
+
+ for (var i = 0; i < didLocation.length; i++) {
+ if (i < 10) {
+ didResult[i] = {}
+ didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_SUCCESS
+ didResult[i].didLocation = didLocation[i]
+ didResult[i].data = '0'
+ }
+ else {
+ didResult[i] = {}
+ didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_DATA_NOT_AVAILABLE
+ didResult[i].didLocation = didLocation[i]
+ didResult[i].data = '0'
+ }
+ }
+ console.debug("Exit")
+ return {didResult: didResult}
+ }
+
+ function subscribeGps(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onGpsChanged.disconnect(model.sendGpsChange)
+ model.onGpsChanged.connect(model.sendGpsChange)
+ console.debug("exit")
+ return {gps:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
+ }
+ function unsubscribeGps(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onGpsChanged.disconnect(model.sendGpsChange)
+ console.debug("exit")
+ return {gps:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
+
+ }
+
+ function subscribeSpeed(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSpeedChanged.disconnect(model.sendSpeedChange)
+ model.onSpeedChanged.connect(model.sendSpeedChange)
+ console.debug("exit")
+ return { speed:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeSpeed(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSpeedChanged.disconnect(model.sendSpeedChange)
+ console.debug("exit")
+ return { speed:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeRpm(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onRpmChanged.disconnect(model.sendRpmChange)
+ model.onRpmChanged.connect(model.sendRpmChange)
+ console.debug("exit")
+ return { rpm:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeRpm(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onRpmChanged.disconnect(model.sendRpmChange)
+ console.debug("exit")
+ return { rpm:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeFuelLevel(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
+ model.onFuelLevelChanged.connect(model.sendFuelLevelChange)
+ console.debug("exit")
+ return { fuelLevel:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeFuelLevel(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
+ console.debug("exit")
+ return { fuelLevel:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeFuelLevel_State(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
+ model.onFuelLevel_StateChanged.connect(model.sendFuelLevel_StateChange)
+ console.debug("exit")
+ return { fuelLevel_State:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeFuelLevel_State(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
+ console.debug("exit")
+ return { fuelLevel_State:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeInstantFuelConsumption(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
+ model.onInstantFuelConsumptionChanged.connect(model.sendInstantFuelConsumptionChange)
+ console.debug("exit")
+ return { instantFuelConsumption:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeInstantFuelConsumption(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
+ console.debug("exit")
+ return { instantFuelConsumption:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeExternalTemperature(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
+ model.onExternalTemperatureChanged.connect(model.sendExternalTemperatureChange)
+ console.debug("exit")
+ return { externalTemperature:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeExternalTemperature(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
+ console.debug("exit")
+ return { externalTemperature:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribePrndl(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onPrndlChanged.disconnect(model.sendPrndlChange)
+ model.onPrndlChanged.connect(model.sendPrndlChange)
+ console.debug("exit")
+ return { prndl:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribePrndl(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onPrndlChanged.disconnect(model.sendPrndlChange)
+ console.debug("exit")
+ return { prndl:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeVin(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onVinChanged.disconnect(model.sendVinChange)
+ model.onVinChanged.connect(model.sendVinChange)
+ console.debug("exit")
+ return { vin:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeVin(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onVinChanged.disconnect(model.sendVinChange)
+ console.debug("exit")
+ return { vin:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeTirePressure(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
+ model.onTirePressureChanged.connect(model.sendTirePressureChange)
+ console.debug("exit")
+ return { tirePressure:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeTirePressure(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
+ console.debug("exit")
+ return { tirePressure:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeOdometer(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onOdometerChanged.disconnect(model.sendOdometerChange)
+ model.onOdometerChanged.connect(model.sendOdometerChange)
+ console.debug("exit")
+ return { odometer:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeOdometer(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onOdometerChanged.disconnect(model.sendOdometerChange)
+ console.debug("exit")
+ return { odometer:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeBeltStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
+ model.onBeltStatusChanged.connect(model.sendBeltStatusChange)
+ console.debug("exit")
+ return { beltStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeBeltStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
+ console.debug("exit")
+ return { beltStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeBodyInformation(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
+ model.onBodyInformationChanged.connect(model.sendBodyInformationChange)
+ console.debug("exit")
+ return { bodyInformation:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeBodyInformation(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
+ console.debug("exit")
+ return { bodyInformation:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeDeviceStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
+ model.onDeviceStatusChanged.connect(model.sendDeviceStatusChange)
+ console.debug("exit")
+ return { deviceStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeDeviceStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
+ console.debug("exit")
+ return { deviceStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeDriverBraking(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
+ model.onDriverBrakingChanged.connect(model.sendDriverBrakingChange)
+ console.debug("exit")
+ return { driverBraking:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeDriverBraking(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
+ console.debug("exit")
+ return { driverBraking:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeWiperStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
+ model.onWiperStatusChanged.connect(model.sendWiperStatusChange)
+ console.debug("exit")
+ return { wiperStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeWiperStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
+ console.debug("exit")
+ return { wiperStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeHeadLampStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
+ model.onHeadLampStatusChanged.connect(model.sendHeadLampStatusChange)
+ console.debug("exit")
+ return { headLampStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeHeadLampStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
+ console.debug("exit")
+ return { headLampStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeEngineTorque(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
+ model.onEngineTorqueChanged.connect(model.sendEngineTorqueChange)
+ console.debug("exit")
+ return { engineTorque:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeEngineTorque(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
+ console.debug("exit")
+ return { engineTorque:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeAccPedalPosition(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
+ model.onAccPedalPositionChanged.connect(model.sendAccPedalPositionChange)
+ console.debug("exit")
+ return { accPedalPosition:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeAccPedalPosition(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
+ console.debug("exit")
+ return { accPedalPosition:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeSteeringWheelAngle(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
+ model.onSteeringWheelAngleChanged.connect(model.sendSteeringWheelAngleChange)
+ console.debug("exit")
+ return { steeringWheelAngle:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeSteeringWheelAngle(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
+ console.debug("exit")
+ return { steeringWheelAngle:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeECallInfo(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
+ model.onECallInfoChanged.connect(model.sendECallInfoChange)
+ console.debug("exit")
+ return { eCallInfo:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeECallInfo(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
+ console.debug("exit")
+ return { eCallInfo:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeAirbagStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
+ model.onAirbagStatusChanged.connect(model.sendAirbagStatusChange)
+ console.debug("exit")
+ return { airbagStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeAirbagStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
+ console.debug("exit")
+ return { airbagStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeEmergencyEvent(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
+ model.onEmergencyEventChanged.connect(model.sendEmergencyEventChange)
+ console.debug("exit")
+ return { emergencyEvent:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeEmergencyEvent(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
+ console.debug("exit")
+ return { emergencyEvent:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeClusterModeStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
+ model.onClusterModeStatusChanged.connect(model.sendClusterModeStatusChange)
+ console.debug("exit")
+ return { clusterModeStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeClusterModeStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
+ console.debug("exit")
+ return { clusterModeStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeMyKey(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
+ model.onMyKeyChanged.connect(model.sendMyKeyChange)
+ console.debug("exit")
+ return { myKey:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeMyKey(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
+ console.debug("exit")
+ return { myKey:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/log4cxx.properties b/src/components/qt_hmi/qml_model_qt4/log4cxx.properties
new file mode 100644
index 0000000000..0bc5ac8fdf
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/log4cxx.properties
@@ -0,0 +1,41 @@
+# Socket logger
+log4j.appender.SocketHub=org.apache.log4j.net.SocketHubAppender
+log4j.appender.SocketHub.port=4555
+log4j.appender.SocketHub.locationInfo=true
+
+# Only ERROR and FATAL messages are logged to console
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.ImmediateFlush=true
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %m%n
+log4j.appender.Console.Threshold=ERROR
+
+# Log for all DBus plugin messages
+log4j.appender.DBusPluginLogFile=org.apache.log4j.FileAppender
+log4j.appender.DBusPluginLogFile.File=DBusPlugin.log
+log4j.appender.DBusPluginLogFile.append=false
+log4j.appender.DBusPluginLogFile.DatePattern='.' yyyy-MM-dd
+log4j.appender.DBusPluginLogFile.ImmediateFlush=true
+log4j.appender.DBusPluginLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.DBusPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
+
+# Log for all HMI Framework plugin
+log4j.appender.HmiFrameworkPluginLogFile=org.apache.log4j.FileAppender
+log4j.appender.HmiFrameworkPluginLogFile.File=HmiFrameworkPlugin.log
+log4j.appender.HmiFrameworkPluginLogFile.append=false
+log4j.appender.HmiFrameworkPluginLogFile.DatePattern='.' yyyy-MM-dd
+log4j.appender.HmiFrameworkPluginLogFile.ImmediateFlush=true
+log4j.appender.HmiFrameworkPluginLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.HmiFrameworkPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
+
+# Log for all Qt HMI
+log4j.rootLogger=ALL, Console
+
+# Log for DBus plugin QtHMI
+log4j.logger.DBusPlugin=ALL, DBusPluginLogFile
+
+# Log for HMI Framework plugin
+log4j.logger.HmiFrameworkPlugin=ALL, HmiFrameworkPluginLogFile
+
+# Log by log4cxx plugin
+log4j.logger.Log4cxxPlugin=ALL, HmiFrameworkPluginLogFile
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml b/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml
new file mode 100644
index 0000000000..a50113095c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml
@@ -0,0 +1,57 @@
+/**
+ * @file ApplicationData.qml
+ * @brief Model for Application.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+QtObject {
+ property string mainField1
+ property string mainField2
+ property string mainField3
+ property string mainField4
+ property string statusBar
+ property string mediaTrack
+ property string image
+
+ function reset () {
+ console.debug("enter")
+ mainField1 = ""
+ mainField2 = ""
+ mainField3 = ""
+ mainField4 = ""
+ statusBar = ""
+ mediaTrack = ""
+ image = ""
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml
new file mode 100644
index 0000000000..206eaa9185
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml
@@ -0,0 +1,91 @@
+/**
+ * @file ApplicationModel.qml
+ * @brief Own fields for each application.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+
+QtObject {
+ property int appId
+ property string appName
+ property string ngnMediaScreenAppName
+ property Icon appIcon: Icon { }
+ property string deviceName
+ property int hmiDisplayLanguageDesired
+ property bool isMediaApplication
+ property variant appType
+ property int hmiUITextAlignment
+
+ // media player
+ property string playPauseState
+ property ApplicationData hmiUIText: ApplicationData { }
+ property MediaClockModel mediaClock: MediaClockModel { }
+
+ property string helpPrompt
+ property string timeoutPrompt
+ property ListModel options: ListModel { }
+
+ property ListModel currentSubMenu: options
+ property ListModel turnList
+ property ListModel softButtons
+ property ListModel turnListSoftButtons
+ property ListModel customPresets
+ property int languageTTSVR
+ // This place is for adding new properties
+
+ function reset () {
+ console.debug("enter")
+ appId = -1
+ appName = ""
+ ngnMediaScreenAppName = ""
+ appIcon.reset()
+ deviceName = ""
+ hmiDisplayLanguageDesired = -1
+ isMediaApplication = false
+ appType = undefined
+ playPauseState = ""
+ hmiUIText.reset()
+// no need to reset mediaClock
+ helpPrompt = ""
+ timeoutPrompt = ""
+ options.clear()
+ currentSubMenu = options
+ turnList = null
+ softButtons = null
+ turnListSoftButtons = null
+ customPresets = null
+ languageTTSVR = -1
+ hmiUITextAlignment = null
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml
new file mode 100644
index 0000000000..f636d1e794
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml
@@ -0,0 +1,78 @@
+/**
+ * @file CarMenuModel.qml
+ * @brief Car menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+
+ListModel
+{
+ ListElement {
+ name: "ambient"
+ icon: "../res/vehicle/Ambient Lighti Icon.png"
+ qml: ""
+ }
+ ListElement {
+ name: "cal"
+ icon: "../res/vehicle/cal.png"
+ qml: ""
+ }
+ ListElement {
+ name: "ev"
+ icon: "../res/vehicle/EV Icon.png"
+ qml: ""
+ }
+ ListElement {
+ name: "folders"
+ icon: "../res/vehicle/folders.png"
+ qml: ""
+ }
+ ListElement {
+ name: "key"
+ icon: "../res/vehicle/key_car.png"
+ qml: ""
+ }
+ ListElement {
+ name: "mcs"
+ icon: "../res/vehicle/MCS Icon.png"
+ qml: ""
+ }
+ ListElement {
+ name: "sun"
+ icon: "../res/vehicle/sun.png"
+ qml: ""
+ }
+ ListElement {
+ name: "sync"
+ icon: "../res/vehicle/SYNC Services.png"
+ qml: ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/Constants.js b/src/components/qt_hmi/qml_model_qt4/models/Constants.js
new file mode 100644
index 0000000000..1bc5c558ba
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/Constants.js
@@ -0,0 +1,249 @@
+/**
+ * @file Constants.js
+ * @brief Namespace of constants.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+.pragma library
+
+// Colors
+
+// Main color of HMI model(now it ~lightblue). Buttons, text, icons of this color.
+var primaryColor = "#1d81d5"
+
+// Color of pressed buttons, text, icons etc.
+var primaryColorPressed = "#8ec0ea"
+
+// Secondary color of HMI model, backgroud of this color.
+var secondaryColor = "black"
+
+// Color of text at buttonts that are inactive (at phone keyboard, when no any contact started with current letter).
+var inactiveButtonTextColor = "grey"
+
+// Color of text at buttonts that are inactive but nevertheless pressed (at phone keyboard, when no any contact started with current letter).
+var inactiveButtonTextColorPressed = "lightgrey"
+
+// Color of text at contact list screen view (Name, number and number type).
+var contactTextColor = "lightblue"
+
+// Color of text at buttons, when they are pressed.
+var pressedButtonTextColor = "black"
+
+// Color of text at "white" buttons, for all other buttons (which most) use primaryColor.
+var releasedButtonTextColor = "white"
+
+// Transparent background.
+var transparentColor = "#00000000"
+
+// "Warning" word color
+var warningColor = "red"
+
+// Color for PopUp
+var popUpBorderColor = "white"
+
+// Color for hardware and simulation panels
+var panelColor = "#003"
+
+// Color for text in hardware and simulation panels
+var panelTextColor = "white"
+
+// Audio pass thru PopUp text color
+var audioPassThruTextColor = "white"
+
+// Color for border of controls
+var controlsBorderColor = "#ababab"
+
+//--------------------------------------------------------------------------------------
+
+// Font sizes of different elements
+
+// Font size for most of text in HMI model.
+var fontSize = 20
+
+// Font size for text inside oval buttons.
+var ovalButtonFontSize = 15
+
+// Title font size
+var titleFontSize = 35
+
+// Power on/off button font size
+var powerButtonFornSize = 25
+
+// Font size of status bar
+var statusBarFontSize = 15
+
+// Size icon for buttons
+var iconButtonSize = 30
+
+// Size icon for item list
+var iconItemListSize = 40
+
+// font size fo TTS popup
+var ttsFontSize = 12
+
+// Font size for list of applications
+var appListFontSize = 40
+
+// Size of contact list fields
+var contactListNameFieldSize = 0.4
+var contactListPhoneFieldSize = 0.3
+var contactListDescriptionFieldSize = 0.3
+
+//--------------------------------------------------------------------------------------
+
+// Sizes of buttons, menus, screen, etc
+
+// Minimal width and height of screen (screen wont resize, if height and width are lower).
+var mainScreenMinWidth = 800
+var mainScreenMiHeight = 600
+
+// Width for long oval button
+var ovalButtonWidth = 163
+
+// Height for oval button
+var ovalButtonHeight = 65
+
+// Height item list
+var itemListHeight = 60
+
+// Width for TTS popup
+var ttsPopUpWidth = 250
+
+// Height for TTS popup
+var ttsPopUpHeight = 100
+
+// Width for popup view
+var popupWidth = 700
+
+// Width for alert window
+var alertWidth = 360
+
+// Height for popup view
+var popupHeigth = 500
+
+// Width for combobox
+var defaultComboboxWidth = 150
+
+// Size icon for list of applications
+var appListIconSize = 100
+
+// DistanceBar height
+var distanceBarHeight = 1
+
+
+//---------------------------------------------------------------------------------------
+
+// Other
+
+// Offset from the edges of the screen.
+var margin = 20
+
+// Offset from the edges of the popup
+var popupMargin = 15
+
+// Spacing between contacts at contact screen view.
+var contactListSpacing = 30
+
+// Duration of appearance of icon/button at icon/button menus.
+var animationDuration = 500
+
+// Duration of appearence of "OK" button at warning screen view, when HMI starts.
+var warningScreenDuration = 1000
+
+// Timer to check how long preset button is pressed.
+var presetButtonTimer = 800
+
+// Spacing between icon and item in list
+var iconItemListSpacing = 20
+
+// Spacing between item on views
+var generalSpacing = 10
+
+// Width of scrollBar
+var scrollBarWidth = 5
+
+// Speak text for a given time
+var ttsSpeakTime = 2000
+
+// Maximal number of submenus
+var maximumSubmenus = 1000
+
+// Maximal number of commands in submenu or root menu
+var maximumCommandsPerSubmenu = 1000
+
+// padding for popup view
+var popUpPadding = 20
+
+// Padding for TTS popup
+var ttsPopUpPadding = 10
+
+// -------------------------
+var sliderBarWidth = 400
+var sliderBarHeight = 50
+var sliderBarRadius = 3
+var sliderBarBorderWidth = 1
+var sliderTextColor = "white"
+var sliderBarBorderColor = "white"
+var sliderBarFillColor = "white"
+
+// -------------------------
+var scrollableMessageTextColor = "white"
+var scrollableMessageScrollBarColor = "gray"
+var scrollableMessageScrollBarWidth = 10
+
+// Padding for hardware and simulation panels
+var panelPadding = 20
+
+// Scale for pressed icon in menu
+var pressedIconScale = 1.1
+
+// Values of color effect for highlighted button
+var highlightedButtonHue = 0.9
+var highlightedButtonSaturation = 0.0
+var highlightedButtonLightness = 0.1
+
+// Values of color effect for disabled button
+var disabledButtonHue = 0.0
+var disabledButtonSaturation = -1.0
+var disabledButtonLightness = 0.1
+
+// Count of rows for grid menu
+var menuRowCount = 2
+
+// Count of columns for grid menu
+var menuColumnCount = 3
+
+// Radius of controls
+var controlsRadius = 2
+
+// Width of border of controls
+var controlsBorderWidth = 1
+// Position for element that came without position value (should be always at the end)
+var positionOfElementWithoutPosition = 1001
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml
new file mode 100644
index 0000000000..348d30156c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml
@@ -0,0 +1,98 @@
+/**
+ * @file ContactsListModel.qml
+ * @brief List of contacts.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+
+ListModel
+{
+ // TODO {ALeshin}: This list model should be sorted in ABC and Upper/lower case order,
+ // when it will be filled dynamically.
+ ListElement { name: "Aaron" ; phone:"(614)555-2444";type:"Mobile"}
+ ListElement { name: "Adrian" ; phone:"(740)245-3434";type:"Mobile" }
+ ListElement { name: "Albert" ; phone:"(614)245-5584";type:"Mobile" }
+ ListElement { name: "Alice" ; phone:"(313)878-3566";type:"Office"}
+ ListElement { name: "Alec" ; phone:"(917)608-2418";type:"Mobile"}
+ ListElement { name: "Alexander" ; phone:"(614)608-2400";type:"Home"}
+ ListElement { name: "Alexander Vasil'evich Michail Leontiy" ; phone:"(614)608-2400";type:"Mobile"}
+ ListElement { name: "Amber" ; phone:"(614)608-2111";type:"Mobile"}
+ ListElement { name: "Amy" ; phone:"(440)245-3434";type:"Mobile" }
+ ListElement { name: "Andy" ; phone:"(313)245-3434";type:"Mobile" }
+ ListElement { name: "Antje" ; phone:"(567)245-3434";type:"Home" }
+ ListElement { name: "buddy" ; phone:"(614)813-6610";type:"Mobile" }
+ ListElement { name: "Barry" ; phone:"(313)555-2211";type:"Mobile" }
+ ListElement { name: "Bea" ; phone:"(614)455-3434";type:"Mobile" }
+ ListElement { name: "Ben" ; phone:"(614)882-1843";type:"Office" }
+ ListElement { name: "Blake" ; phone:"(330)149-7778";type:"Mobile" }
+ ListElement { name: "Bob Mould" ; phone:"(313)245-3434";type:"Mobile" }
+ ListElement { name: "Brian" ; phone:"(614)332-7499";type:"Mobile" }
+ ListElement { name: "Calvin" ; phone:"(614)442-9974";type:"Mobile" }
+ ListElement { name: "Carl" ; phone:"(567)773-3434";type:"Home" }
+ ListElement { name: "Cat Power" ; phone:"(313)608-3434";type:"Home"}
+ ListElement { name: "Cathy" ; phone:"(313)444-456";type:"Home"}
+ ListElement { name: "Chris" ; phone:"(734)997-6514";type:"Home" }
+ ListElement { name: "Cloud Nothings"; phone:"(444)608-543";type:"Mobile"}
+ ListElement { name: "Cody" ; phone:"(567)365-8413";type:"Home" }
+ ListElement { name: "Curtis" ; phone:"(614)245-1547";type:"Office" }
+ ListElement { name: "Dakota" ; phone:"(567)555-4444";type:"Home" }
+ ListElement { name: "Dale" ; phone:"(567)723-1974";type:"Mobile" }
+ ListElement { name: "Dallas"; phone:"(614)556-879";type:"Home"}
+ ListElement { name: "Damian" ; phone:"(614)245-3434";type:"Office" }
+ ListElement { name: "Daniel"; phone:"(614)556-879";type:"Home"}
+ ListElement { name: "Darina"; phone:"(313)895-888";type:"Mobile"}
+ ListElement { name: "Dee "; phone:"(313)432-3434";type:"Home"}
+// ListElement { name: "Edward" ; phone:"(917)608-975";type:"Office"}
+ ListElement { name: "Ferdinand" ; phone:"(917)879-795";type:"Mobile"}
+ ListElement { name: "gomez" ; phone:"(313)455-543";type:"Mobile"}
+ ListElement { name: "Harry Potter"; phone:"(313)888-432";type:"Home"}
+ ListElement { name: "Ivan"; phone:"(313)996-225";type:"Home"}
+// ListElement { name: "James" ; phone:"(917)608-3434";type:"Mobile"}
+ ListElement { name: "Karen"; phone:"(313)998-332";type:"Home"}
+ ListElement { name: "Luis Torres"; phone:"(313)779-111";type:"Home"}
+ ListElement { name: "Mary"; phone:"(313)234-098";type:"Mobile"}
+ ListElement { name: "Neil"; phone:"(313)444-112";type:"Mobile"}
+ ListElement { name: "Oswald"; phone:"(313)456-921";type:"Mobile"}
+ ListElement { name: "Oscar"; phone:"(313)332-778";type:"Home"}
+ ListElement { name: "~1123"; phone:"(313)1332";type:"Home"}
+ ListElement { name: "Patrice"; phone:"(313)789-111";type:"Mobile"}
+ ListElement { name: "Queen Elizabeth"; phone:"(313)897-666";type:"Mobile"}
+ ListElement { name: "Rose"; phone:"(313)111-211";type:"Mobile"}
+ ListElement { name: "Susell"; phone:"(313)345-122";type:"Home"}
+ ListElement { name: "Thomas"; phone:"(917)608-342";type:"Mobile"}
+ ListElement { name: "Titus Andronicus" ; phone:"(917)608-321";type:"Office"}
+ ListElement { name: "Toretto" ; phone:"(917)608-3434";type:"Home"}
+ ListElement { name: "Uhl" ; phone:"(313)444-654";type:"Office"}
+ ListElement { name: "willi" ; phone:"(313)224-5712";type:"Office"}
+ ListElement { name: "Wanda" ; phone:"(313)666-6969";type:"Office"}
+ ListElement { name: "wanda" ; phone:"(313)666-6969";type:"Office"}
+ ListElement { name: "Zara" ; phone:"(313)231-009";type:"Mobile"}
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml
new file mode 100644
index 0000000000..cc5f6fc215
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml
@@ -0,0 +1,510 @@
+/**
+ * @file DataStorage.qml
+ * @brief Container for data.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "Internal.js" as Internal
+import "Constants.js" as Constants
+
+QtObject {
+
+ property string contactsFirstLetter // first letter of contact's name that need to find at contact list
+ property ApplicationModel currentApplication: ApplicationModel { }
+ property SliderModel uiSlider: SliderModel { }
+ property PerformAudioPassThruModel uiAudioPassThru: PerformAudioPassThruModel { }
+
+ function getApplication(appId) {
+ console.log("dataContainer getApplication enter");
+ for(var i = 0; i < applicationList.count; i++) {
+ if(applicationList.get(i).appId === appId) {
+ console.log("Application found", applicationList.get(i));
+ return applicationList.get(i);
+ }
+ }
+ console.log("dataContainer getApplication exit");
+ }
+
+ onApplicationListChanged: {
+ console.log("onApplicationListChanged()");
+ setCurrentApplication(appId);
+ }
+
+ function setCurrentApplication(appId) {
+ console.log("Enter setCurrentApplication function");
+ var oldApplicationContext = applicationContext;
+ if (currentApplication.appId !== appId) {
+ applicationContext = false;
+ }
+
+ for(var i = 0; i < applicationList.count; i++) {
+ if(applicationList.get(i).appId === appId) {
+ currentApplication.appId = appId
+ var application = applicationList.get(i)
+ currentApplication.appName = application.appName
+ currentApplication.appType = application.appType
+ currentApplication.appIcon.source = application.icon
+ currentApplication.playPauseState = application.playPauseState
+ currentApplication.options = application.options
+ currentApplication.softButtons = application.softButtons
+ currentApplication.customPresets = application.customPresets
+
+ if (application.hmiUIText.mainField1 !== undefined) {
+ currentApplication.hmiUIText.mainField1 = application.hmiUIText.mainField1
+ }
+ if (application.hmiUIText.mainField2 !== undefined) {
+ currentApplication.hmiUIText.mainField2 = application.hmiUIText.mainField2
+ }
+ if (application.hmiUIText.mainField3 !== undefined) {
+ currentApplication.hmiUIText.mainField3 = application.hmiUIText.mainField3
+ }
+ if (application.hmiUIText.mainField4 !== undefined) {
+ currentApplication.hmiUIText.mainField4 = application.hmiUIText.mainField4
+ }
+ if (application.hmiUIText.statusBar !== undefined) {
+ currentApplication.hmiUIText.statusBar = application.hmiUIText.statusBar
+ }
+ if (application.hmiUIText.mediaTrack !== undefined) {
+ currentApplication.hmiUIText.mediaTrack = application.hmiUIText.mediaTrack
+ }
+ if (application.hmiUIText.image !== undefined) {
+ currentApplication.hmiUIText.image = application.hmiUIText.image
+ }
+ if (application.hmiUITextAlignment !== undefined) {
+ currentApplication.hmiUITextAlignment = application.hmiUITextAlignment
+ }
+ if (application.helpPrompt !== undefined) {
+ currentApplication.helpPrompt = application.helpPrompt
+ }
+ if (application.timeoutPrompt !== undefined) {
+ currentApplication.timeoutPrompt = application.timeoutPrompt
+ }
+ // Check fields with mandatory = false
+
+ currentApplication.deviceName = application.deviceName
+ currentApplication.isMediaApplication = application.isMediaApplication
+ currentApplication.turnList = application.turnList
+ currentApplication.turnListSoftButtons = application.turnListSoftButtons
+ currentApplication.mediaClock.updateMode = application.mediaClock.updateMode
+ currentApplication.mediaClock.runningMode = application.mediaClock.runningMode
+ currentApplication.mediaClock.startTimeForProgress = application.mediaClock.startTimeForProgress
+ if (application.mediaClock.startTime !== undefined) {
+ currentApplication.mediaClock.startTime = application.mediaClock.startTime
+ }
+ if (application.mediaClock.endTime !== undefined) {
+ currentApplication.mediaClock.endTime = application.mediaClock.endTime
+ }
+ currentApplication.languageTTSVR = application.languageTTSVR
+ currentApplication.hmiDisplayLanguageDesired = application.hmiDisplayLanguageDesired
+ // This place is for adding new properties
+ }
+ }
+ applicationContext = oldApplicationContext;
+ currentApplicationChanged()
+ console.log("Exit setCurrentApplication function")
+ }
+
+ function addApplication(app) {
+ console.log("enter")
+ applicationList.append({
+ appName: app.appName,
+ ngnMediaScreenAppName: app.ngnMediaScreenAppName,
+ icon: app.icon,
+ deviceName: app.deviceName,
+ appId: app.appId,
+ hmiDisplayLanguageDesired: app.hmiDisplayLanguageDesired,
+ isMediaApplication: app.isMediaApplication,
+ appType: app.appType,
+ helpPrompt: "",
+ timeoutPrompt: "",
+ customPresets: app.customPresets ? app.customPresets : [],
+ playPauseState: 'Pause',
+ hmiUIText: app.hmiUIText,
+ hmiUITextAlignment: app.hmiUITextAlignment,
+ options: [],
+ turnList: [],
+ turnListSoftButtons: [],
+ mediaClock: app.mediaClock,
+ languageTTSVR: Common.Language.EN_US,
+ softButtons: []
+ // This place is for adding new properties
+ })
+
+ if (app.isMediaApplication) {
+ musicSourceModel.insert(0, {
+ "title": app.appName,
+ "qml": "views/SDLPlayerView.qml",
+ "appId": app.appId
+ })
+ }
+
+ console.log("exit")
+ }
+
+ function setApplicationProperties(appId, props) {
+ console.log("Enter setApplicationProperties function");
+ var app = getApplication(appId)
+ for (var p in props) {
+ if (props[p] !== undefined) {
+ app[p] = props[p]
+ }
+ }
+ if (currentApplication.appId === appId) {
+ setCurrentApplication(appId); // copy new values to current application
+ }
+ console.log("Exit setApplicationProperties function");
+ }
+
+ function removeApplication(appId) {
+ console.log("enter");
+ for (var j = 0; j < musicSourceModel.count; ++j) {
+ if (musicSourceModel.get(j).appId === appId) {
+ musicSourceModel.remove(j);
+ break;
+ }
+ }
+ for (var i = 0; i < applicationList.count; i++) {
+ if (applicationList.get(i).appId === appId) {
+ applicationList.remove(i);
+ break;
+ }
+ }
+ console.log("exit");
+ }
+
+ property int systemContext
+ property int hmiContext
+ property bool applicationContext: false
+ property bool applicationSavedContext
+ property string routeText: ""
+ property PlayerState cdPlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState ipodPlayerState: PlayerState {
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ playPauseState: 'Pause'
+ }
+ property PlayerState usbPlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState linePlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState btPlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState amPlayerState: PlayerState {
+ songName: "So Far Around The Bend"
+ albumName: "The National"
+ presets: [ "1130", "950", "760", "1270", "1400", "2100", "940", "1001" ]
+ }
+ property PlayerState fmPlayerState: PlayerState {
+ songName: "So Far Around The Bend"
+ albumName: "The National"
+ presets: ["96.3", "107.9", "104.3", "101.9", "105.3", "100.5", "107.9", "103.4"]
+ }
+ property PlayerState siriusPlayerState: PlayerState {
+ songName: "So Far Around The Bend"
+ albumName: "The National"
+ presets: [ "Lithium", "Spectrum", "ESPN", "Alt Nation", "Lithium", "Spectrum", "ESPN", "Alt Nation" ]
+ }
+
+ property bool hmiVRAvailable: false
+ property bool hmiTTSAvailable: false
+ property bool hmiNavigationAvailable: false
+ property bool hmiVehicleInfoAvailable: false
+ property bool hmiUIAvailable: false
+
+ property int hmiUILanguage: Common.Language.EN_US
+ property int hmiTTSVRLanguage: Common.Language.EN_US
+
+ property ListModel deviceList: ListModel { }
+ property ListModel applicationList: ListModel { }
+
+ property ListModel vrCommands: ListModel {}
+
+ property ListModel vrHelp: ListModel {}
+
+ function reset () {
+ console.log("dataContainer reset enter");
+ routeText = ""
+ console.log("dataContainer reset exit");
+ }
+
+ function changeRegistrationUI (language, appID) {
+ console.log("dataContainer changeRegistrarionUI enter");
+ setApplicationProperties(appID, { hmiDisplayLanguageDesired: language });
+ console.log("dataContainer changeRegistrarionUI exit");
+ }
+
+ function changeRegistrationTTSVR(language, appID) {
+ console.log("dataContainer changeRegistrationTTSVR enter");
+ setApplicationProperties(appID, { languageTTSVR: language });
+ console.log("dataContainer changeRegistrationTTSVR exit");
+ }
+
+ function addCommand (cmdID, menuParams, cmdIcon, appID) {
+ console.debug("enter: " +
+ cmdID +
+ ", " +
+ (menuParams ?
+ "{" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}" : menuParams) +
+ ", " +
+ (cmdIcon ?
+ "{" + cmdIcon.value + ", " + cmdIcon.imageType + "}" : cmdIcon) +
+ ", " +
+ appID
+ )
+ var commandToAddPosition
+ var app = getApplication(appID)
+ var currentMenu = app.options
+ var maximumCommands = Constants.maximumCommandsPerSubmenu
+ var index = 0
+
+ if ((menuParams) && (menuParams.parentID)) { // Work with sub menu
+ var parentNotFound = true
+ for (var optionIndex = 0; optionIndex < app.options.count; ++optionIndex) {
+ if ((app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) && (app.options.get(optionIndex).id === menuParams.parentID)) {
+ currentMenu = app.options.get(optionIndex).subMenu
+ parentNotFound = false
+ maximumCommands += 1
+ }
+ }
+ if (parentNotFound) {
+ console.log("UI::addCommand(): parentID " + menuParams.parentID + " not found")
+ }
+ }
+
+ if (currentMenu.count < maximumCommands) {
+ if (menuParams && (menuParams.position !== undefined)) {
+ commandToAddPosition = menuParams.position
+ } else {
+ commandToAddPosition = Constants.positionOfElementWithoutPosition
+ }
+ for (var i = 0; i < currentMenu.count; i++) {
+ if (commandToAddPosition >= currentMenu.get(i).position) {
+ index = i + 1
+ } else {
+ break
+ }
+ }
+ currentMenu.insert( index,
+ { id: cmdID,
+ name: menuParams.menuName,
+ type: Internal.MenuItemType.MI_NODE,
+ position: commandToAddPosition,
+ icon: cmdIcon ? cmdIcon : {},
+ subMenu: []
+ })
+ } else {
+ console.log("addCommand(): too many commands in menu: ", menuParams.parentID, " rejecting")
+ throw Common.Result.REJECTED
+ }
+ console.debug("exit")
+ }
+
+ function deleteCommand (cmdID, appID) {
+ console.debug("enter: " + cmdID + ", " + appID)
+ for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
+ var option = getApplication(appID).options.get(optionIndex)
+ if (option.type === Internal.MenuItemType.MI_NODE) {
+ if (option.id === cmdID) {
+ getApplication(appID).options.remove(optionIndex)
+ break
+ }
+ }
+ if (option.type === Internal.MenuItemType.MI_SUBMENU) {
+ var subMenu = option.subMenu
+ var idMatchFound = false
+ for (var subOptionIndex = 0; subOptionIndex < subMenu.count; ++subOptionIndex) {
+ if (subMenu.get(subOptionIndex).id === cmdID) {
+ idMatchFound = true
+ if (subMenu !== currentApplication.currentSubMenu) {
+ subMenu.remove(subOptionIndex)
+ }
+ else {
+ console.log("UI::deleteCommand(): cannot remove item from current submenu")
+ throw Common.Result.IN_USE
+ }
+ break
+ }
+ }
+ if (idMatchFound) {
+ break
+ }
+ }
+ }
+ console.debug("exit")
+ }
+
+ function addSubMenu (menuID, menuParams, appID) {
+ console.debug("enter: " + menuID + ", {" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}, " + appID)
+ var app = getApplication(appID)
+ var index = 0
+ var count = app.options.count
+ var subMenuToAddPosition
+
+ if (count < Constants.maximumSubmenus) {
+ if (menuParams.position !== undefined) {
+ subMenuToAddPosition = menuParams.position
+ } else {
+ subMenuToAddPosition = Constants.positionOfElementWithoutPosition
+ }
+ for (var i = 0; i < count; i++) {
+ if (subMenuToAddPosition >= app.options.get(i).position) {
+ index = i + 1
+ } else {
+ break
+ }
+ }
+ app.options.insert(index, {
+ "id": menuID,
+ "name": menuParams.menuName,
+ "position": subMenuToAddPosition,
+ "type": Internal.MenuItemType.MI_SUBMENU,
+ "icon": undefined,
+ "subMenu": [{
+ "id": -1,
+ "name": menuParams.menuName,
+ "position": -1,
+ "type": Internal.MenuItemType.MI_PARENT,
+ "icon": {
+ "imageType": Common.ImageType.DYNAMIC,
+ "value": "../res/nav/turnArrow.png"
+ },
+ "subMenu": getApplication(appID).options
+ }]
+ })
+ }
+ else {
+ console.log("addSubMenu(): too many submenus, rejecting")
+ throw Common.Result.REJECTED
+ }
+ console.debug("exit")
+ }
+
+ function deleteSubMenu (menuID, appID) {
+ console.debug("enter: " + menuID + ", " + appID)
+ for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
+ var option = getApplication(appID).options.get(optionIndex)
+ if ((option.type === Internal.MenuItemType.MI_SUBMENU) && (option.id === menuID)) {
+ if (option.subMenu !== currentApplication.currentSubMenu) {
+ getApplication(appID).options.remove(optionIndex)
+ }
+ else {
+ console.log("UI::deleteSubMenu(): cannot remove current submenu")
+ throw Common.Result.IN_USE
+ }
+ break
+ }
+ }
+ console.debug("exit")
+ }
+
+ function setVrHelp (vrHelp) {
+ this.vrHelp.clear()
+ var index
+ for (var i = 0; i < vrHelp.length; ++i) {
+ index = 0
+// sort by simple inserts
+ while ((index < this.vrHelp.count) && (this.vrHelp.get(index).position < vrHelp[i].position)) {
+ ++index
+ }
+ this.vrHelp.insert(index, {
+ "text": vrHelp[i].text,
+ "icon": vrHelp[i].image ? vrHelp[i].image : {},
+ "position": vrHelp[i].position
+ })
+ }
+ }
+
+ property NavigationModel navigationModel: NavigationModel { }
+ property VehicleInfoModel vehicleInfoModel: VehicleInfoModel { }
+ property ScrollableMessageModel scrollableMessageModel: ScrollableMessageModel { }
+ property bool activeVR: false
+
+ property InteractionModel interactionModel: InteractionModel {
+ }
+
+ property int driverDistractionState: Common.DriverDistractionState.DD_OFF
+ onDriverDistractionStateChanged: {
+ sdlUI.onDriverDistraction(driverDistractionState);
+ }
+ property bool activeTTS: false
+ property variant activePopup
+ property int popups: 0
+
+ property bool activeAlert: false
+
+ onActiveVRChanged: setSystemContext()
+ onActiveAlertChanged: setSystemContext()
+ onPopupsChanged: setSystemContext()
+
+ function setSystemContext () {
+ console.debug("enter")
+ if (popups > 0) {
+ systemContext = Common.SystemContext.SYSCTXT_HMI_OBSCURED
+ }
+ else if (activeAlert) {
+ systemContext = Common.SystemContext.SYSCTXT_ALERT
+ }
+ else if (activeVR) {
+ systemContext = Common.SystemContext.SYSCTXT_VRSESSION
+ }
+ else if (contentLoader.item !== null) {
+ systemContext = contentLoader.item.systemContext
+ }
+ console.debug("exit")
+ }
+ property MusicSourceModel musicSourceModel: MusicSourceModel {
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml b/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml
new file mode 100644
index 0000000000..8da8a035db
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml
@@ -0,0 +1,58 @@
+/**
+ * @file InteractionModel.qml
+ * @brief Interaction model.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Async.js" as Async
+
+QtObject {
+ property string initialText
+ property ListModel choice: ListModel {
+ }
+ property int timeout
+ property variant async
+
+ function performInteraction (initialText, choiceSet, vrHelp, timeout, appID) {
+ console.debug("enter")
+ this.initialText = initialText.fieldText
+ choice.clear()
+ for (var i = 0; i < choiceSet.length; ++i) {
+ choice.append({"id": choiceSet[i].choiceID, "name": choiceSet[i].menuName ? choiceSet[i].menuName : "choiceID = " + choiceSet[i].choiceID, image: choiceSet[i].image})
+ }
+ this.timeout = timeout
+ interactionPopup.activate()
+ async = new Async.AsyncCall()
+ console.debug("exit")
+ return async
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/Internal.js b/src/components/qt_hmi/qml_model_qt4/models/Internal.js
new file mode 100644
index 0000000000..4a1ebc625a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/Internal.js
@@ -0,0 +1,163 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var MenuItemType = {
+ MI_NODE: 0,
+ MI_SUBMENU: 1,
+ MI_PARENT: 2
+}
+
+function activePageChoose(flickElement, pages) {
+ if (flickElement.contentX <= 0) {
+ return 0
+ }
+ else if ( (flickElement.contentWidth - flickElement.contentX) < flickElement.width) {
+ return pages -1
+ }
+ else {
+ if ( (flickElement.contentX % flickElement.width) >= (1/6 * flickElement.width)) {
+ return Math.ceil(flickElement.contentX / flickElement.width)
+ }
+ else if ( (flickElement.contentX % flickElement.width) > 0) {
+ return Math.floor(flickElement.contentX / flickElement.width)
+ }
+ }
+}
+
+var MediaClockUpdateMode = {
+ MCU_COUNTUP: 0,
+ MCU_COUNTDOWN: 1,
+}
+
+var MediaClockRunningMode = {
+ MCR_RUNNING: 0,
+ MCR_STOPPED: 1
+}
+
+function appendVrHelpItem (arrayElement, index, array) {
+ this.append({
+ text: arrayElement.text,
+ image: arrayElement.image ? arrayElement.image : "",
+ position: arrayElement.position
+ })
+}
+
+function checkBit(value, bitPosition) {
+ return (value & (1 << bitPosition))
+}
+
+function getArrayForPresetRow() {
+ var array = []
+ for (var i = 0; i < dataContainer.currentApplication.customPresets.count; i++) {
+ array.push(dataContainer.currentApplication.customPresets.get(i).text)
+ }
+ return array
+}
+
+function pad (string, length, lead) {
+ if (!lead) {
+ lead = '0'
+ }
+ var paddedString = "" + string
+ while (paddedString.length < length) {
+ paddedString = lead + paddedString
+ }
+ return paddedString
+}
+
+function hmsTime (hours, minutes, seconds) {
+ return 60 * (60 * hours + minutes) + seconds
+}
+
+function hmsTimeToString (hmsTime) {
+ if (hmsTime === -1) {
+ return "0:00:00"
+ }
+
+ var _time = hmsTime
+ var seconds = _time % 60
+ _time -= seconds
+ _time /= 60
+ var minutes = _time % 60
+ _time -= minutes
+ _time /= 60
+ var hours = _time
+ var string = ""
+ string += hours
+ string += ":"
+ string += pad(minutes, 2)
+ string += ":"
+ string += pad(seconds, 2)
+ return string
+}
+
+function stringToHmsTime (hmsString) {
+ console.debug("enter: \"" + hmsString + "\"")
+ var substrings = hmsString.split(":")
+ var seconds = substrings.length > 0 ? parseInt(substrings.pop()) : 0
+ if (seconds >= 60) {
+ console.log("incorrect field \"seconds\": " + seconds)
+ console.debug("exit")
+ return 0
+ }
+ var minutes = substrings.length > 0 ? parseInt(substrings.pop()) : 0
+ if (minutes >= 60) {
+ console.log("incorrect field \"minutes\": " + minutes)
+ console.debug("exit")
+ return 0
+ }
+ var hours = substrings.length > 0 ? parseInt(substrings.pop()) : 0
+ console.debug("exit")
+ return hmsTime(hours, minutes, seconds)
+}
+
+function mediaClockUpdateModeToString (mediaClockUpdateMode) {
+ switch (mediaClockUpdateMode) {
+ case MediaClockUpdateMode.MCU_COUNTUP:
+ return "Internal.MediaClockUpdateMode.MCU_COUNTUP"
+ case MediaClockUpdateMode.MCU_COUNTDOWN:
+ return "Internal.MediaClockUpdateMode.MCU_COUNTDOWN"
+ default:
+ return ""
+ }
+}
+
+function mediaClockRunningModeToString (mediaClockRunningMode) {
+ switch (mediaClockRunningMode) {
+ case MediaClockRunningMode.MCR_RUNNING:
+ return "Internal.MediaClockRunningMode.MCR_RUNNING"
+ case MediaClockRunningMode.MCR_STOPPED:
+ return "Internal.MediaClockRunningMode.MCR_STOPPED"
+ default:
+ return ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml
new file mode 100644
index 0000000000..49b4e7fb9a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml
@@ -0,0 +1,79 @@
+/**
+ * @file MainMenuListModel.qml
+ * @brief Main menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+
+ListModel
+{
+ ListElement {
+ name: "Climate"
+ icon: "../res/snow.png"
+ qml: "./views/ClimateControlView.qml"
+ }
+
+ ListElement {
+ name: "Navigation"
+ icon: "../res/arrow.png"
+ qml: "./views/NavigationNoRouteGridView.qml"
+ }
+
+ ListElement {
+ name: "Media"
+ icon: "../res/notes.png"
+ qml: "./views/MusicSourceView.qml"
+ }
+
+ ListElement {
+ name: "Preferences"
+ icon: "../res/gear.png"
+ qml: ""
+ }
+
+ ListElement {
+ name: "Apps"
+ icon: "../res/apps.png"
+ qml: "./views/ApplicationListView.qml"
+ }
+
+ ListElement {
+ name: "Phone"
+ icon: "../res/phone/phone.png"
+ qml: "./views/PhoneMenuGridView.qml"
+ }
+
+ ListElement {
+ name: "Car"
+ icon: "../res/car.png"
+ qml: "./views/CarMenuGridView.qml"
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml
new file mode 100644
index 0000000000..8f062008a4
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml
@@ -0,0 +1,112 @@
+/**
+ * @file MediaClockModel.qml
+ * @brief Media clock model
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "Internal.js" as Internal
+
+QtObject {
+ property int updateMode
+ property int runningMode
+ property int startTime
+ property int endTime
+ property int upperTimeLimit: 60 * 60 * 60 - 1
+ property int startTimeForProgress
+ property real progress
+
+ property Timer timer: Timer {
+ id: timer
+ interval: 1000
+ repeat: true
+ onTriggered: onTimer()
+ }
+ onRunningModeChanged: {
+ if (runningMode === Internal.MediaClockRunningMode.MCR_STOPPED) {
+ timer.stop()
+ } else {
+ timer.start()
+ }
+ }
+
+ onStartTimeChanged: {
+ if (startTime === -1) {
+ progress = 0
+ } else {
+ if (updateMode === Internal.MediaClockUpdateMode.MCU_COUNTUP) {
+ progress = (endTime !== -1) ? (startTime / endTime) : (startTime / upperTimeLimit)
+ } else {
+ progress = (endTime !== -1) ? ( (startTime - endTime) / (startTimeForProgress - endTime) )
+ : (startTime / startTimeForProgress)
+ }
+ }
+ }
+
+ function onTimer () {
+ switch (updateMode) {
+ case Internal.MediaClockUpdateMode.MCU_COUNTUP:
+ if (endTime !== -1) {
+ if (startTime < endTime) {
+ startTime++
+ } else {
+ timer.stop()
+ runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ console.debug("count Up timer stopped")
+ }
+ } else {
+ if (startTime < upperTimeLimit) {
+ startTime++
+ } else {
+ startTime = 0
+ }
+ }
+ break
+ case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
+ console.debug("count down")
+ if (--startTime === 0) {
+ timer.stop()
+ runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ startTime = endTime = -1
+ console.debug("count Down timer stopped")
+ }
+ break
+ }
+ dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
+ "mediaClock": {startTime: startTime,
+ endTime: endTime,
+ updateMode: updateMode,
+ runningMode: runningMode,
+ startTimeForProgress: startTimeForProgress
+ }
+ })
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml
new file mode 100644
index 0000000000..b01c4cf834
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml
@@ -0,0 +1,78 @@
+/**
+ * @file MusicSourceModel.qml
+ * @brief Music source menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+
+ListModel
+{
+ ListElement {
+ title: "FM"
+ qml: "./views/FMPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "AM"
+ qml: "./views/AMPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "BT Audio"
+ qml: "./views/BTPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "Sirius"
+ qml: "./views/SiriusPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "CD"
+ qml: "./views/CDPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "iPod"
+ qml: "./views/IPodPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "USB"
+ qml: "./views/UsbPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "LineIn"
+ qml: "./views/LineInPlayerView.qml"
+ appId: 0
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml
new file mode 100644
index 0000000000..963225719e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml
@@ -0,0 +1,72 @@
+/**
+ * @file NavigationMenuModel.qml
+ * @brief Music source menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+ListModel
+{
+ ListElement {
+ title: "Home"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Keyboard"
+ icon: "../res/buttons/long_oval_btn.png"
+ qml: "./views/NavigationKeyboardView.qml"
+ }
+ ListElement {
+ title: "Favorites"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Work"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Recent"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "POI"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Scout"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Waze"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml b/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml
new file mode 100644
index 0000000000..f9203875d3
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml
@@ -0,0 +1,52 @@
+/**
+ * @file NavigationModel.qml
+ * @brief Model for Navigation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+QtObject {
+ property string text1: ""
+ property string text2: ""
+ property string totalDistance: ""
+ property string eta: ""
+ property string timeToDestination: ""
+ property variant turnIcon
+ property variant nextTurnIcon
+
+ property real distanceToManeuver: 0
+ property real distanceToManeuverScale: 0
+ property bool maneuverComplete
+ property ListModel softButtons: ListModel {}
+ property int appId: -1
+ property ListModel alertManeuverSoftButtons: ListModel {}
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml b/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml
new file mode 100644
index 0000000000..8b861d37a2
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml
@@ -0,0 +1,43 @@
+/**
+ * @file PerformAudioPassThruModel.qml
+ * @brief Data model audio pass thru.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+QtObject {
+ property string appName: ""
+ property string firstLine: ""
+ property string secondLine: ""
+ property int timeout: 0
+ property bool running: false
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml
new file mode 100644
index 0000000000..a191f46e46
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml
@@ -0,0 +1,78 @@
+/**
+ * @file PhoneMenuModel.qml
+ * @brief Phone menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+
+ListModel
+{
+ ListElement {
+ name: "phone"
+ icon: "../res/phone/phone.png"
+ qml: ""
+ }
+ ListElement {
+ name: "contacts"
+ icon: "../res/phone/contacts.png"
+ qml: "./views/PhoneKeyboardView.qml"
+ }
+ ListElement {
+ name: "messages"
+ icon: "../res/phone/messages.png"
+ qml: ""
+ }
+ ListElement {
+ name: "DND"
+ icon: "../res/phone/dnd_off.png"
+ qml: ""
+ }
+ ListElement {
+ name: "texts"
+ icon: "../res/phone/texts.png"
+ qml: ""
+ }
+ ListElement {
+ name: "recent"
+ icon: "../res/phone/recent.png"
+ qml: ""
+ }
+ ListElement {
+ name: "keyboard"
+ icon: "../res/phone/keypad.png"
+ qml: ""
+ }
+ ListElement {
+ name: "more"
+ icon: "../res/phone/more.png"
+ qml: ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml b/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml
new file mode 100644
index 0000000000..bbacd49f8c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml
@@ -0,0 +1,51 @@
+/**
+ * @file PlayerState.qml
+ * @brief List of parameters for each player.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+
+// Player state for all players except SDL media player
+Item {
+ // Media players
+ property string playPauseState
+ property string albumImage
+ property string trackNumber
+ property int songPosition
+ property string trackName
+
+ // Radio Players
+ property variant presets: []
+
+ // Both players
+ property string songName
+ property string albumName
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml
new file mode 100644
index 0000000000..6fd441ac3d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml
@@ -0,0 +1,54 @@
+/**
+ * @file ScrollableMessageModel.qml
+ * @brief Model for Scrollable Message.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+QtObject {
+ property string longMessageText: "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh"
+ property ListModel softButtons: ListModel {}
+ property int appId: -1
+ property int timeout: 0
+ property variant async
+ property bool running: false
+
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml b/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml
new file mode 100644
index 0000000000..7fb6cfcdd6
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml
@@ -0,0 +1,125 @@
+/**
+ * @file SettingsStorage.qml
+ * @brief Storage for keeping settings.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+Item
+{
+ property variant sdlLanguagesList: [
+ Common.Language.EN_US,
+ Common.Language.ES_MX,
+ Common.Language.FR_CA,
+ Common.Language.DE_DE,
+ Common.Language.ES_ES,
+ Common.Language.EN_GB,
+ Common.Language.RU_RU,
+ Common.Language.TR_TR,
+ Common.Language.PL_PL,
+ Common.Language.FR_FR,
+ Common.Language.IT_IT,
+ Common.Language.SV_SE,
+ Common.Language.PT_PT,
+ Common.Language.NL_NL,
+ Common.Language.ZH_TW,
+ Common.Language.JA_JP,
+ Common.Language.AR_SA,
+ Common.Language.KO_KR,
+ Common.Language.PT_BR,
+ Common.Language.CS_CZ,
+ Common.Language.DA_DK,
+ Common.Language.NO_NO
+ ]
+
+ property variant displayCapabilities: {
+ "displayType": Common.DisplayType.GEN2_8_DMA,
+ "textFields": [
+ Common.TextFieldName.mainField1,
+ Common.TextFieldName.mainField2,
+ Common.TextFieldName.mainField3,
+ Common.TextFieldName.mainField4,
+ Common.TextFieldName.statusBar,
+ Common.TextFieldName.mediaClock,
+ Common.TextFieldName.mediaTrack,
+ Common.TextFieldName.alertText1,
+ Common.TextFieldName.alertText2,
+ Common.TextFieldName.alertText3,
+ Common.TextFieldName.scrollableMessageBody,
+ Common.TextFieldName.initialInteractionText,
+ Common.TextFieldName.navigationText1,
+ Common.TextFieldName.navigationText2,
+ Common.TextFieldName.ETA,
+ Common.TextFieldName.totalDistance,
+ Common.TextFieldName.navigationText,
+ Common.TextFieldName.audioPassThruDisplayText1,
+ Common.TextFieldName.audioPassThruDisplayText2,
+ Common.TextFieldName.sliderHeader,
+ Common.TextFieldName.sliderFooter,
+ Common.TextFieldName.notificationText
+ ],
+ "mediaClockFormats": [
+ Common.MediaClockFormat.CLOCK1,
+ Common.MediaClockFormat.CLOCK2,
+ Common.MediaClockFormat.CLOCK3,
+ Common.MediaClockFormat.CLOCKTEXT1,
+ Common.MediaClockFormat.CLOCKTEXT2,
+ Common.MediaClockFormat.CLOCKTEXT3,
+ Common.MediaClockFormat.CLOCKTEXT4
+ ],
+ "graphicSupported": true,
+ "imageCapabilities": [ Common.ImageType.DYNAMIC ],
+ "templatesAvailable": [ "" ],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 480
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": true,
+ "doublePressAvailable": true
+ }
+ },
+ "numCustomPresetsAvailable": 6
+ }
+
+ property variant softButtonCapabilities: {
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ }
+
+ property variant buttonCapabilities: []
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml b/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml
new file mode 100644
index 0000000000..d335c9eb2a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml
@@ -0,0 +1,45 @@
+/**
+ * @file SliderModel.qml
+ * @brief Data model for slider.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+QtObject {
+ property string appName: ""
+ property string header: ""
+ property variant footer: []
+ property int numTicks: 0
+ property int position: 0
+ property int timeout: 0
+ property bool running: false
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml b/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml
new file mode 100644
index 0000000000..f5c309880c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml
@@ -0,0 +1,234 @@
+/**
+ * @file VehicleInfoModel.qml
+ * @brief Data model for vehicle info.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+QtObject {
+ id: vehicleInfo
+ property real speed: 80.1
+ property int rpm: 5000
+ property real fuelLevel: 0.2
+ property int fuelLevel_State: Common.ComponentVolumeStatus.CVS_LOW
+ property real instantFuelConsumption: 2.2
+ property int driverBraking: Common.VehicleDataEventStatus.VDES_NO_EVENT
+ property int wiperStatus: Common.WiperStatus.OFF
+ property real engineTorque: 2.5
+ property real accPedalPosition: 0.5
+ property real steeringWheelAngle: 1.2
+ property real externalTemperature: 40.0
+ property string vin: '52-452-52-752'
+ property int odometer: 2
+ property int prndl: Common.PRNDL.FIFTH
+
+ property variant headLampStatus: {
+ "lowBeamsOn": false,
+ "highBeamsOn": false,
+ "ambientLightSensorStatus": Common.AmbientLightStatus.TWILIGHT_1
+ }
+ property variant deviceStatus: {
+ 'voiceRecOn': false,
+ 'btIconOn': false,
+ 'callActive': false,
+ 'phoneRoaming': false,
+ 'textMsgAvailable': false,
+ 'battLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
+ 'stereoAudioOutputMuted': false,
+ 'monoAudioOutputMuted': false,
+ 'signalLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
+ 'primaryAudioSource': Common.PrimaryAudioSource.NO_SOURCE_SELECTED,
+ 'eCallEventActive': false
+ }
+ property variant bodyInformation: {
+ 'parkBrakeActive': false,
+ 'ignitionStableStatus': Common.IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE,
+ 'ignitionStatus': Common.IgnitionStatus.IS_UNKNOWN
+ }
+ property variant beltStatus: {
+ 'driverBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'passengerBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'passengerBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'driverBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'leftRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'passengerChildDetected': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'rightRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'leftRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'rightRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'leftRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'rightRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow1BeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow1BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ }
+ property variant tirePressure: {
+ 'pressureTelltale': Common.WarningLightStatus.WLS_ON,
+ 'leftFront': { status: Common.ComponentVolumeStatus.CVS_NORMAL},
+ 'rightFront': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
+ 'leftRear': { status: Common.ComponentVolumeStatus.CVS_NORMAL },
+ 'rightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
+ 'innerLeftRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
+ 'innerRightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN }
+ }
+ property variant gps: {
+ 'longitudeDegrees': 42.3293,
+ 'latitudeDegrees': -83.0464,
+ 'utcYear': 2013,
+ 'utcMonth': 2,
+ 'utcDay': 14,
+ 'utcHours': 13,
+ 'utcMinutes': 16,
+ 'utcSeconds': 54,
+ 'compassDirection': Common.CompassDirection.SOUTHWEST,
+ 'pdop': 4,
+ 'hdop': 5,
+ 'vdop': 6,
+ 'actual': false,
+ 'satellites': 8,
+ 'dimension': Common.Dimension.Dimension_2D,
+ 'altitude': 7,
+ 'heading': 173,
+ 'speed': 2
+ }
+ property variant ecuDIDData: {
+ 'data1': 'ECU 1 Test Data',
+ 'data2': 'ECU 2 Test Data'
+ }
+ property variant eCallInfo: {
+ "eCallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_NORMAL,
+ "auxECallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_ACTIVE,
+ "eCallConfirmationStatus" : Common.ECallConfirmationStatus.ECCS_NORMAL
+ }
+ property variant airbagStatus: {
+ "driverAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ "driverSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
+ "driverCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
+ "passengerAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED,
+ "passengerCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_FAULT,
+ "driverKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
+ "passengerSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
+ "passengerKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED
+ }
+ property variant emergencyEvent: {
+ "emergencyEventType" : Common.EmergencyEventType.EET_NO_EVENT,
+ "fuelCutoffStatus" : Common.EmergencyEventType.EET_FRONTAL,
+ "rolloverEvent" : Common.EmergencyEventType.EET_SIDE,
+ "maximumChangeVelocity" : Common.EmergencyEventType.EET_REAR,
+ "multipleEvents" : Common.EmergencyEventType.EET_ROLLOVER
+ }
+ property variant clusterModeStatus: {
+ "powerModeActive" : true,
+ "powerModeQualificationStatus" : Common.PowerModeQualificationStatus.POWER_MODE_UNDEFINED,
+ "carModeStatus" : Common.CarModeStatus.CMS_NORMAL,
+ "powerModeStatus" : Common.PowerModeStatus.KEY_OUT
+ }
+ property variant myKey: {
+ "e911Override": Common.VehicleDataStatus.VDS_NO_DATA_EXISTS
+ }
+
+
+ function sendGpsChange(){
+ sdlVehicleInfo.onGps(vehicleInfo.gps)
+ }
+ function sendSpeedChange(){
+ sdlVehicleInfo.onSpeed(vehicleInfo.speed)
+ }
+ function sendRpmChange(){
+ sdlVehicleInfo.onRpm(vehicleInfo.rpm)
+ }
+ function sendFuelLevelChange(){
+ sdlVehicleInfo.onFuelLevel(vehicleInfo.fuelLevel)
+ }
+ function sendFuelLevel_StateChange(){
+ sdlVehicleInfo.onFuelLevel_State(vehicleInfo.fuelLevel_State)
+ }
+ function sendInstantFuelConsumptionChange(){
+ sdlVehicleInfo.onInstantFuelConsumption(vehicleInfo.instantFuelConsumption)
+ }
+ function sendExternalTemperatureChange(){
+ sdlVehicleInfo.onExternalTemperature(vehicleInfo.externalTemperature)
+ }
+ function sendPrndlChange() {
+ if (dataContainer.vehicleInfoModel.prndl !== -1)
+ {sdlVehicleInfo.onPrndl(vehicleInfo.prndl)}
+ }
+ function sendTirePressureChange(){
+ sdlVehicleInfo.onTirePressure(vehicleInfo.tirePressure)
+ }
+ function sendOdometerChange(){
+ sdlVehicleInfo.onOdometer(vehicleInfo.odometer)
+ }
+ function sendBeltStatusChange(){
+ sdlVehicleInfo.onBeltStatus(vehicleInfo.beltStatus)
+ }
+ function sendBodyInformationChange(){
+ sdlVehicleInfo.onBodyInformation(vehicleInfo.bodyInformation)
+ }
+ function sendDeviceStatusChange(){
+ sdlVehicleInfo.onDeviceStatus(vehicleInfo.deviceStatus)
+ }
+ function sendDriverBrakingChange(){
+ sdlVehicleInfo.onDriverBraking(vehicleInfo.driverBraking)
+ }
+ function sendWiperStatusChange(){
+ sdlVehicleInfo.onWiperStatus(vehicleInfo.wiperStatus)
+ }
+ function sendHeadLampStatusChange(){
+ sdlVehicleInfo.onHeadLampStatus(vehicleInfo.headLampStatus)
+ }
+ function sendEngineTorqueChange(){
+ sdlVehicleInfo.onEngineTorque(vehicleInfo.engineTorque)
+ }
+ function sendAccPedalPositionChange(){
+ sdlVehicleInfo.onAccPedalPosition(vehicleInfo.accPedalPosition)
+ }
+ function sendSteeringWheelAngleChange(){
+ sdlVehicleInfo.onSteeringWheelAngle(vehicleInfo.steeringWheelAngle)
+ }
+ function sendECallInfoChange(){
+ sdlVehicleInfo.onECallInfo(vehicleInfo.eCallInfo)
+ }
+ function sendAirbagStatusChange(){
+ sdlVehicleInfo.onAirbagStatus(vehicleInfo.airbagStatus)
+ }
+ function sendEmergencyEventChange(){
+ sdlVehicleInfo.onEmergencyEvent(vehicleInfo.emergencyEvent)
+ }
+ function sendClusterModeStatusChange(){
+ sdlVehicleInfo.onClusterModeStatus(vehicleInfo.clusterModeStatus)
+ }
+ function sendMyKeyChange(){
+ sdlVehicleInfo.onMyKey(vehicleInfo.myKey)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml b/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml
new file mode 100644
index 0000000000..70e7ba29ef
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml
@@ -0,0 +1,285 @@
+/**
+ * @file AlertWindow.qml
+ * @brief Alert popup window
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: alertWindow
+ property date lastAlertTime
+ property variant softButtons
+ property int appId
+ property string popUpName // TODO{ALESHIN}: No requerments for closePopUp, if alert couldn't be closed by closePopUp request - delete everywhere
+
+ color: "transparent"
+
+ property variant async
+
+ Rectangle {
+ id: rectangle
+
+ anchors.centerIn: parent
+ color: "black"
+ border.color: "white"
+
+ width: alertContent.width + 60
+ height: alertContent.height + 60
+
+ property alias alertString: alert.text
+ property alias appNameString: appName.text
+ property int duration
+
+ Column {
+ id: alertContent
+ anchors.centerIn: parent
+ spacing: 20
+
+ Text {
+ id: appName
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: "white"
+ font.pointSize: 16
+ }
+
+ Row {
+ width: Constants.alertWidth
+ spacing: 20
+
+ Image {
+ id: alertLogo
+ source: "../res/warning.png"
+ }
+
+ Text {
+ id: alert
+ width: parent.width - alertLogo.width - parent.spacing
+ clip: true
+ color: "white"
+ font.pointSize: 16
+ }
+ }
+
+ Rectangle {
+ id: progressIndicator
+ color: "white"
+ height: 10
+ }
+
+ Column {
+ Item {
+ width: Constants.alertWidth
+ height: alertButton1.visible ? alertButton1.height : 0
+
+ SoftButton {
+ id: alertButton1
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 0 ? softButtons[0] : undefined
+ anchors.left: parent.left
+ anchors.right: alertButton2.visible ? alertButton2.left : parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ contentLoader.go("views/SDLPlayerView.qml", appId);
+ alertWindow.complete(Common.Result.SUCCESS);
+ }
+ }
+ SoftButton {
+ id: alertButton2
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 1 ? softButtons[1] : undefined
+ anchors.right: parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ contentLoader.go("views/SDLPlayerView.qml", appId);
+ alertWindow.complete(Common.Result.SUCCESS);
+ }
+ }
+ }
+ Item {
+ width: Constants.alertWidth
+ height: alertButton3.visible ? childrenRect.height : 0
+ SoftButton {
+ id: alertButton3
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 2 ? softButtons[2] : undefined
+ anchors.left: parent.left
+ anchors.right: alertButton4.visible ? alertButton4.left : parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ contentLoader.go("views/SDLPlayerView.qml", appId);
+ alertWindow.complete(Common.Result.SUCCESS);
+ }
+ }
+ SoftButton {
+ id: alertButton4
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 3 ? softButtons[3] : undefined
+ anchors.right: parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ contentLoader.go("views/SDLPlayerView.qml", appId);
+ alertWindow.complete(Common.Result.SUCCESS);
+ }
+ }
+ }
+ }
+ }
+
+ SequentialAnimation {
+ id: animation
+ PropertyAction { target: progressIndicator; property: "width"; value: alertContent.width }
+ PropertyAnimation {
+ id: shrinkProgressAnimation
+ target: progressIndicator
+ property: "width"
+ to: 0
+ duration: rectangle.duration
+ }
+ }
+ }
+
+ Timer {
+ id: timer
+ onTriggered: {
+ complete(Common.Result.SUCCESS)
+ }
+ }
+
+ function alert (alertStrings, duration, showIndicator, sButtons, applicationId) {
+ if (timer.running) { // we have alert already
+ var currentTime = new Date()
+ var timeFromLastAlert = currentTime - lastAlertTime
+ var timeLeft = timer.interval - timeFromLastAlert
+ var discreteInMilliseconds = 1000 // wish to round left time to integer seconds
+ var timeLeftRounded = discreteInMilliseconds * Math.ceil(timeLeft / discreteInMilliseconds)
+ return timeLeftRounded
+ }
+ else {
+ lastAlertTime = new Date();
+ appId = applicationId
+ rectangle.appNameString = dataContainer.getApplication(appId).appName;
+ softButtons = sButtons;
+ rectangle.alertString = alertStrings.join('\n');
+ timer.interval = duration;
+ rectangle.duration = duration;
+ timer.start();
+ show();
+
+ progressIndicator.visible = !!showIndicator
+ progressIndicator.width = alertContent.width
+ console.log("ProgressIndicator.width:", progressIndicator.width)
+ animation.start()
+ }
+ }
+
+ function show () {
+ dataContainer.activeAlert = true
+ dataContainer.applicationSavedContext = dataContainer.applicationContext
+ visible = true
+ }
+
+ function complete (reason, data) {
+ if (!keep) {
+ hide()
+ switch (reason) {
+ case Common.Result.SUCCESS:
+ DBus.sendReply(async, { __retCode: Common.Result.SUCCESS, __message: "UI.Alert" })
+ break
+ // For other cases
+ }
+ }
+ timer.stop()
+ }
+
+ function hide() {
+ console.debug(popUpName, "HIDE")
+ dataContainer.activeAlert = false
+ dataContainer.applicationContext = dataContainer.applicationSavedContext
+ visible = false
+ }
+
+ function restart() {
+ animation.restart();
+ timer.restart();
+ }
+
+ property bool keep: false
+
+ onKeepChanged: {
+ if (visible && !keep && !timer.running) {
+ hide()
+ }
+ }
+
+ onVisibleChanged: {
+ if (visible) {
+ dataContainer.activePopup.push(popUpName)
+ } else {
+ for (var i in dataContainer.activePopup) {
+ if (dataContainer.activePopup[i] === popUpName) {
+ dataContainer.activePopup.splice(i, 1)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml
new file mode 100644
index 0000000000..a1ef64144d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml
@@ -0,0 +1,56 @@
+/**
+ * @file ContextPopup.qml
+ * @brief Popup view with system context.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+
+PopUp {
+ function show() {
+ console.debug("enter")
+ if (!visible) { // must not increment counter if show() called for visible popup
+ visible = true;
+ dataContainer.popups++
+ }
+ console.debug("exit")
+ }
+
+ function hide() {
+ console.debug("enter")
+ console.debug(popUpName, "HIDE")
+ if (visible) { // must not decrement counter if hide() called for invisible popup
+ visible = false;
+ dataContainer.popups--
+ }
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml
new file mode 100644
index 0000000000..17e5de50b7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml
@@ -0,0 +1,81 @@
+/**
+ * @file ExitAllApplicationsPopup.qml
+ * @brief Popup "Exit all applications"
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+PopUp {
+ function complete(reason){
+ hide()
+ }
+
+ Item {
+ ListModel {
+ id: reasonExit
+
+ Component.onCompleted: {
+ for (var name in Common.ApplicationsCloseReason) {
+ append({name: name});
+ }
+ }
+ }
+ }
+
+ Column
+ {
+ anchors.centerIn: parent
+ Row {
+ Text {
+ text: "Select reason: "
+ color: "white"
+ }
+
+ ComboBox {
+ id: reasonComboBox
+ model: reasonExit
+ }
+ z: 1000
+ }
+ OvalButton {
+ text: "Exit"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ sdlBasicCommunication.onExitAllApplications(Common.ApplicationsCloseReason[reasonComboBox.currentText])
+ hide()
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml
new file mode 100644
index 0000000000..7a5c53501e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml
@@ -0,0 +1,103 @@
+/**
+ * @file InteractionPopup.qml
+ * @brief Interaction popup view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+ContextPopup {
+ Text {
+ id: initialText
+ text: dataContainer.interactionModel.initialText
+ anchors.top: parent.top
+ anchors.topMargin: Constants.popupMargin
+ anchors.left: parent.left
+ anchors.leftMargin: Constants.popupMargin
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ ListView {
+ anchors.top: initialText.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.popupMargin
+ model: dataContainer.interactionModel.choice
+ delegate: OvalButton {
+ width: parent.width
+ text: name
+ icon: image
+ onClicked: {
+ complete(Common.Result.SUCCESS, {"choiceID": id})
+ }
+ }
+ }
+
+ Item {
+ Timer {
+ id: timer
+ onTriggered: {
+ complete(Common.Result.TIMED_OUT)
+ }
+ }
+ }
+
+ function activate () {
+ console.debug("enter")
+ timer.interval = dataContainer.interactionModel.timeout
+ timer.start()
+ show()
+ console.debug("exit")
+ }
+
+ function complete (reason, data) {
+ console.debug("enter")
+ switch (reason) {
+ case Common.Result.SUCCESS:
+ DBus.sendReply(dataContainer.interactionModel.async, data)
+ break
+ case Common.Result.ABORTED:
+ DBus.sendReply(dataContainer.interactionModel.async, { __retCode: Common.Result.ABORTED })
+ break
+ case Common.Result.TIMED_OUT:
+ DBus.sendReply(dataContainer.interactionModel.async, { __retCode: Common.Result.TIMED_OUT })
+ break
+ }
+ timer.stop()
+ hide()
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml
new file mode 100644
index 0000000000..e65519d363
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml
@@ -0,0 +1,149 @@
+/**
+ * @file PerformAudioPassThruPopup.qml
+ * @brief Popup for audio pass thru
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+ContextPopup {
+ property variant async
+
+ function showAudioPassThru(){
+ console.debug("entered")
+ dataContainer.uiAudioPassThru.running = true
+ show()
+ if (dataContainer.uiAudioPassThru.timeout) {
+ timer.start()
+ }
+ console.debug("exited")
+ }
+
+ function complete(reason){
+ console.debug("enter", reason)
+ timer.stop()
+ dataContainer.uiAudioPassThru.timeout = 0
+ dataContainer.uiAudioPassThru.running = false
+ switch (reason) {
+ case Common.Result.ABORTED:
+ console.debug("exit with abort")
+ DBus.sendError(async, Common.Result.ABORTED)
+ break;
+ case Common.Result.SUCCESS:
+ console.debug("exit with success")
+ DBus.sendReply(async, {})
+ break;
+ case Common.Result.RETRY:
+ console.debug("exit with retry")
+ DBus.sendError(async, Common.Result.RETRY)
+ break;
+ }
+ hide()
+ }
+
+
+ Column {
+ spacing: Constants.generalSpacing
+ anchors.centerIn: parent
+ Timer {
+ id: timer
+ interval: dataContainer.uiAudioPassThru.timeout
+ onTriggered: {
+ complete(Common.Result.SUCCESS)
+ }
+ }
+
+ Text {
+ id: appNameText
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiAudioPassThru.appName
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ Row {
+ spacing: Constants.generalSpacing
+ Image {
+ source: "../res/controlButtons/vrImage.png"
+ }
+
+ Column {
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiAudioPassThru.firstLine
+ color: Constants.audioPassThruTextColor
+ font.pixelSize: Constants.fontSize
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiAudioPassThru.secondLine
+ color: Constants.audioPassThruTextColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+ }
+
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: Constants.generalSpacing
+
+ OvalButton {
+ text: "Retry"
+ fontSize: Constants.fontSize
+ onClicked: {
+ complete(Common.Result.RETRY)
+ }
+ }
+
+ OvalButton {
+ text: "Done"
+ fontSize: Constants.fontSize
+ onClicked: {
+ complete(Common.Result.SUCCESS)
+ }
+ }
+ }
+
+ OvalButton {
+ text: "Close"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ console.debug("enter")
+ complete(Common.Result.ABORTED)
+ console.debug("exit")
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml
new file mode 100644
index 0000000000..07f8c98011
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml
@@ -0,0 +1,94 @@
+/**
+ * @file PopUp.qml
+ * @brief General popup view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+Item {
+ default property alias content: content.children
+ property int padding: Constants.popUpPadding
+ property string popUpName
+
+ visible: false
+
+ width: Constants.popupWidth
+ height: Constants.popupHeigth
+
+ MouseArea { anchors.fill: parent }
+
+ Rectangle {
+ width: parent.width - padding / 2
+ height: parent.height - padding / 2
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: Constants.secondaryColor
+ border.width: 1
+ border.color: Constants.popUpBorderColor
+ radius: padding
+ Rectangle {
+ id: content
+ width: parent.width - padding
+ height: parent.height - padding
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: Constants.transparentColor
+ }
+ }
+
+ onVisibleChanged: {
+ if (popUpName) {
+ if (visible) {
+ dataContainer.activePopup.push(popUpName)
+ } else {
+ for (var i in dataContainer.activePopup) {
+ if (dataContainer.activePopup[i] === popUpName) {
+ dataContainer.activePopup.splice(i, 1)
+ }
+ }
+ }
+ }
+ }
+
+ function show() {
+ console.debug("enter");
+ visible = true;
+ console.debug("exit");
+ }
+
+ function hide() {
+ console.debug("enter");
+ visible = false;
+ console.debug("exit");
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml
new file mode 100644
index 0000000000..6dcd222ed3
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml
@@ -0,0 +1,214 @@
+/**
+ * @file ExitAllApplicationsPopup.qml
+ * @brief Popup "Exit all applications"
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+ContextPopup {
+ property variant async
+ property int position: 1
+ /**
+ * Test Support Section
+ */
+ property int resultCode: -1
+ signal onReady
+ /**
+ * Test Support Section End
+ */
+
+ function showSlider(){
+ console.debug("enter")
+
+ dataContainer.uiSlider.running = true
+ dataContainer.applicationSavedContext = dataContainer.applicationContext
+ if(dataContainer.uiSlider.footer.length === 0 || dataContainer.uiSlider.position === 0 ) {
+ footerText.text = ""
+ } else {
+ footerText.text = dataContainer.uiSlider.footer.length === 1 ? dataContainer.uiSlider.footer[0] : dataContainer.uiSlider.footer[dataContainer.uiSlider.position - 1]
+ }
+ position = dataContainer.uiSlider.position
+ show()
+ timer.start()
+ onReady()
+ console.debug("exit")
+ }
+
+ function complete(reason){
+ console.debug("enter reason = ", reason)
+ timer.stop()
+ dataContainer.applicationContext = dataContainer.applicationSavedContext
+ dataContainer.uiSlider.running = false
+ switch(reason) {
+ case Common.Result.ABORTED:
+ console.debug("aborted position is", position)
+ resultCode = Common.Result.ABORTED
+ DBus.sendReply(async, {__retCode: resultCode, sliderPosition: position})
+ break
+ case Common.Result.SUCCESS:
+ console.debug("send position", position)
+ resultCode = Common.Result.SUCCESS
+ dataContainer.uiSlider.position = position
+ DBus.sendReply(async, {sliderPosition:position})
+ break
+ default:
+ break
+ }
+ hide()
+ position = 1
+ console.debug("exit")
+ }
+
+
+ Column
+ {
+ spacing: Constants.generalSpacing
+ anchors.centerIn: parent
+ Timer {
+ id: timer
+ interval: dataContainer.uiSlider.timeout
+ onTriggered: {
+ console.debug("triggered")
+ complete(Common.Result.SUCCESS)
+ }
+ }
+
+ Text {
+ id: appNameText
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiSlider.appName
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ Text {
+ id: headerText
+ width: borderRectangle.width
+ elide: Text.ElideRight
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiSlider.header
+ color: Constants.sliderTextColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ Rectangle {
+ id: borderRectangle
+ width: Constants.sliderBarWidth
+ height: Constants.sliderBarHeight
+ anchors.horizontalCenter: parent.horizontalCenter
+ border.color: Constants.sliderBarBorderColor
+ border.width: Constants.sliderBarBorderWidth
+ radius: Constants.sliderBarRadius
+ color: "black"
+
+ Rectangle {
+ id: rectangle
+ color: Constants.sliderBarFillColor
+ height: parent.height
+ border.color: parent.border.color
+ border.width: parent.border.width
+ radius: parent.radius
+
+ onVisibleChanged: {
+ var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
+ rectangle.width = dataContainer.uiSlider.position * tickWidth
+ }
+ }
+
+ MouseArea{
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ onPositionChanged(mouse)
+ }
+
+ onPositionChanged: {
+ if(mouseX <= 0){
+ rectangle.width = borderRectangle.width / dataContainer.uiSlider.numTicks
+ position = 1
+ }
+
+ if(mouseX > borderRectangle.width) {
+ rectangle.width = borderRectangle.width
+ position = dataContainer.uiSlider.numTicks
+ }
+
+ if(mouseX > 0 && mouseX < borderRectangle.width) {
+ var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
+ position = Math.ceil(mouseX / tickWidth)
+ rectangle.width = position * tickWidth
+ }
+
+ if(dataContainer.uiSlider.footer.length > 1){
+ footerText.text = dataContainer.uiSlider.footer[position - 1]
+ }
+ }
+ }
+ }
+
+ Text {
+ id:footerText
+ width: borderRectangle.width
+ elide: Text.ElideRight
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: ""
+ color: Constants.sliderTextColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ OvalButton {
+ text: "Close"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ console.debug("enter")
+ complete(Common.Result.ABORTED)
+ console.debug("exit")
+ }
+ }
+ }
+
+ function getTimer() {
+ return timer
+ }
+ function getBackButton() {
+ return backButton
+ }
+ function getFooterText() {
+ return footerText
+ }
+ function getBorderRectangle() {
+ return borderRectangle
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml
new file mode 100644
index 0000000000..9a833b19e7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml
@@ -0,0 +1,71 @@
+/**
+ * @file TBTClientStatePopUp.qml
+ * @brief Popup view for TBT interface (list of states).
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+PopUp {
+ Item {
+ ListModel {
+ id: tbtState
+
+ Component.onCompleted: {
+ for (var name in Common.TBTState) {
+ append({name: name});
+ }
+ }
+ }
+ }
+ Text {
+ text: "TBT Client State"
+ verticalAlignment: Text.AlignVCenter
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.top: parent.top
+ color: Constants.primaryColor
+ }
+ ComboBox {
+ id: comboBox
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ model: tbtState
+ onCurrentTextChanged: {
+ console.log("Send signal onTBTClientState:", currentText);
+ sdlNavigation.onTBTClientState(Common.TBTState[currentText]);
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml
new file mode 100644
index 0000000000..ce64a6be89
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml
@@ -0,0 +1,79 @@
+/**
+ * @file TTSPopUp.qml
+ * @brief Popup view for TTS
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+PopUp {
+ height: Constants.ttsPopUpHeight
+ width: Constants.ttsPopUpWidth
+ padding: Constants.ttsPopUpPadding
+ property variant async
+
+ ScrollableText {
+ id: text
+ anchors.fill: parent
+ }
+
+ resources: [
+ Timer {
+ id: timer
+ interval: Constants.ttsSpeakTime
+ onTriggered: deactivate()
+ }
+ ]
+
+ function activate(message) {
+ console.debug("Activate TTS popup:", message);
+ dataContainer.activeTTS = true;
+ text.text = message;
+ show();
+ timer.restart();
+ console.debug("Exit");
+ }
+
+ function deactivate() {
+ console.debug("Deactivate TTS popup");
+ dataContainer.activeTTS = false;
+ text.text = '';
+ timer.stop();
+ hide();
+ DBus.sendReply(async, {});
+ async = null;
+ console.debug("Exit");
+ }
+}
+
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml
new file mode 100644
index 0000000000..8718c8cd69
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml
@@ -0,0 +1,92 @@
+/**
+ * @file VRHelpPopup.qml
+ * @brief Popup view for VR help
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+PopUp {
+ Text {
+ id: title
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.popupMargin
+ text: "VR HELP" // default title
+ font.pixelSize: Constants.titleFontSize
+ color: Constants.primaryColor
+ }
+
+ ScrollableListView {
+ anchors.top: title.bottom
+ anchors.bottom: closeButton.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.popupMargin
+
+ model: dataContainer.vrHelp
+
+ delegate: Row {
+ spacing: Constants.iconItemListSpacing
+ Icon {
+ source: model.icon
+ width: Constants.iconItemListSize
+ height: Constants.iconItemListSize
+ }
+
+ Text {
+ text: model.text
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+ }
+
+ OvalButton {
+ id: closeButton
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.margins: Constants.popupMargin
+ width: Constants.ovalButtonWidth
+ text: "Close"
+ onClicked: complete()
+ }
+
+ property alias title: title.text
+
+ function complete(reason, data) {
+ hide()
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml
new file mode 100644
index 0000000000..8a8be54be7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml
@@ -0,0 +1,92 @@
+/**
+ * @file VRPopUp.qml
+ * @brief Popup view for VR interface (list commands).
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../views"
+import "../controls"
+
+PopUp {
+ Text {
+ id: title
+ anchors.left: parent.left
+ anchors.top: parent.top
+ height: voice.height
+ width: parent.width - voice.width
+ text: "Speak the command"
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ Image {
+ id: voice
+ anchors.top: parent.top
+ anchors.right: parent.right
+ source: "../res/controlButtons/vrImage.png"
+ }
+
+ ScrollableListView {
+ anchors.bottomMargin: Constants.popupMargin
+ anchors.rightMargin: Constants.popupMargin
+ anchors.leftMargin: Constants.popupMargin
+ anchors.top: voice.bottom
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+
+ model: dataContainer.vrCommands
+
+ delegate: OvalButton {
+ width: parent.width
+ text: command
+ onClicked: {
+ sdlVR.onCommand(cmdID, appID === 0 ? undefined : appID);
+ }
+ }
+ }
+
+ function activate() {
+ dataContainer.activeVR = true;
+ sdlVR.started();
+ show();
+ }
+
+ function complete(reason) {
+ dataContainer.activeVR = false;
+ sdlVR.stopped();
+ hide();
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml
new file mode 100644
index 0000000000..f4582c28ca
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml
@@ -0,0 +1,111 @@
+/**
+ * @file VIPopUp.qml
+ * @brief Pop up window with information about vehicle.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+PopUp {
+ //TODO{ALeshin}: Redraw this window as ListView or Column, when we'll get requirements
+ Column {
+ anchors.fill: parent
+ Text {
+ id: viText
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "Vehicle Information"
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ color: Constants.primaryColor
+ }
+
+ Row {
+ height: 1/5 * parent.height
+ width: parent.width
+
+ Text {
+ width: 1/4 * parent.width
+ height: 1/5 * parent.height
+ anchors.verticalCenter: parent.verticalCenter
+ text: "PRNDL: "
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.primaryColor
+ }
+
+ ComboBox {
+ anchors.verticalCenter: parent.verticalCenter
+ id: comboBox
+ model: prndlList
+
+ onCurrentIndexChanged: {
+ console.debug("PRNDL:", currentIndex)
+ dataContainer.vehicleInfoModel.prndl = model.get(currentIndex).id
+ }
+
+ textRole: "name"
+ ListModel {
+ id: prndlList
+ Component.onCompleted: {
+ append({ id: -1, name: "<NO DATA (prndl)>" })
+ for (var name in Common.PRNDL) {
+ append({ id: Common.PRNDL[name], name: name });
+ }
+ }
+ }
+ }
+ z: 1000
+ }
+
+ Text {
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "ECU 1: " + dataContainer.vehicleInfoModel.ecuDIDData.data1
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.primaryColor
+ }
+
+ Text {
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "ECU 2: " + dataContainer.vehicleInfoModel.ecuDIDData.data2
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.primaryColor
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject b/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject
new file mode 100644
index 0000000000..ea820e8019
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject
@@ -0,0 +1,20 @@
+/* File generated by Qt Creator, version 2.7.0 */
+
+import QmlProject 1.1
+
+Project {
+ mainFile: "MainWindow.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "../res"
+ }
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ "." ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml
new file mode 100644
index 0000000000..4a29168881
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml
@@ -0,0 +1,48 @@
+/**
+ * @file AMPlayerView.qml
+ * @brief AM player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ RadioPlayer {
+ id: amRadioPlayer
+ anchors.fill: parent
+ radioType: "AM"
+ radioName: "AM Radio"
+
+ playerState: dataContainer.amPlayerState
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml
new file mode 100644
index 0000000000..19ecf4ca47
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml
@@ -0,0 +1,123 @@
+/**
+ * @file ApplicationListView.qml
+ * @brief Application list view
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Column {
+ anchors.fill: parent
+ Item {
+ // top 1/4 of screen
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ elementWidth: Constants.ovalButtonWidth
+ snapTo: elementWidth + spacing
+ spacing: (width - 4 * elementWidth) / 3
+
+ OvalButton {
+ text: "Find New Apps"
+ }
+
+ OvalButton {
+ text: "Change device"
+ onReleased: contentLoader.go("./views/ChangeDeviceView.qml")
+ }
+
+ OvalButton {
+ text: "911 Assist"
+ }
+
+ OvalButton {
+ text: "Vehicle Health Report"
+ }
+
+ OvalButton {
+ text: "Install applications/Up"
+ }
+ }
+ }
+
+ Item {
+ height: parent.height / 2
+ width: parent.width
+
+ ScrollableListView {
+ id: applicationListView
+ anchors.fill: parent
+ model: dataContainer.applicationList
+
+ delegate: Item {
+ width: parent.width
+ height: Math.max(applicationName.height, appIcon.height)
+ Image {
+ id: appIcon
+ source: icon
+ height: Constants.appListIconSize
+ width: height
+ }
+ ClickableText {
+ id: applicationName
+ text: appName
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.appListFontSize
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: appIcon.right
+ anchors.leftMargin: Constants.margin
+ onClicked: {
+ dataContainer.setCurrentApplication(appId)
+ dataContainer.currentApplication.isMediaApplication ? contentLoader.go("./views/SDLPlayerView.qml", dataContainer.currentApplication.appId)
+ : contentLoader.go("./views/SDLNonMediaView.qml", dataContainer.currentApplication.appId)
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ // bottom 1/4 of screen
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml
new file mode 100644
index 0000000000..0a5390e920
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml
@@ -0,0 +1,62 @@
+/**
+ * @file BTPlayerView.qml
+ * @brief FM player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: btPlayer
+ playerName: "BT Audio"
+ anchors.fill: parent
+
+ playerState: dataContainer.btPlayerState
+ image: playerState.albumImage
+
+ buttons: [
+ OvalButton {
+ text: btPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml
new file mode 100644
index 0000000000..f582ff2f7e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml
@@ -0,0 +1,63 @@
+/**
+ * @file CDPlayerView.qml
+ * @brief CD player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: cdPlayer
+ playerName: "CD"
+ anchors.fill: parent
+ image: playerState.albumImage
+ playerState: dataContainer.cdPlayerState
+
+ buttons: [
+ OvalButton {
+ text: cdPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml
new file mode 100644
index 0000000000..9b04b1bad7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml
@@ -0,0 +1,54 @@
+/**
+ * @file CarMenuGridView.qml
+ * @brief Car menu screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../models"
+import "../controls"
+
+GridMenu {
+ id: menu
+ model: CarMenuModel { }
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ ClickableImage {
+ anchors.centerIn: parent
+ source: icon
+ onClicked: {
+ if(qml !== "") {
+ contentLoader.go(qml)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml
new file mode 100644
index 0000000000..643b074506
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml
@@ -0,0 +1,102 @@
+/**
+ * @file ChangeDeviceView.qml
+ * @brief Screen view with list of available devices.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ Text {
+ id: searchDeviceText
+ anchors.left: parent.left
+ anchors.top: parent.top
+ height: 1/4 * parent.height
+ width: parent.width
+ color: Constants.primaryColor
+ font.pixelSize: Constants.titleFontSize
+ text: "Devices available:"
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ ListView {
+ id: changeDeviceListView
+ anchors.left: parent.left
+ anchors.top: searchDeviceText.bottom
+ model: dataContainer.deviceList
+ width:parent.width
+ height:parent.height - searchDeviceText.height
+
+ delegate: Text {
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ sdlBasicCommunication.onDeviceChosen({ name: name, id: devid });
+ sdlBasicCommunication.onFindApplications({ name: name, id: devid })
+ contentLoader.go("./views/ApplicationListView.qml")
+ }
+ }
+ text: name
+ color: Constants.primaryColor
+ font.pixelSize: Constants.titleFontSize
+ }
+ }
+ }
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+
+ Component.onCompleted: {
+ console.log("ChangeDeviceView Component.onCompleted enter");
+ sdlBasicCommunication.onStartDeviceDiscovery();
+ console.log("ChangeDeviceView Component.onCompleted exit");
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml
new file mode 100644
index 0000000000..01c289b139
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml
@@ -0,0 +1,94 @@
+/**
+ * @file ClimateControlView.qml
+ * @brief Screen view of climat menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+
+GeneralView {
+ Item {
+ id: climatMenu
+ anchors.fill: parent
+
+ Item {
+ height: parent.height
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ Column {
+ id: leftItem
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width
+
+ Row {
+ ClimateControlBtn {name: "heated_seat"}
+ ClimateControlBtn {name: "heated_wheel"}
+ }
+ Row {
+ ClimateControlBtn {name: "AC"}
+ ClimateControlBtn {name: "headed_dash"}
+ }
+ }
+
+ Column {
+ id: centralItem
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"}
+ ClimateControlBtn {name: "face"; state: "on"}
+ ClimateControlBtn {name: "feet"}
+ }
+
+ Row {
+ id: rightItem
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width
+
+ ClimateControlBtn {
+ anchors.verticalCenter: parent.verticalCenter
+ txt: "Dual"
+ state: "on"
+ }
+
+ Column {
+ ClimateControlBtn { name: "heated_seat" }
+ ClimateControlBtn { name: "AC" }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml
new file mode 100644
index 0000000000..a2b2be590b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml
@@ -0,0 +1,118 @@
+/**
+ * @file ContactsListView.qml
+ * @brief Contact list screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ function setCurrent(firstLetter){
+ for(var i = 0; i < contactsListView.count; i ++) {
+ if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) {
+ contactsListView.positionViewAtIndex(i, ListView.Beginning)
+ break;
+ }
+ }
+ }
+ Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter)
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ ScrollableListView {
+ id: contactsListView
+ anchors.fill: parent
+ clip: true
+ spacing: 1/2 * Constants.fontSize
+ model: ContactsListModel { }
+
+ section.property: "name"
+ section.criteria: ViewSection.FirstCharacter
+ section.delegate: Text {
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ text: section.toUpperCase()
+ }
+
+ delegate: Item {
+ anchors.left: parent.left
+ width: parent.width - Constants.scrollBarWidth
+ height: typeText.height
+
+ Text {
+ id: contactName
+ anchors.left: parent.left
+ text: name
+ width: Constants.contactListNameFieldSize * parent.width
+ color: Constants.contactTextColor
+ font.pixelSize: Constants.fontSize
+ elide: Text.ElideRight
+ }
+ Text {
+ id: phoneText
+ anchors.left: contactName.right
+ width: Constants.contactListPhoneFieldSize * parent.width
+ text: phone
+ color: Constants.contactTextColor
+ font.pixelSize: Constants.fontSize
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Text {
+ id: typeText
+ anchors.right: parent.right
+ width: Constants.contactListDescriptionFieldSize * parent.width
+ text: type
+ color: Constants.contactTextColor
+ font.pixelSize: Constants.fontSize
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml
new file mode 100644
index 0000000000..5c3ca6a5a9
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml
@@ -0,0 +1,121 @@
+/**
+ * @file FMPlayerView.qml
+ * @brief FM player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ RadioPlayer {
+ id: fmRadioPlayer
+ anchors.fill: parent
+ radioType: "FM"
+ radioName: "FM Radio"
+
+ playerState: dataContainer.fmPlayerState
+
+ property int hdButtonValue: 1
+
+ buttonHD: [
+ Image {
+ id: hdButton
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ source: "../res/buttons/long_oval_btn.png"
+ property string textColor: Constants.primaryColor
+
+ Row {
+ anchors.centerIn: parent
+ spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10
+
+ Image {
+ id: hdLogo
+ anchors.verticalCenter: parent.verticalCenter
+ source:"../res/hd_logo_on.png"
+ }
+
+ Text {
+ id: one
+ anchors.verticalCenter: parent.verticalCenter
+ text: "1"
+ color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ id: two
+ anchors.verticalCenter: parent.verticalCenter
+ text: "2"
+ color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ id: three
+ anchors.verticalCenter: parent.verticalCenter
+ text: "3"
+ color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ id: four
+ anchors.verticalCenter: parent.verticalCenter
+ text: "4"
+ color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ hdLogo.source = "../res/hd_logo_off.png"
+ hdButton.source = "../res/buttons/long_oval_pressed_btn.png"
+ hdButton.textColor = Constants.secondaryColor
+
+ }
+ onReleased: {
+ hdLogo.source = "../res/hd_logo_on.png"
+ hdButton.source = "../res/buttons/long_oval_btn.png"
+ hdButton.textColor = Constants.primaryColor
+ fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++
+ }
+ }
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml
new file mode 100644
index 0000000000..40f809299d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml
@@ -0,0 +1,45 @@
+/**
+ * @file GeneralView.qml
+ * @brief Base view class. Defines properties and behavior common for all views
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+
+Item {
+ /// HMI context view is related to
+ property int systemContext: Common.SystemContext.SYSCTXT_MAIN
+ /// True if view is in application context
+ property bool applicationContext: false
+ /// View category for AppDeactivated notification (reason)
+ property int category: Common.DeactivateReason.GENERAL
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml
new file mode 100644
index 0000000000..4cc2f4f615
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml
@@ -0,0 +1,86 @@
+/**
+ * @file GridMenu.qml
+ * @brief Parent class for main menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+GeneralView {
+ id: main
+ property alias model: repeater.model
+ property alias delegate: repeater.delegate
+ property alias rows: grid.rows
+ property int columnsOnPage: Constants.menuColumnCount
+
+ Flickable {
+ id: flicker
+ anchors.fill: parent
+ contentWidth: grid.width
+ flickableDirection: Flickable.HorizontalFlick
+
+ Grid {
+ id: grid
+ anchors.centerIn: parent
+ rows: Constants.menuRowCount
+ columns: Math.ceil(model.count / rows)
+ flow: Grid.TopToBottom
+ Repeater {
+ id: repeater
+ }
+ }
+
+ property int snapTo: width / parent.columnsOnPage
+ onMovementEnded: {
+ var rest = flicker.contentX % snapTo
+ var time = 0.25
+ if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo }
+ var vel = 2 * rest / time
+ flickDeceleration = Math.abs(vel) / time
+ flick(vel, 0)
+ flickDeceleration = 1500
+ }
+ }
+
+ Pager {
+ id: pager
+ space: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: Constants.margin
+
+ pages: Math.ceil(grid.columns / parent.columnsOnPage)
+ activePage: Internal.activePageChoose(flicker, pager.pages)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml
new file mode 100644
index 0000000000..83f1ffcd01
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml
@@ -0,0 +1,173 @@
+/**
+ * @file HardwareButtonsView.qml
+ * @brief Area of screen responsible for hardware buttons
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ height: row.height + row.anchors.margins
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.panelColor
+
+ signal buttonDown(string name)
+ signal buttonUp(string name)
+
+ function pressButton(name) {
+ buttonDown(name)
+ }
+
+ function longPressButton(name) {
+ console.log("long press " + name)
+ }
+
+ function releaseButton(name) {
+ buttonUp(name)
+ }
+
+ Row {
+ id: row
+ spacing: Constants.panelPadding
+ anchors.centerIn: parent
+ anchors.margins: Constants.panelPadding
+
+ PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter}
+
+ MaskedButton {
+ name: "vr"
+ anchors.verticalCenter: parent.verticalCenter
+ onReleased: {
+ console.debug("Clicked VR button");
+ if (!dataContainer.activeVR) {
+ vrPopUp.activate();
+ } else {
+ vrPopUp.complete();
+ }
+ }
+ }
+
+ ArrowKeys {anchors.verticalCenter: parent.verticalCenter}
+
+ Grid {
+ columns: 5
+ rows: 2
+ spacing: 5
+ anchors.verticalCenter: parent.verticalCenter
+ Repeater {
+ model: 10
+ delegate : Rectangle {
+ width: 40
+ height: 40
+ radius: 5
+ gradient: Gradient {
+ GradientStop
+ {
+ position: 0.0;
+ color: "#2c2c2c"
+ Behavior on position {
+ NumberAnimation { duration: 80 }
+ }
+ }
+
+ GradientStop
+ {
+ position: 1.0;
+ color: "black"
+ Behavior on position {
+ NumberAnimation { duration: 80 }
+ }
+ }
+ }
+
+ Text {
+ text: (1 + index) % 10
+ font.pixelSize: 30
+ color: Constants.panelTextColor
+ anchors.centerIn: parent
+ }
+
+ Timer {
+ id: timer
+ interval: Constants.presetButtonTimer
+ repeat: false
+ triggeredOnStart: false
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ property bool clickProcessed
+ onPressed: {
+ parent.gradient.stops[0].position = 1.0
+ parent.gradient.stops[1].position = 0.0
+ clickProcessed = false
+ timer.start()
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+ onReleased: {
+ parent.gradient.stops[0].position = 0.0
+ parent.gradient.stops[1].position = 1.0
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined)
+ timer.stop()
+ if (!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined)
+ }
+ }
+ Connections {
+ target: timer
+ onTriggered: {
+ if(!mouseArea.clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined)
+ mouseArea.clickProcessed = true
+ }
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ settingsContainer.buttonCapabilities.push(
+ {
+ name: Common.ButtonName.PRESET_0 + index,
+ upDownAvailable: true,
+ shortPressAvailable: true,
+ longPressAvailable: true
+ });
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml
new file mode 100644
index 0000000000..4d9b8091d7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml
@@ -0,0 +1,61 @@
+/**
+ * @file IPodPlayerView.qml
+ * @brief IPod player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: ipodPlayer
+ playerName: "iPod"
+ anchors.fill: parent
+ image: playerState.albumImage
+ playerState: dataContainer.ipodPlayerState
+
+ buttons: [
+ OvalButton {
+ text: ipodPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml
new file mode 100644
index 0000000000..eca575d6b1
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml
@@ -0,0 +1,61 @@
+/**
+ * @file LineInPlayerView.qml
+ * @brief LineIn player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: lineInPlayer
+ playerName: "LineIn"
+ anchors.fill: parent
+ image: playerState.albumImage
+ playerState: dataContainer.linePlayerState
+
+ buttons: [
+ OvalButton {
+ text: lineInPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml
new file mode 100644
index 0000000000..321a67831c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml
@@ -0,0 +1,54 @@
+/**
+ * @file MainMenuView.qml
+ * @brief Main menu screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../models"
+import "../controls"
+
+GridMenu {
+ id: menu
+ model: MainMenuListModel { }
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ ClickableImage {
+ anchors.centerIn: parent
+ source: icon
+ onClicked: {
+ if(qml !== "") {
+ contentLoader.go(qml)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml
new file mode 100644
index 0000000000..183798eb49
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml
@@ -0,0 +1,73 @@
+/**
+ * @file MediaClockView.qml
+ * @brief Media clock view
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+Item {
+ property alias time: timeText.text
+ Text {
+ id: timeText
+ anchors.left: parent.left
+ width: 1/10 * parent.width
+ anchors.verticalCenter: parent.verticalCenter
+ horizontalAlignment: Text.AlignRight
+ color: "white"
+ text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime)
+ : "02:36" //TODO {Aleshin}: get track time for all players except SDL
+ font.pixelSize: 18
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ height: parent.height
+ width: 2/3 * parent.width
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ height: 2
+ width: dataContainer.currentApplication.mediaClock.progress * parent.width
+ color: "white"
+ }
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ height: 2
+ width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width
+ color: Constants.primaryColor
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml
new file mode 100644
index 0000000000..866f5399cb
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml
@@ -0,0 +1,325 @@
+/**
+ * @file MediaPlayerView.qml
+ * @brief Parent for BT, IPod, CD players screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+Item {
+ id: mediaPlayerView
+
+ property string playerName: ""
+ property string playerType: ""
+
+ signal rewind
+ signal forward
+ signal play
+ signal pause
+
+ // Holds players state(song name, play/pause state, track number etc). For all players except SDL.
+ property PlayerState playerState;
+
+ property alias buttons: buttonsRow.content
+ property alias buttonsSpacing: buttonsRow.spacing
+ property alias image: image.source
+
+ Item {
+ // row of oval buttons
+ id: ovalButtonsRow
+ width: parent.width
+ height: 1/5 * parent.height
+ anchors.left: parent.left
+ anchors.top: parent.top
+
+ PagedFlickable {
+ id: buttonsRow
+ width: parent.width
+ spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3)
+ : (width - 2 * elementWidth)
+ anchors.verticalCenter: parent.verticalCenter
+ snapTo: Constants.ovalButtonWidth + spacing
+ elementWidth: Constants.ovalButtonWidth
+ }
+ }
+
+ Item {
+ id: spacingBetweenItems
+ width: parent.width
+ height: 1/10 * parent.height
+ anchors.left: parent.left
+ anchors.top: ovalButtonsRow.bottom
+
+ Behavior on height {
+ NumberAnimation {
+ duration : Constants.animationDuration
+ }
+ }
+ }
+
+ Column {
+ // Picture + text information + media clock
+ id: mediaContent
+ width: parent.width
+ height: 2/5 * parent.height
+ anchors.left: parent.left
+ anchors.top: spacingBetweenItems.bottom
+
+ Row {
+ // picture + text info
+ width: parent.width
+ height: 3/4 * parent.height
+ spacing: Constants.margin
+
+ Image {
+ id: image
+ height: parent.height
+ width: height
+ }
+
+ Column {
+ // text info
+ id: textInfo
+ height: parent.height
+ width: parent.width - image.width - parent.spacing
+ spacing: (height - titleText.height - 3 * text.height) / 3
+
+ Text {
+ id: titleText
+ anchors.left: parent.left
+ anchors.right: parent.right
+ horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
+ color: Constants.primaryColor
+ text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1
+ : playerState.trackName
+ font.pixelSize: Constants.titleFontSize
+ font.bold: true
+ }
+
+ Text {
+ id: text
+ anchors.left: parent.left
+ anchors.right: parent.right
+ horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
+ color: Constants.primaryColor
+ text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2
+ : playerState.albumName
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ horizontalAlignment: Text.AlignHCenter
+ color: Constants.primaryColor
+ text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack
+ : playerState.trackNumber
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "Time to destination: " + dataContainer.navigationModel.timeToDestination
+ font.pixelSize: Constants.fontSize
+ horizontalAlignment: dataContainer.hmiUITextAlignment
+ visible: mediaPlayerView.playerType === "SDL" && dataContainer.navigationModel.timeToDestination
+ }
+ }
+ }
+
+ MediaClockView {
+ width: parent.width
+ height: parent.height * 1/4
+ }
+ }
+
+ Item {
+ id: spacingBetweenItems2
+ width: parent.width
+ height: 1/10 * parent.height
+ anchors.left: parent.left
+ anchors.top: mediaContent.bottom
+
+ Behavior on height {
+ NumberAnimation {
+ duration : Constants.animationDuration
+ }
+ }
+ }
+
+ Row {
+ // Rewind, play, pause, forward buttons
+ id: playPauseRewindForward
+ width: parent.width
+ height: 1/5 * parent.height - statusBar.height
+ anchors.left: parent.left
+ anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2
+ anchors.top: spacingBetweenItems2.bottom
+
+ Image {
+ id: prevButton
+ anchors.verticalCenter: parent.verticalCenter
+ source: "../res/buttons/player_prev_btn.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ prevButton.source = "../res/buttons/player_prev_pressed_btn.png"
+ }
+ onReleased: {
+ prevButton.source = "../res/buttons/player_prev_btn.png"
+ }
+ }
+ }
+
+ PlayPauseButton {
+ id: playPauseButton
+ anchors.verticalCenter: parent.verticalCenter
+ state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState
+ onClicked: {
+ (state == 'Play') ? play() : pause();
+ var newState = state === "Play" ? "Pause" : "Play";
+ (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } )
+ : playerState.playPauseState = newState
+ }
+ }
+
+ Image {
+ id: nextButton
+ anchors.verticalCenter: parent.verticalCenter
+ source: "../res/buttons/player_next_btn.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ nextButton.source = "../res/buttons/player_next_pressed_btn.png"
+ }
+ onReleased: {
+ nextButton.source = "../res/buttons/player_next_btn.png"
+ }
+ }
+ }
+ }
+
+ Item {
+ id: presetButtons
+ width: parent.width
+ height: 1/5 * parent.height
+ anchors.top: playPauseRewindForward.bottom
+ anchors.left: parent.left
+
+ PresetRow {
+ id: presetsRow
+ anchors.top: parent.top
+ anchors.left: parent.left
+ presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow() : []
+ width: parent.width
+ property bool clickProcessed
+
+ Timer {
+ id: timer
+ interval: Constants.presetButtonTimer
+ repeat: false
+ triggeredOnStart: false
+ onTriggered: {
+ console.log("preset button hold")
+ presetsRow.clickProcessed = true
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + presetsRow.selectedIndex, Common.ButtonPressMode.LONG, undefined)
+ }
+ }
+
+ onPresetButtonPressed: {
+ console.log("preset button pressed")
+ timer.start()
+ clickProcessed = false
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+
+ onPresetButtonReleased: {
+ console.log("preset button released")
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
+ timer.stop()
+ if (!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
+ }
+ }
+ }
+ }
+
+ StatusBar {
+ id: statusBar
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ }
+
+ states: [
+ State {
+ name: 'presetButtonsON'
+ when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL")
+ PropertyChanges {
+ target: spacingBetweenItems
+ height: 1
+ }
+ PropertyChanges {
+ target: spacingBetweenItems2
+ height: 1
+ }
+ PropertyChanges {
+ target: presetButtons
+ visible: true
+ enabled: true
+ }
+ },
+
+ State {
+ name: 'presetButtonsOFF'
+ when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL")
+ PropertyChanges {
+ target: spacingBetweenItems
+ height: 1/10 * mediaPlayerView.height
+ }
+ PropertyChanges {
+ target: spacingBetweenItems2
+ height: 1/10 * mediaPlayerView.height
+ }
+ PropertyChanges {
+ target: presetButtons
+ visible: false
+ enabled: false
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml
new file mode 100644
index 0000000000..c9c30e200c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml
@@ -0,0 +1,75 @@
+/**
+ * @file MusicSourceView.qml
+ * @brief Music source screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ GridMenu {
+ id: menu
+ model: dataContainer.musicSourceModel
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: bottomPanel.top
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ OvalButton {
+ text: title
+ onReleased: contentLoader.go(qml, appId)
+ anchors.centerIn: parent
+ fontSize: Constants.fontSize
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
+
+
+
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml
new file mode 100644
index 0000000000..6d5ad5027f
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml
@@ -0,0 +1,250 @@
+/**
+ * @file NavigationInRouteGridView.qml
+ * @brief Navigation in route screen veiw.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+
+GeneralView {
+ Item {
+ id: navInRoute
+ anchors.fill: parent
+
+ Image {
+ // 3/4 top screen
+ id: map
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ source: "../res/nav/map.png"
+
+ Image {
+ id: compas
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 1/4 * compas.width
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4 * compas.width
+ source: "../res/nav/compass.png"
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: compas.horizontalCenter
+ spacing: 1/8 * parent.height
+
+ // Zoom "+" button
+ Image {
+ id: zoomIn
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomInBtn
+ anchors.centerIn: parent
+ text: "+"
+ color: Constants.releasedButtonTextColor
+ font.pixelSize: 30
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomInBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomInBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+
+ // Zoom "-" button
+ Image {
+ id: zoomOut
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomOutBtn
+ anchors.centerIn: parent
+ text: "-"
+ color: "white"
+ font.pixelSize: 30
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomOutBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomOutBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+ } // column
+
+ // Options button
+ Image {
+ id: navOptions
+ anchors.top: parent.top
+ anchors.right: parent.right
+ source: "../res/nav/options.png"
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/nav/options_pressed.png"
+ }
+ onReleased: {
+ parent.source = "../res/nav/options.png"
+ }
+ onClicked: {
+ //Options screen
+ }
+ }
+ }
+ } //map
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ Image {
+ id: muteBtnImg
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4 * muteBtnImg.width
+ source: "../res/nav/mute_off.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (muteBtnImg.state === "off") {
+ muteBtnImg.state = "on"
+ muteBtnImg.source = "../res/nav/mute_off.png"
+ }
+ else {
+ muteBtnImg.source = "../res/nav/mute_on.png"
+ muteBtnImg.state = "off"
+ }
+ }
+ }
+
+ Image {
+ id: turnArrow
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: muteBtnImg.right
+ anchors.leftMargin: 1/20 * contentLoader.width
+ source: "../res/nav/turnArrow.png"
+ }
+
+ Text {
+ id: street
+ anchors.verticalCenter: cancel.verticalCenter
+ anchors.left: turnArrow.right
+ anchors.leftMargin: 1/20 * contentLoader.width
+ text: "0.2 mi on Cherry Hill Rd."
+ color: "White"
+ font.pixelSize: 20
+ }
+
+ Text {
+ id: timeToDest
+ anchors.verticalCenter: cancel.verticalCenter
+ anchors.right: cancel.left
+ anchors.rightMargin: 1/20 * contentLoader.width
+ text: "2 hrs 27 min"
+ color: "White"
+ font.pixelSize: 20
+ }
+
+ Image {
+ id: cancel
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+
+ source: "../res/buttons/long_oval_btn.png"
+
+ Image {
+ id: destIcon
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: cancel.left
+ anchors.leftMargin: Constants.fontSize
+ source: "../res/nav/dest_icon.png"
+ }
+
+ Text {
+ id: cancelText
+ anchors.centerIn: parent
+ text: "Cancel"
+ color: Constants.primaryColor
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ cancel.source = "../res/buttons/long_oval_pressed_btn.png"
+ destIcon.source = "../res/nav/dest_icon_black.png"
+ cancelText.color = Constants.pressedButtonTextColor
+ }
+
+ onReleased: {
+ cancel.source = "../res/buttons/long_oval_btn.png"
+ destIcon.source = "../res/nav/dest_icon.png"
+ cancelText.color = Constants.primaryColor
+ }
+
+ onClicked: {
+ contentLoader.go("./views/NavigationNoRouteGridView.qml")
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml
new file mode 100644
index 0000000000..3ef73ee67d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml
@@ -0,0 +1,221 @@
+/**
+ * @file NavigationKeyboardView.qml
+ * @brief Navigation keyboard screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ id: navKeyboard
+ anchors.fill: parent
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ // Text line with input text
+ TextInput {
+ id: inputText
+ anchors.top:parent.top
+ anchors.left:parent.left
+ maximumLength: 30
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ text: dataContainer.routeText
+ }
+
+ // Keyboard
+ Column {
+ anchors.centerIn: parent
+ Row {
+ id: upperRow
+ property string qWERTY : "QWERTYUIOP"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Repeater {
+ model: 10
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: upperRow.qWERTY.charAt(index)
+ pixelSize: Constants.fontSize
+
+ onClicked: {
+ dataContainer.routeText += upperRow.qWERTY.charAt(index)
+ }
+ }
+ }
+ }
+ Row {
+ id: middleRow
+ property string aSDFGH : "ASDFGHJKL"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "123"
+ pixelSize: 15
+ }
+ //--------------
+ Repeater {
+ model: 9
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: middleRow.aSDFGH.charAt(index)
+ pixelSize: Constants.fontSize
+
+ onClicked: {
+ dataContainer.routeText += middleRow.aSDFGH.charAt(index)
+ }
+ }
+ }
+ //--------------
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ onIsPressedChanged: {
+ hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png";
+ }
+ Image {
+ id: hoverImg
+ anchors.centerIn: parent
+ source: "../res/nav/delete_icon.png"
+ }
+
+ onClicked: {
+ dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1)
+ }
+ }
+ }
+ Row {
+ id: lowerRow
+ property string zXCVBN : "ZXCVBNM"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "!@#"
+ pixelSize: 15
+ }
+ //-----------------
+ Repeater {
+ model: 7
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: lowerRow.zXCVBN.charAt(index)
+ pixelSize: Constants.fontSize
+
+ onClicked: {
+ dataContainer.routeText += lowerRow.zXCVBN.charAt(index)
+ }
+ }
+ }
+ //----------------
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "Clear"
+ pixelSize: 12
+
+ onClicked: {
+ dataContainer.routeText = ""
+ }
+ }
+ //----------------
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "Space"
+ pixelSize: 12
+
+ onClicked: {
+ dataContainer.routeText += " "
+ }
+ }
+ }
+
+ } // column
+
+ Image {
+ id: goBtn
+ anchors.right: parent.right
+ anchors.top: parent.top
+ source: "../res/buttons/short_oval_btn.png"
+
+ Text {
+ id: goText
+ anchors.centerIn: parent
+ text: "Go"
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ goBtn.source = "../res/buttons/short_oval_btn_pressed.png"
+ goText.color = Constants.pressedButtonTextColor
+ }
+
+ onReleased: {
+ goBtn.source = "../res/buttons/short_oval_btn.png"
+ goText.color = Constants.primaryColor
+ }
+
+ onClicked: {
+ contentLoader.go("./views/NavigationInRouteGridView.qml")
+ }
+ }
+ }
+ } // 3/4 top screen
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml
new file mode 100644
index 0000000000..5ceffe0526
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml
@@ -0,0 +1,75 @@
+/**
+ * @file NavigationMenuView.qml
+ * @brief Navigation menu screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ GridMenu {
+ id: menu
+ model: NavigationMenuModel {}
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: bottomPanel.top
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ OvalButton {
+ text: title
+ onReleased: contentLoader.go(qml)
+ anchors.centerIn: parent
+ fontSize: Constants.fontSize
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
+
+
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml
new file mode 100644
index 0000000000..312f076394
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml
@@ -0,0 +1,205 @@
+/**
+ * @file NavigationNoRouteGridView.qml
+ * @brief Navigation no route screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ id: navNoRoute
+ anchors.fill: parent
+
+ Image {
+ // 3/4 top screen
+ id: map
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ source: "../res/nav/map.png"
+
+ Image {
+ id: compas
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 1/4 * compas.width
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4 * compas.width
+ source: "../res/nav/compass.png"
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: compas.horizontalCenter
+ spacing: 1/8 * parent.height
+
+ // Zoom "+" button
+ Image {
+ id: zoomIn
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomInBtn
+ anchors.centerIn: parent
+ text: "+"
+ color: "white"
+ font.pixelSize: Constants.fontSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomInBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomInBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+
+ // Zoom "-" button
+ Image {
+ id: zoomOut
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomOutBtn
+ anchors.centerIn: parent
+ text: "-"
+ color: "white"
+ font.pixelSize: Constants.fontSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomOutBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomOutBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+ } // column
+
+ // Options button
+ Image {
+ id: navOptions
+ anchors.top: parent.top
+ anchors.right: parent.right
+ source: "../res/nav/options.png"
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/nav/options_pressed.png"
+ }
+ onReleased: {
+ parent.source = "../res/nav/options.png"
+ }
+ onClicked: {
+ //Options screen
+ }
+ }
+ }
+ } //map
+
+ Item {
+ // 1/4 bottom screen
+ id: bottomPart
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ // Destination search button
+ Image {
+ id: destSearch
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ source: "../res/buttons/longest_oval_btn.png"
+
+ Image {
+ id: destIcon
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 15
+ source: "../res/nav/dest_icon.png"
+ }
+
+ Text {
+ id: destText
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: destIcon.right
+ anchors.leftMargin: 5
+ text: "Destination"
+ color: Constants.primaryColor
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ destSearch.source = "../res/buttons/longest_oval_btn_pressed.png"
+ destIcon.source = "../res/nav/dest_icon_black.png"
+ destText.color = Constants.pressedButtonTextColor
+ }
+
+ onReleased: {
+ destSearch.source = "../res/buttons/longest_oval_btn.png"
+ destIcon.source = "../res/nav/dest_icon.png"
+ destText.color = Constants.primaryColor
+ }
+
+ onClicked: {
+ contentLoader.go("./views/NavigationMenuView.qml")
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml
new file mode 100644
index 0000000000..b328406d68
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml
@@ -0,0 +1,171 @@
+/**
+ * @file PhoneKeyboardView.qml
+ * @brief Phone keyboard screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView{
+ Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons()
+
+ Item {
+ function changeColorOfActiveButtons() {
+ for (var i = 0; i < contactsListModel.count; i++) {
+ activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true
+ }
+ }
+
+ id: phoneKeyboard
+ anchors.fill: parent
+
+ property variant activeButtons: {
+ "A": false, "B": false, "C": false, "D": false, "E": false,
+ "F": false, "G": false, "H": false, "I": false, "J": false,
+ "K": false, "L": false, "M": false, "N": false, "O": false,
+ "P": false, "Q": false, "R": false, "S": false, "T": false,
+ "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false
+ }
+
+ ContactsListModel {
+ id: contactsListModel
+ }
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Column {
+ anchors.centerIn: parent
+
+ Row {
+ id: upperRow
+ property string contentLoader : "ABCDEFGHI"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: 9
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]
+ ? Constants.primaryColor : Constants.inactiveButtonTextColor
+ text: upperRow.contentLoader.charAt(index)
+ pixelSize: Constants.fontSize
+ onIsPressedChanged: {
+ if (!isPressed){
+ if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) {
+ dataContainer.contactsFirstLetter = text
+ contentLoader.go("./views/ContactsListView.qml")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Row {
+ id: middleRow
+ property string contentLoader : "JKLMNOPQR"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: 9
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]
+ ? Constants.primaryColor : Constants.inactiveButtonTextColor
+ text: middleRow.contentLoader.charAt(index)
+ pixelSize: Constants.fontSize
+ onIsPressedChanged: {
+ if (!isPressed){
+ if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) {
+ dataContainer.contactsFirstLetter = text
+ contentLoader.go("./views/ContactsListView.qml")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Row {
+ id: lowerRow
+ property string contentLoader : "STUVWXYZ"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: 8
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]
+ ? Constants.primaryColor : Constants.inactiveButtonTextColor
+ text: lowerRow.contentLoader.charAt(index)
+ pixelSize: Constants.fontSize
+ onIsPressedChanged: {
+ if (!isPressed){
+ if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) {
+ dataContainer.contactsFirstLetter = text
+ contentLoader.go("./views/ContactsListView.qml")
+ }
+ }
+ }
+ }
+ }
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "123"
+ pixelSize: 20
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent}
+ }
+ }
+}
+
+
diff --git a/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml
new file mode 100644
index 0000000000..7d52b1223a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml
@@ -0,0 +1,55 @@
+/**
+ * @file PhoneMenuGridView.qml
+ * @brief View for phone menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../models"
+import "../controls"
+
+GridMenu {
+ id: menu
+ model: PhoneMenuModel {}
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ ClickableImage {
+ anchors.centerIn: parent
+ source: icon
+ onClicked: {
+ if(qml !== "") {
+ contentLoader.go(qml)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml
new file mode 100644
index 0000000000..1df65d4235
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml
@@ -0,0 +1,160 @@
+/**
+ * @file RadioPlayerView.qml
+ * @brief Parent for AM, FM, Sirius players screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+Item {
+ id: radioPlayerView
+
+ property string radioType: ""
+ property string radioName: ""
+ property alias buttonHD: bot.children
+
+ property PlayerState playerState
+
+ Item {
+ // top 3/4 screen
+ id: upperContent
+ anchors.top: parent.top
+ anchors.left: parent.left
+ height: parent.height * 3/4
+ width: parent.width
+
+ Item {
+ // top part for buttons
+ id: top
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height * 1/4
+
+ OvalButton {
+ text: radioName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ }
+
+ OvalButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ text: "Tune"
+ fontSize: Constants.fontSize
+ }
+ }
+
+ Item {
+ // mid part for information about song
+ id: mid
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height / 2
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+
+ Row {
+ Text {
+ id: radioChannelNameText
+ color: Constants.primaryColor
+ text: playerState.presets[0]
+ font.pixelSize: 45
+ }
+ Text {
+ anchors.bottom: radioChannelNameText.bottom
+ color: Constants.primaryColor
+ text: " " + radioType
+ font.pixelSize: 25
+ }
+ }
+
+ Text {
+ color: Constants.primaryColor
+ text: playerState.songName
+ font.pixelSize: 25
+ font.bold: true
+ }
+
+ Text {
+ color: Constants.primaryColor
+ text: playerState.albumName
+ font.pixelSize: 25
+ }
+ }
+ }
+
+ Item {
+ // bottom part for HD button (for FM radio)
+ id: bot
+ anchors.left: parent.left
+ anchors.bottom: parent. bottom
+ width: parent.width
+ height: parent.height * 1/4
+ }
+ }
+
+ Item {
+ // bottom 1/4 screen
+ id: lowerContent
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ // Line that divide screen in two parts
+ Rectangle {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: 2
+ color: Constants.primaryColor
+ }
+
+ PresetRow {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ presets: playerState.presets
+ width: parent.width
+ onSelectedIndexChanged: {
+ radioChannelNameText.text = presets[selectedIndex];
+ }
+ }
+ }
+}
+
+
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml
new file mode 100644
index 0000000000..620b0434c6
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml
@@ -0,0 +1,223 @@
+/**
+ * @file SDLNavi.qml
+ * @brief SDL navigation screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ anchors.fill: parent
+ id: wholeWindow
+
+ Row {
+ // Top items
+ id: topItems
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/6 * parent.height
+ spacing: Constants.sdlNaviSpacing
+
+ Rectangle {
+ anchors.top: parent.top
+ width: 1/5 * parent.width
+ height: 4/5 * parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField1
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ Rectangle {
+ anchors.top: parent.top
+ width: 3/5 * parent.width - 2 * parent.spacing
+ height: parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField2
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ Rectangle {
+ id: rightRectOfTopItems
+ anchors.top: parent.top
+ width: 1/5 * parent.width
+ height: 4/5 * parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3"
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ Column {
+ // "+", "-" button at left
+ anchors.left: parent.left
+ anchors.verticalCenter: parent.verticalCenter
+ width: 1/12 * parent.width
+ height: 2/10 * parent.height + spacing
+ spacing: Constants.sdlNaviSpacing
+
+ GradientRectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ text: "+"
+ isCustomButton: true
+ customButtonID: 3
+ }
+ GradientRectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ text: "-"
+ isCustomButton: true
+ customButtonID: 4
+ }
+ }
+
+ Column {
+ anchors.right: parent.right
+ anchors.top: topItems.bottom
+ width: 1/6 * parent.width
+ height: 2/10 * parent.height + spacing
+ spacing: Constants.sdlNaviSpacing
+
+ Rectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: ""
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ Rectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4"
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ Row {
+ // bottom items
+ id: bottomItems
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/6 * parent.height
+ spacing: Constants.sdlNaviSpacing
+
+ GradientRectangle {
+ anchors.bottom: parent.bottom
+ width: 1/3 * parent.width
+ height: parent.height
+ text: "Menu"
+ isCustomButton: true
+ customButtonID: 1
+ }
+ Rectangle {
+ anchors.bottom: parent.bottom
+ width: 1/3 * parent.width - 2 * parent.spacing
+ height: parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: "mainField5"
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ GradientRectangle {
+ anchors.bottom: parent.bottom
+ width: 1/3 * parent.width
+ height: parent.height
+ text: "Custom Button"
+ isCustomButton: true
+ customButtonID: 2
+ }
+ }
+
+ GradientRectangle {
+ anchors.right: parent.right
+ anchors.bottom: bottomItems.top
+ anchors.bottomMargin: Constants.sdlNaviSpacing
+ width: 1/6 * parent.width
+ height: 1/10 * parent.height
+ text: "Options"
+ fontSize: Constants.fontSize
+ onReleased: {
+ contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId)
+ }
+
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml
new file mode 100644
index 0000000000..bebfe9585d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml
@@ -0,0 +1,194 @@
+/**
+ * @file SDLNonMediaView.qml
+ * @brief SDL non media screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+import QtQuick 1.1
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ id: upperContent
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ Item {
+ id: topButtonRow
+ // top 1/4 of screen
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ elementWidth: Constants.ovalButtonWidth
+ spacing: (width - 4 * elementWidth) / 3
+ snapTo: elementWidth + spacing
+
+ OvalButton {
+ text: "Options"
+ onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
+ }
+
+ Repeater {
+ model: dataContainer.currentApplication.softButtons ?
+ dataContainer.currentApplication.softButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.softButtons.get(index)
+ }
+ }
+ }
+ }
+
+ Column {
+ id: midContent
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: topButtonRow.bottom
+ anchors.left: parent.left
+
+ Text {
+ id: deviceName
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "Device: " + dataContainer.currentApplication.deviceName
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ Row {
+ width: parent.width
+ height: 4/5 * parent.height
+ spacing: Constants.margin
+
+ Image {
+ id: image
+ height: parent.height
+ width: height
+ source: dataContainer.currentApplication.hmiUIText.image
+ }
+
+ Column {
+ height: parent.height
+ width: parent.width - image.width - parent.spacing
+ spacing: Constants.margin
+
+ Text {
+ id: text1
+ width: parent.width
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: dataContainer.hmiUITextAlignment
+ text: dataContainer.currentApplication.hmiUIText.mainField1
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ Text {
+ width: parent.width
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: dataContainer.hmiUITextAlignment
+ text: dataContainer.currentApplication.hmiUIText.mainField2
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ // bottom 1/4 screen
+ id: lowerContent
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height * 1/4
+
+ PresetRow {
+ id: presetsRow
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ presets: Internal.getArrayForPresetRow()
+ width: parent.width
+ property bool clickProcessed
+
+ Timer {
+ id: timer
+ interval: Constants.presetButtonTimer
+ repeat: false
+ triggeredOnStart: false
+ }
+
+ onPresetButtonPressed: {
+ timer.start()
+ clickProcessed = false
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+
+ onPresetButtonReleased: {
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
+ timer.stop()
+ if (!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
+ }
+ }
+
+ Connections {
+ target: timer
+ onTriggered: {
+ if(!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
+ clickProcessed = true
+ }
+ }
+ }
+ }
+ }
+
+ StatusBar {
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml
new file mode 100644
index 0000000000..076851b29a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml
@@ -0,0 +1,120 @@
+/**
+ * @file SDLPlayerOptionsListView.qml
+ * @brief SDL player options screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+GeneralView {
+ applicationContext: true
+ systemContext: Common.SystemContext.SYSCTXT_MENU
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ ListView {
+ id: sdlPlayerOptionsListView
+ anchors.horizontalCenter: parent.horizontalCenter
+ width:parent.width
+ height:parent.height
+
+ model: dataContainer.currentApplication.currentSubMenu
+
+ delegate: Row {
+ spacing: Constants.iconItemListSpacing
+ Icon {
+ source: model.icon
+ width: Constants.iconItemListSize
+ height: Constants.iconItemListSize
+
+ MouseArea {
+ anchors.fill: parent
+ enabled: model.icon.value !== undefined
+
+ onPressed: text.press()
+ onReleased: text.release()
+ onCanceled: text.release()
+ onClicked: text.click()
+ }
+ }
+
+ ClickableText {
+ id: text
+ text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "")
+ width: sdlPlayerOptionsListView.width - x
+ elide: Text.ElideRight
+ defaultColor: type === Internal.MenuItemType.MI_PARENT ?
+ Constants.inactiveButtonTextColor :
+ Constants.primaryColor
+ pressedColor: type === Internal.MenuItemType.MI_PARENT ?
+ Constants.inactiveButtonTextColorPressed :
+ Constants.primaryColorPressed
+ font.pixelSize: Constants.titleFontSize
+
+ function click() {
+ console.debug("enter")
+ switch (type) {
+ case Internal.MenuItemType.MI_NODE:
+ sdlUI.onCommand(model.id, dataContainer.currentApplication.appId)
+ contentLoader.back()
+ break;
+ case Internal.MenuItemType.MI_SUBMENU:
+ case Internal.MenuItemType.MI_PARENT:
+ dataContainer.currentApplication.currentSubMenu = subMenu
+ break;
+ }
+ console.debug("exit")
+ }
+ onClicked: click()
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml
new file mode 100644
index 0000000000..0c1bd5b7e9
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml
@@ -0,0 +1,79 @@
+/**
+ * @file SDLPlayerView.qml
+ * @brief SDL player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ applicationContext: true
+ MediaPlayer {
+ id: mediaPlayer
+ onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
+ onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
+ playerName: "SDL music"
+ playerType: "SDL"
+ image: dataContainer.currentApplication.hmiUIText.image
+ anchors.fill: parent
+
+ buttons: [
+ OvalButton {
+ text: dataContainer.currentApplication.appName
+ onReleased: { contentLoader.go("./views/MusicSourceView.qml") }
+ },
+
+ OvalButton {
+ text: "SDL Menu"
+ onReleased: { contentLoader.go("./views/ApplicationListView.qml") }
+ },
+
+ OvalButton {
+ text: "Options"
+ onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
+ },
+
+ Repeater {
+ model: dataContainer.currentApplication.softButtons ?
+ dataContainer.currentApplication.softButtons.count :
+ 0
+
+ delegate: SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.softButtons.get(index)
+ }
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml
new file mode 100644
index 0000000000..f7111906de
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml
@@ -0,0 +1,216 @@
+/**
+ * @file ScrollableMessageView.qml
+ * @brief Scrollable Message View .
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models"
+import "../popups"
+
+GeneralView {
+ applicationContext: true
+ id: scrollableMessageView
+
+ function complete(abort){
+ console.debug("enter")
+ timer.stop()
+ dataContainer.scrollableMessageModel.running = false
+
+ dataContainer.popups--
+ dataContainer.applicationContext = dataContainer.applicationSavedContext
+
+ if(abort) {
+ console.debug("send error")
+ DBus.sendError(dataContainer.scrollableMessageModel.async, Common.Result.ABORTED)
+ } else {
+ console.debug("send ok")
+ DBus.sendReply(dataContainer.scrollableMessageModel.async, {})
+ }
+
+ contentLoader.back()
+ console.debug("exit")
+ }
+
+
+ Connections {
+ target: contentLoader
+ onStatusChanged: {
+ if (status == Component.Ready) {
+ console.debug("enter")
+ console.debug("timeout in timer", timer.interval)
+ dataContainer.popups++
+ dataContainer.applicationSavedContext = dataContainer.applicationContext
+ dataContainer.scrollableMessageModel.running = true
+ timer.start()
+ console.debug("exit")
+ }
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: Constants.secondaryColor
+
+ Timer {
+ id: timer
+ interval: dataContainer.scrollableMessageModel.timeout
+ onTriggered: {
+ complete(false)
+ }
+ }
+
+ Item {
+ // top 1/6 of screen
+ id: top
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/6 : 1
+
+ OvalButton {
+ //this button is used only to get item size for PagedFlickable
+ id: fakeButton
+ text: "defaultBtnSize"//remove this line when default size for btn will be introduced
+ visible:false
+ }
+
+ PagedFlickable {
+ id: flickRow
+ width: top.width
+ spacing: (width - fakeButton.width * 4) / 3
+ snapTo: fakeButton.width + spacing
+ elementWidth: fakeButton.width
+
+
+ ListView {
+ id: softButtons
+ width: model.count * fakeButton.width + (model.count - 1) * flickRow.spacing
+ height: fakeButton.height
+ spacing: flickRow.spacing
+
+ orientation: ListView.Horizontal
+ interactive: false
+ model: dataContainer.scrollableMessageModel.softButtons
+
+ delegate: SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: model
+ onKeepContext: timer.restart()
+ onDefaultAction: scrollableMessageView.complete(true)
+ }
+ }
+ }
+ }
+
+ Item {
+ id: middle
+ anchors.top: top.bottom
+ anchors.left: parent.left
+ anchors.bottom: bottom.top
+ width: parent.width
+
+ Flickable {
+ id:flickable
+ anchors.fill: middle
+ flickableDirection: Flickable.VerticalFlick
+ contentWidth: longMessageText.width
+ contentHeight: longMessageText.height
+ clip: true
+
+
+ Text {
+ id: longMessageText
+ wrapMode: Text.Wrap
+ width: middle.width
+ text: dataContainer.scrollableMessageModel.longMessageText
+ color: Constants.scrollableMessageTextColor
+ font.pixelSize: Constants.fontSize
+
+ }
+ }
+ Rectangle {
+ id: scrollbar
+ anchors.right: flickable.right
+ y: flickable.visibleArea.yPosition * flickable.height
+ width: Constants.scrollableMessageScrollBarWidth
+ height: flickable.visibleArea.heightRatio * flickable.height
+ visible: !(flickable.visibleArea.heightRatio > 1)
+ color: Constants.scrollableMessageScrollBarColor
+ }
+
+ }
+
+ Item {
+ // 1/4 bottom screen
+ id: bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton {
+ id:backButton
+ anchors.centerIn: parent
+ onClicked: {
+ console.debug("enter")
+ complete(true)
+ console.debug("exit")
+ }
+ }
+ }
+ }
+ /**
+ * Test Support Section
+ *
+ */
+ function getTimer(){
+ return timer
+ }
+ function getSoftButtonsListView(){
+ return softButtons
+ }
+ function getScrollbar(){
+ return scrollbar
+ }
+ function getTextArea(){
+ return middle
+ }
+ function getBackButton(){
+ return backButton
+ }
+ /**
+ * Test Support Section End
+ */
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml
new file mode 100644
index 0000000000..c30d83f019
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml
@@ -0,0 +1,284 @@
+/**
+ * @file SimulationView.qml
+ * @brief Area of screen responsible for simulation actions
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../views"
+import "../popups"
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ width: controlArea.width + controlArea.anchors.margins
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ color: Constants.panelColor
+
+ Item {
+ id: showArea
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins)
+
+ ExitAllApplicationsPopup {
+ id: exitAllApplicationsPopup
+ anchors.fill: parent
+ visible: false
+ }
+
+ VehicleInfoPopUp {
+ id: viPopUp
+ anchors.fill: parent
+ }
+
+ TBTClientStatePopUp {
+ id: tbtClientStatePopUp
+ anchors.fill: parent
+ visible: false
+ }
+ }
+
+ Item {
+ id: controlArea
+ anchors.bottom: parent.bottom
+ anchors.margins: Constants.panelPadding
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: table.width
+
+ ListModel {
+ id: languagesList
+
+ Component.onCompleted: {
+ for (var name in Common.Language) {
+ if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) {
+ append({name: name.replace('_', '-')});
+ }
+ }
+ }
+ }
+
+ Text {
+ id: label
+ text: "Languages"
+ color: Constants.panelTextColor
+ anchors.bottom: table.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Grid {
+ id: table
+ spacing: 5
+ columns: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: globalProperties.top
+
+ Text {
+ text: "HMI UI"
+ color: Constants.panelTextColor
+ }
+
+ Text {
+ text: "HMI TTS + VR"
+ color: Constants.panelTextColor
+ }
+
+ ComboBox {
+ width: table.width / table.columns - table.spacing
+ model: languagesList
+ onCurrentIndexChanged: {
+ dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex];
+ sdlUI.onLanguageChange(dataContainer.hmiUILanguage);
+ }
+ z: 1000
+ }
+
+ ComboBox {
+ width: table.width / table.columns - table.spacing
+ model: languagesList
+ onCurrentIndexChanged: {
+ dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex];
+ sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage);
+ sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage);
+ }
+ z: 1000
+ }
+
+ Text {
+ text: "Application UI"
+ color: Constants.panelTextColor
+ }
+
+ Text {
+ text: "Application TTS + VR"
+ color: Constants.panelTextColor
+ }
+
+ Text {
+ id: uiLanguageLabel
+ color: Constants.panelTextColor
+ text: " "
+ Connections {
+ target: dataContainer
+ onCurrentApplicationChanged: {
+ for (var s in Common.Language) {
+ if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) {
+ uiLanguageLabel.text = s;
+ }
+ }
+ }
+ }
+ }
+
+ Text {
+ id: ttsLanguageLabel
+ color: Constants.panelTextColor
+ text: " "
+ Connections {
+ target: dataContainer
+ onCurrentApplicationChanged: {
+ for (var s in Common.Language) {
+ if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) {
+ ttsLanguageLabel.text = s;
+ }
+ }
+ }
+ }
+ }
+
+ PushButton {
+ id: vehicleInfo
+ label: "Vehicle info"
+ toggleMode: true
+ onPressed: {
+ viPopUp.show();
+ }
+ onUnpressed: {
+ viPopUp.hide();
+ }
+ }
+
+ PushButton {
+ id: tbtClientState
+ label: "TBT Client state"
+ toggleMode: true
+ onPressed: {
+ tbtClientStatePopUp.show();
+ }
+ onUnpressed: {
+ tbtClientStatePopUp.hide();
+ }
+ }
+
+ PushButton {
+ label: "Exit application"
+ onClicked: {
+ if (dataContainer.applicationContext) {
+ sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId)
+ }
+ }
+ }
+
+ PushButton {
+ id: exitAllAppsButton
+ label: "Exit all apps"
+ toggleMode: true
+ onPressed: {
+ exitAllApplicationsPopup.show()
+
+ }
+ onUnpressed: {
+ exitAllApplicationsPopup.hide()
+ }
+ Connections {
+ target: exitAllApplicationsPopup
+ onVisibleChanged: {
+ if (!exitAllApplicationsPopup.visible) {
+ exitAllAppsButton.state = "unpressed"
+ }
+ }
+ }
+ }
+
+ CheckBox {
+ color: Constants.panelTextColor
+ text: "Use URL"
+ }
+
+ CheckBox {
+ color: Constants.panelTextColor
+ text: "DD"
+
+ onClicked: {
+ if (checked) {
+ dataContainer.driverDistractionState =
+ Common.DriverDistractionState.DD_ON;
+ } else {
+ dataContainer.driverDistractionState =
+ Common.DriverDistractionState.DD_OFF;
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ id: globalProperties
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: listGlobalProperties.height + Constants.panelPadding
+ border.color: Constants.panelTextColor
+ border.width: 1
+ color: Constants.panelColor
+ Column {
+ id: listGlobalProperties
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.panelPadding / 4
+ Text {
+ text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt
+ color: Constants.panelTextColor
+ }
+ Text {
+ text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt
+ color: Constants.panelTextColor
+ }
+ Text {
+ text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet
+ color: Constants.panelTextColor
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml
new file mode 100644
index 0000000000..14dd211303
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml
@@ -0,0 +1,46 @@
+/**
+ * @file SiriusPlayerView.qml
+ * @brief Sirius player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../controls"
+
+GeneralView {
+ RadioPlayer {
+ id: siriusRadioPlayer
+ anchors.fill: parent
+ radioType: ""
+ radioName: "Sirius"
+
+ playerState: dataContainer.siriusPlayerState
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml
new file mode 100644
index 0000000000..630113334e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml
@@ -0,0 +1,201 @@
+/**
+ * @file TurnByTurnView.qml
+ * @brief View for TurnByTurn.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models"
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ id: turnByTurnView
+ anchors.fill: parent
+
+ Item {
+ // top 3/4 of screen
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height * 3/4
+
+ Item {
+ // row of oval buttons
+ id: ovalButtonsRow
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ id: buttonsRow
+ width: parent.width
+ spacing: (width - 4 * elementWidth) / 3
+ anchors.verticalCenter: parent.verticalCenter
+ snapTo: Constants.ovalButtonWidth + spacing
+ elementWidth: Constants.ovalButtonWidth
+
+ OvalButton {
+ id: turnListButton
+ text: "TurnList"
+ onClicked: {
+ console.log("Go to TurnListView");
+ contentLoader.go("./views/TurnListView.qml");
+ }
+ }
+
+ Repeater {
+ model: dataContainer.navigationModel.softButtons ?
+ dataContainer.navigationModel.softButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.navigationModel.appId
+ button: dataContainer.navigationModel.softButtons.get(index)
+ }
+ }
+ }
+ }
+
+ Column {
+ // Picture + text information + media clock
+ id: mediaContent
+ width: parent.width
+ height: 3/4 * parent.height
+ anchors.left: parent.left
+ anchors.top: ovalButtonsRow.bottom
+
+ Row {
+ // picture + text info
+ width: parent.width
+ height: 3/4 * parent.height
+ spacing: Constants.margin
+
+ Image {
+ id: image
+ height: parent.height
+ width: height
+ source: dataContainer.navigationModel.turnIcon
+ }
+
+ Column {
+ // text info
+ id: textInfo
+ height: parent.height
+ width: parent.width - image.width - parent.spacing
+ spacing: (height - 5 * navText1.height) / 4
+
+ Text {
+ id: navText1
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: dataContainer.navigationModel.text1
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.navigationModel.text1
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: dataContainer.navigationModel.text2
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.navigationModel.text2
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "Total distance: " + dataContainer.navigationModel.totalDistance
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.navigationModel.totalDistance
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "Time to destination: " + dataContainer.navigationModel.timeToDestination
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.navigationModel.timeToDestination
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "ETA: " + dataContainer.navigationModel.eta
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.navigationModel.eta
+ }
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 1/4 * parent.height
+ width: 2/3 * parent.width
+
+ Rectangle {
+ id: coveredDistance
+ anchors.verticalCenter: parent.verticalCenter
+ height: Constants.distanceBarHeight
+ width: dataContainer.navigationModel.distanceToManeuver / dataContainer.navigationModel.distanceToManeuverScale * parent.width
+ color: "white"
+ }
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ height: Constants.distanceBarHeight
+ width: parent.width - coveredDistance.width
+ color: Constants.primaryColor
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml
new file mode 100644
index 0000000000..91ff02ea02
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml
@@ -0,0 +1,103 @@
+/**
+ * @file TurnListView.qml
+ * @brief View for TurnByTurn list.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ width: parent.width
+ height: 3/4 * parent.height
+
+ Item {
+ id: sotfButtons
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ elementWidth: Constants.ovalButtonWidth
+ snapTo: elementWidth + spacing
+ spacing: (width - 4 * elementWidth) / 3
+
+ Repeater {
+ model: dataContainer.currentApplication.turnListSoftButtons ?
+ dataContainer.currentApplication.turnListSoftButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.turnListSoftButtons.get(index)
+ }
+ }
+ }
+ }
+
+ ScrollableListView {
+ id: scrollableList
+ anchors.top: sotfButtons.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 3/4 * parent.height
+
+ model: dataContainer.currentApplication.turnList
+
+ delegate:
+ ListItem {
+ width: scrollableList.width
+ height: Constants.iconItemListSize
+ text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText
+ fontSize: Constants.fontSize
+ icon: dataContainer.currentApplication.turnList.get(index).turnIcon
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ id: back
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml
new file mode 100644
index 0000000000..4b17b55c10
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml
@@ -0,0 +1,61 @@
+/**
+ * @file UsbPlayerView.qml
+ * @brief USB player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 1.1
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: usbPlayer
+ playerName: "USB"
+ anchors.fill: parent
+ playerState: dataContainer.usbPlayerState
+ image: playerState.albumImage
+
+ buttons: [
+ OvalButton {
+ text: usbPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml
new file mode 100644
index 0000000000..e096cb80d1
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml
@@ -0,0 +1,135 @@
+/**
+ * @file WarningInfo.qml
+ * @brief Screen with warning information.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 1.1
+import "../controls"
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: warningInfo
+ anchors.fill: parent
+ color: Constants.secondaryColor
+ Text {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ text: "WARNING!"
+ color: Constants.warningColor
+ font.pixelSize: Constants.titleFontSize
+ font.bold: true
+ style: Text.Raised
+ styleColor: "gray"
+ }
+
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.margin
+ height: 1/2 * parent.height
+ width: parent.width
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.WordWrap
+
+ text: "This application is intended to be used as a demonstrative aid only, "
+ + "while the vehicle is parked. Don't use it while driving. <br /><br />"
+ + "Use extreme caution when using any device that takes your attention off the road. "
+ + "Ford recommends against the use of any hand-held device while driving and that you comply "
+ + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle."
+ color: "white"
+ font.pixelSize: 25
+ font.bold: true
+ }
+
+ function showOkButton() {
+ okButtonAnimation.start()
+ }
+
+ Item {
+ id: ok
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ opacity: 0
+
+ SequentialAnimation
+ {
+ id: okButtonAnimation
+ // Decrease this value while debugging
+ PauseAnimation { duration: Constants.warningScreenDuration }
+ NumberAnimation {
+ target: ok
+ duration: Constants.animationDuration
+ property: "opacity"
+ from: 0; to: 1;
+ }
+ }
+
+ Image {
+ id: okButton
+ anchors.centerIn: parent
+ source: "../res/buttons/longest_oval_btn.png"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ text: "OK"
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/longest_oval_btn_pressed.png"
+ text.color = Constants.secondaryColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/longest_oval_btn.png"
+ text.color = Constants.primaryColor
+ }
+ onClicked: {
+ console.log("WarningInfo OkButton - on clicked enter");
+ warningInfo.visible = false
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt b/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt
new file mode 100644
index 0000000000..e6eeb9e525
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt
@@ -0,0 +1,87 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
+set(dbus_dir ${components_dir}/dbus)
+set(codegen_dir ${dbus_dir}/codegen)
+set(codegen ${codegen_dir}/make_qml_dbus_qml.py)
+set(parser ${codegen_dir}/ford_xml_parser.py)
+set(interfaces_dir ${components_dir}/interfaces)
+set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
+set(proxy_dir ${CMAKE_CURRENT_BINARY_DIR}/hmi_api)
+set(qml_dirs hmi_api controls models popups views)
+set(qml_files MainWindow.qml)
+
+add_custom_target(qml_auto ALL
+ COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${proxy_dir}
+ DEPENDS ${api_xml} ${codegen} ${parser}
+ COMMENT "Generating files:
+ ${proxy_dir}/BasicCommunicationProxy.qml
+ ${proxy_dir}/ButtonsProxy.qml
+ ${proxy_dir}/NavigationProxy.qml
+ ${proxy_dir}/TTSProxy.qml
+ ${proxy_dir}/UIProxy.qml
+ ${proxy_dir}/VehicleInfoProxy.qml
+ ${proxy_dir}/VRProxy.qml
+ from:
+ ${api_xml} ..."
+)
+
+add_custom_target(qml_copy_resources ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${CMAKE_CURRENT_BINARY_DIR}/res
+ COMMENT "Copying resources")
+
+if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+ foreach(qml_dir ${qml_dirs})
+ add_custom_target(qml_copy_${qml_dir} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${qml_dir}
+ COMMENT "Copying directory ${qml_dir}")
+ endforeach(qml_dir)
+
+ add_dependencies(qml_auto qml_copy_hmi_api)
+
+ foreach(qml_file ${qml_files})
+ add_custom_target(qml_copy_${qml_file} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${qml_file} ${CMAKE_CURRENT_BINARY_DIR}/${qml_file}
+ COMMENT "Copying file ${qml_file}")
+ endforeach(qml_file)
+endif()
+
+install(DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}/controls
+ ${CMAKE_CURRENT_BINARY_DIR}/hmi_api
+ ${CMAKE_CURRENT_BINARY_DIR}/models
+ ${CMAKE_CURRENT_BINARY_DIR}/popups
+ ${CMAKE_CURRENT_BINARY_DIR}/res
+ ${CMAKE_CURRENT_BINARY_DIR}/views
+ DESTINATION bin/hmi)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainWindow.qml DESTINATION bin/hmi)
diff --git a/src/components/qt_hmi/qml_model_qt5/MainWindow.qml b/src/components/qt_hmi/qml_model_qt5/MainWindow.qml
new file mode 100644
index 0000000000..59fed45707
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/MainWindow.qml
@@ -0,0 +1,462 @@
+/**
+ * @file MainWindow.qml
+ * @brief Implementation of main window.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtMultimedia 5.0
+import com.ford.sdl.hmi.dbus_adapter 1.0
+import com.ford.sdl.hmi.log4cxx 1.0
+import com.ford.sdl.hmi.named_pipe_notifier 1.0
+import "./controls"
+import "./views"
+import "./hmi_api" as HmiApi
+import "./models"
+import "./popups"
+import "hmi_api/Common.js" as Common
+import "./models/Constants.js" as Constants
+import "models/Internal.js" as Internal
+
+Rectangle {
+ width: 1280
+ height: 768
+ property string startQml: "./views/ApplicationListView.qml"
+ property int minWidth: Constants.mainScreenMinWidth
+ property int minHeight: Constants.mainScreenMiHeight
+ color: Constants.secondaryColor
+
+ DataStorage {
+ id: dataContainer
+
+ onSystemContextChanged: {
+ sdlUI.onSystemContext(systemContext, currentApplication.appId)
+ }
+
+ // Please note that applicationContext is changed only after setting currentApplication
+ onApplicationContextChanged: {
+ if (applicationContext) {
+ sdlBasicCommunication.onAppActivated(currentApplication.appId)
+ } else {
+ sdlBasicCommunication.onAppDeactivated(currentApplication.appId, contentLoader.item.category)
+ }
+ }
+ }
+
+ Audio {
+ id: beep
+ source: "res/initial.wav"
+ }
+
+ Audio {
+ id: stream
+
+ property real bufferProgress: 0.0
+ }
+
+ SettingsStorage {
+ id: settingsContainer
+ }
+
+ Item {
+ id: mainScreen
+ anchors.top: parent. top
+ anchors.left: parent.left
+ width: (parent.width - simulationScreen.width < minWidth) ?
+ minWidth : parent.width - simulationScreen.width
+ height: (parent.height - hardwareScreen.height < minHeight) ?
+ minHeight : parent.height - hardwareScreen.height
+ clip: true
+ visible: false
+
+ Item {
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: parent.height * 0.10
+ width: parent.width
+ HeaderMenu {}
+ }
+
+ Item {
+ height: parent.height * 0.90
+ width: parent.width
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Video {
+ id: player
+ anchors.fill: parent
+ visible: {
+ var naviString = new RegExp("SDLNavi\.qml")
+ return naviString.test(contentLoader.source);
+ }
+
+ NamedPipeNotifier {
+ id: notifier
+ onReadyRead: {
+ player.source = name
+ player.play()
+ }
+ }
+
+ Component.onCompleted: {
+ notifier.start()
+ }
+ onStopped: {
+ notifier.start()
+
+ }
+ function startStream(url) {
+ notifier.name = url
+ notifier.start()
+ }
+ }
+
+ Loader {
+ id: contentLoader
+ height: parent.height - Constants.margin
+ width: parent.width - 2 * Constants.margin
+ asynchronous: true
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.leftMargin: Constants.margin
+ anchors.rightMargin: Constants.margin
+ anchors.bottomMargin: Constants.margin
+
+
+ source:startQml
+ property var viewTransitionStack : []
+
+ function reset() {
+ viewTransitionStack = []
+ }
+
+ property string currentLocation
+ function go(path, appId) {
+ console.debug("enter:", path, ", appId:", appId)
+ if (path) {
+ if (currentLocation !== path) {
+ viewTransitionStack.push({ uri: source.toString(), applicationContext: false })
+ if (appId) {
+ dataContainer.setCurrentApplication(appId)
+ }
+ item.leaveScreen()
+ currentLocation = path
+ source = path
+ }
+ }
+ console.debug("exit")
+ }
+
+ function back() {
+ if (viewTransitionStack.length) {
+ item.leaveScreen()
+ source = viewTransitionStack.pop().uri
+ }
+ currentLocation = ""
+ }
+
+ onStatusChanged: {
+ if (status == Component.Ready) {
+ if (!dataContainer.activeAlert) {
+ dataContainer.applicationContext = item.applicationContext
+ }
+ else {
+ dataContainer.applicationSavedContext = item.applicationContext
+ }
+ if (viewTransitionStack && viewTransitionStack.length) {
+ viewTransitionStack[viewTransitionStack.length - 1].applicationContext = item.applicationContext
+ }
+ dataContainer.setSystemContext()
+ }
+ }
+ }
+ }
+
+ WarningInfo { id: warningInfo }
+
+ VRHelpPopup {
+ id: vrHelpPopup
+ popUpName: "UI.VrHelp"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ InteractionPopup {
+ id: interactionPopup
+ popUpName: "UI.PerformInteraction"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ SliderPopup {
+ id: sliderPopup
+ popUpName: "UI.Slider"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ PerformAudioPassThruPopup {
+ id: performAudioPassThruPopup
+ popUpName: "UI.PerformAudioPassThru"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ AlertWindow {
+ id: alertWindow
+ popUpName: "UI.Alert"
+ objectName: "AlertWindow"
+ anchors.fill: parent
+ visible: false
+ }
+
+ UserActionPopUp {
+ id: userActionPopUp
+ popUpName: "ActionPopUp"
+ objectName: "ActionPopUp"
+ anchors.fill: parent
+ visible: false
+ }
+
+ OnAppPermissionConsentPopUp {
+ id: onAppPermissionConsentPopUp
+ popUpName: "onAppPermissionConsent"
+ objectName: "onAppPermissionConsent"
+ anchors.fill: parent
+ visible: false
+ }
+ }
+
+ Item {
+ id: simulationScreen
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.left: mainScreen.right
+ width: simulationPanel.width
+ clip: true
+ SimulationView {
+ id: simulationPanel
+
+ VRPopUp {
+ id: vrPopUp
+ visible: false
+ anchors.fill: parent
+ }
+
+ TTSPopUp {
+ id: ttsPopUp
+ anchors.top: parent.top
+ anchors.right: parent.right
+ visible: false
+ }
+ }
+ }
+
+ Item {
+ id: hardwareScreen
+ anchors.top: mainScreen.bottom
+ anchors.left: parent.left
+ anchors.right: simulationScreen.left
+ height: hardwarePanel.height
+ clip: true
+ HardwareButtonsView { id: hardwarePanel }
+ }
+
+ HMIAdapter {
+ HmiApi.ButtonsProxy {
+ id: sdlButtons
+ objectName: "Buttons"
+ }
+ HmiApi.BasicCommunicationProxy {
+ id: sdlBasicCommunication
+ objectName: "BasicCommunication"
+ }
+ HmiApi.VRProxy {
+ id: sdlVR
+ objectName: "VR"
+ }
+ HmiApi.TTSProxy {
+ id: sdlTTS
+ objectName: "TTS"
+ }
+ HmiApi.NavigationProxy {
+ id: sdlNavigation
+ objectName: "Navigation"
+ }
+ HmiApi.VehicleInfoProxy {
+ id: sdlVehicleInfo
+ objectName: "VehicleInfo"
+ }
+ HmiApi.UIProxy {
+ id: sdlUI
+ objectName: "UI"
+ }
+
+ HmiApi.SDLProxy {
+ id: sdlSDL
+ objectName: "SDL"
+ }
+ }
+
+ SDLAdapter {
+ id: sdlProxy
+
+ onOnResumeAudioSource: {
+
+ }
+
+ onOnFileRemoved: {
+
+ }
+
+ onOnAppRegistered: {
+ console.debug("enter onAppRegistered")
+ var appTypeToAdd = 0
+ if (application.appType !== undefined) {
+ for (var index in application.appType) {
+ if (application.appType[index] > 31) {
+ return { __retCode: Common.Result.GENERIC_ERROR, __message: "Apptype value > 31" }
+ }
+ appTypeToAdd |= 1 << application.appType[index]
+ }
+ }
+
+ dataContainer.addApplication(
+ {
+ appName: application.appName,
+ ngnMediaScreenAppName: application.ngnMediaScreenAppName,
+ icon: application.icon,
+ deviceName: application.deviceName,
+ appId: application.appID,
+ hmiDisplayLanguageDesired: application.hmiDisplayLanguageDesired,
+ isMediaApplication: application.isMediaApplication,
+ appType: appTypeToAdd,
+ hmiUIText: { },
+ mediaClock: {
+ "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
+ "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
+ "startTime": -1,
+ "endTime": -1,
+ "startTimeForProgress": -1
+ }
+ });
+ console.debug("exit onAppRegistered")
+ }
+
+ onOnAppUnregistered: {
+ console.debug("enter onAppUnregistered")
+ if ((dataContainer.currentApplication.appId === appID)) {
+ if (dataContainer.applicationContext) {
+ contentLoader.go("views/ApplicationListView.qml");
+ }
+ if (contentLoader.viewTransitionStack.filter(function(x) { return x.applicationContext })) {
+ contentLoader.reset();
+ }
+ dataContainer.currentApplication.reset()
+ }
+ dataContainer.removeApplication(appID);
+ console.debug("exit onAppUnregistered")
+ }
+
+ onPlayTone: {
+ beep.play()
+ }
+
+ onOnSDLClose: {
+
+ }
+
+ onOnPutFile: {
+ console.log("OnPutFile: ", offset, length, fileSize, FileName,
+ syncFileName, fileType, persistentFile);
+ }
+
+ onOnRecordStart: {
+
+ }
+
+ onOnAppPermissionChanged: {
+
+ }
+
+
+ onOnSDLConsentNeeded: {
+
+ }
+
+ onOnStatusUpdate: {
+ console.log("enter onStatusUpdate")
+ settingsContainer.updateStatus(status);
+ }
+ }
+
+ Component.onCompleted: {
+ dataContainer.hmiVRAvailable = true
+ dataContainer.hmiTTSAvailable = true
+ dataContainer.hmiNavigationAvailable = true
+ dataContainer.hmiVehicleInfoAvailable = true
+ dataContainer.hmiUIAvailable = true
+
+ sdlBasicCommunication.onReady()
+ }
+
+ /*
+ * Test Support Section
+ *
+ */
+ function getSlider(){
+ return sliderPopup
+ }
+
+ function getDataStorage(){
+ return dataContainer
+ }
+
+ function getUIProxy(){
+ return sdlUI
+ }
+
+ function getMainScreen(){
+ return mainScreen
+ }
+
+ function getContentLoader(){
+ return contentLoader
+ }
+
+ function getWarningInfo(){
+ return warningInfo
+ }
+ /*
+ * Test Support Section End
+ */
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml b/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml
new file mode 100644
index 0000000000..58cba17707
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml
@@ -0,0 +1,68 @@
+/**
+ * @file ArrowKeys.qml
+ * @brief Keys with arrow for cursor movement.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+Item {
+ width: buttonOk.width
+ height: buttonOk.height
+
+ HardwareButton {
+ id: arrowUp
+ buttonId: Common.ButtonName.TUNEUP
+ name: "Up"
+ }
+ HardwareButton {
+ id: arrowDown
+ buttonId: Common.ButtonName.TUNEDOWN
+ name: "Down"
+ }
+ HardwareButton {
+ id: arrowLeft
+ buttonId: Common.ButtonName.SEEKLEFT
+ name: "Left"
+ }
+ HardwareButton {
+ id: arrowRight
+ buttonId: Common.ButtonName.SEEKRIGHT
+ name: "Right"
+ }
+ HardwareButton {
+ id: buttonOk
+ buttonId: Common.ButtonName.OK
+ name: "Ok"
+ longPressAvailable: false
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml
new file mode 100644
index 0000000000..5d82f15592
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml
@@ -0,0 +1,48 @@
+/**
+ * @file BackButton.qml
+ * @brief Button "Back" that return to previous menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+OvalButton {
+ text: "Back"
+ onClicked: { contentLoader.back() }
+ fontSize: Constants.fontSize
+ opacity: 0
+
+ NumberAnimation on opacity {
+ to: 1;
+ duration: Constants.animationDuration
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml
new file mode 100644
index 0000000000..f0755b3980
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml
@@ -0,0 +1,87 @@
+/**
+ * @file CircleButton.qml
+ * @brief Parent class for circle button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Image {
+ id: circleBtn
+ source: imgOff
+ property alias text: btnText.text
+ property alias pixelSize: btnText.font.pixelSize
+ property string dest: ""
+ property bool isPressed: false
+ property string imgOff: "../res/buttons/round_btn.png"
+ property string imgOn: "../res/buttons/round_pressed_btn.png"
+ property string textColorOnPressed: Constants.secondaryColor
+ property string textColorDefault: Constants.primaryColor
+
+ signal clicked()
+ function wasClicked()
+ {
+ clicked()
+ }
+
+ Text {
+ anchors.centerIn: parent
+ id: btnText
+ color: textColorDefault
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ console.log("CircleButton onPressed enter");
+ source = imgOn
+ btnText.color = textColorOnPressed
+ isPressed = true
+ console.log("CircleButton onPressed exit");
+ }
+ onReleased: {
+ console.log("CircleButton onReleased enter");
+ source = imgOff
+ btnText.color = textColorDefault
+ isPressed = false
+ console.log("CircleButton onReleased exit");
+ }
+ onClicked: {
+ console.log("CircleButton onClicked enter");
+ if(dest !== ""){
+ contentLoader.go(dest)
+ }
+ circleBtn.wasClicked()
+ console.log("CircleButton onClicked enter");
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml
new file mode 100644
index 0000000000..dc1231570a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml
@@ -0,0 +1,66 @@
+/**
+ * @file ClickableImage.qml
+ * @brief Clickable image item
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Image {
+ signal pressed ()
+ signal released ()
+ signal canceled ()
+ signal clicked()
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ parent.scale = Constants.pressedIconScale
+ parent.pressed()
+ }
+
+ onReleased: {
+ parent.scale = 1
+ parent.released()
+ }
+
+ onCanceled: {
+ parent.scale = 1
+ parent.canceled()
+ }
+
+ onClicked: {
+ parent.clicked()
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml
new file mode 100644
index 0000000000..c56e3dc13d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml
@@ -0,0 +1,77 @@
+/**
+ * @file ClickableText.qml
+ * @brief Clickable text item
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Text {
+ property string defaultColor
+ property string pressedColor
+ signal pressed ()
+ signal released ()
+ signal canceled ()
+ signal clicked ()
+
+ color: defaultColor
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ press()
+ parent.pressed()
+ }
+
+ onReleased: {
+ release()
+ parent.released()
+ }
+
+ onCanceled: {
+ release()
+ parent.canceled()
+ }
+
+ onClicked: {
+ parent.clicked()
+ }
+ }
+
+ function press () {
+ color = pressedColor
+ }
+
+ function release () {
+ color = defaultColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml
new file mode 100644
index 0000000000..9211ac1baf
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml
@@ -0,0 +1,93 @@
+/**
+ * @file ClimateControlBtn.qml
+ * @brief Round button, which is used at climat menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Item
+{
+ id: climateControlBtn
+ width: climateBtnImg.width
+ height: climateBtnImg.height
+ property string name: ""
+ property string txt: ""
+ state: "off"
+
+ Image {
+ id: climateBtnImg
+ source: climateControlBtn.state === "off" ? "../res/climate/climate_round_off_btn.png" : "../res/climate/climate_round_on_btn.png"
+
+ Image {
+ id: hoverImg
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ property string st: climateControlBtn.state === "off" ? "_off" : "_on"
+ source: climateControlBtn.name === "" ? "": "../res/climate/" + climateControlBtn.name + st + ".png"
+ }
+
+ Text {
+ id: hoverText
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ text: climateControlBtn.txt
+ font.pixelSize: Constants.fontSize
+ color: climateControlBtn.state === "off" ? Constants.primaryColor : Constants.secondaryColor
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if(climateControlBtn.state === "on") {
+ climateControlBtn.state = "off"
+ climateBtnImg.source = "../res/climate/climate_round_off_btn.png"
+ if(climateControlBtn.txt != "") {
+ hoverText.color = Constants.primaryColor
+ }
+ if(climateControlBtn.name != "") {
+ hoverImg.source = "../res/climate/" + climateControlBtn.name + "_off.png"
+ }
+ } else {
+ climateControlBtn.state = "on"
+ climateBtnImg.source = "../res/climate/climate_round_on_btn.png"
+ if(climateControlBtn.txt != "") {
+ hoverText.color = Constants.secondaryColor
+ }
+ if(climateControlBtn.name != "") {
+ hoverImg.source = "../res/climate/" + climateControlBtn.name + "_on.png"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml b/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml
new file mode 100644
index 0000000000..3695070dfd
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml
@@ -0,0 +1,125 @@
+/**
+ * @file GradientRectangle.qml
+ * @brief Rectangle with gradient.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+Rectangle {
+ property string firstColor: "grey"
+ property string secondColor: "#2E2E2E"
+ property alias fontSize: text.font.pixelSize
+ property alias text: text.text
+ property int customButtonID
+ property bool isCustomButton: false
+ property bool clickProcessed
+ signal pressed()
+ signal released()
+
+ radius: 5
+ border.color: "#D3D3D3"
+
+ Text {
+ id: text
+ anchors.fill: parent
+ font.pixelSize: Constants.titleFontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ firstColor = "#2E2E2E"
+ secondColor = "grey"
+ parent.pressed()
+ }
+ onReleased: {
+ firstColor = "grey"
+ secondColor = "#2E2E2E"
+ parent.released()
+ }
+ }
+
+ Timer {
+ id: timer
+ interval: Constants.customButtonTimer
+ repeat: false
+ triggeredOnStart: false
+ }
+
+ onPressed: {
+ if (isCustomButton) {
+ timer.start()
+ clickProcessed = false
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, customButtonID)
+ }
+ }
+
+ onReleased: {
+ if (isCustomButton) {
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, customButtonID)
+ timer.stop()
+ if (!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, customButtonID)
+ }
+ }
+ }
+
+ Connections {
+ target: timer
+ onTriggered: {
+ if (isCustomButton) {
+ if(!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, customButtonID)
+ clickProcessed = true
+ }
+ }
+ }
+ }
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.1
+ color: firstColor
+ }
+ GradientStop {
+ position: 0.5
+ color: secondColor
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml b/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml
new file mode 100644
index 0000000000..39e1f0d7c4
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml
@@ -0,0 +1,53 @@
+/**
+ * @file GridItem.qml
+ * @brief Item with animation for GridMenu
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Item {
+ id: item
+ opacity: 0
+ SequentialAnimation {
+ id: animation
+ PauseAnimation {duration: index * 100 }
+ NumberAnimation {
+ target: item
+ duration: Constants.animationDuration
+ property: "opacity"
+ from: 0; to: 1;
+ }
+ }
+ Component.onCompleted: {
+ animation.start()
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml
new file mode 100644
index 0000000000..47f034082e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml
@@ -0,0 +1,108 @@
+/**
+ * @file HardwareButton.qml
+ * @brief Parent class for hardware button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+import "../hmi_api/Common.js" as Common
+
+MaskedContainer {
+ property string name
+ property int buttonId: Common.ButtonName.CUSTOM_BUTTON
+ property bool upDownAvailable: true
+ property bool shortPressAvailable: true
+ property bool longPressAvailable: true
+
+ signal hold
+
+ Image {
+ source: "../res/controlButtons/" + name + "Button.png"
+ }
+ Image {
+ id: pressedImg
+ source: "../res/controlButtons/" + name + "Button_pressed.png"
+ visible: false
+ Behavior on opacity {
+ NumberAnimation { duration: 80 }
+ }
+ }
+ Timer {
+ id: timer
+ interval: 2000
+ repeat: false
+ triggeredOnStart: false
+ }
+ property bool clickProcessed
+ onPressed: {
+ clickProcessed = false
+ pressedImg.visible = true
+ timer.start()
+ if (upDownAvailable) {
+ sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+ }
+
+ onReleased: {
+ if (upDownAvailable) {
+ sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONUP, undefined)
+ }
+ timer.stop()
+ if (!clickProcessed && shortPressAvailable) {
+ sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.SHORT, undefined)
+ }
+ pressedImg.visible = false
+ }
+
+ Connections {
+ target: timer
+ onTriggered: {
+ if(!clickProcessed && longPressAvailable) {
+ sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.LONG, undefined)
+ clickProcessed = true
+ hold()
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ if (buttonId !== Common.ButtonName.CUSTOM_BUTTON) {
+ settingsContainer.buttonCapabilities.push(
+ {
+ name: buttonId,
+ upDownAvailable: upDownAvailable,
+ shortPressAvailable: shortPressAvailable,
+ longPressAvailable: longPressAvailable
+ });
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml b/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml
new file mode 100644
index 0000000000..26cfe9abe0
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml
@@ -0,0 +1,133 @@
+/**
+ * @file HeaderMenu.qml
+ * @brief Header menu view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Item {
+ id: headerMenu
+ anchors.fill: parent
+ Text {
+ anchors.leftMargin: Constants.margin
+ anchors.topMargin: Constants.margin
+ anchors.left: parent.left
+ anchors.verticalCenter: parent.verticalCenter
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ text: "75°"
+ }
+
+ Item {
+ width: menuText.width
+ height: parent.height
+ anchors.topMargin: Constants.margin
+ anchors.horizontalCenter: headerMenu.horizontalCenter
+ signal clicked ()
+
+ ClickableText {
+ id: menuLogo
+ anchors.horizontalCenter: menuText.horizontalCenter
+ anchors.bottom: parent.verticalCenter
+ text: "≡"
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.fontSize
+
+ onClicked: parent.clicked()
+ onPressed: menuText.press()
+ onReleased: menuText.release()
+ onCanceled: menuText.release()
+ }
+
+ ClickableText {
+ id: menuText
+ anchors.top: parent.verticalCenter
+ text: "MENU";
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.fontSize
+
+ onClicked: parent.clicked()
+ onPressed: menuLogo.press()
+ onReleased: menuLogo.release()
+ onCanceled: menuLogo.release()
+ }
+
+ onClicked: {
+ contentLoader.go("./views/MainMenuView.qml")
+ }
+ }
+
+ Row {
+ id: clock
+ height: childrenRect.height
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: Constants.margin
+ anchors.topMargin: Constants.margin
+ property date date: new Date()
+
+ Timer {
+ running: true
+ repeat: true
+ interval: 1000
+ onTriggered: {
+ clock.date = new Date();
+ }
+ }
+
+ Text {
+ text: Qt.formatTime(clock.date, "hh");
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize;
+ }
+
+ Item {
+ width: 10
+ height: parent.height
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: clock.date.getSeconds() % 2 ? ":" : ""
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize;
+ }
+ }
+
+ Text {
+ text: Qt.formatTime(clock.date, "mm");
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize;
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml b/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml
new file mode 100644
index 0000000000..2aa7019428
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml
@@ -0,0 +1,65 @@
+/**
+ * @file Navigation.qml
+ * @brief Icon.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+Item {
+ property var source
+
+ Image {
+ anchors.fill: parent
+ source: url(parent.source)
+
+ function image(turnIcon) {
+ if (turnIcon && turnIcon.imageType === Common.ImageType.STATIC) {
+ return turnIcon.value;
+ } else {
+ return "";
+ }
+ }
+
+ function url(turnIcon) {
+ if (turnIcon && turnIcon.imageType === Common.ImageType.DYNAMIC) {
+ return turnIcon.value;
+ } else {
+ return "";
+ }
+ }
+ }
+
+ function reset () {
+ source = undefined
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml b/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml
new file mode 100644
index 0000000000..6373237241
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml
@@ -0,0 +1,70 @@
+/**
+ * @file Entry.qml
+ * @brief Entry with icon and text for list.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: main
+ color: Constants.transparentColor
+
+ property alias text: label.text
+ property alias fontSize: label.font.pixelSize
+ property alias icon: image.source
+
+ Icon {
+ id: image
+ width: Constants.iconItemListSize
+ height: Constants.iconItemListSize
+ anchors.left: parent.left
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.verticalCenter: parent.verticalCenter
+ visible: source ? true : false
+ }
+ Text {
+ id: label
+ anchors.verticalCenter: parent.verticalCenter
+ height: image.height
+ width: parent.width - image.width
+ z: 50
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.fontSize
+ text: "Name Entry"
+ anchors.left: image.right
+ anchors.leftMargin: Constants.generalSpacing
+ anchors.verticalCenterOffset: 0
+ visible: text !== ""
+ color: Constants.primaryColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml
new file mode 100644
index 0000000000..a7f91dd397
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml
@@ -0,0 +1,64 @@
+/**
+ * @file MaskedButton.qml
+ * @brief Masked button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import com.ford.sdl.hmi.hw_buttons 1.0
+
+MaskedContainer {
+ property string name
+
+ Image {
+ id: icon
+ source: "../res/controlButtons/" + name + "Button.png"
+ }
+
+ onPressed: {
+ state = "pressed";
+ }
+
+ onReleased: {
+ state = "";
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: icon
+ source: "../res/controlButtons/" + name + "Button_pressed.png"
+ }
+ }
+
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml b/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml
new file mode 100644
index 0000000000..32626d292d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml
@@ -0,0 +1,103 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+MultiPointTouchArea {
+ property date created
+
+ minimumTouchPoints: 1
+ maximumTouchPoints: 10
+
+ MouseArea {
+ anchors.fill: parent
+
+ function mouseTouchEvent() {
+ var now = new Date()
+ var touchEvents = [
+ {
+ id: 0,
+ ts: [now.valueOf() - created.valueOf()],
+ c: [{x: mouseX, y: mouseY}]
+ }
+ ]
+ return touchEvents
+ }
+
+ onPressed: {
+ sdlUI.onTouchEvent(Common.TouchType.BEGIN, mouseTouchEvent())
+ }
+ onReleased: {
+ sdlUI.onTouchEvent(Common.TouchType.END, mouseTouchEvent())
+ }
+ onCanceled: {
+ sdlUI.onTouchEvent(Common.TouchType.END, mouseTouchEvent())
+ }
+ onPositionChanged: {
+ sdlUI.onTouchEvent(Common.TouchType.MOVE, mouseTouchEvent())
+ }
+ }
+
+ function touchEvents() {
+ var now = new Date()
+ var touchEvents = []
+ for (var i = 0; i < touchPoints.length; ++i) {
+ touchEvents.push(
+ {
+// pointId is guaranteed to be unique but is not guaranteed to fit in range
+// perhaps we will have to edit protocol xml
+ id: touchPoints[i].pointId,
+ ts: [now.valueOf() - created.valueOf()],
+ c: [{x: touchPoints[i].x, y: touchPoints[i].y}]
+ }
+ )
+ }
+ return touchEvents
+ }
+
+ onPressed: {
+ sdlUI.onTouchEvent(Common.TouchType.BEGIN, touchEvents())
+ }
+ onReleased: {
+ sdlUI.onTouchEvent(Common.TouchType.END, touchEvents())
+ }
+ onCanceled: {
+ sdlUI.onTouchEvent(Common.TouchType.END, touchEvents())
+ }
+ onUpdated: {
+ sdlUI.onTouchEvent(Common.TouchType.MOVE, touchEvents())
+ }
+ Component.onCompleted: {
+ created = new Date()
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml
new file mode 100644
index 0000000000..6d68a9096b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml
@@ -0,0 +1,246 @@
+/**
+ * @file OvalButton.qml
+ * @brief Oval button with flexible width.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import "../models/Constants.js" as Constants
+
+// Don't change constants. It break button
+// TODO (dchmerev@luxoft.com): make this comment more clear
+// todo (ykazakov): eliminate this problem and remove all such comments
+
+Item {
+ id: main
+ width: dynamic ? field.width + 2 * left.width : Constants.ovalButtonWidth
+ height: Constants.ovalButtonHeight
+
+ signal clicked;
+ signal pressed;
+ signal released;
+ signal pressAndHold;
+ property alias text: label.text
+ property alias fontSize: label.font.pixelSize
+ property alias icon: image.source
+ property bool highlighted: false
+ property bool dynamic: false
+ property bool disabled: false
+
+ function hue() {
+ var ret = 0;
+ if (disabled) {
+ ret = Constants.disabledButtonHue;
+ } else if (highlighted) {
+ ret = Constants.highlightedButtonHue;
+ }
+ return ret;
+ }
+
+ function saturation() {
+ var ret = 0;
+ if (disabled) {
+ ret = Constants.disabledButtonSaturation;
+ } else if (highlighted) {
+ ret = Constants.highlightedButtonSaturation;
+ }
+ return ret;
+ }
+
+ function lightness() {
+ var ret = 0;
+ if (disabled) {
+ ret = Constants.disabledButtonLightness;
+ } else if (highlighted) {
+ ret = Constants.highlightedButtonLightness;
+ }
+ return ret;
+ }
+
+ Item {
+ id: buttonBorderImage
+ visible: false
+ anchors.fill: parent
+ Image {
+ id: left
+ width: 31
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ anchors.top: parent.top
+ source: "../res/buttons/oval_btn_left.png"
+ }
+
+ Image {
+ id: right
+ width: 31
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ source: "../res/buttons/oval_btn_right.png"
+ }
+
+ Image {
+ id: top
+ height: 10
+ anchors.right: parent.right
+ anchors.rightMargin: 31
+ anchors.left: parent.left
+ anchors.leftMargin: 31
+ anchors.top: parent.top
+ fillMode: Image.TileHorizontally
+ source: "../res/buttons/oval_btn_top.png"
+ }
+
+ Image {
+ id: bottom
+ height: 11
+ anchors.right: parent.right
+ anchors.rightMargin: 31
+ anchors.left: parent.left
+ anchors.leftMargin: 31
+ anchors.bottom: parent.bottom
+ fillMode: Image.TileHorizontally
+ source: "../res/buttons/oval_btn_bottom.png"
+ }
+ }
+
+ HueSaturation {
+ anchors.fill: buttonBorderImage
+ source: buttonBorderImage
+ hue: main.hue()
+ saturation: main.saturation()
+ lightness: main.lightness()
+ }
+
+ Rectangle {
+ id: background
+ color: Constants.transparentColor
+ anchors.fill: parent
+ anchors.rightMargin: 31
+ anchors.leftMargin: 31
+ anchors.bottomMargin: 10
+ anchors.topMargin: 10
+ visible: false
+ }
+
+ HueSaturation {
+ anchors.fill: background
+ source: background
+ hue: main.hue()
+ saturation: main.saturation()
+ lightness: main.lightness()
+ }
+
+ MouseArea {
+ id: mousearea
+ anchors.rightMargin: 15
+ anchors.leftMargin: 15
+ anchors.bottomMargin: 11
+ anchors.topMargin: 10
+ anchors.fill: parent
+ enabled: !parent.disabled
+ onPressed: {
+ parent.state = "pressed";
+ parent.pressed();
+ }
+ onReleased: {
+ parent.state = "";
+ parent.released();
+ }
+ onClicked: {
+ parent.clicked();
+ }
+ onPressAndHold: {
+ parent.pressAndHold();
+ }
+ onCanceled: {
+ parent.state = "";
+ }
+ }
+
+ Item {
+ id: field
+ anchors.fill: background
+
+ Icon {
+ id: image
+ width: Constants.iconButtonSize
+ height: Constants.iconButtonSize
+ anchors.verticalCenter: parent.verticalCenter
+ visible: source ? true : false
+ }
+ Text {
+ id: label
+ width: image.visible ? parent.width - image.width : parent.width
+ color: Constants.primaryColor
+ anchors.centerIn: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: Constants.ovalButtonFontSize
+ visible: false
+ elide: Text.ElideRight
+ }
+ HueSaturation {
+ anchors.fill: label
+ source: label
+ hue: main.hue()
+ saturation: main.saturation()
+ lightness: main.lightness()
+ visible: label.text !== ""
+ }
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: left
+ source: "../res/buttons/oval_btn_pressed_left.png"
+ }
+
+ PropertyChanges {
+ target: right
+ source: "../res/buttons/oval_btn_pressed_right.png"
+ }
+
+ PropertyChanges {
+ target: background
+ color: Constants.primaryColor
+ }
+
+ PropertyChanges {
+ target: label
+ color: Constants.secondaryColor
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml b/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml
new file mode 100644
index 0000000000..5b150d560d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml
@@ -0,0 +1,105 @@
+/**
+ * @file PagedFlickable.qml
+ * @brief Animated row.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Item
+{
+ id: flickablePage
+ height: container.height + pager.height
+ default property alias content: containerRow.children
+ property alias spacing: containerRow.spacing
+ property int elementWidth
+ property int snapTo
+ property int count: 0
+
+ Flickable {
+ id: container
+ anchors.bottom: parent.bottom
+ maximumFlickVelocity: 1500
+ contentWidth: containerRow.width
+ height: containerRow.height
+ width: parent.width
+ interactive: contentWidth > width
+
+ onMovementEnded: {
+ var rest = contentX % snapTo
+ var t = 0.25
+ if (rest > parent.snapTo / 2) {
+ rest = rest - parent.snapTo
+ }
+ var vel = 2 * rest / t
+ flickDeceleration = Math.abs(vel) / t
+ flick(vel, 0)
+ flickDeceleration = 1500
+ }
+ Row {
+ id: containerRow
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Pager {
+ id: pager
+ space: 7
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+
+ pages: {
+ if ( (container.contentWidth % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
+ return Math.ceil(container.contentWidth / container.width)
+ }
+ else {
+ return Math.floor(container.contentWidth / container.width)
+ }
+ }
+
+ activePage: {
+ if (container.contentX <= 0) {
+ return 0
+ }
+ else if ( (container.contentWidth - container.contentX) < container.width) {
+ return pages -1
+ }
+ else {
+ if ( (container.contentX % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
+ return Math.ceil(container.contentX / container.width)
+ }
+ else if ( (container.contentX % container.width) > 0) {
+ return Math.floor(container.contentX / container.width)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml b/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml
new file mode 100644
index 0000000000..53d99436ce
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml
@@ -0,0 +1,53 @@
+/**
+ * @file Pager.qml
+ * @brief Bubbles that indicate about page switch.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Row {
+ id: pager
+ property int pages
+ property int activePage: 0
+ property int space
+ property int itemsInRowOnScreen: 3
+
+ spacing: space
+ visible: pages !== 1
+
+ Repeater {
+ model: pages
+ Image {
+ source: index === activePage ? "../res/white_ball.png" : "../res/blue_ball.png"
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml
new file mode 100644
index 0000000000..bb1cb38388
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml
@@ -0,0 +1,77 @@
+/**
+ * @file PlayPauseButton.qml
+ * @brief Behavior of Play/Pause button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Image {
+ id: playPauseButton
+ property string sourceOnPressed: ""
+ property string sourceOnReleased: ""
+
+ signal clicked
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ playPauseButton.source = playPauseButton.sourceOnPressed
+ }
+ onReleased: {
+ playPauseButton.source = playPauseButton.sourceOnReleased
+ }
+ onClicked: {
+ playPauseButton.clicked()
+ }
+ }
+ states: [
+ State {
+ name: "Play"
+ PropertyChanges {
+ target: playPauseButton
+ source: "../res/buttons/player_play_btn.png"
+ sourceOnPressed: "../res/buttons/player_play_pressed_btn.png"
+ sourceOnReleased: "../res/buttons/player_pause_btn.png"
+ }
+ },
+
+ State {
+ name: "Pause"
+ PropertyChanges {
+ target: playPauseButton
+ source: "../res/buttons/player_pause_btn.png"
+ sourceOnPressed: "../res/buttons/player_pause_pressed_btn.png"
+ sourceOnReleased: "../res/buttons/player_play_btn.png"
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml
new file mode 100644
index 0000000000..95a751c39b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml
@@ -0,0 +1,75 @@
+/**
+ * @file PowerSwitchBtn.qml
+ * @brief On/Off button.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: powerSwitchBtn
+ state: "Turn ON"
+ width: 120
+ height: 80
+ radius: 5
+ property bool pressed;
+
+ gradient: Gradient {
+ GradientStop { position: pressed ? 1.0 : 0.0; color: "#2c2c2c" }
+ GradientStop { position: pressed ? 0.0 : 1.0; color: "black" }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.pressed = true
+ }
+ onReleased: {
+ parent.pressed = false
+ parent.state = parent.state === "Turn ON" ? "Turn OFF" : "Turn ON"
+ btnText.text = parent.state
+ if (parent.state === "Turn OFF") {
+ contentLoader.reset()
+ mainScreen.visible = true
+ warningInfo.showOkButton()
+ }
+ }
+ }
+
+ Text {
+ id: btnText
+ color: "red"
+ text: parent.state
+ anchors.centerIn: parent
+ font.pixelSize: Constants.powerButtonFornSize
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml b/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml
new file mode 100644
index 0000000000..32e74d71bb
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml
@@ -0,0 +1,106 @@
+/**
+ * @file PresetRow.qml
+ * @brief Animated row with radio stations.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Item {
+ id: presetRow
+ height: childrenRect.height
+ property variant presets: []
+ property int selectedIndex: 0
+ signal presetSelected
+ signal presetButtonPressed()
+ signal presetButtonReleased()
+ signal presetButtonClicked()
+ signal presetButtonHold()
+
+ Image {
+ id: circleButton
+ source: "../res/buttons/preset_pressed_btn.png"
+ visible: false
+ enabled: false
+ }
+
+ PagedFlickable {
+ width: parent.width
+ spacing: (width - (circleButton.width * 4)) / 3
+ snapTo: spacing + circleButton.width
+ elementWidth: circleButton.width
+
+ Repeater {
+ model: presetRow.presets.length
+ delegate:
+ Column {
+ width: circleButton.width
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ source: presetRow.selectedIndex === index ? "../res/buttons/preset_pressed_btn.png" : "../res/buttons/preset_btn.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ presetRow.selectedIndex = index;
+ presetButtonPressed()
+ }
+ onReleased: {
+ presetRow.selectedIndex = index;
+ presetButtonReleased()
+ }
+ onClicked: {
+ presetRow.selectedIndex = index
+ presetButtonClicked()
+ }
+ onPressAndHold: {
+ presetRow.selectedIndex = index;
+ presetButtonHold()
+ }
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ text: index + 1
+ font.pixelSize: Constants.fontSize
+ color: presetRow.selectedIndex === index ? Constants.secondaryColor : Constants.primaryColor
+ }
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: presetRow.presets[index]
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml
new file mode 100644
index 0000000000..f83370a207
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml
@@ -0,0 +1,136 @@
+/**
+ * @file PushButton.qml
+ * @brief Simple button
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Rectangle {
+ id: toggleButton
+ width: 160
+ height: 40
+ radius: 2
+ border.width: 2
+ border.color: "#000000"
+ gradient: grUnpressed
+
+ property alias label : label.text
+
+ signal pressed()
+ signal unpressed()
+ signal clicked()
+
+ property bool toggleMode: false
+
+ state: "unpressed"
+ onStateChanged: {
+ if (state == "pressed") {
+ pressed();
+ } else {
+ unpressed();
+ }
+ }
+
+ Text {
+ id: label
+ color: "white"
+ text: "PushButton"
+ font.pixelSize: 18
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.fill: parent
+ }
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onPressed: {
+ if (toggleMode) {
+ if (parent.state == "unpressed") {
+ parent.state = "pressed"
+ } else {
+ parent.state = "unpressed"
+ }
+ } else {
+ parent.state = "pressed"
+ }
+ }
+ onReleased: {
+ if (!toggleMode) {
+ parent.state = "unpressed"
+ if (mouse.isClick) {
+ parent.clicked()
+ }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "pressed"
+ PropertyChanges {
+ target: toggleButton
+ gradient: grPressed
+ }
+ },
+ State {
+ name: "unpressed"
+ PropertyChanges {
+ target: toggleButton
+ gradient: grUnpressed
+ }
+ }
+ ]
+
+ Gradient {
+ id: grUnpressed
+
+ GradientStop { position: 0.0; color: "#2c2c2c" }
+ GradientStop { position: 1.0; color: "#0c0c0c" }
+ }
+
+ Gradient {
+ id: grPressed
+
+ GradientStop { position: 0.0; color: "black" }
+ GradientStop { position: 1.0; color: "black" }
+ }
+
+ transitions: [
+ Transition {
+ from: "unpressed"
+ to: "pressed"
+ reversible: true
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml b/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml
new file mode 100644
index 0000000000..a63960d16d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml
@@ -0,0 +1,49 @@
+/**
+ * @file ScrollableListView.qml
+ * @brief ListView with scrollbar on the right
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+ListView {
+ clip: true
+
+ Rectangle {
+ visible: parent.height < parent.contentHeight
+ anchors.right: parent.right
+ y: parent.visibleArea.yPosition * parent.height
+ width: Constants.scrollBarWidth
+ height: parent.visibleArea.heightRatio * parent.height
+ color: Constants.primaryColor
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js
new file mode 100644
index 0000000000..227f638366
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js
@@ -0,0 +1,39 @@
+/**
+ * @file SoftButton.js
+ * @brief Soft button view constants
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+.pragma library
+
+var Action = {
+ doOnClicked: 0,
+ doOnReleased: 1
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
new file mode 100644
index 0000000000..0f3cfd7140
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
@@ -0,0 +1,97 @@
+/**
+ * @file SoftButton.qml
+ * @brief Soft button view
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "SoftButton.js" as SoftButton
+
+OvalButton {
+ property var button
+ property int appId
+ visible: !!button
+
+ signal defaultAction;
+ signal stealFocus;
+ signal keepContext;
+
+ property int actionOrder: SoftButton.Action.doOnClicked
+
+ highlighted: button ? button.isHighlighted : false
+ onPressed: {
+ actionOrder = SoftButton.Action.doOnClicked
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID)
+ }
+
+ onReleased: {
+ if (actionOrder === SoftButton.Action.doOnReleased) {
+ switch (button.systemAction) {
+ case Common.SystemAction.DEFAULT_ACTION:
+ defaultAction();
+ break;
+ case Common.SystemAction.STEAL_FOCUS:
+ stealFocus();
+ break;
+ case Common.SystemAction.KEEP_CONTEXT:
+ keepContext();
+ break;
+ }
+ }
+
+ sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID)
+ }
+
+ onClicked: {
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID);
+ switch (button.systemAction) {
+ case Common.SystemAction.DEFAULT_ACTION:
+ defaultAction();
+ break;
+ case Common.SystemAction.STEAL_FOCUS:
+ stealFocus();
+ break;
+ case Common.SystemAction.KEEP_CONTEXT:
+ keepContext();
+ break;
+ }
+ }
+
+ onPressAndHold: {
+ actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
+ sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID);
+ }
+
+ onButtonChanged: {
+ icon = button && button.type !== Common.SoftButtonType.SBT_TEXT ? button.image : undefined;
+ text = button && button.type !== Common.SoftButtonType.SBT_IMAGE ? button.text : ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml b/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml
new file mode 100644
index 0000000000..c06ebc45e4
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml
@@ -0,0 +1,42 @@
+/**
+ * @file StatusBar.qml
+ * @brief Status bar that contains text string.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Text {
+ text: dataContainer.currentApplication.hmiUIText.statusBar
+ color: Constants.primaryColor
+ font.pixelSize: Constants.statusBarFontSize
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js b/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js
new file mode 100644
index 0000000000..ebc5bfa3ca
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js
@@ -0,0 +1,7 @@
+.pragma library
+
+var async_uid = 1;
+
+function AsyncCall() {
+ this.__async_uid = async_uid++;
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml
new file mode 100644
index 0000000000..ba066e628b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml
@@ -0,0 +1,187 @@
+/**
+ * @file BasicCommunication.qml
+ * @brief Implement of interface Basic Communication.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+Item {
+ function updateDeviceList (deviceList) {
+ var deviceListLog = "";
+ deviceList.forEach(function (device) {
+ deviceListLog += "{name: '" + device.name + "', " +
+ "id: '" + device.id + "'},";
+ });
+ console.log("Message Received - {method: 'BasicCommunication.UpdateDeviceList', params:{ " +
+ "deviceList: [" + deviceListLog + "]" +
+ "}}")
+
+ deviceList.forEach(function (device) {
+ var exist = false;
+ for (var i = 0; i < dataContainer.deviceList.count; ++i) {
+ exist = device.id === dataContainer.deviceList[i].devid;
+ }
+ if (!exist) {
+ dataContainer.deviceList.append({ name: device.name,
+ devid: device.id,
+ allowed: false})
+ }
+ });
+
+ for (var i = 0; i < dataContainer.deviceList.count; ++i) {
+ deviceList.forEach(function (device) {
+ var exist = dataContainer.deviceList[i].id === device.id;
+ if (!exist) {
+ dataContainer.deviceList.remove(i);
+ }
+ });
+ }
+ }
+
+ function updateAppList (applications) {
+ var applicationsLog = "",
+ appTypeLog = "";
+ if (applications) {
+ for (var i = 0; i < applications.length; i++) {
+ appTypeLog = "";
+
+ for (var j = 0; j < applications[i].appType.length; i++) {
+ appTypeLog += "'" + applications[i].appType + "', "
+ }
+
+ applicationsLog += "{name: '" + applications[i].name + "', " +
+ "appName: '" + applications[i].appName + "', " +
+ "ngnMediaScreenAppName: '" + applications[i].ngnMediaScreenAppName + "', " +
+ "icon: '" + applications[i].icon + "', " +
+ "deviceName: '" + applications[i].deviceName + "', " +
+ "appID: " + applications[i].appID + ", " +
+ "hmiDisplayLanguageDesired: '" + applications[i].hmiDisplayLanguageDesired + "', " +
+ "isMediaApplication: " + applications[i].isMediaApplication + ", " +
+ "appType: [" + applications[i].deviceName + "]" +
+ "},";
+ }
+ }
+ console.log("Message Received - {method: 'BasicCommunication.UpdateAppList', params:{ " +
+ "applications: [" + applicationsLog + "]" +
+ "}}")
+
+
+ dataContainer.applicationList.clear();
+ for(var i = 0; i < applications.length; i++) {
+ dataContainer.applicationList.append({
+ appName: applications[i].appName,
+ ngnMediaScreenAppName: applications[i].ngnMediaScreenAppName,
+ icon: applications[i].icon,
+ deviceName: applications[i].deviceName,
+ appId: applications[i].appID,
+ hmiDisplayLanguageDesired: applications[i].hmiDisplayLanguageDesired,
+ isMediaApplication: applications[i].isMediaApplication,
+ appType: applications[i].appType
+ });
+ }
+ }
+
+ function getResumeResult (appID) {
+ return dataContainer.getResumeResult(appID)
+ }
+
+ function allowDeviceToConnect (device) {
+ console.log("Message Received - {method: 'BasicCommunication.AllowDeviceToConnect', params:{ " +
+ "device: {name: '" + device.name + "', " +
+ "id: '" + device.id + "'}," +
+ "}}")
+ return {
+ allow: true
+ }
+ }
+
+ function mixingAudioSupported() {
+ console.log("Message Received - {method: 'BasicCommunication.MixingAudioSupported'}")
+ return {
+ attenuatedSupport: true
+ }
+ }
+
+ function allowAllApps() {
+ console.log("Message Received - {method: 'BasicCommunication.AllowAllApps'}")
+ return {
+ allowed: true
+ }
+ }
+
+ function allowApp(app, appPermissions) {
+ console.log("Message Received - {method: 'BasicCommunication.AllowApp'}")
+ return {
+ allowed: true
+ }
+ }
+
+ function activateApp(appID, priority, level) {
+ console.log("Message Received - {method: 'BasicCommunication.ActivateApp', params:{ " +
+ "appID: " + appID +
+ "}}")
+ contentLoader.go("views/SDLPlayerView.qml", appID);
+ }
+
+ function policyUpdate(file, timeout, retry) {
+ console.log("enter policyUpdate");
+ settingsContainer.filePTSnapshot = file;
+ settingsContainer.timeoutPTExchange = timeout;
+ settingsContainer.retriesPTExchange = retry;
+ var service = 7; // service type for Ford specific policy
+ RequestToSDL.SDL_GetURLS(service, settingsContainer.startPTExchange);
+ console.log("exit policyUpdate");
+ }
+
+ function systemRequest(requestType, fileName, appID) {
+ console.log("enter systemRequest", requestType, fileName, appID);
+
+ console.log(requestType, Common.RequestType.PROPRIETARY, Common.RequestType.HTTP);
+
+ switch (requestType) {
+ case Common.RequestType.PROPRIETARY: {
+ settingsContainer.stopPTExchange(fileName);
+ break;
+ }
+ case Common.RequestType.HTTP: {
+ if (fileName === "IVSU") {
+ settingsContainer.updateIVSU(appID);
+ } else {
+ settingsContainer.decrypt(fileName, appID);
+ }
+ break;
+ }
+ }
+ console.log("exit systemRequest");
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml
new file mode 100644
index 0000000000..b8b3da5932
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml
@@ -0,0 +1,48 @@
+/**
+ * @file Buttons.qml
+ * @brief Implement of interface Buttons.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+Item
+{
+ function getCapabilities() {
+ console.log("Message Received - {method: 'Buttons.GetCapabilities'}")
+ return {
+ capabilities: settingsContainer.buttonCapabilities,
+ presetBankCapabilities: {
+ onScreenPresetsAvailable: true
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml
new file mode 100644
index 0000000000..bab54220b1
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml
@@ -0,0 +1,246 @@
+/**
+ * @file Navigation.qml
+ * @brief Navigation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Common.js" as Common
+
+Item {
+ function isReady () {
+ console.log("Message Received - {method: 'Navigation.IsReady'}")
+ return {
+ available: dataContainer.hmiNavigationAvailable
+ }
+ }
+
+ function showConstantTBT(navigationTexts, turnIcon, nextTurnIcon, distanceToManeuver,
+ distanceToManeuverScale, maneuverComplete,
+ softButtons, appID) {
+ console.debug("enter")
+ var navigationTextsLog = "",
+ softButtonsLog = "",
+ turnIconLogs = "",
+ nextTurnIconLogs = "";
+ if (navigationTexts) {
+ for (var i = 0; i < navigationTexts.length; i++) {
+ navigationTextsLog += "{fieldName: '" + navigationTexts[i].fieldName + "', " +
+ "fieldText: '" + navigationTexts[i].fieldText + "'},";
+ }
+ }
+ if (softButtons) {
+ for (var i = 0; i < softButtons.length; i++) {
+ softButtonsLog += "{type: '" + softButtons[i].type + "', " +
+ "text: " + softButtons[i].text + "', ";
+ softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
+ softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
+ "softButtonID: " + softButtons[i].softButtonID + "', " +
+ "systemAction: " + softButtons[i].systemAction +
+ "},";
+ }
+ }
+ if (turnIcon) {
+ turnIconLogs = "{value: '" + turnIcon.value + "', imageType: " + turnIcon.imageType + "}";
+ }
+ if (nextTurnIcon) {
+ nextTurnIconLogs = "{value: '" + nextTurnIcon.value + "', imageType: " + nextTurnIcon.imageType + "}";
+ }
+ console.log("Message Received - {method: 'Navigation.ShowConstantTBT', params:{ " +
+ "navigationTexts: [" + navigationTextsLog + "], " +
+ "turnIcon: " + turnIconLogs + ", " +
+ "nextTurnIcon: " + nextTurnIconLogs + ", " +
+ "distanceToManeuver: " + distanceToManeuver + ", " +
+ "distanceToManeuverScale: " + distanceToManeuverScale + ", " +
+ "maneuverComplete: " + maneuverComplete + ", " +
+ "softButtons: [" + softButtonsLog + "], " +
+ "appID: " + appID +
+ "}}")
+
+ var app = dataContainer.getApplication(appID)
+ var dataToUpdate = {}
+
+ navigationTexts.forEach(fillTexts, dataToUpdate)
+ if (turnIcon !== undefined) { dataToUpdate.turnIcon = turnIcon }
+ if (nextTurnIcon !== undefined) { dataToUpdate.nextTurnIcon = nextTurnIcon }
+ if (distanceToManeuver !== undefined) {
+ dataToUpdate.distanceToManeuver = distanceToManeuver
+ } else {
+ DBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "distanceToManeuver absence"} )
+ }
+ if (distanceToManeuverScale !== undefined) {
+ dataToUpdate.distanceToManeuverScale = distanceToManeuverScale
+ } else {
+ DBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "distanceToManeuverScale absence"} )
+ }
+ if (maneuverComplete !== undefined) {
+ dataToUpdate.maneuverComplete = maneuverComplete
+ }
+ if (softButtons !== undefined) {
+ app.navigationSoftButtons.clear()
+ softButtons.forEach(function(x) { app.navigationSoftButtons.append(x); });
+ }
+ if (appID !== undefined) {
+ dataToUpdate.appID = appID
+ } else {
+ dBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "appID absence"} )
+ }
+
+ dataContainer.setApplicationProperties(appID, { navigationModel : dataToUpdate } )
+ contentLoader.go("./views/TurnByTurnView.qml", appID)
+ }
+
+ function alertManeuver(softButtons) {
+ console.debug("enter")
+ var softButtonsLog = "";
+
+ if (softButtons) {
+ for (var i = 0; i < softButtons.length; i++) {
+ softButtonsLog += "{type: '" + softButtons[i].type + "', " +
+ "text: " + softButtons[i].text + "', ";
+ softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
+ softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
+ "softButtonID: " + softButtons[i].softButtonID + "', " +
+ "systemAction: " + softButtons[i].systemAction +
+ "},";
+ }
+ }
+ console.log("Message Received - {method: 'Navigation.AlertManeuver', params:{ " +
+ "softButtons: [" + softButtonsLog + "]" +
+ "}}")
+
+ console.debug("exit")
+ return { __retCode: Common.Result.SUCCESS }
+ }
+
+ function updateTurnList(turnList, softButtons, appID) {
+ console.debug("enter")
+ var turnListLog = "",
+ softButtonsLog = "";
+ if (turnList) {
+ for (var i = 0; i < turnList.length; i++) {
+ turnList[i].navigationText ? turnListLog += "{navigationText: {fieldName: '" + turnList[i].navigationText.fieldName + "', fieldText: '" + turnList[i].navigationText.fieldText + "'}," : turnListLog += "{";
+ turnList[i].turnIcon ? turnListLog += "turnIcon: " + "{value: '" + turnList[i].turnIcon.value + "', imageType: " + turnList[i].turnIcon.imageType + "}}, " : turnListLog += "},";
+ }
+ }
+ if (softButtons) {
+ softButtonsLog += "{type: '" + softButtons[0].type + "', " +
+ "text: '" + softButtons[0].text + "', ";
+ softButtons[0].image ? softButtonsLog += "image: " + "{value: '" + softButtons[0].image.value + "', imageType: " + softButtons[0].image.imageType + "}, " : softButtonsLog += "";
+ softButtonsLog += "isHighlighted: " + softButtons[0].isHighlighted + "', " +
+ "softButtonID: " + softButtons[0].softButtonID + "', " +
+ "systemAction: " + softButtons[0].systemAction +
+ "},";
+ }
+ console.log("Message Received - {method: 'Navigation.UpdateTurnList', params:{ " +
+ "softButtons: [" + softButtonsLog + "], " +
+ "turnList: [" + turnListLog + "], " +
+ "appID: " + appID +
+ "}}")
+ if (turnList !== undefined) {
+ dataContainer.getApplication(appID).turnList.clear();
+ turnList.forEach(fillTurnList, dataContainer.getApplication(appID).turnList);
+ }
+ if (softButtons !== undefined) {
+ dataContainer.getApplication(appID).turnListSoftButtons.clear();
+ softButtons.forEach(fillSoftButtons, dataContainer.getApplication(appID).turnListSoftButtons);
+ }
+ dataContainer.navigationModel.appId = appID;
+ console.debug("exit")
+ }
+
+ function fillTexts(element, index, array) {
+ switch (element.fieldName) {
+ case Common.TextFieldName.navigationText1:
+ this.text1 = element.fieldText;
+ break;
+ case Common.TextFieldName.navigationText2:
+ this.text2 = element.fieldText;
+ break;
+ case Common.TextFieldName.ETA:
+ this.eta = element.fieldText;
+ break;
+ case Common.TextFieldName.totalDistance:
+ this.totalDistance = element.fieldText;
+ break;
+ case Common.TextFieldName.timeToDestination:
+ this.timeToDestination = element.fieldText;
+ break;
+ }
+ }
+
+ function startStream(url, appID) {
+ console.debug("enter")
+ player.startStream(url)
+ console.debug("exit")
+ }
+
+ function stopStream(appID) {
+ console.debug("enter")
+ player.stop()
+ console.debug("exit")
+ }
+
+ function startAudioStream(url, appID) {
+ console.log("Message Received - {method: 'Navigation.StartAudioStream', params:{ " +
+ "url: '" + url + "'" +
+ "appID: " + appID +
+ "}}")
+ stream.source = url;
+ stream.play();
+ }
+
+ function stopAudioStream(appID) {
+ console.log("Message Received - {method: 'Navigation.StopAudioStream', params:{ " +
+ "appID: " + appID +
+ "}}")
+ stream.stop();
+ }
+
+ function fillSoftButtons(element, index, array) {
+ this.append({
+ type: element.type,
+ text: element.text,
+ image: element.image,
+ isHighlighted: element.isHighlighted,
+ buttonId: element.softButtonID,
+ systemAction: element.systemAction
+ });
+ }
+
+ function fillTurnList(element, index, array) {
+ this.append({
+ navigationText: element.navigationText,
+ turnIcon: element.turnIcon
+ });
+ console.debug(element.navigationText)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml
new file mode 100644
index 0000000000..c16e1d7750
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Common.js" as Common
+import "Async.js" as Async
+
+Item {
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml
new file mode 100644
index 0000000000..7884b31097
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml
@@ -0,0 +1,203 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Common.js" as Common
+import "Async.js" as Async
+
+Item {
+ function ttsChunksToString(ttsChunks){
+ return ttsChunks.map(function(str) { return str.text }).join('\n')
+ }
+
+ function isReady() {
+ console.log("Message Received - {method: 'TTS.IsReady'}")
+ return {
+ available: dataContainer.hmiTTSAvailable
+ }
+ }
+
+ function speak(ttsChunks, appID) {
+ // appID unused
+ console.debug('enter:', ttsChunks, appID);
+ var ttsChunksLog = "";
+ if (ttsChunks) {
+ for (var i = 0; i < ttsChunks.length; i++) {
+ ttsChunksLog += "{type: " + ttsChunks[i].type + ", " +
+ "text: '" + ttsChunks[i].text + "'}, ";
+ }
+ }
+ console.log("Message Received - {method: 'TTS.Speak', params:{ " +
+ "ttsChunks: [" + ttsChunksLog + "], " +
+ "appID: " + appID + "', " +
+ "}}")
+ if (ttsPopUp.async) {
+ console.log('speak send abort');
+ throw Common.Result.ABORTED;
+ }
+ var message = ttsChunksToString(ttsChunks);
+ ttsPopUp.activate(message);
+ ttsPopUp.async = new Async.AsyncCall();
+ console.debug('exit');
+ return ttsPopUp.async;
+ }
+
+ function stopSpeaking() {
+ console.debug("enter");
+ console.log("Message Received - {method: 'TTS.StopSpeaking'}")
+ ttsPopUp.deactivate();
+ console.debug("exit");
+ }
+
+ function getLanguage() {
+ console.log("Message Received - {method: 'TTS.GetLanguage'}")
+ return {
+ language: dataContainer.hmiTTSVRLanguage
+ }
+ }
+
+ function getSupportedLanguages() {
+ console.log("Message Received - {method: 'TTS.GetSupportedLanguages'}")
+ return {
+ languages: settingsContainer.sdlLanguagesList
+ }
+ }
+
+ function getCapabilities() {
+ console.log("Message Received - {method: 'TTS.GetCapabilities'}")
+ return {
+ speechCapabilities: [
+ Common.SpeechCapabilities.SC_TEXT,
+ Common.SpeechCapabilities.PRE_RECORDED
+ ],
+ prerecordedSpeechCapabilities: [
+ Common.PrerecordedSpeech.HELP_JINGLE,
+ Common.PrerecordedSpeech.INITIAL_JINGLE,
+ Common.PrerecordedSpeech.LISTEN_JINGLE,
+ Common.PrerecordedSpeech.POSITIVE_JINGLE,
+ Common.PrerecordedSpeech.NEGATIVE_JINGLE
+ ]
+ }
+ }
+
+ function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout) {
+ console.debug("enter");
+ var helpttsChunksLog = "",
+ initialttsChunkLog = "",
+ timeoutttsChunkLog = "";
+
+ if (helpPrompt) {
+ for (var i = 0; i < helpPrompt.length; i++) {
+ helpttsChunksLog += "{type: " + helpPrompt[i].type + ", " +
+ "text: '" + helpPrompt[i].text + "'}, ";
+ }
+ }
+ if (initialPrompt) {
+ for (var i = 0; i < initialPrompt.length; i++) {
+ initialttsChunkLog += "{type: " + initialPrompt[i].type + ", " +
+ "text: '" + initialPrompt[i].text + "'}, ";
+ }
+ }
+ if (timeoutPrompt) {
+ for (var i = 0; i < timeoutPrompt.length; i++) {
+ timeoutttsChunkLog += "{type: " + timeoutPrompt[i].type + ", " +
+ "text: '" + timeoutPrompt[i].text + "'}, ";
+ }
+ }
+ console.log("Message Received - {method: 'TTS.PerformInteraction', params:{ " +
+ "helpPrompt: [" + helpttsChunksLog + "], " +
+ "initialPrompt: [" + initialttsChunkLog + "], " +
+ "timeoutPrompt: [" + timeoutttsChunkLog + "], " +
+ "timeout: " + timeout +
+ "}}")
+ ttsPopUp.performInteraction(ttsChunksToString(helpPrompt),
+ ttsChunksToString(initialPrompt),
+ ttsChunksToString(timeoutPrompt),
+ timeout)
+ console.debug("exit");
+ }
+
+ function changeRegistration(language, appID) {
+ console.debug("enter:", language, appID);
+ console.log("Message Received - {method: 'TTS.ChangeRegistration', params:{ " +
+ "language: " + language + ", " +
+ "appID: " + appID +
+ "}}")
+ dataContainer.changeRegistrationTTSVR(language, appID);
+ console.debug("exit");
+ }
+
+ function setGlobalProperties(helpPrompt, timeoutPrompt, appID) {
+ var helpPromptLog = "",
+ timeoutPromptLog = "";
+ if (helpPrompt) {
+ for (var i = 0; i < helpPrompt.length; i++) {
+ helpPromptLog += "{type: " + helpPrompt[i].type + ", " +
+ "text: '" + helpPrompt[i].text + "'}, ";
+ }
+ }
+ if (timeoutPrompt) {
+ for (var i = 0; i < timeoutPrompt.length; i++) {
+ timeoutPromptLog += "{type: " + timeoutPrompt[i].type + ", " +
+ "text: '" + timeoutPrompt[i].text + "'}, ";
+ }
+ }
+ console.log("Message Received - {method: 'TTS.SetGlobalProperties', params:{ " +
+ "appID:" + appID + ", " +
+ "helpPrompt: [" + helpPromptLog + "], " +
+ "timeoutPrompt: [" + timeoutPromptLog + "]" +
+ "}}")
+
+ var newHelpPropmt = helpPrompt ?
+ helpPrompt.map(
+ function (structure) {
+ return structure.text
+ }
+ ).join(", ") :
+ dataContainer.currentApplication.helpPrompt
+
+ var newTimeoutPrompt = timeoutPrompt ?
+ timeoutPrompt.map(
+ function (structure) {
+ return structure.text
+ }
+ ).join(", ") :
+ dataContainer.currentApplication.timeoutPrompt
+
+ dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
+ helpPrompt: newHelpPropmt,
+ timeoutPrompt: newTimeoutPrompt
+ })
+ console.debug("exit")
+ }
+}
+
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
new file mode 100644
index 0000000000..d89747c3c0
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
@@ -0,0 +1,725 @@
+/**
+ * @file UI.qml
+ * @brief UI interface implementation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Common.js" as Common
+import "Async.js" as Async
+import "../models/Internal.js" as Internal
+
+Item {
+ function filter (strings, fields) {
+ console.debug("enter")
+// substrings for each allowed field
+ var fieldSubstrings = {}
+// this cycle concatenates allowed lines sorting them by field
+ for (var stringIndex = 0; stringIndex < strings.length; ++stringIndex) {
+ for (var fieldIndex = 0; fieldIndex < fields.length; ++fieldIndex) {
+ var fieldName = strings[stringIndex].fieldName
+ if (fieldName === fields[fieldIndex]) {
+ if (fieldSubstrings[fieldName] !== undefined) {
+ fieldSubstrings[fieldName] += "\n";
+ fieldSubstrings[fieldName] += strings[stringIndex].fieldText
+ }
+ else {
+ fieldSubstrings[fieldName] = strings[stringIndex].fieldText
+ }
+ }
+ }
+ }
+ console.debug("exit")
+ return fieldSubstrings
+ }
+
+ function alert (alertStrings, duration, softButtons, progressIndicator, alertType, appID) {
+ var softButtonsLog = "",
+ alertStringsLog = "";
+ if (alertStrings) {
+ for (var i = 0; i < alertStrings.length; i++) {
+ alertStringsLog += "{fieldName: '" + alertStrings[i].fieldName + "', " +
+ "fieldText: '" + alertStrings[i].fieldText + "'},";
+ }
+ }
+ if (softButtons) {
+ for (var i = 0; i < softButtons.length; i++) {
+ softButtonsLog += "{type: '" + softButtons[i].type + "', " +
+ "text: " + softButtons[i].text + "', ";
+ softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
+ softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
+ "softButtonID: " + softButtons[i].softButtonID + "', " +
+ "systemAction: " + softButtons[i].systemAction +
+ "},";
+ }
+ }
+ console.log("Message Received - {method: 'UI.Alert', params:{ " +
+ "alertStrings: [" + alertStringsLog + "]," +
+ "duration: " + duration + "', " +
+ "softButtons: [" + softButtonsLog + "]," +
+ "progressIndicator: " + progressIndicator + "', " +
+ "appID: " + appID + "', " +
+ "}}")
+ var fieldSubstrings = alertStrings
+ .sort(function(a, b) { return a.fieldName - b.fieldName }) // sorting by fieldName
+ .map(function(val) { return val.fieldText }); // mapping to array of strings
+
+ var tryAgainTime = alertWindow.alert(fieldSubstrings, duration, softButtons, progressIndicator, alertType, appID)
+ if (tryAgainTime === undefined) {
+ alertWindow.async = new Async.AsyncCall();
+ return alertWindow.async;
+ }
+ else {
+ return {
+ "__retCode": Common.Result.REJECTED,
+ "tryAgainTime": tryAgainTime
+ }
+ }
+ }
+
+ function show (showStrings, alignment, graphic, secondaryGraphic, softButtons, customPresets, appID) {
+ var softButtonsLog = "",
+ showStringsLog = "",
+ customPresetsLog = "",
+ graphiLog = "",
+ secondaryGraphicLog = "";
+ if (showStrings) {
+ for (var i = 0; i < showStrings.length; i++) {
+ showStringsLog += "{fieldName: '" + showStrings[i].fieldName + "', " +
+ "fieldText: '" + showStrings[i].fieldText + "'},";
+ }
+ }
+ if (customPresets) {
+ for (var i = 0; i < customPresets.length; i++) {
+ customPresetsLog += "'" + customPresets[i] + "', ";
+ }
+ }
+ if (softButtons) {
+ for (var i = 0; i < softButtons.length; i++) {
+ softButtonsLog += "{type: '" + softButtons[i].type + "', " +
+ "text: " + softButtons[i].text + "', ";
+ softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
+ softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
+ "softButtonID: " + softButtons[i].softButtonID + "', " +
+ "systemAction: " + softButtons[i].systemAction +
+ "},";
+ }
+ }
+ if (graphic) {
+ graphiLog = "{value: '" + graphic.value + "', imageType: " + graphic.imageType + "}";
+ }
+ if (secondaryGraphic) {
+ secondaryGraphicLog = "{value: '" + secondaryGraphic.value + "', imageType: " + secondaryGraphic.imageType + "}";
+ }
+
+ console.log("Message Received - {method: 'UI.Show', params:{ " +
+ "showStrings: [" + showStringsLog + "], " +
+ "alignment: " + alignment + "', " +
+ "graphic: " + graphiLog + ", " +
+ "secondaryGraphic: " + secondaryGraphicLog+ ", " +
+ "softButtons: [" + softButtonsLog + "], " +
+ "customPresets: [" + customPresetsLog + "], " +
+ "appID: " + appID +
+ "}}")
+ var app = dataContainer.getApplication(appID);
+
+ app.softButtons.clear()
+ if (softButtons) {
+ softButtons.forEach(function(x) { app.softButtons.append(x); });
+ }
+
+ app.customPresets.clear()
+ if (customPresets) {
+ customPresets.forEach( function(x) { app.customPresets.append( {text: x} ); } )
+ }
+
+ var textAlignment
+ switch (alignment) {
+ case Common.TextAlignment.LEFT_ALIGNED:
+ textAlignment = Text.AlignLeft
+ break;
+ case Common.TextAlignment.RIGHT_ALIGNED:
+ textAlignment = Text.AlignRight
+ break;
+ case Common.TextAlignment.CENTERED:
+ textAlignment = Text.AlignHCenter
+ break;
+ default:
+ textAlignment = Text.AlignHCenter
+ break;
+ }
+
+ // with this array we grab only the lines we need
+ var showFields = [
+ Common.TextFieldName.mainField1,
+ Common.TextFieldName.mainField2,
+ Common.TextFieldName.mainField3,
+ Common.TextFieldName.mainField4,
+ Common.TextFieldName.statusBar,
+ Common.TextFieldName.mediaClock,
+ Common.TextFieldName.mediaTrack
+ ]
+ var fieldSubstrings = filter(showStrings, showFields)
+ var showData = { hmiUIText: {} }
+ if (fieldSubstrings[Common.TextFieldName.mainField1] !== undefined) { showData.hmiUIText.mainField1 = fieldSubstrings[Common.TextFieldName.mainField1]; }
+ if (fieldSubstrings[Common.TextFieldName.mainField2] !== undefined) { showData.hmiUIText.mainField2 = fieldSubstrings[Common.TextFieldName.mainField2]; }
+ if (fieldSubstrings[Common.TextFieldName.mainField3] !== undefined) { showData.hmiUIText.mainField3 = fieldSubstrings[Common.TextFieldName.mainField3]; }
+ if (fieldSubstrings[Common.TextFieldName.mainField4] !== undefined) { showData.hmiUIText.mainField4 = fieldSubstrings[Common.TextFieldName.mainField4]; }
+ if (fieldSubstrings[Common.TextFieldName.statusBar] !== undefined) { showData.hmiUIText.statusBar = fieldSubstrings[Common.TextFieldName.statusBar]; }
+ if (fieldSubstrings[Common.TextFieldName.mediaTrack] !== undefined) { showData.hmiUIText.mediaTrack = fieldSubstrings[Common.TextFieldName.mediaTrack]; }
+ if (graphic) { showData.hmiUIText.image = graphic.value; }
+ if (secondaryGraphic) { showData.hmiUIText.secondaryImage = secondaryGraphic.value; }
+ if (textAlignment) { showData.hmiUITextAlignment = textAlignment; }
+ if (fieldSubstrings[Common.TextFieldName.mediaClock]) {
+ showData.mediaClock = {
+ "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
+ "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
+ "magic": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
+ "startTimeForProgress": -1
+ }
+ }
+
+ dataContainer.setApplicationProperties(appID, showData);
+ console.debug("exit")
+ }
+
+ function addCommand (cmdID, menuParams, cmdIcon, appID) {
+ var cmdIconLogs = "",
+ menuParamsLogs = "";
+
+ if (cmdIcon) {
+ cmdIconLogs = "{value: '" + cmdIcon.value + "', imageType: " + cmdIcon.imageType + "}";
+ }
+ if (menuParams) {
+ menuParamsLogs = "{parentID: " + menuParams.parentID + ", position: " + menuParams.position + "}";
+ }
+ console.log("Message Received - {method: 'UI.AddCommand', params:{ " +
+ "appID: " + appID + ", " +
+ "cmdID: " + cmdID + ", " +
+ "cmdIcon: " + cmdIconLogs + ", " +
+ "menuParams: " + menuParamsLogs +
+ "}}")
+ dataContainer.addCommand(cmdID, menuParams, cmdIcon, appID)
+ }
+
+ function deleteCommand (cmdID, appID) {
+ console.log("Message Received - {method: 'UI.DeleteCommand', params:{ " +
+ "appID: " + appID + ", " +
+ "cmdID: " + cmdID +
+ "}}")
+ dataContainer.deleteCommand(cmdID, appID)
+ }
+
+ function addSubMenu (menuID, menuParams, appID) {
+ var menuParamsLogs = "";
+
+ if (menuParams) {
+ menuParamsLogs = "{parentID: " + menuParams.parentID + ", position: " + menuParams.position + "}";
+ }
+ console.log("Message Received - {method: 'UI.AddSubMenu', params:{ " +
+ "appID: " + appID + ", " +
+ "menuID: " + menuID + ", " +
+ "menuParams: " + menuParamsLogs +
+ "}}")
+ dataContainer.addSubMenu(menuID, menuParams, appID)
+ }
+
+ function deleteSubMenu (menuID, appID) {
+ console.log("Message Received - {method: 'UI.DeleteSubMenu', params:{ " +
+ "appID:" + appID + ", " +
+ "menuID: " + menuID +
+ "}}")
+ dataContainer.deleteSubMenu(menuID, appID)
+ }
+
+ function performInteraction (initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
+ console.debug("enter")
+ var choiseLog = "",
+ vrHelpLog = "",
+ initialTextLog = "";
+ if (choiceSet) {
+ for (var i = 0; i < choiceSet.length; i++) {
+ choiseLog += "{choiceID: " + choiceSet[i].choiceID + ", " +
+ "menuName: '" + choiceSet[i].menuName + "', " +
+ "image: {value: '" + choiceSet[i].image.value + "', imageType: " + choiceSet[i].image.imageType + "}, " +
+ "secondaryText: '" + choiceSet[i].secondaryText + "', " +
+ "tertiaryText: '" + choiceSet[i].tertiaryText + "', " +
+ "secondaryImage: {value: '" + choiceSet[i].image.value + "', imageType: " + choiceSet[i].image.imageType + "}},";
+ }
+ }
+ if (vrHelp) {
+ for (var i = 0; i < vrHelp.length; i++) {
+ var vrHelpImageLog = "";
+ if (vrHelp[i].image) {
+ vrHelpImageLog = "{value: '" + vrHelp[i].image.value + "', imageType: " + vrHelp[i].image.imageType + "}";
+ }
+
+ vrHelpLog += "{text: '" + vrHelp[i].text + "', " +
+ "image: " + vrHelpImageLog + ", " +
+ "position: " + vrHelp[i].position +
+ "},";
+ }
+ }
+ if (initialText) {
+ initialTextLog = "{fieldName: " + initialText.fieldName + ", fieldText: '" + initialText.fieldText + "'}";
+ }
+
+ console.log("Message Received - {method: 'UI.PerformInteraction', params:{ " +
+ "appID:" + appID + ", " +
+ "initialText: " + initialTextLog + ", " +
+ "choiceSet: [" + choiseLog + "], " +
+ "vrHelpTitle: '" + vrHelpTitle + "', " +
+ "vrHelp: [" + vrHelpLog + "], " +
+ "timeout: " + timeout + ", " +
+ "interactionLayout: " + interactionLayout +
+ "}}")
+ var async = interactionPopup.performInteraction(initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID)
+ console.debug("exit")
+ return async
+ }
+
+ function setMediaClockTimer (startTime, endTime, updateMode, appID) {
+ var startTimeLog = "",
+ endTimeLog = "";
+ if (startTime) {
+ startTimeLog = "hours: " + startTime.hours + ", minutes: " + startTime.minutes + ", seconds: " + startTime.seconds;
+ }
+ if (endTime) {
+ endTimeLog = "hours: " + endTime.hours + ", minutes: " + endTime.minutes + ", seconds: " + endTime.seconds;
+ }
+
+ console.log("Message Received - {method: 'UI.SetMediaClockTimer', params:{ " +
+ "startTime: {" + startTimeLog + "}, " +
+ "endTime: {" + endTimeLog + "}, " +
+ "updateMode: " + updateMode + ", " +
+ "appID: " + appID +
+ "}}")
+ var app = dataContainer.getApplication(appID)
+ var newStartTime
+ var newEndTime
+ var newUpdateMode
+ var newRunningMode
+ var newStartTimeForProgress
+ var resultCode
+ var sendErrorResponce = false
+
+ switch (updateMode) {
+ case Common.ClockUpdateMode.COUNTUP:
+ if (startTime === undefined) {
+ resultCode = Common.Result.INVALID_DATA
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
+ newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTUP
+ newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
+ newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.COUNTDOWN:
+ if (startTime === undefined) {
+ resultCode = Common.Result.INVALID_DATA
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
+ newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTDOWN
+ newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
+ newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.PAUSE:
+ // Already paused or cleared
+ if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_STOPPED)
+ || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
+ resultCode = Common.Result.IGNORED
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = app.mediaClock.startTime
+ newEndTime = app.mediaClock.endTime
+ newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ newUpdateMode = app.mediaClock.updateMode
+ newStartTimeForProgress = app.mediaClock.startTime
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.RESUME:
+ // Already resumed or cleared
+ if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_RUNNING)
+ || (app.mediaClock.startTime === app.mediaClock.endTime)) {
+ resultCode = Common.Result.IGNORED
+ sendErrorResponce = true
+ break
+ }
+ newStartTime = app.mediaClock.startTime
+ newEndTime = app.mediaClock.endTime
+ newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
+ newStartTimeForProgress = app.mediaClock.startTime
+ newUpdateMode = app.mediaClock.updateMode
+ resultCode = Common.Result.SUCCESS
+ break
+
+ case Common.ClockUpdateMode.CLEAR:
+ newStartTime = -1
+ newEndTime = -1
+ newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ newUpdateMode = app.mediaClock.updateMode
+ newStartTimeForProgress = -1
+ resultCode = Common.Result.SUCCESS
+ break
+ }
+
+ if (sendErrorResponce) {
+ console.debug("exit with result code: ", resultCode)
+ return { __retCode: resultCode }
+ }
+
+ dataContainer.setApplicationProperties(appID, {
+ "mediaClock": {
+ "updateMode": newUpdateMode,
+ "runningMode": newRunningMode,
+ "startTime": newStartTime,
+ "endTime": newEndTime,
+ "startTimeForProgress": newStartTimeForProgress
+ }
+ })
+
+ console.debug("exit")
+ return { __retCode: resultCode }
+ }
+
+ function setGlobalProperties (vrHelpTitle, vrHelp, menuTitle, menuIcon, keyboardProperties, appID) {
+ console.debug("enter")
+ var vrHelpLog = "",
+ menuIconLog = "",
+ keyboardPropertiesLog = "";
+ if (vrHelp) {
+ for (var i = 0; i < vrHelp.length; i++) {
+ var vrHelpImageLog = "";
+ if (vrHelp[i].image) {
+ vrHelpImageLog = "{value: '" + vrHelp[i].image.value + "', imageType: " + vrHelp[i].image.imageType + "}";
+ }
+ vrHelpLog += "{text: '" + vrHelp[i].text + "', " +
+ "image: " + vrHelpImageLog + ", " +
+ "position: " + vrHelp[i].position +
+ "},";
+ }
+ }
+ if (menuIcon) {
+ menuIconLog = "{value: '" + menuIcon.value + "', imageType: " + menuIcon.imageType + "}";
+ }
+ if (keyboardProperties) {
+ keyboardPropertiesLog = "{language: '" + keyboardProperties.language + "', keyboardLayout: '" + keyboardProperties.language +
+ "', sendDynamicEntry: '" + keyboardProperties.sendDynamicEntry + "', keypressMode: '" + keyboardProperties.keypressMode +
+ "', limitedCharacterList: '" + keyboardProperties.limitedCharacterList + "', autoCompleteText: '" + keyboardProperties.autoCompleteText + "'}";
+ }
+
+ console.log("Message Received - {method: 'UI.SetGlobalProperties', params:{ " +
+ "appID:" + appID + ", " +
+ "vrHelpTitle: '" + vrHelpTitle + "', " +
+ "vrHelp: [" + vrHelpLog + "], " +
+ "menuTitle: '" + menuTitle + "', " +
+ "menuIcon: " + menuIconLog + ", " +
+ "keyboardProperties: " + keyboardPropertiesLog +
+ "}}")
+ var app = dataContainer.getApplication(appID)
+ var dataToUpdate = {}
+
+ if (vrHelpTitle !== undefined) {
+ dataToUpdate.vrHelpTitle = vrHelpTitle
+ } else if ( (vrHelp !== undefined) && (vrHelp.length >= 1) ) {
+ return { __retCode: Common.Result.REJECTED, __message: "vrHelpTitle - undefined, vrHelpItem - provided" }
+ }
+
+ if (vrHelp !== undefined) {
+ var checkSequentialPosition = vrHelp[0].position
+ for (var index = 0; index < vrHelp.length; index++) {
+ if (vrHelp[index].position !== checkSequentialPosition) {
+ return { __retCode: Common.Result.REJECTED, __message: "Nonsequential positions of VrHelpItems" }
+ }
+ checkSequentialPosition++
+ }
+
+ if (app.vrHelpItems.count !== 0) {
+ app.vrHelpItems.clear()
+ }
+ vrHelp.forEach( Internal.appendVrHelpItem, app.vrHelpItems )
+ } else {
+ if (vrHelpTitle !== undefined) {
+ return { __retCode: Common.Result.REJECTED, __message: "vrHelpItems - undefined, vrHelpTitle - provided" }
+ }
+ }
+ if (menuTitle !== undefined) {
+ dataToUpdate.menuTitle = menuTitle
+ }
+ if (menuIcon !== undefined) {
+ dataToUpdate.menuIcon = menuIcon
+ }
+ dataContainer.setApplicationProperties(appID, dataToUpdate)
+ console.debug("exit")
+ }
+
+ function isReady () {
+ console.log("Message Received - {method: 'UI.IsReady'}")
+ return {
+ available: dataContainer.hmiUIAvailable
+ }
+ }
+
+ function getLanguage () {
+ console.log("Message Received - {method: 'UI.GetLanguage'}")
+ return {
+ language: dataContainer.hmiUILanguage
+ }
+ }
+
+ function getSupportedLanguages () {
+ console.log("Message Received - {method: 'UI.GetSupportedLanguages'}")
+ return {
+ languages: settingsContainer.sdlLanguagesList
+ }
+ }
+
+ function changeRegistration (language, appID) {
+ console.log("Message Received - {method: 'UI.ChangeRegistration', params:{ " +
+ "language: " + language + ", " +
+ "appID: " + appID +
+ "}}")
+ dataContainer.changeRegistrationUI(language, appID)
+ }
+
+ function setAppIcon (syncFileName, appID) {
+ var syncFileNameLog = "";
+ if (syncFileName) {
+ syncFileNameLog = "{value: '" + syncFileName.value + "', imageType: " + syncFileName.imageType + "}";
+ }
+
+ console.log("Message Received - {method: 'UI.SetAppIcon', params:{ " +
+ "syncFileName: " + syncFileNameLog + ", " +
+ "appID: " + appID +
+ "}}")
+ dataContainer.setApplicationProperties(appID, { icon: syncFileName.value })
+ }
+
+ function slider (numTicks, position, sliderHeader, sliderFooter, timeout, appID) {
+ console.log("Message Received - {method: 'UI.Slider', params:{ " +
+ "numTicks: " + numTicks + "', " +
+ "position: " + position + "', " +
+ "sliderHeader: '" + sliderHeader + "', " +
+ "sliderFooter: [" + sliderFooter + "], " +
+ "timeout: " + timeout + ", " +
+ "appID: " + appID +
+ "}}")
+ if (dataContainer.uiSlider.running) {
+ console.debug("aborted")
+ return {__retCode: Common.Result.ABORTED, sliderPosition: position}
+ }
+
+ dataContainer.uiSlider.appName = dataContainer.getApplication(appID).appName
+ dataContainer.uiSlider.header = sliderHeader
+ dataContainer.uiSlider.footer = sliderFooter
+ dataContainer.uiSlider.numTicks = numTicks
+ dataContainer.uiSlider.position = position
+ dataContainer.uiSlider.timeout = timeout
+
+ if (timeout !== 0) {
+ sliderPopup.showSlider()
+ sliderPopup.async = new Async.AsyncCall();
+ console.debug("exit")
+ return sliderPopup.async;
+ } else {
+ console.debug("exit")
+ return { sliderPosition: position }
+ }
+ }
+
+ function scrollableMessage (messageText, timeout, softButtons, appID) {
+ var softButtonsLog = "",
+ messageTextLog = "";
+ if (softButtons) {
+ for (var i = 0; i < softButtons.length; i++) {
+ softButtonsLog += "{type: '" + softButtons[i].type + "', " +
+ "text: " + softButtons[i].text + "', ";
+ softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
+ softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
+ "softButtonID: " + softButtons[i].softButtonID + "', " +
+ "systemAction: " + softButtons[i].systemAction +
+ "},";
+ }
+ }
+ if (messageText) {
+ messageTextLog = "{fieldName: " + messageText.fieldName + ", fieldText: '" + messageText.fieldText + "'}";
+ }
+
+ console.log("Message Received - {method: 'UI.ScrollableMessage', params:{ " +
+ "messageText: " + messageTextLog + ", " +
+ "timeout: " + timeout + "', " +
+ "softButtons: [" + softButtonsLog + "]," +
+ "appID: " + appID + "', " +
+ "}}")
+ // TODO{ALeshin}: Also check HMILevel, when it will be available. It should be FULL otherwise - REJECTED
+ if (contentLoader.item.systemContext !== Common.SystemContext.SYSCTXT_MAIN) {
+ return { __retCode: Common.Result.REJECTED, __message: "System Context isn't MAIN" }
+ }
+ if(dataContainer.scrollableMessageModel.running){
+ //send error response if scrollable message already running
+ return { __retCode: Common.Result.ABORTED, __message: "ScrollableMessage already running" }
+ }
+
+ dataContainer.scrollableMessageModel.longMessageText = messageText.fieldText
+ if (timeout === 0) {
+ return { __retCode: Common.Result.SUCCESS, __message: "Timeout = 0" }
+ } else {
+ dataContainer.scrollableMessageModel.timeout = timeout
+ }
+
+ dataContainer.scrollableMessageModel.softButtons.clear();
+ if (softButtons !== undefined) {
+ softButtons.forEach(fillSoftButtons, dataContainer.scrollableMessageModel.softButtons);
+ }
+ dataContainer.scrollableMessageModel.appId = appID
+ dataContainer.scrollableMessageModel.async = new Async.AsyncCall()
+ contentLoader.go("./views/ScrollableMessageView.qml")
+ console.debug("exit")
+ return dataContainer.scrollableMessageModel.async
+ }
+
+ function getCapabilities() {
+ console.log("Message Received - {method: 'UI.GetCapabilities'}")
+ return {
+ "audioPassThruCapabilities": {
+ "samplingRate": Common.SamplingRate.RATE_44KHZ,
+ "bitsPerSample": Common.BitsPerSample.RATE_8_BIT,
+ "audioType": Common.AudioType.PCM
+ },
+ "displayCapabilities": settingsContainer.displayCapabilities,
+ "hmiZoneCapabilities": Common.HmiZoneCapabilities.FRONT,
+ "softButtonCapabilities": settingsContainer.softButtonCapabilities
+ }
+ }
+
+ function performAudioPassThru (audioPassThruDisplayTexts, timeout, appID) {
+ var displayTextsLog = "";
+ if (audioPassThruDisplayTexts) {
+ for (var i = 0; i < audioPassThruDisplayTexts.length; i++) {
+ displayTextsLog += "{fieldName: '" + audioPassThruDisplayTexts[i].fieldName + "', " +
+ "fieldText: " + audioPassThruDisplayTexts[i].fieldText + "'},";
+ }
+ }
+ console.log("Message Received - {method: 'UI.PerformAudioPassThru', params:{ " +
+ "audioPassThruDisplayTexts: [" + displayTextsLog + "], " +
+ "maxDuration: " + timeout +
+ "}}")
+
+ if (dataContainer.uiAudioPassThru.running) {
+ console.debug("aborted")
+ throw Common.Result.ABORTED
+ }
+
+ dataContainer.uiAudioPassThru.appName = dataContainer.getApplication(appID).appName
+ dataContainer.uiAudioPassThru.timeout = timeout
+ if (audioPassThruDisplayTexts.length === 2) {
+ dataContainer.uiAudioPassThru.firstLine = audioPassThruDisplayTexts[0].fieldText
+ dataContainer.uiAudioPassThru.secondLine = audioPassThruDisplayTexts[1].fieldText
+ }
+ performAudioPassThruPopup.async = new Async.AsyncCall();
+ performAudioPassThruPopup.showAudioPassThru()
+ console.debug("exit")
+ return performAudioPassThruPopup.async;
+ }
+
+ function endAudioPassThru () {
+ console.debug("enter")
+ console.log("Message Received - {method: 'UI.EndAudioPassThru'}")
+
+ if (!dataContainer.uiAudioPassThru.running) {
+ console.debug("rejected")
+ throw Common.Result.REJECTED
+ }
+ DBus.sendReply({__retCode: Common.Result.SUCCESS})
+ performAudioPassThruPopup.complete(Common.Result.SUCCESS)
+ console.debug("exit")
+ }
+
+ function closePopUp (methodName) {
+ console.debug("enter")
+ console.log("Message Received - {method: 'UI.ClosePopUp', params:{ " +
+ "methodName: " + methodName +
+ "}}")
+ var popUpToClose
+
+ if (dataContainer.activePopup.length === 0) {
+ return { __retCode: Common.Result.ABORT, __message: "No active PopUps"}
+ }
+
+ if (methodName !== undefined) {
+ popUpToClose = methodName
+ } else {
+ popUpToClose = dataContainer.activePopup[dataContain.activePopUp.length - 1]
+ }
+
+ switch (popUpToClose) {
+ case "UI.PerformInteraction":
+ interactionPopup.complete(Common.Result.SUCCESS)
+ break
+ case "UI.Slider":
+ sliderPopup.complete(Common.Result.SUCCESS)
+ break
+ case "UI.PerformAudioPassThru":
+ performAudioPassThruPopup.complete(Common.Result.SUCCESS)
+ break
+ case "UI.Alert":
+ alertWindow.complete(Common.Result.SUCCESS)
+ break
+ case "UI.VrHelp":
+ vrHelpPopup.complete(Common.Result.SUCCESS)
+ break
+ }
+ console.debug("exit")
+ }
+
+ function fillSoftButtons(element, index, array) {
+ this.append({
+ type: element.type,
+ text: element.text,
+ image: element.image,
+ isHighlighted: element.isHighlighted,
+ softButtonID: element.softButtonID,
+ systemAction: element.systemAction
+ });
+ }
+
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
new file mode 100644
index 0000000000..8a426197e2
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
@@ -0,0 +1,114 @@
+/**
+ * @file VR.qml
+ * @brief Implement of interface VR.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Common.js" as Common
+
+Item {
+ function isReady() {
+ console.log("Message Received - {method: 'VR.IsReady'}")
+ return {
+ available: dataContainer.hmiVRAvailable
+ }
+ }
+
+ function addCommand(cmdID, vrCommands, appID) {
+ var vrCommandsLog = "";
+ if (vrCommands) {
+ for (var i = 0; i < vrCommands.length; i++) {
+ vrCommandsLog += "'" + vrCommands[i] + "', ";
+ }
+ }
+ console.log("Message Received - {method: 'VR.AddCommand', params:{ " +
+ "vrCommands: [" + vrCommandsLog + "], " +
+ "cmdID: " + cmdID + ", " +
+ "appID: " + appID +
+ "}}")
+ for (var i = 0; i < vrCommands.length; ++i) {
+ dataContainer.vrCommands.append({
+ cmdID: cmdID,
+ command: vrCommands[i],
+ appID: appID === undefined ? 0 : appID,
+ });
+ }
+ console.log("exit")
+ }
+
+ function deleteCommand(cmdID, appID) {
+ console.log("Message Received - {method: 'VR.DeleteCommand', params:{ " +
+ "appID: " + appID + ", " +
+ "cmdID: " + cmdID +
+ "}}")
+ for (var i = 0; i < dataContainer.vrCommands.count; ) {
+ if ((dataContainer.vrCommands.get(i).cmdID === cmdID) &&
+ ((appID === undefined) || (dataContainer.vrCommands.get(i).appID === appID))) {
+ dataContainer.vrCommands.remove(i);
+ continue;
+ }
+ ++i;
+ }
+ console.log("exit")
+ }
+
+ function getLanguage() {
+ console.log("Message Received - {method: 'VR.GetLanguage'}")
+ return {
+ language: dataContainer.hmiTTSVRLanguage
+ }
+ }
+
+ function getSupportedLanguages() {
+ console.log("Message Received - {method: 'VR.GetSupportedLanguages'}")
+ return {
+ languages: settingsContainer.sdlLanguagesList
+ }
+ }
+
+ function getCapabilities() {
+ console.log("Message Received - {method: 'UI.GetCapabilities'}")
+ return {
+ vrCapabilities: [ Common.VrCapabilities.VR_TEXT ]
+ }
+ }
+
+ function changeRegistration(language, appID) {
+ console.debug("enter");
+ console.log("Message Received - {method: 'VR.ChangeRegistration', params:{ " +
+ "language: " + language + ", " +
+ "appID: " + appID +
+ "}}")
+ dataContainer.changeRegistrationTTSVR(language, appID);
+ console.debug("exit");
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml
new file mode 100644
index 0000000000..e564860517
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml
@@ -0,0 +1,764 @@
+/**
+ * @file VehicleInfo.qml
+ * @brief Vehicle information interface realisation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Common.js" as Common
+
+Item {
+ function isReady () {
+ console.log("Message Received - {method: 'VehicleInfo.IsReady'}")
+ return {
+ available: dataContainer.hmiVehicleInfoAvailable
+ }
+ }
+
+ function getVehicleType() {
+ console.log("Message Received - {method: 'VehicleInfo.GetVehicleType'}")
+ return {
+ "vehicleType": {
+ "make": "Ford",
+ "model": "Fiesta",
+ "modelYear": "2013",
+ "trim": "SE"
+ }
+ }
+ }
+
+ function getGpsData(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { gps: dataContainer.vehicleInfoModel.gps }
+ }
+
+ function getSpeed(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { speed: dataContainer.vehicleInfoModel.speed }
+ }
+
+ function getRpm(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return {
+ rpm: dataContainer.vehicleInfoModel.rpm,
+ __retCode: Common.Result.DATA_NOT_AVAILABLE
+ }
+ }
+
+ function getFuelLevel(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { fuelLevel: dataContainer.vehicleInfoModel.fuelLevel }
+ }
+
+ function getFuelLevelState(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { fuelLevel_State: dataContainer.vehicleInfoModel.fuelLevel_State }
+ }
+
+ function getInstantFuelConsumption(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { instantFuelConsumption: dataContainer.vehicleInfoModel.instantFuelConsumption }
+ }
+
+ function getExternalTemperature(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { externalTemperature: dataContainer.vehicleInfoModel.externalTemperature }
+ }
+
+ function getVin(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { vin: dataContainer.vehicleInfoModel.vin }
+ }
+
+ function getPrndl(appID) {
+ console.debug("enter")
+ if (dataContainer.vehicleInfoModel.prndl === -1) { // Test value, to check response
+ console.debug("exit")
+ return {
+ prndl: dataContainer.vehicleInfoModel.prndl,
+ __retCode: Common.Result.DATA_NOT_AVAILABLE
+ }
+ }
+ console.debug("exit")
+ return { prndl: dataContainer.vehicleInfoModel.prndl }
+ }
+
+ function getTirePressure(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { tirePressure: dataContainer.vehicleInfoModel.tirePressure }
+ }
+
+ function getOdometer(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return {
+ odometer: dataContainer.vehicleInfoModel.odometer,
+ __retCode: Common.Result.DATA_NOT_AVAILABLE
+ }
+ }
+
+ function getBeltStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { beltStatus: dataContainer.vehicleInfoModel.beltStatus }
+ }
+
+ function getBodyInformation(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { bodyInformation: dataContainer.vehicleInfoModel.bodyInformation }
+ }
+
+ function getDeviceStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { deviceStatus: dataContainer.vehicleInfoModel.deviceStatus }
+ }
+
+ function getDriverBraking(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { driverBraking: dataContainer.vehicleInfoModel.driverBraking }
+ }
+
+ function getWiperStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { wiperStatus: dataContainer.vehicleInfoModel.wiperStatus }
+ }
+
+ function getHeadLampStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { headLampStatus: dataContainer.vehicleInfoModel.headLampStatus }
+ }
+
+ function getEngineTorque(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { engineTorque: dataContainer.vehicleInfoModel.engineTorque }
+ }
+
+ function getAccPedalPosition(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { accPedalPosition: dataContainer.vehicleInfoModel.accPedalPosition }
+ }
+
+ function getSteeringWheelAngle(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { steeringWheelAngle: dataContainer.vehicleInfoModel.steeringWheelAngle }
+ }
+
+ function getECallInfo(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { eCallInfo: dataContainer.vehicleInfoModel.eCallInfo }
+ }
+
+ function getAirbagStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { airbagStatus: dataContainer.vehicleInfoModel.airbagStatus }
+ }
+
+ function getEmergencyEvent(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { emergencyEvent: dataContainer.vehicleInfoModel.emergencyEvent }
+ }
+
+ function getClusterModeStatus(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { clusterModeStatus: dataContainer.vehicleInfoModel.clusterModeStatus }
+ }
+
+ function getMyKey(appID) {
+ console.debug("enter")
+ console.debug("exit")
+ return { myKey: dataContainer.vehicleInfoModel.myKey }
+ }
+
+ function getDTCs(ecuName, dtcMask, appID) {
+ console.log("Message Received - {method: 'VehicleInfo.GetDTCs', params:{ " +
+ "ecuName: " + ecuName + ", " +
+ "dtcMask: " + dtcMask + ", " +
+ "appID: " + appID +
+ "}}")
+ var ecuHeader = 2
+ var dtc = []
+
+ for (var i = 0; i < 3; i++) {
+ dtc.push("line" + i)
+ }
+ return {ecuHeader: ecuHeader, dtc: dtc}
+ }
+
+ function readDID(ecuName, didLocation, appID) {
+ console.debug("Enter")
+ console.log("Message Received - {method: 'VehicleInfo.ReadDID', params:{ " +
+ "ecuName: " + ecuName + ", " +
+ "didLocation: " + didLocation + ", " +
+ "appID: " + appID +
+ "}}")
+ //TODO{ALeshin}: refactoring of this function, when we'll have Vehicle Info module
+ var didResult = []
+
+ for (var i = 0; i < didLocation.length; i++) {
+ if (i < 10) {
+ didResult[i] = {}
+ didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_SUCCESS
+ didResult[i].didLocation = didLocation[i]
+ didResult[i].data = '0'
+ }
+ else {
+ didResult[i] = {}
+ didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_DATA_NOT_AVAILABLE
+ didResult[i].didLocation = didLocation[i]
+ didResult[i].data = '0'
+ }
+ }
+ console.debug("Exit")
+ return {didResult: didResult}
+ }
+
+ function subscribeGps(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onGpsChanged.disconnect(model.sendGpsChange)
+ model.onGpsChanged.connect(model.sendGpsChange)
+ console.debug("exit")
+ return {gps:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
+ }
+ function unsubscribeGps(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onGpsChanged.disconnect(model.sendGpsChange)
+ console.debug("exit")
+ return {gps:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
+
+ }
+
+ function subscribeSpeed(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSpeedChanged.disconnect(model.sendSpeedChange)
+ model.onSpeedChanged.connect(model.sendSpeedChange)
+ console.debug("exit")
+ return { speed:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeSpeed(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSpeedChanged.disconnect(model.sendSpeedChange)
+ console.debug("exit")
+ return { speed:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeRpm(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onRpmChanged.disconnect(model.sendRpmChange)
+ model.onRpmChanged.connect(model.sendRpmChange)
+ console.debug("exit")
+ return { rpm:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeRpm(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onRpmChanged.disconnect(model.sendRpmChange)
+ console.debug("exit")
+ return { rpm:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeFuelLevel(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
+ model.onFuelLevelChanged.connect(model.sendFuelLevelChange)
+ console.debug("exit")
+ return { fuelLevel:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeFuelLevel(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
+ console.debug("exit")
+ return { fuelLevel:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeFuelLevel_State(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
+ model.onFuelLevel_StateChanged.connect(model.sendFuelLevel_StateChange)
+ console.debug("exit")
+ return { fuelLevel_State:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeFuelLevel_State(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
+ console.debug("exit")
+ return { fuelLevel_State:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeInstantFuelConsumption(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
+ model.onInstantFuelConsumptionChanged.connect(model.sendInstantFuelConsumptionChange)
+ console.debug("exit")
+ return { instantFuelConsumption:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeInstantFuelConsumption(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
+ console.debug("exit")
+ return { instantFuelConsumption:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeExternalTemperature(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
+ model.onExternalTemperatureChanged.connect(model.sendExternalTemperatureChange)
+ console.debug("exit")
+ return { externalTemperature:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeExternalTemperature(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
+ console.debug("exit")
+ return { externalTemperature:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribePrndl(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onPrndlChanged.disconnect(model.sendPrndlChange)
+ model.onPrndlChanged.connect(model.sendPrndlChange)
+ console.debug("exit")
+ return { prndl:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribePrndl(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onPrndlChanged.disconnect(model.sendPrndlChange)
+ console.debug("exit")
+ return { prndl:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeVin(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onVinChanged.disconnect(model.sendVinChange)
+ model.onVinChanged.connect(model.sendVinChange)
+ console.debug("exit")
+ return { vin:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeVin(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onVinChanged.disconnect(model.sendVinChange)
+ console.debug("exit")
+ return { vin:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeTirePressure(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
+ model.onTirePressureChanged.connect(model.sendTirePressureChange)
+ console.debug("exit")
+ return { tirePressure:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeTirePressure(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
+ console.debug("exit")
+ return { tirePressure:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeOdometer(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onOdometerChanged.disconnect(model.sendOdometerChange)
+ model.onOdometerChanged.connect(model.sendOdometerChange)
+ console.debug("exit")
+ return { odometer:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeOdometer(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onOdometerChanged.disconnect(model.sendOdometerChange)
+ console.debug("exit")
+ return { odometer:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeBeltStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
+ model.onBeltStatusChanged.connect(model.sendBeltStatusChange)
+ console.debug("exit")
+ return { beltStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeBeltStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
+ console.debug("exit")
+ return { beltStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeBodyInformation(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
+ model.onBodyInformationChanged.connect(model.sendBodyInformationChange)
+ console.debug("exit")
+ return { bodyInformation:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeBodyInformation(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
+ console.debug("exit")
+ return { bodyInformation:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeDeviceStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
+ model.onDeviceStatusChanged.connect(model.sendDeviceStatusChange)
+ console.debug("exit")
+ return { deviceStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeDeviceStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
+ console.debug("exit")
+ return { deviceStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeDriverBraking(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
+ model.onDriverBrakingChanged.connect(model.sendDriverBrakingChange)
+ console.debug("exit")
+ return { driverBraking:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeDriverBraking(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
+ console.debug("exit")
+ return { driverBraking:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeWiperStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
+ model.onWiperStatusChanged.connect(model.sendWiperStatusChange)
+ console.debug("exit")
+ return { wiperStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeWiperStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
+ console.debug("exit")
+ return { wiperStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeHeadLampStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
+ model.onHeadLampStatusChanged.connect(model.sendHeadLampStatusChange)
+ console.debug("exit")
+ return { headLampStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeHeadLampStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
+ console.debug("exit")
+ return { headLampStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeEngineTorque(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
+ model.onEngineTorqueChanged.connect(model.sendEngineTorqueChange)
+ console.debug("exit")
+ return { engineTorque:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeEngineTorque(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
+ console.debug("exit")
+ return { engineTorque:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeAccPedalPosition(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
+ model.onAccPedalPositionChanged.connect(model.sendAccPedalPositionChange)
+ console.debug("exit")
+ return { accPedalPosition:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeAccPedalPosition(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
+ console.debug("exit")
+ return { accPedalPosition:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeSteeringWheelAngle(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
+ model.onSteeringWheelAngleChanged.connect(model.sendSteeringWheelAngleChange)
+ console.debug("exit")
+ return { steeringWheelAngle:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeSteeringWheelAngle(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
+ console.debug("exit")
+ return { steeringWheelAngle:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeECallInfo(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
+ model.onECallInfoChanged.connect(model.sendECallInfoChange)
+ console.debug("exit")
+ return { eCallInfo:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeECallInfo(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
+ console.debug("exit")
+ return { eCallInfo:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeAirbagStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
+ model.onAirbagStatusChanged.connect(model.sendAirbagStatusChange)
+ console.debug("exit")
+ return { airbagStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeAirbagStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
+ console.debug("exit")
+ return { airbagStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeEmergencyEvent(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
+ model.onEmergencyEventChanged.connect(model.sendEmergencyEventChange)
+ console.debug("exit")
+ return { emergencyEvent:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeEmergencyEvent(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
+ console.debug("exit")
+ return { emergencyEvent:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeClusterModeStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
+ model.onClusterModeStatusChanged.connect(model.sendClusterModeStatusChange)
+ console.debug("exit")
+ return { clusterModeStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeClusterModeStatus(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
+ console.debug("exit")
+ return { clusterModeStatus:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+
+ function subscribeMyKey(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
+ model.onMyKeyChanged.connect(model.sendMyKeyChange)
+ console.debug("exit")
+ return { myKey:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+ function unsubscribeMyKey(appID) {
+ console.debug("enter")
+ var model = dataContainer.vehicleInfoModel;
+ model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
+ console.debug("exit")
+ return { myKey:
+ { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
+ resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/log4cxx.properties b/src/components/qt_hmi/qml_model_qt5/log4cxx.properties
new file mode 100644
index 0000000000..0bc5ac8fdf
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/log4cxx.properties
@@ -0,0 +1,41 @@
+# Socket logger
+log4j.appender.SocketHub=org.apache.log4j.net.SocketHubAppender
+log4j.appender.SocketHub.port=4555
+log4j.appender.SocketHub.locationInfo=true
+
+# Only ERROR and FATAL messages are logged to console
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.ImmediateFlush=true
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %m%n
+log4j.appender.Console.Threshold=ERROR
+
+# Log for all DBus plugin messages
+log4j.appender.DBusPluginLogFile=org.apache.log4j.FileAppender
+log4j.appender.DBusPluginLogFile.File=DBusPlugin.log
+log4j.appender.DBusPluginLogFile.append=false
+log4j.appender.DBusPluginLogFile.DatePattern='.' yyyy-MM-dd
+log4j.appender.DBusPluginLogFile.ImmediateFlush=true
+log4j.appender.DBusPluginLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.DBusPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
+
+# Log for all HMI Framework plugin
+log4j.appender.HmiFrameworkPluginLogFile=org.apache.log4j.FileAppender
+log4j.appender.HmiFrameworkPluginLogFile.File=HmiFrameworkPlugin.log
+log4j.appender.HmiFrameworkPluginLogFile.append=false
+log4j.appender.HmiFrameworkPluginLogFile.DatePattern='.' yyyy-MM-dd
+log4j.appender.HmiFrameworkPluginLogFile.ImmediateFlush=true
+log4j.appender.HmiFrameworkPluginLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.HmiFrameworkPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
+
+# Log for all Qt HMI
+log4j.rootLogger=ALL, Console
+
+# Log for DBus plugin QtHMI
+log4j.logger.DBusPlugin=ALL, DBusPluginLogFile
+
+# Log for HMI Framework plugin
+log4j.logger.HmiFrameworkPlugin=ALL, HmiFrameworkPluginLogFile
+
+# Log by log4cxx plugin
+log4j.logger.Log4cxxPlugin=ALL, HmiFrameworkPluginLogFile
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml b/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml
new file mode 100644
index 0000000000..ec40819040
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml
@@ -0,0 +1,59 @@
+/**
+ * @file ApplicationData.qml
+ * @brief Model for Application.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+QtObject {
+ property string mainField1
+ property string mainField2
+ property string mainField3
+ property string mainField4
+ property string statusBar
+ property string mediaTrack
+ property string image: ""
+ property string secondaryImage: ""
+
+ function reset () {
+ console.debug("enter")
+ mainField1 = ""
+ mainField2 = ""
+ mainField3 = ""
+ mainField4 = ""
+ statusBar = ""
+ mediaTrack = ""
+ image = ""
+ secondaryImage = ""
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml
new file mode 100644
index 0000000000..5181e04a5b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml
@@ -0,0 +1,105 @@
+/**
+ * @file ApplicationModel.qml
+ * @brief Own fields for each application.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+
+QtObject {
+ property int appId
+ property string appName
+ property string ngnMediaScreenAppName
+ property Icon appIcon: Icon { }
+ property string deviceName
+ property int hmiDisplayLanguageDesired
+ property bool isMediaApplication
+ property int appType
+ property int hmiUITextAlignment
+ property string vrHelpTitle
+ property string vrHelpTitleDefault: "VR HELP"
+ property string vrHelpTitlePerformInteraction
+ property string menuTitle
+ property Icon menuIcon: Icon { }
+
+ // media player
+ property string playPauseState
+ property ApplicationData hmiUIText: ApplicationData { }
+ property MediaClockModel mediaClock: MediaClockModel { }
+ property NavigationModel navigationModel: NavigationModel { }
+
+ property string helpPrompt
+ property string timeoutPrompt
+ property ListModel vrHelpItems: ListModel { }
+ property ListModel vrHelpItemsDefault: VrHelpItemsDefault { }
+ property ListModel vrHelpItemsPerformInteraction: ListModel { }
+ property ListModel options: ListModel { }
+ property ListModel currentSubMenu: options
+ property ListModel turnList
+ property ListModel softButtons
+ property ListModel turnListSoftButtons
+ property ListModel navigationSoftButtons
+ property ListModel alertManeuverSoftButtons
+ property ListModel customPresets
+ property int languageTTSVR
+ property var allowedFunctions: []
+ // This place is for adding new properties
+
+ function reset () {
+ console.debug("enter")
+ appId = -1
+ appName = ""
+ ngnMediaScreenAppName = ""
+ appIcon.reset()
+ deviceName = ""
+ hmiDisplayLanguageDesired = -1
+ isMediaApplication = false
+ playPauseState = ""
+ hmiUIText.reset()
+// no need to reset mediaClock
+ helpPrompt = ""
+ timeoutPrompt = ""
+ options.clear()
+ currentSubMenu = options
+ turnList.clear()
+ softButtons.clear()
+ navigationSoftButtons.clear()
+ alertManeuverSoftButtons.clear()
+ turnListSoftButtons.clear()
+ customPresets.clear()
+ languageTTSVR = -1
+ hmiUITextAlignment = -1
+ appType = 0
+ allowedFunctions = []
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml
new file mode 100644
index 0000000000..c715ae091f
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml
@@ -0,0 +1,78 @@
+/**
+ * @file CarMenuModel.qml
+ * @brief Car menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel
+{
+ ListElement {
+ name: "ambient"
+ icon: "../res/vehicle/Ambient Lighti Icon.png"
+ qml: ""
+ }
+ ListElement {
+ name: "cal"
+ icon: "../res/vehicle/cal.png"
+ qml: ""
+ }
+ ListElement {
+ name: "ev"
+ icon: "../res/vehicle/EV Icon.png"
+ qml: ""
+ }
+ ListElement {
+ name: "folders"
+ icon: "../res/vehicle/folders.png"
+ qml: ""
+ }
+ ListElement {
+ name: "key"
+ icon: "../res/vehicle/key_car.png"
+ qml: ""
+ }
+ ListElement {
+ name: "mcs"
+ icon: "../res/vehicle/MCS Icon.png"
+ qml: ""
+ }
+ ListElement {
+ name: "sun"
+ icon: "../res/vehicle/sun.png"
+ qml: ""
+ }
+ ListElement {
+ name: "sync"
+ icon: "../res/vehicle/SYNC Services.png"
+ qml: ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/Constants.js b/src/components/qt_hmi/qml_model_qt5/models/Constants.js
new file mode 100644
index 0000000000..0b4a3191d7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/Constants.js
@@ -0,0 +1,250 @@
+/**
+ * @file Constants.js
+ * @brief Namespace of constants.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+.pragma library
+
+// Colors
+
+// Main color of HMI model(now it ~lightblue). Buttons, text, icons of this color.
+var primaryColor = "#1d81d5"
+
+// Color of pressed buttons, text, icons etc.
+var primaryColorPressed = "#8ec0ea"
+
+// Secondary color of HMI model, backgroud of this color.
+var secondaryColor = "black"
+
+// Color of text at buttonts that are inactive (at phone keyboard, when no any contact started with current letter).
+var inactiveButtonTextColor = "grey"
+
+// Color of text at buttonts that are inactive but nevertheless pressed (at phone keyboard, when no any contact started with current letter).
+var inactiveButtonTextColorPressed = "lightgrey"
+
+// Color of text at contact list screen view (Name, number and number type).
+var contactTextColor = "lightblue"
+
+// Color of text at buttons, when they are pressed.
+var pressedButtonTextColor = "black"
+
+// Color of text at "white" buttons, for all other buttons (which most) use primaryColor.
+var releasedButtonTextColor = "white"
+
+// Transparent background.
+var transparentColor = "#00000000"
+
+// "Warning" word color
+var warningColor = "red"
+
+// Color for PopUp
+var popUpBorderColor = "white"
+
+// Color for hardware and simulation panels
+var panelColor = "#003"
+
+// Color for text in hardware and simulation panels
+var panelTextColor = "white"
+
+// Audio pass thru PopUp text color
+var audioPassThruTextColor = "white"
+
+// Semi transparent color of item in SDL Navi menu
+var sdlNaviTransparentItemColor = "#30C0C0C0"
+
+//--------------------------------------------------------------------------------------
+
+// Font sizes of different elements
+
+// Font size for most of text in HMI model.
+var fontSize = 20
+
+// Font size for text inside oval buttons.
+var ovalButtonFontSize = 15
+
+// Title font size
+var titleFontSize = 35
+
+// Power on/off button font size
+var powerButtonFornSize = 25
+
+// Font size of status bar
+var statusBarFontSize = 15
+
+// Size icon for buttons
+var iconButtonSize = 30
+
+// Size icon for item list
+var iconItemListSize = 40
+
+// font size fo TTS popup
+var ttsFontSize = 12
+
+// Font size for list of applications
+var appListFontSize = 40
+
+// Size of contact list fields
+var contactListNameFieldSize = 0.4
+var contactListPhoneFieldSize = 0.3
+var contactListDescriptionFieldSize = 0.3
+
+//--------------------------------------------------------------------------------------
+
+// Sizes of buttons, menus, screen, etc
+
+// Minimal width and height of screen (screen wont resize, if height and width are lower).
+var mainScreenMinWidth = 800
+var mainScreenMiHeight = 600
+
+// Width for long oval button
+var ovalButtonWidth = 163
+
+// Height for oval button
+var ovalButtonHeight = 65
+
+// Height item list
+var itemListHeight = 60
+
+// Width for TTS popup
+var ttsPopUpWidth = 250
+
+// Height for TTS popup
+var ttsPopUpHeight = 100
+
+// Width for popup view
+var popupWidth = 700
+
+// Width for alert window
+var alertWidth = 360
+
+// Height for popup view
+var popupHeigth = 500
+
+// Width for combobox
+var defaultComboboxWidth = 150
+
+// Size icon for list of applications
+var appListIconSize = 100
+
+// DistanceBar height
+var distanceBarHeight = 1
+
+
+//---------------------------------------------------------------------------------------
+
+// Other
+
+// Offset from the edges of the screen.
+var margin = 20
+
+// Offset from the edges of the popup
+var popupMargin = 15
+
+// Spacing between items in SDLNavi view
+var sdlNaviSpacing = 5
+
+// Spacing between contacts at contact screen view.
+var contactListSpacing = 30
+
+// Duration of appearance of icon/button at icon/button menus.
+var animationDuration = 500
+
+// Duration of appearence of "OK" button at warning screen view, when HMI starts.
+var warningScreenDuration = 1000
+
+// Timer to check how long preset button is pressed.
+var presetButtonTimer = 800
+
+// Timer to check got long custom button is pressed.
+var customButtonTimer = 2000
+
+// Spacing between icon and item in list
+var iconItemListSpacing = 20
+
+// Spacing between item on views
+var generalSpacing = 10
+
+// Width of scrollBar
+var scrollBarWidth = 5
+
+// Speak text for a given time
+var ttsSpeakTime = 2000
+
+// Maximal number of submenus
+var maximumSubmenus = 1000
+
+// Maximal number of commands in submenu or root menu
+var maximumCommandsPerSubmenu = 1000
+
+// padding for popup view
+var popUpPadding = 20
+
+// Padding for TTS popup
+var ttsPopUpPadding = 10
+
+// -------------------------
+var sliderBarWidth = 400
+var sliderBarHeight = 50
+var sliderBarRadius = 3
+var sliderBarBorderWidth = 1
+var sliderTextColor = "white"
+var sliderBarBorderColor = "white"
+var sliderBarFillColor = "white"
+
+// -------------------------
+var scrollableMessageTextColor = "white"
+var scrollableMessageScrollBarColor = "gray"
+var scrollableMessageScrollBarWidth = 10
+
+// Padding for hardware and simulation panels
+var panelPadding = 20
+
+// Scale for pressed icon in menu
+var pressedIconScale = 1.1
+
+// Values of color effect for highlighted button
+var highlightedButtonHue = 0.9
+var highlightedButtonSaturation = 0.0
+var highlightedButtonLightness = 0.1
+
+// Values of color effect for disabled button
+var disabledButtonHue = 0.0
+var disabledButtonSaturation = -1.0
+var disabledButtonLightness = 0.1
+
+// Count of rows for grid menu
+var menuRowCount = 2
+
+// Count of columns for grid menu
+var menuColumnCount = 3
+
+// Position for element that came without position value (should be always at the end)
+var positionOfElementWithoutPosition = 1001
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml
new file mode 100644
index 0000000000..7e9326e9d8
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml
@@ -0,0 +1,98 @@
+/**
+ * @file ContactsListModel.qml
+ * @brief List of contacts.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel
+{
+ // TODO {ALeshin}: This list model should be sorted in ABC and Upper/lower case order,
+ // when it will be filled dynamically.
+ ListElement { name: "Aaron" ; phone:"(614)555-2444";type:"Mobile"}
+ ListElement { name: "Adrian" ; phone:"(740)245-3434";type:"Mobile" }
+ ListElement { name: "Albert" ; phone:"(614)245-5584";type:"Mobile" }
+ ListElement { name: "Alice" ; phone:"(313)878-3566";type:"Office"}
+ ListElement { name: "Alec" ; phone:"(917)608-2418";type:"Mobile"}
+ ListElement { name: "Alexander" ; phone:"(614)608-2400";type:"Home"}
+ ListElement { name: "Alexander Vasil'evich Michail Leontiy" ; phone:"(614)608-2400";type:"Mobile"}
+ ListElement { name: "Amber" ; phone:"(614)608-2111";type:"Mobile"}
+ ListElement { name: "Amy" ; phone:"(440)245-3434";type:"Mobile" }
+ ListElement { name: "Andy" ; phone:"(313)245-3434";type:"Mobile" }
+ ListElement { name: "Antje" ; phone:"(567)245-3434";type:"Home" }
+ ListElement { name: "buddy" ; phone:"(614)813-6610";type:"Mobile" }
+ ListElement { name: "Barry" ; phone:"(313)555-2211";type:"Mobile" }
+ ListElement { name: "Bea" ; phone:"(614)455-3434";type:"Mobile" }
+ ListElement { name: "Ben" ; phone:"(614)882-1843";type:"Office" }
+ ListElement { name: "Blake" ; phone:"(330)149-7778";type:"Mobile" }
+ ListElement { name: "Bob Mould" ; phone:"(313)245-3434";type:"Mobile" }
+ ListElement { name: "Brian" ; phone:"(614)332-7499";type:"Mobile" }
+ ListElement { name: "Calvin" ; phone:"(614)442-9974";type:"Mobile" }
+ ListElement { name: "Carl" ; phone:"(567)773-3434";type:"Home" }
+ ListElement { name: "Cat Power" ; phone:"(313)608-3434";type:"Home"}
+ ListElement { name: "Cathy" ; phone:"(313)444-456";type:"Home"}
+ ListElement { name: "Chris" ; phone:"(734)997-6514";type:"Home" }
+ ListElement { name: "Cloud Nothings"; phone:"(444)608-543";type:"Mobile"}
+ ListElement { name: "Cody" ; phone:"(567)365-8413";type:"Home" }
+ ListElement { name: "Curtis" ; phone:"(614)245-1547";type:"Office" }
+ ListElement { name: "Dakota" ; phone:"(567)555-4444";type:"Home" }
+ ListElement { name: "Dale" ; phone:"(567)723-1974";type:"Mobile" }
+ ListElement { name: "Dallas"; phone:"(614)556-879";type:"Home"}
+ ListElement { name: "Damian" ; phone:"(614)245-3434";type:"Office" }
+ ListElement { name: "Daniel"; phone:"(614)556-879";type:"Home"}
+ ListElement { name: "Darina"; phone:"(313)895-888";type:"Mobile"}
+ ListElement { name: "Dee "; phone:"(313)432-3434";type:"Home"}
+// ListElement { name: "Edward" ; phone:"(917)608-975";type:"Office"}
+ ListElement { name: "Ferdinand" ; phone:"(917)879-795";type:"Mobile"}
+ ListElement { name: "gomez" ; phone:"(313)455-543";type:"Mobile"}
+ ListElement { name: "Harry Potter"; phone:"(313)888-432";type:"Home"}
+ ListElement { name: "Ivan"; phone:"(313)996-225";type:"Home"}
+// ListElement { name: "James" ; phone:"(917)608-3434";type:"Mobile"}
+ ListElement { name: "Karen"; phone:"(313)998-332";type:"Home"}
+ ListElement { name: "Luis Torres"; phone:"(313)779-111";type:"Home"}
+ ListElement { name: "Mary"; phone:"(313)234-098";type:"Mobile"}
+ ListElement { name: "Neil"; phone:"(313)444-112";type:"Mobile"}
+ ListElement { name: "Oswald"; phone:"(313)456-921";type:"Mobile"}
+ ListElement { name: "Oscar"; phone:"(313)332-778";type:"Home"}
+ ListElement { name: "~1123"; phone:"(313)1332";type:"Home"}
+ ListElement { name: "Patrice"; phone:"(313)789-111";type:"Mobile"}
+ ListElement { name: "Queen Elizabeth"; phone:"(313)897-666";type:"Mobile"}
+ ListElement { name: "Rose"; phone:"(313)111-211";type:"Mobile"}
+ ListElement { name: "Susell"; phone:"(313)345-122";type:"Home"}
+ ListElement { name: "Thomas"; phone:"(917)608-342";type:"Mobile"}
+ ListElement { name: "Titus Andronicus" ; phone:"(917)608-321";type:"Office"}
+ ListElement { name: "Toretto" ; phone:"(917)608-3434";type:"Home"}
+ ListElement { name: "Uhl" ; phone:"(313)444-654";type:"Office"}
+ ListElement { name: "willi" ; phone:"(313)224-5712";type:"Office"}
+ ListElement { name: "Wanda" ; phone:"(313)666-6969";type:"Office"}
+ ListElement { name: "wanda" ; phone:"(313)666-6969";type:"Office"}
+ ListElement { name: "Zara" ; phone:"(313)231-009";type:"Mobile"}
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
new file mode 100644
index 0000000000..659a8eabd7
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
@@ -0,0 +1,659 @@
+/**
+ * @file DataStorage.qml
+ * @brief Container for data.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "Internal.js" as Internal
+import "Constants.js" as Constants
+
+QtObject {
+ property string contactsFirstLetter // first letter of contact's name that need to find at contact list
+ property ApplicationModel currentApplication: ApplicationModel { }
+ property SliderModel uiSlider: SliderModel { }
+ property PerformAudioPassThruModel uiAudioPassThru: PerformAudioPassThruModel { }
+ property ScrollableMessageModel scrollableMessageModel: ScrollableMessageModel { }
+
+ function getApplication(appId) {
+ console.log("enter");
+ for(var i = 0; i < applicationList.count; i++) {
+ if(applicationList.get(i).appId === appId) {
+ console.log("Application found", applicationList.get(i));
+ return applicationList.get(i);
+ }
+ }
+ console.log("exit");
+ }
+
+ function getStashedApplication(appId) {
+ console.log("enter getStashedApplication function");
+ for(var i = 0; i < stashedApplicationsList.count; i++) {
+ if(stashedApplicationsList.get(i).appId === appId) {
+ console.log("Application found", stashedApplicationsList.get(i));
+ return stashedApplicationsList.get(i);
+ }
+ }
+ console.log("exit getStashedApplication: application was not found");
+ }
+
+ onApplicationListChanged: {
+ console.log("onApplicationListChanged()");
+ setCurrentApplication(appId);
+ }
+
+ function setCurrentApplication(appId) {
+ console.log("Enter setCurrentApplication function");
+ var oldApplicationContext = applicationContext;
+ if (currentApplication.appId !== appId) {
+ applicationContext = false;
+ }
+
+ for(var i = 0; i < applicationList.count; i++) {
+ if(applicationList.get(i).appId === appId) {
+ currentApplication.appId = appId
+ var application = applicationList.get(i)
+
+ currentApplication.appName = application.appName
+ currentApplication.appType = application.appType
+ currentApplication.appIcon.source = application.icon
+ currentApplication.playPauseState = application.playPauseState
+ currentApplication.options = application.options
+ currentApplication.softButtons = application.softButtons
+ currentApplication.navigationSoftButtons = application.navigationSoftButtons
+ currentApplication.alertManeuverSoftButtons = application.alertManeuverSoftButtons
+ currentApplication.customPresets = application.customPresets
+
+ if (application.navigationModel.text1 !== undefined) {
+ currentApplication.navigationModel.text1 = application.navigationModel.text1
+ }
+ if (application.navigationModel.text2 !== undefined) {
+ currentApplication.navigationModel.text2 = application.navigationModel.text2
+ }
+ if (application.navigationModel.totalDistance !== undefined) {
+ currentApplication.navigationModel.totalDistance = application.navigationModel.totalDistance
+ }
+ if (application.navigationModel.eta !== undefined) {
+ currentApplication.navigationModel.eta = application.navigationModel.eta
+ }
+ if (application.navigationModel.timeToDestination !== undefined) {
+ currentApplication.navigationModel.timeToDestination = application.navigationModel.timeToDestination
+ }
+ if (application.navigationModel.turnIcon !== undefined) {
+ currentApplication.navigationModel.turnIcon = application.navigationModel.turnIcon
+ }
+ if (application.navigationModel.nextTurnIcon !== undefined) {
+ currentApplication.navigationModel.nextTurnIcon = application.navigationModel.nextTurnIcon
+ }
+ if (application.navigationModel.distanceToManeuver !== undefined) {
+ currentApplication.navigationModel.distanceToManeuver = application.navigationModel.distanceToManeuver
+ }
+ if (application.navigationModel.distanceToManeuverScale !== undefined) {
+ currentApplication.navigationModel.distanceToManeuverScale = application.navigationModel.distanceToManeuverScale
+ }
+ if (application.navigationModel.maneuverComplete !== undefined) {
+ currentApplication.navigationModel.maneuverComplete = application.navigationModel.maneuverComplete
+ }
+ if (application.navigationModel.appID !== undefined) {
+ currentApplication.navigationModel.appID = application.navigationModel.appID
+ }
+ if (application.hmiUIText.mainField1 !== undefined) {
+ currentApplication.hmiUIText.mainField1 = application.hmiUIText.mainField1
+ }
+ if (application.hmiUIText.mainField2 !== undefined) {
+ currentApplication.hmiUIText.mainField2 = application.hmiUIText.mainField2
+ }
+ if (application.hmiUIText.mainField3 !== undefined) {
+ currentApplication.hmiUIText.mainField3 = application.hmiUIText.mainField3
+ }
+ if (application.hmiUIText.mainField4 !== undefined) {
+ currentApplication.hmiUIText.mainField4 = application.hmiUIText.mainField4
+ }
+ if (application.hmiUIText.statusBar !== undefined) {
+ currentApplication.hmiUIText.statusBar = application.hmiUIText.statusBar
+ }
+ if (application.hmiUIText.mediaTrack !== undefined) {
+ currentApplication.hmiUIText.mediaTrack = application.hmiUIText.mediaTrack
+ }
+ if (application.hmiUIText.image !== undefined) {
+ currentApplication.hmiUIText.image = application.hmiUIText.image
+ }
+ if (application.hmiUIText.secondaryImage!== undefined) {
+ currentApplication.hmiUIText.secondaryImage= application.hmiUIText.secondaryImage
+ }
+ if (application.hmiUITextAlignment !== undefined) {
+ currentApplication.hmiUITextAlignment = application.hmiUITextAlignment
+ }
+ if (application.helpPrompt !== undefined) {
+ currentApplication.helpPrompt = application.helpPrompt
+ }
+ if (application.timeoutPrompt !== undefined) {
+ currentApplication.timeoutPrompt = application.timeoutPrompt
+ }
+ if (application.mediaClock.startTime !== undefined) {
+ currentApplication.mediaClock.startTime = application.mediaClock.startTime
+ }
+ if (application.mediaClock.endTime !== undefined) {
+ currentApplication.mediaClock.endTime = application.mediaClock.endTime
+ }
+ // Check fields with mandatory = false
+
+ if (application.menuIcon !== undefined) {
+ currentApplication.menuIcon.source = application.menuIcon
+ }
+ currentApplication.vrHelpTitle = application.vrHelpTitle
+ currentApplication.vrHelpTitleDefault = application.vrHelpTitleDefault
+ currentApplication.vrHelpTitlePerformInteraction = application.vrHelpTitlePerformInteraction
+ currentApplication.menuTitle = application.menuTitle
+ currentApplication.vrHelpItems = application.vrHelpItems
+ currentApplication.vrHelpItemsPerformInteraction = application.vrHelpItemsPerformInteraction
+ currentApplication.deviceName = application.deviceName
+ currentApplication.isMediaApplication = application.isMediaApplication
+ currentApplication.turnList = application.turnList
+ currentApplication.turnListSoftButtons = application.turnListSoftButtons
+ currentApplication.mediaClock.updateMode = application.mediaClock.updateMode
+ currentApplication.mediaClock.runningMode = application.mediaClock.runningMode
+ if (application.mediaClock.startTimeForProgress !== undefined) {
+ currentApplication.mediaClock.startTimeForProgress = application.mediaClock.startTimeForProgress
+ }
+ currentApplication.languageTTSVR = application.languageTTSVR
+ currentApplication.hmiDisplayLanguageDesired = application.hmiDisplayLanguageDesired
+ currentApplication.allowedFunctions = application.allowedFunctions
+ // This place is for adding new properties
+ }
+ }
+ applicationContext = oldApplicationContext;
+ currentApplicationChanged()
+ console.log("Exit setCurrentApplication function")
+ }
+
+ function addApplication(app) {
+ console.log("enter")
+ applicationList.append({
+ appName: app.appName,
+ ngnMediaScreenAppName: app.ngnMediaScreenAppName,
+ icon: app.icon,
+ menuIcon: {
+ value: "",
+ imageType: 1
+ },
+ deviceName: app.deviceName,
+ appId: app.appId,
+ hmiDisplayLanguageDesired: app.hmiDisplayLanguageDesired,
+ isMediaApplication: app.isMediaApplication,
+ appType: app.appType,
+ helpPrompt: "",
+ timeoutPrompt: "",
+ customPresets: app.customPresets ? app.customPresets : [],
+ playPauseState: 'Pause',
+ hmiUIText: app.hmiUIText,
+ hmiUITextAlignment: app.hmiUITextAlignment,
+ options: [],
+ turnList: [],
+ turnListSoftButtons: [],
+ mediaClock: app.mediaClock,
+ languageTTSVR: Common.Language.EN_US,
+ softButtons: [],
+ vrHelpTitle: "",
+ vrHelpTitlePerformInteraction: "",
+ vrHelpTitleDefault: "VR HELP",
+ menuTitle: "",
+ keyboardProperties: [],
+ vrHelpItems: [],
+ vrHelpItemsPerformInteraction: [],
+ vrHelpItemsDefault: {
+ text: "VrHelpItems - defaultText1",
+ image: "",
+ position: 1
+ },
+ navigationSoftButtons: [],
+ alertManeuverSoftButtons: [],
+ navigationModel: {
+ appID: -1,
+ text1: "",
+ text2: "",
+ totalDistance: "",
+ eta: "",
+ timeToDestination: "",
+ turnIcon: {
+ value: "",
+ imageType: -1
+ },
+ nextTurnIcon: {
+ value: "",
+ imageType: -1
+ },
+ distanceToManeuver: 0,
+ distanceToManeuverScale: 0,
+ maneuverComplete: false
+ },
+ allowedFunctions: []
+ // This place is for adding new properties
+ })
+ if (app.isMediaApplication) {
+ musicSourceModel.insert(0, {
+ "title": app.appName,
+ "qml": "views/SDLPlayerView.qml",
+ "appId": app.appId
+ })
+ }
+
+ console.log("exit")
+ }
+
+ function setApplicationProperties(appId, props) {
+ console.log("Enter setApplicationProperties function");
+
+ var app = getApplication(appId)
+ for (var p in props) {
+ console.debug(p)
+ if (props[p] !== undefined) {
+ app[p] = props[p]
+ }
+ }
+ if (currentApplication.appId === appId) {
+ setCurrentApplication(appId); // copy new values to current application
+ }
+ console.log("Exit setApplicationProperties function");
+ }
+
+ function removeApplication(appId) {
+ console.log("enter removeApplication");
+ for (var j = 0; j < musicSourceModel.count; ++j) {
+ if (musicSourceModel.get(j).appId === appId) {
+ musicSourceModel.remove(j);
+ break;
+ }
+ }
+ for (var i = 0; i < applicationList.count; i++) {
+ if (applicationList.get(i).appId === appId) {
+ applicationList.remove(i);
+ break;
+ }
+ }
+ console.log("exit removeApplication");
+ }
+
+ function stashApplication(appId) {
+ console.log("stashApplication enter");
+ stashedApplicationsList.append(getApplication(appId))
+ console.log("stashApplication exit");
+ }
+
+ function getResumeResult (appID) {
+
+ if (getStashedApplication(appId) && getApplication(appID)) {
+ var stashedApp = getStashedApplication(appId),
+ app = getApplication(appID);
+ if (stashedApp.options.count == app.options.count) {
+ for (var optionIndex = 0; optionIndex < stashedApp.options.count; ++optionIndex) {
+ if (app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) {
+ //comparison subMenu compare
+
+ if ( !((app.options.get(optionIndex).id === stashedApp.options.get(optionIndex).id) &&
+ (app.options.get(optionIndex).name === stashedApp.options.get(optionIndex).name) &&
+ (app.options.get(optionIndex).position === stashedApp.options.get(optionIndex).position) &&
+ (app.options.get(optionIndex).icon === stashedApp.options.get(optionIndex).icon))) {
+ return {
+ result: false
+ }
+ }
+
+ var stashedAppSubMenu = stashedApp.options.get(optionIndex).subMenu,
+ appSubMenuArray = app.options.get(optionIndex).subMenu;
+
+ if (stashedAppSubMenu.length != appSubMenuArray.length) {
+ return {
+ result: false
+ }
+ }
+
+ for (var subMenuIndex = 0; subMenuIndex < stashedAppSubMenu.length; subMenuIndex++) {
+ if ( !((appSubMenuArray[subMenuIndex].id === stashedAppSubMenu[subMenuIndex].id) &&
+ (appSubMenuArray[subMenuIndex].name === stashedAppSubMenu[subMenuIndex].name) &&
+ (appSubMenuArray[subMenuIndex].position === stashedAppSubMenu[subMenuIndex].position) &&
+ (appSubMenuArray[subMenuIndex].icon === stashedAppSubMenu[subMenuIndex].icon)
+ )) {
+ return {
+ result: false
+ }
+ }
+ }
+ } else {
+ //comparison Command compare
+ if ( !((app.options.get(optionIndex).id === stashedApp.options.get(optionIndex).id) &&
+ (app.options.get(optionIndex).name === stashedApp.options.get(optionIndex).name) &&
+ (app.options.get(optionIndex).position === stashedApp.options.get(optionIndex).position) &&
+ (app.options.get(optionIndex).icon === stashedApp.options.get(optionIndex).icon)
+ )) {
+ return {
+ result: false
+ }
+ }
+ }
+ }
+ // if all commands and subMenus were same
+ // rerturn SUCCESS result
+ return {
+ result: true
+ }
+ }
+ }
+
+ return {
+ result: false
+ }
+ }
+
+ property int systemContext
+ property int hmiContext
+ property bool applicationContext: false
+ property bool applicationSavedContext
+ property string routeText: ""
+ property PlayerState cdPlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState ipodPlayerState: PlayerState {
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ playPauseState: 'Pause'
+ }
+ property PlayerState usbPlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState linePlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState btPlayerState: PlayerState {
+ playPauseState: 'Pause'
+ albumImage: "../res/album_art.png"
+ trackNumber: "13/16"
+ trackName: "The Dog Days Are Over"
+ albumName: "Florence and the Machine"
+ }
+ property PlayerState amPlayerState: PlayerState {
+ songName: "So Far Around The Bend"
+ albumName: "The National"
+ presets: [ "1130", "950", "760", "1270", "1400", "2100", "940", "1001" ]
+ }
+ property PlayerState fmPlayerState: PlayerState {
+ songName: "So Far Around The Bend"
+ albumName: "The National"
+ presets: ["96.3", "107.9", "104.3", "101.9", "105.3", "100.5", "107.9", "103.4"]
+ }
+ property PlayerState siriusPlayerState: PlayerState {
+ songName: "So Far Around The Bend"
+ albumName: "The National"
+ presets: [ "Lithium", "Spectrum", "ESPN", "Alt Nation", "Lithium", "Spectrum", "ESPN", "Alt Nation" ]
+ }
+
+ property bool hmiVRAvailable: false
+ property bool hmiTTSAvailable: false
+ property bool hmiNavigationAvailable: false
+ property bool hmiVehicleInfoAvailable: false
+ property bool hmiUIAvailable: false
+
+ property int hmiUILanguage: Common.Language.EN_US
+ property int hmiTTSVRLanguage: Common.Language.EN_US
+
+ property ListModel deviceList: ListModel { }
+ property ListModel applicationList: ListModel { }
+ property ListModel stashedApplicationsList: ListModel { }
+ property ListModel vrCommands: ListModel {}
+
+ function reset () {
+ console.log("dataContainer reset enter");
+ routeText = ""
+ console.log("dataContainer reset exit");
+ }
+
+ function changeRegistrationUI (language, appID) {
+ console.log("dataContainer changeRegistrarionUI enter");
+ setApplicationProperties(appID, { hmiDisplayLanguageDesired: language });
+ console.log("dataContainer changeRegistrarionUI exit");
+ }
+
+ function changeRegistrationTTSVR(language, appID) {
+ console.log("dataContainer changeRegistrationTTSVR enter");
+ setApplicationProperties(appID, { languageTTSVR: language });
+ console.log("dataContainer changeRegistrationTTSVR exit");
+ }
+
+ function addCommand (cmdID, menuParams, cmdIcon, appID) {
+ console.debug("enter: " +
+ cmdID +
+ ", " +
+ (menuParams ?
+ "{" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}" : menuParams) +
+ ", " +
+ (cmdIcon ?
+ "{" + cmdIcon.value + ", " + cmdIcon.imageType + "}" : cmdIcon) +
+ ", " +
+ appID
+ )
+ var commandToAddPosition
+ var app = getApplication(appID)
+ var currentMenu = app.options
+ var maximumCommands = Constants.maximumCommandsPerSubmenu
+ var index = 0
+
+ if ((menuParams) && (menuParams.parentID)) { // Work with sub menu
+ var parentNotFound = true
+ for (var optionIndex = 0; optionIndex < app.options.count; ++optionIndex) {
+ if ((app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) && (app.options.get(optionIndex).id === menuParams.parentID)) {
+ currentMenu = app.options.get(optionIndex).subMenu
+ parentNotFound = false
+ maximumCommands += 1
+ }
+ }
+ if (parentNotFound) {
+ console.log("UI::addCommand(): parentID " + menuParams.parentID + " not found")
+ }
+ }
+
+ if (currentMenu.count < maximumCommands) {
+ if (menuParams && (menuParams.position !== undefined)) {
+ commandToAddPosition = menuParams.position
+ } else {
+ commandToAddPosition = Constants.positionOfElementWithoutPosition
+ }
+ for (var i = 0; i < currentMenu.count; i++) {
+ if (commandToAddPosition >= currentMenu.get(i).position) {
+ index = i + 1
+ } else {
+ break
+ }
+ }
+ currentMenu.insert( index,
+ { id: cmdID,
+ name: menuParams.menuName,
+ type: Internal.MenuItemType.MI_NODE,
+ position: commandToAddPosition,
+ icon: cmdIcon ? cmdIcon : {},
+ subMenu: []
+ })
+ } else {
+ console.log("addCommand(): too many commands in menu: ", menuParams.parentID, " rejecting")
+ throw Common.Result.REJECTED
+ }
+ console.debug("exit")
+ }
+
+ function deleteCommand (cmdID, appID) {
+ console.debug("enter: " + cmdID + ", " + appID)
+ for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
+ var option = getApplication(appID).options.get(optionIndex)
+ if (option.type === Internal.MenuItemType.MI_NODE) {
+ if (option.id === cmdID) {
+ getApplication(appID).options.remove(optionIndex)
+ break
+ }
+ }
+ if (option.type === Internal.MenuItemType.MI_SUBMENU) {
+ var subMenu = option.subMenu
+ var idMatchFound = false
+ for (var subOptionIndex = 0; subOptionIndex < subMenu.count; ++subOptionIndex) {
+ if (subMenu.get(subOptionIndex).id === cmdID) {
+ idMatchFound = true
+ if (subMenu !== currentApplication.currentSubMenu) {
+ subMenu.remove(subOptionIndex)
+ }
+ else {
+ console.log("UI::deleteCommand(): cannot remove item from current submenu")
+ throw Common.Result.IN_USE
+ }
+ break
+ }
+ }
+ if (idMatchFound) {
+ break
+ }
+ }
+ }
+ console.debug("exit")
+ }
+
+ function addSubMenu (menuID, menuParams, appID) {
+ console.debug("enter: " + menuID + ", {" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}, " + appID)
+ var app = getApplication(appID)
+ var index = 0
+ var count = app.options.count
+ var subMenuToAddPosition
+
+ if (count < Constants.maximumSubmenus) {
+ if (menuParams.position !== undefined) {
+ subMenuToAddPosition = menuParams.position
+ } else {
+ subMenuToAddPosition = Constants.positionOfElementWithoutPosition
+ }
+ for (var i = 0; i < count; i++) {
+ if (subMenuToAddPosition >= app.options.get(i).position) {
+ index = i + 1
+ } else {
+ break
+ }
+ }
+ app.options.insert(index, {
+ "id": menuID,
+ "name": menuParams.menuName,
+ "position": subMenuToAddPosition,
+ "type": Internal.MenuItemType.MI_SUBMENU,
+ "icon": undefined,
+ "subMenu": [{
+ "id": -1,
+ "name": menuParams.menuName,
+ "position": -1,
+ "type": Internal.MenuItemType.MI_PARENT,
+ "icon": {
+ "imageType": Common.ImageType.DYNAMIC,
+ "value": "../res/nav/turnArrow.png"
+ },
+ "subMenu": getApplication(appID).options
+ }]
+ })
+ }
+ else {
+ console.log("addSubMenu(): too many submenus, rejecting")
+ throw Common.Result.REJECTED
+ }
+ console.debug("exit")
+ }
+
+ function deleteSubMenu (menuID, appID) {
+ console.debug("enter: " + menuID + ", " + appID)
+ for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
+ var option = getApplication(appID).options.get(optionIndex)
+ if ((option.type === Internal.MenuItemType.MI_SUBMENU) && (option.id === menuID)) {
+ if (option.subMenu !== currentApplication.currentSubMenu) {
+ getApplication(appID).options.remove(optionIndex)
+ }
+ else {
+ console.log("UI::deleteSubMenu(): cannot remove current submenu")
+ throw Common.Result.IN_USE
+ }
+ break
+ }
+ }
+ console.debug("exit")
+ }
+ property VehicleInfoModel vehicleInfoModel: VehicleInfoModel { }
+ property bool activeVR: false
+ property int driverDistractionState: Common.DriverDistractionState.DD_OFF
+ onDriverDistractionStateChanged: {
+ sdlUI.onDriverDistraction(driverDistractionState);
+ }
+ property bool activeTTS: false
+ property var activePopup: [] // Stack of names of active pop ups
+ property int popups: 0
+
+ property bool activeAlert: false
+
+ onActiveVRChanged: setSystemContext()
+ onActiveAlertChanged: setSystemContext()
+ onPopupsChanged: setSystemContext()
+
+ function setSystemContext () {
+ console.debug("enter")
+ if (popups > 0) {
+ systemContext = Common.SystemContext.SYSCTXT_HMI_OBSCURED
+ }
+ else if (activeAlert) {
+ systemContext = Common.SystemContext.SYSCTXT_ALERT
+ }
+ else if (activeVR) {
+ systemContext = Common.SystemContext.SYSCTXT_VRSESSION
+ }
+ else if (contentLoader.item !== null) {
+ systemContext = contentLoader.item.systemContext
+ }
+ console.debug("exit")
+ }
+ property MusicSourceModel musicSourceModel: MusicSourceModel {
+ }
+
+ property SettingsSourceModel settingsSourceModel: SettingsSourceModel {
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/Internal.js b/src/components/qt_hmi/qml_model_qt5/models/Internal.js
new file mode 100644
index 0000000000..53d7640136
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/Internal.js
@@ -0,0 +1,176 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+.pragma library
+.import "../hmi_api/Common.js" as Common
+
+var MenuItemType = {
+ MI_NODE: 0,
+ MI_SUBMENU: 1,
+ MI_PARENT: 2
+}
+
+function activePageChoose(flickElement, pages) {
+ if (flickElement.contentX <= 0) {
+ return 0
+ }
+ else if ( (flickElement.contentWidth - flickElement.contentX) < flickElement.width) {
+ return pages -1
+ }
+ else {
+ if ( (flickElement.contentX % flickElement.width) >= (1/6 * flickElement.width)) {
+ return Math.ceil(flickElement.contentX / flickElement.width)
+ }
+ else if ( (flickElement.contentX % flickElement.width) > 0) {
+ return Math.floor(flickElement.contentX / flickElement.width)
+ }
+ }
+}
+
+var MediaClockUpdateMode = {
+ MCU_COUNTUP: 0,
+ MCU_COUNTDOWN: 1,
+}
+
+var MediaClockRunningMode = {
+ MCR_RUNNING: 0,
+ MCR_STOPPED: 1
+}
+
+function chooseAppStartScreen(appType, isMediaApplication) {
+ if (checkBit(appType, Common.AppHMIType.NAVIGATION)) {
+ return "./views/SDLNavi.qml"
+ } else if (isMediaApplication) {
+ return "./views/SDLPlayerView.qml"
+ } else {
+ return "./views/SDLNonMediaView.qml"
+ }
+}
+
+function appendVrHelpItem (arrayElement, index, array) {
+ this.append({
+ text: arrayElement.text,
+ image: arrayElement.image ? arrayElement.image : "",
+ position: arrayElement.position
+ })
+}
+
+function checkBit(value, bitPosition) {
+ return (value & (1 << bitPosition))
+}
+
+function getArrayForPresetRow(app) {
+ var array = []
+ for (var i = 0; i < app.customPresets.count; i++) {
+ array.push(app.customPresets.get(i).text)
+ }
+ return array
+}
+
+function pad (string, length, lead) {
+ if (!lead) {
+ lead = '0'
+ }
+ var paddedString = "" + string
+ while (paddedString.length < length) {
+ paddedString = lead + paddedString
+ }
+ return paddedString
+}
+
+function hmsTime (hours, minutes, seconds) {
+ return 60 * (60 * hours + minutes) + seconds
+}
+
+function hmsTimeToString (hmsTime) {
+ if (hmsTime === -1) {
+ return "0:00:00"
+ }
+
+ var _time = hmsTime
+ var seconds = _time % 60
+ _time -= seconds
+ _time /= 60
+ var minutes = _time % 60
+ _time -= minutes
+ _time /= 60
+ var hours = _time
+ var string = ""
+ string += hours
+ string += ":"
+ string += pad(minutes, 2)
+ string += ":"
+ string += pad(seconds, 2)
+ return string
+}
+
+function stringToHmsTime (hmsString) {
+ console.debug("enter: \"" + hmsString + "\"")
+ var substrings = hmsString.split(":")
+ var seconds = substrings.length > 0 ? parseInt(substrings.pop()) : 0
+ if (seconds >= 60) {
+ console.log("incorrect field \"seconds\": " + seconds)
+ console.debug("exit")
+ return 0
+ }
+ var minutes = substrings.length > 0 ? parseInt(substrings.pop()) : 0
+ if (minutes >= 60) {
+ console.log("incorrect field \"minutes\": " + minutes)
+ console.debug("exit")
+ return 0
+ }
+ var hours = substrings.length > 0 ? parseInt(substrings.pop()) : 0
+ console.debug("exit")
+ return hmsTime(hours, minutes, seconds)
+}
+
+function mediaClockUpdateModeToString (mediaClockUpdateMode) {
+ switch (mediaClockUpdateMode) {
+ case MediaClockUpdateMode.MCU_COUNTUP:
+ return "Internal.MediaClockUpdateMode.MCU_COUNTUP"
+ case MediaClockUpdateMode.MCU_COUNTDOWN:
+ return "Internal.MediaClockUpdateMode.MCU_COUNTDOWN"
+ default:
+ return ""
+ }
+}
+
+function mediaClockRunningModeToString (mediaClockRunningMode) {
+ switch (mediaClockRunningMode) {
+ case MediaClockRunningMode.MCR_RUNNING:
+ return "Internal.MediaClockRunningMode.MCR_RUNNING"
+ case MediaClockRunningMode.MCR_STOPPED:
+ return "Internal.MediaClockRunningMode.MCR_STOPPED"
+ default:
+ return ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml
new file mode 100644
index 0000000000..a2f659c393
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml
@@ -0,0 +1,79 @@
+/**
+ * @file MainMenuListModel.qml
+ * @brief Main menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel
+{
+ ListElement {
+ name: "Climate"
+ icon: "../res/snow.png"
+ qml: "./views/ClimateControlView.qml"
+ }
+
+ ListElement {
+ name: "Navigation"
+ icon: "../res/arrow.png"
+ qml: "./views/NavigationNoRouteGridView.qml"
+ }
+
+ ListElement {
+ name: "Media"
+ icon: "../res/notes.png"
+ qml: "./views/MusicSourceView.qml"
+ }
+
+ ListElement {
+ name: "Settings"
+ icon: "../res/gear.png"
+ qml: "./views/SettingsSourceView.qml"
+ }
+
+ ListElement {
+ name: "Apps"
+ icon: "../res/apps.png"
+ qml: "./views/ApplicationListView.qml"
+ }
+
+ ListElement {
+ name: "Phone"
+ icon: "../res/phone/phone.png"
+ qml: "./views/PhoneMenuGridView.qml"
+ }
+
+ ListElement {
+ name: "Car"
+ icon: "../res/car.png"
+ qml: "./views/CarMenuGridView.qml"
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
new file mode 100644
index 0000000000..cae82c36f1
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
@@ -0,0 +1,124 @@
+/**
+ * @file MediaClockModel.qml
+ * @brief Media clock model
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "Internal.js" as Internal
+
+QtObject {
+ property int updateMode
+ property int runningMode
+ property int startTime
+ property int endTime
+ property int upperTimeLimit: 60 * 60 * 60 - 1
+ property int startTimeForProgress
+ property real progress
+
+ property Timer timer: Timer {
+ id: timer
+ interval: 1000
+ repeat: true
+ onTriggered: onTimer()
+ }
+ onRunningModeChanged: {
+ if (runningMode === Internal.MediaClockRunningMode.MCR_STOPPED) {
+ timer.stop()
+ } else {
+ timer.start()
+ }
+ }
+
+ onStartTimeChanged: {
+ onProgress()
+ }
+
+ onEndTimeChanged: {
+ onProgress()
+ }
+
+ onStartTimeForProgressChanged: {
+ onProgress()
+ }
+
+ function onTimer () {
+ switch (updateMode) {
+ case Internal.MediaClockUpdateMode.MCU_COUNTUP:
+ if (endTime !== -1) {
+ if (startTime < endTime) {
+ startTime++
+ } else {
+ timer.stop()
+ runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ console.debug("count Up timer stopped")
+ }
+ } else {
+ if (startTime < upperTimeLimit) {
+ startTime++
+ } else {
+ startTime = 0
+ }
+ }
+ break
+ case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
+ console.debug("count down")
+ if (--startTime === 0) {
+ timer.stop()
+ runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
+ startTime = endTime = -1
+ console.debug("count Down timer stopped")
+ }
+ break
+ }
+ dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
+ "mediaClock": {startTime: startTime,
+ endTime: endTime,
+ updateMode: updateMode,
+ runningMode: runningMode,
+ startTimeForProgress: startTimeForProgress
+ }
+ })
+ }
+
+ function onProgress () {
+ if (startTime === -1) {
+ progress = 0
+ } else {
+ if (updateMode === Internal.MediaClockUpdateMode.MCU_COUNTUP) {
+ progress = (endTime !== -1) ? (startTime / endTime) : (startTime / upperTimeLimit)
+ } else {
+ progress = (endTime !== -1) ? ( (startTime - endTime) / (startTimeForProgress - endTime) )
+ : (startTime / startTimeForProgress)
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml
new file mode 100644
index 0000000000..7497d987d4
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml
@@ -0,0 +1,78 @@
+/**
+ * @file MusicSourceModel.qml
+ * @brief Music source menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel
+{
+ ListElement {
+ title: "FM"
+ qml: "./views/FMPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "AM"
+ qml: "./views/AMPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "BT Audio"
+ qml: "./views/BTPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "Sirius"
+ qml: "./views/SiriusPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "CD"
+ qml: "./views/CDPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "iPod"
+ qml: "./views/IPodPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "USB"
+ qml: "./views/UsbPlayerView.qml"
+ appId: 0
+ }
+ ListElement {
+ title: "LineIn"
+ qml: "./views/LineInPlayerView.qml"
+ appId: 0
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml
new file mode 100644
index 0000000000..6e434495a6
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml
@@ -0,0 +1,72 @@
+/**
+ * @file NavigationMenuModel.qml
+ * @brief Model for navigation menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+ListModel
+{
+ ListElement {
+ title: "Home"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Keyboard"
+ icon: "../res/buttons/long_oval_btn.png"
+ qml: "./views/NavigationKeyboardView.qml"
+ }
+ ListElement {
+ title: "Favorites"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Work"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Recent"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "POI"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Scout"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+ ListElement {
+ title: "Waze"
+ icon: "../res/buttons/long_oval_btn.png"
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml b/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml
new file mode 100644
index 0000000000..0abbe6b309
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml
@@ -0,0 +1,50 @@
+/**
+ * @file NavigationModel.qml
+ * @brief Model for Navigation.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+QtObject {
+ property string text1: ""
+ property string text2: ""
+ property string totalDistance: ""
+ property string eta: ""
+ property string timeToDestination: ""
+ property var turnIcon
+ property var nextTurnIcon
+
+ property real distanceToManeuver: 0
+ property real distanceToManeuverScale: 0
+ property bool maneuverComplete: false
+ property int appID: -1
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml b/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml
new file mode 100644
index 0000000000..0952b7d8ad
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml
@@ -0,0 +1,43 @@
+/**
+ * @file PerformAudioPassThruModel.qml
+ * @brief Data model audio pass thru.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+QtObject {
+ property string appName: ""
+ property string firstLine: ""
+ property string secondLine: ""
+ property int timeout: 0
+ property bool running: false
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml
new file mode 100644
index 0000000000..519f48a809
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml
@@ -0,0 +1,78 @@
+/**
+ * @file PhoneMenuModel.qml
+ * @brief Phone menu list of elements.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel
+{
+ ListElement {
+ name: "phone"
+ icon: "../res/phone/phone.png"
+ qml: ""
+ }
+ ListElement {
+ name: "contacts"
+ icon: "../res/phone/contacts.png"
+ qml: "./views/PhoneKeyboardView.qml"
+ }
+ ListElement {
+ name: "messages"
+ icon: "../res/phone/messages.png"
+ qml: ""
+ }
+ ListElement {
+ name: "DND"
+ icon: "../res/phone/dnd_off.png"
+ qml: ""
+ }
+ ListElement {
+ name: "texts"
+ icon: "../res/phone/texts.png"
+ qml: ""
+ }
+ ListElement {
+ name: "recent"
+ icon: "../res/phone/recent.png"
+ qml: ""
+ }
+ ListElement {
+ name: "keyboard"
+ icon: "../res/phone/keypad.png"
+ qml: ""
+ }
+ ListElement {
+ name: "more"
+ icon: "../res/phone/more.png"
+ qml: ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml b/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml
new file mode 100644
index 0000000000..9707f35193
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml
@@ -0,0 +1,51 @@
+/**
+ * @file PlayerState.qml
+ * @brief List of parameters for each player.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+// Player state for all players except SDL media player
+Item {
+ // Media players
+ property string playPauseState
+ property string albumImage
+ property string trackNumber
+ property int songPosition
+ property string trackName
+
+ // Radio Players
+ property var presets: []
+
+ // Both players
+ property string songName
+ property string albumName
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml
new file mode 100644
index 0000000000..9f45a5d06d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml
@@ -0,0 +1,54 @@
+/**
+ * @file ScrollableMessageModel.qml
+ * @brief Model for Scrollable Message.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+QtObject {
+ property string longMessageText: "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
+ "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh"
+ property ListModel softButtons: ListModel {}
+ property int appId: -1
+ property int timeout: 0
+ property var async
+ property bool running: false
+ property int result: -1
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml b/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml
new file mode 100644
index 0000000000..fed6d499d9
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml
@@ -0,0 +1,92 @@
+/**
+ * @file SettingsSourceModel.qml
+ * @brief Settings source menu list of elements.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel
+{
+ ListElement {
+ title: "Allow SDL Functionality"
+ qml: "./views/SDLFunctionalityView.qml"
+ appId: 0
+ action: ""
+ }
+ ListElement {
+ title: "Update SDL"
+ qml: ""
+ appId: 0
+ action: "update_sdl"
+ }
+ ListElement {
+ title: "Policy table update status"
+ qml: ""
+ appId: 0
+ action: "get_status_update"
+ }
+ ListElement {
+ title: "Send request GetURLS"
+ qml: ""
+ appId: 0
+ action: "get_urls"
+ }
+ ListElement {
+ title: "Statistics info settings"
+ qml: "./views/StatisticsInfoView.qml"
+ appId: 0
+ action: ""
+ }
+ ListElement {
+ title: "App permissions"
+ qml: "./views/PolicyAppListView.qml"
+ appId: 0
+ action: ""
+ }
+ ListElement {
+ title: "Device state change"
+ qml: "./views/DeviceStateChangedView.qml"
+ appId: 0
+ action: ""
+ }
+ ListElement {
+ title: "System Error"
+ qml: "./views/SystemErrorView.qml"
+ appId: 0
+ action: ""
+ }
+ ListElement {
+ title: "System Request"
+ qml: "./views/SystemRequestView.qml"
+ appId: 0
+ action: ""
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml
new file mode 100644
index 0000000000..a102b4ee27
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml
@@ -0,0 +1,401 @@
+/**
+ * @file SettingsStorage.qml
+ * @brief Storage for keeping settings.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "../models/Internal.js" as Internal
+
+Item
+{
+ property var sdlLanguagesList: [
+ Common.Language.EN_US,
+ Common.Language.ES_MX,
+ Common.Language.FR_CA,
+ Common.Language.DE_DE,
+ Common.Language.ES_ES,
+ Common.Language.EN_GB,
+ Common.Language.RU_RU,
+ Common.Language.TR_TR,
+ Common.Language.PL_PL,
+ Common.Language.FR_FR,
+ Common.Language.IT_IT,
+ Common.Language.SV_SE,
+ Common.Language.PT_PT,
+ Common.Language.NL_NL,
+ Common.Language.ZH_TW,
+ Common.Language.JA_JP,
+ Common.Language.AR_SA,
+ Common.Language.KO_KR,
+ Common.Language.PT_BR,
+ Common.Language.CS_CZ,
+ Common.Language.DA_DK,
+ Common.Language.NO_NO
+ ]
+
+ property var displayCapabilities: {
+ "displayType": Common.DisplayType.GEN2_8_DMA,
+ "textFields": [
+ Common.TextFieldName.mainField1,
+ Common.TextFieldName.mainField2,
+ Common.TextFieldName.mainField3,
+ Common.TextFieldName.mainField4,
+ Common.TextFieldName.statusBar,
+ Common.TextFieldName.mediaClock,
+ Common.TextFieldName.mediaTrack,
+ Common.TextFieldName.alertText1,
+ Common.TextFieldName.alertText2,
+ Common.TextFieldName.alertText3,
+ Common.TextFieldName.scrollableMessageBody,
+ Common.TextFieldName.initialInteractionText,
+ Common.TextFieldName.navigationText1,
+ Common.TextFieldName.navigationText2,
+ Common.TextFieldName.ETA,
+ Common.TextFieldName.totalDistance,
+ Common.TextFieldName.navigationText,
+ Common.TextFieldName.audioPassThruDisplayText1,
+ Common.TextFieldName.audioPassThruDisplayText2,
+ Common.TextFieldName.sliderHeader,
+ Common.TextFieldName.sliderFooter,
+ Common.TextFieldName.notificationText
+ ],
+ "mediaClockFormats": [
+ Common.MediaClockFormat.CLOCK1,
+ Common.MediaClockFormat.CLOCK2,
+ Common.MediaClockFormat.CLOCK3,
+ Common.MediaClockFormat.CLOCKTEXT1,
+ Common.MediaClockFormat.CLOCKTEXT2,
+ Common.MediaClockFormat.CLOCKTEXT3,
+ Common.MediaClockFormat.CLOCKTEXT4
+ ],
+ "graphicSupported": true,
+ "imageCapabilities": [ Common.ImageType.DYNAMIC ],
+ "templatesAvailable": [ "" ],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 480
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": true,
+ "doublePressAvailable": true
+ }
+ },
+ "numCustomPresetsAvailable": 6
+ }
+
+ property var softButtonCapabilities: {
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ }
+
+ property var buttonCapabilities: []
+
+ readonly property string fileIVSU: "hmi/res/IVSU/PROPRIETARY_REQUEST"
+
+ property string filePTSnapshot: ""
+
+ property int timeoutPTExchange: 500
+
+ property var retriesPTExchange: []
+
+ property var urlsPTExchange: []
+
+ property int currentRetry: 0
+
+ property int currentUrl: 0
+
+ property string appIdIVSU: ""
+
+ property var urlsIVSU: []
+
+ function updateStatus(result) {
+ console.debug("Result update SDL:", result);
+ var text = {}
+ text[Common.UpdateResult.UP_TO_DATE] = "UP_TO_DATE";
+ text[Common.UpdateResult.UPDATING] = "UPDATING";
+ text[Common.UpdateResult.UPDATE_NEEDED] = "UPDATE_NEEDED";
+ ttsPopUp.activate(text[result])
+ }
+
+ function startPTExchange(urls) {
+ console.log("enter startPTExchange");
+ urlsPTExchange = urls;
+ currentRetry = 0;
+ currentUrl = 0;
+ tryUpdatePolicy();
+ console.log("exit startPTExchange");
+ }
+
+ function startIVSU(urls) {
+ urlsIVSU = urls;
+ sendSystemRequest(Common.RequestType.PROPRIETARY, urlsIVSU[0].url,
+ fileIVSU, appIdIVSU);
+ }
+
+ function getUrl() {
+ console.log("enter getUrl");
+ if (currentUrl >= 0 && currentUrl < urlsPTExchange.length) {
+ var url = urlsPTExchange[currentUrl];
+ currentUrl = (currentUrl + 1) / urlsPTExchange.length;
+ console.log("exit getUrl");
+ return url;
+ } else {
+ console.log("exit getUrl (empty)");
+ return {url: ""}
+ }
+ }
+
+ function getInterval() {
+ if (currentRetry >= 0 && currentRetry < retriesPTExchange.length) {
+ var interval = (timeoutPTExchange + retriesPTExchange[currentRetry]) * 1000;
+ currentRetry++;
+ return interval;
+ } else {
+ return 0;
+ }
+ }
+
+ function sendSystemRequest(type, url, fileName, applicationId) {
+ console.log("enter sendSystemRequest");
+ var offset = 1000;
+ var length = 10000;
+ var appId = applicationId ? applicationId : "default";
+ var file = fileName ? fileName : fileIVSU;
+
+ sdlBasicCommunication.onSystemRequest(type, url, Common.FileType.JSON,
+ offset, length, timeoutPTExchange,
+ file, appId);
+ console.log("enter sendSystemRequest");
+ }
+
+ function tryUpdatePolicy() {
+ console.log("enter tryUpdatePolicy");
+ if (urlsPTExchange.length) {
+ var url = getUrl();
+ sendSystemRequest(Common.RequestType.PROPRIETARY, url.url, filePTSnapshot, url.policyAppId);
+ } else {
+ sendSystemRequest(Common.RequestType.PROPRIETARY);
+ }
+
+ retriesTimer.interval = getInterval();
+ if (retriesTimer.interval > 0) {
+ console.log("start retry strategy");
+ retriesTimer.start();
+ }
+ console.log("exit tryUpdatePolicy");
+ }
+
+ function systemRequest(type) {
+ if (urlsPTExchange.length) {
+ sendSystemRequest(type, urlsPTExchange[0].url, null, urlsPTExchange[0].policyAppId);
+ } else {
+ sendSystemRequest(type);
+ }
+ }
+
+ function stopPTExchange(fileName) {
+ console.log("enter stopPTExchange");
+ retriesTimer.stop();
+ sdlSDL.onReceivedPolicyUpdate(fileName);
+ console.log("exit stopPTExchange");
+ }
+
+ Timer {
+ id: retriesTimer
+ interval: timeoutPTExchange; running: false; repeat: false
+ onTriggered: sendSystemRequest()
+ }
+
+ function activateApp (appId) {
+
+ console.debug("SDL.ActivateApp Request enter", appId);
+
+ RequestToSDL.SDL_ActivateApp(appId, function(isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority){
+ settingsContainer.activateApp_Response(appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority)
+ })
+
+ console.debug("SDL.ActivateApp Request exit");
+ }
+
+ function activateApp_Response (appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority) {
+
+ console.debug("activateApp_Response enter", appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority);
+
+ if (!isSDLAllowed) {
+
+ userActionPopUp.activate("Allow SDL Functionality request",
+ "Would you like to allow SDL functionality for device '" + device.name + "'?",
+ function(result){
+ allowSDLFunctionality(result, device)
+ },
+ true
+ )
+ }
+
+ if (isPermissionsConsentNeeded) {
+ RequestToSDL.SDL_GetListOfPermissions(appId, function(allowedFunctions){
+ settingsContainer.getListOfPermissions_Response(appId, allowedFunctions)
+ })
+ }
+
+ if (isAppPermissionsRevoked) {
+
+ appPermissionsRevoked(appId, appRevokedPermissions, "AppPermissionsRevoked")
+ }
+
+ if (isAppRevoked) {
+
+ RequestToSDL.SDL_GetUserFriendlyMessage(["AppUnsupported"], dataContainer.hmiUILanguage, function(messages){
+ settingsContainer.getUserFriendlyMessageAppPermissionsRevoked("AppUnsupported", messages)
+ });
+ } else if (isSDLAllowed && !isPermissionsConsentNeeded) {
+
+ dataContainer.setCurrentApplication(appId)
+ contentLoader.go(
+ Internal.chooseAppStartScreen(
+ dataContainer.currentApplication.appType,
+ dataContainer.currentApplication.isMediaApplication
+ ),
+ appId
+ )
+ }
+ }
+
+ function allowSDLFunctionality (result, device) {
+ console.log("allowSDLFunctionality enter", result, device);
+
+ sdlSDL.onAllowSDLFunctionality(device, result, Common.ConsentSource.GUI)
+
+ console.log("allowSDLFunctionality exit");
+ }
+
+ function getListOfPermissions_Response (appId, allowedFunctions) {
+ console.log("getListOfPermissions_Response enter");
+
+ var app = dataContainer.getApplication(appId);
+ var messageCodes = [];
+
+ app.allowedFunctions = allowedFunctions;
+
+ allowedFunctions.forEach(function (x) {
+ messageCodes.push(x.name);
+ });
+
+ RequestToSDL.SDL_GetUserFriendlyMessage(messageCodes, dataContainer.hmiUILanguage, function(messages){
+ settingsContainer.onAppPermissionConsent_Notification(appId, messages)
+ });
+
+ console.log("getListOfPermissions_Response exit");
+ }
+
+ function appPermissionsRevoked (appId, permissions, title) {
+
+ var messageCodes = [];
+
+ permissions.forEach(function (x) {
+ messageCodes.push(x.name);
+ });
+
+ messageCodes.push("AppPermissionsRevoked");
+
+ RequestToSDL.SDL_GetUserFriendlyMessage(messageCodes, dataContainer.hmiUILanguage, function(messages){
+ settingsContainer.getUserFriendlyMessageAppPermissionsRevoked(title, messages)
+ });
+ }
+
+ function getUserFriendlyMessageAppPermissionsRevoked (title, messages) {
+ var tts = "",
+ text = "";
+
+ messages.forEach(function (x) {
+ if (x.tts) {
+ tts += x.tts;
+ }
+ if (x.textBody) {
+ text += x.textBody;
+ }
+ });
+
+ if (tts) {
+ ttsPopUp.activate(tts)
+ }
+
+ userActionPopUp.activate(title, text, null, false)
+
+ }
+
+ function onAppPermissionConsent_Notification (appId, messages) {
+ console.log("onAppPermissionConsent_Notification enter");
+
+ onAppPermissionConsentPopUp.permissionItems.clear()
+
+ var tts = "";
+
+ for (var i = 0; i < messages.length; i++) {
+ onAppPermissionConsentPopUp.permissionItems.append({
+ "messageCode": messages[i].messageCode,
+ "label": messages[i].label,
+ "textBody": messages[i].textBody,
+ "allowed": false,
+ "id": messages[i].id
+ });
+
+ if (messages[i].tts) {
+ tts += x.tts;
+ }
+ }
+
+ if (tts) {
+ ttsPopUp.activate(tts)
+ }
+
+ onAppPermissionConsentPopUp.activate(appId)
+
+ console.log("onAppPermissionConsent_Notification enter");
+ }
+
+ function decrypt(file, appId) {
+ sendSystemRequest(Common.RequestType.FILE_RESUME, urlsIVSU[0].url, file,
+ appId);
+ }
+
+ function updateIVSU(appId) {
+ appIdIVSU = appId;
+ var service = 4; // service type for IVSU
+ RequestToSDL.SDL_GetURLS(service, startIVSU);
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml b/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml
new file mode 100644
index 0000000000..359eb5d59c
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml
@@ -0,0 +1,45 @@
+/**
+ * @file SliderModel.qml
+ * @brief Data model for slider.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+QtObject {
+ property string appName: ""
+ property string header: ""
+ property var footer: []
+ property int numTicks: 0
+ property int position: 0
+ property int timeout: 0
+ property bool running: false
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml b/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml
new file mode 100644
index 0000000000..997ce1ee0a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml
@@ -0,0 +1,234 @@
+/**
+ * @file VehicleInfoModel.qml
+ * @brief Data model for vehicle info.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+QtObject {
+ id: vehicleInfo
+ property real speed: 80.1
+ property int rpm: 5000
+ property real fuelLevel: 0.2
+ property int fuelLevel_State: Common.ComponentVolumeStatus.CVS_LOW
+ property real instantFuelConsumption: 2.2
+ property int driverBraking: Common.VehicleDataEventStatus.VDES_NO_EVENT
+ property int wiperStatus: Common.WiperStatus.OFF
+ property real engineTorque: 2.5
+ property real accPedalPosition: 0.5
+ property real steeringWheelAngle: 1.2
+ property real externalTemperature: 40.0
+ property string vin: '52-452-52-752'
+ property int odometer: 2
+ property int prndl: Common.PRNDL.FIFTH
+
+ property var headLampStatus: {
+ "lowBeamsOn": false,
+ "highBeamsOn": false,
+ "ambientLightSensorStatus": Common.AmbientLightStatus.TWILIGHT_1
+ }
+ property var deviceStatus: {
+ 'voiceRecOn': false,
+ 'btIconOn': false,
+ 'callActive': false,
+ 'phoneRoaming': false,
+ 'textMsgAvailable': false,
+ 'battLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
+ 'stereoAudioOutputMuted': false,
+ 'monoAudioOutputMuted': false,
+ 'signalLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
+ 'primaryAudioSource': Common.PrimaryAudioSource.NO_SOURCE_SELECTED,
+ 'eCallEventActive': false
+ }
+ property var bodyInformation: {
+ 'parkBrakeActive': false,
+ 'ignitionStableStatus': Common.IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE,
+ 'ignitionStatus': Common.IgnitionStatus.IS_UNKNOWN
+ }
+ property var beltStatus: {
+ 'driverBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'passengerBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'passengerBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'driverBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'leftRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'passengerChildDetected': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'rightRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'leftRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'rightRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'leftRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'rightRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow1BeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ 'middleRow1BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ }
+ property var tirePressure: {
+ 'pressureTelltale': Common.WarningLightStatus.WLS_ON,
+ 'leftFront': { status: Common.ComponentVolumeStatus.CVS_NORMAL},
+ 'rightFront': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
+ 'leftRear': { status: Common.ComponentVolumeStatus.CVS_NORMAL },
+ 'rightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
+ 'innerLeftRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
+ 'innerRightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN }
+ }
+ property var gps: {
+ 'longitudeDegrees': 42.3293,
+ 'latitudeDegrees': -83.0464,
+ 'utcYear': 2013,
+ 'utcMonth': 2,
+ 'utcDay': 14,
+ 'utcHours': 13,
+ 'utcMinutes': 16,
+ 'utcSeconds': 54,
+ 'compassDirection': Common.CompassDirection.SOUTHWEST,
+ 'pdop': 4,
+ 'hdop': 5,
+ 'vdop': 6,
+ 'actual': false,
+ 'satellites': 8,
+ 'dimension': Common.Dimension.Dimension_2D,
+ 'altitude': 7,
+ 'heading': 173,
+ 'speed': 2
+ }
+ property var ecuDIDData: {
+ 'data1': 'ECU 1 Test Data',
+ 'data2': 'ECU 2 Test Data'
+ }
+ property var eCallInfo: {
+ "eCallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_NORMAL,
+ "auxECallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_ACTIVE,
+ "eCallConfirmationStatus" : Common.ECallConfirmationStatus.ECCS_NORMAL
+ }
+ property var airbagStatus: {
+ "driverAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO_EVENT,
+ "driverSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
+ "driverCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
+ "passengerAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED,
+ "passengerCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_FAULT,
+ "driverKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
+ "passengerSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
+ "passengerKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED
+ }
+ property var emergencyEvent: {
+ "emergencyEventType" : Common.EmergencyEventType.EET_NO_EVENT,
+ "fuelCutoffStatus" : Common.EmergencyEventType.EET_FRONTAL,
+ "rolloverEvent" : Common.EmergencyEventType.EET_SIDE,
+ "maximumChangeVelocity" : Common.EmergencyEventType.EET_REAR,
+ "multipleEvents" : Common.EmergencyEventType.EET_ROLLOVER
+ }
+ property var clusterModeStatus: {
+ "powerModeActive" : true,
+ "powerModeQualificationStatus" : Common.PowerModeQualificationStatus.POWER_MODE_UNDEFINED,
+ "carModeStatus" : Common.CarModeStatus.CMS_NORMAL,
+ "powerModeStatus" : Common.PowerModeStatus.KEY_OUT
+ }
+ property var myKey: {
+ "e911Override": Common.VehicleDataStatus.VDS_NO_DATA_EXISTS
+ }
+
+
+ function sendGpsChange(){
+ sdlVehicleInfo.onGps(vehicleInfo.gps)
+ }
+ function sendSpeedChange(){
+ sdlVehicleInfo.onSpeed(vehicleInfo.speed)
+ }
+ function sendRpmChange(){
+ sdlVehicleInfo.onRpm(vehicleInfo.rpm)
+ }
+ function sendFuelLevelChange(){
+ sdlVehicleInfo.onFuelLevel(vehicleInfo.fuelLevel)
+ }
+ function sendFuelLevel_StateChange(){
+ sdlVehicleInfo.onFuelLevel_State(vehicleInfo.fuelLevel_State)
+ }
+ function sendInstantFuelConsumptionChange(){
+ sdlVehicleInfo.onInstantFuelConsumption(vehicleInfo.instantFuelConsumption)
+ }
+ function sendExternalTemperatureChange(){
+ sdlVehicleInfo.onExternalTemperature(vehicleInfo.externalTemperature)
+ }
+ function sendPrndlChange() {
+ if (dataContainer.vehicleInfoModel.prndl !== -1)
+ {sdlVehicleInfo.onPrndl(vehicleInfo.prndl)}
+ }
+ function sendTirePressureChange(){
+ sdlVehicleInfo.onTirePressure(vehicleInfo.tirePressure)
+ }
+ function sendOdometerChange(){
+ sdlVehicleInfo.onOdometer(vehicleInfo.odometer)
+ }
+ function sendBeltStatusChange(){
+ sdlVehicleInfo.onBeltStatus(vehicleInfo.beltStatus)
+ }
+ function sendBodyInformationChange(){
+ sdlVehicleInfo.onBodyInformation(vehicleInfo.bodyInformation)
+ }
+ function sendDeviceStatusChange(){
+ sdlVehicleInfo.onDeviceStatus(vehicleInfo.deviceStatus)
+ }
+ function sendDriverBrakingChange(){
+ sdlVehicleInfo.onDriverBraking(vehicleInfo.driverBraking)
+ }
+ function sendWiperStatusChange(){
+ sdlVehicleInfo.onWiperStatus(vehicleInfo.wiperStatus)
+ }
+ function sendHeadLampStatusChange(){
+ sdlVehicleInfo.onHeadLampStatus(vehicleInfo.headLampStatus)
+ }
+ function sendEngineTorqueChange(){
+ sdlVehicleInfo.onEngineTorque(vehicleInfo.engineTorque)
+ }
+ function sendAccPedalPositionChange(){
+ sdlVehicleInfo.onAccPedalPosition(vehicleInfo.accPedalPosition)
+ }
+ function sendSteeringWheelAngleChange(){
+ sdlVehicleInfo.onSteeringWheelAngle(vehicleInfo.steeringWheelAngle)
+ }
+ function sendECallInfoChange(){
+ sdlVehicleInfo.onECallInfo(vehicleInfo.eCallInfo)
+ }
+ function sendAirbagStatusChange(){
+ sdlVehicleInfo.onAirbagStatus(vehicleInfo.airbagStatus)
+ }
+ function sendEmergencyEventChange(){
+ sdlVehicleInfo.onEmergencyEvent(vehicleInfo.emergencyEvent)
+ }
+ function sendClusterModeStatusChange(){
+ sdlVehicleInfo.onClusterModeStatus(vehicleInfo.clusterModeStatus)
+ }
+ function sendMyKeyChange(){
+ sdlVehicleInfo.onMyKey(vehicleInfo.myKey)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml b/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml
new file mode 100644
index 0000000000..3dc6ad563d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml
@@ -0,0 +1,66 @@
+/**
+ * @file VrHelpItemsDefault.qml
+ * @brief Default voice recognition help items.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+
+ListModel {
+ id: vrHelpItemsDefault
+
+ Component.onCompleted: {
+ vrHelpItemsDefault.append({
+ text: "Default VR Help Text1",
+ image: {
+ value: "",
+ imageType: 1
+ },
+ position: 1
+ });
+ vrHelpItemsDefault.append({
+ text: "Default VR Help Text2",
+ image: {
+ value: "",
+ imageType: 1
+ },
+ position: 2
+ });
+ vrHelpItemsDefault.append({
+ text: "Default VR Help Text3",
+ image: {
+ value: "",
+ imageType: 1
+ },
+ position: 3
+ });
+ }
+}
+
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml b/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml
new file mode 100644
index 0000000000..2d0c4119b1
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml
@@ -0,0 +1,290 @@
+/**
+ * @file AlertWindow.qml
+ * @brief Alert popup window
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+Rectangle {
+ id: alertWindow
+ property date lastAlertTime
+ property var softButtons
+ property int appId
+ property string popUpName // TODO{ALESHIN}: No requerments for closePopUp, if alert couldn't be closed by closePopUp request - delete everywhere
+
+ color: "transparent"
+
+ property var async
+
+ Rectangle {
+ id: rectangle
+
+ anchors.centerIn: parent
+ color: "black"
+ border.color: "white"
+
+ width: alertContent.width + 60
+ height: alertContent.height + 60
+
+ property alias alertString: alert.text
+ property alias appNameString: appName.text
+ property int duration
+
+ Column {
+ id: alertContent
+ anchors.centerIn: parent
+ spacing: 20
+
+ Text {
+ id: appName
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: "white"
+ font.pointSize: 16
+ }
+
+ Row {
+ width: Constants.alertWidth
+ spacing: 20
+
+ Image {
+ id: alertLogo
+ source: "../res/warning.png"
+ }
+
+ Text {
+ id: alert
+ width: parent.width - alertLogo.width - parent.spacing
+ clip: true
+ color: "white"
+ font.pointSize: 16
+ }
+ }
+
+ Rectangle {
+ id: progressIndicator
+ color: "white"
+ height: 10
+ }
+
+ Column {
+ Item {
+ width: Constants.alertWidth
+ height: alertButton1.visible ? alertButton1.height : 0
+
+ SoftButton {
+ id: alertButton1
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 0 ? softButtons[0] : undefined
+ anchors.left: parent.left
+ anchors.right: alertButton2.visible ? alertButton2.left : parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ alertWindow.complete(Common.Result.SUCCESS);
+ contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
+ dataContainer.currentApplication.isMediaApplication), appId )
+ }
+ }
+ SoftButton {
+ id: alertButton2
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 1 ? softButtons[1] : undefined
+ anchors.right: parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ alertWindow.complete(Common.Result.SUCCESS);
+ contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
+ dataContainer.currentApplication.isMediaApplication), appId )
+ }
+ }
+ }
+ Item {
+ width: Constants.alertWidth
+ height: alertButton3.visible ? childrenRect.height : 0
+ SoftButton {
+ id: alertButton3
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 2 ? softButtons[2] : undefined
+ anchors.left: parent.left
+ anchors.right: alertButton4.visible ? alertButton4.left : parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ alertWindow.complete(Common.Result.SUCCESS);
+ contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
+ dataContainer.currentApplication.isMediaApplication), appId )
+ }
+ }
+ SoftButton {
+ id: alertButton4
+ appId: alertWindow.appId
+ button: softButtons && softButtons.length > 3 ? softButtons[3] : undefined
+ anchors.right: parent.right
+ width: Constants.alertWidth / 2
+ onPressed: { alertWindow.keep = true; }
+ onReleased: { alertWindow.keep = false; }
+ onKeepContext: {
+ alertWindow.restart();
+ sdlUI.onResetTimeout(appId, "UI.Alert")
+ }
+ onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
+ onStealFocus: {
+ alertWindow.complete(Common.Result.SUCCESS);
+ contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
+ dataContainer.currentApplication.isMediaApplication), appId )
+ }
+ }
+ }
+ }
+ }
+
+ SequentialAnimation {
+ id: animation
+ PropertyAction { target: progressIndicator; property: "width"; value: alertContent.width }
+ PropertyAnimation {
+ id: shrinkProgressAnimation
+ target: progressIndicator
+ property: "width"
+ to: 0
+ duration: rectangle.duration
+ }
+ }
+ }
+
+ Timer {
+ id: timer
+ onTriggered: {
+ complete(Common.Result.SUCCESS)
+ }
+ }
+
+ function alert (alertStrings, duration, sButtons, showIndicator, alertType, applicationId) {
+ if (timer.running) { // we have alert already
+ var currentTime = new Date()
+ var timeFromLastAlert = currentTime - lastAlertTime
+ var timeLeft = timer.interval - timeFromLastAlert
+ var discreteInMilliseconds = 1000 // wish to round left time to integer seconds
+ var timeLeftRounded = discreteInMilliseconds * Math.ceil(timeLeft / discreteInMilliseconds)
+ return timeLeftRounded
+ }
+ else {
+ lastAlertTime = new Date();
+ appId = applicationId
+ rectangle.appNameString = dataContainer.getApplication(appId).appName;
+ softButtons = sButtons;
+ rectangle.alertString = alertStrings.join('\n');
+ timer.interval = duration;
+ rectangle.duration = duration;
+ timer.start();
+ show();
+
+ progressIndicator.visible = !!showIndicator
+ progressIndicator.width = alertContent.width
+ console.log("ProgressIndicator.width:", progressIndicator.width)
+ animation.start()
+ }
+ }
+
+ function show () {
+ dataContainer.activeAlert = true
+ dataContainer.applicationSavedContext = dataContainer.applicationContext
+ visible = true
+ }
+
+ function complete (reason, data) {
+ if (!keep) {
+ hide()
+ switch (reason) {
+ case Common.Result.SUCCESS:
+ DBus.sendReply(async, { __retCode: Common.Result.SUCCESS, __message: "UI.Alert" })
+ break
+ // For other cases
+ }
+ }
+ timer.stop()
+ }
+
+ function hide() {
+ console.debug(popUpName, "HIDE")
+ dataContainer.activeAlert = false
+ dataContainer.applicationContext = dataContainer.applicationSavedContext
+ visible = false
+ }
+
+ function restart() {
+ animation.restart();
+ timer.restart();
+ }
+
+ property bool keep: false
+
+ onKeepChanged: {
+ if (visible && !keep && !timer.running) {
+ hide()
+ }
+ }
+
+ onVisibleChanged: {
+ if (visible) {
+ dataContainer.activePopup.push(popUpName)
+ } else {
+ for (var i in dataContainer.activePopup) {
+ if (dataContainer.activePopup[i] === popUpName) {
+ dataContainer.activePopup.splice(i, 1)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml
new file mode 100644
index 0000000000..92e9d7442b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml
@@ -0,0 +1,56 @@
+/**
+ * @file ContextPopup.qml
+ * @brief Popup view with system context.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+
+PopUp {
+ function show() {
+ console.debug("enter")
+ if (!visible) { // must not increment counter if show() called for visible popup
+ visible = true;
+ dataContainer.popups++
+ }
+ console.debug("exit")
+ }
+
+ function hide() {
+ console.debug("enter")
+ console.debug(popUpName, "HIDE")
+ if (visible) { // must not decrement counter if hide() called for invisible popup
+ visible = false;
+ dataContainer.popups--
+ }
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml
new file mode 100644
index 0000000000..bf88366eae
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml
@@ -0,0 +1,82 @@
+/**
+ * @file ExitAllApplicationsPopup.qml
+ * @brief Popup "Exit all applications"
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+PopUp {
+ function complete(reason){
+ hide()
+ }
+
+ Item {
+ ListModel {
+ id: reasonExit
+
+ Component.onCompleted: {
+ for (var name in Common.ApplicationsCloseReason) {
+ append({name: name});
+ }
+ }
+ }
+ }
+
+ Column
+ {
+ anchors.centerIn: parent
+ Row {
+ Text {
+ text: "Select reason: "
+ color: "white"
+ }
+
+ ComboBox {
+ id: reasonComboBox
+ model: reasonExit
+ }
+ z: 1000
+ }
+ OvalButton {
+ text: "Exit"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ sdlBasicCommunication.onExitAllApplications(Common.ApplicationsCloseReason[reasonComboBox.currentText])
+ hide()
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
new file mode 100644
index 0000000000..782fd76c18
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
@@ -0,0 +1,157 @@
+/**
+ * @file InteractionPopup.qml
+ * @brief Interaction popup view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../hmi_api/Async.js" as Async
+import "../models/Internal.js" as Internal
+
+ContextPopup {
+ id: piPopUp
+ property ListModel choiceSet: ListModel { }
+ property int timeout
+ property int appID
+ property int interactionLayout
+ property var async
+ property bool performInteractionIsActiveNow
+
+ Text {
+ id: initialText
+ anchors.top: parent.top
+ anchors.topMargin: Constants.popupMargin
+ anchors.left: parent.left
+ anchors.leftMargin: Constants.popupMargin
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ ListView {
+ anchors.top: initialText.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.popupMargin
+ model: choiceSet
+ delegate: OvalButton {
+ width: parent.width
+ text: menuName
+ icon: image
+ onClicked: {
+ complete(Common.Result.SUCCESS, {"choiceID": model.choiceID})
+ }
+ }
+ }
+
+ Item {
+ Timer {
+ id: timer
+ onTriggered: {
+ complete(Common.Result.TIMED_OUT)
+ }
+ }
+ }
+
+ function performInteraction(initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
+ console.debug("enter")
+ var app = dataContainer.getApplication(appID)
+ var dataToUpdate = {}
+
+ performInteractionIsActiveNow = true
+ initialText.text = initialText.fieldText
+ this.timeout = timeout
+ this.appID = appID
+
+ this.choiceSet.clear()
+ if (choiceSet !== undefined) {
+ choiceSet.forEach( function(arrayElement) {
+ piPopUp.choiceSet.append({
+ choiceID: arrayElement.choiceID,
+ menuName: arrayElement.menuName ? arrayElement.menuName : "",
+ image: arrayElement.image ? arrayElement.image : "",
+ secondaryText: arrayElement.secondaryText ? arrayElement.secondaryText : "",
+ tertiaryText: arrayElement.tertiaryText ? arrayElement.tertiaryText: "",
+ secondaryImage: arrayElement.secondaryImage ? arrayElement.secondaryImage : ""
+ })
+ })
+ }
+ if (vrHelpTitle !== undefined) {
+ dataToUpdate.vrHelpTitlePerformInteraction = vrHelpTitle
+ }
+
+ app.vrHelpItemsPerformInteraction.clear()
+
+ if (vrHelp !== undefined) {
+ vrHelp.forEach( Internal.appendVrHelpItem, app.vrHelpItemsPerformInteraction )
+ }
+ if (interactionLayout !== undefined) {
+ this.interactionLayout = interactionLayout
+ }
+ dataContainer.setApplicationProperties(appID, dataToUpdate)
+ async = new Async.AsyncCall()
+ if (piPopUp.choiceSet.count !== 0) {
+ activate()
+ }
+ console.debug("exit")
+ return async
+ }
+
+ function activate () {
+ console.debug("enter")
+ timer.interval = timeout
+ timer.start()
+ show()
+ console.debug("exit")
+ }
+
+ function complete (reason, data) {
+ console.debug("enter")
+ switch (reason) {
+ case Common.Result.SUCCESS:
+ DBus.sendReply(async, data)
+ break
+ case Common.Result.ABORTED:
+ DBus.sendReply(async, { __retCode: Common.Result.ABORTED })
+ break
+ case Common.Result.TIMED_OUT:
+ DBus.sendReply(async, { __retCode: Common.Result.TIMED_OUT })
+ break
+ }
+ timer.stop()
+ hide()
+ performInteractionIsActiveNow = false
+ console.debug("exit")
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml
new file mode 100644
index 0000000000..2c4fe8bd3d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml
@@ -0,0 +1,153 @@
+/**
+ * @file OnAppPermissionConsent.qml
+ * @brief Settings source screen view.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+import "../models"
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+PopUp {
+
+ width: Constants.popupWidth - 200
+ height: Constants.popupHeigth - 200
+
+ property int appID
+ property ListModel permissionItems: ListModel{}
+
+ function activate(appId) {
+ console.debug("onAppPermissionConsentPopUp activate enter");
+ appID = appId
+ show()
+ console.debug("onAppPermissionConsentPopUp activate exit");
+ }
+
+ function getFunctionalID(messageCode) {
+
+ console.debug(appID);
+
+ var app = dataContainer.getApplication(appID);
+
+ for (var i = 0; i < app.allowedFunctions.length; i++) {
+ if (messageCode == app.allowedFunctions[i].name) {
+
+ return app.allowedFunctions[i].id;
+ }
+ }
+ }
+
+ function deactivate() {
+ console.debug("onAppPermissionConsentPopUp deactivate enter");
+ hide()
+
+ var consentedFunctions = [];
+
+ for (var i = 0; i < permissionItems.count; i++) {
+ consentedFunctions.push({
+ "name": permissionItems.get(i).messageCode,
+ "id": getFunctionalID(permissionItems.get(i).messageCode),
+ "allowed": permissionItems.get(i).allowed
+ })
+
+ console.debug("consentedFunctions.push", consentedFunctions[i].name,consentedFunctions[i].id,consentedFunctions[i].allowed);
+ }
+
+ sdlSDL.onAppPermissionConsent(appID, consentedFunctions, Common.ConsentSource.GUI);
+ console.debug("onAppPermissionConsentPopUp deactivate exit");
+ }
+
+ Column {
+ anchors.fill: parent
+
+ Component {
+ id: listDelegate
+
+ Item {
+ height: 70
+ width: parent.width
+
+ CheckBox {
+ id: checkBox
+ height: 20
+
+ style: CheckBoxStyle {
+ label: Text {
+ color: Constants.panelTextColor
+ text: permissionItems.get(index).label
+ }
+ }
+ onClicked: {
+ permissionItems.setProperty(index, "allowed", !allowed)
+ }
+ }
+
+ Text {
+ id: label
+ color: Constants.primaryColor
+ font.pixelSize: 0
+ text: textBody
+ wrapMode: TextEdit.Wrap
+ width: parent.width
+ anchors.top: checkBox.bottom
+ }
+ }
+ }
+
+ ScrollableListView {
+ id: onAppPermissonList
+ anchors.fill: parent;
+ anchors.margins: 5
+ anchors.bottomMargin: 100
+ model: permissionItems
+ delegate: listDelegate
+ }
+
+ Item {
+ id: bottomPanel
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 100
+ width: parent.width
+
+ OvalButton {
+ anchors.centerIn: parent
+ text: "Done"
+ onClicked: {
+ deactivate()
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml
new file mode 100644
index 0000000000..2cb0212a34
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml
@@ -0,0 +1,150 @@
+/**
+ * @file PerformAudioPassThruPopup.qml
+ * @brief Popup for audio pass thru
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+ContextPopup {
+ property var async
+
+ function showAudioPassThru(){
+ console.debug("entered")
+ dataContainer.uiAudioPassThru.running = true
+ show()
+ if (dataContainer.uiAudioPassThru.timeout) {
+ timer.start()
+ }
+ console.debug("exited")
+ }
+
+ function complete(reason){
+ console.debug("enter", reason)
+ timer.stop()
+ dataContainer.uiAudioPassThru.timeout = 0
+ dataContainer.uiAudioPassThru.running = false
+ switch (reason) {
+ case Common.Result.ABORTED:
+ console.debug("exit with abort")
+ DBus.sendError(async, Common.Result.ABORTED)
+ break;
+ case Common.Result.SUCCESS:
+ console.debug("exit with success")
+ DBus.sendReply(async, {})
+ break;
+ case Common.Result.RETRY:
+ console.debug("exit with retry")
+ DBus.sendError(async, Common.Result.RETRY)
+ break;
+ }
+ hide()
+ }
+
+
+ Column {
+ spacing: Constants.generalSpacing
+ anchors.centerIn: parent
+ Timer {
+ id: timer
+ interval: dataContainer.uiAudioPassThru.timeout
+ onTriggered: {
+ complete(Common.Result.SUCCESS)
+ }
+ }
+
+ Text {
+ id: appNameText
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiAudioPassThru.appName
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ Row {
+ spacing: Constants.generalSpacing
+ Image {
+ source: "../res/controlButtons/vrImage.png"
+ }
+
+ Column {
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiAudioPassThru.firstLine
+ color: Constants.audioPassThruTextColor
+ font.pixelSize: Constants.fontSize
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiAudioPassThru.secondLine
+ color: Constants.audioPassThruTextColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+ }
+
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: Constants.generalSpacing
+
+ OvalButton {
+ text: "Retry"
+ fontSize: Constants.fontSize
+ onClicked: {
+ complete(Common.Result.RETRY)
+ }
+ }
+
+ OvalButton {
+ text: "Done"
+ fontSize: Constants.fontSize
+ onClicked: {
+ complete(Common.Result.SUCCESS)
+ }
+ }
+ }
+
+ OvalButton {
+ text: "Close"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ console.debug("enter")
+ complete(Common.Result.ABORTED)
+ console.debug("exit")
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml
new file mode 100644
index 0000000000..544852638d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml
@@ -0,0 +1,94 @@
+/**
+ * @file PopUp.qml
+ * @brief General popup view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+Item {
+ default property alias content: content.children
+ property int padding: Constants.popUpPadding
+ property string popUpName
+
+ visible: false
+
+ width: Constants.popupWidth
+ height: Constants.popupHeigth
+
+ MouseArea { anchors.fill: parent }
+
+ Rectangle {
+ width: parent.width - padding / 2
+ height: parent.height - padding / 2
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: Constants.secondaryColor
+ border.width: 1
+ border.color: Constants.popUpBorderColor
+ radius: padding
+ Rectangle {
+ id: content
+ width: parent.width - padding
+ height: parent.height - padding
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: Constants.transparentColor
+ }
+ }
+
+ onVisibleChanged: {
+ if (popUpName) {
+ if (visible) {
+ dataContainer.activePopup.push(popUpName)
+ } else {
+ for (var i in dataContainer.activePopup) {
+ if (dataContainer.activePopup[i] === popUpName) {
+ dataContainer.activePopup.splice(i, 1)
+ }
+ }
+ }
+ }
+ }
+
+ function show() {
+ console.debug("enter");
+ visible = true;
+ console.debug("exit");
+ }
+
+ function hide() {
+ console.debug("enter");
+ visible = false;
+ console.debug("exit");
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml
new file mode 100644
index 0000000000..38f866797d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml
@@ -0,0 +1,217 @@
+/**
+ * @file ExitAllApplicationsPopup.qml
+ * @brief Popup "Exit all applications"
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+
+ContextPopup {
+ property var async
+ property int position: 1
+ /**
+ * Test Support Section
+ */
+ property int resultCode: -1
+ signal onReady
+ /**
+ * Test Support Section End
+ */
+
+ function showSlider(){
+ console.debug("enter")
+
+ dataContainer.uiSlider.running = true
+ dataContainer.applicationSavedContext = dataContainer.applicationContext
+ if(dataContainer.uiSlider.footer === undefined ||
+ dataContainer.uiSlider.footer.length === 0 ||
+ dataContainer.uiSlider.position === 0 ) {
+ footerText.text = ""
+ } else {
+ footerText.text = dataContainer.uiSlider.footer.length === 1 ? dataContainer.uiSlider.footer[0] : dataContainer.uiSlider.footer[dataContainer.uiSlider.position - 1]
+ }
+ position = dataContainer.uiSlider.position
+ show()
+ timer.start()
+ onReady()
+ console.debug("exit")
+ }
+
+ function complete(reason){
+ console.debug("enter reason = ", reason)
+ timer.stop()
+ dataContainer.applicationContext = dataContainer.applicationSavedContext
+ dataContainer.uiSlider.running = false
+ switch(reason) {
+ case Common.Result.ABORTED:
+ console.debug("aborted position is", position)
+ resultCode = Common.Result.ABORTED
+ DBus.sendReply(async, {__retCode: resultCode, sliderPosition: position})
+ break
+ case Common.Result.SUCCESS:
+ console.debug("send position", position)
+ resultCode = Common.Result.SUCCESS
+ dataContainer.uiSlider.position = position
+ DBus.sendReply(async, {sliderPosition:position})
+ break
+ default:
+ break
+ }
+ hide()
+ position = 1
+ console.debug("exit")
+ }
+
+
+ Column
+ {
+ spacing: Constants.generalSpacing
+ anchors.centerIn: parent
+ Timer {
+ id: timer
+ interval: dataContainer.uiSlider.timeout
+ onTriggered: {
+ console.debug("triggered")
+ complete(Common.Result.SUCCESS)
+ }
+ }
+
+ Text {
+ id: appNameText
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiSlider.appName
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ Text {
+ id: headerText
+ width: borderRectangle.width
+ elide: Text.ElideRight
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: dataContainer.uiSlider.header
+ color: Constants.sliderTextColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ Rectangle {
+ id: borderRectangle
+ width: Constants.sliderBarWidth
+ height: Constants.sliderBarHeight
+ anchors.horizontalCenter: parent.horizontalCenter
+ border.color: Constants.sliderBarBorderColor
+ border.width: Constants.sliderBarBorderWidth
+ radius: Constants.sliderBarRadius
+ color: "black"
+
+ Rectangle {
+ id: rectangle
+ color: Constants.sliderBarFillColor
+ height: parent.height
+ border.color: parent.border.color
+ border.width: parent.border.width
+ radius: parent.radius
+
+ onVisibleChanged: {
+ var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
+ rectangle.width = dataContainer.uiSlider.position * tickWidth
+ }
+ }
+
+ MouseArea{
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ onPositionChanged(mouse)
+ }
+
+ onPositionChanged: {
+ if(mouseX <= 0){
+ rectangle.width = borderRectangle.width / dataContainer.uiSlider.numTicks
+ position = 1
+ }
+
+ if(mouseX > borderRectangle.width) {
+ rectangle.width = borderRectangle.width
+ position = dataContainer.uiSlider.numTicks
+ }
+
+ if(mouseX > 0 && mouseX < borderRectangle.width) {
+ var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
+ position = Math.ceil(mouseX / tickWidth)
+ rectangle.width = position * tickWidth
+ }
+
+ if(dataContainer.uiSlider.footer.length > 1){
+ footerText.text = dataContainer.uiSlider.footer[position - 1]
+ }
+ }
+ }
+ }
+
+ Text {
+ id:footerText
+ width: borderRectangle.width
+ elide: Text.ElideRight
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: ""
+ color: Constants.sliderTextColor
+ font.pixelSize: Constants.fontSize * 2
+ }
+
+ OvalButton {
+ text: "Close"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ console.debug("enter")
+ complete(Common.Result.ABORTED)
+ console.debug("exit")
+ }
+ }
+ }
+
+ function getTimer() {
+ return timer
+ }
+ function getBackButton() {
+ return backButton
+ }
+ function getFooterText() {
+ return footerText
+ }
+ function getBorderRectangle() {
+ return borderRectangle
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml
new file mode 100644
index 0000000000..5cd49bdd51
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml
@@ -0,0 +1,71 @@
+/**
+ * @file TBTClientStatePopUp.qml
+ * @brief Popup view for TBT interface (list of states).
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+PopUp {
+ Item {
+ ListModel {
+ id: tbtState
+
+ Component.onCompleted: {
+ for (var name in Common.TBTState) {
+ append({name: name});
+ }
+ }
+ }
+ }
+ Text {
+ text: "TBT Client State"
+ verticalAlignment: Text.AlignVCenter
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.top: parent.top
+ color: Constants.primaryColor
+ }
+ ComboBox {
+ id: comboBox
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ model: tbtState
+ onCurrentTextChanged: {
+ console.log("Send signal onTBTClientState:", currentText);
+ sdlNavigation.onTBTClientState(Common.TBTState[currentText]);
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
new file mode 100644
index 0000000000..33f82013b2
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
@@ -0,0 +1,104 @@
+/**
+ * @file TTSPopUp.qml
+ * @brief Popup view for TTS
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+PopUp {
+ height: Constants.ttsPopUpHeight
+ width: Constants.ttsPopUpWidth
+ padding: Constants.ttsPopUpPadding
+ property var async
+
+ ScrollView {
+ anchors.fill: parent
+ Text {
+ id: text
+ anchors.fill: parent
+ color: Constants.popUpBorderColor
+ font.pixelSize: Constants.ttsFontSize
+ }
+ }
+
+ resources: [
+ Timer {
+ id: timer
+ interval: Constants.ttsSpeakTime
+ onTriggered: deactivate()
+ },
+
+ Timer {
+ id: ttsPerformInteractionTimer
+ interval: Constants.ttsSpeakTime
+ onTriggered: activate(message)
+ property var message: undefined
+ }
+ ]
+
+ function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout) {
+ activate(initialPrompt);
+ if (timeout * 2 - Constants.ttsSpeakTime > 0) {
+ ttsPerformInteractionTimer.message = timeoutPrompt;
+ ttsPerformInteractionTimer.interval = timeout - Constants.ttsSpeakTime;
+ ttsPerformInteractionTimer.restart()
+ }
+ }
+
+ function activate(message) {
+ console.debug("Activate TTS popup:", message);
+ dataContainer.activeTTS = true;
+ sdlTTS.started();
+ console.debug("TTS started");
+ text.text = message;
+ show();
+ timer.restart();
+ console.debug("Exit");
+ }
+
+ function deactivate() {
+ console.debug("Deactivate TTS popup");
+ dataContainer.activeTTS = false;
+ sdlTTS.stopped();
+ console.debug("TTS stopped");
+ text.text = '';
+ timer.stop();
+ hide();
+ DBus.sendReply(async, {});
+ async = null;
+ console.debug("Exit");
+ }
+}
+
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml
new file mode 100644
index 0000000000..d49c212297
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml
@@ -0,0 +1,175 @@
+/**
+ * @file PopUp.qml
+ * @brief General popup view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+import "../controls"
+
+Item {
+ default property alias content: content.children
+ property var callbackFunc: null
+ property int padding: Constants.popUpPadding
+ property string popUpName
+
+ visible: false
+
+ width: Constants.popupWidth
+ height: Constants.popupHeigth
+
+ MouseArea { anchors.fill: parent }
+
+ Rectangle {
+ width: parent.width / 2
+ height: parent.height / 2
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: Constants.secondaryColor
+ border.width: 1
+ border.color: Constants.popUpBorderColor
+ radius: padding
+ Rectangle {
+ id: content
+ width: parent.width - padding
+ height: parent.height - padding
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ color: Constants.transparentColor
+ }
+
+ Text {
+ id: title
+ text: "adsadad"
+ anchors.top: parent.top
+ anchors.topMargin: 5
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ width: parent.width - padding
+ height: 20
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ wrapMode: TextEdit.Wrap
+ }
+
+ Text {
+ id: message
+ text: "adsadad"
+ anchors.top: parent.top
+ anchors.topMargin: 30
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ width: parent.width - padding
+ height: 100
+ font.pixelSize: 0
+ color: Constants.primaryColor
+ wrapMode: TextEdit.Wrap
+ }
+
+ OvalButton {
+ id: okButton
+ text: "Ok"
+ fontSize: Constants.fontSize
+ property bool result: true
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.leftMargin: 15
+ width: parent.width / 2 - 20
+ onClicked: {
+ deactivate(result)
+ }
+ visible: false
+ }
+
+ OvalButton {
+ id: cancelButton
+ text: "Cancel"
+ fontSize: Constants.fontSize
+ property bool result: false
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.rightMargin: 15
+ width: parent.width / 2 - 20
+ onClicked: {
+ deactivate(result)
+ }
+ visible: false
+ }
+
+ OvalButton {
+ id: closeButton
+ text: "Close"
+ fontSize: Constants.fontSize
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.leftMargin: 15
+ width: parent.width - 20
+ onClicked: {
+ deactivate()
+ }
+ visible: false
+ }
+
+ }
+
+ function activate(titleText, textBoxText, callback, buttons) {
+ console.log("userActionPopUp activate enter");
+ title.text = titleText;
+ message.text = textBoxText;
+
+ if (buttons) {
+ callbackFunc = callback;
+ okButton.visible = true
+ cancelButton.visible = true
+ } else {
+ closeButton.visible = true
+ }
+
+ visible = true;
+ console.debug("userActionPopUp activate exit");
+ }
+
+ function deactivate(result) {
+ console.log("userActionPopUp deactivate enter");
+ visible = false;
+ title.text = "";
+ message.text = "";
+ if (callbackFunc) {
+ callbackFunc(result);
+ callbackFunc = null;
+ }
+ okButton.visible = false
+ cancelButton.visible = false
+ closeButton.visible = false
+ console.debug("userActionPopUp deactivate exit");
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml
new file mode 100644
index 0000000000..c699f0f51d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml
@@ -0,0 +1,113 @@
+/**
+ * @file VRHelpPopup.qml
+ * @brief Popup view for VR help
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+PopUp {
+ property alias title: title.text
+ Text {
+ id: title
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.popupMargin
+ text: {
+ // not in application
+ if (!dataContainer.applicationContext) {
+ return dataContainer.currentApplication.vrHelpTitleDefault
+ // in application
+ } else {
+ if (interactionPopup.performInteractionIsActiveNow) {
+ return dataContainer.currentApplication.vrHelpTitlePerformInteraction
+ } else if (dataContainer.currentApplication.vrHelpTitle) {
+ return dataContainer.currentApplication.vrHelpTitle
+ } else {
+ return dataContainer.currentApplication.vrHelpTitleDefault
+ }
+ }
+ }
+ font.pixelSize: Constants.titleFontSize
+ color: Constants.primaryColor
+ }
+
+ ScrollableListView {
+ anchors.top: title.bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.popupMargin
+
+ model: {
+ // not in application
+ if (!dataContainer.applicationContext) {
+ return dataContainer.currentApplication.vrHelpItemsDefault
+ // in application
+ } else {
+ if (interactionPopup.performInteractionIsActiveNow) {
+ return dataContainer.currentApplication.vrHelpItemsPerformInteraction
+ } else if (dataContainer.currentApplication.vrHelpItems.count > 0) {
+ return dataContainer.currentApplication.vrHelpItems
+ } else {
+ return dataContainer.currentApplication.vrHelpItemsDefault
+ }
+ }
+ }
+
+ delegate:
+ Row {
+ spacing: Constants.iconItemListSpacing
+ Icon {
+ source: model.image
+ anchors.verticalCenter: parent.verticalCenter
+ width: Constants.iconItemListSize
+ height: Constants.iconItemListSize
+ }
+
+ Text {
+ id: text
+ anchors.verticalCenter: parent.verticalCenter
+ text: model.text
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+ }
+
+ function complete(reason, data) {
+ hide()
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
new file mode 100644
index 0000000000..2acf4f0651
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
@@ -0,0 +1,96 @@
+/**
+ * @file VRPopUp.qml
+ * @brief Popup view for VR interface (list commands).
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../views"
+import "../controls"
+
+PopUp {
+ Text {
+ id: title
+ anchors.left: parent.left
+ anchors.top: parent.top
+ height: voice.height
+ width: parent.width - voice.width
+ text: "Speak the command"
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ Image {
+ id: voice
+ anchors.top: parent.top
+ anchors.right: parent.right
+ source: "../res/controlButtons/vrImage.png"
+ }
+
+ ScrollableListView {
+ anchors.bottomMargin: Constants.popupMargin
+ anchors.rightMargin: Constants.popupMargin
+ anchors.leftMargin: Constants.popupMargin
+ anchors.top: voice.bottom
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+
+ model: dataContainer.vrCommands
+
+ delegate: OvalButton {
+ width: parent.width
+ text: command
+ onClicked: {
+ sdlVR.onCommand(cmdID, appID === 0 ? undefined : appID);
+ if (dataContainer.activeVR) {
+ vrPopUp.complete();
+ vrHelpPopup.hide()
+ }
+ }
+ }
+ }
+
+ function activate() {
+ dataContainer.activeVR = true;
+ sdlVR.started();
+ show();
+ }
+
+ function complete(reason) {
+ dataContainer.activeVR = false;
+ sdlVR.stopped();
+ hide();
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml
new file mode 100644
index 0000000000..a97f346719
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml
@@ -0,0 +1,112 @@
+/**
+ * @file VIPopUp.qml
+ * @brief Pop up window with information about vehicle.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+import "../controls"
+import QtQuick.Controls 1.0
+
+PopUp {
+ //TODO{ALeshin}: Redraw this window as ListView or Column, when we'll get requirements
+ Column {
+ anchors.fill: parent
+ Text {
+ id: viText
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "Vehicle Information"
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ color: Constants.primaryColor
+ }
+
+ Row {
+ height: 1/5 * parent.height
+ width: parent.width
+
+ Text {
+ width: 1/4 * parent.width
+ height: 1/5 * parent.height
+ anchors.verticalCenter: parent.verticalCenter
+ text: "PRNDL: "
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.primaryColor
+ }
+
+ ComboBox {
+ anchors.verticalCenter: parent.verticalCenter
+ id: comboBox
+ model: prndlList
+
+ onCurrentIndexChanged: {
+ console.debug("PRNDL:", currentIndex)
+ dataContainer.vehicleInfoModel.prndl = model.get(currentIndex).id
+ }
+
+ textRole: "name"
+ ListModel {
+ id: prndlList
+ Component.onCompleted: {
+ append({ id: -1, name: "<NO DATA (prndl)>" })
+ for (var name in Common.PRNDL) {
+ append({ id: Common.PRNDL[name], name: name });
+ }
+ }
+ }
+ }
+ z: 1000
+ }
+
+ Text {
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "ECU 1: " + dataContainer.vehicleInfoModel.ecuDIDData.data1
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.primaryColor
+ }
+
+ Text {
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "ECU 2: " + dataContainer.vehicleInfoModel.ecuDIDData.data2
+ font.pixelSize: Constants.fontSize
+ verticalAlignment: Text.AlignVCenter
+ color: Constants.primaryColor
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject b/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject
new file mode 100644
index 0000000000..ea820e8019
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject
@@ -0,0 +1,20 @@
+/* File generated by Qt Creator, version 2.7.0 */
+
+import QmlProject 1.1
+
+Project {
+ mainFile: "MainWindow.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "../res"
+ }
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ "." ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml
new file mode 100644
index 0000000000..ad0c9d1907
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml
@@ -0,0 +1,48 @@
+/**
+ * @file AMPlayerView.qml
+ * @brief AM player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ RadioPlayer {
+ id: amRadioPlayer
+ anchors.fill: parent
+ radioType: "AM"
+ radioName: "AM Radio"
+
+ playerState: dataContainer.amPlayerState
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml
new file mode 100644
index 0000000000..38c5ab067e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml
@@ -0,0 +1,126 @@
+/**
+ * @file ApplicationListView.qml
+ * @brief Application list view
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+GeneralView {
+ Column {
+ anchors.fill: parent
+ Item {
+ // top 1/4 of screen
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ elementWidth: Constants.ovalButtonWidth
+ snapTo: elementWidth + spacing
+ spacing: (width - 4 * elementWidth) / 3
+
+ OvalButton {
+ text: "Find New Apps"
+ }
+
+ OvalButton {
+ text: "Change device"
+ onReleased: contentLoader.go("./views/ChangeDeviceView.qml")
+ }
+
+ OvalButton {
+ text: "911 Assist"
+ }
+
+ OvalButton {
+ text: "Vehicle Health Report"
+ }
+
+ OvalButton {
+ text: "Install applications/Up"
+ }
+ }
+ }
+
+ Item {
+ height: parent.height / 2
+ width: parent.width
+
+ ScrollableListView {
+ id: applicationListView
+ anchors.fill: parent
+ model: dataContainer.applicationList
+
+ delegate: Item {
+ width: parent.width
+ height: Math.max(applicationName.height, appIcon.height)
+ Image {
+ id: appIcon
+ source: icon
+ height: Constants.appListIconSize
+ width: height
+ }
+ ClickableText {
+ id: applicationName
+ text: appName
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.appListFontSize
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: appIcon.right
+ anchors.leftMargin: Constants.margin
+ onClicked: {
+ settingsContainer.activateApp(appId)
+// dataContainer.setCurrentApplication(appId)
+// contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
+// dataContainer.currentApplication.isMediaApplication), appId )
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ // bottom 1/4 of screen
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml
new file mode 100644
index 0000000000..a1d8c43a39
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml
@@ -0,0 +1,62 @@
+/**
+ * @file BTPlayerView.qml
+ * @brief FM player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: btPlayer
+ playerName: "BT Audio"
+ anchors.fill: parent
+
+ playerState: dataContainer.btPlayerState
+ image: playerState.albumImage
+
+ buttons: [
+ OvalButton {
+ text: btPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml
new file mode 100644
index 0000000000..8cf1c3f728
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml
@@ -0,0 +1,63 @@
+/**
+ * @file CDPlayerView.qml
+ * @brief CD player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: cdPlayer
+ playerName: "CD"
+ anchors.fill: parent
+ image: playerState.albumImage
+ playerState: dataContainer.cdPlayerState
+
+ buttons: [
+ OvalButton {
+ text: cdPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml
new file mode 100644
index 0000000000..e61bac1d08
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml
@@ -0,0 +1,54 @@
+/**
+ * @file CarMenuGridView.qml
+ * @brief Car menu screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+
+GridMenu {
+ id: menu
+ model: CarMenuModel { }
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ ClickableImage {
+ anchors.centerIn: parent
+ source: icon
+ onClicked: {
+ if(qml !== "") {
+ contentLoader.go(qml)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml
new file mode 100644
index 0000000000..84a751efec
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml
@@ -0,0 +1,102 @@
+/**
+ * @file ChangeDeviceView.qml
+ * @brief Screen view with list of available devices.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ Text {
+ id: searchDeviceText
+ anchors.left: parent.left
+ anchors.top: parent.top
+ height: 1/4 * parent.height
+ width: parent.width
+ color: Constants.primaryColor
+ font.pixelSize: Constants.titleFontSize
+ text: "Devices available:"
+ verticalAlignment: Text.AlignVCenter
+ }
+
+ ListView {
+ id: changeDeviceListView
+ anchors.left: parent.left
+ anchors.top: searchDeviceText.bottom
+ model: dataContainer.deviceList
+ width:parent.width
+ height:parent.height - searchDeviceText.height
+
+ delegate: Text {
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ sdlBasicCommunication.onDeviceChosen({ name: name, id: devid });
+ sdlBasicCommunication.onFindApplications({ name: name, id: devid })
+ contentLoader.go("./views/ApplicationListView.qml")
+ }
+ }
+ text: name
+ color: Constants.primaryColor
+ font.pixelSize: Constants.titleFontSize
+ }
+ }
+ }
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+
+ Component.onCompleted: {
+ console.log("ChangeDeviceView Component.onCompleted enter");
+ sdlBasicCommunication.onStartDeviceDiscovery();
+ console.log("ChangeDeviceView Component.onCompleted exit");
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml
new file mode 100644
index 0000000000..41b0c32efa
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml
@@ -0,0 +1,94 @@
+/**
+ * @file ClimateControlView.qml
+ * @brief Screen view of climat menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+
+GeneralView {
+ Item {
+ id: climatMenu
+ anchors.fill: parent
+
+ Item {
+ height: parent.height
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ Column {
+ id: leftItem
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width
+
+ Row {
+ ClimateControlBtn {name: "heated_seat"}
+ ClimateControlBtn {name: "heated_wheel"}
+ }
+ Row {
+ ClimateControlBtn {name: "AC"}
+ ClimateControlBtn {name: "headed_dash"}
+ }
+ }
+
+ Column {
+ id: centralItem
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+
+ ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"}
+ ClimateControlBtn {name: "face"; state: "on"}
+ ClimateControlBtn {name: "feet"}
+ }
+
+ Row {
+ id: rightItem
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width
+
+ ClimateControlBtn {
+ anchors.verticalCenter: parent.verticalCenter
+ txt: "Dual"
+ state: "on"
+ }
+
+ Column {
+ ClimateControlBtn { name: "heated_seat" }
+ ClimateControlBtn { name: "AC" }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml
new file mode 100644
index 0000000000..90f817036d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml
@@ -0,0 +1,118 @@
+/**
+ * @file ContactsListView.qml
+ * @brief Contact list screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ function setCurrent(firstLetter){
+ for(var i = 0; i < contactsListView.count; i ++) {
+ if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) {
+ contactsListView.positionViewAtIndex(i, ListView.Beginning)
+ break;
+ }
+ }
+ }
+ Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter)
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ ScrollableListView {
+ id: contactsListView
+ anchors.fill: parent
+ clip: true
+ spacing: 1/2 * Constants.fontSize
+ model: ContactsListModel { }
+
+ section.property: "name"
+ section.criteria: ViewSection.FirstCharacter
+ section.delegate: Text {
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ text: section.toUpperCase()
+ }
+
+ delegate: Item {
+ anchors.left: parent.left
+ width: parent.width - Constants.scrollBarWidth
+ height: typeText.height
+
+ Text {
+ id: contactName
+ anchors.left: parent.left
+ text: name
+ width: Constants.contactListNameFieldSize * parent.width
+ color: Constants.contactTextColor
+ font.pixelSize: Constants.fontSize
+ elide: Text.ElideRight
+ }
+ Text {
+ id: phoneText
+ anchors.left: contactName.right
+ width: Constants.contactListPhoneFieldSize * parent.width
+ text: phone
+ color: Constants.contactTextColor
+ font.pixelSize: Constants.fontSize
+ horizontalAlignment: Text.AlignHCenter
+ }
+ Text {
+ id: typeText
+ anchors.right: parent.right
+ width: Constants.contactListDescriptionFieldSize * parent.width
+ text: type
+ color: Constants.contactTextColor
+ font.pixelSize: Constants.fontSize
+ horizontalAlignment: Text.AlignHCenter
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml b/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml
new file mode 100644
index 0000000000..5a0b5b7754
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ Text {
+ id: title
+ text: "Choose devices to be Unpaired:"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ height: Constants.fontSize + Constants.panelPadding
+ }
+
+ ScrollableListView {
+ id: menu
+ model: dataContainer.deviceList
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: title.bottom
+ anchors.bottom: bottomPanel.top
+ delegate: OvalButton {
+ text: name
+ onClicked: {
+ sdlSDL.onDeviceStateChanged(Common.DeviceState.UNPAIRED,
+ "", {id: devid, name: name});
+ }
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml
new file mode 100644
index 0000000000..ae117ccd05
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml
@@ -0,0 +1,121 @@
+/**
+ * @file FMPlayerView.qml
+ * @brief FM player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ RadioPlayer {
+ id: fmRadioPlayer
+ anchors.fill: parent
+ radioType: "FM"
+ radioName: "FM Radio"
+
+ playerState: dataContainer.fmPlayerState
+
+ property int hdButtonValue: 1
+
+ buttonHD: [
+ Image {
+ id: hdButton
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ source: "../res/buttons/long_oval_btn.png"
+ property string textColor: Constants.primaryColor
+
+ Row {
+ anchors.centerIn: parent
+ spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10
+
+ Image {
+ id: hdLogo
+ anchors.verticalCenter: parent.verticalCenter
+ source:"../res/hd_logo_on.png"
+ }
+
+ Text {
+ id: one
+ anchors.verticalCenter: parent.verticalCenter
+ text: "1"
+ color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ id: two
+ anchors.verticalCenter: parent.verticalCenter
+ text: "2"
+ color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ id: three
+ anchors.verticalCenter: parent.verticalCenter
+ text: "3"
+ color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ id: four
+ anchors.verticalCenter: parent.verticalCenter
+ text: "4"
+ color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ hdLogo.source = "../res/hd_logo_off.png"
+ hdButton.source = "../res/buttons/long_oval_pressed_btn.png"
+ hdButton.textColor = Constants.secondaryColor
+
+ }
+ onReleased: {
+ hdLogo.source = "../res/hd_logo_on.png"
+ hdButton.source = "../res/buttons/long_oval_btn.png"
+ hdButton.textColor = Constants.primaryColor
+ fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++
+ }
+ }
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml
new file mode 100644
index 0000000000..ca6eb12e8f
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml
@@ -0,0 +1,48 @@
+/**
+ * @file GeneralView.qml
+ * @brief Base view class. Defines properties and behavior common for all views
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+
+Item {
+ /// HMI context view is related to
+ property int systemContext: Common.SystemContext.SYSCTXT_MAIN
+ /// True if view is in application context
+ property bool applicationContext: false
+ /// View category for AppDeactivated notification (reason)
+ property int category: Common.DeactivateReason.GENERAL
+
+ signal enterScreen
+ signal leaveScreen
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml
new file mode 100644
index 0000000000..f935b030c4
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml
@@ -0,0 +1,86 @@
+/**
+ * @file GridMenu.qml
+ * @brief Parent class for main menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+GeneralView {
+ id: main
+ property alias model: repeater.model
+ property alias delegate: repeater.delegate
+ property alias rows: grid.rows
+ property int columnsOnPage: Constants.menuColumnCount
+
+ Flickable {
+ id: flicker
+ anchors.fill: parent
+ contentWidth: grid.width
+ flickableDirection: Flickable.HorizontalFlick
+
+ Grid {
+ id: grid
+ anchors.centerIn: parent
+ rows: Constants.menuRowCount
+ columns: Math.ceil(model.count / rows)
+ flow: Grid.TopToBottom
+ Repeater {
+ id: repeater
+ }
+ }
+
+ property int snapTo: width / parent.columnsOnPage
+ onMovementEnded: {
+ var rest = flicker.contentX % snapTo
+ var time = 0.25
+ if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo }
+ var vel = 2 * rest / time
+ flickDeceleration = Math.abs(vel) / time
+ flick(vel, 0)
+ flickDeceleration = 1500
+ }
+ }
+
+ Pager {
+ id: pager
+ space: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ anchors.topMargin: Constants.margin
+
+ pages: Math.ceil(grid.columns / parent.columnsOnPage)
+ activePage: Internal.activePageChoose(flicker, pager.pages)
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml
new file mode 100644
index 0000000000..1a162f2caa
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml
@@ -0,0 +1,175 @@
+/**
+ * @file HardwareButtonsView.qml
+ * @brief Area of screen responsible for hardware buttons
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ height: row.height + row.anchors.margins
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.panelColor
+
+ signal buttonDown(string name)
+ signal buttonUp(string name)
+
+ function pressButton(name) {
+ buttonDown(name)
+ }
+
+ function longPressButton(name) {
+ console.log("long press " + name)
+ }
+
+ function releaseButton(name) {
+ buttonUp(name)
+ }
+
+ Row {
+ id: row
+ spacing: Constants.panelPadding
+ anchors.centerIn: parent
+ anchors.margins: Constants.panelPadding
+
+ PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter}
+
+ MaskedButton {
+ name: "vr"
+ anchors.verticalCenter: parent.verticalCenter
+ onReleased: {
+ console.debug("Clicked VR button");
+ if (!dataContainer.activeVR) {
+ vrPopUp.activate();
+ vrHelpPopup.show();
+ } else {
+ vrPopUp.complete();
+ vrHelpPopup.hide()
+ }
+ }
+ }
+
+ ArrowKeys {anchors.verticalCenter: parent.verticalCenter}
+
+ Grid {
+ columns: 5
+ rows: 2
+ spacing: 5
+ anchors.verticalCenter: parent.verticalCenter
+ Repeater {
+ model: 10
+ delegate : Rectangle {
+ width: 40
+ height: 40
+ radius: 5
+ gradient: Gradient {
+ GradientStop
+ {
+ position: 0.0;
+ color: "#2c2c2c"
+ Behavior on position {
+ NumberAnimation { duration: 80 }
+ }
+ }
+
+ GradientStop
+ {
+ position: 1.0;
+ color: "black"
+ Behavior on position {
+ NumberAnimation { duration: 80 }
+ }
+ }
+ }
+
+ Text {
+ text: (1 + index) % 10
+ font.pixelSize: 30
+ color: Constants.panelTextColor
+ anchors.centerIn: parent
+ }
+
+ Timer {
+ id: timer
+ interval: Constants.presetButtonTimer
+ repeat: false
+ triggeredOnStart: false
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ property bool clickProcessed
+ onPressed: {
+ parent.gradient.stops[0].position = 1.0
+ parent.gradient.stops[1].position = 0.0
+ clickProcessed = false
+ timer.start()
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+ onReleased: {
+ parent.gradient.stops[0].position = 0.0
+ parent.gradient.stops[1].position = 1.0
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined)
+ timer.stop()
+ if (!clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined)
+ }
+ }
+ Connections {
+ target: timer
+ onTriggered: {
+ if(!mouseArea.clickProcessed) {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined)
+ mouseArea.clickProcessed = true
+ }
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ settingsContainer.buttonCapabilities.push(
+ {
+ name: Common.ButtonName.PRESET_0 + index,
+ upDownAvailable: true,
+ shortPressAvailable: true,
+ longPressAvailable: true
+ });
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml
new file mode 100644
index 0000000000..65a667702b
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml
@@ -0,0 +1,61 @@
+/**
+ * @file IPodPlayerView.qml
+ * @brief IPod player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: ipodPlayer
+ playerName: "iPod"
+ anchors.fill: parent
+ image: playerState.albumImage
+ playerState: dataContainer.ipodPlayerState
+
+ buttons: [
+ OvalButton {
+ text: ipodPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml
new file mode 100644
index 0000000000..70f3e04772
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml
@@ -0,0 +1,61 @@
+/**
+ * @file LineInPlayerView.qml
+ * @brief LineIn player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: lineInPlayer
+ playerName: "LineIn"
+ anchors.fill: parent
+ image: playerState.albumImage
+ playerState: dataContainer.linePlayerState
+
+ buttons: [
+ OvalButton {
+ text: lineInPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml
new file mode 100644
index 0000000000..7ed435b137
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml
@@ -0,0 +1,54 @@
+/**
+ * @file MainMenuView.qml
+ * @brief Main menu screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+
+GridMenu {
+ id: menu
+ model: MainMenuListModel { }
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ ClickableImage {
+ anchors.centerIn: parent
+ source: icon
+ onClicked: {
+ if(qml !== "") {
+ contentLoader.go(qml)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml
new file mode 100644
index 0000000000..5178d979cf
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml
@@ -0,0 +1,73 @@
+/**
+ * @file MediaClockView.qml
+ * @brief Media clock view
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+Item {
+ property alias time: timeText.text
+ Text {
+ id: timeText
+ anchors.left: parent.left
+ width: 1/10 * parent.width
+ anchors.verticalCenter: parent.verticalCenter
+ horizontalAlignment: Text.AlignRight
+ color: "white"
+ text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime)
+ : "02:36" //TODO {Aleshin}: get track time for all players except SDL
+ font.pixelSize: 18
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ height: parent.height
+ width: 2/3 * parent.width
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ height: 2
+ width: dataContainer.currentApplication.mediaClock.progress * parent.width
+ color: "white"
+ }
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ height: 2
+ width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width
+ color: Constants.primaryColor
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml
new file mode 100644
index 0000000000..ed4eda014e
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml
@@ -0,0 +1,302 @@
+/**
+ * @file MediaPlayerView.qml
+ * @brief Parent for BT, IPod, CD players screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+Item {
+ id: mediaPlayerView
+
+ property string playerName: ""
+ property string playerType: ""
+
+ signal rewind
+ signal forward
+ signal play
+ signal pause
+
+ // Holds players state(song name, play/pause state, track number etc). For all players except SDL.
+ property PlayerState playerState;
+
+ property alias buttons: buttonsRow.content
+ property alias buttonsSpacing: buttonsRow.spacing
+ property alias image: image.source
+
+ Item {
+ // row of oval buttons
+ id: ovalButtonsRow
+ width: parent.width
+ height: 1/5 * parent.height
+ anchors.left: parent.left
+ anchors.top: parent.top
+
+ PagedFlickable {
+ id: buttonsRow
+ width: parent.width
+ spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3)
+ : (width - 2 * elementWidth)
+ anchors.verticalCenter: parent.verticalCenter
+ snapTo: Constants.ovalButtonWidth + spacing
+ elementWidth: Constants.ovalButtonWidth
+ }
+ }
+
+ Item {
+ id: spacingBetweenItems
+ width: parent.width
+ height: 1/10 * parent.height
+ anchors.left: parent.left
+ anchors.top: ovalButtonsRow.bottom
+
+ Behavior on height {
+ NumberAnimation {
+ duration : Constants.animationDuration
+ }
+ }
+ }
+
+ Column {
+ // Picture + text information + media clock
+ id: mediaContent
+ width: parent.width
+ height: 2/5 * parent.height
+ anchors.left: parent.left
+ anchors.top: spacingBetweenItems.bottom
+
+ Row {
+ // picture + text info
+ width: parent.width
+ height: 3/4 * parent.height
+ spacing: Constants.margin
+
+ Image {
+ id: image
+ height: parent.height
+ width: height
+ }
+
+ Column {
+ // text info
+ id: textInfo
+ height: parent.height
+ width: parent.width - image.width - parent.spacing
+ spacing: (height - titleText.height - 3 * text.height) / 3
+
+ Text {
+ id: titleText
+ anchors.left: parent.left
+ anchors.right: parent.right
+ horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
+ color: Constants.primaryColor
+ text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1
+ : playerState.trackName
+ font.pixelSize: Constants.titleFontSize
+ font.bold: true
+ }
+
+ Text {
+ id: text
+ anchors.left: parent.left
+ anchors.right: parent.right
+ horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
+ color: Constants.primaryColor
+ text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2
+ : playerState.albumName
+ font.pixelSize: Constants.fontSize
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ horizontalAlignment: Text.AlignHCenter
+ color: Constants.primaryColor
+ text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack
+ : playerState.trackNumber
+ font.pixelSize: Constants.fontSize
+ }
+ }
+ }
+
+ MediaClockView {
+ width: parent.width
+ height: parent.height * 1/4
+ }
+ }
+
+ Item {
+ id: spacingBetweenItems2
+ width: parent.width
+ height: 1/10 * parent.height
+ anchors.left: parent.left
+ anchors.top: mediaContent.bottom
+
+ Behavior on height {
+ NumberAnimation {
+ duration : Constants.animationDuration
+ }
+ }
+ }
+
+ Row {
+ // Rewind, play, pause, forward buttons
+ id: playPauseRewindForward
+ width: parent.width
+ height: 1/5 * parent.height - statusBar.height
+ anchors.left: parent.left
+ anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2
+ anchors.top: spacingBetweenItems2.bottom
+
+ Image {
+ id: prevButton
+ anchors.verticalCenter: parent.verticalCenter
+ source: "../res/buttons/player_prev_btn.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ prevButton.source = "../res/buttons/player_prev_pressed_btn.png"
+ }
+ onReleased: {
+ prevButton.source = "../res/buttons/player_prev_btn.png"
+ }
+ }
+ }
+
+ PlayPauseButton {
+ id: playPauseButton
+ anchors.verticalCenter: parent.verticalCenter
+ state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState
+ onClicked: {
+ (state == 'Play') ? play() : pause();
+ var newState = state === "Play" ? "Pause" : "Play";
+ (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } )
+ : playerState.playPauseState = newState
+ }
+ }
+
+ Image {
+ id: nextButton
+ anchors.verticalCenter: parent.verticalCenter
+ source: "../res/buttons/player_next_btn.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ nextButton.source = "../res/buttons/player_next_pressed_btn.png"
+ }
+ onReleased: {
+ nextButton.source = "../res/buttons/player_next_btn.png"
+ }
+ }
+ }
+ }
+
+ Item {
+ id: presetButtons
+ width: parent.width
+ height: 1/5 * parent.height
+ anchors.top: playPauseRewindForward.bottom
+ anchors.left: parent.left
+
+ PresetRow {
+ id: presetsRow
+ anchors.top: parent.top
+ anchors.left: parent.left
+ presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow(dataContainer.currentApplication) : []
+ width: parent.width
+
+ onPresetButtonPressed: {
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+
+ onPresetButtonReleased: {
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
+ }
+
+ onPresetButtonClicked: {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
+ }
+
+ onPresetButtonHold: {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
+ }
+ }
+ }
+
+ StatusBar {
+ id: statusBar
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ }
+
+ states: [
+ State {
+ name: 'presetButtonsON'
+ when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL")
+ PropertyChanges {
+ target: spacingBetweenItems
+ height: 1
+ }
+ PropertyChanges {
+ target: spacingBetweenItems2
+ height: 1
+ }
+ PropertyChanges {
+ target: presetButtons
+ visible: true
+ enabled: true
+ }
+ },
+
+ State {
+ name: 'presetButtonsOFF'
+ when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL")
+ PropertyChanges {
+ target: spacingBetweenItems
+ height: 1/10 * mediaPlayerView.height
+ }
+ PropertyChanges {
+ target: spacingBetweenItems2
+ height: 1/10 * mediaPlayerView.height
+ }
+ PropertyChanges {
+ target: presetButtons
+ visible: false
+ enabled: false
+ }
+ }
+ ]
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml
new file mode 100644
index 0000000000..08f1d76b60
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml
@@ -0,0 +1,75 @@
+/**
+ * @file MusicSourceView.qml
+ * @brief Music source screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ GridMenu {
+ id: menu
+ model: dataContainer.musicSourceModel
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: bottomPanel.top
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ OvalButton {
+ text: title
+ onReleased: contentLoader.go(qml, appId)
+ anchors.centerIn: parent
+ fontSize: Constants.fontSize
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
+
+
+
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml
new file mode 100644
index 0000000000..99f1877a51
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml
@@ -0,0 +1,250 @@
+/**
+ * @file NavigationInRouteGridView.qml
+ * @brief Navigation in route screen veiw.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+
+GeneralView {
+ Item {
+ id: navInRoute
+ anchors.fill: parent
+
+ Image {
+ // 3/4 top screen
+ id: map
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ source: "../res/nav/map.png"
+
+ Image {
+ id: compas
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 1/4 * compas.width
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4 * compas.width
+ source: "../res/nav/compass.png"
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: compas.horizontalCenter
+ spacing: 1/8 * parent.height
+
+ // Zoom "+" button
+ Image {
+ id: zoomIn
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomInBtn
+ anchors.centerIn: parent
+ text: "+"
+ color: Constants.releasedButtonTextColor
+ font.pixelSize: 30
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomInBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomInBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+
+ // Zoom "-" button
+ Image {
+ id: zoomOut
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomOutBtn
+ anchors.centerIn: parent
+ text: "-"
+ color: "white"
+ font.pixelSize: 30
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomOutBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomOutBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+ } // column
+
+ // Options button
+ Image {
+ id: navOptions
+ anchors.top: parent.top
+ anchors.right: parent.right
+ source: "../res/nav/options.png"
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/nav/options_pressed.png"
+ }
+ onReleased: {
+ parent.source = "../res/nav/options.png"
+ }
+ onClicked: {
+ //Options screen
+ }
+ }
+ }
+ } //map
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ Image {
+ id: muteBtnImg
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4 * muteBtnImg.width
+ source: "../res/nav/mute_off.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: if (muteBtnImg.state === "off") {
+ muteBtnImg.state = "on"
+ muteBtnImg.source = "../res/nav/mute_off.png"
+ }
+ else {
+ muteBtnImg.source = "../res/nav/mute_on.png"
+ muteBtnImg.state = "off"
+ }
+ }
+ }
+
+ Image {
+ id: turnArrow
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: muteBtnImg.right
+ anchors.leftMargin: 1/20 * contentLoader.width
+ source: "../res/nav/turnArrow.png"
+ }
+
+ Text {
+ id: street
+ anchors.verticalCenter: cancel.verticalCenter
+ anchors.left: turnArrow.right
+ anchors.leftMargin: 1/20 * contentLoader.width
+ text: "0.2 mi on Cherry Hill Rd."
+ color: "White"
+ font.pixelSize: 20
+ }
+
+ Text {
+ id: timeToDest
+ anchors.verticalCenter: cancel.verticalCenter
+ anchors.right: cancel.left
+ anchors.rightMargin: 1/20 * contentLoader.width
+ text: "2 hrs 27 min"
+ color: "White"
+ font.pixelSize: 20
+ }
+
+ Image {
+ id: cancel
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+
+ source: "../res/buttons/long_oval_btn.png"
+
+ Image {
+ id: destIcon
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: cancel.left
+ anchors.leftMargin: Constants.fontSize
+ source: "../res/nav/dest_icon.png"
+ }
+
+ Text {
+ id: cancelText
+ anchors.centerIn: parent
+ text: "Cancel"
+ color: Constants.primaryColor
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ cancel.source = "../res/buttons/long_oval_pressed_btn.png"
+ destIcon.source = "../res/nav/dest_icon_black.png"
+ cancelText.color = Constants.pressedButtonTextColor
+ }
+
+ onReleased: {
+ cancel.source = "../res/buttons/long_oval_btn.png"
+ destIcon.source = "../res/nav/dest_icon.png"
+ cancelText.color = Constants.primaryColor
+ }
+
+ onClicked: {
+ contentLoader.go("./views/NavigationNoRouteGridView.qml")
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml
new file mode 100644
index 0000000000..f5d19e7626
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml
@@ -0,0 +1,221 @@
+/**
+ * @file NavigationKeyboardView.qml
+ * @brief Navigation keyboard screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ id: navKeyboard
+ anchors.fill: parent
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ // Text line with input text
+ TextInput {
+ id: inputText
+ anchors.top:parent.top
+ anchors.left:parent.left
+ maximumLength: 30
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ text: dataContainer.routeText
+ }
+
+ // Keyboard
+ Column {
+ anchors.centerIn: parent
+ Row {
+ id: upperRow
+ property string qWERTY : "QWERTYUIOP"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Repeater {
+ model: 10
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: upperRow.qWERTY.charAt(index)
+ pixelSize: Constants.fontSize
+
+ onClicked: {
+ dataContainer.routeText += upperRow.qWERTY.charAt(index)
+ }
+ }
+ }
+ }
+ Row {
+ id: middleRow
+ property string aSDFGH : "ASDFGHJKL"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "123"
+ pixelSize: 15
+ }
+ //--------------
+ Repeater {
+ model: 9
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: middleRow.aSDFGH.charAt(index)
+ pixelSize: Constants.fontSize
+
+ onClicked: {
+ dataContainer.routeText += middleRow.aSDFGH.charAt(index)
+ }
+ }
+ }
+ //--------------
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ onIsPressedChanged: {
+ hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png";
+ }
+ Image {
+ id: hoverImg
+ anchors.centerIn: parent
+ source: "../res/nav/delete_icon.png"
+ }
+
+ onClicked: {
+ dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1)
+ }
+ }
+ }
+ Row {
+ id: lowerRow
+ property string zXCVBN : "ZXCVBNM"
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "!@#"
+ pixelSize: 15
+ }
+ //-----------------
+ Repeater {
+ model: 7
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: lowerRow.zXCVBN.charAt(index)
+ pixelSize: Constants.fontSize
+
+ onClicked: {
+ dataContainer.routeText += lowerRow.zXCVBN.charAt(index)
+ }
+ }
+ }
+ //----------------
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "Clear"
+ pixelSize: 12
+
+ onClicked: {
+ dataContainer.routeText = ""
+ }
+ }
+ //----------------
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "Space"
+ pixelSize: 12
+
+ onClicked: {
+ dataContainer.routeText += " "
+ }
+ }
+ }
+
+ } // column
+
+ Image {
+ id: goBtn
+ anchors.right: parent.right
+ anchors.top: parent.top
+ source: "../res/buttons/short_oval_btn.png"
+
+ Text {
+ id: goText
+ anchors.centerIn: parent
+ text: "Go"
+ color: Constants.primaryColor
+ font.pixelSize: Constants.fontSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ goBtn.source = "../res/buttons/short_oval_btn_pressed.png"
+ goText.color = Constants.pressedButtonTextColor
+ }
+
+ onReleased: {
+ goBtn.source = "../res/buttons/short_oval_btn.png"
+ goText.color = Constants.primaryColor
+ }
+
+ onClicked: {
+ contentLoader.go("./views/NavigationInRouteGridView.qml")
+ }
+ }
+ }
+ } // 3/4 top screen
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml
new file mode 100644
index 0000000000..8b8b7ef261
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml
@@ -0,0 +1,75 @@
+/**
+ * @file NavigationMenuView.qml
+ * @brief Navigation menu screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ GridMenu {
+ id: menu
+ model: NavigationMenuModel {}
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: bottomPanel.top
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ OvalButton {
+ text: title
+ onReleased: contentLoader.go(qml)
+ anchors.centerIn: parent
+ fontSize: Constants.fontSize
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
+
+
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml
new file mode 100644
index 0000000000..d4fbb9f4ef
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml
@@ -0,0 +1,205 @@
+/**
+ * @file NavigationNoRouteGridView.qml
+ * @brief Navigation no route screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ id: navNoRoute
+ anchors.fill: parent
+
+ Image {
+ // 3/4 top screen
+ id: map
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ source: "../res/nav/map.png"
+
+ Image {
+ id: compas
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 1/4 * compas.width
+ anchors.left: parent.left
+ anchors.leftMargin: 1/4 * compas.width
+ source: "../res/nav/compass.png"
+ }
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: compas.horizontalCenter
+ spacing: 1/8 * parent.height
+
+ // Zoom "+" button
+ Image {
+ id: zoomIn
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomInBtn
+ anchors.centerIn: parent
+ text: "+"
+ color: "white"
+ font.pixelSize: Constants.fontSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomInBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomInBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+
+ // Zoom "-" button
+ Image {
+ id: zoomOut
+ source: "../res/buttons/zoom.png"
+
+ Text {
+ id: zoomOutBtn
+ anchors.centerIn: parent
+ text: "-"
+ color: "white"
+ font.pixelSize: Constants.fontSize
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/zoom_pressed.png"
+ zoomOutBtn.color = Constants.pressedButtonTextColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/zoom.png"
+ zoomOutBtn.color = Constants.releasedButtonTextColor
+ }
+
+ onClicked: {
+ //Some behavior
+ }
+ }
+ }
+ } // column
+
+ // Options button
+ Image {
+ id: navOptions
+ anchors.top: parent.top
+ anchors.right: parent.right
+ source: "../res/nav/options.png"
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/nav/options_pressed.png"
+ }
+ onReleased: {
+ parent.source = "../res/nav/options.png"
+ }
+ onClicked: {
+ //Options screen
+ }
+ }
+ }
+ } //map
+
+ Item {
+ // 1/4 bottom screen
+ id: bottomPart
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ // Destination search button
+ Image {
+ id: destSearch
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ source: "../res/buttons/longest_oval_btn.png"
+
+ Image {
+ id: destIcon
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 15
+ source: "../res/nav/dest_icon.png"
+ }
+
+ Text {
+ id: destText
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: destIcon.right
+ anchors.leftMargin: 5
+ text: "Destination"
+ color: Constants.primaryColor
+ font.pixelSize: 20
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ destSearch.source = "../res/buttons/longest_oval_btn_pressed.png"
+ destIcon.source = "../res/nav/dest_icon_black.png"
+ destText.color = Constants.pressedButtonTextColor
+ }
+
+ onReleased: {
+ destSearch.source = "../res/buttons/longest_oval_btn.png"
+ destIcon.source = "../res/nav/dest_icon.png"
+ destText.color = Constants.primaryColor
+ }
+
+ onClicked: {
+ contentLoader.go("./views/NavigationMenuView.qml")
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml
new file mode 100644
index 0000000000..4b217cf9f5
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml
@@ -0,0 +1,171 @@
+/**
+ * @file PhoneKeyboardView.qml
+ * @brief Phone keyboard screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+GeneralView{
+ Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons()
+
+ Item {
+ function changeColorOfActiveButtons() {
+ for (var i = 0; i < contactsListModel.count; i++) {
+ activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true
+ }
+ }
+
+ id: phoneKeyboard
+ anchors.fill: parent
+
+ property var activeButtons: {
+ "A": false, "B": false, "C": false, "D": false, "E": false,
+ "F": false, "G": false, "H": false, "I": false, "J": false,
+ "K": false, "L": false, "M": false, "N": false, "O": false,
+ "P": false, "Q": false, "R": false, "S": false, "T": false,
+ "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false
+ }
+
+ ContactsListModel {
+ id: contactsListModel
+ }
+
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ Column {
+ anchors.centerIn: parent
+
+ Row {
+ id: upperRow
+ property string contentLoader : "ABCDEFGHI"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: 9
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]
+ ? Constants.primaryColor : Constants.inactiveButtonTextColor
+ text: upperRow.contentLoader.charAt(index)
+ pixelSize: Constants.fontSize
+ onIsPressedChanged: {
+ if (!isPressed){
+ if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) {
+ dataContainer.contactsFirstLetter = text
+ contentLoader.go("./views/ContactsListView.qml")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Row {
+ id: middleRow
+ property string contentLoader : "JKLMNOPQR"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: 9
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]
+ ? Constants.primaryColor : Constants.inactiveButtonTextColor
+ text: middleRow.contentLoader.charAt(index)
+ pixelSize: Constants.fontSize
+ onIsPressedChanged: {
+ if (!isPressed){
+ if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) {
+ dataContainer.contactsFirstLetter = text
+ contentLoader.go("./views/ContactsListView.qml")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Row {
+ id: lowerRow
+ property string contentLoader : "STUVWXYZ"
+ anchors.horizontalCenter: parent.horizontalCenter
+ Repeater {
+ model: 8
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]
+ ? Constants.primaryColor : Constants.inactiveButtonTextColor
+ text: lowerRow.contentLoader.charAt(index)
+ pixelSize: Constants.fontSize
+ onIsPressedChanged: {
+ if (!isPressed){
+ if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) {
+ dataContainer.contactsFirstLetter = text
+ contentLoader.go("./views/ContactsListView.qml")
+ }
+ }
+ }
+ }
+ }
+ CircleButton {
+ imgOff: "../res/buttons/preset_btn.png"
+ imgOn: "../res/buttons/preset_pressed_btn.png"
+ text: "123"
+ pixelSize: 20
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent}
+ }
+ }
+}
+
+
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml
new file mode 100644
index 0000000000..5cfdc5a309
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml
@@ -0,0 +1,55 @@
+/**
+ * @file PhoneMenuGridView.qml
+ * @brief View for phone menu.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../models"
+import "../controls"
+
+GridMenu {
+ id: menu
+ model: PhoneMenuModel {}
+ delegate: GridItem {
+ width: menu.width / menu.columnsOnPage
+ height: menu.height / menu.rows
+ ClickableImage {
+ anchors.centerIn: parent
+ source: icon
+ onClicked: {
+ if(qml !== "") {
+ contentLoader.go(qml)
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml b/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml
new file mode 100644
index 0000000000..83a223a18a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml
@@ -0,0 +1,98 @@
+/**
+ * @file SettingsSourceView.qml
+ * @brief Settings source screen view.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ Text {
+ id: title
+ text: "Permissions (choose application):"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ height: Constants.fontSize + Constants.panelPadding
+ }
+ ScrollableListView {
+ id: applicationList
+ anchors.top: title.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ model: dataContainer.applicationList
+
+ delegate: Item {
+ width: parent.width
+ height: Math.max(applicationName.height, appIcon.height)
+ Image {
+ id: appIcon
+ source: icon
+ height: Constants.appListIconSize
+ width: height
+ }
+ ClickableText {
+ id: applicationName
+ text: appName
+ defaultColor: Constants.primaryColor
+ pressedColor: Constants.primaryColorPressed
+ font.pixelSize: Constants.appListFontSize
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: appIcon.right
+ anchors.leftMargin: Constants.margin
+ onClicked: {
+ RequestToSDL.SDL_GetListOfPermissions(appId, function(params){
+ settingsContainer.getListOfPermissions_Response(appId, params)
+ });
+ }
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml
new file mode 100644
index 0000000000..f673327c68
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml
@@ -0,0 +1,160 @@
+/**
+ * @file RadioPlayerView.qml
+ * @brief Parent for AM, FM, Sirius players screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models"
+import "../models/Constants.js" as Constants
+
+Item {
+ id: radioPlayerView
+
+ property string radioType: ""
+ property string radioName: ""
+ property alias buttonHD: bot.children
+
+ property PlayerState playerState
+
+ Item {
+ // top 3/4 screen
+ id: upperContent
+ anchors.top: parent.top
+ anchors.left: parent.left
+ height: parent.height * 3/4
+ width: parent.width
+
+ Item {
+ // top part for buttons
+ id: top
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height * 1/4
+
+ OvalButton {
+ text: radioName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ }
+
+ OvalButton {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ text: "Tune"
+ fontSize: Constants.fontSize
+ }
+ }
+
+ Item {
+ // mid part for information about song
+ id: mid
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height / 2
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+
+ Row {
+ Text {
+ id: radioChannelNameText
+ color: Constants.primaryColor
+ text: playerState.presets[0]
+ font.pixelSize: 45
+ }
+ Text {
+ anchors.bottom: radioChannelNameText.bottom
+ color: Constants.primaryColor
+ text: " " + radioType
+ font.pixelSize: 25
+ }
+ }
+
+ Text {
+ color: Constants.primaryColor
+ text: playerState.songName
+ font.pixelSize: 25
+ font.bold: true
+ }
+
+ Text {
+ color: Constants.primaryColor
+ text: playerState.albumName
+ font.pixelSize: 25
+ }
+ }
+ }
+
+ Item {
+ // bottom part for HD button (for FM radio)
+ id: bot
+ anchors.left: parent.left
+ anchors.bottom: parent. bottom
+ width: parent.width
+ height: parent.height * 1/4
+ }
+ }
+
+ Item {
+ // bottom 1/4 screen
+ id: lowerContent
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ // Line that divide screen in two parts
+ Rectangle {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: 2
+ color: Constants.primaryColor
+ }
+
+ PresetRow {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ presets: playerState.presets
+ width: parent.width
+ onSelectedIndexChanged: {
+ radioChannelNameText.text = presets[selectedIndex];
+ }
+ }
+ }
+}
+
+
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml
new file mode 100644
index 0000000000..8ac6e6d9b8
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml
@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ id: deviceList
+ property bool allowed: false
+
+ function setAllowed(allowed) {
+ console.debug("Set allowed", allowed, deviceList.allowed);
+ deviceList.allowed = allowed;
+ for (var i = 0; i < dataContainer.deviceList.count; ++i) {
+ menu.model.get(i).allowed = allowed;
+ }
+ }
+
+ anchors.fill: parent
+ Text {
+ id: title
+ text: "Choose devices to be allowed for SDL functionality:"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ height: Constants.fontSize + Constants.panelPadding
+ }
+
+ OvalButton {
+ id: allDevice
+ text: "All devices Not Allowed"
+ onClicked: {
+ if (parent.allowed) {
+ parent.setAllowed(false);
+ text = "All devices Not Allowed";
+ } else {
+ parent.setAllowed(true);
+ text = "All devices Allowed";
+ }
+ settingsContainer.allowSDLFunctionality(parent.allowed, undefined);
+ }
+ anchors.top: title.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+
+ ScrollableListView {
+ id: menu
+ model: dataContainer.deviceList
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: allDevice.bottom
+ anchors.bottom: bottomPanel.top
+ delegate: OvalButton {
+ text: (allowed) ? name + " - Allowed" :
+ name + " - Not allowed"
+ onClicked: {
+ var item = menu.model.get(index);
+ allDevice.text = "All devices manual Configuration";
+ item.allowed = !item.allowed;
+ settingsContainer.allowSDLFunctionality(item.allowed,
+ {id: item.devid,
+ name: item.name});
+ deviceList.allowed = null;
+ }
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml
new file mode 100644
index 0000000000..ef98ffb10d
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml
@@ -0,0 +1,223 @@
+/**
+ * @file SDLNavi.qml
+ * @brief SDL navigation screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtMultimedia 5.0
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ applicationContext: true
+
+ MultiTouchArea {
+ anchors.fill: parent
+ id: wholeWindow
+
+ Row {
+ // Top items
+ id: topItems
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/6 * parent.height
+ spacing: Constants.sdlNaviSpacing
+
+ Rectangle {
+ anchors.top: parent.top
+ width: 1/5 * parent.width
+ height: 4/5 * parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField1
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ Rectangle {
+ anchors.top: parent.top
+ width: 3/5 * parent.width - 2 * parent.spacing
+ height: parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField2
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ Rectangle {
+ id: rightRectOfTopItems
+ anchors.top: parent.top
+ width: 1/5 * parent.width
+ height: 4/5 * parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3"
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ Column {
+ // "+", "-" button at left
+ anchors.left: parent.left
+ anchors.verticalCenter: parent.verticalCenter
+ width: 1/12 * parent.width
+ height: 2/10 * parent.height + spacing
+ spacing: Constants.sdlNaviSpacing
+
+ GradientRectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ text: "+"
+ isCustomButton: true
+ customButtonID: 3
+ }
+ GradientRectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ text: "-"
+ isCustomButton: true
+ customButtonID: 4
+ }
+ }
+
+ Column {
+ anchors.right: parent.right
+ anchors.top: topItems.bottom
+ width: 1/6 * parent.width
+ height: 2/10 * parent.height + spacing
+ spacing: Constants.sdlNaviSpacing
+
+ Rectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: ""
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ Rectangle {
+ width: parent.width
+ height: 1/10 * wholeWindow.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4"
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ Row {
+ // bottom items
+ id: bottomItems
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/6 * parent.height
+ spacing: Constants.sdlNaviSpacing
+
+ GradientRectangle {
+ anchors.bottom: parent.bottom
+ width: 1/3 * parent.width
+ height: parent.height
+ text: "Menu"
+ isCustomButton: true
+ customButtonID: 1
+ }
+ Rectangle {
+ anchors.bottom: parent.bottom
+ width: 1/3 * parent.width - 2 * parent.spacing
+ height: parent.height
+ color: Constants.sdlNaviTransparentItemColor
+ radius: 5
+ Text {
+ text: "mainField5"
+ anchors.fill: parent
+ font.pixelSize: Constants.fontSize
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ GradientRectangle {
+ anchors.bottom: parent.bottom
+ width: 1/3 * parent.width
+ height: parent.height
+ text: "Custom Button"
+ isCustomButton: true
+ customButtonID: 2
+ }
+ }
+
+ GradientRectangle {
+ anchors.right: parent.right
+ anchors.bottom: bottomItems.top
+ anchors.bottomMargin: Constants.sdlNaviSpacing
+ width: 1/6 * parent.width
+ height: 1/10 * parent.height
+ text: "Options"
+ fontSize: Constants.fontSize
+ onReleased: {
+ contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId)
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml
new file mode 100644
index 0000000000..231ab03135
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml
@@ -0,0 +1,179 @@
+/**
+ * @file SDLNonMediaView.qml
+ * @brief SDL non media screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ id: upperContent
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+
+ Item {
+ id: topButtonRow
+ // top 1/4 of screen
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ elementWidth: Constants.ovalButtonWidth
+ spacing: (width - 4 * elementWidth) / 3
+ snapTo: elementWidth + spacing
+
+ OvalButton {
+ text: "Options"
+ onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
+ }
+
+ Repeater {
+ model: dataContainer.currentApplication.softButtons ?
+ dataContainer.currentApplication.softButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.softButtons.get(index)
+ }
+ }
+ }
+ }
+
+ Column {
+ id: midContent
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: topButtonRow.bottom
+ anchors.left: parent.left
+
+ Text {
+ id: deviceName
+ width: parent.width
+ height: 1/5 * parent.height
+ text: "Device: " + dataContainer.currentApplication.deviceName
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ Row {
+ width: parent.width
+ height: 4/5 * parent.height
+ spacing: Constants.margin
+
+ Image {
+ id: image
+ height: parent.height
+ width: height
+ source: dataContainer.currentApplication.hmiUIText.image
+ }
+
+ Column {
+ height: parent.height
+ width: parent.width - image.width - parent.spacing
+ spacing: Constants.margin
+
+ Text {
+ id: text1
+ width: parent.width
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
+ text: dataContainer.currentApplication.hmiUIText.mainField1
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ Text {
+ width: parent.width
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
+ text: dataContainer.currentApplication.hmiUIText.mainField2
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ // bottom 1/4 screen
+ id: lowerContent
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height * 1/4
+
+ PresetRow {
+ id: presetsRow
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ presets: Internal.getArrayForPresetRow(dataContainer.currentApplication)
+ width: parent.width
+ property bool clickProcessed
+
+ onPresetButtonPressed: {
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
+ }
+
+ onPresetButtonReleased: {
+ sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
+ }
+
+ onPresetButtonClicked: {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
+ }
+
+ onPresetButtonHold: {
+ sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
+ }
+ }
+ }
+
+ StatusBar {
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
new file mode 100644
index 0000000000..8f3a0a17b6
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
@@ -0,0 +1,120 @@
+/**
+ * @file SDLPlayerOptionsListView.qml
+ * @brief SDL player options screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models/Internal.js" as Internal
+
+GeneralView {
+ applicationContext: true
+ systemContext: Common.SystemContext.SYSCTXT_MENU
+ Item {
+ // 3/4 top screen
+ height: parent.height * 3/4
+ width: parent.width
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+
+ ListView {
+ id: sdlPlayerOptionsListView
+ anchors.horizontalCenter: parent.horizontalCenter
+ width:parent.width
+ height:parent.height
+
+ model: dataContainer.currentApplication.currentSubMenu
+
+ delegate: Row {
+ spacing: Constants.iconItemListSpacing
+ Icon {
+ source: model.icon
+ width: Constants.iconItemListSize
+ height: Constants.iconItemListSize
+
+ MouseArea {
+ anchors.fill: parent
+ enabled: model.icon.value !== undefined
+
+ onPressed: text.press()
+ onReleased: text.release()
+ onCanceled: text.release()
+ onClicked: text.click()
+ }
+ }
+
+ ClickableText {
+ id: text
+ text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "")
+ width: sdlPlayerOptionsListView.width - x
+ elide: Text.ElideRight
+ defaultColor: type === Internal.MenuItemType.MI_PARENT ?
+ Constants.inactiveButtonTextColor :
+ Constants.primaryColor
+ pressedColor: type === Internal.MenuItemType.MI_PARENT ?
+ Constants.inactiveButtonTextColorPressed :
+ Constants.primaryColorPressed
+ font.pixelSize: Constants.titleFontSize
+
+ function click() {
+ console.debug("enter")
+ switch (type) {
+ case Internal.MenuItemType.MI_NODE:
+ sdlUI.onCommand(model.id, dataContainer.currentApplication.appId)
+ contentLoader.back()
+ break;
+ case Internal.MenuItemType.MI_SUBMENU:
+ case Internal.MenuItemType.MI_PARENT:
+ dataContainer.currentApplication.currentSubMenu = subMenu
+ break;
+ }
+ console.debug("exit")
+ }
+ onClicked: click()
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml
new file mode 100644
index 0000000000..4fff5aa826
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml
@@ -0,0 +1,79 @@
+/**
+ * @file SDLPlayerView.qml
+ * @brief SDL player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ applicationContext: true
+ MediaPlayer {
+ id: mediaPlayer
+ onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
+ onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
+ playerName: "SDL music"
+ playerType: "SDL"
+ image: dataContainer.currentApplication.hmiUIText.image
+ anchors.fill: parent
+
+ buttons: [
+ OvalButton {
+ text: dataContainer.currentApplication.appName
+ onReleased: { contentLoader.go("./views/MusicSourceView.qml") }
+ },
+
+ OvalButton {
+ text: "SDL Menu"
+ onReleased: { contentLoader.go("./views/ApplicationListView.qml") }
+ },
+
+ OvalButton {
+ text: "Options"
+ onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
+ },
+
+ Repeater {
+ model: dataContainer.currentApplication.softButtons ?
+ dataContainer.currentApplication.softButtons.count :
+ 0
+
+ delegate: SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.softButtons.get(index)
+ }
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
new file mode 100644
index 0000000000..ec9731d1c4
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
@@ -0,0 +1,176 @@
+/**
+ * @file ScrollableMessageView.qml
+ * @brief Scrollable Message View.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../hmi_api/Async.js" as Async
+import "../models/Constants.js" as Constants
+import "../models"
+import "../popups"
+
+GeneralView {
+ applicationContext: true
+ onLeaveScreen: {
+ timer.stop()
+ dataContainer.scrollableMessageModel.running = false
+ DBus.sendReply(dataContainer.scrollableMessageModel.async, { __retCode: dataContainer.scrollableMessageModel.result })
+ }
+ Component.onCompleted: {
+ dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
+ dataContainer.scrollableMessageModel.running = true
+ timer.start()
+ }
+
+ Timer {
+ id: timer
+ interval: dataContainer.scrollableMessageModel.timeout
+ onTriggered: {
+ dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS
+ contentLoader.back()
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: Constants.secondaryColor
+
+ Item {
+ // top 1/5 of screen
+ id: top
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/5 : 1
+
+ PagedFlickable {
+ id: flickRow
+ width: top.width
+ spacing: (width - elementWidth * 4) / 3
+ snapTo: Constants.ovalButtonWidth + spacing
+ elementWidth: Constants.ovalButtonWidth
+ Repeater {
+ model: dataContainer.scrollableMessageModel.softButtons ?
+ dataContainer.scrollableMessageModel.softButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.scrollableMessageModel.appId
+ button: dataContainer.scrollableMessageModel.softButtons.get(index)
+ onKeepContext: { timer.restart() }
+ onDefaultAction: {
+ dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
+ contentLoader.back()
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ id: middle
+ anchors.top: top.bottom
+ anchors.left: parent.left
+ anchors.bottom: bottom.top
+ width: parent.width
+ clip: true
+
+ Flickable {
+ id:flickable
+ anchors.fill: middle
+ flickableDirection: Flickable.VerticalFlick
+ contentWidth: longMessageText.width
+ contentHeight: longMessageText.height
+ clip: true
+
+ Text {
+ id: longMessageText
+ wrapMode: Text.Wrap
+ width: middle.width
+ text: dataContainer.scrollableMessageModel.longMessageText
+ color: Constants.scrollableMessageTextColor
+ font.pixelSize: Constants.fontSize
+ }
+ }
+ Rectangle {
+ id: scrollbar
+ anchors.right: flickable.right
+ y: flickable.visibleArea.yPosition * flickable.height
+ width: Constants.scrollableMessageScrollBarWidth
+ height: flickable.visibleArea.heightRatio * flickable.height
+ visible: !(flickable.visibleArea.heightRatio > 1)
+ color: Constants.scrollableMessageScrollBarColor
+ }
+ }
+ Item {
+ // 1/5 bottom screen
+ id: bottom
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/5 * parent.height
+ OvalButton {
+ anchors.centerIn: parent
+ text: "Close"
+ onClicked: {
+ dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
+ contentLoader.back()
+ }
+ }
+ }
+ }
+ /**
+ * Test Support Section
+ *
+ */
+ function getTimer(){
+ return timer
+ }
+ function getSoftButtonsListView(){
+ return softButtons
+ }
+ function getScrollbar(){
+ return scrollbar
+ }
+ function getTextArea(){
+ return middle
+ }
+ function getBackButton(){
+ return backButton
+ }
+
+ /**
+ * Test Support Section End
+ */
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml
new file mode 100644
index 0000000000..fa0bfbc821
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml
@@ -0,0 +1,88 @@
+/**
+ * @file SettingsSourceView.qml
+ * @brief Settings source screen view.
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ signal itemActivated(string item)
+
+ onItemActivated: {
+ switch (item) {
+ case "update_sdl": RequestToSDL.SDL_UpdateSDL(settingsContainer.updateStatus); break;
+ case "get_status_update": RequestToSDL.SDL_GetStatusUpdate(settingsContainer.updateStatus); break;
+ case "get_urls": RequestToSDL.SDL_GetURLS(0, settingsContainer.startPTExchange); break;
+ }
+ }
+
+ Item {
+ anchors.fill: parent
+ ScrollableListView {
+ id: menu
+ model: dataContainer.settingsSourceModel
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: bottomPanel.top
+ delegate: OvalButton {
+ text: title
+ onReleased: {
+ if (qml) {
+ contentLoader.go(qml, appId);
+ } else {
+ itemActivated(action);
+ }
+ }
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
+
+
+
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml
new file mode 100644
index 0000000000..b79cddf8cf
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml
@@ -0,0 +1,293 @@
+/**
+ * @file SimulationView.qml
+ * @brief Area of screen responsible for simulation actions
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../views"
+import "../popups"
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ width: controlArea.width + controlArea.anchors.margins
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ color: Constants.panelColor
+
+ Item {
+ id: showArea
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins)
+
+ ExitAllApplicationsPopup {
+ id: exitAllApplicationsPopup
+ anchors.fill: parent
+ visible: false
+ }
+
+ VehicleInfoPopUp {
+ id: viPopUp
+ anchors.fill: parent
+ }
+
+ TBTClientStatePopUp {
+ id: tbtClientStatePopUp
+ anchors.fill: parent
+ visible: false
+ }
+ }
+
+ Item {
+ id: controlArea
+ anchors.bottom: parent.bottom
+ anchors.margins: Constants.panelPadding
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: table.width
+
+ ListModel {
+ id: languagesList
+
+ Component.onCompleted: {
+ for (var name in Common.Language) {
+ if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) {
+ append({name: name.replace('_', '-')});
+ }
+ }
+ }
+ }
+
+ Text {
+ id: label
+ text: "Languages"
+ color: Constants.panelTextColor
+ anchors.bottom: table.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ Grid {
+ id: table
+ spacing: 5
+ columns: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: globalProperties.top
+
+ Text {
+ text: "HMI UI"
+ color: Constants.panelTextColor
+ }
+
+ Text {
+ text: "HMI TTS + VR"
+ color: Constants.panelTextColor
+ }
+
+ ComboBox {
+ width: table.width / table.columns - table.spacing
+ model: languagesList
+ onCurrentIndexChanged: {
+ dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex];
+ sdlUI.onLanguageChange(dataContainer.hmiUILanguage);
+ }
+ z: 1000
+ }
+
+ ComboBox {
+ width: table.width / table.columns - table.spacing
+ model: languagesList
+ onCurrentIndexChanged: {
+ dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex];
+ sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage);
+ sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage);
+ }
+ z: 1000
+ }
+
+ Text {
+ text: "Application UI"
+ color: Constants.panelTextColor
+ }
+
+ Text {
+ text: "Application TTS + VR"
+ color: Constants.panelTextColor
+ }
+
+ Text {
+ id: uiLanguageLabel
+ color: Constants.panelTextColor
+ text: " "
+ Connections {
+ target: dataContainer
+ onCurrentApplicationChanged: {
+ for (var s in Common.Language) {
+ if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) {
+ uiLanguageLabel.text = s;
+ }
+ }
+ }
+ }
+ }
+
+ Text {
+ id: ttsLanguageLabel
+ color: Constants.panelTextColor
+ text: " "
+ Connections {
+ target: dataContainer
+ onCurrentApplicationChanged: {
+ for (var s in Common.Language) {
+ if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) {
+ ttsLanguageLabel.text = s;
+ }
+ }
+ }
+ }
+ }
+
+ PushButton {
+ id: vehicleInfo
+ label: "Vehicle info"
+ toggleMode: true
+ onPressed: {
+ viPopUp.show();
+ }
+ onUnpressed: {
+ viPopUp.hide();
+ }
+ }
+
+ PushButton {
+ id: tbtClientState
+ label: "TBT Client state"
+ toggleMode: true
+ onPressed: {
+ tbtClientStatePopUp.show();
+ }
+ onUnpressed: {
+ tbtClientStatePopUp.hide();
+ }
+ }
+
+ PushButton {
+ label: "Exit application"
+ onClicked: {
+ if (dataContainer.applicationContext) {
+ sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId)
+ }
+ }
+ }
+
+ PushButton {
+ id: exitAllAppsButton
+ label: "Exit all apps"
+ toggleMode: true
+ onPressed: {
+ exitAllApplicationsPopup.show()
+
+ }
+ onUnpressed: {
+ exitAllApplicationsPopup.hide()
+ }
+ Connections {
+ target: exitAllApplicationsPopup
+ onVisibleChanged: {
+ if (!exitAllApplicationsPopup.visible) {
+ exitAllAppsButton.state = "unpressed"
+ }
+ }
+ }
+ }
+
+ CheckBox {
+ style: CheckBoxStyle {
+ label: Text {
+ color: Constants.panelTextColor
+ text: "Use URL"
+ }
+ }
+ }
+
+ CheckBox {
+ style: CheckBoxStyle {
+ label: Text {
+ color: Constants.panelTextColor
+ text: "DD"
+ }
+ }
+ onClicked: {
+ if (checked) {
+ dataContainer.driverDistractionState =
+ Common.DriverDistractionState.DD_ON;
+ } else {
+ dataContainer.driverDistractionState =
+ Common.DriverDistractionState.DD_OFF;
+ }
+ }
+ }
+ }
+
+ Rectangle {
+ id: globalProperties
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: listGlobalProperties.height + Constants.panelPadding
+ border.color: Constants.panelTextColor
+ border.width: 1
+ color: Constants.panelColor
+ Column {
+ id: listGlobalProperties
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.panelPadding / 4
+ Text {
+ text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt
+ color: Constants.panelTextColor
+ }
+ Text {
+ text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt
+ color: Constants.panelTextColor
+ }
+ Text {
+ text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet
+ color: Constants.panelTextColor
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml
new file mode 100644
index 0000000000..e5d2149542
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml
@@ -0,0 +1,46 @@
+/**
+ * @file SiriusPlayerView.qml
+ * @brief Sirius player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../controls"
+
+GeneralView {
+ RadioPlayer {
+ id: siriusRadioPlayer
+ anchors.fill: parent
+ radioType: ""
+ radioName: "Sirius"
+
+ playerState: dataContainer.siriusPlayerState
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml b/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml
new file mode 100644
index 0000000000..75f76249d5
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ Text {
+ id: title
+ text: "Statistics Info:"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ height: Constants.fontSize + Constants.panelPadding
+ }
+
+ ScrollableListView {
+ id: menu
+ model: statisticsTypeList
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: title.bottom
+ anchors.bottom: bottomPanel.top
+ delegate: OvalButton {
+ text: name
+ onClicked: sdlSDL.addStatisticsInfo(Common.StatisticsType[name]);
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+ }
+
+ ListModel {
+ id: statisticsTypeList
+
+ Component.onCompleted: {
+ for (var name in Common.StatisticsType) {
+ append({name: name});
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml
new file mode 100644
index 0000000000..058282ae00
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ Text {
+ id: title
+ text: "System Error:"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ height: Constants.fontSize + Constants.panelPadding
+ }
+
+ ScrollableListView {
+ id: menu
+ model: systemErrorList
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: title.bottom
+ anchors.bottom: bottomPanel.top
+ delegate: OvalButton {
+ text: name
+ onClicked: sdlSDL.onSystemError(Common.SystemError[name]);
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+ }
+
+ ListModel {
+ id: systemErrorList
+
+ Component.onCompleted: {
+ for (var name in Common.SystemError) {
+ append({name: name});
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml
new file mode 100644
index 0000000000..32a3987e74
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../models"
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+
+GeneralView {
+ Item {
+ anchors.fill: parent
+ Text {
+ id: title
+ text: "System Request:"
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ height: Constants.fontSize + Constants.panelPadding
+ }
+
+ ScrollableListView {
+ id: menu
+ model: requestTypeList
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: title.bottom
+ anchors.bottom: bottomPanel.top
+ delegate: OvalButton {
+ text: name
+ onClicked: settingsContainer.systemRequest(Common.RequestType[name]);
+ anchors.left: parent.left
+ anchors.right: parent.right
+ fontSize: Constants.fontSize
+ }
+ }
+
+ ListModel {
+ id: requestTypeList
+
+ Component.onCompleted: {
+ for (var name in Common.RequestType) {
+ append({name: name});
+ }
+ }
+ }
+
+ Item {
+ id: bottomPanel
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+
+ BackButton { anchors.centerIn: parent }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml
new file mode 100644
index 0000000000..a69a86a40a
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml
@@ -0,0 +1,202 @@
+/**
+ * @file TurnByTurnView.qml
+ * @brief View for TurnByTurn.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../models"
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ id: turnByTurnView
+ anchors.fill: parent
+
+ Item {
+ // top 3/4 of screen
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: parent.height * 3/4
+
+ Item {
+ // row of oval buttons
+ id: ovalButtonsRow
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ id: buttonsRow
+ width: parent.width
+ spacing: (width - 4 * elementWidth) / 3
+ anchors.verticalCenter: parent.verticalCenter
+ snapTo: Constants.ovalButtonWidth + spacing
+ elementWidth: Constants.ovalButtonWidth
+
+ OvalButton {
+ id: turnListButton
+ text: "TurnList"
+ onClicked: {
+ console.log("Go to TurnListView");
+ contentLoader.go("./views/TurnListView.qml");
+ }
+ }
+
+ Repeater {
+ model: dataContainer.currentApplication.navigationSoftButtons ?
+ dataContainer.currentApplication.navigationSoftButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.navigationSoftButtons.get(index)
+ }
+ }
+ }
+ }
+
+ Column {
+ // Picture + text information + media clock
+ id: mediaContent
+ width: parent.width
+ height: 3/4 * parent.height
+ anchors.left: parent.left
+ anchors.top: ovalButtonsRow.bottom
+
+ Row {
+ // picture + text info
+ width: parent.width
+ height: 3/4 * parent.height
+ spacing: Constants.margin
+
+ Icon {
+ id: image
+ height: parent.height
+ width: height
+ source: dataContainer.currentApplication.navigationModel.turnIcon
+ }
+
+ Column {
+ // text info
+ id: textInfo
+ height: parent.height
+ width: parent.width - image.width - parent.spacing
+ spacing: (height - 5 * navText1.height) / 4
+
+ Text {
+ id: navText1
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: dataContainer.currentApplication.navigationModel.text1
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.currentApplication.navigationModel.text1
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: dataContainer.currentApplication.navigationModel.text2
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.currentApplication.navigationModel.text2
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "Total distance: " + dataContainer.currentApplication.navigationModel.totalDistance
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.currentApplication.navigationModel.totalDistance
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "Time to destination: " + dataContainer.currentApplication.navigationModel.timeToDestination
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.currentApplication.navigationModel.timeToDestination
+ }
+
+ Text {
+ anchors.left: parent.left
+ anchors.right: parent.right
+ color: Constants.primaryColor
+ text: "ETA: " + dataContainer.currentApplication.navigationModel.eta
+ font.pixelSize: Constants.fontSize
+ visible: dataContainer.currentApplication.navigationModel.eta
+ }
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: 1/4 * parent.height
+ width: 2/3 * parent.width
+
+ Rectangle {
+ id: coveredDistance
+ anchors.verticalCenter: parent.verticalCenter
+ height: Constants.distanceBarHeight
+ width: dataContainer.currentApplication.navigationModel.distanceToManeuver /
+ dataContainer.currentApplication.navigationModel.distanceToManeuverScale * parent.width
+ color: "white"
+ }
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ height: Constants.distanceBarHeight
+ width: parent.width - coveredDistance.width
+ color: Constants.primaryColor
+ }
+ }
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml
new file mode 100644
index 0000000000..bdd0b3d6cf
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml
@@ -0,0 +1,103 @@
+/**
+ * @file TurnListView.qml
+ * @brief View for TurnByTurn list.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models/Constants.js" as Constants
+import "../hmi_api/Common.js" as Common
+
+GeneralView {
+ applicationContext: true
+
+ Item {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ width: parent.width
+ height: 3/4 * parent.height
+
+ Item {
+ id: sotfButtons
+ width: parent.width
+ height: 1/4 * parent.height
+
+ PagedFlickable {
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ elementWidth: Constants.ovalButtonWidth
+ snapTo: elementWidth + spacing
+ spacing: (width - 4 * elementWidth) / 3
+
+ Repeater {
+ model: dataContainer.currentApplication.turnListSoftButtons ?
+ dataContainer.currentApplication.turnListSoftButtons.count :
+ 0
+ delegate:
+ SoftButton {
+ appId: dataContainer.currentApplication.appId
+ button: dataContainer.currentApplication.turnListSoftButtons.get(index)
+ }
+ }
+ }
+ }
+
+ ScrollableListView {
+ id: scrollableList
+ anchors.top: sotfButtons.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 3/4 * parent.height
+
+ model: dataContainer.currentApplication.turnList
+
+ delegate:
+ ListItem {
+ width: scrollableList.width
+ height: Constants.iconItemListSize
+ text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText
+ fontSize: Constants.fontSize
+ icon: dataContainer.currentApplication.turnList.get(index).turnIcon
+ }
+ }
+ }
+
+ Item {
+ // 1/4 bottom screen
+ id: back
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ BackButton { anchors.centerIn: parent }
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml
new file mode 100644
index 0000000000..f8a2d39806
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml
@@ -0,0 +1,61 @@
+/**
+ * @file UsbPlayerView.qml
+ * @brief USB player screen view.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+import QtQuick 2.0
+import "../hmi_api/Common.js" as Common
+import "../models/Constants.js" as Constants
+import "../controls"
+
+GeneralView {
+ category: Common.DeactivateReason.AUDIO
+ MediaPlayer {
+ id: usbPlayer
+ playerName: "USB"
+ anchors.fill: parent
+ playerState: dataContainer.usbPlayerState
+ image: playerState.albumImage
+
+ buttons: [
+ OvalButton {
+ text: usbPlayer.playerName
+ onReleased: contentLoader.go("./views/MusicSourceView.qml")
+ fontSize: Constants.fontSize
+ },
+
+ OvalButton {
+ text: "Browse"
+ fontSize: Constants.fontSize
+ }
+ ]
+ }
+}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml
new file mode 100644
index 0000000000..6228b63c79
--- /dev/null
+++ b/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml
@@ -0,0 +1,135 @@
+/**
+ * @file WarningInfo.qml
+ * @brief Screen with warning information.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import "../controls"
+import "../models/Constants.js" as Constants
+
+Rectangle {
+ id: warningInfo
+ anchors.fill: parent
+ color: Constants.secondaryColor
+ Text {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ height: 1/4 * parent.height
+ width: parent.width
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ text: "WARNING!"
+ color: Constants.warningColor
+ font.pixelSize: Constants.titleFontSize
+ font.bold: true
+ style: Text.Raised
+ styleColor: "gray"
+ }
+
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Constants.margin
+ height: 1/2 * parent.height
+ width: parent.width
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.WordWrap
+
+ text: "This application is intended to be used as a demonstrative aid only, "
+ + "while the vehicle is parked. Don't use it while driving. <br /><br />"
+ + "Use extreme caution when using any device that takes your attention off the road. "
+ + "Ford recommends against the use of any hand-held device while driving and that you comply "
+ + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle."
+ color: "white"
+ font.pixelSize: 25
+ font.bold: true
+ }
+
+ function showOkButton() {
+ okButtonAnimation.start()
+ }
+
+ Item {
+ id: ok
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ width: parent.width
+ height: 1/4 * parent.height
+ opacity: 0
+
+ SequentialAnimation
+ {
+ id: okButtonAnimation
+ // Decrease this value while debugging
+ PauseAnimation { duration: Constants.warningScreenDuration }
+ NumberAnimation {
+ target: ok
+ duration: Constants.animationDuration
+ property: "opacity"
+ from: 0; to: 1;
+ }
+ }
+
+ Image {
+ id: okButton
+ anchors.centerIn: parent
+ source: "../res/buttons/longest_oval_btn.png"
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ text: "OK"
+ font.pixelSize: Constants.fontSize
+ color: Constants.primaryColor
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ parent.source = "../res/buttons/longest_oval_btn_pressed.png"
+ text.color = Constants.secondaryColor
+ }
+ onReleased: {
+ parent.source = "../res/buttons/longest_oval_btn.png"
+ text.color = Constants.primaryColor
+ }
+ onClicked: {
+ console.log("WarningInfo OkButton - on clicked enter");
+ warningInfo.visible = false
+ }
+ }
+ }
+ }
+}
diff --git a/src/components/qt_hmi/qml_plugins/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/CMakeLists.txt
new file mode 100644
index 0000000000..6ff595315c
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# --- DBus plugin
+add_subdirectory(./dbus_adapter)
+
+# --- Hmi Framework plugin
+add_subdirectory(./hw_buttons)
+
+# --- Log4cxx plugin
+add_subdirectory(./log4cxx)
+
+# --- NamedPipeNotifier plugin
+add_subdirectory(./named_pipe_notifier)
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt
new file mode 100644
index 0000000000..53d1144356
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt
@@ -0,0 +1,164 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
+set(dbus_dir ${components_dir}/dbus)
+set(codegen_dir ${dbus_dir}/codegen)
+set(codegen ${codegen_dir}/make_qml_dbus_cpp.py)
+set(codegen_request_to_sdl ${codegen_dir}/make_request_to_sdl.py)
+set(codegen_hmi_requests ${codegen_dir}/make_hmi_requests.py)
+set(codegen_notification_qml ${codegen_dir}/make_notifications_qml.py)
+set(parser ${codegen_dir}/ford_xml_parser.py)
+set(interfaces_dir ${components_dir}/interfaces)
+set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h
+ COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${api_xml} ${codegen} ${parser}
+ COMMENT "Generating files:
+ ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h
+ from:
+ ${api_xml} ..."
+)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.cc ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h
+ COMMAND python ${codegen_request_to_sdl} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${api_xml} ${codegen_request_to_sdl} ${parser}
+ COMMENT "Generating files:
+ ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h
+ from:
+ ${api_xml} ..."
+)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.cc ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h
+ COMMAND python ${codegen_hmi_requests} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${api_xml} ${codegen_hmi_requests} ${parser}
+ COMMENT "Generating files:
+ ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h
+ from:
+ ${api_xml} ..."
+)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.cc ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h
+ COMMAND python ${codegen_notification_qml} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${api_xml} ${codegen_notification_qml} ${parser}
+ COMMENT "Generating files:
+ ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h
+ from:
+ ${api_xml} ..."
+)
+
+set(target DbusAdapter)
+set(destination com/ford/sdl/hmi/dbus_adapter)
+set(install_destination bin/hmi/plugins/${destination})
+set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+set(CMAKE_AUTOMOC ON)
+set(SOURCES
+ dbus_plugin.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc
+ moc_qml_dbus.cpp
+ sdl_proxy.cc
+ moc_sdl_proxy.cpp
+ hmi_proxy.cc
+ stream_qvariant.cc
+ moc_qml_dbus.cpp
+ dbus_controller.cc
+ request_to_sdl.cc
+ moc_request_to_sdl.cpp
+ hmi_requests.cc
+ moc_hmi_requests.cpp
+)
+include_directories(
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}/src/components
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include/
+)
+
+add_library(${target} SHARED ${SOURCES})
+
+if (${qt_version} MATCHES "4.8.5")
+ qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h moc_hmi_requests.cpp)
+ qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h moc_request_to_sdl.cpp)
+ qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h moc_qml_dbus.cpp)
+ qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h moc_sdl_proxy.cpp)
+ qt4_use_modules(${target} Core DBus Declarative)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
+elseif (${qt_version} MATCHES "5.1.0")
+ qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h moc_hmi_requests.cpp)
+ qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h moc_request_to_sdl.cpp)
+ qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h moc_qml_dbus.cpp)
+ qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h moc_sdl_proxy.cpp)
+ qt5_use_modules(${target} Core DBus Qml)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
+endif ()
+
+target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+target_link_libraries(${target} Utils)
+
+add_custom_target(copy_library_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
+ ${copy_destination}
+ DEPENDS ${target}
+ COMMENT "Copying library ${library_name}")
+file(COPY qmldir DESTINATION ${copy_destination})
+
+install(TARGETS ${target}
+ DESTINATION ${install_destination}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+install(FILES qmldir DESTINATION ${install_destination})
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_custom_target(qmltypes_${target} ALL
+ COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.dbus_adapter 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null || true
+ DEPENDS copy_library_${target}
+ )
+ add_custom_target(copy_qmltypes_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
+ ${copy_destination}
+ DEPENDS qmltypes_${target}
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
+endif ()
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
new file mode 100644
index 0000000000..abfe712398
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
@@ -0,0 +1,93 @@
+/**
+ * \file dbus_controller.cpp
+ * \brief DbusController class.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "dbus_controller.h"
+#include "interfaces/QT_HMI_API.h"
+#include <QtDBus/QDBusConnection>
+
+DBusController::DBusController(QObject *parent)
+ : QObject(parent),
+ message(NULL) {}
+
+void DBusController::addMessage(const QDBusMessage& message, fillRoutine fill,
+ int async_uid) {
+ delayedReply reply;
+ reply.message = message;
+ reply.fill = fill;
+ replies_[async_uid] = reply;
+}
+
+void DBusController::sendReply(QVariant asyncObject, QVariant data) {
+ int uid = asyncObject.toMap()["__async_uid"].toInt();
+ std::map<int, delayedReply>::iterator it = replies_.find(uid);
+ if (it != replies_.end()) {
+ QDBusMessage msg = it->second.message.createReply();
+ if (!it->second.fill(msg, data.toMap())) {
+ QDBusConnection::sessionBus()
+ .send(it->second.message.createErrorReply(QDBusError::InternalError,
+ QString::number(hmi_apis::Common_Result::INVALID_DATA)));
+ } else {
+ QDBusConnection::sessionBus().send(msg);
+ }
+ replies_.erase(it);
+ }
+}
+
+void DBusController::sendReply(QVariant data) {
+ if (!message)
+ return;
+ QDBusMessage msg = message->createReply();
+ if (!fill(msg, data.toMap())) {
+ QDBusConnection::sessionBus()
+ .send(message->createErrorReply(QDBusError::InternalError,
+ QString::number(hmi_apis::Common_Result::INVALID_DATA)));
+ } else {
+ QDBusConnection::sessionBus().send(msg);
+ }
+}
+
+void DBusController::sendError(QVariant asyncObject, QVariant code, QVariant message) {
+ int uid = asyncObject.toMap()["__async_uid"].toInt();
+ std::map<int, delayedReply>::iterator it = replies_.find(uid);
+ if (it != replies_.end()) {
+ QDBusMessage msg = it->second.message.createErrorReply(code.toString(),
+ message.toString());
+ QDBusConnection::sessionBus().send(msg);
+ replies_.erase(it);
+ }
+}
+
+void DBusController::sendError(QVariant asyncObject, QVariant code) {
+ sendError(asyncObject, code, QVariant(""));
+}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
new file mode 100644
index 0000000000..45b6a4e7fe
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
@@ -0,0 +1,65 @@
+/**
+ * \file dbus_controller.h
+ * \brief DbusController class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
+
+#include <QtDBus/QDBusMessage>
+#include <QtCore/QObject>
+#include <map>
+
+typedef bool (*fillRoutine)(QDBusMessage&, const QVariantMap&);
+
+class DBusController: public QObject {
+ struct delayedReply {
+ QDBusMessage message;
+ fillRoutine fill;
+ };
+ Q_OBJECT
+
+ public:
+ explicit DBusController(QObject *parent = 0);
+ void addMessage(const QDBusMessage& message, fillRoutine fill, int async_uid);
+ Q_INVOKABLE void sendReply(QVariant asyncObject, QVariant data);
+ Q_INVOKABLE void sendReply(QVariant data);
+ Q_INVOKABLE void sendError(QVariant asyncObject, QVariant code);
+ Q_INVOKABLE void sendError(QVariant asyncObject, QVariant code, QVariant message);
+ const QDBusMessage* message;
+ fillRoutine fill;
+
+ private:
+ std::map<int, delayedReply> replies_;
+};
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
new file mode 100644
index 0000000000..c264a42a8b
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
@@ -0,0 +1,97 @@
+/**
+ * \file dbus_plugin.cpp
+ * \brief DbusPlugin class source file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "dbus_plugin.h"
+
+#include "hmi_proxy.h"
+#include "sdl_proxy.h"
+#include "optional_argument.h"
+#include "qml_dbus.h"
+#include "dbus_controller.h"
+#include "request_to_sdl.h"
+
+#include <log4cxx/logger.h>
+#include <log4cxx/propertyconfigurator.h>
+
+#include <QtCore/QString>
+#include <QtDBus/QDBusConnection>
+
+#if QT_4
+# include <QtDeclarative/QDeclarativeContext>
+# include <QtDeclarative/QDeclarativeListReference>
+# include <QtDeclarative/QDeclarativeEngine>
+#elif QT_5
+# include <QtQml/QQmlContext>
+# include <QtQml/QQmlListReference>
+# include <QtQml/QQmlEngine>
+#endif // QT_VERSION
+log4cxx::LoggerPtr logger_ = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("DBusPlugin"));
+
+void DbusPlugin::registerTypes(const char *uri) {
+ log4cxx::PropertyConfigurator::configure("log4cxx.properties");
+
+ // @uri sdl.core.api
+ qmlRegisterType<HmiProxy>(uri, 1, 0, "HMIAdapter");
+ qmlRegisterType<SdlProxy>(uri, 1, 0, "SDLAdapter");
+
+ RegisterDbusMetatypes();
+ qDBusRegisterMetaType<OptionalArgument<int> >();
+ qDBusRegisterMetaType<OptionalArgument<QList<int> > >();
+ qDBusRegisterMetaType<OptionalArgument<QString> >();
+ qDBusRegisterMetaType<OptionalArgument<QStringList> >();
+ qDBusRegisterMetaType<OptionalArgument<bool> >();
+ qDBusRegisterMetaType<OptionalArgument<QList<bool> > >();
+ qDBusRegisterMetaType<OptionalArgument<double> >();
+ qDBusRegisterMetaType<OptionalArgument<QList<double> > >();
+
+ HmiProxy::api_adaptors_.Init(this);
+
+ QDBusConnection::sessionBus().registerObject("/", this);
+ QDBusConnection::sessionBus().registerService("com.ford.sdl.hmi");
+
+ dbusController_ = new DBusController();
+ requestToSDL_ = new RequestToSDL();
+
+ HmiProxy::api_adaptors_.SetDBusController(dbusController_);
+}
+
+void DbusPlugin::initializeEngine(Engine *engine, const char *uri) {
+ engine->rootContext()->setContextProperty("DBus", dbusController_);
+ engine->rootContext()->setContextProperty("RequestToSDL", requestToSDL_);
+}
+
+#if QT_4
+Q_EXPORT_PLUGIN2(DbusAdapter, DbusPlugin)
+#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
new file mode 100644
index 0000000000..4d145d09b4
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
@@ -0,0 +1,70 @@
+/**
+ * \file dbus_plugin.h
+ * \brief DbusPlugin class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
+
+#include "qt_version.h"
+
+#if QT_4
+# include <QtDeclarative/QDeclarativeExtensionPlugin>
+typedef QDeclarativeExtensionPlugin ExtensionPlugin;
+typedef QDeclarativeEngine Engine;
+#elif QT_5
+# include <QtQml/QQmlExtensionPlugin>
+typedef QQmlExtensionPlugin ExtensionPlugin;
+typedef QQmlEngine Engine;
+#endif // QT_VERSION
+#include <QtDBus/QDBusContext>
+
+class DBusController;
+class RequestToSDL;
+
+class DbusPlugin : public ExtensionPlugin, public QDBusContext {
+ Q_OBJECT
+
+#if QT_5
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+#endif // QT_5
+
+ DBusController *dbusController_;
+ RequestToSDL *requestToSDL_;
+
+ public:
+ void registerTypes(const char *uri);
+ void initializeEngine(Engine *engine, const char *uri);
+};
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
+
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
new file mode 100644
index 0000000000..bd9e6efea9
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
@@ -0,0 +1,46 @@
+/**
+ * \file hmiproxy.cpp
+ * \brief HmiProxy class source file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi_proxy.h"
+#include <QtDBus/QDBusConnection>
+
+ApiAdaptors HmiProxy::api_adaptors_;
+
+HmiProxy::HmiProxy(Item *parent)
+ : Item(parent) {}
+
+void HmiProxy::componentComplete() {
+ Item::componentComplete();
+ api_adaptors_.SetApi(this);
+}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
new file mode 100644
index 0000000000..7fa0e49bf8
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
@@ -0,0 +1,64 @@
+/**
+ * \file hmiproxy.h
+ * \brief HmiProxy class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
+
+#include "qt_version.h"
+#include "qml_dbus.h"
+
+#if QT_4
+# include <QtDeclarative/QDeclarativeItem>
+typedef QDeclarativeItem Item;
+#elif QT_5
+# include <QtQuick/QQuickItem>
+typedef QQuickItem Item;
+#endif // QT_VERSION
+
+class HmiProxy : public Item {
+ Q_OBJECT
+ Q_DISABLE_COPY(HmiProxy)
+
+ public:
+ explicit HmiProxy(Item *parent = 0);
+ static ApiAdaptors api_adaptors_;
+
+ protected:
+ virtual void componentComplete();
+};
+
+QML_DECLARE_TYPE(HmiProxy)
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
+
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
new file mode 100644
index 0000000000..6f2b54fc57
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
+
+#include <QMetaType>
+
+template<typename T>
+QMetaType::Type metatype();
+
+template<>
+inline QMetaType::Type metatype<int>() {
+ return QMetaType::Int;
+}
+
+template<>
+inline QMetaType::Type metatype<QString>() {
+ return QMetaType::QString;
+}
+
+template<>
+inline QMetaType::Type metatype<bool>() {
+ return QMetaType::Bool;
+}
+
+template<>
+inline QMetaType::Type metatype<double>() {
+ return QMetaType::Double;
+}
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
new file mode 100644
index 0000000000..79dfdd1838
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
@@ -0,0 +1,94 @@
+/**
+ * \file optional_argument.h
+ * \brief OptionalArgument struct header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
+
+#include "qt_version.h"
+#include <QtDBus/QDBusArgument>
+
+template<class T>
+struct OptionalArgument {
+ T val;
+ bool presence;
+ explicit OptionalArgument(const T& value)
+ : val(value),
+ presence(true) {}
+ OptionalArgument()
+ : presence(false) {}
+};
+
+template<class T>
+inline
+QDBusArgument& operator << (QDBusArgument& arg, const OptionalArgument<T>& o) {
+ arg.beginStructure();
+ arg << o.presence << o.val;
+ arg.endStructure();
+ return arg;
+}
+
+template<class T>
+inline
+const QDBusArgument& operator >> (const QDBusArgument& arg, OptionalArgument<T>& o) {
+ arg.beginStructure();
+ arg >> o.presence >> o.val;
+ arg.endStructure();
+ return arg;
+}
+
+template<class T>
+inline
+bool VariantToValue(const QVariant& variant, OptionalArgument<T>& o) {
+ if (variant.isNull()) {
+ o.presence = false;
+ return true;
+ }
+ o.presence = true;
+ return VariantToValue(variant, o.val);
+}
+
+#if QT_4
+Q_DECLARE_METATYPE(QList<int>)
+#endif // QT_4
+
+Q_DECLARE_METATYPE(OptionalArgument<int>)
+Q_DECLARE_METATYPE(OptionalArgument<QString>)
+Q_DECLARE_METATYPE(OptionalArgument<bool>)
+Q_DECLARE_METATYPE(OptionalArgument<double>)
+
+Q_DECLARE_METATYPE(OptionalArgument<QList<int> >)
+Q_DECLARE_METATYPE(OptionalArgument<QStringList>)
+Q_DECLARE_METATYPE(OptionalArgument<QList<bool> >)
+Q_DECLARE_METATYPE(OptionalArgument<QList<double> >)
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
new file mode 100644
index 0000000000..6148da71f5
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
@@ -0,0 +1,236 @@
+/**
+ * \file qml_dbus_common.h
+ * \brief Contain utilities for DBus plugin.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
+
+#include <QtDBus/QDBusContext>
+#include "optional_argument.h"
+#include "stream_qvariant.h"
+#include "metatype.h"
+
+enum ErrorCode {
+ Success = 0,
+ UnsupportedRequest,
+ UnsupportedResource,
+ Disallowed,
+ Rejected,
+ Aborted,
+ Ignored,
+ Retry,
+ InUse,
+ DataNotAvailable,
+ TimedOut,
+ InvalidData,
+ CharLimitExceeded,
+ InvalidId,
+ DuplicateName,
+ ApplicationNotRegistered,
+ WrongLanguage,
+ OutOfMemory,
+ TooManyPendingRequests,
+ NoAppsRegistered,
+ NoDevicesConnected,
+ Warnings,
+ GenericError,
+ UserDisallowed
+};
+
+inline void RaiseDbusError(QObject* adaptor, int code, const QString& message) {
+ QDBusContext* context = dynamic_cast<QDBusContext*>(adaptor->parent());
+ if (context) {
+ context->sendErrorReply(QString::number(static_cast<int>(code)),
+ message);
+ }
+}
+
+inline void RaiseDbusError(QObject* adaptor, int code) {
+ RaiseDbusError(adaptor, code, "");
+}
+
+template<typename T>
+inline void PutArgToMap(QVariantMap& map, const char* name, const T& v) {
+ map.insert(name, QVariant::fromValue(v));
+}
+
+inline bool GetArgFromMap(const QVariantMap& map, const char* name, int& v) {
+ QVariantMap::const_iterator it = map.find(name);
+ if (map.end() == it) return false;
+ if (it->type() != QVariant::Int) return false;
+ v = it->toInt();
+ return true;
+}
+
+inline bool GetArgFromMap(const QVariantMap& map, const char* name, QString& v) {
+ QVariantMap::const_iterator it = map.find(name);
+ if (map.end() == it) return false;
+ if (it->type() != QVariant::String) return false;
+ v = it->toString();
+ return true;
+}
+
+inline bool GetArgFromMap(const QVariantMap& map, const char* name, bool& v) {
+ QVariantMap::const_iterator it = map.find(name);
+ if (map.end() == it) return false;
+ if (it->type() != QVariant::Bool) return false;
+ v = it->toBool();
+ return true;
+}
+
+inline bool isNumber(QVariant v) {
+ QVariant::Type t = v.type();
+ return (t == QVariant::Double) || (t == QVariant::Int) ||
+ (t == QVariant::UInt) || (t == QVariant::LongLong) ||
+ (t == QVariant::ULongLong);
+}
+
+inline bool GetArgFromMap(const QVariantMap& map, const char* name, double& v) {
+ QVariantMap::const_iterator it = map.find(name);
+ if (map.end() == it) return false;
+ if (!isNumber(*it)) return false;
+ v = it->toDouble();
+ return true;
+}
+
+inline bool VariantToValue(const QVariant& variant, int& v) {
+ if (variant.type() != QVariant::Int) return false;
+ v = variant.toInt();
+ return true;
+}
+
+inline bool VariantToValue(const QVariant& variant, QString& v) {
+ if (variant.type() != QVariant::String) return false;
+ v = variant.toString();
+ return true;
+}
+
+inline bool VariantToValue(const QVariant& variant, bool& v) {
+ if (variant.type() != QVariant::Bool) return false;
+ v = variant.toBool();
+ return true;
+}
+
+inline bool VariantToValue(const QVariant& variant, double& v) {
+ if (variant.type() != QVariant::Double) return false;
+ v = variant.toDouble();
+ return true;
+}
+
+inline bool VariantToValue(const QVariant& variant, QStringList& v) {
+ if (variant.type() != QVariant::List) return false;
+ QList<QVariant> list = variant.toList();
+ for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
+ if (i->type() != QVariant::String) return false;
+ v.append(i->toString());
+ }
+ return true;
+}
+
+template<typename T>
+bool VariantToValue(const QVariant& variant, QList<T>& v) {
+ if (variant.type() != QVariant::List) return false;
+ QList<T> spare;
+ QList<QVariant> list = variant.toList();
+ for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
+ QVariant::Type type = i->type();
+// Although this function is declared as returning QVariant::Type(obsolete),
+// the return value should be interpreted as QMetaType::Type.
+// (http://qt-project.org/doc/qt-5.0/qtcore/qvariant.html#type)
+ QMetaType::Type type_casted = static_cast<QMetaType::Type>(type);
+ if (type_casted != metatype<T>()) {
+ return false;
+ }
+ spare.append(i->value<T>());
+ }
+ v.swap(spare);
+ return true;
+}
+
+template<typename T>
+inline QVariant ValueToVariant(const T& v) {
+ return QVariant::fromValue(v);
+}
+
+template<typename T>
+inline QVariant ValueToVariant(const QList<T>& v) {
+ QList<QVariant> list;
+ for (typename QList<T>::const_iterator i = v.begin(); i != v.end(); ++i)
+ list.append(ValueToVariant(*i));
+ return QVariant::fromValue(list);
+}
+
+template<typename T>
+inline void PutArgToMap(QVariantMap& map, const char* name, const QList<T>& v) {
+ QList<QVariant> list;
+ for (typename QList<T>::const_iterator i = v.begin(); i != v.end(); ++i)
+ list.append(ValueToVariant(*i));
+ map.insert(name, QVariant::fromValue(list));
+}
+
+template<typename T>
+inline bool GetArgFromMap(const QVariantMap& map, const char* name, QList<T>& v) {
+ QVariantMap::const_iterator it = map.find(name);
+ if (map.end() == it) return false;
+ const QVariant& variant = *it;
+ if (variant.type() != QVariant::List) return false;
+ QList<QVariant> list = variant.toList();
+ for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
+ T t;
+ bool ok = VariantToValue(*i, t);
+ if (!ok) return false;
+ v.append(t);
+ }
+ return true;
+}
+
+template<typename T>
+inline void PutArgToMap(QVariantMap& map, const char* name,
+ const OptionalArgument<T>& v) {
+ if (v.presence)
+ map.insert(name, ValueToVariant(v.val));
+}
+
+template<typename T>
+inline bool GetArgFromMap(const QVariantMap& map, const char* name,
+ OptionalArgument<T>& v) {
+ QVariantMap::const_iterator it = map.find(name);
+ if (map.end() == it || !it->isValid()) {
+ v.presence = false;
+ return true;
+ }
+ v.presence = true;
+ return GetArgFromMap(map, name, v.val);
+}
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir b/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir
new file mode 100644
index 0000000000..5f426d357d
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir
@@ -0,0 +1,3 @@
+module com.ford.sdl.hmi.dbus_adapter
+plugin DbusAdapter
+
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
new file mode 100644
index 0000000000..cbad38ed5e
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
@@ -0,0 +1,47 @@
+/**
+ * @file qt_version.h
+ * @brief Defines for check Qt version.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
+
+#include <qglobal.h>
+
+#define QT_4 ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
+
+#define QT_5 ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
+
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
new file mode 100644
index 0000000000..a1ae3402c4
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "stream_qvariant.h"
+
+std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
+ const QVariant& value) {
+ switch (value.type()) {
+ case QVariant::Map: {
+ os << "{ ";
+ QVariantMap structure = value.toMap();
+ QMapIterator<QString, QVariant> i(structure);
+ while (i.hasNext()) {
+ i.next();
+ os << i.key() << ":" << i.value();
+ if (i.hasNext()) {
+ os << ", ";
+ }
+ }
+ os << " }";
+ } break;
+ case QVariant::List: {
+ os << "[ ";
+ QVariantList array = value.toList();
+ QListIterator<QVariant> i(array);
+ while (i.hasNext()) {
+ os << i.next();
+ if (i.hasNext()) {
+ os << ", ";
+ }
+ }
+ os << " ]";
+ } break;
+ default:
+ os << value.toString().toLatin1().data();
+ }
+
+ return os;
+}
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
new file mode 100644
index 0000000000..675b6d069e
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
+
+#include <QtCore/QVariant>
+#include <sstream>
+
+std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
+ const QVariant& value);
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt
new file mode 100644
index 0000000000..56a64b48b3
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt
@@ -0,0 +1,85 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(target HWButtons)
+set(destination com/ford/sdl/hmi/hw_buttons)
+set(install_destination bin/hmi/plugins/${destination})
+set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+set(CMAKE_AUTOMOC ON)
+set(SOURCES
+ attributed_mouse_event.cc
+ hmi_hwbuttons.cc
+ masked_container.cc
+)
+
+add_library(${target} SHARED ${SOURCES})
+
+if (${qt_version} MATCHES "4.8.5")
+ qt4_use_modules(${target} Core Gui Declarative)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
+elseif (${qt_version} MATCHES "5.1.0")
+ qt5_use_modules(${target} Core Qml Quick)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
+endif ()
+
+add_custom_target(copy_library_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
+ ${copy_destination}
+ DEPENDS ${target}
+ COMMENT "Copying library ${library_name}")
+file(COPY qmldir DESTINATION ${copy_destination})
+
+install(TARGETS ${target}
+ DESTINATION ${install_destination}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+install(FILES qmldir DESTINATION ${install_destination})
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_custom_target(qmltypes_${target} ALL
+ COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.hw_buttons 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
+ DEPENDS copy_library_${target}
+ )
+ add_custom_target(copy_qmltypes_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
+ ${copy_destination}
+ DEPENDS qmltypes_${target}
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
+endif ()
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
new file mode 100644
index 0000000000..42e2e4f370
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
@@ -0,0 +1,39 @@
+/**
+ * \file attributed_mouse_event.cpp
+ * \brief AttributedMouseEvent class source file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "attributed_mouse_event.h"
+
+Item *AttributedMouseEvent::item() const {
+ return item_;
+}
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
new file mode 100644
index 0000000000..b058e28f28
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
@@ -0,0 +1,64 @@
+/**
+ * \file attributed_mouse_event.h
+ * \brief AttributedMouseEvent class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
+
+#include "qt_version.h"
+
+#include <QtCore/QObject>
+#if QT_4
+# include <QtDeclarative/QDeclarativeItem>
+typedef QDeclarativeItem Item;
+#elif QT_5
+# include <QtQuick/QQuickItem>
+typedef QQuickItem Item;
+#endif // QT_VERSION
+
+class AttributedMouseEvent : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(Item* item READ item)
+
+ public:
+ explicit AttributedMouseEvent(Item *item) : item_(item) {}
+
+ Item *item() const;
+
+ private:
+ Item *item_;
+ Q_DISABLE_COPY(AttributedMouseEvent)
+};
+
+QML_DECLARE_TYPE(AttributedMouseEvent)
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
new file mode 100644
index 0000000000..9f4f3b611c
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
@@ -0,0 +1,58 @@
+/**
+ * \file hmi_hwbuttons.cpp
+ * \brief HmiHWButtons class source file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "hmi_hwbuttons.h"
+
+#if QT_4
+# include <QtDeclarative/qdeclarative.h>
+# include <QtGui/QGraphicsColorizeEffect>
+#elif QT_5
+# include <QtQml>
+#endif // QT_VERSION
+
+#include "masked_container.h"
+#include "attributed_mouse_event.h"
+
+void HmiHWButtons::registerTypes(const char *uri) {
+ // @uri com.ford.hmi_framework
+ qmlRegisterType<MaskedContainer>(uri, 1, 0, "MaskedContainer");
+ qmlRegisterType<AttributedMouseEvent>();
+#if QT_4
+ qmlRegisterType<QGraphicsColorizeEffect>(uri, 1, 0, "Colorize");
+#endif // QT_4
+}
+
+#if QT_4
+Q_EXPORT_PLUGIN2(HWButtons, HmiHWButtons)
+#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
new file mode 100644
index 0000000000..ee5fa53021
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
@@ -0,0 +1,59 @@
+/**
+ * \file hmi_hwbuttons.h
+ * \brief HmiHWButtons class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
+
+#include "qt_version.h"
+
+#if QT_4
+# include <QtDeclarative/QDeclarativeExtensionPlugin>
+typedef QDeclarativeExtensionPlugin ExtensionPlugin;
+#elif QT_5
+# include <QtQml/QQmlExtensionPlugin>
+typedef QQmlExtensionPlugin ExtensionPlugin;
+#endif // QT_VERSION
+
+class HmiHWButtons : public ExtensionPlugin {
+ Q_OBJECT
+#if QT_5
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+#endif // QT_5
+
+ public:
+ void registerTypes(const char *uri);
+};
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
+
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
new file mode 100644
index 0000000000..aee3afbbdf
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
@@ -0,0 +1,155 @@
+/**
+ * \file masked_container.cpp
+ * \brief MaskedContainer class source file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "masked_container.h"
+
+#if QT_4
+# include <QtCore/QPointF>
+# include <QtGui/QGraphicsSceneMouseEvent>
+# define IMAGE "QDeclarativeImage"
+#elif QT_5
+# include <QtGui/QImage>
+# include <QtCore/QEvent>
+# define IMAGE "QQuickImage"
+#endif // QT_VERSION
+
+MaskedContainer::MaskedContainer(Item *parent)
+ : Item(parent),
+ mask_(NULL) {
+ setAcceptedMouseButtons(Qt::LeftButton);
+}
+
+void MaskedContainer::componentComplete() {
+ Item::componentComplete();
+
+ for (QObjectList::ConstIterator it = children().begin();
+ it != children().end(); ++it) {
+ Item *item = qobject_cast<Item*>(*it);
+ if (item && item->inherits(IMAGE) && item->isVisible()) {
+ images_.push_back(item);
+ }
+ }
+
+ int height = this->height();
+ int width =this->width();
+
+ for (size_t i = 0; i < images_.size(); ++i) {
+ Item *item = images_[i];
+ int itemWidth = item->width();
+ int itemHeight = item->height();
+ int itemX = item->x();
+ int itemY = item->y();
+ if (height < itemHeight + itemY)
+ height = itemHeight + itemY;
+ if (width < itemWidth + itemX)
+ width = itemWidth + itemX;
+ }
+
+ setHeight(height);
+ setWidth(width);
+
+ mask_ = new int[height * width];
+ std::fill(mask_, mask_ + height * width, -1);
+
+ for (size_t i = 0; i < images_.size(); ++i) {
+ Item *item = images_[i];
+ int itemWidth = item->width();
+ int itemHeight = item->height();
+ int itemX = item->x();
+ int itemY = item->y();
+
+ QUrl url = item->property("source").toUrl();
+ QImage img(url.path());
+ const QRgb* bits = reinterpret_cast<const QRgb*>(img.constBits());
+ for (int x = 0; x < itemWidth; ++x) {
+ for (int y = 0; y < itemHeight; ++y) {
+ if (qAlpha(bits[y * itemWidth + x]) > 128) {
+ mask_[(itemY + y) * width + (x + itemX)] = i;
+ }
+ }
+ }
+ }
+}
+
+void MaskedContainer::mousePressEvent(MouseEvent *mouse) {
+#if QT_4
+ qreal x = mouse->pos().x();
+ qreal y = mouse->pos().y();
+#elif QT_5
+ int x = mouse->x();
+ int y = mouse->y();
+#endif // QT_VERSION
+
+ if (width() * y + x > width() * height()) {
+ mouse->ignore();
+ } else {
+ int idx = mask_[indexOfMask(x, y)];
+ if (idx >= 0) {
+ AttributedMouseEvent ev(images_[idx]);
+ emit pressed(&ev);
+ grabMouse();
+ mouse->accept();
+ } else {
+ mouse->ignore();
+ }
+ }
+}
+
+void MaskedContainer::mouseReleaseEvent(MouseEvent *mouse) {
+#if QT_4
+ qreal x = mouse->pos().x();
+ qreal y = mouse->pos().y();
+#elif QT_5
+ int x = mouse->x();
+ int y = mouse->y();
+#endif // QT_VERSION
+
+ if (width() * y + x > width() * height()) {
+ return;
+ } else {
+ int idx = mask_[indexOfMask(x, y)];
+ if (idx >= 0) {
+ AttributedMouseEvent ev(images_[idx]);
+ emit released(&ev);
+ } else {
+ emit released(NULL);
+ }
+ }
+ ungrabMouse();
+}
+
+MaskedContainer::~MaskedContainer() {
+ delete[] mask_;
+}
+
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
new file mode 100644
index 0000000000..30e145aa35
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
@@ -0,0 +1,89 @@
+/**
+ * \file masked_container.h
+ * \brief MaskedContainer class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
+
+#include <vector>
+#include <QtCore/QString>
+
+#include "qt_version.h"
+
+#if QT_4
+# include <QtDeclarative/QDeclarativeItem>
+typedef QDeclarativeItem Item;
+typedef QGraphicsSceneMouseEvent MouseEvent;
+#elif QT_5
+# include <QtQuick/QQuickItem>
+typedef QQuickItem Item;
+typedef QMouseEvent MouseEvent;
+#endif
+
+#include "attributed_mouse_event.h"
+
+class MaskedContainer : public Item {
+ Q_OBJECT
+ Q_DISABLE_COPY(MaskedContainer)
+
+ public:
+ explicit MaskedContainer(Item *parent = 0);
+ ~MaskedContainer();
+
+ signals:
+ void pressed(AttributedMouseEvent *attr);
+ void released(AttributedMouseEvent *attr);
+
+ protected:
+ virtual void componentComplete();
+ virtual void mousePressEvent(MouseEvent *event);
+ virtual void mouseReleaseEvent(MouseEvent *event);
+
+ private:
+ std::vector<Item*> images_;
+ int *mask_;
+
+#if QT_4
+ int indexOfMask(qreal x, qreal y) const {
+ return static_cast<int>(y * width() + x);
+ }
+#elif QT_5
+ int indexOfMask(int x, int y) const {
+ return y * static_cast<int>(width()) + x;
+ }
+#endif // QT_VERSION
+};
+
+QML_DECLARE_TYPE(MaskedContainer)
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir b/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir
new file mode 100644
index 0000000000..a4bae8144b
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir
@@ -0,0 +1,3 @@
+module com.ford.sdl.hmi.hw_buttons
+plugin HWButtons
+
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h b/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
new file mode 100644
index 0000000000..6a277e3867
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
@@ -0,0 +1,47 @@
+/**
+ * @file qt_version.h
+ * @brief Defines for check Qt version.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
+
+#include <qglobal.h>
+
+#define QT_4 ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
+
+#define QT_5 ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
+
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt
new file mode 100644
index 0000000000..1a5baadaa9
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt
@@ -0,0 +1,86 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(target QmlLog4cxx)
+set(destination com/ford/sdl/hmi/log4cxx)
+set(install_destination bin/hmi/plugins/${destination})
+set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+include_directories(
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set(CMAKE_AUTOMOC ON)
+set(SOURCES log4cxx_plugin.cc)
+
+add_library(${target} SHARED ${SOURCES})
+
+if (${qt_version} MATCHES "4.8.5")
+ qt4_use_modules(${target} Core Declarative)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
+elseif (${qt_version} MATCHES "5.1.0")
+ qt5_use_modules(${target} Core Qml)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
+endif ()
+
+target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+
+add_custom_target(copy_library_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
+ ${copy_destination}
+ DEPENDS ${target}
+ COMMENT "Copying library ${library_name}")
+file(COPY qmldir DESTINATION ${copy_destination})
+
+install(TARGETS ${target}
+ DESTINATION ${install_destination}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+install(FILES qmldir DESTINATION ${install_destination})
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_custom_target(qmltypes_${target} ALL
+ COMMAND LD_LIBRARY_PATH=${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.log4cxx 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
+ DEPENDS copy_library_${target}
+ )
+ add_custom_target(copy_qmltypes_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
+ ${copy_destination}
+ DEPENDS qmltypes_${target}
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
+endif ()
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
new file mode 100644
index 0000000000..19eec36651
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
@@ -0,0 +1,108 @@
+/**
+ * @file log4cxx_plugin.cpp
+ * @brief Log4cxxPlugin class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "log4cxx_plugin.h"
+
+#include <log4cxx/log4cxx.h>
+#include <log4cxx/propertyconfigurator.h>
+
+log4cxx::LoggerPtr logger_ = log4cxx::LoggerPtr(
+ log4cxx::Logger::getLogger("Log4cxxPlugin"));
+
+#if QT_4
+void smartLogger(QtMsgType type, const char *msg) {
+ log4cxx::spi::LocationInfo location("", "", -1);
+
+ switch (type) {
+ case QtDebugMsg:
+ (*logger_).debug(msg, location);
+ break;
+ case QtWarningMsg:
+ (*logger_).warn(msg, location);
+ break;
+ case QtCriticalMsg:
+ (*logger_).error(msg, location);
+ break;
+ case QtFatalMsg:
+ (*logger_).fatal(msg, location);
+ break;
+ default:
+ (*logger_).info(msg, location);
+ break;
+ }
+}
+#elif QT_5
+void smartLogger(QtMsgType type, const QMessageLogContext &context,
+ const QString &msg) {
+ log4cxx::spi::LocationInfo location(context.file,
+ context.function ? context.function : "",
+ context.line);
+ switch (type) {
+ case QtDebugMsg:
+ (*logger_).debug(msg.toStdString(), location);
+ break;
+ case QtWarningMsg:
+ (*logger_).warn(msg.toStdString(), location);
+ break;
+ case QtCriticalMsg:
+ (*logger_).error(msg.toStdString(), location);
+ break;
+ case QtFatalMsg:
+ (*logger_).fatal(msg.toStdString(), location);
+ break;
+ default:
+ (*logger_).info(msg.toStdString(), location);
+ break;
+ }
+}
+#endif // QT_VERSION
+
+void Log4cxxPlugin::registerTypes(const char *uri) {
+ log4cxx::PropertyConfigurator::configure("log4cxx.properties");
+
+#if QT_4
+ qInstallMsgHandler(smartLogger);
+#elif QT_5
+ qInstallMessageHandler(smartLogger);
+#endif // QT_VERSION
+
+ // @uri com.ford.sdl.hmi.log4cxx
+ qmlRegisterType<Logger>(uri, 1, 0, "Logger");
+ // Use standart console API Javascript
+ // See Debugging QML Applications in Qt documentation
+}
+
+#if QT_4
+Q_EXPORT_PLUGIN2(QmlLog4cxx, Log4cxxPlugin)
+#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
new file mode 100644
index 0000000000..00e136cf76
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
@@ -0,0 +1,77 @@
+/**
+ * @file log4cxx_plugin.h
+ * @brief Log4cxxPlugin class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
+
+#include <qglobal.h>
+
+#define QT_4 ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
+
+#define QT_5 ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
+
+#if QT_4
+# include <QtDeclarative/qdeclarative.h>
+# include <QtDeclarative/QDeclarativeExtensionPlugin>
+typedef QDeclarativeExtensionPlugin ExtensionPlugin;
+#elif QT_5
+# include <QtQml/qqml.h>
+# include <QtQml/QQmlExtensionPlugin>
+typedef QQmlExtensionPlugin ExtensionPlugin;
+#endif // QT_VERSION
+
+class Logger : public QObject {
+ Q_OBJECT
+ Q_DISABLE_COPY(Logger)
+
+ public:
+ explicit Logger(QObject *parent = 0) : QObject(parent) {}
+};
+
+class Log4cxxPlugin : public ExtensionPlugin {
+ Q_OBJECT
+#if QT_5
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+#endif // QT_5
+
+ public:
+ void registerTypes(const char *uri);
+};
+
+QML_DECLARE_TYPE(Logger)
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
+
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/qmldir b/src/components/qt_hmi/qml_plugins/log4cxx/qmldir
new file mode 100644
index 0000000000..ddd7bc99a5
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/log4cxx/qmldir
@@ -0,0 +1,3 @@
+module com.ford.sdl.hmi.log4cxx
+plugin QmlLog4cxx
+
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt
new file mode 100644
index 0000000000..e777e95263
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt
@@ -0,0 +1,84 @@
+# Copyright (c) 2013, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.11)
+
+set(target NamedPipeNotifier)
+set(destination com/ford/sdl/hmi/named_pipe_notifier)
+set(install_destination bin/hmi/plugins/${destination})
+set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+set(CMAKE_AUTOMOC ON)
+set(SOURCES
+ named_pipe_notifier.cc
+ named_pipe_notifier_plugin.cc
+)
+
+add_library(${target} SHARED ${SOURCES})
+
+if (${qt_version} MATCHES "4.8.5")
+ qt4_use_modules(${target} Core Declarative)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
+elseif (${qt_version} MATCHES "5.1.0")
+ qt5_use_modules(${target} Core Qml)
+ set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
+ set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
+endif ()
+
+add_custom_target(copy_library_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
+ ${copy_destination}
+ DEPENDS ${target}
+ COMMENT "Copying library ${library_name}")
+file(COPY qmldir DESTINATION ${copy_destination})
+
+install(TARGETS ${target}
+ DESTINATION ${install_destination}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+install(FILES qmldir DESTINATION ${install_destination})
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_custom_target(qmltypes_${target} ALL
+ COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.named_pipe_notifier 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
+ DEPENDS copy_library_${target}
+ )
+ add_custom_target(copy_qmltypes_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
+ ${copy_destination}
+ DEPENDS qmltypes_${target}
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
+endif ()
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
new file mode 100644
index 0000000000..e231124fe8
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
@@ -0,0 +1,59 @@
+/**
+ * @file named_pipe_notifier.cc
+ * @brief NamedPipeNotifier class implementation file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <fcntl.h>
+#include <sys/select.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#include "named_pipe_notifier.h"
+
+void NamedPipeNotifier::run() {
+ int fd = ::open(name_.toLocal8Bit().constData(), O_RDONLY);
+ if (-1 == fd) { // if open() fails
+ if ((errno != ENOENT) // we can only manage lack of pipe
+ || (-1 == ::mkfifo(name_.toLocal8Bit().constData(), 0666))
+ || (-1 == (fd = ::open(name_.toLocal8Bit().constData(), O_RDONLY)))) {
+ emit openFailed();
+ return;
+ }
+ }
+ ::fd_set readfds;
+ FD_ZERO(&readfds);
+ FD_SET(fd, &readfds);
+// this select() is supposed to block till pipe is empty
+ if (::select(fd + 1, &readfds, 0, 0, 0) > 0) {
+ emit readyRead();
+ }
+}
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
new file mode 100644
index 0000000000..14bacd9b6f
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
@@ -0,0 +1,65 @@
+/**
+ * \file named_pipe_notifier.h
+ * \brief NamedPipeNotifier class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
+
+#include <QThread>
+
+class NamedPipeNotifier : public QThread {
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE set_name NOTIFY nameChanged)
+ QString name_;
+
+ public:
+ explicit NamedPipeNotifier(QObject* parent = 0) : QThread(parent) {}
+
+ const QString& name() const { return name_; }
+ void set_name(const QString& name) {
+ if (name_ != name) {
+ name_ = name;
+ emit nameChanged();
+ }
+ }
+
+ protected:
+ virtual void run();
+
+ signals:
+ void nameChanged();
+ void readyRead();
+ void openFailed();
+};
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
new file mode 100644
index 0000000000..a423434c17
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
@@ -0,0 +1,52 @@
+/**
+ * \file named_pipe_notifier_plugin.cc
+ * \brief NamedPipeNotifierPlugin class implementation file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "named_pipe_notifier_plugin.h"
+
+#if QT_4
+# include <QtDeclarative/qdeclarative.h>
+#elif QT_5
+# include <QtQml/qqml.h>
+#endif // QT_VERSION
+
+#include "named_pipe_notifier.h"
+
+void NamedPipeNotifierPlugin::registerTypes(const char* uri) {
+ // @uri com.ford.sdl.hmi.named_pipe_notifier
+ qmlRegisterType<NamedPipeNotifier>(uri, 1, 0, "NamedPipeNotifier");
+}
+
+#if QT_4
+Q_EXPORT_PLUGIN2(NamedPipeNotifier, NamedPipeNotifierPlugin)
+#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
new file mode 100644
index 0000000000..36513aa931
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
@@ -0,0 +1,59 @@
+/**
+ * \file named_pipe_notifier_plugin.h
+ * \brief NamedPipeNotifierPlugin class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
+
+#include "qt_version.h"
+
+#if QT_4
+# include <QtDeclarative/QDeclarativeExtensionPlugin>
+typedef QDeclarativeExtensionPlugin ExtensionPlugin;
+#elif QT_5
+# include <QtQml/QQmlExtensionPlugin>
+typedef QQmlExtensionPlugin ExtensionPlugin;
+#endif // QT_5
+
+class NamedPipeNotifierPlugin : public ExtensionPlugin {
+ Q_OBJECT
+
+#if QT_5
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
+#endif // QT_5
+
+ public:
+ void registerTypes(const char* uri);
+};
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir
new file mode 100644
index 0000000000..86ede716ee
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir
@@ -0,0 +1,2 @@
+module com.ford.sdl.hmi.named_pipe_notifier
+plugin NamedPipeNotifier
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
new file mode 100644
index 0000000000..42b4bcb9d6
--- /dev/null
+++ b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
@@ -0,0 +1,47 @@
+/**
+ * @file qt_version.h
+ * @brief Defines for check Qt version.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
+#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
+
+#include <qglobal.h>
+
+#define QT_4 ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
+
+#define QT_5 ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
+ (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
+
+#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
+
diff --git a/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST b/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST
new file mode 100644
index 0000000000..ab0a27b552
--- /dev/null
+++ b/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST
@@ -0,0 +1,2 @@
+4Ezay^ק<yi'*';(*'-N)z:nx:Rǂi^^笴ǭO9$ySgږ爞ZDžYhږǜzۭקoj[nruZL
+w>^7k͆
diff --git a/src/components/qt_hmi/res/SPT.png b/src/components/qt_hmi/res/SPT.png
new file mode 100644
index 0000000000..efe0b43dc2
--- /dev/null
+++ b/src/components/qt_hmi/res/SPT.png
Binary files differ
diff --git a/src/components/qt_hmi/res/album_art.png b/src/components/qt_hmi/res/album_art.png
new file mode 100644
index 0000000000..9000680276
--- /dev/null
+++ b/src/components/qt_hmi/res/album_art.png
Binary files differ
diff --git a/src/components/qt_hmi/res/app_911_assist.png b/src/components/qt_hmi/res/app_911_assist.png
new file mode 100644
index 0000000000..dc7d3c6630
--- /dev/null
+++ b/src/components/qt_hmi/res/app_911_assist.png
Binary files differ
diff --git a/src/components/qt_hmi/res/app_vehicle_info.png b/src/components/qt_hmi/res/app_vehicle_info.png
new file mode 100644
index 0000000000..1542c787db
--- /dev/null
+++ b/src/components/qt_hmi/res/app_vehicle_info.png
Binary files differ
diff --git a/src/components/qt_hmi/res/apps.png b/src/components/qt_hmi/res/apps.png
new file mode 100644
index 0000000000..48d8284b2a
--- /dev/null
+++ b/src/components/qt_hmi/res/apps.png
Binary files differ
diff --git a/src/components/qt_hmi/res/arrow.png b/src/components/qt_hmi/res/arrow.png
new file mode 100644
index 0000000000..4c215b2bf7
--- /dev/null
+++ b/src/components/qt_hmi/res/arrow.png
Binary files differ
diff --git a/src/components/qt_hmi/res/blue_ball.png b/src/components/qt_hmi/res/blue_ball.png
new file mode 100644
index 0000000000..d4db3f96ae
--- /dev/null
+++ b/src/components/qt_hmi/res/blue_ball.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/long_oval_btn.png b/src/components/qt_hmi/res/buttons/long_oval_btn.png
new file mode 100644
index 0000000000..375195bec3
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/long_oval_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png b/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png
new file mode 100644
index 0000000000..bd4ba813d5
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/longest_oval_btn.png b/src/components/qt_hmi/res/buttons/longest_oval_btn.png
new file mode 100644
index 0000000000..6ed0293aab
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/longest_oval_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png b/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png
new file mode 100644
index 0000000000..73ee397da6
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_bottom.png b/src/components/qt_hmi/res/buttons/oval_btn_bottom.png
new file mode 100644
index 0000000000..4964b4787a
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/oval_btn_bottom.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_left.png b/src/components/qt_hmi/res/buttons/oval_btn_left.png
new file mode 100644
index 0000000000..4818162a19
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/oval_btn_left.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png b/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png
new file mode 100644
index 0000000000..29c47e189f
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png b/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png
new file mode 100644
index 0000000000..c7d7d53ab6
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_right.png b/src/components/qt_hmi/res/buttons/oval_btn_right.png
new file mode 100644
index 0000000000..d566ac8ca5
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/oval_btn_right.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_top.png b/src/components/qt_hmi/res/buttons/oval_btn_top.png
new file mode 100644
index 0000000000..787e0990e2
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/oval_btn_top.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_next_btn.png b/src/components/qt_hmi/res/buttons/player_next_btn.png
new file mode 100644
index 0000000000..c432068d4a
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_next_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png
new file mode 100644
index 0000000000..aab3df8914
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_pause_btn.png b/src/components/qt_hmi/res/buttons/player_pause_btn.png
new file mode 100644
index 0000000000..a9443feb8b
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_pause_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png
new file mode 100644
index 0000000000..9c409c8f17
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_play_btn.png b/src/components/qt_hmi/res/buttons/player_play_btn.png
new file mode 100644
index 0000000000..f185e94461
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_play_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png
new file mode 100644
index 0000000000..ecbb4f2ef0
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_prev_btn.png b/src/components/qt_hmi/res/buttons/player_prev_btn.png
new file mode 100644
index 0000000000..acc2a71de3
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_prev_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png
new file mode 100644
index 0000000000..c6eefc09c9
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/preset_btn.png b/src/components/qt_hmi/res/buttons/preset_btn.png
new file mode 100644
index 0000000000..58c296a4e4
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/preset_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/preset_pressed_btn.png b/src/components/qt_hmi/res/buttons/preset_pressed_btn.png
new file mode 100644
index 0000000000..fd7606fbd6
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/preset_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/round_btn.png b/src/components/qt_hmi/res/buttons/round_btn.png
new file mode 100644
index 0000000000..3add8dd21c
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/round_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/round_pressed_btn.png b/src/components/qt_hmi/res/buttons/round_pressed_btn.png
new file mode 100644
index 0000000000..b0f8863423
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/round_pressed_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/short_oval_btn.png b/src/components/qt_hmi/res/buttons/short_oval_btn.png
new file mode 100644
index 0000000000..99f5e90c3d
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/short_oval_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png b/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png
new file mode 100644
index 0000000000..6b8bc61d80
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/zoom.png b/src/components/qt_hmi/res/buttons/zoom.png
new file mode 100644
index 0000000000..0df4d25109
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/zoom.png
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/zoom_pressed.png b/src/components/qt_hmi/res/buttons/zoom_pressed.png
new file mode 100644
index 0000000000..c67d2c7c55
--- /dev/null
+++ b/src/components/qt_hmi/res/buttons/zoom_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/car.png b/src/components/qt_hmi/res/car.png
new file mode 100644
index 0000000000..18a21656d0
--- /dev/null
+++ b/src/components/qt_hmi/res/car.png
Binary files differ
diff --git a/src/components/qt_hmi/res/change_devices.png b/src/components/qt_hmi/res/change_devices.png
new file mode 100644
index 0000000000..24a43a0d32
--- /dev/null
+++ b/src/components/qt_hmi/res/change_devices.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/AC_off.png b/src/components/qt_hmi/res/climate/AC_off.png
new file mode 100644
index 0000000000..8554ddfb4c
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/AC_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/AC_on.png b/src/components/qt_hmi/res/climate/AC_on.png
new file mode 100644
index 0000000000..c549010d6b
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/AC_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/climate_round_off_btn.png b/src/components/qt_hmi/res/climate/climate_round_off_btn.png
new file mode 100644
index 0000000000..411f003938
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/climate_round_off_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/climate_round_on_btn.png b/src/components/qt_hmi/res/climate/climate_round_on_btn.png
new file mode 100644
index 0000000000..691f6e3bf8
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/climate_round_on_btn.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/defrost_off.png b/src/components/qt_hmi/res/climate/defrost_off.png
new file mode 100644
index 0000000000..22e384dbc0
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/defrost_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/defrost_on.png b/src/components/qt_hmi/res/climate/defrost_on.png
new file mode 100644
index 0000000000..9b0fc7aa43
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/defrost_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/face_off.png b/src/components/qt_hmi/res/climate/face_off.png
new file mode 100644
index 0000000000..72448d6aaf
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/face_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/face_on.png b/src/components/qt_hmi/res/climate/face_on.png
new file mode 100644
index 0000000000..4ed6089800
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/face_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/feet_off.png b/src/components/qt_hmi/res/climate/feet_off.png
new file mode 100644
index 0000000000..bac7bc9cfb
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/feet_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/feet_on.png b/src/components/qt_hmi/res/climate/feet_on.png
new file mode 100644
index 0000000000..6d7a3b7a14
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/feet_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/headed_dash_off.png b/src/components/qt_hmi/res/climate/headed_dash_off.png
new file mode 100644
index 0000000000..cf5168b559
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/headed_dash_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/headed_dash_on.png b/src/components/qt_hmi/res/climate/headed_dash_on.png
new file mode 100644
index 0000000000..c46b690f7f
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/headed_dash_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_seat_off.png b/src/components/qt_hmi/res/climate/heated_seat_off.png
new file mode 100644
index 0000000000..11a32048c9
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/heated_seat_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_seat_on.png b/src/components/qt_hmi/res/climate/heated_seat_on.png
new file mode 100644
index 0000000000..8211eb79e5
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/heated_seat_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_wheel_off.png b/src/components/qt_hmi/res/climate/heated_wheel_off.png
new file mode 100644
index 0000000000..5956f5a3dc
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/heated_wheel_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_wheel_on.png b/src/components/qt_hmi/res/climate/heated_wheel_on.png
new file mode 100644
index 0000000000..af3c2598da
--- /dev/null
+++ b/src/components/qt_hmi/res/climate/heated_wheel_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/DownButton.png b/src/components/qt_hmi/res/controlButtons/DownButton.png
new file mode 100644
index 0000000000..fd44c5438c
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/DownButton.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png b/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png
new file mode 100644
index 0000000000..013672bbf9
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/LeftButton.png b/src/components/qt_hmi/res/controlButtons/LeftButton.png
new file mode 100644
index 0000000000..e65dd5ce04
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/LeftButton.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png b/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png
new file mode 100644
index 0000000000..8df2e136ef
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/OkButton.png b/src/components/qt_hmi/res/controlButtons/OkButton.png
new file mode 100644
index 0000000000..9e82fe298b
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/OkButton.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png b/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png
new file mode 100644
index 0000000000..478d9ef7e5
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/RightButton.png b/src/components/qt_hmi/res/controlButtons/RightButton.png
new file mode 100644
index 0000000000..24e0f50a88
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/RightButton.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png b/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png
new file mode 100644
index 0000000000..9e70d8d729
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/UpButton.png b/src/components/qt_hmi/res/controlButtons/UpButton.png
new file mode 100644
index 0000000000..3547a7fc70
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/UpButton.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png b/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png
new file mode 100644
index 0000000000..2cbcfbe679
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png b/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png
new file mode 100644
index 0000000000..041d49e7e9
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrButton.png b/src/components/qt_hmi/res/controlButtons/vrButton.png
new file mode 100644
index 0000000000..af09282dff
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/vrButton.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png b/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png
new file mode 100644
index 0000000000..9206e42a95
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrImage.png b/src/components/qt_hmi/res/controlButtons/vrImage.png
new file mode 100644
index 0000000000..2f6bac2d9f
--- /dev/null
+++ b/src/components/qt_hmi/res/controlButtons/vrImage.png
Binary files differ
diff --git a/src/components/qt_hmi/res/find_apps.png b/src/components/qt_hmi/res/find_apps.png
new file mode 100644
index 0000000000..55a9a28676
--- /dev/null
+++ b/src/components/qt_hmi/res/find_apps.png
Binary files differ
diff --git a/src/components/qt_hmi/res/gear.png b/src/components/qt_hmi/res/gear.png
new file mode 100644
index 0000000000..b1eeba091c
--- /dev/null
+++ b/src/components/qt_hmi/res/gear.png
Binary files differ
diff --git a/src/components/qt_hmi/res/hd_logo_off.png b/src/components/qt_hmi/res/hd_logo_off.png
new file mode 100644
index 0000000000..80c9d58b46
--- /dev/null
+++ b/src/components/qt_hmi/res/hd_logo_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/hd_logo_on.png b/src/components/qt_hmi/res/hd_logo_on.png
new file mode 100644
index 0000000000..dfc3d4ccf1
--- /dev/null
+++ b/src/components/qt_hmi/res/hd_logo_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/initial.wav b/src/components/qt_hmi/res/initial.wav
new file mode 100644
index 0000000000..61a549fbc6
--- /dev/null
+++ b/src/components/qt_hmi/res/initial.wav
Binary files differ
diff --git a/src/components/qt_hmi/res/install_apps.png b/src/components/qt_hmi/res/install_apps.png
new file mode 100644
index 0000000000..dc33c0965c
--- /dev/null
+++ b/src/components/qt_hmi/res/install_apps.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/compass.png b/src/components/qt_hmi/res/nav/compass.png
new file mode 100644
index 0000000000..15c73ee878
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/compass.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/current_street.png b/src/components/qt_hmi/res/nav/current_street.png
new file mode 100644
index 0000000000..e289c054ff
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/current_street.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/delete_icon.png b/src/components/qt_hmi/res/nav/delete_icon.png
new file mode 100644
index 0000000000..826b5faacf
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/delete_icon.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/delete_icon_black.png b/src/components/qt_hmi/res/nav/delete_icon_black.png
new file mode 100644
index 0000000000..56e35c759b
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/delete_icon_black.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/dest_icon.png b/src/components/qt_hmi/res/nav/dest_icon.png
new file mode 100644
index 0000000000..dadcfe25cf
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/dest_icon.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/dest_icon_black.png b/src/components/qt_hmi/res/nav/dest_icon_black.png
new file mode 100644
index 0000000000..75c99bc4aa
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/dest_icon_black.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/map.png b/src/components/qt_hmi/res/nav/map.png
new file mode 100644
index 0000000000..328bca44cf
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/map.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/mute_off.png b/src/components/qt_hmi/res/nav/mute_off.png
new file mode 100644
index 0000000000..f7306d96ae
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/mute_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/mute_on.png b/src/components/qt_hmi/res/nav/mute_on.png
new file mode 100644
index 0000000000..de2a2bb5bc
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/mute_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options.png b/src/components/qt_hmi/res/nav/options.png
new file mode 100644
index 0000000000..46887f1061
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/options.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options_in_active.png b/src/components/qt_hmi/res/nav/options_in_active.png
new file mode 100644
index 0000000000..601b242bbe
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/options_in_active.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options_pressed.png b/src/components/qt_hmi/res/nav/options_pressed.png
new file mode 100644
index 0000000000..42c352a7e8
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/options_pressed.png
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/turnArrow.png b/src/components/qt_hmi/res/nav/turnArrow.png
new file mode 100644
index 0000000000..f37731f5af
--- /dev/null
+++ b/src/components/qt_hmi/res/nav/turnArrow.png
Binary files differ
diff --git a/src/components/qt_hmi/res/notes.png b/src/components/qt_hmi/res/notes.png
new file mode 100644
index 0000000000..8b4a92fffc
--- /dev/null
+++ b/src/components/qt_hmi/res/notes.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/contacts.png b/src/components/qt_hmi/res/phone/contacts.png
new file mode 100644
index 0000000000..a16d518ba8
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/contacts.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/dnd_off.png b/src/components/qt_hmi/res/phone/dnd_off.png
new file mode 100644
index 0000000000..04bb2476c1
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/dnd_off.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/dnd_on.png b/src/components/qt_hmi/res/phone/dnd_on.png
new file mode 100644
index 0000000000..56b9fe7065
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/dnd_on.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/keypad.png b/src/components/qt_hmi/res/phone/keypad.png
new file mode 100644
index 0000000000..1792c8fac8
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/keypad.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/messages.png b/src/components/qt_hmi/res/phone/messages.png
new file mode 100644
index 0000000000..b5cbb8e8af
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/messages.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/more.png b/src/components/qt_hmi/res/phone/more.png
new file mode 100644
index 0000000000..908ebf654e
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/more.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/phone.png b/src/components/qt_hmi/res/phone/phone.png
new file mode 100644
index 0000000000..346f36cc33
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/phone.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/recent.png b/src/components/qt_hmi/res/phone/recent.png
new file mode 100644
index 0000000000..db54c2f16e
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/recent.png
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/texts.png b/src/components/qt_hmi/res/phone/texts.png
new file mode 100644
index 0000000000..31c024b1df
--- /dev/null
+++ b/src/components/qt_hmi/res/phone/texts.png
Binary files differ
diff --git a/src/components/qt_hmi/res/snow.png b/src/components/qt_hmi/res/snow.png
new file mode 100644
index 0000000000..54756bb2f6
--- /dev/null
+++ b/src/components/qt_hmi/res/snow.png
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/cal.png b/src/components/qt_hmi/res/vehicle/cal.png
new file mode 100644
index 0000000000..94d5d44b5a
--- /dev/null
+++ b/src/components/qt_hmi/res/vehicle/cal.png
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/folders.png b/src/components/qt_hmi/res/vehicle/folders.png
new file mode 100644
index 0000000000..c5985043df
--- /dev/null
+++ b/src/components/qt_hmi/res/vehicle/folders.png
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/key_car.png b/src/components/qt_hmi/res/vehicle/key_car.png
new file mode 100644
index 0000000000..a8e5d9d66c
--- /dev/null
+++ b/src/components/qt_hmi/res/vehicle/key_car.png
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/sun.png b/src/components/qt_hmi/res/vehicle/sun.png
new file mode 100644
index 0000000000..6424d9d210
--- /dev/null
+++ b/src/components/qt_hmi/res/vehicle/sun.png
Binary files differ
diff --git a/src/components/qt_hmi/res/warning.png b/src/components/qt_hmi/res/warning.png
new file mode 100644
index 0000000000..c91cd31d34
--- /dev/null
+++ b/src/components/qt_hmi/res/warning.png
Binary files differ
diff --git a/src/components/qt_hmi/res/white_ball.png b/src/components/qt_hmi/res/white_ball.png
new file mode 100644
index 0000000000..952714ebe6
--- /dev/null
+++ b/src/components/qt_hmi/res/white_ball.png
Binary files differ
diff --git a/src/components/resumption/CMakeLists.txt b/src/components/resumption/CMakeLists.txt
new file mode 100644
index 0000000000..607912337c
--- /dev/null
+++ b/src/components/resumption/CMakeLists.txt
@@ -0,0 +1,13 @@
+include_directories (
+ ./include
+ ../utils/include/
+ ../config_profile/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ ./src/last_state.cc
+)
+
+add_library("Resumption" ${SOURCES})
diff --git a/src/components/resumption/include/resumption/last_state.h b/src/components/resumption/include/resumption/last_state.h
new file mode 100644
index 0000000000..5183f1a1da
--- /dev/null
+++ b/src/components/resumption/include/resumption/last_state.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_RESUMPTION_INCLUDE_RESUMPTION_LAST_STATE_H_
+#define SRC_COMPONENTS_RESUMPTION_INCLUDE_RESUMPTION_LAST_STATE_H_
+
+#include <string>
+
+#include "utils/macro.h"
+#include "utils/singleton.h"
+#include "json/json.h"
+
+namespace resumption {
+
+class LastState : public utils::Singleton<LastState> {
+ public:
+ /**
+ * @brief Saving dictionary to filesystem
+ */
+ void SaveToFileSystem();
+
+ /**
+ * @brief public dictionary
+ */
+ Json::Value dictionary;
+
+ private:
+
+ /**
+ * @brief Load dictionary from filesystem
+ */
+ void LoadFromFileSystem();
+
+ /**
+ * @brief Private default constructor
+ */
+ LastState();
+
+ /**
+ * @brief Private destructor
+ */
+ ~LastState();
+
+ DISALLOW_COPY_AND_ASSIGN(LastState);
+
+ FRIEND_BASE_SINGLETON_CLASS(LastState);
+};
+
+} // namespace resumption
+
+#endif // SRC_COMPONENTS_RESUMPTION_INCLUDE_RESUMPTION_LAST_STATE_H_
diff --git a/src/components/resumption/src/last_state.cc b/src/components/resumption/src/last_state.cc
new file mode 100644
index 0000000000..15100c3e13
--- /dev/null
+++ b/src/components/resumption/src/last_state.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "resumption/last_state.h"
+#include "config_profile/profile.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+
+namespace resumption {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "LastState");
+
+void LastState::SaveToFileSystem() {
+ LOG4CXX_INFO(logger_, "LastState::SaveToFileSystem");
+ const std::string file =
+ profile::Profile::instance()->app_info_storage();
+ const std::string& str = dictionary.toStyledString();
+ const std::vector<uint8_t> char_vector_pdata(
+ str.begin(), str.end());
+
+ DCHECK(file_system::CreateDirectoryRecursively(
+ profile::Profile::instance()->app_storage_folder()));
+
+ LOG4CXX_INFO(logger_, "LastState::SaveToFileSystem " << file);
+ DCHECK(file_system::Write(file, char_vector_pdata));
+}
+
+void LastState::LoadFromFileSystem() {
+ const std::string file =
+ profile::Profile::instance()->app_info_storage();
+ std::string buffer;
+ bool result = file_system::ReadFile(file, buffer);
+ Json::Reader m_reader;
+ if (result && m_reader.parse(buffer, dictionary)) {
+ LOG4CXX_INFO(logger_, "Valid last state was found.");
+ return;
+ }
+ LOG4CXX_WARN(logger_, "No valid last state was found.");
+}
+
+LastState::LastState() {
+ LoadFromFileSystem();
+}
+
+LastState::~LastState() {
+ SaveToFileSystem();
+}
+
+}
diff --git a/src/components/rpc_base/CMakeLists.txt b/src/components/rpc_base/CMakeLists.txt
new file mode 100644
index 0000000000..2a14274145
--- /dev/null
+++ b/src/components/rpc_base/CMakeLists.txt
@@ -0,0 +1,21 @@
+include_directories(
+ include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ src/rpc_base/rpc_base.cc
+)
+
+set (HEADERS
+ include/rpc_base/gtest_support.h
+ include/rpc_base/rpc_base_dbus_inl.h
+ include/rpc_base/rpc_base.h
+ include/rpc_base/rpc_base_inl.h
+ include/rpc_base/rpc_base_json_inl.h
+ include/rpc_base/rpc_message.h
+ include/rpc_base/validation_report.h
+)
+
+add_library(rpc_base ${HEADERS} ${SOURCES})
+target_link_libraries(rpc_base jsoncpp)
diff --git a/src/components/rpc_base/include/rpc_base/gtest_support.h b/src/components/rpc_base/include/rpc_base/gtest_support.h
new file mode 100644
index 0000000000..68d1a83141
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/gtest_support.h
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RPC_BASE_GTEST_SUPPORT_H_
+#define RPC_BASE_GTEST_SUPPORT_H_
+
+#include <gtest/gtest.h>
+
+#include "rpc_base/validation_report.h"
+
+// A predicate-formatter for asserting that intergen generated
+// object is valid
+template<typename T>
+::testing::AssertionResult AssertRpcObjValid(const char* obj_expr,
+ const T& obj) {
+ if (obj.is_valid())
+ return ::testing::AssertionSuccess();
+
+ rpc::ValidationReport report(obj_expr);
+ obj.ReportErrors(&report);
+
+ return ::testing::AssertionFailure()
+ << obj_expr << " failed validation. Violations are:\n"
+ << rpc::PrettyFormat(report);
+}
+
+#define ASSERT_RPCTYPE_VALID(object) \
+ ASSERT_PRED_FORMAT1(AssertRpcObjValid, object)
+
+#define EXPECT_RPCTYPE_VALID(object) \
+ EXPECT_PRED_FORMAT1(AssertRpcObjValid, object)
+
+#endif /* RPC_BASE_GTEST_SUPPORT_H_ */
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h
new file mode 100644
index 0000000000..56b099d9e9
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -0,0 +1,415 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VALIDATED_TYPES_H_
+#define VALIDATED_TYPES_H_
+
+#include <stdint.h>
+#include <map>
+#include <string>
+#include <vector>
+
+namespace Json {
+class Value;
+} // namespace Json
+
+namespace dbus {
+class MessageReader;
+class MessageWriter;
+} // namespace dbus
+
+namespace rpc {
+class ValidationReport;
+
+namespace policy_table_interface_base {
+
+ enum PolicyTableType {
+ INVALID_PT_TYPE = -1,
+ PT_PRELOADED,
+ PT_UPDATE,
+ PT_SNAPSHOT
+ };
+ const std::string ommited_validation_info = "should be ommited in ";
+ const std::string required_validation_info = "is required in ";
+
+ std::string PolicyTableTypeToString(const PolicyTableType pt_type);
+
+
+}
+
+template<typename T> class Range;
+class PrimitiveType;
+class CompositeType;
+class Boolean;
+template<typename T, T minval, T maxval> class Integer;
+template<int64_t minnum, int64_t maxnum,
+ int64_t minden = 1, int64_t maxden = 1> class Float;
+template<size_t minlen, size_t maxlen> class String;
+template<typename T> class Enum;
+template<typename T, size_t minsize, size_t maxsize> class Array;
+template<typename T, size_t minsize, size_t maxsize> class Map;
+template<typename T> class Nullable;
+template<typename T> class Optional;
+template<typename T> class Stringifyable;
+
+template<typename T>
+class Range {
+ public:
+ // Methods
+ Range(const T min, const T max);
+ T min() const;
+ T max() const;
+ template<typename U>
+ bool Includes(U val) const;
+ private:
+ T min_;
+ T max_;
+};
+
+/*
+ * Base class for all primitive types, keeps a flag to
+ * tell whether descendant object was initialized
+ */
+class PrimitiveType {
+ public:
+ bool is_initialized() const;
+ bool is_valid() const;
+ void ReportErrors(ValidationReport* report) const;
+ policy_table_interface_base::PolicyTableType GetPolicyTableType() const;
+ virtual void SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type);
+
+ protected:
+ enum ValueState {
+ kUninitialized,
+ kInvalid,
+ kValid
+ };
+ explicit PrimitiveType(ValueState value_state);
+ static ValueState InitHelper(bool is_next);
+ static ValueState InitHelper(const Json::Value* value,
+ bool (Json::Value::*type_check)() const);
+
+ protected:
+ ValueState value_state_;
+ policy_table_interface_base::PolicyTableType policy_table_type_;
+};
+
+/*
+ * Base class for all composite types (arrays and all user-defined types)
+ */
+class CompositeType {
+ public:
+ void mark_initialized();
+ void ReportErrors(ValidationReport* report) const;
+ policy_table_interface_base::PolicyTableType GetPolicyTableType() const;
+ virtual void SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type);
+
+ protected:
+ enum InitializationState {
+ kUninitialized,
+ kInitialized,
+ kInvalidInitialized
+ };
+ explicit CompositeType(InitializationState init_state);
+ virtual ~CompositeType(){}
+ static InitializationState InitHelper(bool is_next);
+ static InitializationState InitHelper(const Json::Value* value,
+ bool (Json::Value::*type_check)() const);
+ protected:
+ mutable InitializationState initialization_state__;
+ policy_table_interface_base::PolicyTableType policy_table_type_;
+
+};
+
+/*
+ * Class that holds primitive boolean value. It is always valid.
+ */
+class Boolean : public PrimitiveType {
+ public:
+ // Types
+ typedef bool ValueType;
+ public:
+ // Methods
+ Boolean();
+ explicit Boolean(bool value);
+ explicit Boolean(const Json::Value* value);
+ explicit Boolean(dbus::MessageReader* reader);
+ Boolean(const Json::Value* value, bool def_value);
+ Boolean& operator=(bool new_val);
+ operator bool() const;
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ private:
+ // Fields
+ ValueType value_;
+};
+
+template<typename T, T minval, T maxval>
+class Integer : public PrimitiveType {
+ public:
+ // Types
+ typedef T IntType;
+ public:
+ // Methods
+ Integer();
+ explicit Integer(IntType value);
+ explicit Integer(const Json::Value* value);
+ explicit Integer(dbus::MessageReader* reader);
+ Integer(const Json::Value* value, IntType def_value);
+ Integer& operator=(IntType new_val);
+ Integer& operator++();
+ Integer& operator+=(int value);
+ operator IntType() const;
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ private:
+ IntType value_;
+ static const Range<T> range_;
+};
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+class Float : public PrimitiveType {
+ public:
+ // Methods
+ Float();
+ explicit Float(double value);
+ explicit Float(const Json::Value* value);
+ explicit Float(dbus::MessageReader* reader);
+ Float(const Json::Value* value, double def_value);
+ Float& operator=(double new_val);
+ operator double() const;
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ private:
+ double value_;
+ static const Range<double> range_;
+};
+
+template<size_t minlen, size_t maxlen>
+class String : public PrimitiveType {
+ public:
+ // Methods
+ String();
+ explicit String(const std::string& value);
+ explicit String(const char* value);
+ explicit String(const Json::Value* value);
+ explicit String(dbus::MessageReader* reader);
+ String(const Json::Value* value, const std::string& def_value);
+ bool operator<(String new_val);
+ String& operator=(const std::string& new_val);
+ operator const std::string& () const;
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ private:
+ std::string value_;
+ static const Range<size_t> length_range_;
+};
+
+template<typename T>
+class Enum : public PrimitiveType {
+ public:
+ // Types
+ typedef T EnumType;
+ public:
+ // Methods
+ Enum();
+ explicit Enum(EnumType value);
+ explicit Enum(const Json::Value* value);
+ explicit Enum(dbus::MessageReader* reader);
+ Enum(const Json::Value* value, EnumType def_value);
+ Enum& operator=(EnumType new_val);
+ operator EnumType() const;
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ private:
+ // Fields
+ EnumType value_;
+};
+
+template<typename T, size_t minsize, size_t maxsize>
+class Array : public std::vector<T>, public CompositeType {
+ public:
+ // Types
+ typedef std::vector<T> ArrayType;
+ public:
+ // Methods
+ Array();
+ // Need const and non-const versions to beat all-type accepting constructor
+ explicit Array(Json::Value* value);
+ explicit Array(const Json::Value* value);
+ explicit Array(dbus::MessageReader* reader);
+ template<typename U>
+ explicit Array(const U& value);
+ template<typename U>
+ Array& operator=(const U& that);
+ using ArrayType::push_back;
+ template<typename U>
+ void push_back(const U& value);
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ bool is_valid() const;
+ bool is_initialized() const;
+ void ReportErrors(ValidationReport* report) const;
+ virtual void SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type);
+};
+
+template<typename T, size_t minsize, size_t maxsize>
+class Map : public std::map<std::string, T>, public CompositeType {
+ public:
+ // Types
+ typedef Map<T, minsize, maxsize> Frankenbase;
+ typedef std::map<std::string, T> MapType;
+ public:
+ // Methods
+ Map();
+ // Need const and non-const versions to beat all-type accepting constructor
+ explicit Map(Json::Value* value);
+ explicit Map(const Json::Value* value);
+ explicit Map(dbus::MessageReader* reader);
+ template<typename U>
+ explicit Map(const U& value);
+ template<typename U>
+ Map& operator=(const U& that);
+ using MapType::insert;
+ template<typename U>
+ void insert(const std::pair<std::string, U>& value);
+ Json::Value ToJsonValue() const;
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ bool is_valid() const;
+ bool is_initialized() const;
+ void ReportErrors(ValidationReport* report) const;
+ virtual void SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type);
+};
+
+template<typename T>
+class Nullable : public T {
+ public:
+ // Methods
+ Nullable();
+ explicit Nullable(dbus::MessageReader* reader);
+ // Need const and non-const versions to beat all-type accepting constructor
+ explicit Nullable(Json::Value* value);
+ explicit Nullable(const Json::Value* value);
+ template<typename U>
+ explicit Nullable(const U& value);
+ template<typename U>
+ Nullable(const Json::Value* value, const U& def_value);
+ template<typename U>
+ Nullable& operator=(const U& new_val);
+ Json::Value ToJsonValue() const;
+
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool is_null() const;
+ void set_to_null();
+ void ReportErrors(ValidationReport* report) const;
+ private:
+ bool marked_null_;
+};
+
+template<typename T>
+class Stringifyable : public T {
+ public:
+ // Methods
+ Stringifyable();
+ explicit Stringifyable(dbus::MessageReader* reader);
+ // Need const and non-const versions to beat all-type accepting constructor
+ explicit Stringifyable(Json::Value* value);
+ explicit Stringifyable(const Json::Value* value);
+ template<typename U>
+ explicit Stringifyable(const U& value);
+ template<typename U>
+ Stringifyable(const Json::Value* value, const U& def_value);
+ template<typename U>
+ Stringifyable& operator=(const U& new_val);
+ Json::Value ToJsonValue() const;
+
+ bool is_valid() const;
+ bool is_initialized() const;
+ bool is_string() const;
+ std::string get_string() const;
+ void set_to_string(const std::string& input);
+ void ReportErrors(ValidationReport* report) const;
+ private:
+ std::string predefined_string_;
+};
+
+template<typename T>
+class Optional {
+ public:
+ // Methods
+ Optional();
+ explicit Optional(dbus::MessageReader* reader);
+ template<typename U>
+ explicit Optional(const U& value);
+ template<typename U>
+ Optional(const Json::Value* value, const U& def_value);
+ Json::Value ToJsonValue() const;
+
+ void ToDbusWriter(dbus::MessageWriter* writer) const;
+
+ // Pointer semantics
+ T& operator*();
+ const T& operator*() const;
+ T* operator->();
+ const T* operator->() const;
+ // For pointer-like 'if (optional_value)' tests
+ // Better than operator bool because bool can be implicitly
+ // casted to integral types
+ operator const void* () const;
+
+ bool is_valid() const;
+ bool is_initialized() const;
+ void ReportErrors(ValidationReport* report) const;
+ policy_table_interface_base::PolicyTableType GetPolicyTableType() const;
+ virtual void SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type);
+
+ protected:
+ policy_table_interface_base::PolicyTableType policy_table_type_;
+ private:
+ T value_;
+};
+
+} // namespace rpc
+
+// Template methods implementation
+#include "rpc_base_inl.h"
+#include "rpc_base_json_inl.h"
+
+#endif /* VALIDATED_TYPES_H_ */
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
new file mode 100644
index 0000000000..7d66950fc9
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h
@@ -0,0 +1,449 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RPC_BASE_DBUS_INL_H_
+#define RPC_BASE_DBUS_INL_H_
+
+#include "dbus/dbus_message.h"
+#include "json/value.h"
+#include "rpc_base/rpc_base.h"
+
+namespace rpc {
+
+// static
+inline PrimitiveType::ValueState PrimitiveType::InitHelper(bool is_next) {
+ return is_next ? kValid : kInvalid;
+}
+
+// static
+inline CompositeType::InitializationState CompositeType::InitHelper(bool is_next) {
+ return is_next ? kInitialized : kUninitialized;
+}
+
+namespace impl {
+
+
+// Helper functions to statically map int types to appropriate
+// MessageReader functions
+
+// Non-specialized versions doesn't have implementation
+
+// Tells if next element of reader is of type T
+template<typename T> inline bool NextIs(const dbus::MessageReader& reader);
+// Takes next element of type T from reader
+template<typename T> inline T Take(dbus::MessageReader* reader);
+
+template<> inline bool NextIs<int8_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsByte();
+}
+
+template<> inline int8_t Take<int8_t>(dbus::MessageReader* reader) {
+ return static_cast<int8_t>(reader->TakeByte());
+}
+
+inline void Put(int8_t val, dbus::MessageWriter* writer) {
+ writer->PutByte(static_cast<uint8_t>(val));
+}
+
+template<> inline bool NextIs<uint8_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsByte();
+}
+
+template<> inline uint8_t Take<uint8_t>(dbus::MessageReader* reader) {
+ return reader->TakeByte();
+}
+
+inline void Put(uint8_t val, dbus::MessageWriter* writer) {
+ writer->PutByte(val);
+}
+
+template<> inline bool NextIs<int16_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsInt16();
+}
+
+template<> inline int16_t Take<int16_t>(dbus::MessageReader* reader) {
+ return reader->TakeInt16();
+}
+
+inline void Put(int16_t val, dbus::MessageWriter* writer) {
+ writer->PutInt16(val);
+}
+
+template<> inline bool NextIs<uint16_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsUint16();
+}
+
+template<> inline uint16_t Take<uint16_t>(dbus::MessageReader* reader) {
+ return reader->TakeUint16();
+}
+
+inline void Put(uint16_t val, dbus::MessageWriter* writer) {
+ writer->PutUint16(val);
+}
+
+template<> inline bool NextIs<int32_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsInt32();
+}
+
+template<> inline int32_t Take<int32_t>(dbus::MessageReader* reader) {
+ return reader->TakeInt32();
+}
+
+inline void Put(int32_t val, dbus::MessageWriter* writer) {
+ writer->PutInt32(val);
+}
+
+template<> inline bool NextIs<uint32_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsUint32();
+}
+
+template<> inline uint32_t Take<uint32_t>(dbus::MessageReader* reader) {
+ return reader->TakeUint32();
+}
+
+inline void Put(uint32_t val, dbus::MessageWriter* writer) {
+ writer->PutUint32(val);
+}
+
+template<> inline bool NextIs<int64_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsInt64();
+}
+
+template<> inline int64_t Take<int64_t>(dbus::MessageReader* reader) {
+ return reader->TakeInt64();
+}
+
+inline void Put(int64_t val, dbus::MessageWriter* writer) {
+ writer->PutInt64(val);
+}
+
+template<> inline bool NextIs<uint64_t>(const dbus::MessageReader& reader) {
+ return reader.NextIsUint64();
+}
+
+template<> inline uint64_t Take<uint64_t>(dbus::MessageReader* reader) {
+ return reader->TakeUint64();
+}
+
+inline void Put(uint64_t val, dbus::MessageWriter* writer) {
+ writer->PutUint64(val);
+}
+
+template<> inline std::string Take<std::string>(dbus::MessageReader* reader) {
+ return reader->TakeString();
+}
+
+inline void Put(const std::string val, dbus::MessageWriter* writer) {
+ writer->PutString(val);
+}
+
+// Type to DBus type id mappers
+template<typename T> char DbusTypeCode();
+template<> inline char DbusTypeCode<bool>() { return DBUS_TYPE_BOOLEAN; }
+// There is no dbus type for signed byte, map to unsigned
+template<> inline char DbusTypeCode<int8_t>() { return DBUS_TYPE_BYTE; }
+template<> inline char DbusTypeCode<uint8_t>() { return DBUS_TYPE_BYTE; }
+template<> inline char DbusTypeCode<int16_t>() { return DBUS_TYPE_INT16; }
+template<> inline char DbusTypeCode<uint16_t>() { return DBUS_TYPE_UINT16; }
+template<> inline char DbusTypeCode<int32_t>() { return DBUS_TYPE_INT32; }
+template<> inline char DbusTypeCode<uint32_t>() { return DBUS_TYPE_UINT32; }
+template<> inline char DbusTypeCode<int64_t>() { return DBUS_TYPE_INT64; }
+template<> inline char DbusTypeCode<uint64_t>() { return DBUS_TYPE_UINT64; }
+template<> inline char DbusTypeCode<double>() { return DBUS_TYPE_DOUBLE; }
+template<> inline char DbusTypeCode<std::string>() { return DBUS_TYPE_STRING; }
+template<> inline char DbusTypeCode<const std::string>() { return DBUS_TYPE_STRING; }
+
+// Non-specialized template supposes there is static
+// void GetDbusSignature(std::string*) method in T
+template<typename T>
+struct DbusSignatureHelper {
+ static void DbusSignature(std::string* signature) {
+ T::GetDbusSignature(signature);
+ }
+};
+
+template<>
+struct DbusSignatureHelper<Boolean> {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += rpc::impl::DbusTypeCode<bool>();
+ }
+};
+
+template<typename T, T minval, T maxval>
+struct DbusSignatureHelper<Integer<T, minval, maxval> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += rpc::impl::DbusTypeCode<T>();
+ }
+};
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+struct DbusSignatureHelper<Float<minnum, maxnum, minden, maxden> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += rpc::impl::DbusTypeCode<double>();
+ }
+};
+
+template<typename T>
+struct DbusSignatureHelper<Enum<T> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += rpc::impl::DbusTypeCode<int32_t>();
+ }
+};
+
+template<size_t minlen, size_t maxlen>
+struct DbusSignatureHelper<String<minlen, maxlen> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += rpc::impl::DbusTypeCode<std::string>();
+ }
+};
+
+template<typename K, typename V>
+struct DbusSignatureHelper<std::pair<K, V> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += DBUS_DICT_ENTRY_BEGIN_CHAR;
+ (*signature) += rpc::impl::DbusTypeCode<K>();
+ rpc::impl::DbusSignatureHelper<V>::DbusSignature(signature);
+ (*signature) += DBUS_DICT_ENTRY_END_CHAR;
+ }
+};
+
+template<typename T, size_t minsize, size_t maxsize>
+struct DbusSignatureHelper<Array<T, minsize, maxsize> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += DBUS_TYPE_ARRAY;
+ rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
+ }
+};
+
+template<typename T, size_t minsize, size_t maxsize>
+struct DbusSignatureHelper<Map<T, minsize, maxsize> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += DBUS_TYPE_ARRAY;
+ rpc::impl::DbusSignatureHelper<
+ typename Map<T, minsize, maxsize>::value_type>::DbusSignature(signature);
+ }
+};
+
+template<typename T>
+struct DbusSignatureHelper<Optional<T> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += DBUS_STRUCT_BEGIN_CHAR;
+ (*signature) += rpc::impl::DbusTypeCode<bool>();
+ rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
+ (*signature) += DBUS_STRUCT_END_CHAR;
+ }
+};
+
+template<typename T>
+struct DbusSignatureHelper<Nullable<T> > {
+ static void DbusSignature(std::string* signature) {
+ (*signature) += DBUS_STRUCT_BEGIN_CHAR;
+ (*signature) += rpc::impl::DbusTypeCode<bool>();
+ rpc::impl::DbusSignatureHelper<T>::DbusSignature(signature);
+ (*signature) += DBUS_STRUCT_END_CHAR;
+ }
+};
+
+// Helper Optional type initialization functipon
+template<typename T>
+T TakeOptional(dbus::MessageReader* reader) {
+ dbus::MessageReader struct_reader = reader->TakeStructReader();
+ bool available = struct_reader.TakeBool();
+ T value(&struct_reader);
+ return available ? value : T();
+}
+
+// Helper Nullable type initialization functipon
+template<typename T>
+bool TakeNullable(dbus::MessageReader* reader) {
+ dbus::MessageReader struct_reader = reader->TakeStructReader();
+ bool is_null = struct_reader.TakeBool();
+ return is_null;
+}
+
+} // namespace impl
+
+
+// Helper function that outputs dbus signature for type T
+template<typename T>
+void DbusSignature(std::string* signature) {
+ impl::DbusSignatureHelper<T>::DbusSignature(signature);
+}
+
+// Type constructors
+inline Boolean::Boolean(dbus::MessageReader* reader)
+ : PrimitiveType(InitHelper(reader->NextIsBool())),
+ value_(reader->TakeBool()) {
+}
+
+template<typename T, T minval, T maxval>
+inline Integer<T, minval, maxval>::Integer(dbus::MessageReader* reader)
+ : PrimitiveType(InitHelper(impl::NextIs<IntType>(*reader))),
+ value_(impl::Take<IntType>(reader)) {
+ if (is_valid()) {
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
+ }
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+inline Float<minnum, maxnum, minden, maxden>::Float(dbus::MessageReader* reader)
+ : PrimitiveType(InitHelper(reader->NextIsDouble())),
+ value_(reader->TakeDouble()) {
+ if (is_valid()) {
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
+ }
+}
+
+template<size_t minlen, size_t maxlen>
+inline String<minlen, maxlen>::String(dbus::MessageReader* reader)
+ : PrimitiveType(InitHelper(reader->NextIsString())),
+ value_(reader->TakeString()) {
+ if (is_valid()) {
+ value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
+ }
+}
+
+template<typename T>
+inline Enum<T>::Enum(dbus::MessageReader* reader)
+ : PrimitiveType(InitHelper(reader->NextIsInt32())),
+ value_(EnumType(reader->TakeInt32())) {
+ if (is_valid()) {
+ value_state_ = IsValidEnum(value_) ? kValid : kInvalid;
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+inline Array<T, minsize, maxsize>::Array(dbus::MessageReader* reader)
+ : CompositeType(InitHelper(reader->NextIsArray())) {
+ dbus::MessageReader array_reader = reader->TakeArrayReader();
+ if (array_reader.has_failed()) {
+ push_back(T());
+ } else {
+ while(array_reader.HasNext()) {
+ push_back(T(&array_reader));
+ }
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+inline Map<T, minsize, maxsize>::Map(dbus::MessageReader* reader)
+ : CompositeType(InitHelper(reader->NextIsStruct())) {
+ // Map key-value pairs are serialized into array
+ dbus::MessageReader array_reader = reader->TakeArrayReader();
+ if (array_reader.has_failed()) {
+ this->insert(typename MapType::value_type("", T()));
+ } else {
+ while(array_reader.HasNext()) {
+ dbus::MessageReader dictvalue_reader = array_reader.TakeDictEntryReader();
+ typename MapType::key_type key =
+ impl::Take<typename MapType::key_type>(&dictvalue_reader);
+ this->insert(typename MapType::value_type(key, T(&dictvalue_reader)));
+ }
+ }
+}
+
+template<typename T>
+inline Nullable<T>::Nullable(dbus::MessageReader* reader)
+ : T(reader),
+ marked_null_(impl::TakeNullable<T>(reader)){
+}
+
+template<typename T>
+inline Optional<T>::Optional(dbus::MessageReader* reader)
+ : value_(impl::TakeOptional<T>(reader)){
+}
+
+// MessageWriter serializers
+inline void Boolean::ToDbusWriter(dbus::MessageWriter* writer) const {
+ writer->PutBool(value_);
+}
+
+template<typename T, T minval, T maxval>
+inline void Integer<T, minval, maxval>::ToDbusWriter(
+ dbus::MessageWriter* writer) const {
+ impl::Put(value_, writer);
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+inline void Float<minnum, maxnum, minden, maxden>::ToDbusWriter(
+ dbus::MessageWriter* writer) const {
+ writer->PutDouble(value_);
+}
+
+template<size_t minlen, size_t maxlen>
+inline void String<minlen, maxlen>::ToDbusWriter(
+ dbus::MessageWriter* writer) const {
+ writer->PutString(value_);
+}
+
+template<typename T>
+inline void Enum<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
+ writer->PutInt32(static_cast<int32_t>(value_));
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+inline void Array<T, minsize, maxsize>::ToDbusWriter(
+ dbus::MessageWriter* writer) const {
+ std::string array_signature;
+ DbusSignature<typename ArrayType::value_type>(&array_signature);
+ dbus::MessageWriter array_writer(writer, dbus::kArray,
+ array_signature.c_str());
+ for (typename ArrayType::const_iterator i = this->begin(); i != this->end(); ++i) {
+ i->ToDbusWriter(&array_writer);
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+inline void Map<T, minsize, maxsize>::ToDbusWriter(
+ dbus::MessageWriter* writer) const {
+ std::string array_signature;
+ DbusSignature<typename MapType::value_type>(&array_signature);
+ dbus::MessageWriter array_writer(writer, dbus::kArray,
+ array_signature.c_str());
+ for (typename MapType::const_iterator i = this->begin(); i != this->end();
+ ++i) {
+ dbus::MessageWriter dictentry_writer(&array_writer, dbus::kDictEntry, NULL);
+ impl::Put(i->first, &dictentry_writer);
+ i->second.ToDbusWriter(&dictentry_writer);
+ }
+}
+
+template<typename T>
+inline void Optional<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
+ dbus::MessageWriter struct_writer(writer, dbus::kStruct, NULL);
+ struct_writer.PutBool(value_.is_initialized());
+ value_.ToDbusWriter(&struct_writer);
+}
+
+} // namespace rpc
+
+#endif // RPC_BASE_DBUS_INL_H_
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
new file mode 100644
index 0000000000..4373f0ea26
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h
@@ -0,0 +1,681 @@
+/**
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VALIDATED_TYPES_INL_H_
+#define VALIDATED_TYPES_INL_H_
+
+#include "rpc_base.h"
+
+#include <cassert>
+#include <cstdio>
+
+#include "rpc_base/validation_report.h"
+
+namespace rpc {
+
+/*
+ * Range helper class
+ */
+template <typename T>
+Range<T>::Range(T min, T max)
+ : min_(min),
+ max_(max) {
+}
+
+template <typename T>
+T Range<T>::min() const {
+ return min_;
+}
+
+template <typename T>
+T Range<T>::max() const {
+ return max_;
+}
+
+template <typename T>
+template <typename U>
+bool Range<T>::Includes(U val) const {
+ return min() <= val && val <= max();
+}
+
+
+/*
+ * PrimitiveType base class
+ */
+inline PrimitiveType::PrimitiveType(ValueState value_state)
+ : value_state_(value_state),
+ policy_table_type_(policy_table_interface_base::PT_PRELOADED) {
+}
+
+inline bool PrimitiveType::is_initialized() const {
+ return value_state_ != kUninitialized;
+}
+
+inline bool PrimitiveType::is_valid() const {
+ return value_state_ == kValid;
+}
+
+inline void PrimitiveType::ReportErrors(ValidationReport* report) const {
+ switch (value_state_) {
+ case kUninitialized: {
+ report->set_validation_info("value is not initialized");
+ break;
+ }
+ case kInvalid: {
+ report->set_validation_info("value initialized incorrectly");
+ break;
+ }
+ case kValid: {
+ // No error
+ break;
+ }
+ default: {
+ assert(!"Unexpected value state");
+ break;
+ }
+ }
+}
+
+/*
+ * CompositeType base class
+ */
+inline void CompositeType::mark_initialized() {
+ initialization_state__ = kInitialized;
+}
+
+inline CompositeType::CompositeType(InitializationState init_state)
+ : initialization_state__(init_state),
+ policy_table_type_(policy_table_interface_base::PT_PRELOADED) {
+}
+
+inline void CompositeType::ReportErrors(ValidationReport* report) const {
+ switch (initialization_state__) {
+ case kUninitialized: {
+ report->set_validation_info("object is not initialized");
+ break;
+ }
+ case kInvalidInitialized: {
+ report->set_validation_info("object initialized incorrectly");
+ break;
+ }
+ case kInitialized: {
+ // No error
+ break;
+ }
+ default:
+ assert(!"Unexpected initialization state");
+ break;
+ }
+}
+
+/*
+ * Boolean class
+ */
+inline Boolean::Boolean()
+ : PrimitiveType(kUninitialized),
+ value_(false) {
+}
+
+inline Boolean::Boolean(bool value)
+ : PrimitiveType(kValid), value_(value) {
+}
+
+inline Boolean& Boolean::operator=(bool new_val) {
+ value_ = new_val;
+ value_state_ = kValid;
+ return *this;
+}
+
+inline Boolean::operator bool() const {
+ return value_;
+}
+
+/*
+ * Integer class
+ */
+template<typename T, T minval, T maxval>
+const Range<T> Integer<T, minval, maxval>::range_(minval, maxval);
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>::Integer()
+ : PrimitiveType(kUninitialized),
+ value_(range_.min()) {
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>::Integer(IntType value)
+ : PrimitiveType(range_.Includes(value) ? kValid : kInvalid),
+ value_(value) {
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator=(IntType new_val) {
+ value_ = new_val;
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
+ return *this;
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator++() {
+ ++value_;
+ return *this;
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator+=(int value) {
+ value_ += value;
+ return *this;
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>::operator IntType() const {
+ return value_;
+}
+
+/*
+ * Float class
+ */
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+const Range<double> Float<minnum, maxnum, minden, maxden>::range_(
+ (double(minnum)/minden), (double(maxnum)/maxden));
+
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Float<minnum, maxnum, minden, maxden>::Float()
+ : PrimitiveType(kUninitialized),
+ value_(range_.min()) {
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Float<minnum, maxnum, minden, maxden>::Float(double value)
+ : PrimitiveType(range_.Includes(value) ? kValid : kInvalid),
+ value_(value) {
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Float<minnum, maxnum, minden, maxden>&
+Float<minnum, maxnum, minden, maxden>::operator=(double new_val) {
+ value_ = new_val;
+ value_state_ = range_.Includes(new_val) ? kValid : kInvalid;
+ return *this;
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Float<minnum, maxnum, minden, maxden>::operator double() const {
+ return value_;
+}
+
+/*
+ * String class
+ */
+template<size_t minlen, size_t maxlen>
+const Range<size_t> String<minlen, maxlen>::length_range_(minlen, maxlen);
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>::String()
+ : PrimitiveType(kUninitialized) {
+}
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>::String(const std::string& value)
+ : PrimitiveType(length_range_.Includes(value.length()) ? kValid : kInvalid),
+ value_(value) {
+}
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>::String(const char* value)
+ : PrimitiveType(kUninitialized),
+ value_(value) {
+ value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
+}
+
+template<size_t minlen, size_t maxlen>
+bool String<minlen, maxlen>::operator<(String new_val) {
+ return value_ < new_val.value_;
+}
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>& String<minlen, maxlen>::operator=(const std::string& new_val) {
+ value_ = new_val;
+ value_state_ = length_range_.Includes(new_val.length()) ? kValid : kInvalid;
+ return *this;
+}
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>::operator const std::string&() const {
+ return value_;
+}
+
+/*
+ * Enum class
+ */
+template<typename T>
+Enum<T>::Enum()
+ : PrimitiveType(kUninitialized),
+ value_(EnumType()) {
+}
+
+template<typename T>
+Enum<T>::Enum(EnumType value)
+ : PrimitiveType(IsValidEnum(value) ? kValid : kInvalid),
+ value_(value) {
+}
+
+template<typename T>
+Enum<T>& Enum<T>::operator=(EnumType new_val) {
+ value_ = new_val;
+ value_state_ = IsValidEnum(value_) ? kValid : kInvalid;
+ return *this;
+}
+
+template<typename T>
+Enum<T>::operator EnumType() const {
+ return value_;
+}
+
+/*
+ * Array class
+ */
+template<typename T, size_t minsize, size_t maxsize>
+Array<T, minsize, maxsize>::Array()
+ : CompositeType(kUninitialized) {
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+template<typename U>
+Array<T, minsize, maxsize>::Array(const U& value)
+ : ArrayType(value.begin(), value.end()),
+ CompositeType(kUninitialized) {
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+template<typename U>
+Array<T, minsize, maxsize>&
+Array<T, minsize, maxsize>::operator=(const U& that) {
+ this->assign(that.begin(), that.end());
+ return *this;
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+template<typename U>
+void Array<T, minsize, maxsize>::push_back(const U& value) {
+ ArrayType::push_back(T(value));
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+bool Array<T, minsize, maxsize>::is_valid() const {
+ // Empty array might be valid only if marked initialized
+ if (this->empty() && (initialization_state__ != kInitialized)) {
+ return false;
+ }
+ // Array size must be within allowed range
+ if (!Range<size_t>(minsize, maxsize).Includes(this->size())) {
+ return false;
+ }
+ // All array elements must be valid
+ for (typename ArrayType::const_iterator i = this->begin();
+ i != this->end(); ++i) {
+ if (!i->is_valid()) {
+ return false;
+ }
+ }
+ return true;
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+bool Array<T, minsize, maxsize>::is_initialized() const {
+ // Array that is not empty is initialized for sure
+ if (!this->empty()) {
+ return true;
+ }
+ // Empty array is initialized if not marked as unitialized
+ if (initialization_state__ != kUninitialized) {
+ return true;
+ }
+ return false;
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+void Array<T, minsize, maxsize>::ReportErrors(ValidationReport* report) const {
+ if (this->empty()) {
+ CompositeType::ReportErrors(report);
+ } else {
+ if (!Range<size_t>(minsize, maxsize).Includes(this->size())) {
+ report->set_validation_info("array has invalid size");
+ } else {
+ // No error
+ }
+ }
+ for (size_t i = 0; i != this->size(); ++i) {
+ const T& elem = this->operator [](i);
+ if (!elem.is_valid()) {
+ char elem_idx[32] = {};
+ snprintf(elem_idx, 32, "[%zu]", i);
+ ValidationReport& elem_report =
+ report->ReportSubobject(elem_idx);
+ elem.ReportErrors(&elem_report);
+ }
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+void Array<T, minsize, maxsize>::SetPolicyTableType(
+ rpc::policy_table_interface_base::PolicyTableType pt_type) {
+
+ for (typename ArrayType::iterator it = this->begin();
+ it != this->end(); ++it) {
+ it->SetPolicyTableType(pt_type);
+ }
+}
+
+/*
+ * Map class
+ */
+template<typename T, size_t minsize, size_t maxsize>
+Map<T, minsize, maxsize>::Map()
+ : CompositeType(kUninitialized) {
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+template<typename U>
+Map<T, minsize, maxsize>::Map(const U& value)
+ : CompositeType(kUninitialized) {
+ for (typename U::const_iterator i = value.begin(), e = value.end(); i != e;
+ ++i) {
+ // Explicitly convert that value to T because all rpc_types have explicit
+ // constructors
+ insert(typename MapType::value_type(i->first, T(i->second)));
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+template<typename U>
+Map<T, minsize, maxsize>&
+Map<T, minsize, maxsize>::operator=(const U& that) {
+ this->clear();
+ for (typename U::const_iterator i = that.begin(), e = that.end(); i != e;
+ ++i) {
+ // Explicitly convert that value to T because all rpc_types have explicit
+ // constructors
+ insert(typename MapType::value_type(i->first, T(i->second)));
+ }
+ return *this;
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+template<typename U>
+void Map<T, minsize, maxsize>::insert(const std::pair<std::string, U>& value) {
+ MapType::insert(typename MapType::value_type(value.first, T(value.second)));
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+bool Map<T, minsize, maxsize>::is_valid() const {
+ // Empty map might be valid only if marked initialized
+ if (this->empty() && (initialization_state__ != kInitialized)) {
+ return false;
+ }
+ // Maps size must be within allowed range
+ if (!Range<size_t>(minsize, maxsize).Includes(this->size())) {
+ return false;
+ }
+ // All map elements must be valid
+ for (typename Map::const_iterator i = this->begin();
+ i != this->end(); ++i) {
+ if (!i->second.is_valid()) {
+ return false;
+ }
+ }
+ return true;
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+bool Map<T, minsize, maxsize>::is_initialized() const {
+ // Map that is not empty is initialized for sure
+ if (!this->empty()) {
+ return true;
+ }
+ // Empty map might be initialized only if not marked as unitialized
+ if (initialization_state__ != kUninitialized) {
+ return true;
+ }
+ return false;
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+void Map<T, minsize, maxsize>::ReportErrors(ValidationReport* report) const {
+ if (this->empty()) {
+ CompositeType::ReportErrors(report);
+ } else {
+ if (!Range<size_t>(minsize, maxsize).Includes(this->size())) {
+ report->set_validation_info("map has invalid size");
+ } else {
+ // No error
+ }
+ }
+ for (typename Map::const_iterator i = this->begin();
+ i != this->end(); ++i) {
+ if (!i->second.is_valid()) {
+ std::string elem_name = "[\"" + i->first + "\"]";
+ ValidationReport& elem_report = report->ReportSubobject(elem_name);
+ i->second.ReportErrors(&elem_report);
+ }
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+void Map<T, minsize, maxsize>::SetPolicyTableType(
+ rpc::policy_table_interface_base::PolicyTableType pt_type) {
+ for (typename Map::iterator it = this->begin();
+ it != this->end(); ++it) {
+ it->second.SetPolicyTableType(pt_type);
+ }
+}
+
+/*
+ * Nullable class
+ */
+template<typename T>
+Nullable<T>::Nullable()
+ : marked_null_(false) {
+}
+
+template<typename T>
+template<typename U>
+Nullable<T>::Nullable(const U& value)
+ : T(value),
+ marked_null_(false) {
+}
+
+template<typename T>
+template<typename U>
+Nullable<T>& Nullable<T>::operator=(const U& new_val) {
+ this->T::operator=(new_val);
+ return *this;
+}
+
+template<typename T>
+bool Nullable<T>::is_valid() const {
+ return is_null() || T::is_valid();
+}
+
+template<typename T>
+bool Nullable<T>::is_initialized() const {
+ return is_null() || T::is_initialized();
+}
+
+template<typename T>
+bool Nullable<T>::is_null() const {
+ return marked_null_;
+}
+
+template<typename T>
+void Nullable<T>::set_to_null() {
+ marked_null_ = true;
+}
+
+template<typename T>
+void Nullable<T>::ReportErrors(ValidationReport* report) const {
+ if (marked_null_) {
+ // No error
+ } else {
+ T::ReportErrors(report);
+ }
+}
+
+/*
+ * Optional class
+ */
+template<typename T>
+Optional<T>::Optional() {
+}
+
+template<typename T>
+template<typename U>
+Optional<T>::Optional(const U& value)
+ : value_(value) {
+}
+
+template<typename T>
+T& Optional<T>::operator*() {
+ return value_;
+}
+
+template<typename T>
+const T& Optional<T>::operator*() const {
+ return value_;
+}
+
+template<typename T>
+T* Optional<T>::operator->() {
+ return &value_;
+}
+
+template<typename T>
+const T* Optional<T>::operator->() const {
+ return &value_;
+}
+
+template<typename T>
+Optional<T>::operator const void*() const {
+ return is_initialized() ? &value_ : NULL;
+}
+
+template<typename T>
+bool Optional<T>::is_valid() const {
+ return !value_.is_initialized() || value_.is_valid();
+}
+
+template<typename T>
+bool Optional<T>::is_initialized() const {
+ return value_.is_initialized();
+}
+
+template<typename T>
+void Optional<T>::ReportErrors(ValidationReport* report) const {
+ if (!is_initialized()) {
+ // No error
+ } else {
+ value_.ReportErrors(report);
+ }
+}
+template<typename T>
+inline rpc::policy_table_interface_base::PolicyTableType Optional<T>::GetPolicyTableType() const {
+ return policy_table_type_;
+}
+
+template<typename T>
+void rpc::Optional<T>::SetPolicyTableType(rpc::policy_table_interface_base::PolicyTableType pt_type) {
+ policy_table_type_ = pt_type;
+ value_.SetPolicyTableType(pt_type);
+}
+
+/*
+ * Stringifyable class
+ */
+template<typename T>
+Stringifyable<T>::Stringifyable()
+ : predefined_string_("") {
+}
+
+template<typename T>
+template<typename U>
+Stringifyable<T>::Stringifyable(const U& value)
+ : T(value),
+ predefined_string_("") {
+}
+
+template<typename T>
+template<typename U>
+Stringifyable<T>& Stringifyable<T>::operator=(const U& new_val) {
+ this->T::operator=(new_val);
+ return *this;
+}
+
+template<typename T>
+bool Stringifyable<T>::is_valid() const {
+ return is_string() || T::is_valid();
+}
+
+template<typename T>
+bool Stringifyable<T>::is_initialized() const {
+ return is_string() || T::is_initialized();
+}
+
+template<typename T>
+bool Stringifyable<T>::is_string() const {
+ return !predefined_string_.empty();
+}
+
+template<typename T>
+std::string Stringifyable<T>::get_string() const {
+ return predefined_string_;
+}
+
+template<typename T>
+void Stringifyable<T>::set_to_string(const std::string& input) {
+ predefined_string_ = input;
+}
+
+template<typename T>
+void Stringifyable<T>::ReportErrors(ValidationReport* report) const {
+ if (is_string()) {
+ // No error
+ } else {
+ T::ReportErrors(report);
+ }
+}
+
+} // namespace rpc
+
+
+
+#endif /* VALIDATED_TYPES_INL_H_ */
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
new file mode 100644
index 0000000000..f9b8914295
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h
@@ -0,0 +1,387 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VALIDATED_TYPES_JSON_INL_H_
+#define VALIDATED_TYPES_JSON_INL_H_
+
+#include "rpc_base/rpc_base.h"
+#include "json/value.h"
+
+namespace rpc {
+
+// static
+inline PrimitiveType::ValueState PrimitiveType::InitHelper(
+ const Json::Value* value,
+ bool (Json::Value::*type_check)() const) {
+ if (!value) {
+ return kUninitialized;
+ } else if ((value->*type_check)()) {
+ return kValid;
+ } else {
+ return kInvalid;
+ }
+}
+
+inline policy_table_interface_base::PolicyTableType PrimitiveType::GetPolicyTableType() const {
+ return policy_table_type_;
+}
+
+inline void PrimitiveType::SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type) {
+ policy_table_type_ = pt_type;
+}
+
+// static
+inline CompositeType::InitializationState CompositeType::InitHelper(
+ const Json::Value* value,
+ bool (Json::Value::*type_check)() const) {
+ if (!value) {
+ return kUninitialized;
+ } else if ((value->*type_check)()) {
+ // Some value type checks return true when initialized with null
+ if (value->isNull()) {
+ return kInvalidInitialized;
+ } else {
+ return kInitialized;
+ }
+ } else {
+ return kInvalidInitialized;
+ }
+}
+
+inline policy_table_interface_base::PolicyTableType CompositeType::GetPolicyTableType() const {
+ return policy_table_type_;
+}
+
+inline void CompositeType::SetPolicyTableType(policy_table_interface_base::PolicyTableType pt_type) {
+ policy_table_type_ = pt_type;
+}
+
+namespace impl {
+// static
+inline const Json::Value* ValueMember(const Json::Value* value,
+ const char* member_name) {
+ if (value && value->isMember(member_name)) {
+ return &(*value)[member_name];
+ }
+ return NULL;
+}
+
+template<class T>
+inline void WriteJsonField(const char* field_name,
+ const T& field,
+ Json::Value* json_value) {
+ if (field.is_initialized()) {
+ (*json_value)[field_name] = field.ToJsonValue();
+ }
+}
+
+} // namespace impl
+
+inline Boolean::Boolean(const Json::Value* value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isBool)),
+ value_(is_valid() ? value->asBool() : bool()) {
+}
+
+inline Boolean::Boolean(const Json::Value* value, bool def_value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isBool)),
+ value_(is_valid() ? value->asBool() : def_value) {
+ // If there is no value, mark it as valid and use def_value
+ if (!is_initialized()) {
+ value_state_ = kValid;
+ }
+}
+
+inline Json::Value Boolean::ToJsonValue() const {
+ return Json::Value(value_);
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>::Integer(const Json::Value* value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isInt)),
+ value_() {
+ if (is_valid()) {
+ Json::Value::Int64 intval = value->asInt64();
+ if (range_.Includes(intval)) {
+ value_ = IntType(intval);
+ } else {
+ value_state_ = kInvalid;
+ }
+ }
+}
+
+template<typename T, T minval, T maxval>
+Integer<T, minval, maxval>::Integer(const Json::Value* value, IntType def_value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isInt)),
+ value_(def_value) {
+ if (!is_initialized()) {
+ value_state_ = kValid;
+ } else if (is_valid()) {
+ Json::Value::Int64 intval = value->asInt64();
+ if (range_.Includes(intval)) {
+ value_ = IntType(intval);
+ } else {
+ value_state_ = kInvalid;
+ }
+ }
+}
+
+template<typename T, T minval, T maxval>
+Json::Value Integer<T, minval, maxval>::ToJsonValue() const {
+ return Json::Value(Json::Int64(value_));
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Float<minnum, maxnum, minden, maxden>::Float(const Json::Value* value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isDouble)),
+ value_() {
+ if (is_valid()) {
+ value_ = value->asDouble();
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
+ }
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Float<minnum, maxnum, minden, maxden>::Float(const Json::Value* value,
+ double def_value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isDouble)),
+ value_(def_value) {
+ if (!is_initialized()) {
+ value_state_ = kValid;
+ } else if (is_valid()) {
+ value_ = value->asDouble();
+ value_state_ = range_.Includes(value_) ? kValid : kInvalid;
+ }
+}
+
+template<int64_t minnum, int64_t maxnum, int64_t minden, int64_t maxden>
+Json::Value Float<minnum, maxnum, minden, maxden>::ToJsonValue() const {
+ return Json::Value(value_);
+}
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>::String(const Json::Value* value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isString)),
+ value_(is_valid() ? value->asString() : std::string()) {
+ if (is_valid()) {
+ value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
+ }
+}
+
+template<size_t minlen, size_t maxlen>
+String<minlen, maxlen>::String(const Json::Value* value, const std::string& def_value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isString)),
+ value_(def_value) {
+ if (!is_initialized()) {
+ value_state_ = kValid;
+ } else if (is_valid()) {
+ value_state_ = length_range_.Includes(value_.length()) ? kValid : kInvalid;
+ }
+}
+
+template<size_t minlen, size_t maxlen>
+Json::Value String<minlen, maxlen>::ToJsonValue() const {
+ return Json::Value(value_);
+}
+
+template<typename T>
+Enum<T>::Enum(const Json::Value* value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isString)),
+ value_(EnumType()) {
+ if (is_valid()) {
+ value_state_ =
+ EnumFromJsonString(value->asString(), &value_) ? kValid : kInvalid;
+ }
+}
+
+template<typename T>
+Enum<T>::Enum(const Json::Value* value, EnumType def_value)
+ : PrimitiveType(InitHelper(value, &Json::Value::isString)),
+ value_(def_value) {
+ if (!is_initialized()) {
+ value_state_ = kValid;
+ } else if (is_valid()) {
+ value_state_ =
+ EnumFromJsonString(value->asString(), &value_) ? kValid : kInvalid;
+ }
+}
+
+template<typename T>
+Json::Value Enum<T>::ToJsonValue() const {
+ return Json::Value(Json::StaticString(EnumToJsonString(value_)));
+}
+
+// Non-const version
+template<typename T, size_t minsize, size_t maxsize>
+Array<T, minsize, maxsize>::Array(Json::Value* value)
+ : CompositeType(InitHelper(value, &Json::Value::isArray)) {
+ if (value) {
+ if (value->isArray()) {
+ this->reserve(value->size());
+ for (Json::Value::iterator i = value->begin(); i != value->end(); ++i) {
+ push_back(&*i);
+ }
+ } else {
+ // Array is empty, empty initialized or uninitialized
+ // depending on InitHelper result
+ }
+ }
+}
+
+// Const version, must be identical to the non-const version
+template<typename T, size_t minsize, size_t maxsize>
+Array<T, minsize, maxsize>::Array(const Json::Value* value)
+ : CompositeType(InitHelper(value, &Json::Value::isArray)) {
+ if (value) {
+ if (value->isArray()) {
+ this->reserve(value->size());
+ for (Json::Value::const_iterator i = value->begin(); i != value->end(); ++i) {
+ push_back(&*i);
+ }
+ } else {
+ // Array is empty, empty initialized or uninitialized
+ // depending on InitHelper result
+ }
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+Json::Value Array<T, minsize, maxsize>::ToJsonValue() const {
+ Json::Value array(Json::arrayValue);
+ array.resize(this->size());
+ for (size_t i = 0; i != this->size(); ++i) {
+ array[Json::ArrayIndex(i)] = (this->operator [](i)).ToJsonValue();
+ }
+ return array;
+}
+
+// Non-const version
+template<typename T, size_t minsize, size_t maxsize>
+Map<T, minsize, maxsize>::Map(Json::Value* value)
+ : CompositeType(InitHelper(value, &Json::Value::isObject)) {
+ if (value) {
+ if (value->isObject()) {
+ for (Json::Value::iterator i = value->begin(); i != value->end(); ++i) {
+ this->insert(typename MapType::value_type(i.key().asString(), T(&*i)));
+ }
+ } else {
+ // Map is empty, empty initialized or uninitialized
+ // depending on InitHelper result
+ }
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+Map<T, minsize, maxsize>::Map(const Json::Value* value)
+ : CompositeType(InitHelper(value, &Json::Value::isObject)) {
+ if (value) {
+ if (value->isObject()) {
+ for (Json::Value::const_iterator i = value->begin(); i != value->end(); ++i) {
+ this->insert(typename MapType::value_type(i.key().asString(), T(&*i)));
+ }
+ } else {
+ // Map is empty, empty initialized or uninitialized
+ // depending on InitHelper result
+ }
+ }
+}
+
+template<typename T, size_t minsize, size_t maxsize>
+Json::Value Map<T, minsize, maxsize>::ToJsonValue() const {
+ Json::Value map(Json::objectValue);
+ for (typename MapType::const_iterator i = this->begin(); i != this->end(); ++i) {
+ map[i->first] = i->second.ToJsonValue();
+ }
+ return map;
+}
+
+template<typename T>
+Nullable<T>::Nullable(const Json::Value* value)
+ : T(value),
+ marked_null_(value != NULL&& value->isNull()) {
+}
+
+template<typename T>
+Nullable<T>::Nullable(Json::Value* value)
+ : T(value),
+ marked_null_(value != NULL&& value->isNull()) {
+}
+
+template<typename T>
+template<typename U>
+Nullable<T>::Nullable(const Json::Value* value, const U& def_value)
+ : T(value, def_value),
+ marked_null_(value != NULL&& value->isNull()) {
+}
+
+template<typename T>
+inline Json::Value Nullable<T>::ToJsonValue() const {
+ return marked_null_ ? Json::Value::null : T::ToJsonValue();
+}
+
+template<typename T>
+template<typename U>
+Optional<T>::Optional(const Json::Value* value, const U& def_value)
+ : value_(value, def_value) {
+}
+
+template<typename T>
+inline Json::Value Optional<T>::ToJsonValue() const {
+ return value_.ToJsonValue();
+}
+
+template<typename T>
+Stringifyable<T>::Stringifyable(const Json::Value* value)
+ : T(NULL != value&& !value->isString() ? value : NULL),
+ predefined_string_(NULL != value&& value->isString() ? value->asString() : "") {
+}
+
+template<typename T>
+Stringifyable<T>::Stringifyable(Json::Value* value)
+ : T(NULL != value&& !value->isString() ? value : NULL),
+ predefined_string_(NULL != value&& value->isString() ? value->asString() : "") {
+}
+
+template<typename T>
+template<typename U>
+Stringifyable<T>::Stringifyable(const Json::Value* value, const U& def_value)
+ : T(NULL != value&& !value->isString() ? (value, def_value) : NULL),
+ predefined_string_(NULL != value&& value->isString() ? value->asString() : "") {
+}
+
+template<typename T>
+inline Json::Value Stringifyable<T>::ToJsonValue() const {
+ return predefined_string_.empty() ? T::ToJsonValue() : predefined_string_;
+}
+
+} // namespace rpc
+
+#endif /* VALIDATED_TYPES_JSON_INL_H_ */
diff --git a/src/components/rpc_base/include/rpc_base/rpc_message.h b/src/components/rpc_base/include/rpc_base/rpc_message.h
new file mode 100644
index 0000000000..48ef5ff391
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/rpc_message.h
@@ -0,0 +1,98 @@
+/**
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef TYPE_BASE_H_
+#define TYPE_BASE_H_
+
+#include "rpc_base.h"
+
+namespace Json {
+class Value;
+}
+
+namespace rpc {
+
+enum MessageType {
+ kRequest = 0,
+ kResponse = 1,
+ kNotification = 2
+};
+
+// Base class for all RPC messages
+// Has methods to identify interface this message belongs to
+// And message ID
+class Message {
+public:
+ // Type of message
+ virtual MessageType message_type() const = 0;
+ // Numerical function identifier, unique to the interface
+ // Responses share function identifier with corresponding requests
+ virtual int32_t function_id() const = 0;
+ // Function string identifier as specified in original xml file
+ virtual const char* function_string_id() const = 0;
+ // Interface name as specified in original xml file
+ virtual const char* interface_string_id() const = 0;
+ // Serializes message to Json::Value
+ virtual Json::Value ToJsonValue() const = 0;
+ virtual ~Message() {}
+};
+
+// Base class for all interface-specific requests
+class RequestBase : public Message, public CompositeType {
+ public:
+ explicit RequestBase(InitializationState init_state): CompositeType(init_state) {}
+ // Message interface
+ MessageType message_type() const { return kRequest; }
+ virtual ~RequestBase() {}
+};
+
+// Base class for all interface-specific responses
+class ResponseBase : public Message, public CompositeType {
+ public:
+ ResponseBase(InitializationState init_state): CompositeType(init_state) {}
+ // Message interface
+ MessageType message_type() const { return kResponse; }
+ virtual ~ResponseBase() {}
+};
+
+// Base class for all interface-specific notifications
+class NotificationBase : public Message, public CompositeType {
+ public:
+ explicit NotificationBase(InitializationState init_state): CompositeType(init_state) {}
+ MessageType message_type() const { return kNotification; }
+ // Message interface
+ virtual ~NotificationBase() {}
+};
+
+} // namespace rpc
+
+#endif /* TYPE_BASE_H_ */
diff --git a/src/components/rpc_base/include/rpc_base/validation_report.h b/src/components/rpc_base/include/rpc_base/validation_report.h
new file mode 100644
index 0000000000..eeadb35ee4
--- /dev/null
+++ b/src/components/rpc_base/include/rpc_base/validation_report.h
@@ -0,0 +1,119 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RPC_BASE_VALIDATION_REPORT_H_
+#define RPC_BASE_VALIDATION_REPORT_H_
+
+#include <string>
+#include <list>
+
+namespace rpc {
+
+class ValidationReport;
+typedef std::list<ValidationReport> ValidationReports;
+
+class ValidationReport {
+ public:
+ explicit ValidationReport(const std::string& object_name);
+ const std::string& object_name() const;
+ const std::string& validation_info() const;
+ void set_validation_info(const std::string& info);
+ const ValidationReports& subobject_reports() const;
+ ValidationReport& ReportSubobject(const std::string& object_name);
+private:
+ std::string object_name_;
+ std::string validation_info_;
+ ValidationReports subobject_reports_;
+};
+
+std::string PrettyFormat(const ValidationReport& report);
+
+// Implementation
+
+namespace impl {
+inline void PrettyFormat(const ValidationReport& report,
+ const std::string& parent_path,
+ std::string* result) {
+ std::string object_path = parent_path;
+ if (!object_path.empty() && report.object_name()[0] != '[') {
+ object_path.append(".");
+ }
+ object_path.append(report.object_name());
+ if (!report.validation_info().empty()) {
+ result->append(object_path);
+ result->append(": ");
+ result->append(report.validation_info());
+ result->append("\n");
+ }
+ const ValidationReports& subreports = report.subobject_reports();
+ for (ValidationReports::const_iterator i = subreports.begin(),
+ end = subreports.end(); i != end; ++i) {
+ PrettyFormat(*i, object_path, result);
+ }
+}
+} // namespace impl
+
+inline ValidationReport::ValidationReport(const std::string& object_name)
+ : object_name_(object_name) {
+}
+
+inline const std::string& ValidationReport::object_name() const {
+ return object_name_;
+}
+
+inline const std::string& ValidationReport::validation_info() const {
+ return validation_info_;
+}
+
+inline void ValidationReport::set_validation_info(const std::string& info) {
+ validation_info_ = info;
+}
+
+inline const std::list<ValidationReport>& ValidationReport::subobject_reports() const {
+ return subobject_reports_;
+}
+
+inline ValidationReport& ValidationReport::ReportSubobject(
+ const std::string& object_name) {
+ subobject_reports_.push_back(ValidationReport(object_name));
+ return subobject_reports_.back();
+}
+
+inline std::string PrettyFormat(const ValidationReport& report) {
+ std::string result;
+ impl::PrettyFormat(report, "", &result);
+ return result;
+}
+
+} // namespace rpc
+
+#endif /* RPC_BASE_VALIDATION_REPORT_H_ */
diff --git a/src/components/rpc_base/src/rpc_base/rpc_base.cc b/src/components/rpc_base/src/rpc_base/rpc_base.cc
new file mode 100644
index 0000000000..88f0f53740
--- /dev/null
+++ b/src/components/rpc_base/src/rpc_base/rpc_base.cc
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "rpc_base/rpc_base.h"
+
+namespace rpc {
+
+} // namespace rpc
diff --git a/src/components/security_manager/CMakeLists.txt b/src/components/security_manager/CMakeLists.txt
new file mode 100644
index 0000000000..13a22a5b24
--- /dev/null
+++ b/src/components/security_manager/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(
+ ./include/
+ ../protocol_handler/include/
+ ../connection_handler/include
+ ../utils/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/jsoncpp/include
+ ${APR_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ src/security_manager_impl.cc
+ src/security_query.cc
+ src/crypto_manager_impl.cc
+ src/ssl_context_impl.cc
+)
+
+add_library(SecurityManager ${SOURCES})
+target_link_libraries(SecurityManager crypto ssl ProtocolHandler jsoncpp ProtocolLibrary)
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
new file mode 100644
index 0000000000..43bb63ef67
--- /dev/null
+++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_IMPL_H_
+
+#include <stdint.h>
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <string>
+#include <map>
+
+#include "security_manager/crypto_manager.h"
+#include "security_manager/ssl_context.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+
+namespace security_manager {
+class CryptoManagerImpl : public CryptoManager {
+ private:
+ class SSLContextImpl : public SSLContext {
+ public:
+ SSLContextImpl(SSL *conn, Mode mode);
+ virtual HandshakeResult StartHandshake(const uint8_t** const out_data,
+ size_t *out_data_size);
+ virtual HandshakeResult DoHandshakeStep(const uint8_t *const in_data,
+ size_t in_data_size,
+ const uint8_t** const out_data,
+ size_t *out_data_size);
+ virtual bool Encrypt(const uint8_t *const in_data, size_t in_data_size,
+ const uint8_t ** const out_data, size_t *out_data_size);
+ virtual bool Decrypt(const uint8_t *const in_data, size_t in_data_size,
+ const uint8_t ** const out_data, size_t *out_data_size);
+ virtual bool IsInitCompleted() const;
+ virtual bool IsHandshakePending() const;
+ virtual size_t get_max_block_size(size_t mtu) const;
+ virtual std::string LastError() const;
+ virtual ~SSLContextImpl();
+
+ private:
+ typedef size_t(*BlockSizeGetter)(size_t);
+ void EnsureBufferSizeEnough(size_t size);
+ SSL *connection_;
+ BIO *bioIn_;
+ BIO *bioOut_;
+ BIO *bioFilter_;
+ mutable sync_primitives::Lock bio_locker;
+ size_t buffer_size_;
+ uint8_t *buffer_;
+ bool is_handshake_pending_;
+ Mode mode_;
+ BlockSizeGetter max_block_size_;
+ static std::map<std::string, BlockSizeGetter> max_block_sizes;
+ static std::map<std::string, BlockSizeGetter> create_max_block_sizes();
+ DISALLOW_COPY_AND_ASSIGN(SSLContextImpl);
+ };
+
+ public:
+ CryptoManagerImpl();
+ virtual bool Init(Mode mode,
+ Protocol protocol,
+ const std::string &cert_filename,
+ const std::string &key_filename,
+ const std::string &ciphers_list,
+ bool verify_peer);
+ virtual void Finish();
+ virtual SSLContext *CreateSSLContext();
+ virtual void ReleaseSSLContext(SSLContext *context);
+ virtual std::string LastError() const;
+
+ private:
+ SSL_CTX *context_;
+ Mode mode_;
+ static uint32_t instance_count_;
+ DISALLOW_COPY_AND_ASSIGN(CryptoManagerImpl);
+};
+} // namespace security_manager
+#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_CRYPTO_MANAGER_IMPL_H_
diff --git a/src/components/security_manager/include/security_manager/security_manager_impl.h b/src/components/security_manager/include/security_manager/security_manager_impl.h
new file mode 100644
index 0000000000..a2dce4bf8b
--- /dev/null
+++ b/src/components/security_manager/include/security_manager/security_manager_impl.h
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_IMPL_H_
+
+#include <list>
+#include <string>
+
+#include "utils/macro.h"
+#include "utils/message_queue.h"
+#include "utils/threads/message_loop_thread.h"
+
+#include "security_manager/security_manager.h"
+#include "security_manager/security_query.h"
+#include "protocol_handler/protocol_handler.h"
+#include "protocol/common.h"
+
+namespace security_manager {
+/**
+ * \brief SecurityMessage is wrapper for SecurityQuery with priority
+ * \brief SecurityMessageQueue and SecurityMessageLoop are support typedefs
+ * for thread working
+ */
+struct SecurityMessage: public SecurityQueryPtr {
+ explicit SecurityMessage(const SecurityQueryPtr &message)
+ : SecurityQueryPtr(message) {}
+ // PrioritizedQueue requires this method to decide which priority to assign
+ size_t PriorityOrder() const {
+ return 0;
+ }
+};
+typedef utils::PrioritizedQueue<SecurityMessage> SecurityMessageQueue;
+typedef threads::MessageLoopThread<SecurityMessageQueue> SecurityMessageLoop;
+
+/**
+ * \brief SecurityManagerImpl class implements SecurityManager inteface
+ */
+class SecurityManagerImpl
+ : public SecurityManager,
+ public SecurityMessageLoop::Handler {
+ public:
+ /**
+ * \brief Constructor
+ */
+ SecurityManagerImpl();
+ /**
+ * \brief Add received from Mobile Application message
+ * Overriden ProtocolObserver::OnMessageReceived method
+ * \param message Message with supporting params received
+ */
+ void OnMessageReceived(const RawMessagePtr message) OVERRIDE;
+ /**
+ * \brief Post message to Mobile Application
+ * Empty *overriden ProtocolObserver::OnMessageReceived method
+ * \param message Message with supporting params received
+ */
+ void OnMobileMessageSent(const RawMessagePtr) OVERRIDE;
+
+ /**
+ * \brief Sets pointer for Connection Handler layer for managing sessions
+ * \param session_observer pointer to object of the class implementing
+ */
+ void set_session_observer(
+ protocol_handler::SessionObserver *observer) OVERRIDE;
+ /**
+ * \brief Sets pointer for Protocol Handler layer for sending
+ * \param protocol_handler pointer to object of the class implementing
+ */
+ void set_protocol_handler(
+ protocol_handler::ProtocolHandler *protocol_handler_) OVERRIDE;
+ /**
+ * \brief Sets pointer for CryptoManager for handling SSLContext
+ * \param crypto_manager pointer to object of the class implementing
+ */
+ void set_crypto_manager(CryptoManager *crypto_manager) OVERRIDE;
+ /**
+ * \brief Sends InternallError with text message to mobile application
+ * \param connection_key Unique key used by other components as session identifier
+ * \param error_id unique error identifier
+ * \param erorr_text SSL impelmentation error text
+ * \param seq_number received from Mobile Application
+ */
+ void SendInternalError(const uint32_t connection_key,
+ const uint8_t &error_id,
+ const std::string &erorr_text,
+ const uint32_t seq_number) OVERRIDE;
+
+ using SecurityManager::SendInternalError;
+
+ /**
+ * \brief Handle SecurityMessage from mobile for processing
+ * threads::MessageLoopThread<*>::Handler implementations
+ * CALLED in SecurityMessageLoop thread
+ */
+ void Handle(const SecurityMessage message) OVERRIDE;
+
+ /**
+ * \brief Create new SSLContext for connection or return exists
+ * Do not notify listeners, send security error on occure
+ * \param connection_key Unique key used by other components as session identifier
+ * @return new \c SSLContext or \c NULL on any error
+ */
+ SSLContext *CreateSSLContext(const uint32_t &connection_key) OVERRIDE;
+
+ /**
+ * \brief Start handshake as SSL client
+ */
+ void StartHandshake(uint32_t connection_key) OVERRIDE;
+
+ /**
+ * \brief Add/Remove for SecurityManagerListener
+ */
+ void AddListener(SecurityManagerListener *const listener) OVERRIDE;
+ void RemoveListener(SecurityManagerListener *const listener) OVERRIDE;
+ /**
+ * \brief Notifiers for listeners
+ * \param connection_key Unique key used by other components as session identifier
+ * \param success result of connection protection
+ */
+ void NotifyListenersOnHandshakeDone(const uint32_t &connection_key,
+ const bool success);
+ /**
+ * @brief SecurityConfigSection
+ * @return Session name in config file
+ */
+ static const char *ConfigSection();
+ private:
+ /**
+ * \brief Sends Handshake binary data to mobile application
+ * \param connection_key Unique key used by other components as session identifier
+ * \param data pointer to binary data array
+ * \param data_size size of binary data array
+ * \param seq_number received from Mobile Application
+ */
+ void SendHandshakeBinData(const uint32_t connection_key,
+ const uint8_t *const data,
+ const size_t data_size,
+ const uint32_t seq_number = 0);
+ /**
+ * \brief Parse SecurityMessage as HandshakeData request
+ * \param inMessage SecurityMessage with binary data of handshake
+ */
+ bool ProccessHandshakeData(const SecurityMessage &inMessage);
+ /**
+ * \brief Parse InternalError from mobile side
+ * \param inMessage SecurityMessage with binary data of handshake
+ */
+ bool ProccessInternalError(const SecurityMessage &inMessage);
+
+ /**
+ * \brief Sends security query
+ * Create new array as concatenation of header and binary data
+ * \param query SecurityQuery for sending via Control service
+ * \param connection_key Unique key used by other components as session identifier
+ */
+ void SendQuery(const SecurityQuery &query, const uint32_t connection_key);
+
+ // Thread that pumps handshake data
+ SecurityMessageLoop security_messages_;
+
+ /**
+ *\brief Pointer on instance of class implementing SessionObserver
+ */
+ protocol_handler::SessionObserver *session_observer_;
+ /**
+ *\brief Pointer on instance of class implementing CryptoManager
+ */
+ security_manager::CryptoManager *crypto_manager_;
+ /**
+ *\brief Pointer on instance of class implementing ProtocolHandler
+ */
+ protocol_handler::ProtocolHandler *protocol_handler_;
+ /**
+ *\brief List of listeners for notify handshake done result
+ */
+ std::list<SecurityManagerListener *> listeners_;
+ DISALLOW_COPY_AND_ASSIGN(SecurityManagerImpl);
+};
+} // namespace security_manager
+#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_IMPL_H_
diff --git a/src/components/security_manager/include/security_manager/security_query.h b/src/components/security_manager/include/security_manager/security_query.h
new file mode 100644
index 0000000000..c9f0b5843f
--- /dev/null
+++ b/src/components/security_manager/include/security_manager/security_query.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
+#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
+
+#include <stdint.h>
+#include <cstddef>
+#include <vector>
+#include <string>
+#include "utils/shared_ptr.h"
+
+namespace security_manager {
+/**
+ * \brief SecurityQuery is wrapper for handling Mobile messages
+ * as security queries
+ */
+class SecurityQuery {
+ public:
+ /**
+ * \brief QueryType is 1 byte type of income query
+ * Equal RPC Type (Ford Binary Header Definition)
+ */
+ enum QueryType {
+ REQUEST = 0x00,
+ RESPONSE = 0x10,
+ NOTIFICATION = 0x20,
+ INVALID_QUERY_TYPE = 0xFF
+ };
+ /**
+ * \brief QueryId is 3 byte identifier of income query
+ * Equal RPC Function ID (Ford Binary Header Definition)
+ */
+ enum QueryId {
+ SEND_HANDSHAKE_DATA = 0x1,
+ SEND_INTERNAL_ERROR = 0x2,
+ INVALID_QUERY_ID = 0xFFFFFF
+ };
+ /**
+ * \brief QueryHeader is 12 byte header of security query
+ * Equal Ford Binary Header Definition
+ */
+ struct QueryHeader {
+ QueryHeader();
+ QueryHeader(uint8_t queryType, uint32_t queryId,
+ uint32_t seqNumber = 0, uint32_t jsonSize= 0);
+ // TODO(EZamakhov): check bitfield correctness on other endianness platform
+ uint32_t query_type:8;
+ uint32_t query_id:24; // API function identifier
+ uint32_t seq_number; // request sequential number
+ uint32_t json_size;
+ };
+
+ /**
+ * \brief Constructor
+ */
+ SecurityQuery();
+ /**
+ * \brief Constructor with header and connection_key
+ * \param connection_key Unique key used by other components as session identifier
+ * \param header QueryHeader
+ */
+ SecurityQuery(const QueryHeader &header, const uint32_t connection_key);
+ /**
+ * \brief Constructor with header, connection_key and query binary data
+ * \param connection_key Unique key used by other components as session identifier
+ * \param raw_data pointer to binary data array
+ * \param raw_data_size size of binary data array
+ * \param header QueryHeader
+ */
+ SecurityQuery(const QueryHeader &header, const uint32_t connection_key,
+ const uint8_t *const raw_data, const size_t raw_data_size);
+ /**
+ * \brief Serialize income from Mobile Application data
+ * as query with header and binary data or json message
+ * \param raw_data pointer to binary data array
+ * \param raw_data_size size of binary data array
+ * \return \c true on correct parse and \c false on wrong size of data
+ */
+ bool SerializeQuery(const uint8_t *const raw_data, const size_t raw_data_size);
+ /**
+ * \brief Deserialize query for sending to Mobile Application
+ * \return \c vector of uint8_t data (serialized header data and send_data))
+ */
+ const std::vector<uint8_t> DeserializeQuery() const;
+ /**
+ * \brief Set binary data. (No header modification)
+ * \param binary_data pointer to binary data array
+ * \param bin_data_size size of binary data array
+ */
+ void set_data(const uint8_t *const binary_data, const size_t bin_data_size);
+ /**
+ * \brief Set json data. (No header modification)
+ * \param json_message string with json error
+ */
+ void set_json_message(const std::string &json_message);
+ /**
+ * \brief Set connection key
+ * \param connection_key Unique key used by other components as session identifier
+ */
+ void set_connection_key(const uint32_t connection_key);
+ /**
+ * \brief Set query header
+ * \param header of query
+ */
+ void set_header(const QueryHeader &header);
+ /**
+ * \brief Get query header
+ * \return header of query
+ */
+ const QueryHeader &get_header() const;
+ /**
+ * \brief Get query binary data (without header data)
+ * \return const pointer to const binary data
+ */
+ const uint8_t *get_data() const;
+ /**
+ * \brief Get query binary data size
+ * \return size of binary data
+ */
+ size_t get_data_size() const;
+ /**
+ * \brief Get json string data (without header data)
+ * \return const pointer to const binary data
+ */
+ const std::string &get_json_message() const;
+ /**
+ * \brief Get connection key
+ * \return Unique key used by other components as session identifier
+ */
+ uint32_t get_connection_key() const;
+
+ private:
+ /**
+ *\brief 12 byte header of security query
+ * Equal Ford Binary Header Definition
+ */
+ QueryHeader header_;
+ /**
+ *\brief nique key used by other components as session identifier
+ */
+ uint32_t connection_key_;
+ /**
+ *\brief Binary data of query (without header info)
+ */
+ std::vector<uint8_t> data_;
+ /**
+ *\brief JSON (string) value of query
+ */
+ std::string json_message_;
+};
+/**
+*\brief SmartPointer wrapper
+*/
+typedef utils::SharedPtr<SecurityQuery> SecurityQueryPtr;
+} // namespace security_manager
+#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
new file mode 100644
index 0000000000..69121a7b19
--- /dev/null
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "security_manager/crypto_manager_impl.h"
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include "security_manager/security_manager.h"
+#include "utils/logger.h"
+#include "utils/atomic.h"
+
+#define TLS1_1_MINIMAL_VERSION 0x1000103fL
+#define CONST_SSL_METHOD_MINIMAL_VERSION 0x00909000L
+
+namespace security_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "CryptoManagerImpl")
+
+uint32_t CryptoManagerImpl::instance_count_ = 0;
+
+CryptoManagerImpl::CryptoManagerImpl()
+ : context_(NULL), mode_(CLIENT) {
+}
+
+bool CryptoManagerImpl::Init(Mode mode,
+ Protocol protocol,
+ const std::string &cert_filename,
+ const std::string &key_filename,
+ const std::string &ciphers_list,
+ bool verify_peer) {
+ if (atomic_post_inc(&instance_count_) == 0) {
+ SSL_load_error_strings();
+ ERR_load_BIO_strings();
+ OpenSSL_add_all_algorithms();
+ SSL_library_init();
+ }
+
+ mode_ = mode;
+ const bool is_server = (mode == SERVER);
+#if OPENSSL_VERSION_NUMBER < CONST_SSL_METHOD_MINIMAL_VERSION
+ SSL_METHOD *method;
+#else
+ const SSL_METHOD *method;
+#endif
+ switch (protocol) {
+ case SSLv3:
+ method = is_server ?
+ SSLv3_server_method() :
+ SSLv3_client_method();
+ break;
+ case TLSv1:
+ method = is_server ?
+ TLSv1_server_method() :
+ TLSv1_client_method();
+ break;
+ case TLSv1_1:
+#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
+ LOG4CXX_WARN(logger_,
+ "OpenSSL has no TLSv1.1 with version lower 1.0.1, set TLSv1.0");
+ method = is_server ?
+ TLSv1_server_method() :
+ TLSv1_client_method();
+#else
+ method = is_server ?
+ TLSv1_1_server_method() :
+ TLSv1_1_client_method();
+#endif
+ break;
+ case TLSv1_2:
+#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
+ LOG4CXX_WARN(logger_,
+ "OpenSSL has no TLSv1.2 with version lower 1.0.1, set TLSv1.0");
+ method = is_server ?
+ TLSv1_server_method() :
+ TLSv1_client_method();
+#else
+ method = is_server ?
+ TLSv1_2_server_method() :
+ TLSv1_2_client_method();
+#endif
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "Unknown protocol: " << protocol);
+ return false;
+ }
+ context_ = SSL_CTX_new(method);
+
+ // Disable SSL2 as deprecated
+ SSL_CTX_set_options(context_, SSL_OP_NO_SSLv2);
+
+ if (cert_filename.empty()) {
+ LOG4CXX_WARN(logger_, "Empty certificate path");
+ } else {
+ LOG4CXX_INFO(logger_, "Certificate path: " << cert_filename);
+ if (!SSL_CTX_use_certificate_file(context_, cert_filename.c_str(),
+ SSL_FILETYPE_PEM)) {
+ LOG4CXX_ERROR(logger_, "Could not use certificate " << cert_filename);
+ return false;
+ }
+ }
+
+ if (key_filename.empty()) {
+ LOG4CXX_WARN(logger_, "Empty key path");
+ } else {
+ LOG4CXX_INFO(logger_, "Key path: " << key_filename);
+ if (!SSL_CTX_use_PrivateKey_file(context_, key_filename.c_str(),
+ SSL_FILETYPE_PEM)) {
+ LOG4CXX_ERROR(logger_, "Could not use key " << key_filename);
+ return false;
+ }
+ if (!SSL_CTX_check_private_key(context_)) {
+ LOG4CXX_ERROR(logger_, "Could not use certificate " << cert_filename);
+ return false;
+ }
+ }
+
+ if (ciphers_list.empty()) {
+ LOG4CXX_WARN(logger_, "Empty ciphers list");
+ } else {
+ LOG4CXX_INFO(logger_, "Cipher list: " << ciphers_list);
+ if (!SSL_CTX_set_cipher_list(context_, ciphers_list.c_str())) {
+ LOG4CXX_ERROR(logger_, "Could not set cipher list: " << ciphers_list);
+ return false;
+ }
+ }
+
+ // TODO(EZamakhov): add loading SSL_VERIFY_FAIL_IF_NO_PEER_CERT from INI
+ const int verify_mode = verify_peer
+ ? SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT
+ : SSL_VERIFY_NONE;
+ SSL_CTX_set_verify(context_, verify_mode, NULL);
+
+ return true;
+}
+
+void CryptoManagerImpl::Finish() {
+ SSL_CTX_free(context_);
+ if (atomic_post_dec(&instance_count_) == 1) {
+ EVP_cleanup();
+ ERR_free_strings();
+ }
+}
+
+SSLContext* CryptoManagerImpl::CreateSSLContext() {
+ if (context_ == NULL) {
+ return NULL;
+ }
+
+ SSL *conn = SSL_new(context_);
+ if (conn == NULL)
+ return NULL;
+
+ if (mode_ == SERVER) {
+ SSL_set_accept_state(conn);
+ } else {
+ SSL_set_connect_state(conn);
+ }
+ return new SSLContextImpl(conn, mode_);
+}
+
+void CryptoManagerImpl::ReleaseSSLContext(SSLContext *context) {
+ delete context;
+}
+
+std::string CryptoManagerImpl::LastError() const {
+ if (!context_) {
+ return std::string("Initialization is not completed");
+ }
+ const char *reason = ERR_reason_error_string(ERR_get_error());
+ return std::string(reason ? reason : "");
+}
+
+} // namespace security_manager
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
new file mode 100644
index 0000000000..7b538ed1fe
--- /dev/null
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -0,0 +1,367 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "security_manager/security_manager_impl.h"
+#include "security_manager/crypto_manager_impl.h"
+#include "protocol_handler/protocol_packet.h"
+#include "utils/logger.h"
+#include "utils/byte_order.h"
+#include "json/json.h"
+
+namespace security_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SecurityManager")
+
+static const char* kErrId = "id";
+static const char* kErrText = "text";
+
+SecurityManagerImpl::SecurityManagerImpl()
+ : security_messages_("SecurityManager", this),
+ session_observer_(NULL), crypto_manager_(NULL), protocol_handler_(NULL) {
+}
+
+void SecurityManagerImpl::OnMessageReceived(
+ const RawMessagePtr message) {
+ if (message->service_type() != protocol_handler::kControl) {
+ return;
+ }
+
+ SecurityMessage securityMessagePtr(new SecurityQuery());
+ const bool result = securityMessagePtr->SerializeQuery(
+ message->data(), message->data_size());
+ if (!result) {
+ // result will be false only if data less then query header
+ const std::string error_text("Incorrect message received");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(message->connection_key(),
+ ERROR_INVALID_QUERY_SIZE, error_text);
+ return;
+ }
+ securityMessagePtr->set_connection_key(message->connection_key());
+
+ // Post message to message query for next processing in thread
+ security_messages_.PostMessage(securityMessagePtr);
+}
+
+void SecurityManagerImpl::OnMobileMessageSent(
+ const RawMessagePtr ) {
+}
+
+void SecurityManagerImpl::set_session_observer(
+ protocol_handler::SessionObserver *observer) {
+ if (!observer) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to SessionObserver.");
+ return;
+ }
+ session_observer_ = observer;
+}
+
+void SecurityManagerImpl::set_protocol_handler(
+ protocol_handler::ProtocolHandler *handler) {
+ if (!handler) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to ProtocolHandler.");
+ return;
+ }
+ protocol_handler_ = handler;
+}
+
+void SecurityManagerImpl::set_crypto_manager(CryptoManager *crypto_manager) {
+ if (!crypto_manager) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to CryptoManager.");
+ return;
+ }
+ crypto_manager_ = crypto_manager;
+}
+
+void SecurityManagerImpl::Handle(const SecurityMessage message) {
+ DCHECK(message);
+ LOG4CXX_INFO(logger_, "Received Security message from Mobile side");
+ if (!crypto_manager_) {
+ const std::string error_text("Invalid (NULL) CryptoManager.");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(message->get_connection_key(),
+ ERROR_NOT_SUPPORTED, error_text);
+ return;
+ }
+ switch (message->get_header().query_id) {
+ case SecurityQuery::SEND_HANDSHAKE_DATA:
+ if (!ProccessHandshakeData(message)) {
+ LOG4CXX_ERROR(logger_, "Proccess HandshakeData failed");
+ }
+ break;
+ case SecurityQuery::SEND_INTERNAL_ERROR:
+ if (!ProccessInternalError(message)) {
+ LOG4CXX_ERROR(logger_, "Processing income InternalError failed");
+ }
+ break;
+ default: {
+ // SecurityQuery::InvalidQuery
+ const std::string error_text("Unknown query identifier.");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(message->get_connection_key(),
+ ERROR_INVALID_QUERY_ID, error_text,
+ message->get_header().seq_number);
+ }
+ break;
+ }
+}
+
+security_manager::SSLContext *SecurityManagerImpl::CreateSSLContext(
+ const uint32_t &connection_key) {
+ LOG4CXX_INFO(logger_, "ProtectService processing");
+ DCHECK(session_observer_);
+ DCHECK(crypto_manager_);
+
+ security_manager::SSLContext *ssl_context =
+ session_observer_->GetSSLContext(connection_key, protocol_handler::kControl);
+ // return exists SSLCOntext for current connection/session
+ if (ssl_context) {
+ return ssl_context;
+ }
+
+ ssl_context = crypto_manager_->CreateSSLContext();
+ if (!ssl_context) {
+ const std::string error_text("CryptoManager could not create SSL context.");
+ LOG4CXX_ERROR(logger_, error_text);
+ // Generate response query and post to security_messages_
+ SendInternalError(connection_key, ERROR_INTERNAL,
+ error_text);
+ return NULL;
+ }
+
+ const int result = session_observer_->SetSSLContext(connection_key, ssl_context);
+ if (ERROR_SUCCESS != result) {
+ // delete SSLContext on any error
+ crypto_manager_->ReleaseSSLContext(ssl_context);
+ SendInternalError(connection_key, result, "");
+ return NULL;
+ }
+ DCHECK(session_observer_->GetSSLContext(connection_key,
+ protocol_handler::kControl));
+ LOG4CXX_DEBUG(logger_, "Set SSL context to connection_key " << connection_key);
+ return ssl_context;
+}
+
+void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
+ DCHECK(session_observer_);
+ LOG4CXX_INFO(logger_, "StartHandshake: connection_key " << connection_key);
+ security_manager::SSLContext *ssl_context =
+ session_observer_->GetSSLContext(connection_key,
+ protocol_handler::kControl);
+ if (!ssl_context) {
+ const std::string error_text("StartHandshake failed, "
+ "connection is not protected");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(connection_key, ERROR_INTERNAL, error_text);
+ NotifyListenersOnHandshakeDone(connection_key, false);
+ return;
+ }
+
+ if (ssl_context->IsInitCompleted()) {
+ NotifyListenersOnHandshakeDone(connection_key, true);
+ return;
+ }
+ size_t data_size = 0;
+ const uint8_t *data = NULL;
+ const security_manager::SSLContext::HandshakeResult result =
+ ssl_context->StartHandshake(&data, &data_size);
+ if (security_manager::SSLContext::Handshake_Result_Success != result) {
+ const std::string error_text("StartHandshake failed, handshake step fail");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(connection_key, ERROR_INTERNAL, error_text);
+ NotifyListenersOnHandshakeDone(connection_key, false);
+ return;
+ }
+ // for client mode will be generated output data
+ if (data != NULL && data_size != 0) {
+ SendHandshakeBinData(connection_key, data, data_size);
+ }
+}
+void SecurityManagerImpl::AddListener(SecurityManagerListener *const listener) {
+ if (!listener) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to SecurityManagerListener.");
+ return;
+ }
+ listeners_.push_back(listener);
+}
+void SecurityManagerImpl::RemoveListener(SecurityManagerListener *const listener) {
+ if (!listener) {
+ LOG4CXX_ERROR(logger_, "Invalid (NULL) pointer to SecurityManagerListener.");
+ return;
+ }
+ listeners_.remove(listener);
+}
+void SecurityManagerImpl::NotifyListenersOnHandshakeDone(const uint32_t &connection_key,
+ const bool success) {
+ LOG4CXX_TRACE(logger_, "NotifyListenersOnHandshakeDone");
+ std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
+ while (it != listeners_.end()) {
+ if ((*it)->OnHandshakeDone(connection_key, success)) {
+ // On get notification remove listener
+ it = listeners_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+}
+
+bool SecurityManagerImpl::ProccessHandshakeData(const SecurityMessage &inMessage) {
+ LOG4CXX_INFO(logger_, "SendHandshakeData processing");
+ DCHECK(inMessage);
+ DCHECK(inMessage->get_header().query_id == SecurityQuery::SEND_HANDSHAKE_DATA);
+ const uint32_t seqNumber = inMessage->get_header().seq_number;
+ const uint32_t connection_key = inMessage->get_connection_key();
+
+ LOG4CXX_DEBUG(logger_, "Received " << inMessage->get_data_size()
+ << " bytes handshake data ");
+
+ if (!inMessage->get_data_size()) {
+ const std::string error_text("SendHandshakeData: null arguments size.");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(connection_key, ERROR_INVALID_QUERY_SIZE,
+ error_text, seqNumber);
+ return false;
+ }
+ DCHECK(session_observer_);
+ SSLContext *sslContext =
+ session_observer_->GetSSLContext(connection_key,
+ protocol_handler::kControl);
+ if (!sslContext) {
+ const std::string error_text("SendHandshakeData: No ssl context.");
+ LOG4CXX_ERROR(logger_, error_text);
+ SendInternalError(connection_key, ERROR_SERVICE_NOT_PROTECTED,
+ error_text, seqNumber);
+ NotifyListenersOnHandshakeDone(connection_key, false);
+ return false;
+ }
+ size_t out_data_size;
+ const uint8_t *out_data;
+ const SSLContext::HandshakeResult handshake_result =
+ sslContext->DoHandshakeStep(inMessage->get_data(), inMessage->get_data_size(),
+ &out_data, &out_data_size);
+ if (handshake_result == SSLContext::Handshake_Result_AbnormalFail) {
+ // Do not return handshake data on AbnormalFail or null returned values
+ const std::string erorr_text(sslContext->LastError());
+ LOG4CXX_ERROR(logger_, "SendHandshakeData: Handshake failed: " << erorr_text);
+ SendInternalError(connection_key,
+ ERROR_SSL_INVALID_DATA, erorr_text, seqNumber);
+ NotifyListenersOnHandshakeDone(connection_key, false);
+ // no handshake data to send
+ return false;
+ }
+ if (sslContext->IsInitCompleted()) {
+ // On handshake success
+ LOG4CXX_DEBUG(logger_, "SSL initialization finished success.");
+ NotifyListenersOnHandshakeDone(connection_key, true);
+ } else if (handshake_result == SSLContext::Handshake_Result_Fail) {
+ // On handshake fail
+ LOG4CXX_WARN(logger_, "SSL initialization finished with fail.");
+ NotifyListenersOnHandshakeDone(connection_key, false);
+ }
+
+ if (out_data && out_data_size) {
+ // answer with the same seqNumber as income message
+ SendHandshakeBinData(connection_key, out_data, out_data_size,
+ seqNumber);
+ }
+ return true;
+}
+
+bool SecurityManagerImpl::ProccessInternalError(const SecurityMessage &inMessage) {
+ LOG4CXX_INFO(logger_, "Recieved InternalError with Json message"
+ << inMessage->get_json_message());
+ Json::Value root;
+ Json::Reader reader;
+ const bool parsingSuccessful =
+ reader.parse(inMessage->get_json_message(), root);
+ if (!parsingSuccessful)
+ return false;
+ LOG4CXX_DEBUG(logger_, "Recieved InternalError id " << root[kErrId].asString()
+ << ", text: " << root[kErrText].asString());
+ return true;
+}
+void SecurityManagerImpl::SendHandshakeBinData(
+ const uint32_t connection_key, const uint8_t *const data,
+ const size_t data_size, const uint32_t seq_number) {
+ const SecurityQuery::QueryHeader header(
+ SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_HANDSHAKE_DATA, seq_number);
+ DCHECK(data_size < 1024 * 1024 *1024 );
+ const SecurityQuery query = SecurityQuery(header, connection_key, data, data_size);
+ SendQuery(query, connection_key);
+ LOG4CXX_DEBUG(logger_, "Sent " << data_size << " bytes handshake data ");
+}
+
+void SecurityManagerImpl::SendInternalError(const uint32_t connection_key,
+ const uint8_t &error_id,
+ const std::string &erorr_text,
+ const uint32_t seq_number) {
+ Json::Value value;
+ value[kErrId] = error_id;
+ value[kErrText] = erorr_text;
+ const std::string error_str = value.toStyledString();
+ SecurityQuery::QueryHeader header(SecurityQuery::NOTIFICATION,
+ SecurityQuery::SEND_INTERNAL_ERROR,
+ // header save json size only (exclude last byte)
+ seq_number, error_str.size());
+
+ // Raw data is json string and error id at last byte
+ std::vector<uint8_t> data_sending(error_str.size() + 1);
+ memcpy(&data_sending[0], error_str.c_str(), error_str.size());
+ data_sending[data_sending.size()-1] = error_id;
+
+ const SecurityQuery query(header, connection_key,
+ &data_sending[0], data_sending.size());
+ SendQuery(query, connection_key);
+ LOG4CXX_DEBUG(logger_, "Sent Internal error id " << static_cast<int>(error_id)
+ << " : \"" << erorr_text << "\".");
+}
+
+void SecurityManagerImpl::SendQuery(const SecurityQuery& query,
+ const uint32_t connection_key) {
+ const std::vector<uint8_t> data_sending = query.DeserializeQuery();
+
+ const RawMessagePtr rawMessagePtr(
+ new protocol_handler::RawMessage(connection_key,
+ protocol_handler::PROTOCOL_VERSION_3,
+ &data_sending[0], data_sending.size(),
+ protocol_handler::kControl));
+ DCHECK(protocol_handler_);
+ // Add RawMessage to ProtocolHandler message query
+ protocol_handler_->SendMessageToMobileApp(rawMessagePtr, false);
+}
+
+const char *SecurityManagerImpl::ConfigSection() {
+ return "Security Manager";
+}
+
+} // namespace security_manager
diff --git a/src/components/security_manager/src/security_query.cc b/src/components/security_manager/src/security_query.cc
new file mode 100644
index 0000000000..cd4da03c15
--- /dev/null
+++ b/src/components/security_manager/src/security_query.cc
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "security_manager/security_query.h"
+#include <cstring>
+#include "utils/macro.h"
+#include "utils/byte_order.h"
+
+namespace security_manager {
+
+SecurityQuery::QueryHeader::QueryHeader()
+ : query_type(INVALID_QUERY_TYPE), query_id(INVALID_QUERY_ID),
+ seq_number(0), json_size(0) {
+}
+
+SecurityQuery::QueryHeader::QueryHeader(uint8_t queryType, uint32_t queryId,
+ uint32_t seqNumber, uint32_t jsonSize)
+ : query_type(queryType), query_id(queryId),
+ seq_number(seqNumber), json_size(jsonSize) {
+}
+
+SecurityQuery::SecurityQuery()
+ : header_(INVALID_QUERY_TYPE, INVALID_QUERY_ID, 0), connection_key_(0) {
+}
+
+SecurityQuery::SecurityQuery(const SecurityQuery::QueryHeader &header,
+ const uint32_t connection_key,
+ const uint8_t *const raw_data,
+ const size_t raw_data_size)
+ : header_(header), connection_key_(connection_key),
+ data_(raw_data, raw_data + raw_data_size) {
+}
+
+SecurityQuery::SecurityQuery(const SecurityQuery::QueryHeader &header,
+ const uint32_t connection_key)
+ : header_(header), connection_key_(connection_key) {
+}
+
+bool SecurityQuery::SerializeQuery(const uint8_t *const raw_data,
+ const size_t raw_data_size) {
+ const size_t header_size = sizeof(QueryHeader);
+ if (raw_data_size < header_size || !raw_data) {
+ return false;
+ }
+ const uint8_t query_type = raw_data[0];
+ switch (query_type) {
+ case REQUEST:
+ header_.query_type = REQUEST;
+ break;
+ case RESPONSE:
+ header_.query_type = RESPONSE;
+ break;
+ case NOTIFICATION:
+ header_.query_type = NOTIFICATION;
+ break;
+ default:
+ header_.query_type = INVALID_QUERY_TYPE;
+ break;
+ }
+ // Convert to Little-Endian and clean high byte
+ const uint32_t query_id = 0x00FFFFFF &
+ BE_TO_LE32(*reinterpret_cast<const uint32_t*>(raw_data));
+ switch (query_id) {
+ case SEND_HANDSHAKE_DATA:
+ header_.query_id = SEND_HANDSHAKE_DATA;
+ break;
+ case SEND_INTERNAL_ERROR:
+ header_.query_id = SEND_INTERNAL_ERROR;
+ break;
+ default: // On wrong query id
+ header_.query_id = INVALID_QUERY_ID;
+ break;
+ }
+ header_.seq_number = BE_TO_LE32(*reinterpret_cast<const uint32_t*>(raw_data + 4));
+ header_.json_size = BE_TO_LE32(*reinterpret_cast<const uint32_t*>(raw_data + 8));
+
+ if (header_.json_size > raw_data_size - header_size)
+ return false;
+
+ if (header_.json_size > 0) {
+ const char *const json_data =
+ reinterpret_cast<const char*>(raw_data + header_size);
+ json_message_.assign(json_data, json_data + header_.json_size);
+ }
+
+ const uint32_t bin_data_size = raw_data_size - (header_size + header_.json_size);
+ if (bin_data_size > 0) {
+ const char *const bin_data =
+ reinterpret_cast<const char*>(raw_data + header_size + header_.json_size);
+ data_.assign(bin_data, bin_data + bin_data_size);
+ }
+ return true;
+}
+
+const std::vector<uint8_t> SecurityQuery::DeserializeQuery() const {
+ SecurityQuery::QueryHeader deserialize_header(header_);
+ const uint32_t tmp = deserialize_header.query_id << 8;
+ deserialize_header.query_id = LE_TO_BE32(tmp);
+ deserialize_header.seq_number = LE_TO_BE32(deserialize_header.seq_number);
+ deserialize_header.json_size = LE_TO_BE32(deserialize_header.json_size);
+
+ const size_t header_size = sizeof(deserialize_header);
+ // vector of header and raw_data
+ std::vector<uint8_t> data_sending(header_size + data_.size() + json_message_.size());
+ // copy header
+ memcpy(&data_sending[0], &deserialize_header, header_size);
+ // copy binary data
+ std::copy(data_.begin(), data_.end(), data_sending.begin() + header_size);
+ // copy text (json) data
+ std::copy(json_message_.begin(), json_message_.end(),
+ data_sending.begin() + header_size + data_.size());
+ return data_sending;
+}
+
+void SecurityQuery::set_data(const uint8_t *const binary_data,
+ const size_t bin_data_size) {
+ DCHECK(binary_data);
+ DCHECK(bin_data_size);
+ data_.assign(binary_data, binary_data + bin_data_size);
+}
+
+void SecurityQuery::set_json_message(const std::string &json_message) {
+ json_message_ = json_message;
+}
+
+void SecurityQuery::set_connection_key(const uint32_t connection_key) {
+ connection_key_ = connection_key;
+}
+
+void SecurityQuery::set_header(const SecurityQuery::QueryHeader &header) {
+ header_ = header;
+}
+
+const SecurityQuery::QueryHeader &SecurityQuery::get_header() const {
+ return header_;
+}
+
+const uint8_t* SecurityQuery::get_data() const {
+ return &data_[0];
+}
+
+size_t SecurityQuery::get_data_size() const {
+ return data_.size();
+}
+
+const std::string &SecurityQuery::get_json_message() const {
+ return json_message_;
+}
+
+uint32_t SecurityQuery::get_connection_key() const {
+ return connection_key_;
+}
+
+} // namespace security_manager
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
new file mode 100644
index 0000000000..09c2efd196
--- /dev/null
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "security_manager/crypto_manager_impl.h"
+
+#include <assert.h>
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <memory.h>
+#include <map>
+
+#include "utils/macro.h"
+
+namespace security_manager {
+
+CryptoManagerImpl::SSLContextImpl::SSLContextImpl(SSL *conn, Mode mode)
+ : connection_(conn),
+ bioIn_(BIO_new(BIO_s_mem())),
+ bioOut_(BIO_new(BIO_s_mem())),
+ bioFilter_(NULL),
+ // TODO(EZamakhov): get MTU by parameter (from transport)
+ // default buffer size is TCP MTU
+ buffer_size_(1500),
+ buffer_(new uint8_t[buffer_size_]),
+ is_handshake_pending_(false),
+ mode_(mode) {
+ SSL_set_bio(connection_, bioIn_, bioOut_);
+}
+
+std::string CryptoManagerImpl::SSLContextImpl::LastError() const {
+ if (!IsInitCompleted()) {
+ return std::string("Initialization is not completed");
+ }
+ const char *reason = ERR_reason_error_string(ERR_get_error());
+ return std::string(reason ? reason : "");
+}
+
+bool CryptoManagerImpl::SSLContextImpl::IsInitCompleted() const {
+ sync_primitives::AutoLock locker(bio_locker);
+ return SSL_is_init_finished(connection_);
+}
+
+SSLContext::HandshakeResult CryptoManagerImpl::SSLContextImpl::
+StartHandshake(const uint8_t** const out_data, size_t *out_data_size) {
+ is_handshake_pending_ = true;
+ return DoHandshakeStep(NULL, 0, out_data, out_data_size);
+}
+
+namespace {
+ size_t aes128_gcm_sha256_max_block_size(size_t mtu) {
+ if (mtu < 29)
+ return 0;
+ return mtu - 29;
+ }
+ size_t rc4_md5_max_block_size(size_t mtu) {
+ if (mtu < 21)
+ return 0;
+ return mtu - 21;
+ }
+ size_t rc4_sha_max_block_size(size_t mtu) {
+ if (mtu < 25)
+ return 0;
+ return mtu - 25;
+ }
+ size_t seed_sha_max_block_size(size_t mtu) {
+ if (mtu < 53)
+ return 0;
+ return ((mtu - 37) & 0xfffffff0) - 5;
+ }
+ size_t aes128_sha256_max_block_size(size_t mtu) {
+ if (mtu < 69)
+ return 0;
+ return ((mtu - 53) & 0xfffffff0) - 1;
+ }
+ size_t des_cbc3_sha_max_block_size(size_t mtu) {
+ if (mtu < 37)
+ return 0;
+ return ((mtu - 29) & 0xfffffff8) - 5;
+ }
+} // namespace
+
+std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter>
+CryptoManagerImpl::SSLContextImpl::create_max_block_sizes() {
+ std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter> rc;
+ rc.insert(std::make_pair("AES128-GCM-SHA256", aes128_gcm_sha256_max_block_size));
+ rc.insert(std::make_pair("AES128-SHA256", aes128_sha256_max_block_size));
+ rc.insert(std::make_pair("AES128-SHA", seed_sha_max_block_size));
+ rc.insert(std::make_pair("AES256-GCM-SHA384", aes128_gcm_sha256_max_block_size));
+ rc.insert(std::make_pair("AES256-SHA256", aes128_sha256_max_block_size));
+ rc.insert(std::make_pair("AES256-SHA", seed_sha_max_block_size));
+ rc.insert(std::make_pair("CAMELLIA128-SHA", seed_sha_max_block_size));
+ rc.insert(std::make_pair("CAMELLIA256-SHA", seed_sha_max_block_size));
+ rc.insert(std::make_pair("DES-CBC3-SHA", des_cbc3_sha_max_block_size));
+ rc.insert(std::make_pair("DES-CBC-SHA", des_cbc3_sha_max_block_size));
+ rc.insert(std::make_pair("RC4-MD5", rc4_md5_max_block_size));
+ rc.insert(std::make_pair("RC4-SHA", rc4_sha_max_block_size));
+ rc.insert(std::make_pair("SEED-SHA", seed_sha_max_block_size));
+ return rc;
+}
+
+std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter>
+CryptoManagerImpl::SSLContextImpl::max_block_sizes =
+ CryptoManagerImpl::SSLContextImpl::create_max_block_sizes();
+
+SSLContext::HandshakeResult CryptoManagerImpl::SSLContextImpl::
+DoHandshakeStep(const uint8_t* const in_data, size_t in_data_size,
+ const uint8_t** const out_data, size_t* out_data_size) {
+ DCHECK(out_data);
+ DCHECK(out_data_size);
+ *out_data = NULL;
+ *out_data_size = 0;
+ // TODO(Ezamakhov): add test - hanshake fail -> restart StartHandshake
+ sync_primitives::AutoLock locker(bio_locker);
+ if (SSL_is_init_finished(connection_)) {
+ is_handshake_pending_ = false;
+ return SSLContext::Handshake_Result_Success;
+ }
+
+ if (in_data && in_data_size) {
+ const int ret = BIO_write(bioIn_, in_data, in_data_size);
+ if (ret <= 0) {
+ is_handshake_pending_ = false;
+ SSL_clear(connection_);
+ return SSLContext::Handshake_Result_AbnormalFail;
+ }
+ }
+
+ const int handshake_result = SSL_do_handshake(connection_);
+ if (handshake_result == 1) {
+ // Handshake is successful
+ bioFilter_ = BIO_new(BIO_f_ssl());
+ BIO_set_ssl(bioFilter_, connection_, BIO_NOCLOSE);
+
+ const SSL_CIPHER *cipher = SSL_get_current_cipher(connection_);
+ max_block_size_ = max_block_sizes[SSL_CIPHER_get_name(cipher)];
+ is_handshake_pending_ = false;
+ } else if (handshake_result == 0) {
+ SSL_clear(connection_);
+ is_handshake_pending_ = false;
+ return SSLContext::Handshake_Result_Fail;
+ } else if (SSL_get_error(connection_, handshake_result) != SSL_ERROR_WANT_READ) {
+ SSL_clear(connection_);
+ is_handshake_pending_ = false;
+ return SSLContext::Handshake_Result_AbnormalFail;
+ }
+
+ const size_t pend = BIO_ctrl_pending(bioOut_);
+
+ if (pend) {
+ EnsureBufferSizeEnough(pend);
+
+ const int read_count = BIO_read(bioOut_, buffer_, pend);
+ if (read_count == static_cast<int>(pend)) {
+ *out_data_size = read_count;
+ *out_data = buffer_;
+ } else {
+ is_handshake_pending_ = false;
+ SSL_clear(connection_);
+ return SSLContext::Handshake_Result_AbnormalFail;
+ }
+ }
+
+ return SSLContext::Handshake_Result_Success;
+}
+
+bool CryptoManagerImpl::SSLContextImpl::Encrypt(
+ const uint8_t * const in_data, size_t in_data_size,
+ const uint8_t ** const out_data, size_t *out_data_size) {
+
+ sync_primitives::AutoLock locker(bio_locker);
+ if (!SSL_is_init_finished(connection_) ||
+ !in_data ||
+ !in_data_size) {
+ return false;
+ }
+
+ BIO_write(bioFilter_, in_data, in_data_size);
+ const size_t len = BIO_ctrl_pending(bioOut_);
+
+ EnsureBufferSizeEnough(len);
+ const int read_size = BIO_read(bioOut_, buffer_, len);
+ DCHECK(len == static_cast<size_t>(read_size));
+ if (read_size <= 0) {
+ // Reset filter and connection deinitilization instead
+ BIO_ctrl(bioFilter_, BIO_CTRL_RESET, 0, NULL);
+ return false;
+ }
+ *out_data_size = read_size;
+ *out_data = buffer_;
+
+ return true;
+}
+
+bool CryptoManagerImpl::SSLContextImpl::Decrypt(
+ const uint8_t * const in_data, size_t in_data_size,
+ const uint8_t ** const out_data, size_t *out_data_size) {
+
+ sync_primitives::AutoLock locker(bio_locker);
+ if (!SSL_is_init_finished(connection_)) {
+ return false;
+ }
+
+ if (!in_data || !in_data_size) {
+ return false;
+ }
+ BIO_write(bioIn_, in_data, in_data_size);
+ int len = BIO_ctrl_pending(bioFilter_);
+ ptrdiff_t offset = 0;
+
+ *out_data_size = 0;
+ while (len) {
+ EnsureBufferSizeEnough(len + offset);
+ len = BIO_read(bioFilter_, buffer_ + offset, len);
+ // TODO(EZamakhov): investigate BIO_read return 0, -1 and -2 meanings
+ if (len <= 0) {
+ // Reset filter and connection deinitilization instead
+ BIO_ctrl(bioFilter_, BIO_CTRL_RESET, 0, NULL);
+ return false;
+ }
+ *out_data_size += len;
+ offset += len;
+ len = BIO_ctrl_pending(bioFilter_);
+ }
+ *out_data = buffer_;
+ return true;
+}
+
+size_t CryptoManagerImpl::SSLContextImpl::get_max_block_size(size_t mtu) const {
+ if (!max_block_size_) {
+ // FIXME(EZamakhov): add correct logics for TLS1/1.2/SSL3
+ // For SSL3.0 set temporary value 90, old TLS1.2 value is 29
+ assert(mtu > 90);
+ return mtu - 90;
+ }
+ return max_block_size_(mtu);
+}
+
+bool CryptoManagerImpl::SSLContextImpl::IsHandshakePending() const {
+ return is_handshake_pending_;
+}
+
+CryptoManagerImpl::SSLContextImpl::~SSLContextImpl() {
+ SSL_shutdown(connection_);
+ SSL_free(connection_);
+ delete[] buffer_;
+}
+
+void CryptoManagerImpl::SSLContextImpl::EnsureBufferSizeEnough(size_t size) {
+ if (buffer_size_ < size) {
+ delete[] buffer_;
+ buffer_ = new(std::nothrow) uint8_t[size];
+ if (buffer_) {
+ buffer_size_ = size;
+ }
+ }
+}
+
+} // namespace security_manager
diff --git a/src/components/smart_objects/CMakeLists.txt b/src/components/smart_objects/CMakeLists.txt
new file mode 100644
index 0000000000..89f0dbdce5
--- /dev/null
+++ b/src/components/smart_objects/CMakeLists.txt
@@ -0,0 +1,26 @@
+include_directories (
+ ./include
+ ../utils/include/
+)
+
+set (SOURCES
+ ./src/smart_object.cc
+ ./src/smart_schema.cc
+ ./src/schema_item.cc
+ ./src/always_false_schema_item.cc
+ ./src/always_true_schema_item.cc
+ ./src/default_shema_item.cc
+ ./src/bool_schema_item.cc
+ ./src/number_schema_item.cc
+ ./src/enum_schema_item.cc
+ ./src/string_schema_item.cc
+ ./src/object_schema_item.cc
+ ./src/array_schema_item.cc
+)
+
+add_library("SmartObjects" ${SOURCES})
+
+if(ENABLE_LOG)
+ target_link_libraries("SmartObjects" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
new file mode 100644
index 0000000000..c4babbf8b4
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief Always false schema item.
+ **/
+class CAlwaysFalseSchemaItem : public ISchemaItem {
+ public:
+ /**
+ * @brief Create a new schema item.
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<CAlwaysFalseSchemaItem> create();
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return Errors::ERROR
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ private:
+ CAlwaysFalseSchemaItem();
+ DISALLOW_COPY_AND_ASSIGN(CAlwaysFalseSchemaItem);
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
new file mode 100644
index 0000000000..1b5fa8a765
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief Always true schema item.
+ **/
+class CAlwaysTrueSchemaItem : public ISchemaItem {
+ public:
+ /**
+ * @brief Create a new schema item.
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<CAlwaysTrueSchemaItem> create();
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ private:
+ CAlwaysTrueSchemaItem();
+ DISALLOW_COPY_AND_ASSIGN(CAlwaysTrueSchemaItem);
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h
new file mode 100644
index 0000000000..f8fa8e9462
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
+
+#include <stddef.h>
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/schema_item.h"
+#include "smart_objects/always_true_schema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief Array schema item.
+ **/
+class CArraySchemaItem : public ISchemaItem {
+ public:
+ /**
+ * @brief Create a new schema item.
+ *
+ * @param ElementSchemaItem SchemaItem for array elements.
+ * @param MinSize Minimum allowed size.
+ * @param MaxSize Maximum allowed size.
+ *
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<CArraySchemaItem> create(
+ const ISchemaItemPtr ElementSchemaItem = CAlwaysTrueSchemaItem::create(),
+ const TSchemaItemParameter<size_t>& MinSize = TSchemaItemParameter<size_t>(),
+ const TSchemaItemParameter<size_t>& MaxSize = TSchemaItemParameter<size_t>());
+
+ /**
+ * @brief Validate smart object.
+ *
+ * @param Object Object to validate.
+ *
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+
+ /**
+ * @brief Apply schema.
+ *
+ * @param Object Object to apply schema.
+ **/
+ void applySchema(SmartObject& Object) OVERRIDE;
+
+ /**
+ * @brief Unapply schema.
+ *
+ * @param Object Object to unapply schema.
+ **/
+ void unapplySchema(SmartObject& Object) OVERRIDE;
+
+ /**
+ * @brief Build smart object by smart schema having copied matched
+ * parameters from pattern smart object
+ *
+ * @param pattern_object pattern object
+ * @param result_object object to build
+ */
+ void BuildObjectBySchema(const SmartObject& pattern_object,
+ SmartObject& result_object) OVERRIDE;
+
+ private:
+ /**
+ * @brief Constructor.
+ *
+ * @param ElementSchemaItem SchemaItem for array elements.
+ * @param MinSize Minimum allowed size.
+ * @param MaxSize Maximum allowed size.
+ **/
+ CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize,
+ const TSchemaItemParameter<size_t>& MaxSize);
+ /**
+ * @brief SchemaItem for array elements.
+ **/
+ const ISchemaItemPtr mElementSchemaItem;
+ /**
+ * @brief Minimum allowed size.
+ **/
+ const TSchemaItemParameter<size_t> mMinSize;
+ /**
+ * @brief Maximum allowed size.
+ **/
+ const TSchemaItemParameter<size_t> mMaxSize;
+ DISALLOW_COPY_AND_ASSIGN(CArraySchemaItem);
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/bool_schema_item.h b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
new file mode 100644
index 0000000000..bb0dbd6653
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/bool_schema_item.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
+
+#include "utils/shared_ptr.h"
+
+#include "smart_objects/default_shema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief Bool schema item.
+ **/
+class CBoolSchemaItem : public CDefaultSchemaItem<bool> {
+ public:
+ /**
+ * @brief Create a new schema item.
+ * @param DefaultValue Default value of a parameter.
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<CBoolSchemaItem> create(
+ const TSchemaItemParameter<bool>& DefaultValue =
+ TSchemaItemParameter<bool>());
+
+ private:
+ explicit CBoolSchemaItem(const TSchemaItemParameter<bool>& DefaultValue);
+ SmartType getSmartType() const OVERRIDE;
+ bool getDefaultValue() const OVERRIDE;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CBoolSchemaItem);
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h
new file mode 100644
index 0000000000..5065e27684
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
+
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+
+#include "smart_objects/schema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+#include "smart_objects/smart_object.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+/**
+ * @brief Default schema item.
+ **/
+template<typename Type>
+class CDefaultSchemaItem : public ISchemaItem {
+ public:
+ typedef TSchemaItemParameter<Type> ParameterType;
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+
+ /**
+ * @brief Set default value to an object.
+ * @param Object Object to set default value.
+ * @return true if default value was successfully set, false otherwise.
+ **/
+ bool setDefaultValue(SmartObject& Object) OVERRIDE;
+
+ /**
+ * @brief Build smart object by smart schema having copied matched
+ * parameters from pattern smart object
+ * @param pattern_object pattern object
+ * @param result_object object to build
+ */
+ void BuildObjectBySchema(const SmartObject& pattern_object,
+ SmartObject& result_object) OVERRIDE;
+
+ protected:
+ explicit CDefaultSchemaItem(const ParameterType& DefaultValue);
+ /**
+ * @brief SmartType getter for primitive types common logic
+ * @return SmartType for ShemaItem
+ */
+ virtual SmartType getSmartType() const = 0;
+ /**
+ * @brief Default value getter for primitive types common logic
+ * @return Default value for selected type
+ */
+ virtual Type getDefaultValue() const = 0;
+ /**
+ * @param DefaultValue Default value of a parameter.
+ */
+ const ParameterType mDefaultValue;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CDefaultSchemaItem<Type>);
+};
+
+template<typename Type>
+CDefaultSchemaItem<Type>::CDefaultSchemaItem(const ParameterType& DefaultValue)
+ : mDefaultValue(DefaultValue) {
+}
+
+template<typename Type>
+Errors::eType CDefaultSchemaItem<Type>::validate(const SmartObject& Object) {
+ return (getSmartType() == Object.getType()) ? Errors::OK : Errors::INVALID_VALUE;
+}
+
+template<typename Type>
+bool CDefaultSchemaItem<Type>::setDefaultValue(SmartObject& Object) {
+ Type value;
+ if (mDefaultValue.getValue(value)) {
+ Object = value;
+ return true;
+ }
+ return false;
+}
+
+template<typename Type>
+void CDefaultSchemaItem<Type>::BuildObjectBySchema(
+ const SmartObject& pattern_object, SmartObject& result_object) {
+ if (getSmartType() == pattern_object.getType()) {
+ result_object = pattern_object;
+ } else {
+ if (!setDefaultValue(result_object)) {
+ result_object = getDefaultValue();
+ }
+ }
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
new file mode 100644
index 0000000000..b38b910452
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ENUM_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ENUM_SCHEMA_ITEM_H_
+
+#include <string.h>
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/default_shema_item.h"
+
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+template <typename EnumType> class EnumConversionHelper;
+/**
+ * @brief Enumeration schema item.
+ * @tparam EnumType Enumeration type.
+ **/
+template<typename EnumType>
+class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
+ public:
+ /**
+ * @brief Create a new schema item.
+ * @param AllowedElements Set of allowed enumeration elements.
+ * @param DefaultValue Default value.
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<TEnumSchemaItem> create(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue =
+ TSchemaItemParameter<EnumType>());
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Apply schema.
+ * This implementation checks if enumeration is represented as string
+ * and tries to convert it to integer according to element-to-string
+ * map.
+ * @param Object Object to apply schema.
+ **/
+ void applySchema(SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Unapply schema.
+ * @param Object Object to unapply schema.
+ **/
+ void unapplySchema(SmartObject& Object) OVERRIDE;
+
+ private:
+ /**
+ * @brief Constructor.
+ * @param AllowedElements Set of allowed enumeration elements.
+ * @param DefaultValue Default value.
+ **/
+ TEnumSchemaItem(const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue);
+ SmartType getSmartType() const OVERRIDE;
+ EnumType getDefaultValue() const OVERRIDE;
+ /**
+ * @brief Set of allowed enumeration elements.
+ **/
+ const std::set<EnumType> mAllowedElements;
+ /**
+ * @brief Default value.
+ **/
+ const TSchemaItemParameter<EnumType> mDefaultValue;
+ typedef EnumConversionHelper<EnumType> ConversionHelper;
+ DISALLOW_COPY_AND_ASSIGN(TEnumSchemaItem);
+};
+
+struct CStringComparator {
+ bool operator()(const char* a, const char* b) const {
+ return strcmp(a, b) < 0;
+ }
+};
+
+template <typename EnumType>
+class EnumConversionHelper {
+ public:
+ typedef std::map<EnumType, const char*> EnumToCStringMap;
+ typedef std::map<const char*, EnumType, CStringComparator> CStringToEnumMap;
+
+ static const EnumToCStringMap& enum_to_cstring_map() {
+ return enum_to_cstring_map_;
+ }
+
+ static const CStringToEnumMap& cstring_to_enum_map() {
+ return cstring_to_enum_map_;
+ }
+
+ static bool CStringToEnum(const char* str, EnumType* value) {
+ typename CStringToEnumMap::const_iterator it = cstring_to_enum_map().find(str);
+ if (it == cstring_to_enum_map().end()) {
+ return false;
+ }
+ if (value) {
+ *value = it->second;
+ }
+ return true;
+ }
+
+ static bool EnumToCString(EnumType value, const char** str) {
+ typename EnumToCStringMap::const_iterator it = enum_to_cstring_map().find(value);
+ if (it == enum_to_cstring_map().end()) {
+ return false;
+ }
+ if (str) {
+ *str = it->second;
+ }
+ return true;
+ }
+
+ static bool StringToEnum(const std::string& str, EnumType* value) {
+ return CStringToEnum(str.c_str(), value);
+ }
+
+ static bool EnumToString(const EnumType value, std::string* str) {
+ const char* cstr;
+ if (EnumToCString(value, &cstr)) {
+ return false;
+ }
+ if (str) {
+ *str = cstr;
+ }
+ return false;
+ }
+
+ private:
+ static const char* const cstring_values_[];
+ static const EnumType enum_values_[];
+ static const EnumToCStringMap enum_to_cstring_map_;
+ static const CStringToEnumMap cstring_to_enum_map_;
+
+ struct Size {
+ enum {value = sizeof(cstring_values_) / sizeof(cstring_values_[0])};
+ };
+
+ static EnumToCStringMap InitEnumToCStringMap() {
+ DCHECK(Size::value == sizeof(enum_values_) / sizeof(enum_values_[0]));
+ EnumToCStringMap result;
+ for (size_t i = 0; i < Size::value; ++i) {
+ result[enum_values_[i]] = cstring_values_[i];
+ }
+ return result;
+ }
+
+ static CStringToEnumMap InitCStringToEnumMap() {
+ DCHECK(Size::value == sizeof(enum_values_) / sizeof(enum_values_[0]));
+ CStringToEnumMap result;
+ for (size_t i = 0; i < Size::value; ++i) {
+ result[cstring_values_[i]] = enum_values_[i];
+ }
+ return result;
+ }
+ DISALLOW_COPY_AND_ASSIGN(EnumConversionHelper<EnumType>);
+};
+
+
+template<typename EnumType>
+utils::SharedPtr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue) {
+ return new TEnumSchemaItem<EnumType>(AllowedElements, DefaultValue);
+}
+
+template<typename EnumType>
+Errors::eType TEnumSchemaItem<EnumType>::validate(const SmartObject& Object) {
+ if (SmartType_Integer != Object.getType()) {
+ return Errors::INVALID_VALUE;
+ }
+ if (mAllowedElements.find(static_cast<EnumType>(Object.asInt()))
+ == mAllowedElements.end()) {
+ return Errors::OUT_OF_RANGE;
+ }
+ return Errors::OK;
+}
+
+template<typename EnumType>
+void TEnumSchemaItem<EnumType>::applySchema(SmartObject& Object) {
+ if (SmartType_String == Object.getType()) {
+ EnumType enum_val = static_cast<EnumType>(-1);
+ if (ConversionHelper::StringToEnum(Object.asString(), &enum_val)) {
+ Object = enum_val;
+ }
+ }
+}
+
+template<typename EnumType>
+void TEnumSchemaItem<EnumType>::unapplySchema(SmartObject& Object) {
+ if (SmartType_Integer == Object.getType()) {
+ const char* str;
+ if (ConversionHelper::EnumToCString(static_cast<EnumType>(Object.asInt()), &str)) {
+ Object = str;
+ }
+ }
+}
+
+template<typename EnumType>
+SmartType TEnumSchemaItem<EnumType>::getSmartType() const {
+ return SmartType_Integer;
+}
+template<typename EnumType>
+EnumType TEnumSchemaItem<EnumType>::getDefaultValue() const {
+ return EnumType::INVALID_ENUM;
+}
+
+template<typename EnumType>
+TEnumSchemaItem<EnumType>::TEnumSchemaItem(
+ const std::set<EnumType>& AllowedElements,
+ const TSchemaItemParameter<EnumType>& DefaultValue)
+ : CDefaultSchemaItem<EnumType>(DefaultValue),
+ mAllowedElements(AllowedElements) {
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ENUM_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/errors.h b/src/components/smart_objects/include/smart_objects/errors.h
new file mode 100644
index 0000000000..fe8a04b692
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/errors.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+namespace Errors {
+/**
+ * @brief Enumeration that provides information about SmartObject validation errors
+ **/
+enum eType {
+ /**
+ * @brief Success validation
+ **/
+ OK = 0,
+
+ /**
+ * @brief Invalid value.
+ **/
+ INVALID_VALUE,
+
+ /**
+ * @brief Value is out of allowed range.
+ **/
+ OUT_OF_RANGE,
+
+ /**
+ * @brief Mandatory parameter is missing.
+ **/
+ MISSING_MANDATORY_PARAMETER,
+
+ /**
+ * @brief General validation error
+ **/
+ ERROR
+};
+} // namespace Errors
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ERRORS_H_
diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h
new file mode 100644
index 0000000000..f5dd8ba42b
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
+
+#include <typeinfo>
+
+#include "utils/shared_ptr.h"
+#include "smart_objects/default_shema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief Number schema item.
+ * @tparam NumberType Number type.
+ **/
+template<typename NumberType>
+class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
+ public:
+ /**
+ * @brief Create a new schema item.
+ * @param MinValue Minimum allowed value.
+ * @param MaxValue Maximum allowed value.
+ * @param DefaultValue Default value.
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<TNumberSchemaItem> create(
+ const TSchemaItemParameter<NumberType>& MinValue = TSchemaItemParameter <NumberType > (),
+ const TSchemaItemParameter<NumberType>& MaxValue = TSchemaItemParameter <NumberType > (),
+ const TSchemaItemParameter<NumberType>& DefaultValue =
+ TSchemaItemParameter<NumberType>());
+
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+
+ private:
+ /**
+ * @brief Get smart type for this NumberType.
+ * @return Smart type for this NumberType.
+ **/
+ SmartType getSmartType() const OVERRIDE;
+ NumberType getDefaultValue() const OVERRIDE;
+ /**
+ * @brief Constructor.
+ *
+ * @param MinValue Minimum allowed value.
+ * @param MaxValue Maximum allowed value.
+ * @param DefaultValue Default value.
+ **/
+ TNumberSchemaItem(const TSchemaItemParameter<NumberType>& MinValue,
+ const TSchemaItemParameter<NumberType>& MaxValue,
+ const TSchemaItemParameter<NumberType>& DefaultValue);
+ bool isNumberType(SmartType type);
+
+ /**
+ * @brief Minimum and Maximum allowed values.
+ **/
+ const TSchemaItemParameter<NumberType> mMinValue;
+ const TSchemaItemParameter<NumberType> mMaxValue;
+ DISALLOW_COPY_AND_ASSIGN(TNumberSchemaItem);
+};
+
+template<typename NumberType>
+utils::SharedPtr<TNumberSchemaItem<NumberType> >
+TNumberSchemaItem<NumberType>::create(
+ const TSchemaItemParameter<NumberType>& MinValue,
+ const TSchemaItemParameter<NumberType>& MaxValue,
+ const TSchemaItemParameter<NumberType>& DefaultValue) {
+ return new TNumberSchemaItem<NumberType>(MinValue, MaxValue, DefaultValue);
+}
+
+template<typename NumberType>
+bool TNumberSchemaItem<NumberType>::isNumberType(SmartType type) {
+ return SmartType_Integer == type || SmartType_Double == type;
+}
+
+template<typename NumberType>
+Errors::eType TNumberSchemaItem<NumberType>::validate(const SmartObject& Object) {
+ if (!isNumberType(Object.getType())) {
+ return Errors::INVALID_VALUE;
+ }
+ NumberType value;
+ if (typeid(int32_t) == typeid(value)) {
+ value = Object.asInt();
+ } else if (typeid(uint32_t) == typeid(value)) {
+ value = Object.asUInt();
+ } else if (typeid(double) == typeid(value)) {
+ value = Object.asDouble();
+ } else if (typeid(int64_t) == typeid(value)) {
+ value = Object.asInt64();
+ } else {
+ NOTREACHED();
+ }
+
+ NumberType rangeLimit;
+ if (mMinValue.getValue(rangeLimit) && (value < rangeLimit)) {
+ return Errors::OUT_OF_RANGE;
+ }
+
+ if (mMaxValue.getValue(rangeLimit) && (value > rangeLimit)) {
+ return Errors::OUT_OF_RANGE;
+ }
+ return Errors::OK;
+}
+
+template<typename NumberType>
+TNumberSchemaItem<NumberType>::TNumberSchemaItem(
+ const TSchemaItemParameter<NumberType>& MinValue,
+ const TSchemaItemParameter<NumberType>& MaxValue,
+ const TSchemaItemParameter<NumberType>& DefaultValue)
+ : CDefaultSchemaItem<NumberType>(DefaultValue),
+ mMinValue(MinValue),
+ mMaxValue(MaxValue) {
+}
+
+template<typename NumberType>
+NumberType TNumberSchemaItem<NumberType>::getDefaultValue() const {
+ return NumberType(0);
+}
+
+/**
+ * @brief Specialization of getSmartType for number types.
+ * @return SmartType.
+ **/
+template<typename NumberType>
+SmartType TNumberSchemaItem<NumberType>::getSmartType() const {
+ DCHECK(!"Wrong type of template class");
+ return SmartType_Invalid;
+}
+template<>
+SmartType TNumberSchemaItem<int32_t>::getSmartType() const;
+
+template<>
+SmartType TNumberSchemaItem<uint32_t>::getSmartType() const;
+
+template<>
+SmartType TNumberSchemaItem<uint32_t>::getSmartType() const;
+
+template<>
+SmartType TNumberSchemaItem<double>::getSmartType() const;
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_NUMBER_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
new file mode 100644
index 0000000000..b58414459d
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
+
+#include <map>
+#include <string>
+#include <set>
+
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+
+#include "smart_objects/schema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief Object schema item.
+ **/
+class CObjectSchemaItem : public ISchemaItem {
+ public:
+ /**
+ * @brief Object member.
+ **/
+ struct SMember {
+ /**
+ * @brief Default constructor.
+ **/
+ SMember();
+ /**
+ * @brief Constructor.
+ * @param SchemaItem Member schema item.
+ * @param IsMandatory true if member is mandatory, false
+ * otherwise. Defaults to true.
+ **/
+ SMember(const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory = true);
+ /**
+ * @brief Member schema item.
+ **/
+ ISchemaItemPtr mSchemaItem;
+ /**
+ * @brief true if member is mandatory, false otherwise.
+ **/
+ bool mIsMandatory;
+ };
+ typedef std::map<std::string, SMember> Members;
+ /**
+ * @brief Create a new schema item.
+ *
+ * @param Members Map of member name to SMember structure
+ * describing the object member.
+ *
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<CObjectSchemaItem> create(const Members& Members);
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Apply schema.
+ * @param Object Object to apply schema.
+ **/
+ void applySchema(SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Unapply schema.
+ * @param Object Object to unapply schema.
+ **/
+ void unapplySchema(SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Build smart object by smart schema having copied matched
+ * parameters from pattern smart object
+ * @param pattern_object pattern object
+ * @param result_object object to build
+ */
+ void BuildObjectBySchema(const SmartObject& pattern_object,
+ SmartObject& result_object) OVERRIDE;
+ /**
+ * @brief Get size mMembers map
+ * @return Size of mMembers
+ */
+ size_t GetMemberSize() OVERRIDE;
+
+ protected:
+ /**
+ * @brief Constructor.
+ * @param Members Map of member name to SMember structure
+ * describing the object member.
+ **/
+ CObjectSchemaItem(const Members& Members);
+ /**
+ * @brief Map of member name to SMember structure describing the object member.
+ **/
+ const Members mMembers;
+ DISALLOW_COPY_AND_ASSIGN(CObjectSchemaItem);
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_OBJECT_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h
new file mode 100644
index 0000000000..83adb0022b
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
+
+#include <stdlib.h>
+#include "utils/shared_ptr.h"
+
+#include "smart_objects/errors.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+
+/**
+ * @brief Base schema item.
+ **/
+class ISchemaItem {
+ public:
+ /**
+ * @brief Validate object.
+ *
+ * @param Object Object to validate.
+ *
+ * @return NsSmartObjects::Errors::eType
+ **/
+ virtual Errors::eType validate(const SmartObject& Object);
+
+ /**
+ * @brief Set default value to an object.
+ *
+ * @param Object Object to set default value.
+ *
+ * @return true if default value was successfully set, false otherwise.
+ **/
+ virtual bool setDefaultValue(SmartObject& Object);
+
+ /**
+ * @brief Check if object has default value.
+ *
+ * @param Object Object to set default value.
+ *
+ * @return true if default value was successfully set, false otherwise.
+ **/
+ virtual bool hasDefaultValue(SmartObject& Object);
+
+ /**
+ * @brief Apply schema.
+ *
+ * @param Object Object to apply schema.
+ **/
+ virtual void applySchema(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& Object);
+
+ /**
+ * @brief Unapply schema.
+ *
+ * @param Object Object to unapply schema.
+ **/
+ virtual void unapplySchema(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& Object);
+
+ /**
+ * @brief Build smart object by smart schema having copied matched
+ * parameters from pattern smart object
+ *
+ * @param pattern_object pattern object
+ * @param result_object object to build
+ */
+ virtual void BuildObjectBySchema(
+ const SmartObject& pattern_object, SmartObject& result_object);
+
+ /**
+ * @brief Get value param, depends of children
+ *
+ * @return value of any parameter
+ */
+ virtual size_t GetMemberSize();
+
+ virtual ~ISchemaItem() { }
+};
+typedef utils::SharedPtr<ISchemaItem> ISchemaItemPtr;
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/include/smart_objects/schema_item_parameter.h b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
new file mode 100644
index 0000000000..7ae359b740
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/schema_item_parameter.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_PARAMETER_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_PARAMETER_H_
+
+#include "utils/macro.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief SchemaItem parameter.
+ * Container for schema item parameter such as min/max value, size,
+ * etc. which may be unspecified.
+ * @tparam ParameterType Type of a parameter.
+ */
+template<typename ParameterType>
+class TSchemaItemParameter FINAL {
+ public:
+ /**
+ * @brief Constructor.
+ * Initialize unspecified parameter.
+ **/
+ TSchemaItemParameter();
+ /**
+ * @brief Constructor.
+ * Initialize parameter with specified value.
+ * @param ParameterValue Value of a parameter.
+ **/
+ explicit TSchemaItemParameter(const ParameterType& ParameterValue);
+
+ /**
+ * @brief Get parameter value.
+ * Get the value of the parameter if it is specified.
+ * @param Value Reference to variable that must receive the
+ * value of the parameter. If parameter is not
+ * specified this variable is not modified.
+ * @return true if the parameter is specified and its value
+ * has been stored in Value variable, false otherwise.
+ **/
+ bool getValue(ParameterType& Value) const;
+
+ private:
+ /**
+ * @brief true if parameter is specified, false otherwise.
+ **/
+ const bool mIsSpecified;
+ /**
+ * @brief Parameter value.
+ **/
+ const ParameterType mValue;
+};
+
+template<typename ParameterType>
+TSchemaItemParameter<ParameterType>::TSchemaItemParameter()
+ : mIsSpecified(false),
+ mValue() {
+}
+
+template<typename ParameterType>
+TSchemaItemParameter<ParameterType>::TSchemaItemParameter(
+ const ParameterType& ParameterValue)
+ : mIsSpecified(true),
+ mValue(ParameterValue) {
+}
+
+template<typename ParameterType>
+bool TSchemaItemParameter<ParameterType>::getValue(ParameterType& Value) const {
+ if (mIsSpecified) {
+ Value = mValue;
+ }
+ return mIsSpecified;
+}
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_PARAMETER_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h
new file mode 100644
index 0000000000..6a2b7b7f4e
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -0,0 +1,952 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
+
+#include <set>
+#include <string>
+#include <vector>
+#include <map>
+
+#include "smart_objects/smart_schema.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+
+/**
+ * @brief Enumeration with all types, supported by SmartObject
+ **/
+enum SmartType {
+ /**
+ * @brief Null value. Act as initial value.
+ **/
+ SmartType_Null = 0,
+
+ /**
+ * @brief Boolean value.
+ **/
+ SmartType_Boolean = 1,
+
+ /**
+ * @brief Integer value.
+ **/
+ SmartType_Integer = 2,
+
+ /**
+ * @brief Character value.
+ **/
+ SmartType_Character = 3,
+
+ /**
+ * @brief String value.
+ **/
+ SmartType_String = 4,
+
+ /**
+ * @brief Double value.
+ **/
+ SmartType_Double = 5,
+
+ /**
+ * @brief Map value. Gives possibility for object to act like hashtable.
+ **/
+ SmartType_Map = 6,
+
+ /**
+ * @brief Array value. Gives possibility for object to act like array.
+ **/
+ SmartType_Array = 7,
+
+ /**
+ * @brief Binary data value. Gives possibility for object to store binary data.
+ **/
+ SmartType_Binary = 8,
+
+ /**
+ * @brief Invalid value. Represents invalid object that cannot change his type.
+ **/
+ SmartType_Invalid = -1
+};
+
+/**
+ * @brief SmartArray type
+ **/
+typedef std::vector<SmartObject> SmartArray;
+
+/**
+ * @brief SmartMap type
+ **/
+typedef std::map<std::string, SmartObject> SmartMap;
+
+/**
+ * @brief SmartBinary type
+ **/
+typedef std::vector<uint8_t> SmartBinary;
+
+/**
+ * @brief Main SmartObject class
+ *
+ * This class act as Variant type from other languages and can be used as primitive type
+ * like bool, int32_t, char, double, string and as complex type like array and map.
+ **/
+class SmartObject FINAL {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * Creates object with Null type.
+ **/
+ SmartObject();
+
+ /**
+ * @brief Copy constructor.
+ *
+ * @param Other Object to be copied from.
+ **/
+ SmartObject(const SmartObject& Other);
+
+ /**
+ * @brief Constructor for avoid cast
+ * from unknown type
+ *
+ * @param pointer
+ **/
+ template<typename UnknownType>
+ SmartObject(const UnknownType&);
+
+ /**
+ * @brief Constructor for creating object of given primitive type.
+ *
+ * Only primitive types (bool, int32_t, char, double, string) are supported.
+ *
+ * @param type Type of the created object.
+ **/
+ explicit SmartObject(SmartType Type);
+
+ /**
+ * @brief Destructor
+ *
+ **/
+ ~SmartObject();
+
+ /**
+ * @brief Assignment operator.
+ *
+ * @param Other Other SmartObject
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(const SmartObject& Other);
+
+ /**
+ * @brief Comparison operator
+ *
+ * @param Other Other SmartObject to be compared with
+ * @return bool Result of comparison
+ **/
+ bool operator==(const SmartObject& Other) const;
+
+ /**
+ * @name Support of type: int32_t
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: int32_t
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(int32_t InitialValue);
+
+ /**
+ * @brief Returns current object converted to int32_t
+ *
+ * @return int32_t
+ **/
+ int32_t asInt() const;
+
+ /**
+ * @brief Assignment operator for type: int32_t
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(int32_t NewValue);
+
+ /**
+ * @brief Comparison operator for comparing object with integer value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(int32_t Value) const;
+
+ // Support of type: uint32_t
+ /**
+ * @brief Constructor for creating object of type: int32_t
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(uint32_t InitialValue);
+
+ /**
+ * @brief Returns current object converted to uint32_t int32_t
+ *
+ * @return double
+ **/
+ uint32_t asUInt() const;
+
+ /**
+ * @brief Assignment operator for type: int32_t
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(uint32_t NewValue);
+
+ /**
+ * @brief Comparison operator for comparing object with uint32_t value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(uint32_t Value) const;
+
+ /**
+ * @name Support of type: int64_t
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: int64_t
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(int64_t InitialValue);
+
+ /**
+ * @brief Returns current object converted to int64_t
+ *
+ * @return int64_t
+ **/
+ int64_t asInt64() const;
+
+ /**
+ * @brief Assignment operator for type: int64_t
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(int64_t NewValue);
+
+ /**
+ * @brief Comparison operator for comparing object with integer value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(int64_t Value) const;
+
+ /** @} */
+
+ /**
+ * @name Support of type: double
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: double
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(double InitialValue);
+
+ /**
+ * @brief Returns current object converted to double
+ *
+ * @return double
+ **/
+ double asDouble() const;
+
+ /**
+ * @brief Assignment operator for type: double
+ *
+ * @param new_value New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(double new_value);
+
+ /**
+ * @brief Comparison operator for comparing object with double value
+ *
+ * @param new_value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(double new_value) const;
+ /** @} */
+
+ /**
+ * @name Support of type: bool
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: bool
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(bool InitialValue);
+
+ /**
+ * @brief Returns current object converted to bool
+ *
+ * @return bool
+ **/
+ bool asBool() const;
+
+ /**
+ * @brief Assignment operator for type: bool
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(bool NewValue);
+
+ /**
+ * @brief Comparison operator for comparing object with bool value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(bool Value) const;
+ /** @} */
+
+ /**
+ * @name Support of type: char
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: char
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(char InitialValue);
+
+ /**
+ * @brief Returns current object converted to char
+ *
+ * @return char
+ **/
+ char asChar() const;
+
+ /**
+ * @brief Assignment operator for type: char
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(char NewValue);
+
+ /**
+ * @brief Comparison operator for comparing object with char value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(char Value) const;
+ /** @} */
+
+ /**
+ * @name Support of type: string
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: string
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(const std::string& InitialValue);
+
+ /**
+ * @brief Constructor for creating object of type: string
+ *
+ * @param InitialValue Initial object value
+ **/
+ explicit SmartObject(const char* InitialValue);
+
+ /**
+ * @brief Returns current object converted to string
+ *
+ * @return std::string
+ **/
+ std::string asString() const;
+
+ /**
+ * @brief Returns char array from SmartObject data if exist. Otherwise returns
+ * empty string
+ *
+ * @return const char*
+ **/
+ const char* asCharArray() const;
+
+ /**
+ * @brief Assignment operator for type: string
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(const std::string& NewValue);
+
+ /**
+ * @brief Assignment operator for type: string
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(const char* NewValue);
+
+ /**
+ * @brief Comparison operator for comparing object with string value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(const std::string& Value) const;
+
+ /**
+ * @brief Comparison operator for comparing object with string value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(const char* Value) const;
+ /** @} */
+
+ /**
+ * @name Support of type: binary
+ * @{
+ */
+ /**
+ * @brief Constructor for creating object of type: binary
+ *
+ * @param InitialValue Initial binary value
+ **/
+ explicit SmartObject(const SmartBinary& InitialValue);
+
+ /**
+ * @brief Returns current object converted to binary
+ *
+ * @return SmartBinary
+ **/
+ SmartBinary asBinary() const;
+
+ /**
+ * @brief Returns current object converted to array
+ *
+ * @return SmartArray
+ **/
+ SmartArray* asArray() const;
+
+ /**
+ * @brief Assignment operator for type: binary
+ *
+ * @param NewValue New object value
+ * @return SmartObject&
+ **/
+ SmartObject& operator=(const SmartBinary&);
+
+ /**
+ * @brief Comparison operator for comparing object with binary value
+ *
+ * @param Value Value to compare object with
+ * @return bool
+ **/
+ bool operator==(const SmartBinary&) const;
+ /** @} */
+
+ /**
+ * @name Array interface support
+ * @{
+ */
+ /**
+ * @brief Support of array-like access
+ *
+ * @param Index index of element to return, on -1 create new element at end
+ * @return SmartObject&
+ **/
+ SmartObject& operator[](int32_t Index);
+ const SmartObject& operator[](int32_t Index) const;
+
+ /**
+ * @brief Get array element.
+ *
+ * This method does not automatically convert the object to an array or
+ * add elements. If this object is not an array or index is out of
+ * range then null object is returned.
+ *
+ * @param Index Index of an element.
+ *
+ * @return Element of array or null object if element can't be provided.
+ **/
+ const SmartObject& getElement(size_t Index) const;
+ /** @} */
+
+ /**
+ * @name Map/Hashtable interface support
+ * @{
+ */
+ /**
+ * @brief Support of map-like access
+ *
+ * @param Key Key of element to return
+ * @return SmartObject&
+ **/
+ SmartObject& operator[](const std::string& Key);
+ const SmartObject& operator[](const std::string& Key) const;
+
+ /**
+ * @brief Support of map-like access
+ *
+ * @param Key Key of element to return
+ * @return SmartObject&
+ **/
+ SmartObject& operator[](char* Key);
+ const SmartObject& operator[](char* Key) const;
+
+ /**
+ * @brief Support of map-like access
+ *
+ * @param Key Key of element to return
+ * @return SmartObject&
+ **/
+ SmartObject& operator[](const char* Key);
+
+ /**
+ * @brief Support of map-like access
+ *
+ * @param Key Key of element to return
+ * @return const SmartObject&
+ **/
+ const SmartObject& operator[](const char* Key) const;
+
+ /**
+ * @brief Get map element.
+ *
+ * This method does not automatically convert the object to a map or
+ * add elements. If this object is not a map or it does not contain
+ * key then invalid object is returned.
+ *
+ * @param Key Key of an element.
+ *
+ * @return Element of map or null object if element can't be provided.
+ **/
+ const SmartObject& getElement(const std::string& Key) const;
+
+ /**
+ * @brief Enumerates content of the object when it behaves like a map.
+ *
+ * @return Set of map keys or empty set if object has type other than map
+ **/
+ std::set<std::string> enumerate() const;
+
+ SmartMap::iterator map_begin() const {
+ DCHECK(m_type == SmartType_Map);
+ return m_data.map_value->begin();
+ }
+ SmartMap::iterator map_end() const {
+ DCHECK(m_type == SmartType_Map);
+ return m_data.map_value->end();
+ }
+
+ /**
+ * @brief Checks for key presense when object is behaves like a map
+ *
+ * @param Key Key to check presense for
+ * @return bool
+ **/
+ bool keyExists(const std::string& Key) const;
+
+ /**
+ * @brief Removes element from the map.
+ *
+ * @param Key Key of the element.
+ *
+ * @return true if success, false if there is no such element in the map
+ */
+ bool erase(const std::string& Key);
+ /** @} */
+
+ /**
+ * @name Validation and schema support
+ * @{
+ */
+ /**
+ * @brief Validates object according to attached schema.
+ *
+ * @return bolean validation result
+ **/
+ bool isValid() const;
+
+ /**
+ * @brief Validates object according to attached schema.
+ *
+ * @return Result of validation.
+ */
+ Errors::eType validate();
+
+ /**
+ * @brief Sets new schema
+ *
+ * @param schema Schema for object validation
+ * @return void
+ **/
+ void setSchema(const CSmartSchema& schema);
+
+ /**
+ * @brief Returns attached schema
+ *
+ * @return CSmartSchema
+ **/
+ CSmartSchema getSchema();
+
+ /**
+ * @brief Returns current object type
+ *
+ * @return NsSmartObjects::SmartType
+ **/
+ SmartType getType() const;
+
+ /**
+ * @brief Returns length of object
+ *
+ * If object has type string, array or map then method returns corresponded
+ * size. Otherwise returns zero.
+ *
+ * @return size_t Length of the object
+ **/
+ size_t length() const;
+
+ /**
+ * @brief Object string/array/map/binary empty state
+ *
+ * @return Returns object string/array/map/binary empty state
+ * or true on other object typed
+ **/
+ bool empty() const;
+
+ /**
+ * @brief Nequation template operator
+ *
+ * @param Other value to be compared with
+ * @return bool Result of nequation
+ **/
+ template<typename Type>
+ bool operator!=(const Type& Other) const {
+ return !(*this == Other);
+ }
+
+ protected:
+ static std::string OperatorToTransform(const SmartMap::value_type& pair);
+ /**
+ * @name Support of type: int32_t (internal)
+ * @{
+ */
+ /**
+ * @brief Sets new integer value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_integer(int64_t NewValue);
+
+ /**
+ * @brief Converts object to int32_t type
+ *
+ * @return int32_t Converted value or invalid_int_value if conversion not possible
+ **/
+ inline int64_t convert_int() const;
+ /** @} */
+
+ /**
+ * @name Support of type: char (internal)
+ * @{
+ */
+ /**
+ * @brief Sets new char value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_char(char NewValue);
+
+ /**
+ * @brief Converts object to char type
+ *
+ * @return int32_t Converted value or invalid_char_value if conversion not possible
+ **/
+ inline char convert_char() const;
+ /** @} */
+
+ /**
+ * @name Support of type: double (internal)
+ * @{
+ */
+ /**
+ * @brief Sets new double value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_double(double NewValue);
+
+ /**
+ * @brief Converts object to double type
+ *
+ * @return int32_t Converted value or invalid_double_value if conversion not possible
+ **/
+ inline double convert_double() const;
+ /** @} */
+
+ /**
+ * @name Support of type: bool (internal)
+ * @{
+ */
+ /**
+ * @brief Sets new bool value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_bool(bool NewValue);
+
+ /**
+ * @brief Converts object to bool type
+ *
+ * @return int32_t Converted value or invalid_bool_value if conversion not possible
+ **/
+ inline bool convert_bool() const;
+ /** @} */
+
+ /**
+ * @name Support of type: string (internal)
+ * @{
+ */
+ /**
+ * @brief Sets new string value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_string(const std::string& NewValue);
+
+ /**
+ * @brief Sets new string value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_cstr(const char* NewValue);
+
+ /**
+ * @brief Converts object to string type
+ *
+ * @return int32_t Converted value or invalid_string_value if conversion not possible
+ **/
+ inline std::string convert_string() const;
+ /** @} */
+
+ /**
+ * @name Support of type: binary (internal)
+ * @{
+ */
+ /**
+ * @brief Sets new binary value to the object.
+ *
+ * This method changes also internal object type
+ *
+ * @param NewValue New object value
+ * @return void
+ **/
+ inline void set_value_binary(const SmartBinary& NewValue);
+
+ /**
+ * @brief Converts object to binary type
+ *
+ * @return int32_t Converted value or invalid_binary_value if conversion not possible
+ **/
+ inline SmartBinary convert_binary() const;
+
+ /**
+ * @brief Returns SmartObject from internal array data by it's index
+ *
+ * @param Index Index of element to retrieve
+ * @return SmartObject&
+ **/
+ SmartObject& handle_array_access(const int32_t Index);
+
+ /**
+ * @brief Returns SmartObject from internal map data by it's key
+ *
+ * @param Key Key of element to retrieve
+ * @return SmartObject&
+ **/
+ inline SmartObject& handle_map_access(const std::string& Key);
+
+ /**
+ * @brief Converts string to double
+ *
+ * @param Value Pointer to string to convert
+ * @return double
+ **/
+ static double convert_string_to_double(const std::string* Value);
+
+ /**
+ * @brief Converts string to int64_t
+ *
+ * @param Value Pointer to string to convert
+ * @return int64_t int64_t
+ **/
+ static uint64_t convert_string_to_integer(const std::string* Value);
+
+ /**
+ * @brief Converts double value to string
+ *
+ * @param Value Value to be converted
+ * @return std::string
+ **/
+ static std::string convert_double_to_string(const double& Value);
+ /** @} */
+
+ /**
+ * @brief Duplicates another SmartObject
+ *
+ * After calling that function current SmartObject will have the same
+ * type, schema and data, as passed.
+ *
+ * @param OtherObject Object to be duplicated
+ * @return void
+ **/
+ void duplicate(const SmartObject& OtherObject);
+
+ /**
+ * @brief Cleans up internal data for some types (like string, array or map)
+ *
+ * @return void
+ **/
+ void cleanup_data();
+
+ /**
+ * @brief Sets new internal type and cleans up if it changes
+ *
+ * @param NewType New object type
+ * @return void
+ **/
+ void set_new_type(SmartType NewType);
+
+ /**
+ * @brief Current type of the object
+ **/
+ SmartType m_type;
+
+ /**
+ * @brief Union for holding actual internal object data
+ **/
+ typedef union {
+ double double_value;
+ bool bool_value;
+ char char_value;
+ int64_t int_value;
+ std::string* str_value;
+ SmartArray* array_value;
+ SmartMap* map_value;
+ SmartBinary* binary_value;
+ } SmartData;
+
+ /**
+ * @brief Current internal object data
+ **/
+ SmartData m_data;
+
+ /**
+ * @brief Validation schema, attached to the object
+ **/
+ CSmartSchema m_schema;
+};
+
+/**
+ * @brief Value that is used as invalid value for bool type
+ **/
+static const bool invalid_bool_value = false;
+
+/**
+ * @brief Value that is used as invalid value for int32_t type
+ **/
+static const int32_t invalid_int_value = -1;
+static const uint32_t invalid_unsigned_int_value = 0;
+static const int64_t invalid_int64_value = -1;
+
+/**
+ * @brief Value that is used as invalid value for char type
+ **/
+static const char invalid_char_value = 0;
+
+/**
+ * @brief Value that is used as invalid value for string type
+ **/
+static const std::string invalid_string_value = "";
+
+/**
+ * @brief Value that is used as invalid value for double type
+ **/
+static const double invalid_double_value = -1;
+
+/**
+ * @brief Value that is used as invalid value for object type
+ **/
+static SmartObject invalid_object_value(SmartType_Invalid);
+
+/**
+ * @brief Value that is used as invalid value for object type
+ **/
+static const SmartBinary invalid_binary_value;
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
new file mode 100644
index 0000000000..720bfc9012
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
+
+#include "utils/macro.h"
+#include "smart_objects/schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+class SmartObject;
+
+/**
+ * @brief Smart Schema.
+ */
+class CSmartSchema FINAL {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * Default constructor. Creates empty schema.
+ */
+ CSmartSchema();
+
+ /**
+ * @brief Constructor.
+ *
+ * Creates schema with given root schema item.
+ *
+ * @param SchemaItem Root schema item.
+ */
+ explicit CSmartSchema(const ISchemaItemPtr SchemaItem);
+
+ /**
+ * @brief Validate smart object.
+ *
+ * @param Object SmartObject to validate.
+ *
+ * @return Result of validation.
+ */
+ Errors::eType validate(const SmartObject& Object) const;
+
+ /**
+ * @brief Set new root schema item.
+ *
+ * @param SchemaItem Root schema item.
+ */
+ void setSchemaItem(const ISchemaItemPtr SchemaItem);
+
+ /**
+ * @brief Apply schema.
+ *
+ * @param Object Object to apply schema.
+ **/
+ void applySchema(SmartObject& Object);
+
+ /**
+ * @brief The reverse SmartObject conversion using schema.
+ *
+ * @param object Object to convert.
+ */
+ // TODO(cpplint): Is this a non-const reference?
+ // If so, make const or use a pointer.
+ void unapplySchema(SmartObject& object);
+
+ /**
+ * @brief Build smart object by smart schema having copied matched
+ * parameters from pattern smart object
+ *
+ * @param pattern_object pattern object
+ * @param result_object object to build
+ */
+ void BuildObjectBySchema(const SmartObject& pattern_object,
+ SmartObject& result_object) const;
+
+ protected:
+ /**
+ * @brief Root schema item.
+ */
+ ISchemaItemPtr mSchemaItem;
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_SCHEMA_H_
diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h
new file mode 100644
index 0000000000..dbcfcbf9f9
--- /dev/null
+++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_STRING_SCHEMA_ITEM_H_
+#define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_STRING_SCHEMA_ITEM_H_
+
+#include <stddef.h>
+#include <string>
+
+#include "utils/shared_ptr.h"
+
+#include "smart_objects/default_shema_item.h"
+#include "smart_objects/schema_item_parameter.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+/**
+ * @brief String schema item.
+ **/
+class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
+ public:
+ /**
+ * @brief Create a new schema item.
+ * @param MaxLength Maximum allowed string length.
+ * @param DefaultValue Default value.
+ * @return Shared pointer to a new schema item.
+ **/
+ static utils::SharedPtr<CStringSchemaItem> create(
+ const TSchemaItemParameter<size_t>& MinLength = TSchemaItemParameter<size_t>(),
+ const TSchemaItemParameter<size_t>& MaxLength = TSchemaItemParameter<size_t>(),
+ const TSchemaItemParameter<std::string>& DefaultValue =
+ TSchemaItemParameter<std::string>());
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object) OVERRIDE;
+
+ private:
+ /**
+ * @brief Constructor.
+ * @param MaxLength Maximum allowed string length.
+ * @param DefaultValue Default value.
+ **/
+ CStringSchemaItem(const TSchemaItemParameter<size_t>& MinLength,
+ const TSchemaItemParameter<size_t>& MaxLength,
+ const TSchemaItemParameter<std::string>& DefaultValue);
+ virtual SmartType getSmartType() const OVERRIDE;
+ virtual std::string getDefaultValue() const OVERRIDE;
+ /**
+ * @brief Minimum and Maximum allowed string length.
+ **/
+ const TSchemaItemParameter<size_t> mMinLength;
+ const TSchemaItemParameter<size_t> mMaxLength;
+ DISALLOW_COPY_AND_ASSIGN(CStringSchemaItem);
+};
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
+#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_STRING_SCHEMA_ITEM_H_
diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc
new file mode 100644
index 0000000000..d4313fb4c0
--- /dev/null
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "smart_objects/always_false_schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+CAlwaysFalseSchemaItem::CAlwaysFalseSchemaItem() {
+}
+
+utils::SharedPtr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
+ return new CAlwaysFalseSchemaItem();
+}
+
+Errors::eType CAlwaysFalseSchemaItem::validate(const SmartObject& object) {
+ return Errors::ERROR;
+}
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc
new file mode 100644
index 0000000000..8f77919443
--- /dev/null
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "smart_objects/always_true_schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+CAlwaysTrueSchemaItem::CAlwaysTrueSchemaItem() {
+}
+
+utils::SharedPtr<CAlwaysTrueSchemaItem> CAlwaysTrueSchemaItem::create() {
+ return new CAlwaysTrueSchemaItem();
+}
+
+Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object) {
+ return Errors::OK;
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
new file mode 100644
index 0000000000..a7c44bba3b
--- /dev/null
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -0,0 +1,109 @@
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "smart_objects/array_schema_item.h"
+#include "smart_objects/smart_object.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+utils::SharedPtr<CArraySchemaItem> CArraySchemaItem::create(
+ const ISchemaItemPtr ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize,
+ const TSchemaItemParameter<size_t>& MaxSize) {
+ return new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize);
+}
+
+Errors::eType CArraySchemaItem::validate(const SmartObject& Object) {
+ if (SmartType_Array != Object.getType()) {
+ return Errors::INVALID_VALUE;
+ }
+ size_t sizeLimit;
+ const size_t array_len = Object.length();
+
+ if (mMinSize.getValue(sizeLimit) && (array_len < sizeLimit)) {
+ return Errors::OUT_OF_RANGE;
+ }
+ if (mMaxSize.getValue(sizeLimit) && (array_len > sizeLimit)) {
+ return Errors::OUT_OF_RANGE;
+ }
+
+ for (size_t i = 0u; i < array_len; ++i) {
+ const Errors::eType result =
+ mElementSchemaItem->validate(Object.getElement(i));
+ if (Errors::OK != result) {
+ return result;
+ }
+ }
+ return Errors::OK;
+}
+
+void CArraySchemaItem::applySchema(SmartObject& Object) {
+ if (SmartType_Array == Object.getType()) {
+ for (size_t i = 0U; i < Object.length(); ++i) {
+ mElementSchemaItem->applySchema(Object[i]);
+ }
+ }
+}
+
+void CArraySchemaItem::unapplySchema(SmartObject& Object) {
+ if (SmartType_Array == Object.getType()) {
+ for (size_t i = 0U; i < Object.length(); ++i) {
+ mElementSchemaItem->unapplySchema(Object[i]);
+ }
+ }
+}
+
+void CArraySchemaItem::BuildObjectBySchema(
+ const SmartObject& pattern_object, SmartObject& result_object) {
+ if (SmartType_Array == pattern_object.getType()) {
+ const size_t array_len = pattern_object.length();
+ if (array_len > 0) {
+ for (size_t i = 0u; i < array_len; i++) {
+ mElementSchemaItem->BuildObjectBySchema(pattern_object.getElement(i),
+ result_object[i]);
+ }
+ return;
+ }
+ }
+ // empty array
+ result_object = SmartObject(SmartType_Array);
+}
+
+CArraySchemaItem::CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem,
+ const TSchemaItemParameter<size_t>& MinSize,
+ const TSchemaItemParameter<size_t>& MaxSize)
+ : mElementSchemaItem(ElementSchemaItem),
+ mMinSize(MinSize),
+ mMaxSize(MaxSize) {
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/bool_schema_item.cc b/src/components/smart_objects/src/bool_schema_item.cc
new file mode 100644
index 0000000000..845cf9f5cc
--- /dev/null
+++ b/src/components/smart_objects/src/bool_schema_item.cc
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/bool_schema_item.h"
+#include "smart_objects/smart_object.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+utils::SharedPtr<CBoolSchemaItem> CBoolSchemaItem::create(
+ const TSchemaItemParameter<bool> & DefaultValue) {
+ return new CBoolSchemaItem(DefaultValue);
+}
+
+CBoolSchemaItem::CBoolSchemaItem(
+ const TSchemaItemParameter<bool>& DefaultValue)
+ : CDefaultSchemaItem<bool>(DefaultValue) {
+}
+
+SmartType CBoolSchemaItem::getSmartType() const {
+ return SmartType_Boolean;
+}
+
+bool CBoolSchemaItem::getDefaultValue() const {
+ return false;
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/default_shema_item.cc b/src/components/smart_objects/src/default_shema_item.cc
new file mode 100644
index 0000000000..58fab34d5a
--- /dev/null
+++ b/src/components/smart_objects/src/default_shema_item.cc
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/default_shema_item.h"
diff --git a/src/components/smart_objects/src/enum_schema_item.cc b/src/components/smart_objects/src/enum_schema_item.cc
new file mode 100644
index 0000000000..28883232d5
--- /dev/null
+++ b/src/components/smart_objects/src/enum_schema_item.cc
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/enum_schema_item.h"
diff --git a/src/components/smart_objects/src/number_schema_item.cc b/src/components/smart_objects/src/number_schema_item.cc
new file mode 100644
index 0000000000..e3a85caadc
--- /dev/null
+++ b/src/components/smart_objects/src/number_schema_item.cc
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/number_schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+template<> SmartType TNumberSchemaItem<int32_t>::getSmartType() const {
+ return SmartType_Integer;
+}
+
+template<> SmartType TNumberSchemaItem<uint32_t>::getSmartType() const {
+ return SmartType_Integer;
+}
+
+template<> SmartType TNumberSchemaItem<int64_t>::getSmartType() const {
+ return SmartType_Integer;
+}
+
+template<> SmartType TNumberSchemaItem<double>::getSmartType() const {
+ return SmartType_Double;
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
new file mode 100644
index 0000000000..8f572e427d
--- /dev/null
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/object_schema_item.h"
+
+#include <algorithm>
+
+#include "smart_objects/always_false_schema_item.h"
+#include "smart_objects/smart_object.h"
+
+namespace {
+const char connection_key[] = "connection_key";
+const char binary_data[] = "binary_data";
+const char app_id[] = "appID";
+}
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+CObjectSchemaItem::SMember::SMember()
+ : mSchemaItem(CAlwaysFalseSchemaItem::create()),
+ mIsMandatory(true) {
+}
+
+CObjectSchemaItem::SMember::SMember(const ISchemaItemPtr SchemaItem,
+ const bool IsMandatory)
+ : mSchemaItem(SchemaItem),
+ mIsMandatory(IsMandatory) {
+}
+
+utils::SharedPtr<CObjectSchemaItem> CObjectSchemaItem::create(const Members& members) {
+ return new CObjectSchemaItem(members);
+}
+
+Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
+ if (SmartType_Map != object.getType()) {
+ return Errors::INVALID_VALUE;
+ }
+
+ std::set<std::string> object_keys = object.enumerate();
+
+ for (Members::const_iterator it = mMembers.begin(); it != mMembers.end(); ++it) {
+ const std::string& key = it->first;
+ const SMember& member = it->second;
+
+ std::set<std::string>::const_iterator key_it = object_keys.find(key);
+ if (object_keys.end() == key_it) {
+ if (member.mIsMandatory) {
+ return Errors::MISSING_MANDATORY_PARAMETER;
+ }
+ continue;
+ }
+ const SmartObject& field = object.getElement(key);
+ const Errors::eType result = member.mSchemaItem->validate(field);
+ if (Errors::OK != result) {
+ return result;
+ }
+ object_keys.erase(key_it);
+ }
+ return Errors::OK;
+}
+
+void CObjectSchemaItem::applySchema(SmartObject& Object) {
+ if (SmartType_Map != Object.getType()) {
+ return;
+ }
+
+ for (SmartMap::const_iterator it = Object.map_begin(); it != Object.map_end(); ) {
+ const std::string& key = it->first;
+ if (mMembers.end() == mMembers.find(key)
+ // FIXME(EZamakhov): Remove illegal usage of filed in AM
+ && key.compare(connection_key) != 0
+ && key.compare(binary_data) != 0
+ && key.compare(app_id) != 0
+ ) {
+ ++it;
+ // FIXME(DK): remove fake params. There are error responses with params
+ // Object.erase(key);
+ } else {
+ it++;
+ }
+ }
+
+ SmartObject default_value;
+ for (Members::const_iterator it = mMembers.begin(); it != mMembers.end(); ++it) {
+ const std::string& key = it->first;
+ const SMember& member = it->second;
+ if (!Object.keyExists(key)) {
+ if (member.mSchemaItem->setDefaultValue(default_value)) {
+ Object[key] = default_value;
+ member.mSchemaItem->applySchema(Object[key]);
+ }
+ } else {
+ member.mSchemaItem->applySchema(Object[key]);
+ }
+ }
+}
+
+void CObjectSchemaItem::unapplySchema(SmartObject& Object) {
+ if (SmartType_Map != Object.getType()) {
+ return;
+ }
+ for (SmartMap::const_iterator it = Object.map_begin();
+ it != Object.map_end();) {
+ const std::string& key = it->first;
+ // move next to avoid wrong iterator on erase
+ ++it;
+ if (mMembers.end() == mMembers.find(key)) {
+ // remove fake params
+ Object.erase(key);
+ }
+ }
+
+ for (Members::const_iterator it = mMembers.begin(); it != mMembers.end(); ++it) {
+ const std::string& key = it->first;
+ const SMember& member = it->second;
+ if (Object.keyExists(key)) {
+ member.mSchemaItem->unapplySchema(Object[key]);
+ }
+ }
+}
+
+void CObjectSchemaItem::BuildObjectBySchema(
+ const SmartObject& pattern_object, SmartObject& result_object) {
+ result_object = SmartObject(SmartType_Map);
+ const bool pattern_is_map = SmartType_Map == pattern_object.getType();
+
+ for (Members::const_iterator it = mMembers.begin(); it != mMembers.end(); ++it) {
+ const std::string& key = it->first;
+ const SMember& member = it->second;
+ const bool pattern_exists = pattern_is_map && pattern_object.keyExists(key);
+ member.mSchemaItem->BuildObjectBySchema(
+ pattern_exists ? pattern_object.getElement(key) : SmartObject(),
+ result_object[key]);
+ }
+}
+
+size_t CObjectSchemaItem::GetMemberSize() {
+ return mMembers.size();
+}
+
+CObjectSchemaItem::CObjectSchemaItem(const Members& members)
+ : mMembers(members) {}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
new file mode 100644
index 0000000000..b75e5a35ea
--- /dev/null
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "smart_objects/schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+Errors::eType ISchemaItem::validate(const SmartObject& object) {
+ return Errors::ERROR;
+}
+
+bool ISchemaItem::setDefaultValue(SmartObject& Object) {
+ return false;
+}
+
+bool ISchemaItem::hasDefaultValue(SmartObject& Object) {
+ return false;
+}
+
+void ISchemaItem::applySchema(SmartObject& Object) {
+}
+
+void ISchemaItem::unapplySchema(SmartObject& Object) {
+}
+
+void ISchemaItem::BuildObjectBySchema(const SmartObject& pattern_object,
+ SmartObject& result_object) {
+}
+
+size_t ISchemaItem::GetMemberSize() {
+ return 0;
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
new file mode 100644
index 0000000000..264652e448
--- /dev/null
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -0,0 +1,880 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "smart_objects/smart_object.h"
+
+#include <errno.h>
+#include <inttypes.h>
+#include <limits>
+#include <stdlib.h>
+#include <algorithm>
+#include <sstream>
+#include <iomanip>
+#include <iterator>
+#include <limits>
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+/**
+ * @brief Value that is used as invalid value for string type
+ **/
+static const char* invalid_cstr_value = "";
+
+SmartObject::SmartObject()
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+}
+
+SmartObject::SmartObject(const SmartObject& Other)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ duplicate(Other);
+}
+
+SmartObject::SmartObject(SmartType Type)
+ : m_type(SmartType_Null),
+ m_schema() {
+ switch (Type) {
+ case SmartType_Null:
+ break;
+ case SmartType_Integer:
+ set_value_integer(0);
+ break;
+ case SmartType_Double:
+ set_value_double(0);
+ break;
+ case SmartType_Boolean:
+ set_value_bool(false);
+ break;
+ case SmartType_Character:
+ set_value_char(' ');
+ break;
+ case SmartType_String:
+ set_value_string("");
+ break;
+ case SmartType_Map:
+ m_data.map_value = new SmartMap();
+ m_type = SmartType_Map;
+ break;
+ case SmartType_Array:
+ m_data.array_value = new SmartArray();
+ m_type = SmartType_Array;
+ break;
+ case SmartType_Binary:
+ set_value_binary(SmartBinary());
+ break;
+ case SmartType_Invalid:
+ m_type = SmartType_Invalid;
+ break;
+ default:
+ DCHECK(!"Unhandled smart object type");
+ break;
+ }
+}
+
+SmartObject::~SmartObject() {
+ cleanup_data();
+}
+
+SmartObject& SmartObject::operator=(const SmartObject& Other) {
+ if (this != &Other)
+ duplicate(Other);
+ return *this;
+}
+
+bool SmartObject::operator==(const SmartObject& Other) const {
+ if (m_type != Other.m_type)
+ return false;
+
+ switch (m_type) {
+ case SmartType_Integer:
+ return m_data.int_value == Other.m_data.int_value;
+ case SmartType_Double:
+ return m_data.double_value == Other.m_data.double_value;
+ case SmartType_Boolean:
+ return m_data.bool_value == Other.m_data.bool_value;
+ case SmartType_Character:
+ return m_data.char_value == Other.m_data.char_value;
+ case SmartType_String:
+ return *(m_data.str_value) == *(Other.m_data.str_value);
+ case SmartType_Map: {
+ if (m_data.map_value == Other.m_data.map_value)
+ return true;
+ if (m_data.map_value->size() != Other.m_data.map_value->size())
+ return false;
+ return std::equal(m_data.map_value->begin(), m_data.map_value->end(),
+ Other.m_data.map_value->begin());
+ }
+ case SmartType_Array: {
+ if (m_data.array_value == Other.m_data.array_value)
+ return true;
+ if (m_data.array_value->size() != Other.m_data.array_value->size())
+ return false;
+ return std::equal(m_data.array_value->begin(), m_data.array_value->end(),
+ Other.m_data.array_value->begin());
+ }
+ case SmartType_Binary: {
+ if (m_data.binary_value == Other.m_data.binary_value)
+ return true;
+ if (m_data.array_value->size() != Other.m_data.array_value->size())
+ return false;
+ return std::equal(m_data.binary_value->begin(),
+ m_data.binary_value->end(),
+ Other.m_data.binary_value->begin());
+ }
+ case SmartType_Null:
+ return true;
+ case SmartType_Invalid:
+ return true;
+ default:
+ DCHECK(!"Unhandled smart object type");
+ break;
+ }
+ return false;
+}
+
+// =============================================================
+// INTEGER TYPE SUPPORT
+// =============================================================
+SmartObject::SmartObject(int32_t InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_integer(InitialValue);
+}
+
+int32_t SmartObject::asInt() const {
+ const int64_t convert = convert_int();
+ if (invalid_int64_value == convert) {
+ return invalid_int_value;
+ }
+ DCHECK(convert >= std::numeric_limits<int32_t>::min());
+ DCHECK(convert <= std::numeric_limits<int32_t>::max());
+ return static_cast<int32_t>(convert);
+}
+
+SmartObject& SmartObject::operator=(const int32_t NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_integer(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const int32_t Value) const {
+ const int64_t comp = convert_int();
+ if (comp == invalid_int64_value) {
+ return false;
+ }
+ return comp == static_cast<int64_t>(Value);
+}
+
+void SmartObject::set_value_integer(int64_t NewValue) {
+ set_new_type(SmartType_Integer);
+ m_data.int_value = NewValue;
+}
+
+int64_t SmartObject::convert_int() const {
+ switch (m_type) {
+ case SmartType_String:
+ return convert_string_to_integer(m_data.str_value);
+ case SmartType_Boolean:
+ return (m_data.bool_value == true) ? 1 : 0;
+ case SmartType_Integer:
+ return m_data.int_value;
+ case SmartType_Double:
+ return static_cast<int64_t>(m_data.double_value);
+ default:
+ break;
+ }
+ return invalid_int64_value;
+}
+
+// =============================================================
+// uint32_t TYPE SUPPORT
+// =============================================================
+SmartObject::SmartObject(uint32_t InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_integer(InitialValue);
+}
+
+uint32_t SmartObject::asUInt() const {
+ const int64_t convert = convert_int();
+ if (invalid_int64_value == convert) {
+ return invalid_unsigned_int_value;
+ }
+ DCHECK(convert >= std::numeric_limits<uint32_t>::min());
+ DCHECK(convert <= std::numeric_limits<uint32_t>::max());
+ return static_cast<uint32_t>(convert);
+}
+
+SmartObject& SmartObject::operator=(const uint32_t NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_integer(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const uint32_t Value) const {
+ const int64_t comp = convert_int();
+ if (comp == invalid_int_value) {
+ return false;
+ }
+ return comp == static_cast<int64_t>(Value);
+}
+
+// =============================================================
+// int64_t TYPE SUPPORT
+// =============================================================
+SmartObject::SmartObject(int64_t InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_integer(InitialValue);
+}
+
+int64_t SmartObject::asInt64() const {
+ return convert_int();
+}
+
+SmartObject& SmartObject::operator=(const int64_t NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_integer(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const int64_t Value) const {
+ const int64_t comp = convert_int();
+ if (comp == invalid_int_value) {
+ return false;
+ }
+ return comp == Value;
+}
+
+// =============================================================
+// DOUBLE TYPE SUPPORT
+// =============================================================
+SmartObject::SmartObject(double InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_double(InitialValue);
+}
+
+double SmartObject::asDouble() const {
+ return convert_double();
+}
+
+SmartObject& SmartObject::operator=(const double NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_double(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const double Value) const {
+ const double comp = convert_double();
+ if (comp == invalid_double_value) {
+ return false;
+ }
+ return comp == Value;
+}
+
+void SmartObject::set_value_double(const double NewValue) {
+ set_new_type(SmartType_Double);
+ m_data.double_value = NewValue;
+}
+
+double SmartObject::convert_double() const {
+ switch (m_type) {
+ case SmartType_String:
+ return convert_string_to_double(m_data.str_value);
+ case SmartType_Boolean:
+ return (m_data.bool_value) ? 1.0 : 0.0;
+ case SmartType_Integer:
+ return static_cast<double>(convert_int());
+ case SmartType_Double:
+ return m_data.double_value;
+ default:
+ break;
+ }
+ return invalid_double_value;
+}
+
+// =============================================================
+// BOOL TYPE SUPPORT
+// =============================================================
+
+SmartObject::SmartObject(bool InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_bool(InitialValue);
+}
+
+bool SmartObject::asBool() const {
+ return convert_bool();
+}
+
+SmartObject& SmartObject::operator=(const bool NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_bool(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const bool Value) const {
+ bool comp = convert_bool();
+ // FIXME(EZamakhov): invalide bool?
+ if (comp == invalid_bool_value) {
+ return false;
+ }
+ return comp == Value;
+}
+
+void SmartObject::set_value_bool(bool NewValue) {
+ set_new_type(SmartType_Boolean);
+ m_data.bool_value = NewValue;
+}
+
+bool SmartObject::convert_bool() const {
+ switch (m_type) {
+ case SmartType_Boolean:
+ return m_data.bool_value;
+ case SmartType_Integer:
+ return (m_data.int_value != 0);
+ case SmartType_Double:
+ return (m_data.double_value != 0.0);
+ default:
+ break;
+ }
+ return invalid_bool_value;
+}
+
+// =============================================================
+// CHAR TYPE SUPPORT
+// =============================================================
+
+SmartObject::SmartObject(char InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_char(InitialValue);
+}
+
+char SmartObject::asChar() const {
+ return convert_char();
+}
+
+SmartObject& SmartObject::operator=(const char NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_char(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const char Value) const {
+ const char comp = convert_char();
+ if (comp == invalid_char_value) {
+ return false;
+ }
+ return comp == Value;
+}
+
+void SmartObject::set_value_char(char NewValue) {
+ set_new_type(SmartType_Character);
+ m_data.char_value = NewValue;
+}
+
+char SmartObject::convert_char() const {
+ switch (m_type) {
+ case SmartType_String:
+ return
+ (m_data.str_value->length() == 1) ?
+ m_data.str_value->at(0) : invalid_char_value;
+ case SmartType_Character:
+ return m_data.char_value;
+ default:
+ break;
+ }
+ return invalid_char_value;
+}
+
+// =============================================================
+// STD::STRING TYPE SUPPORT
+// =============================================================
+
+SmartObject::SmartObject(const std::string& InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_string(InitialValue);
+}
+
+std::string SmartObject::asString() const {
+ return convert_string();
+}
+
+const char* SmartObject::asCharArray() const {
+ if (m_data.str_value != NULL) {
+ return m_data.str_value->c_str();
+ }
+ return "";
+}
+
+SmartObject& SmartObject::operator=(const std::string& NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_string(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const std::string& Value) const {
+ const std::string comp = convert_string();
+ if (comp == invalid_string_value) {
+ return false;
+ }
+ return comp == Value;
+}
+
+void SmartObject::set_value_string(const std::string& NewValue) {
+ set_new_type(SmartType_String);
+ m_data.str_value = new std::string(NewValue);
+}
+
+std::string SmartObject::convert_string() const {
+ switch (m_type) {
+ case SmartType_String:
+ return *(m_data.str_value);
+ case SmartType_Integer: {
+ std::stringstream stream;
+ stream << m_data.int_value;
+ return stream.str();
+ }
+ case SmartType_Character:
+ return std::string(1, m_data.char_value);
+ case SmartType_Double:
+ return convert_double_to_string(m_data.double_value);
+ default:
+ break;
+ }
+ return NsSmartDeviceLink::NsSmartObjects::invalid_cstr_value;
+}
+
+// =============================================================
+// CHAR* TYPE SUPPORT
+// =============================================================
+
+SmartObject::SmartObject(const char* const InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_cstr(InitialValue);
+ return;
+}
+
+SmartObject& SmartObject::operator=(const char* NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_cstr(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const char* Value) const {
+ const std::string comp = convert_string();
+ if (comp == invalid_string_value) {
+ return false;
+ }
+ return (0 == comp.compare(Value));
+}
+
+void SmartObject::set_value_cstr(const char* NewValue) {
+ set_value_string(NewValue ? std::string(NewValue) : std::string());
+}
+
+// =============================================================
+// BINARY TYPE SUPPORT
+// =============================================================
+SmartObject::SmartObject(const SmartBinary& InitialValue)
+ : m_type(SmartType_Null),
+ m_schema() {
+ m_data.str_value = NULL;
+ set_value_binary(InitialValue);
+}
+
+SmartBinary SmartObject::asBinary() const {
+ return convert_binary();
+}
+
+SmartArray* SmartObject::asArray() const {
+ if (m_type != SmartType_Array) {
+ return NULL;
+ }
+ return m_data.array_value;
+}
+
+SmartObject& SmartObject::operator=(const SmartBinary& NewValue) {
+ if (m_type != SmartType_Invalid) {
+ set_value_binary(NewValue);
+ }
+ return *this;
+}
+
+bool SmartObject::operator==(const SmartBinary& Value) const {
+ const SmartBinary comp = convert_binary();
+ if (comp == invalid_binary_value) {
+ return false;
+ }
+ if (comp.size() != Value.size())
+ return false;
+ return std::equal(comp.begin(), comp.end(), Value.begin());
+}
+
+void SmartObject::set_value_binary(const SmartBinary& NewValue) {
+ set_new_type(SmartType_Binary);
+ m_data.binary_value = new SmartBinary(NewValue);
+}
+
+SmartBinary SmartObject::convert_binary() const {
+ switch (m_type) {
+ case SmartType_Binary:
+ return *(m_data.binary_value);
+ default:
+ break;
+ }
+ return invalid_binary_value;
+}
+
+// =============================================================
+// ARRAY INTERFACE SUPPORT
+// =============================================================
+
+SmartObject& SmartObject::operator[](const int32_t Index) {
+ return handle_array_access(Index);
+}
+
+const SmartObject& SmartObject::operator[](const int32_t Index) const {
+ return getElement(Index);
+}
+
+inline SmartObject& SmartObject::handle_array_access(const int32_t Index) {
+ if (m_type == SmartType_Invalid) {
+ return *this;
+ }
+
+ if (m_type != SmartType_Array) {
+ cleanup_data();
+ m_type = SmartType_Array;
+ m_data.array_value = new SmartArray();
+ }
+ SmartArray& array = *m_data.array_value;
+ if (Index == -1 || static_cast<size_t>(Index) == array.size()) {
+ array.push_back(SmartObject());
+ return array[array.size() - 1];
+ }
+ if (Index >= 0 && (static_cast<size_t>(Index) < array.size())) {
+ DCHECK(sizeof(Index) <= sizeof(array.size()));
+ return array[Index];
+ }
+ // FIXME(EZamakhov): return always the same reference - multi-thread problem?
+ return invalid_object_value;
+}
+
+// =============================================================
+// MAP INTERFACE SUPPORT
+// =============================================================
+
+SmartObject& SmartObject::operator[](const std::string& Key) {
+ return handle_map_access(Key);
+}
+
+const SmartObject& SmartObject::operator[] (const std::string& Key) const {
+ return getElement(Key);
+}
+
+SmartObject& SmartObject::operator[](char* Key) {
+ return handle_map_access(std::string(Key));
+}
+
+const SmartObject& SmartObject::operator[](char* Key) const {
+ return getElement(std::string(Key));
+}
+
+SmartObject& SmartObject::operator[](const char* Key) {
+ return handle_map_access(std::string(Key));
+}
+
+const SmartObject& SmartObject::operator[](const char* Key) const {
+ return getElement(std::string(Key));
+}
+
+const SmartObject& SmartObject::getElement(size_t Index) const {
+ if (SmartType_Array == m_type) {
+ if (Index < m_data.array_value->size()) {
+ return m_data.array_value->at(Index);
+ }
+ }
+ return invalid_object_value;
+}
+
+const SmartObject& SmartObject::getElement(const std::string& Key) const {
+ if (SmartType_Map == m_type) {
+ SmartMap::const_iterator it = m_data.map_value->find(Key);
+ if (it != m_data.map_value->end()) {
+ return it->second;
+ }
+ }
+ return invalid_object_value;
+}
+
+SmartObject& SmartObject::handle_map_access(const std::string& Key) {
+ if (m_type == SmartType_Invalid) {
+ return *this;
+ }
+
+ if (m_type != SmartType_Map) {
+ cleanup_data();
+ m_type = SmartType_Map;
+ m_data.map_value = new SmartMap();
+ }
+ SmartMap& map = *m_data.map_value;
+
+ return map[Key];
+}
+
+// =============================================================
+// OTHER METHODS
+// =============================================================
+void SmartObject::duplicate(const SmartObject& OtherObject) {
+ SmartData newData;
+ const SmartType newType = OtherObject.m_type;
+ switch (newType) {
+ case SmartType_Null: // on duplicate empty SmartObject
+ return;
+ case SmartType_Map:
+ newData.map_value = new SmartMap(*OtherObject.m_data.map_value);
+ break;
+ case SmartType_Array:
+ newData.array_value = new SmartArray(*OtherObject.m_data.array_value);
+ break;
+ case SmartType_Integer:
+ newData.int_value = OtherObject.m_data.int_value;
+ break;
+ case SmartType_Double:
+ newData.double_value = OtherObject.m_data.double_value;
+ break;
+ case SmartType_Boolean:
+ newData.bool_value = OtherObject.m_data.bool_value;
+ break;
+ case SmartType_Character:
+ newData.char_value = OtherObject.m_data.char_value;
+ break;
+ case SmartType_String:
+ newData.str_value = new std::string(*OtherObject.m_data.str_value);
+ break;
+ case SmartType_Binary:
+ newData.binary_value = new SmartBinary(*OtherObject.m_data.binary_value);
+ break;
+ default:
+ DCHECK(!"Unhandled smart object type");
+ return;
+ }
+ m_schema = OtherObject.m_schema;
+
+ cleanup_data();
+
+ m_type = newType;
+ m_data = newData;
+}
+
+void SmartObject::cleanup_data() {
+ switch (m_type) {
+ case SmartType_String:
+ delete m_data.str_value;
+ break;
+ case SmartType_Map:
+ delete m_data.map_value;
+ break;
+ case SmartType_Array:
+ delete m_data.array_value;
+ break;
+ case SmartType_Binary:
+ delete m_data.binary_value;
+ break;
+ default:
+ break;
+ }
+}
+
+size_t SmartObject::length() const {
+ switch (m_type) {
+ case SmartType_String:
+ return m_data.str_value->size();
+ case SmartType_Array:
+ return m_data.array_value->size();
+ case SmartType_Map:
+ return m_data.map_value->size();
+ case SmartType_Binary:
+ return m_data.binary_value->size();
+ default:
+ break;
+ }
+ return 0;
+}
+
+bool SmartObject::empty() const {
+ switch (m_type) {
+ case SmartType_String:
+ return m_data.str_value->empty();
+ case SmartType_Array:
+ return m_data.array_value->empty();
+ case SmartType_Map:
+ return m_data.map_value->empty();
+ case SmartType_Binary:
+ return m_data.binary_value->empty();
+ default:
+ break;
+ }
+ return true;
+}
+
+void SmartObject::set_new_type(SmartType NewType) {
+ cleanup_data();
+ m_type = NewType;
+}
+
+double SmartObject::convert_string_to_double(const std::string* Value) {
+ if (!Value || Value->empty()) {
+ return invalid_double_value;
+ }
+
+ char* ptr;
+ errno = 0;
+
+ double result = strtod(Value->c_str(), &ptr);
+ if (errno || (ptr != (Value->c_str() + Value->length()))) {
+ return invalid_double_value;
+ }
+
+ return result;
+}
+
+std::string SmartObject::convert_double_to_string(const double& Value) {
+ std::stringstream ss;
+
+ // convert double to string w fixed notation, hi precision
+ ss << std::fixed << std::setprecision(10) << Value;
+
+ // output to std::string
+ std::string s = ss.str();
+
+ // remove trailing 000s (123.1200 => 123.12, 123.000 => 123.)
+ s.erase(s.find_last_not_of('0') + 1, std::string::npos);
+ if (s[s.size() - 1] == '.') {
+ // remove dangling decimal (123. => 123)
+ s.erase(s.end() - 1);
+ }
+ return s;
+}
+
+uint64_t SmartObject::convert_string_to_integer(const std::string* Value) {
+ if (!Value || Value->empty()) {
+ return invalid_int64_value;
+ }
+ int64_t result;
+ std::stringstream stream(*Value);
+ stream >> result;
+ if (stream.eof()) {
+ return result;
+ }
+ return invalid_int64_value;
+}
+
+SmartType SmartObject::getType() const {
+ return m_type;
+}
+
+std::string SmartObject::OperatorToTransform(const SmartMap::value_type &pair) {
+ return pair.first;
+}
+
+std::set<std::string> SmartObject::enumerate() const {
+ std::set<std::string> keys;
+
+ if (m_type == SmartType_Map) {
+ std::transform(
+ m_data.map_value->begin(),
+ m_data.map_value->end(),
+ std::inserter(keys, keys.end()),
+ &SmartObject::OperatorToTransform
+ );
+ }
+ return keys;
+}
+
+bool SmartObject::keyExists(const std::string& Key) const {
+ if (m_type != SmartType_Map) {
+ return false;
+ }
+ return m_data.map_value->find(Key) != m_data.map_value->end();
+}
+
+bool SmartObject::erase(const std::string& Key) {
+ if (m_type != SmartType_Map) {
+ return false;
+ }
+ return (m_data.map_value->erase(Key) > 0);
+}
+
+bool SmartObject::isValid() const {
+ return (Errors::OK == m_schema.validate(*this));
+}
+
+Errors::eType SmartObject::validate() {
+ return m_schema.validate(*this);
+}
+
+void SmartObject::setSchema(const CSmartSchema& schema) {
+ m_schema = schema;
+}
+
+CSmartSchema SmartObject::getSchema() {
+ return m_schema;
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
new file mode 100644
index 0000000000..36c153332a
--- /dev/null
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/smart_schema.h"
+#include "smart_objects/always_true_schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+CSmartSchema::CSmartSchema()
+ : mSchemaItem(CAlwaysTrueSchemaItem::create()) {
+}
+
+CSmartSchema::CSmartSchema(const ISchemaItemPtr SchemaItem)
+ : mSchemaItem(SchemaItem) {
+}
+
+Errors::eType CSmartSchema::validate(const SmartObject& object) const {
+ return mSchemaItem->validate(object);
+}
+
+void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
+ mSchemaItem = schemaItem;
+}
+
+void CSmartSchema::applySchema(SmartObject& Object) {
+ mSchemaItem->applySchema(Object);
+}
+
+void CSmartSchema::unapplySchema(SmartObject& Object) {
+ mSchemaItem->unapplySchema(Object);
+}
+
+void CSmartSchema::BuildObjectBySchema(const SmartObject& pattern_object,
+ SmartObject& result_object) const {
+ mSchemaItem->BuildObjectBySchema(pattern_object, result_object);
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
new file mode 100644
index 0000000000..c9c00e8896
--- /dev/null
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "smart_objects/smart_object.h"
+#include "smart_objects/string_schema_item.h"
+
+namespace NsSmartDeviceLink {
+namespace NsSmartObjects {
+
+utils::SharedPtr<CStringSchemaItem> CStringSchemaItem::create(
+ const TSchemaItemParameter<size_t>& MinLength,
+ const TSchemaItemParameter<size_t>& MaxLength,
+ const TSchemaItemParameter<std::string>& DefaultValue) {
+ return new CStringSchemaItem(MinLength, MaxLength, DefaultValue);
+}
+
+Errors::eType CStringSchemaItem::validate(const SmartObject& Object) {
+ if (SmartType_String != Object.getType()) {
+ return Errors::INVALID_VALUE;
+ }
+
+ const std::string value = Object.asString();
+ size_t length;
+
+ if (mMinLength.getValue(length) && (value.size() < length)) {
+ return Errors::OUT_OF_RANGE;
+ }
+ if (mMaxLength.getValue(length) && (value.size() > length)) {
+ return Errors::OUT_OF_RANGE;
+ }
+ return Errors::OK;
+}
+
+SmartType CStringSchemaItem::getSmartType() const {
+ return SmartType_String;
+}
+
+std::string CStringSchemaItem::getDefaultValue() const {
+ return std::string("");
+}
+
+CStringSchemaItem::CStringSchemaItem(
+ const TSchemaItemParameter<size_t>& MinLength,
+ const TSchemaItemParameter<size_t>& MaxLength,
+ const TSchemaItemParameter<std::string>& DefaultValue)
+ : CDefaultSchemaItem<std::string>(DefaultValue),
+ mMinLength(MinLength),
+ mMaxLength(MaxLength) {
+}
+
+} // namespace NsSmartObjects
+} // namespace NsSmartDeviceLink
diff --git a/src/components/time_tester/CMakeLists.txt b/src/components/time_tester/CMakeLists.txt
new file mode 100644
index 0000000000..df84bffb12
--- /dev/null
+++ b/src/components/time_tester/CMakeLists.txt
@@ -0,0 +1,30 @@
+include_directories (
+ ./include/time_tester
+ ../utils/include/
+ ../protocol_handler/include/
+ ../connection_handler/include/
+ ../transport_manager/include/
+ ../application_manager/include/
+ ../hmi_message_handler/include/
+ ../formatters/include/
+ ../media_manager/include/
+ ../smart_objects/include/
+ ../config_profile/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ ./src/metric_wrapper.cc
+ ./src/time_manager.cc
+ ./src/application_manager_observer.cc
+ ./src/transport_manager_observer.cc
+ ./src/protocol_handler_observer.cc
+ ./src/application_manager_metric.cc
+ ./src/transport_manager_metric.cc
+ ./src/protocol_handler_metric.cc
+)
+
+add_library("TimeTester" ${SOURCES})
+target_link_libraries("TimeTester" ${LIBRARIES})
diff --git a/src/components/time_tester/include/time_tester/application_manager_metric.h b/src/components/time_tester/include/time_tester/application_manager_metric.h
new file mode 100644
index 0000000000..1c21c0f722
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/application_manager_metric.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_MECTRIC_WRAPPER_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_MECTRIC_WRAPPER_H_
+
+#include <string>
+
+#include "metric_wrapper.h"
+#include "application_manager_observer.h"
+
+
+namespace time_tester {
+
+class ApplicationManagerObserver;
+
+class ApplicationManagerMetricWrapper: public MetricWrapper {
+
+ public:
+ utils::SharedPtr<application_manager::AMMetricObserver::MessageMetric> message_metric;
+
+ protected:
+ virtual Json::Value GetJsonMetric();
+};
+
+}
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_MECTRIC_WRAPPER_H_
diff --git a/src/components/time_tester/include/time_tester/application_manager_observer.h b/src/components/time_tester/include/time_tester/application_manager_observer.h
new file mode 100644
index 0000000000..8331682ecd
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/application_manager_observer.h
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_OBSERVER_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_OBSERVER_H_
+
+#include "utils/message_queue.h"
+#include "application_manager/time_metric_observer.h"
+#include "application_manager_metric.h"
+
+
+namespace time_tester {
+
+class TimeManager;
+
+class ApplicationManagerObserver: public application_manager::AMMetricObserver {
+ public:
+ explicit ApplicationManagerObserver(TimeManager* time_manager);
+ virtual void OnMessage(utils::SharedPtr<MessageMetric> metric);
+
+ private:
+ TimeManager* time_manager_;
+};
+
+}
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_APPLICATION_MANAGER_OBSERVER_H_
diff --git a/src/components/time_tester/include/time_tester/json_keys.h b/src/components/time_tester/include/time_tester/json_keys.h
new file mode 100644
index 0000000000..d1ace3f9d4
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/json_keys.h
@@ -0,0 +1,52 @@
+/**
+ *
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_JSON_KEYS_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_JSON_KEYS_H_
+
+namespace time_tester {
+ namespace strings {
+ const char logger[] = "logger";
+ const char begin[] = "begin";
+ const char end[] = "end";
+ const char data_size[] = "data_size";
+ const char message_id[] = "message_id";
+ const char session_id[] = "session_id";
+ const char correlation_id[] = "correlation_id";
+ const char connection_key[] = "connection_key";
+ const char stime[] = "stime";
+ const char utime[] = "utime";
+ const char memory[] = "RAM";
+ }
+}
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_JSON_KEYS_H_
diff --git a/src/components/time_tester/include/time_tester/metric_wrapper.h b/src/components/time_tester/include/time_tester/metric_wrapper.h
new file mode 100644
index 0000000000..a1867824d4
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/metric_wrapper.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_MECTRIC_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_MECTRIC_H_
+
+#include <string>
+#include "utils/resource_usage.h"
+#include "json/json.h"
+
+namespace time_tester {
+
+class MetricWrapper {
+ utils::ResourseUsage* resources;
+ public:
+ MetricWrapper();
+ /*
+ * @brief get current cpu and memory info and store it as member
+ */
+ bool grabResources();
+ virtual std::string GetStyledString();
+ virtual ~MetricWrapper();
+ protected:
+ virtual Json::Value GetJsonMetric();
+ void Clear();
+};
+
+
+} // namespace time_tester
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_MECTRIC_H_
diff --git a/src/components/time_tester/include/time_tester/protocol_handler_metric.h b/src/components/time_tester/include/time_tester/protocol_handler_metric.h
new file mode 100644
index 0000000000..47db117a39
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/protocol_handler_metric.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_MECTRIC_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_MECTRIC_H_
+
+#include <string>
+#include "utils/shared_ptr.h"
+#include "metric_wrapper.h"
+#include "protocol_handler_observer.h"
+
+namespace time_tester {
+
+class ProtocolHandlerMecticWrapper: public MetricWrapper {
+
+ public:
+ utils::SharedPtr<protocol_handler::PHMetricObserver::MessageMetric> message_metric;
+ protected:
+ virtual Json::Value GetJsonMetric();
+};
+} // namespace time_tester
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_MECTRIC_H_
diff --git a/src/components/time_tester/include/time_tester/protocol_handler_observer.h b/src/components/time_tester/include/time_tester/protocol_handler_observer.h
new file mode 100644
index 0000000000..780e9992f2
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/protocol_handler_observer.h
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_OBSERVER_H_
+
+#include "protocol_handler/time_metric_observer.h"
+#include "utils/message_queue.h"
+
+namespace time_tester {
+
+class TimeManager;
+
+class ProtocolHandlerObserver: public protocol_handler::PHMetricObserver {
+ public:
+ explicit ProtocolHandlerObserver(TimeManager* time_manager);
+
+ virtual void StartMessageProcess(uint32_t message_id, const TimevalStruct& start_time);
+
+ virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m);
+
+ private:
+ TimeManager* time_manager_;
+ std::map<uint32_t, TimevalStruct> time_starts;
+};
+} // namespace time_tester
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_PROTOCOL_HANDLER_OBSERVER_H_
diff --git a/src/components/time_tester/include/time_tester/time_manager.h b/src/components/time_tester/include/time_tester/time_manager.h
new file mode 100644
index 0000000000..66dd97595b
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/time_manager.h
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MEDIA_MANAGER_H_
+#define SRC_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MEDIA_MANAGER_H_
+
+#include <string>
+
+#include "utils/shared_ptr.h"
+#include "utils/message_queue.h"
+#include "utils/threads/thread.h"
+#include "utils/singleton.h"
+#include "utils/threads/thread_delegate.h"
+#include "metric_wrapper.h"
+#include "application_manager_observer.h"
+#include "application_manager/application_manager_impl.h"
+#include "transport_manager_observer.h"
+#include "transport_manager/transport_manager_impl.h"
+#include "protocol_handler_observer.h"
+#include "protocol_handler/protocol_handler_impl.h"
+
+namespace time_tester {
+
+class TimeManager {
+ public:
+ TimeManager();
+ ~TimeManager();
+ void Init(protocol_handler::ProtocolHandlerImpl* ph);
+ void Stop();
+ void SendMetric(utils::SharedPtr<MetricWrapper> metric);
+ private:
+
+ class Streamer : public threads::ThreadDelegate {
+ public:
+ explicit Streamer(TimeManager* const server);
+ ~Streamer();
+ void threadMain() OVERRIDE;
+ bool exitThreadMain() OVERRIDE;
+ bool IsReady() const;
+ void Start();
+ void Stop();
+ bool Send(const std::string &msg);
+ volatile bool is_client_connected_;
+ private:
+ TimeManager* const server_;
+ int32_t new_socket_fd_;
+ volatile bool stop_flag_;
+ DISALLOW_COPY_AND_ASSIGN(Streamer);
+ };
+
+ int16_t port_;
+ std::string ip_;
+ int32_t socket_fd_;
+ bool is_ready_;
+ threads::Thread* thread_;
+ MessageQueue<utils::SharedPtr<MetricWrapper> > messages_;
+ Streamer* streamer_;
+ ApplicationManagerObserver app_observer;
+ TransportManagerObserver tm_observer;
+ ProtocolHandlerObserver ph_observer;
+
+ DISALLOW_COPY_AND_ASSIGN(TimeManager);
+};
+} // namespace time_manager
+#endif // SRC_COMPONENTS_TIME_MANAGER_INCLUDE_TIME_MANAGER_MEDIA_MANAGER_H_
diff --git a/src/components/time_tester/include/time_tester/transport_manager_metric.h b/src/components/time_tester/include/time_tester/transport_manager_metric.h
new file mode 100644
index 0000000000..25261b007c
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/transport_manager_metric.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_MECTRIC_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_MECTRIC_H_
+
+#include <string>
+#include "metric_wrapper.h"
+#include "transport_manager_observer.h"
+
+namespace time_tester {
+
+class TransportManagerMecticWrapper: public MetricWrapper {
+ public:
+ utils::SharedPtr<transport_manager::TMMetricObserver::MessageMetric> message_metric;
+ protected:
+ virtual Json::Value GetJsonMetric();
+};
+} // namespace time_tester
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_MECTRIC_H_
diff --git a/src/components/time_tester/include/time_tester/transport_manager_observer.h b/src/components/time_tester/include/time_tester/transport_manager_observer.h
new file mode 100644
index 0000000000..ee83888329
--- /dev/null
+++ b/src/components/time_tester/include/time_tester/transport_manager_observer.h
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_OBSERVER_H_
+#define SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_OBSERVER_H_
+
+#include "transport_manager/time_metric_observer.h"
+#include "utils/message_queue.h"
+#include "utils/date_time.h"
+
+namespace time_tester {
+
+class TimeManager;
+
+class TransportManagerObserver: public transport_manager::TMMetricObserver {
+ public:
+ explicit TransportManagerObserver(TimeManager* time_manager);
+ virtual void StartRawMsg(const protocol_handler::RawMessage* ptr);
+ virtual void StopRawMsg(const protocol_handler::RawMessage* ptr);
+ private:
+ TimeManager* time_manager_;
+ std::map<const protocol_handler::RawMessage*, TimevalStruct> time_starts;
+};
+} // namespace time_tester
+#endif // SRC_COMPONENTS_TIME_TESTER_INCLUDE_TIME_TESTER_TRANSPORT_MANAGER_OBSERVER_H_
diff --git a/src/components/time_tester/src/application_manager_metric.cc b/src/components/time_tester/src/application_manager_metric.cc
new file mode 100644
index 0000000000..251323dc4f
--- /dev/null
+++ b/src/components/time_tester/src/application_manager_metric.cc
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager_metric.h"
+#include "json_keys.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace time_tester {
+
+Json::Value ApplicationManagerMetricWrapper::GetJsonMetric() {
+ Json::Value result = MetricWrapper::GetJsonMetric();
+ result[strings::logger] = "ApplicationManager";
+ result[strings::begin] =
+ Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
+ result[strings::end] =
+ Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ const NsSmartDeviceLink::NsSmartObjects::SmartObject& params =
+ message_metric->message->getElement(application_manager::strings::params);
+ result[strings::correlation_id] =
+ params[application_manager::strings::correlation_id].asInt();
+ result[strings::connection_key] =
+ params[application_manager::strings::connection_key].asInt();
+ return result;
+}
+} // namespace time_tester
diff --git a/src/components/time_tester/src/application_manager_observer.cc b/src/components/time_tester/src/application_manager_observer.cc
new file mode 100644
index 0000000000..67d7268da7
--- /dev/null
+++ b/src/components/time_tester/src/application_manager_observer.cc
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#include "application_manager_observer.h"
+#include "utils/shared_ptr.h"
+#include "time_manager.h"
+#include "application_manager_metric.h"
+
+namespace time_tester {
+
+ApplicationManagerObserver::ApplicationManagerObserver(TimeManager* time_manager):
+ time_manager_(time_manager) {
+}
+
+void ApplicationManagerObserver::OnMessage(utils::SharedPtr<MessageMetric> metric) {
+ ApplicationManagerMetricWrapper* m = new ApplicationManagerMetricWrapper();
+ m->message_metric = metric;
+ m->grabResources();
+ time_manager_->SendMetric(m);
+}
+} // namespace time_tester
diff --git a/src/components/time_tester/src/metric_wrapper.cc b/src/components/time_tester/src/metric_wrapper.cc
new file mode 100644
index 0000000000..2922bf35cb
--- /dev/null
+++ b/src/components/time_tester/src/metric_wrapper.cc
@@ -0,0 +1,46 @@
+#include "metric_wrapper.h"
+#include "json_keys.h"
+
+namespace time_tester {
+
+ MetricWrapper::MetricWrapper():
+ resources(NULL) {
+ }
+
+bool MetricWrapper::grabResources() {
+ Clear();
+ resources = utils::Resources::getCurrentResourseUsage();
+ if (NULL != resources) {
+ return true;
+ } else {
+ return false;
+ }
+ flush(std::cout);
+}
+
+std::string MetricWrapper::GetStyledString() {
+ return GetJsonMetric().toStyledString();
+}
+
+Json::Value MetricWrapper::GetJsonMetric() {
+ Json::Value result;
+ if (resources) {
+ result[strings::stime] = resources->stime;
+ result[strings::utime] = resources->utime;
+ result[strings::memory] = resources->memory;
+ }
+ return result;
+}
+
+void MetricWrapper::Clear() {
+ if (NULL != resources) {
+ delete resources;
+ resources = NULL;
+ }
+}
+
+MetricWrapper::~MetricWrapper() {
+ Clear();
+}
+
+}
diff --git a/src/components/time_tester/src/protocol_handler_metric.cc b/src/components/time_tester/src/protocol_handler_metric.cc
new file mode 100644
index 0000000000..93e08642f1
--- /dev/null
+++ b/src/components/time_tester/src/protocol_handler_metric.cc
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol_handler_metric.h"
+#include "json/json.h"
+#include "json_keys.h"
+
+namespace time_tester {
+
+Json::Value ProtocolHandlerMecticWrapper::GetJsonMetric() {
+ Json::Value result = MetricWrapper::GetJsonMetric();
+ result[strings::logger] = "ProtocolHandler";
+ result[strings::begin] =
+ Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
+ result[strings::end] =
+ Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ result[strings::message_id] = message_metric->message_id;
+ result[strings::connection_key] = message_metric->connection_key;
+ return result;
+}
+
+} // namespace time_tester
diff --git a/src/components/time_tester/src/protocol_handler_observer.cc b/src/components/time_tester/src/protocol_handler_observer.cc
new file mode 100644
index 0000000000..0ad6ec1c0d
--- /dev/null
+++ b/src/components/time_tester/src/protocol_handler_observer.cc
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol_handler_observer.h"
+#include "utils/date_time.h"
+#include "protocol_handler_metric.h"
+#include "time_manager.h"
+
+namespace time_tester {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+ProtocolHandlerObserver::ProtocolHandlerObserver(TimeManager *time_manager):
+ time_manager_(time_manager) {
+}
+
+void ProtocolHandlerObserver::StartMessageProcess(uint32_t message_id,
+ const TimevalStruct &start_time) {
+ if (message_id == 0) {
+ return;
+ }
+ if (time_starts.find(message_id) != time_starts.end()) {
+ LOG4CXX_INFO(logger_, "Message ID already wait for stop processing" << message_id);
+ return;
+ }
+ time_starts[message_id] = start_time;
+}
+
+void ProtocolHandlerObserver::EndMessageProcess(utils::SharedPtr<MessageMetric> m) {
+ uint32_t message_id = m->message_id;
+ std::map<uint32_t, TimevalStruct>::const_iterator it = time_starts.find(message_id);
+ if (it == time_starts.end()) {
+ LOG4CXX_WARN(logger_, "Cant find start time for message" << message_id);
+ return;
+ }
+ m->begin= time_starts[message_id];
+ m->end = date_time::DateTime::getCurrentTime();
+ ProtocolHandlerMecticWrapper* metric = new ProtocolHandlerMecticWrapper();
+ metric->message_metric = m;
+ metric->grabResources();
+ time_manager_->SendMetric(metric);
+}
+} //namespace time_tester
diff --git a/src/components/time_tester/src/time_manager.cc b/src/components/time_tester/src/time_manager.cc
new file mode 100644
index 0000000000..de1537e306
--- /dev/null
+++ b/src/components/time_tester/src/time_manager.cc
@@ -0,0 +1,242 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "time_manager.h"
+
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "transport_manager/transport_manager_default.h"
+#include "config_profile/profile.h"
+#include "utils/resource_usage.h"
+
+namespace time_tester {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TimeManager")
+
+TimeManager::TimeManager():
+ socket_fd_(0),
+ thread_(NULL),
+ messages_(),
+ streamer_(NULL),
+ app_observer(this),
+ tm_observer(this),
+ ph_observer(this) {
+ ip_ = profile::Profile::instance()->server_address();
+ port_ = profile::Profile::instance()->time_testing_port();
+}
+
+TimeManager::~TimeManager() {
+ LOG4CXX_INFO(logger_, "Destroing TimeManager");
+ Stop();
+}
+
+void TimeManager::Init(protocol_handler::ProtocolHandlerImpl* ph) {
+ DCHECK(ph);
+ if (!thread_) {
+ streamer_ = new Streamer(this);
+ thread_ = new threads::Thread("TimeManager", streamer_ );
+ application_manager::ApplicationManagerImpl::instance()->SetTimeMetricObserver(&app_observer);
+ transport_manager::TransportManagerDefault::instance()->SetTimeMetricObserver(&tm_observer);
+ ph->SetTimeMetricObserver(&ph_observer);
+ thread_->startWithOptions(threads::ThreadOptions());
+ LOG4CXX_INFO(logger_, "Create and start sending thread");
+ }
+}
+
+void TimeManager::Stop() {
+ if (thread_) {
+ thread_->stop();
+ delete thread_;
+ thread_ = NULL;
+ if (socket_fd_ != -1) {
+ ::close(socket_fd_);
+ }
+ }
+ messages_.Reset();
+ LOG4CXX_INFO(logger_, "TimeManager stopped");
+}
+
+void TimeManager::SendMetric(utils::SharedPtr<MetricWrapper> metric) {
+ if ((NULL != streamer_ )&& streamer_->is_client_connected_) {
+ messages_.push(metric);
+ }
+}
+
+TimeManager::Streamer::Streamer(
+ TimeManager* const server)
+ : is_client_connected_(false),
+ server_(server),
+ new_socket_fd_(0),
+ stop_flag_(false) {
+}
+
+TimeManager::Streamer::~Streamer() {
+ Stop();
+}
+
+void TimeManager::Streamer::threadMain() {
+ LOG4CXX_INFO(logger_, "Streamer::threadMain");
+
+ Start();
+
+ while (!stop_flag_) {
+ new_socket_fd_ = accept(server_->socket_fd_, NULL, NULL);
+ if (0 > new_socket_fd_) {
+ LOG4CXX_ERROR(logger_, "Cant open socket . Socket is busy ");
+ Stop();
+ break;
+ }
+
+ is_client_connected_ = true;
+ while (is_client_connected_) {
+ while (!server_->messages_.empty()) {
+ utils::SharedPtr<MetricWrapper> metric = server_->messages_.pop();
+ is_client_connected_ = Send(metric->GetStyledString());
+ }
+
+ if (!IsReady()) {
+ LOG4CXX_INFO(logger_, "Client disconnected.");
+ Stop();
+ break;
+ }
+
+ server_->messages_.wait();
+ }
+ }
+}
+
+bool TimeManager::Streamer::exitThreadMain() {
+ LOG4CXX_INFO(logger_, "Streamer::exitThreadMain");
+ stop_flag_ = true;
+ Stop();
+ server_->messages_.Shutdown();
+ return false;
+}
+
+void TimeManager::Streamer::Start() {
+ server_->socket_fd_ = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (0 >= server_->socket_fd_) {
+ LOG4CXX_ERROR_EXT(logger_, "Server open error");
+ return;
+ }
+
+ int32_t optval = 1;
+ if (-1 == setsockopt(server_->socket_fd_, SOL_SOCKET, SO_REUSEADDR,
+ &optval, sizeof optval)) {
+ LOG4CXX_ERROR_EXT(logger_, "Unable to set sockopt");
+ return;
+ }
+
+ sockaddr_in serv_addr_;
+ memset(&serv_addr_, 0, sizeof(serv_addr_));
+ serv_addr_.sin_addr.s_addr = inet_addr(server_->ip_.c_str());
+ serv_addr_.sin_family = AF_INET;
+ serv_addr_.sin_port = htons(server_->port_);
+
+ if (-1 == bind(server_->socket_fd_,
+ reinterpret_cast<struct sockaddr*>(&serv_addr_),
+ sizeof(serv_addr_))) {
+ LOG4CXX_ERROR(logger_, "Unable to bind server "
+ << server_->ip_.c_str() << ':' << server_->port_);
+ return;
+ }
+ if (-1 == listen(server_->socket_fd_, 1)) {
+ LOG4CXX_ERROR(logger_, "Streamer listen error " << strerror(errno) );
+ return;
+ }
+ LOG4CXX_INFO(logger_, "Streamer is listetning for connections");
+}
+
+void TimeManager::Streamer::Stop() {
+ LOG4CXX_INFO(logger_, "SocketStreamerAdapter::Streamer::stop");
+ if (!new_socket_fd_) {
+ return;
+ }
+
+ if (-1 == shutdown(new_socket_fd_, SHUT_RDWR)) {
+ LOG4CXX_ERROR(logger_, "Unable to shutdown socket");
+ return;
+ }
+
+ if (-1 == close(new_socket_fd_)) {
+ LOG4CXX_ERROR(logger_, "Unable to close socket");
+ return;
+ }
+
+ new_socket_fd_ = -1;
+ is_client_connected_ = false;
+}
+
+bool TimeManager::Streamer::IsReady() const {
+ bool result = true;
+ fd_set fds;
+ FD_ZERO(&fds);
+ FD_SET(new_socket_fd_, &fds);
+ TimevalStruct tv;
+ tv.tv_sec = 5; // set a 5 second timeout
+ tv.tv_usec = 0;
+
+ const int retval = select(new_socket_fd_ + 1, 0, &fds, 0, &tv);
+
+ if (-1 == retval) {
+ LOG4CXX_ERROR_EXT(logger_, "An error occurred");
+ result = false;
+ } else if (0 == retval) {
+ LOG4CXX_ERROR_EXT(logger_, "The timeout expired");
+ result = false;
+ }
+
+ return result;
+}
+
+bool TimeManager::Streamer::Send(const std::string& msg) {
+ if (!IsReady()) {
+ LOG4CXX_ERROR_EXT(logger_, " Socket is not ready");
+ return false;
+ }
+
+ if (-1 == ::send(new_socket_fd_, msg.c_str(),
+ msg.size(), MSG_NOSIGNAL)) {
+ LOG4CXX_ERROR_EXT(logger_, " Unable to send");
+ return false;
+ }
+ return true;
+}
+} // namespace time_tester
diff --git a/src/components/time_tester/src/transport_manager_metric.cc b/src/components/time_tester/src/transport_manager_metric.cc
new file mode 100644
index 0000000000..a7c9ecb5a2
--- /dev/null
+++ b/src/components/time_tester/src/transport_manager_metric.cc
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager_metric.h"
+#include "json/json.h"
+#include "json_keys.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace time_tester {
+
+Json::Value TransportManagerMecticWrapper::GetJsonMetric() {
+ Json::Value result = MetricWrapper::GetJsonMetric();
+ result[strings::logger] = "TransportManager";
+ result[strings::begin] =
+ Json::Int64(date_time::DateTime::getuSecs(message_metric->begin));
+ result[strings::end] =
+ Json::Int64(date_time::DateTime::getuSecs(message_metric->end));
+ result[strings::data_size] = static_cast<uint32_t>(message_metric->data_size);
+ return result;
+}
+
+} // namespace time_tester
diff --git a/src/components/time_tester/src/transport_manager_observer.cc b/src/components/time_tester/src/transport_manager_observer.cc
new file mode 100644
index 0000000000..41cb30126a
--- /dev/null
+++ b/src/components/time_tester/src/transport_manager_observer.cc
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#include "transport_manager_observer.h"
+
+#include <time.h>
+
+#include "transport_manager_metric.h"
+#include "time_manager.h"
+
+namespace time_tester {
+
+TransportManagerObserver::TransportManagerObserver(TimeManager* time_manager):
+ time_manager_ (time_manager) {
+}
+
+void TransportManagerObserver::StartRawMsg(const protocol_handler::RawMessage* ptr) {
+ time_starts[ptr] = date_time::DateTime::getCurrentTime();
+}
+
+void TransportManagerObserver::StopRawMsg(const protocol_handler::RawMessage* ptr) {
+ std::map<const protocol_handler::RawMessage*, TimevalStruct>::const_iterator it;
+ it = time_starts.find(ptr);
+ if (it != time_starts.end()) {
+ TransportManagerMecticWrapper* m = new TransportManagerMecticWrapper();
+ m->message_metric = new transport_manager::TMMetricObserver::MessageMetric();
+ m->message_metric->begin = it->second;
+ m->message_metric->end = date_time::DateTime::getCurrentTime();
+ m->message_metric->data_size = ptr->data_size();
+ m->grabResources();
+ time_manager_->SendMetric(m);
+ }
+}
+
+} //namespace time_tester
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
new file mode 100644
index 0000000000..922eb5431b
--- /dev/null
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -0,0 +1,127 @@
+set(target TransportManager)
+
+include_directories (
+ ./include
+ ../utils/include/
+ ../protocol_handler/include
+ ../connection_handler/include
+ ../config_profile/include
+ ../resumption/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${LIBUSB_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+if (BUILD_BT_SUPPORT)
+ include_directories(
+ )
+endif()
+
+set (SOURCES
+ ./src/transport_manager_impl.cc
+ ./src/transport_manager_default.cc
+ ./src/transport_adapter/transport_adapter_listener_impl.cc
+ ./src/transport_adapter/transport_adapter_impl.cc
+ ./src/tcp/tcp_transport_adapter.cc
+ ./src/transport_adapter/threaded_socket_connection.cc
+ ./src/tcp/tcp_client_listener.cc
+ ./src/tcp/tcp_device.cc
+ ./src/tcp/tcp_socket_connection.cc
+ ./src/tcp/tcp_connection_factory.cc
+)
+
+if (BUILD_AVAHI_SUPPORT)
+ list (APPEND SOURCES
+ ./src/tcp/dnssd_service_browser.cc
+ )
+endif()
+if (BUILD_BT_SUPPORT)
+ list (APPEND SOURCES
+ ./src/bluetooth/bluetooth_device_scanner.cc
+ ./src/bluetooth/bluetooth_transport_adapter.cc
+ ./src/bluetooth/bluetooth_connection_factory.cc
+ ./src/bluetooth/bluetooth_socket_connection.cc
+ ./src/bluetooth/bluetooth_device.cc
+ )
+endif()
+
+if (BUILD_USB_SUPPORT)
+ list (APPEND SOURCES
+ ./src/usb/usb_aoa_adapter.cc
+ ./src/usb/usb_connection_factory.cc
+ ./src/usb/usb_device_scanner.cc
+ )
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ list (APPEND SOURCES
+ ./src/usb/libusb/usb_handler.cc
+ ./src/usb/libusb/usb_connection.cc
+ ./src/usb/libusb/platform_usb_device.cc
+ )
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ list(APPEND SOURCES
+ ./src/usb/qnx/usb_handler.cc
+ ./src/usb/qnx/usb_connection.cc
+ ./src/usb/qnx/platform_usb_device.cc
+ )
+ endif()
+endif(BUILD_USB_SUPPORT)
+
+if (BUILD_MME_SUPPORT)
+ list (APPEND SOURCES
+ src/mme/mme_transport_adapter.cc
+ src/mme/mme_device.cc
+ src/mme/iap_device.cc
+ src/mme/iap2_device.cc
+ src/mme/mme_device_scanner.cc
+ src/mme/mme_connection_factory.cc
+ src/mme/iap_connection.cc
+ src/mme/iap2_connection.cc
+ src/mme/protocol_config.cc
+ )
+endif(BUILD_MME_SUPPORT)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ if (BUILD_AOA_SUPPORT)
+ list (APPEND SOURCES
+ src/aoa/aoa_wrapper.cc
+ src/aoa/aoa_device.cc
+ src/aoa/aoa_dynamic_device.cc
+ src/aoa/aoa_device_scanner.cc
+ src/aoa/aoa_connection.cc
+ src/aoa/aoa_connection_factory.cc
+ src/aoa/aoa_transport_adapter.cc
+ )
+ endif(BUILD_AOA_SUPPORT)
+endif()
+
+add_library(${target} ${SOURCES})
+target_link_libraries(${target} ProtocolLibrary)
+
+if (BUILD_USB_SUPPORT)
+ if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ target_link_libraries(${target} usbdi)
+ endif()
+endif(BUILD_USB_SUPPORT)
+
+if (BUILD_MME_SUPPORT)
+ target_link_libraries (${target} ipod)
+ target_link_libraries (${target} iap2client)
+ target_link_libraries (${target} qdb)
+endif(BUILD_MME_SUPPORT)
+
+if (BUILD_AVAHI_SUPPORT)
+ target_link_libraries(${target} avahi-common)
+endif()
+
+if(ENABLE_LOG)
+ target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+if (BUILD_BT_SUPPORT)
+ target_link_libraries(${target} bluetooth)
+endif()
+
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ if (BUILD_AOA_SUPPORT)
+ target_link_libraries(${target} aoa)
+ endif(BUILD_AOA_SUPPORT)
+endif() \ No newline at end of file
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h
new file mode 100644
index 0000000000..48d1f15538
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_connection_factory.h
@@ -0,0 +1,98 @@
+/**
+ * \file bluetooth_connection_factory.h
+ * \brief BluetoothConnectionFactory class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_CONNECTION_FACTORY_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_CONNECTION_FACTORY_H_
+
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Create connections.
+ */
+class BluetoothConnectionFactory : public ServerConnectionFactory {
+ public:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param controller Pointer to the device adapter controller.
+ */
+ BluetoothConnectionFactory(TransportAdapterController* controller);
+ protected:
+
+ /**
+ * @brief Start BT connection factory.
+ */
+ virtual TransportAdapter::Error Init();
+
+ /**
+ * @brief Create bluetooth socket connection.
+ *
+ * @param device_uid Device unique identifier.
+ * @param ap_handle Handle of application.
+ */
+ virtual TransportAdapter::Error CreateConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief
+ */
+ virtual void Terminate();
+
+ /**
+ * @brief Check for initialization.
+ *
+ * @return true - initialized.
+ * false - not initialized.
+ */
+ virtual bool IsInitialised() const;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~BluetoothConnectionFactory();
+ private:
+ TransportAdapterController* controller_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h
new file mode 100644
index 0000000000..4abef3c604
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device.h
@@ -0,0 +1,128 @@
+/**
+ * \file bluetooth_device.h
+ * \brief BluetoothDevice class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_H_
+
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+#include <bluetooth/rfcomm.h>
+
+#include <vector>
+
+#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/device.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Type definition for vector that holds uint8_t variables.
+ */
+typedef std::vector<uint8_t> RfcommChannelVector;
+
+/**
+ * @brief Information about device that use bluetooth transport.
+ */
+class BluetoothDevice : public Device {
+ public:
+
+ /**
+ * @brief Return device unique identifier.
+ *
+ * @return string with device unique identifier.
+ */
+ static std::string GetUniqueDeviceId(const bdaddr_t& device_address);
+
+ /**
+ * @brief Constructor.
+ *
+ * @param address Bluetooth address.
+ * @param name Human-readable device name.
+ * @param rfcomm_channels List of RFCOMM channels where SmartDeviceLink service has been discovered.
+ **/
+ BluetoothDevice(const bdaddr_t& device_address, const char* device_name,
+ const RfcommChannelVector& rfcomm_channels);
+
+ /**
+ * @brief Compare devices.
+ *
+ * This method checks whether two SBluetoothDevice structures
+ * refer to the same device.
+ *
+ * @param other Device to compare with.
+ *
+ * @return true if devices are equal, false otherwise.
+ **/
+ virtual bool IsSameAs(const Device* other) const;
+
+ bool GetRfcommChannel(const ApplicationHandle app_handle,
+ uint8_t* channel_out);
+
+ /**
+ * @brief Update list of applications available on device.
+ *
+ * @return Container with list of applications.
+ */
+ virtual ApplicationList GetApplicationList() const;
+
+ /**
+ * @brief Return device bluetooth address.
+ *
+ * @return Device bluetooth address.
+ */
+ const bdaddr_t& address() const {
+ return address_;
+ }
+
+ private:
+ /**
+ * @brief Device bluetooth address.
+ **/
+ bdaddr_t address_;
+
+ /**
+ * @brief List of RFCOMM channels where SmartDeviceLink service has been discovered.
+ **/
+ RfcommChannelVector rfcomm_channels_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_DEVICE_H_
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
new file mode 100644
index 0000000000..0c68c67216
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h
@@ -0,0 +1,181 @@
+/**
+ * \file bluetooth_device_scanner.h
+ * \brief BluetoothDeviceScanner class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_SCANNER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_SCANNER_H_
+
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+#include <bluetooth/rfcomm.h>
+
+#include "transport_manager/transport_adapter/device_scanner.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+class TransportAdapterController;
+
+/**
+ * @brief Scan for devices using bluetooth.
+ */
+class BluetoothDeviceScanner : public DeviceScanner {
+ public:
+ /**
+ * @brief Constructor.
+ * @param controller Transport adapter controller
+ * @param auto_repeat_search true - autorepeated or continous device search, false - search on demand
+ * @param repeat_search_pause_sec - pause between device searches, 0 means continous search
+ */
+ BluetoothDeviceScanner(TransportAdapterController* controller,
+ bool auto_repeat_search, int repeat_search_pause_sec);
+ /**
+ * @brief Destructor.
+ */
+ ~BluetoothDeviceScanner();
+ /**
+ * @brief Main thread initialization.
+ */
+ void Thread();
+ protected:
+
+ /**
+ * @brief Start device scanner.
+ *
+ * @return Error information about reason of initialization failure.
+ */
+ virtual TransportAdapter::Error Init();
+
+ /**
+ * @brief Terminates device scanner thread
+ */
+ virtual void Terminate();
+
+ /**
+ * @brief Request device search
+ *
+ * @return Error information about reason of Scan failure.
+ */
+ virtual TransportAdapter::Error Scan();
+
+ /**
+ * @brief Check device scanner for initialization.
+ *
+ * @return true - initialized.
+ * false - not initialized.
+ */
+ virtual bool IsInitialised() const;
+ private:
+
+ class BluetoothDeviceScannerDelegate: public threads::ThreadDelegate {
+ public:
+ explicit BluetoothDeviceScannerDelegate(BluetoothDeviceScanner* scanner);
+ void threadMain() OVERRIDE;
+ private:
+ BluetoothDeviceScanner* scanner_;
+ };
+
+ typedef std::vector<uint8_t> RfcommChannelVector;
+
+ /**
+ * @brief Waits for external scan request or time out for repeated search or terminate request
+ */
+ void TimedWaitForDeviceScanRequest();
+
+ /**
+ * @brief Finds RFCOMM-channels of SDL enabled applications for set of devices
+ * @param device_addresses Bluetooth addresses to search on
+ * @return List of RFCOMM-channels lists
+ */
+ std::vector<RfcommChannelVector> DiscoverSmartDeviceLinkRFCOMMChannels(
+ const std::vector<bdaddr_t>& device_addresses);
+
+ /**
+ * @brief Finds RFCOMM-channels of SDL enabled applications for given device
+ * @param[out] discovered List of RFCOMM-channels to fill
+ * @return true - if search was OK, false if it failed
+ */
+ bool DiscoverSmartDeviceLinkRFCOMMChannels(const bdaddr_t& device_address,
+ RfcommChannelVector* discovered);
+
+ /**
+ * @brief Summarizes the total list of devices (paired and scanned) and notifies controller
+ */
+ void UpdateTotalDeviceList();
+
+ /**
+ * @brief Performs search of SDL-enabled devices
+ */
+ void DoInquiry();
+
+ /**
+ * @brief Checks if given devices have SDL service and creates appropriate BluetoothDevice objects
+ * @param bd_address List of bluetooth addresses to check
+ * @param device_handle HCI handle
+ * @param[out] discovered_devices List of created BluetoothDevice objects to fill
+ */
+ void CheckSDLServiceOnDevices(const std::vector<bdaddr_t>& bd_address,
+ int device_handle,
+ DeviceVector* discovered_devices);
+
+ TransportAdapterController* controller_;
+ threads::Thread* thread_;
+ bool shutdown_requested_;
+ bool ready_;
+ bool device_scan_requested_;
+ sync_primitives::Lock device_scan_requested_lock_;
+ sync_primitives::ConditionalVariable device_scan_requested_cv_;
+
+ std::vector<bdaddr_t> paired_devices_;
+
+ DeviceVector paired_devices_with_sdl_;
+ DeviceVector found_devices_with_sdl_;
+
+ /**
+ * @brief UUID of SmartDeviceLink service.
+ **/
+ uuid_t smart_device_link_service_uuid_;
+
+ const bool auto_repeat_search_;
+ const int auto_repeat_pause_sec_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif /* BLUETOOTH_DEVICE_SCANNER_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h
new file mode 100644
index 0000000000..e1606da878
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h
@@ -0,0 +1,83 @@
+/**
+ * \file bluetooth_socket_connection.h
+ * \brief BluetoothSocketConnection class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_SOCKET_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_SOCKET_CONNECTION_H_
+
+#include "transport_manager/transport_adapter/threaded_socket_connection.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Class responsible for communication over bluetooth sockets.
+ */
+class BluetoothSocketConnection : public ThreadedSocketConnection {
+ public:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid Device unique identifier.
+ * @param app_handle Handle of device.
+ * @param controller Pointer to the device adapter controller.
+ */
+ BluetoothSocketConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~BluetoothSocketConnection();
+ protected:
+
+ /**
+ * @brief Establish connection.
+ *
+ * @param error Connection error.
+ *
+ * @return True - connection established.
+ * false - connection not established.
+ */
+ virtual bool Establish(ConnectError** error);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif /* BLUETOOTH_SOCKET_CONNECTION_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
new file mode 100644
index 0000000000..075b5da55f
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h
@@ -0,0 +1,81 @@
+/**
+ * \file bluetooth_transport_adapter.h
+ * \brief BluetoothAdapter class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_ADAPTER_H
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_ADAPTER_H
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Transport adapter that use bluetooth transport.
+ */
+class BluetoothTransportAdapter : public TransportAdapterImpl {
+ public:
+ /**
+ * @brief Constructor.
+ */
+ BluetoothTransportAdapter();
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~BluetoothTransportAdapter();
+ protected:
+
+ /**
+ * @brief Return type of device.
+ */
+ virtual DeviceType GetDeviceType() const;
+
+ /**
+ * @brief Store adapter state in last state singleton
+ */
+ virtual void Store() const;
+
+ /**
+ * @brief Restore adapter state from last state singleton
+ *
+ * @return True on success false otherwise
+ */
+ virtual bool Restore();
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_ADAPTER
diff --git a/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h b/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h
new file mode 100644
index 0000000000..cd319ca543
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/dnssd_service_browser.h
@@ -0,0 +1,133 @@
+/**
+ * \file dnssd_service_browser.h
+ * \brief DnssdServiceBrowser class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_DNSSD_SERVICE_BROWSER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_DNSSD_SERVICE_BROWSER_H_
+
+#include <string>
+#include <vector>
+#include <pthread.h>
+#include <avahi-client/client.h>
+#include <avahi-client/lookup.h>
+#include <avahi-common/error.h>
+#include <avahi-common/thread-watch.h>
+
+#include "transport_manager/transport_adapter/device_scanner.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+struct DnssdServiceRecord {
+ AvahiIfIndex interface;
+ AvahiProtocol protocol;
+ std::string domain_name;
+ std::string host_name;
+ std::string name;
+ std::string type;
+ uint16_t port;
+ uint32_t addr;
+};
+
+#define DNSSD_DEFAULT_SERVICE_TYPE "_ford-sdlapp._tcp"
+
+/**
+ * @brief DNS service discovery class.
+ */
+class DnssdServiceBrowser : public DeviceScanner {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param controller Pointer to the device adapter controller.
+ */
+ DnssdServiceBrowser(class TransportAdapterController* controller);
+ virtual ~DnssdServiceBrowser();
+ protected:
+ virtual TransportAdapter::Error Init();
+ virtual TransportAdapter::Error Scan();
+ virtual void Terminate();
+ virtual bool IsInitialised() const;
+ private:
+ TransportAdapter::Error CreateAvahiClientAndBrowser();
+ void AddService(AvahiIfIndex interface, AvahiProtocol protocol,
+ const char *name, const char *type, const char *domain);
+ void RemoveService(AvahiIfIndex interface, AvahiProtocol protocol,
+ const char *name, const char *type, const char *domain);
+
+ void OnClientConnected();
+ void OnClientFailure();
+
+ DeviceVector PrepareDeviceVector() const;
+
+ void ServiceResolved(const DnssdServiceRecord& service_record);
+ void ServiceResolveFailed(const DnssdServiceRecord& service_record);
+
+ friend void AvahiClientCallback(AvahiClient *avahi_client,
+ AvahiClientState avahi_client_state,
+ void* data);
+ friend void AvahiServiceBrowserCallback(
+ AvahiServiceBrowser *avahi_service_browser, AvahiIfIndex interface,
+ AvahiProtocol protocol, AvahiBrowserEvent event, const char *name,
+ const char *type, const char *domain, AvahiLookupResultFlags flags,
+ void* data);
+
+ friend void AvahiServiceResolverCallback(
+ AvahiServiceResolver* avahi_service_resolver, AvahiIfIndex interface,
+ AvahiProtocol protocol, AvahiResolverEvent event, const char* name,
+ const char* type, const char* domain, const char* host_name,
+ const AvahiAddress* avahi_address, uint16_t port, AvahiStringList* txt,
+ AvahiLookupResultFlags flags, void *data);
+
+ TransportAdapterController* controller_;
+
+ AvahiServiceBrowser* avahi_service_browser_;
+ AvahiThreadedPoll* avahi_threaded_poll_;
+ AvahiClient* avahi_client_;
+
+ typedef std::vector<DnssdServiceRecord> ServiceRecords;
+ ServiceRecords service_records_;
+
+ pthread_mutex_t mutex_;
+
+ bool initialised_;
+}
+;
+
+} // namespace
+} // namespace
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_DNSSD_SERVICE_BROWSER
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
new file mode 100644
index 0000000000..090f46d001
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_client_listener.h
@@ -0,0 +1,119 @@
+/**
+ * \file tcp_client_listener.h
+ * \brief TcpClientListener class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CLIENT_LISTENER_H_
+
+#include "transport_manager/transport_adapter/client_connection_listener.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Listener of device adapter that use TCP transport.
+ */
+class TcpClientListener : public ClientConnectionListener {
+ public:
+ /**
+ * @breaf Constructor.
+ *
+ * @param controller Pointer to the device adapter controller.
+ * @param port Port No.
+ * @param enable_keepalive If true enables TCP keepalive on accepted
+ *connections
+ */
+ TcpClientListener(TransportAdapterController* controller, uint16_t port,
+ bool enable_keepalive);
+
+ /**
+ * @brief Start TCP client listener thread.
+ */
+ void Thread();
+ protected:
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TcpClientListener();
+
+ /**
+ * @brief Run TCP client listener.
+ *
+ * @return Error information about possible reason of starting TCP listener listener failure.
+ */
+ virtual TransportAdapter::Error Init();
+
+ /**
+ * @brief Stop TCP client listener.
+ */
+ virtual void Terminate();
+
+ /**
+ * @brief Check initialization.
+ *
+ * @return True if initialized.
+ * @return False if not initialized.
+ */
+ virtual bool IsInitialised() const;
+
+ /**
+ * @brief
+ *
+ * @return Error information about possible reason of failure.
+ */
+ virtual TransportAdapter::Error StartListening();
+
+ /**
+ * @brief Terminate TCP client listener thread.
+ */
+ virtual TransportAdapter::Error StopListening();
+ private:
+ const uint16_t port_;
+ const bool enable_keepalive_;
+ TransportAdapterController* controller_;
+ // TODO(Eamakhov): change to threads::Thread usage
+ pthread_t thread_;
+ int socket_;
+ bool thread_started_;
+ bool shutdown_requested_;
+ bool thread_stop_requested_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif /* TCP_CLIENT_LISTENER_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h
new file mode 100644
index 0000000000..fba85aa601
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h
@@ -0,0 +1,99 @@
+/**
+ * \file tcp_connection_factory.h
+ * \brief TcpConnectionFactory class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CONNECTION_FACTORY_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CONNECTION_FACTORY_H_
+
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Create connections.
+ */
+class TcpConnectionFactory : public ServerConnectionFactory {
+ public:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param controller Pointer to the device adapter controller.
+ */
+ TcpConnectionFactory(TransportAdapterController* controller);
+ protected:
+
+ /**
+ * @brief Start TCP connection factory.
+ */
+ virtual TransportAdapter::Error Init();
+
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid device unique identifier.
+ * @param app_handle Handle of application.
+ *
+ * @return Error information about possible reason of failure.
+ */
+ virtual TransportAdapter::Error CreateConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief
+ */
+ virtual void Terminate();
+
+ /**
+ * @brief Check for initialization.
+ *
+ * @return true - initialized.
+ * false - not initialized.
+ */
+ virtual bool IsInitialised() const;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TcpConnectionFactory();
+ private:
+ TransportAdapterController* controller_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
new file mode 100644
index 0000000000..08821ab3c4
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_device.h
@@ -0,0 +1,148 @@
+/**
+ * \file tcp_device.h
+ * \brief TcpDevice class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_DEVICE_H_
+
+#include "transport_manager/transport_adapter/device.h"
+
+#include <map>
+#include <memory.h>
+#include <signal.h>
+#include <errno.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Information about device that use TCP transport.
+ */
+class TcpDevice : public Device {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param in_addr Address.
+ * @param name Device Name.
+ **/
+ TcpDevice(const in_addr_t& in_addr, const std::string& name);
+
+ virtual ~TcpDevice();
+
+ /**
+ * @brief Compare devices.
+ *
+ * @param other Device to compare with.
+ *
+ * @return True if devices are equal, false otherwise.
+ **/
+ virtual bool IsSameAs(const Device* other) const;
+
+ /**
+ * @brief Update list of applications available on device.
+ *
+ * @return Container with list of applications.
+ */
+ virtual ApplicationList GetApplicationList() const;
+
+ /**
+ * @brief Add an application to the container of applications.
+ *
+ * @param socket Value of socket.
+ */
+ ApplicationHandle AddIncomingApplication(int socket_fd);
+
+ /**
+ * @brief Add application that was discovered before.
+ *
+ * @param Port No.
+ */
+ ApplicationHandle AddDiscoveredApplication(int port);
+
+ /**
+ * @brief Remove application from the container of applications.
+ *
+ * @param app_handle Handle of application.
+ */
+ void RemoveApplication(const ApplicationHandle app_handle);
+
+ /**
+ * @brief Return application's socket value.
+ *
+ * @param app_handle Handle of application.
+ *
+ * @return Application's socket value.
+ */
+ int GetApplicationSocket(const ApplicationHandle app_handle) const;
+
+ /**
+ * @brief Return application's port No.
+ *
+ * @param app_handle Handle of application.
+ *
+ * @return Application's port No.
+ */
+ int GetApplicationPort(const ApplicationHandle app_handle) const;
+
+ /**
+ * @brief Return address.
+ *
+ * @return Address.
+ */
+ in_addr_t in_addr() const {
+ return in_addr_;
+ }
+
+ private:
+ struct Application {
+ bool incoming;
+ int socket;
+ uint16_t port;
+ };
+ std::map<ApplicationHandle, Application> applications_;
+ mutable pthread_mutex_t applications_mutex_;
+ const in_addr_t in_addr_;
+ const std::string name_;
+ ApplicationHandle last_handle_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif /* TCP_DEVICE_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h
new file mode 100644
index 0000000000..8fe7b8e837
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h
@@ -0,0 +1,112 @@
+/**
+ * \file tcp_socket_connection.h
+ * \brief TcpSocketConnection class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SOCKET_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SOCKET_CONNECTION_H_
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include "transport_manager/transport_adapter/threaded_socket_connection.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Class responsible for communication over TCP sockets.
+ */
+class TcpSocketConnection : public ThreadedSocketConnection {
+ public:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param controller Pointer to the TCP device adapter controller.
+ */
+ TcpSocketConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TcpSocketConnection();
+ protected:
+
+ /**
+ * @brief
+ */
+ virtual bool Establish(ConnectError** error);
+};
+
+/**
+ * @brief Class responsible for communication over sockets that originated by server.
+ */
+class TcpServerOiginatedSocketConnection : public ThreadedSocketConnection {
+ public:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param controller Pointer to the device adapter controller.
+ */
+ TcpServerOiginatedSocketConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TcpServerOiginatedSocketConnection();
+ protected:
+
+ /**
+ * @brief
+ */
+ virtual bool Establish(ConnectError** error);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_SOCKET_CONNECTION_H_
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
new file mode 100644
index 0000000000..1319c40eeb
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_transport_adapter.h
@@ -0,0 +1,83 @@
+/**
+ * \file tcp_transport_adapter.h
+ * \brief TcpTransportAdapter class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_ADAPTER_H_
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Transport adapter that use TCP transport.
+ */
+class TcpTransportAdapter : public TransportAdapterImpl {
+ public:
+ /**
+ * @brief Constructor.
+ */
+ explicit TcpTransportAdapter(uint16_t port);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TcpTransportAdapter();
+ protected:
+
+ /**
+ * @brief Return type of device.
+ *
+ * @return String with device type.
+ */
+ virtual DeviceType GetDeviceType() const;
+
+ /**
+ * @brief Store adapter state in last state singleton
+ */
+ virtual void Store() const;
+
+ /**
+ * @brief Restore adapter state from last state singleton
+ *
+ * @return True on success false otherwise
+ */
+ virtual bool Restore();
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_ADAPTER
diff --git a/src/components/transport_manager/include/transport_manager/time_metric_observer.h b/src/components/transport_manager/include/transport_manager/time_metric_observer.h
new file mode 100644
index 0000000000..ce59a9b4c4
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/time_metric_observer.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TIME_METRIC_OBSERVER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TIME_METRIC_OBSERVER_H_
+
+#include "transport_manager/common.h"
+#include "protocol/raw_message.h"
+#include "utils/date_time.h"
+
+namespace transport_manager {
+
+class TMMetricObserver {
+ public:
+ struct MessageMetric {
+ TimevalStruct begin;
+ TimevalStruct end;
+ size_t data_size;
+ };
+ virtual void StartRawMsg(const protocol_handler::RawMessage* ptr) = 0;
+ virtual void StopRawMsg(const protocol_handler::RawMessage* ptr) = 0;
+
+ virtual ~TMMetricObserver(){}
+};
+} // transport_manager
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TIME_METRIC_OBSERVER_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h
new file mode 100644
index 0000000000..41658fb45f
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h
@@ -0,0 +1,91 @@
+/**
+ * \file client_connection_listener.h
+ * \brief ClientConnectionListener class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CLIENT_CONNECTION_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CLIENT_CONNECTION_LISTENER_H_
+
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+
+namespace transport_manager {
+
+
+namespace transport_adapter {
+
+/**
+ * @brief Abstract class for listener of client connection.
+ */
+class ClientConnectionListener {
+ public:
+ /**
+ * @brief Run client connection listener.
+ *
+ * @return Error information about possible reason of starting client listener failure.
+ */
+ virtual TransportAdapter::Error Init() = 0;
+
+ /**
+ * @brief Stop client connection listener.
+ */
+ virtual void Terminate() = 0;
+
+ /**
+ * @brief Check initialization.
+ *
+ * @return True if initialized.
+ * @return False if not initialized.
+ */
+ virtual bool IsInitialised() const = 0;
+
+ /**
+ * @brief Start to listen for connection from client.
+ */
+ virtual TransportAdapter::Error StartListening() = 0;
+
+ /**
+ * @brief Stop to listen for connection from client.
+ */
+ virtual TransportAdapter::Error StopListening() = 0;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~ClientConnectionListener() {
+ }
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif /* CLIENT_CONNECTION_LISTENER_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
new file mode 100644
index 0000000000..2bfea9c818
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h
@@ -0,0 +1,81 @@
+/**
+ * \file connection.h
+ * \brief Connection class header.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
+
+#include "utils/shared_ptr.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+/**
+ * @brief Application connection.
+ **/
+class Connection {
+ public:
+ /**
+ * @brief Constructor.
+ */
+ Connection() {}
+ /**
+ * @brief Destructor.
+ **/
+ virtual ~Connection() {}
+
+ /**
+ * @brief Send data frame.
+ *
+ * @param Message Smart pointer to the raw message.
+ *
+ * @return Error Information about possible reason of sending data failure.
+ */
+ virtual TransportAdapter::Error SendData(RawMessagePtr message) = 0;
+
+ /**
+ * @brief Disconnect the current connection.
+ */
+ virtual TransportAdapter::Error Disconnect() = 0;
+};
+
+/**
+ * @typedef Type definition of smart pointer to the Connection class.
+ */
+typedef utils::SharedPtr<Connection> ConnectionSptr;
+
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h b/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h
new file mode 100644
index 0000000000..5b09a726e5
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/device_scanner.h
@@ -0,0 +1,86 @@
+/**
+ * \file device_scanner.h
+ * \brief DeviceScanner class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_SCANNER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_SCANNER_H_
+
+#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Abstract class for device scanner.
+ */
+class DeviceScanner {
+ public:
+ /**
+ * @brief Start device scanner.
+ *
+ * @return Error information about reason of initialization failure.
+ */
+ virtual TransportAdapter::Error Init() = 0;
+
+ /**
+ * @brief
+ *
+ * @return Error information about reason of Scan failure.
+ */
+ virtual TransportAdapter::Error Scan() = 0;
+
+ /**
+ * @brief Stop device scanner.
+ */
+ virtual void Terminate() = 0;
+
+ /**
+ * @brief Check device scanner for initialization.
+ *
+ * @return true - initialized.
+ * false - not initialized.
+ */
+ virtual bool IsInitialised() const = 0;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~DeviceScanner() {
+ }
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif /* DEVICE_SCANNER_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h b/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h
new file mode 100644
index 0000000000..d944594d88
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/server_connection_factory.h
@@ -0,0 +1,89 @@
+/**
+ * \file server_connection_factory.h
+ * \brief ServerConnectionFactory class header file.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_SERVER_CONNECTION_FACTORY_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_SERVER_CONNECTION_FACTORY_H_
+
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief Implement transport dependent connection that was originated by the user.
+ */
+class ServerConnectionFactory {
+ public:
+ /**
+ * @brief Start server connection factory.
+ *
+ * @return Information about possible reason of error during initialization.
+ */
+ virtual TransportAdapter::Error Init() = 0;
+
+ /**
+ * @brief
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ *
+ * @return Information about posible reason of error.
+ */
+ virtual TransportAdapter::Error CreateConnection(
+ const DeviceUID& device_handle, const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief
+ */
+ virtual void Terminate() = 0;
+
+ /**
+ * @brief Check device scanner for initialization.
+ *
+ * @return true - initialized.
+ * false - not initialized.
+ */
+ virtual bool IsInitialised() const = 0;
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~ServerConnectionFactory() {
+ }
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif /* SERVER_CONNECTION_FACTORY_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
new file mode 100644
index 0000000000..5398b13869
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
@@ -0,0 +1,162 @@
+/**
+ * \file threaded_socket_connection.h
+ * \brief Header for classes responsible for communication over sockets.
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_THREADED_SOCKET_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_THREADED_SOCKET_CONNECTION_H_
+
+#include <poll.h>
+#include <queue>
+
+#include "transport_manager/transport_adapter/connection.h"
+#include "protocol/common.h"
+
+using ::transport_manager::transport_adapter::Connection;
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Class responsible for communication over sockets.
+ */
+class ThreadedSocketConnection : public Connection {
+ public:
+
+ /**
+ * @brief Send data frame.
+ *
+ * @param message Smart pointer to the raw message.
+ *
+ * @return Error Information about possible reason of sending data failure.
+ */
+ TransportAdapter::Error SendData(RawMessagePtr message);
+
+ /**
+ * @brief Disconnect the current connection.
+ *
+ * @return Error Information about possible reason of Disconnect failure.
+ */
+ TransportAdapter::Error Disconnect();
+
+ /**
+ * @brief Start thread creation.
+ *
+ * @return Information about possible reason of thread creation error.
+ */
+ TransportAdapter::Error Start();
+
+ /**
+ * @brief Set variable that hold socket No.
+ */
+ void set_socket(int socket) {
+ socket_ = socket;
+ }
+ protected:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param controller Pointer to the device adapter controller.
+ */
+ ThreadedSocketConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~ThreadedSocketConnection();
+
+
+ virtual bool Establish(ConnectError** error) = 0;
+
+ /**
+ * @brief Return pointer to the device adapter controller.
+ */
+ TransportAdapterController* controller() {
+ return controller_;
+ }
+
+ /**
+ * @brief Return device unique identifier.
+ */
+ DeviceUID device_handle() const {
+ return device_uid_;
+ }
+
+ /**
+ * @brief Return handle of application.
+ */
+ ApplicationHandle application_handle() const {
+ return app_handle_;
+ }
+
+ private:
+
+ int read_fd_;
+ int write_fd_;
+ void Thread();
+ void Transmit();
+ void Finalize();
+ TransportAdapter::Error Notify() const;
+ bool Receive();
+ bool Send();
+ void Abort();
+
+ friend void* StartThreadedSocketConnection(void*);
+
+ TransportAdapterController* controller_;
+ /**
+ * @brief Frames that must be sent to remote device.
+ **/
+ typedef std::queue<RawMessagePtr> FrameQueue;
+ FrameQueue frames_to_send_;
+ mutable pthread_mutex_t frames_to_send_mutex_;
+
+ // TODO(Eamakhov): change to threads::Thread usage
+ pthread_t thread_;
+
+ int socket_;
+ bool terminate_flag_;
+ bool unexpected_disconnect_;
+ const DeviceUID device_uid_;
+ const ApplicationHandle app_handle_;
+};
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif //SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_transport_adapter_SOCKET_COMMUNICATION
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
new file mode 100644
index 0000000000..a2502f67f3
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_controller.h
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_CONTROLLER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_CONTROLLER_H_
+
+#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController {
+ public:
+ virtual ~TransportAdapterController() {
+ }
+
+ /**
+ * @brief Add device to the container(map), if container doesn't hold it yet.
+ *
+ * @param device Smart pointer to the device.
+ *
+ * @return Smart pointer to the device.
+ */
+ virtual DeviceSptr AddDevice(DeviceSptr device) = 0;
+
+ /**
+ * @brief Search for device in container of devices, if it is not there - adds it.
+ *
+ * @param devices Container(vector) of smart pointers to devices.
+ */
+ virtual void SearchDeviceDone(const DeviceVector& devices) = 0;
+
+ /**
+ * @brief application list update notification from device
+ * @param device_handle device id
+ */
+ virtual void ApplicationListUpdated(const DeviceUID& device_handle) = 0;
+
+ /**
+ * @brief "Find new applications" request
+ */
+ virtual void FindNewApplicationsRequest() = 0;
+
+ /**
+ * @brief Launch OnSearchDeviceFailed event in device adapter listener.
+ *
+ * @param error Error class that contains details of this error situation.
+ */
+ virtual void SearchDeviceFailed(const SearchDeviceError& error) = 0;
+
+ /**
+ * @brief Find device in the internal container(map).
+ *
+ * @param device_handle Device unique identifier.
+ *
+ * @return Smart pointer to the device.
+ */
+ virtual DeviceSptr FindDevice(const DeviceUID& device_handle) const = 0;
+
+ /**
+ * @brief Create connection and fill its parameters.
+ *
+ * @param connection Smart pointer to the connection.
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectionCreated(ConnectionSptr connection,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Make state of specified connection - ESTABLISHED and launch OnConnectDone event in device adapter listener.
+ *
+ * @param devcie_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Delete connection from the container of connections and launch OnConnectFailed event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ConnectError& error) = 0;
+
+ /**
+ * @brief Make state of specified connection - FINILIZING.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectionFinished(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Set specified connection state to FINALISING and launch OnUnexpectedDisconnect event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param error Error class that contains details of this error situation.
+ */
+ virtual void ConnectionAborted(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const CommunicationError& error) = 0;
+
+ /**
+ * @brief Remove specified device and all its connections
+ * @param device_handle Device unique identifier.
+ * @param error Error class that contains details of this error situation.
+ */
+ virtual void DeviceDisconnected(const DeviceUID& device_handle,
+ const DisconnectDeviceError& error) = 0;
+
+ /**
+ * @brief Delete specified connection from the container(map) of connections and launch event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void DisconnectDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Launch OnDataReceiveDone event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to the raw message.
+ */
+ virtual void DataReceiveDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message) = 0;
+
+ /**
+ * @brief Launch OnDataReceiveFailed event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param error Class that contains details of this error situation.
+ */
+ virtual void DataReceiveFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DataReceiveError&) = 0;
+
+ /**
+ * @brief Launch OnDataSendDone event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to raw message.
+ */
+ virtual void DataSendDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message) = 0;
+
+ /**
+ * @brief Launch OnDataSendFailed event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to raw message.
+ * @param error Class that contains details of this error situation.
+ */
+ virtual void DataSendFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message, const DataSendError&) = 0;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_CONTROLLER_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
new file mode 100644
index 0000000000..df9f0e4703
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
@@ -0,0 +1,534 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_
+
+#include <queue>
+#include <set>
+#include <map>
+#include <memory>
+#include <string>
+
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/transport_adapter/connection.h"
+
+#ifdef TIME_TESTER
+#include "transport_manager/time_metric_observer.h"
+#endif // TIME_TESTER
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class TransportAdapterListener;
+class DeviceScanner;
+class ServerConnectionFactory;
+class ClientConnectionListener;
+
+/*
+ * @brief Implementation of device adapter class.
+ **/
+class TransportAdapterImpl : public TransportAdapter,
+ public TransportAdapterController {
+ protected:
+ /**
+ * @brief Constructor.
+ *
+ * @param device_scanner Pointer to device scanner.
+ * @param server_connection_factory Pointer to the factory that create
+ *connections from server.
+ * @param client_connection_listener Pointer to the listener of client
+ *connection.
+ **/
+ TransportAdapterImpl(DeviceScanner* device_scanner,
+ ServerConnectionFactory* server_connection_factory,
+ ClientConnectionListener* client_connection_listener);
+
+ /**
+ * @brief Destructor.
+ **/
+ virtual ~TransportAdapterImpl();
+
+ /**
+ * @brief Check initialization.
+ *
+ * @return true if initialized.
+ * @return false if not initialized.
+ */
+ virtual bool IsInitialised() const;
+
+ public:
+ /**
+ * @brief Initiate device adapter.
+ *
+ * Called from transport manager to start device adapter.
+ *
+ * @return Error information about possible reason of failure.
+ **/
+ virtual TransportAdapter::Error Init();
+
+ /**
+ * @brief Add listener to the container(list) of device adapter listeners.
+ *
+ * @param listener Pointer to the device adapter listener.
+ */
+ virtual void AddListener(TransportAdapterListener* listener);
+
+ /**
+ * @brief Start scanning for new devices.
+ *
+ * List of new devices will be supplied in onDeviceListUpdated callback.
+ *
+ * @return Error information about possible reason of search devices failure.
+ **/
+ virtual TransportAdapter::Error SearchDevices();
+
+ /**
+ * @brief Connect to the specified application discovered on device.
+ *
+ * @param device_handle Device unique identifier to connect to.
+ * @param app_handle Handle of application to connect to.
+ *
+ * @return Error information about possible reason of failure.
+ **/
+ virtual TransportAdapter::Error Connect(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Connect to all applications discovered on device
+ * @param device_handle Handle of device
+ * @return Error information about connecting applications on device
+ */
+ virtual TransportAdapter::Error ConnectDevice(const DeviceUID& device_handle);
+
+ /**
+ * @brief Disconnect from specified session.
+ *
+ * @param devcie_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ *
+ * @return Error information about possible reason of disconnecting failure.
+ **/
+ virtual TransportAdapter::Error Disconnect(
+ const DeviceUID& device_handle, const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Disconnect from all sessions on specified device.
+ *
+ * @param device_handle Device handle to Disconnect.
+ *
+ * @return Error information about possible reason of disconnecting from
+ *specified device failure.
+ **/
+ virtual TransportAdapter::Error DisconnectDevice(
+ const DeviceUID& device_handle);
+
+ /**
+ * @brief Send frame of data.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param data Smart pointer to the raw message.
+ *
+ * @return Error information about possible reason of sending data failure
+ **/
+ virtual TransportAdapter::Error SendData(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const RawMessagePtr data);
+
+ /**
+ * @brief Start client listener.
+ *
+ * @return Error information about possible reason of failure.
+ */
+ virtual TransportAdapter::Error StartClientListening();
+
+ /**
+ * @brief Stop client listener.
+ *
+ * @return Error information about possible reason of failure.
+ */
+ virtual TransportAdapter::Error StopClientListening();
+
+ /**
+ * @brief Notify that device scanner is available.
+ *
+ * @return True - available, false - not available.
+ */
+ virtual bool IsSearchDevicesSupported() const;
+
+ /**
+ * @brief Notify that server connection factory is available.
+ *
+ * @return True - available, false - not available.
+ */
+ virtual bool IsServerOriginatedConnectSupported() const;
+
+ /**
+ * @brief Notify that listener of client connection is available.
+ *
+ * @return True - available, false - not available.
+ */
+ virtual bool IsClientOriginatedConnectSupported() const;
+
+ /**
+ * @brief Create container(vector) of device unique identifiers.
+ *
+ * @return Container(vector) of device unique identifiers.
+ */
+ virtual DeviceList GetDeviceList() const;
+
+ /**
+ * @brief Get container(vector) of application unique identifiers that
+ *available at specified device.
+ *
+ * @param device_handle Device unique identifier.
+ *
+ * @return Container(vector) that holds application unique identifiers.
+ */
+ virtual ApplicationList GetApplicationList(const DeviceUID& device_handle)
+ const;
+
+ /**
+ * @brief Find device in the internal container(map).
+ *
+ * @param device_handle Device unique identifier.
+ *
+ * @return Smart pointer to device.
+ */
+ virtual DeviceSptr FindDevice(const DeviceUID& device_handle) const;
+
+ /**
+ * @brief Search for device in container of devices, if it is not there - adds
+ *it.
+ *
+ * @param devices Container(vector) of smart pointers to devices.
+ */
+ virtual void SearchDeviceDone(const DeviceVector& devices);
+
+ virtual void ApplicationListUpdated(const DeviceUID& device_handle);
+
+ virtual void FindNewApplicationsRequest();
+
+ /**
+ * @brief Launch OnSearchDeviceFailed event in device adapter listener.
+ *
+ * @param error Error class that contains details of this error situation.
+ */
+ virtual void SearchDeviceFailed(const SearchDeviceError& error);
+
+ /**
+ * @brief Add device to the container(map), if container doesn't hold it yet.
+ *
+ * @param device Smart pointer to the device.
+ *
+ * @return Smart pointer to the device.
+ */
+ virtual DeviceSptr AddDevice(DeviceSptr device);
+
+ /**
+ * @brief Create connection and fill its parameters.
+ *
+ * @param connection Smart pointer to the connection.
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectionCreated(ConnectionSptr connection,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Set state of specified connection - FINILIZING.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectionFinished(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Set specified connection state to FINILIZING and launch
+ *OnUnexpectedDisconnect event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param error Error class that contains details of this error situation.
+ */
+ virtual void ConnectionAborted(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const CommunicationError& error);
+
+ /**
+ * @brief Set state of specified connection - ESTABLISHED and launch
+ *OnConnectDone event in device adapter listener.
+ *
+ * @param devcie_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Delete connection from the container of connections and launch
+ *OnConnectFailed event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void ConnectFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ConnectError& error);
+
+ /**
+ * @brief Remove specified device and all its connections
+ * @param device_handle Device unique identifier.
+ * @param error Error class that contains details of this error situation.
+ */
+ virtual void DeviceDisconnected(const DeviceUID& device_handle,
+ const DisconnectDeviceError& error);
+
+ /**
+ * @brief Delete specified connection from the container(map) of connections
+ *and launch event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void DisconnectDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Launch OnDataReceiveDone event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to the raw message.
+ */
+ virtual void DataReceiveDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message);
+
+ /**
+ * @brief Launch OnDataReceiveFailed event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param error Class that contains details of this error situation.
+ */
+ virtual void DataReceiveFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DataReceiveError& error);
+
+ /**
+ * @brief Launch OnDataSendDone event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to raw message.
+ */
+ virtual void DataSendDone(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message);
+
+ /**
+ * @brief Launch OnDataSendFailed event in the device adapter listener.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param message Smart pointer to raw message.
+ * @param error Class that contains details of this error situation.
+ */
+ virtual void DataSendFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message,
+ const DataSendError& error);
+
+ /**
+ * @brief Return name of device.
+ *
+ * @param device_id Device unique identifier.
+ *
+ * @return String with name.
+ */
+ virtual std::string DeviceName(const DeviceUID& device_id) const;
+
+ /**
+ * @brief Allows to obtain connection type used by device.
+ * @return connection type.
+ */
+ virtual std::string GetConnectionType() const;
+
+#ifdef TIME_TESTER
+ /**
+ * @brief Setup observer for time metric.
+ *
+ * @param observer - pointer to observer
+ */
+ void SetTimeMetricObserver(TMMetricObserver* observer);
+
+ /**
+ * @brief Return Time metric observer
+ *
+ * @param return pointer to Time metric observer
+ */
+ virtual TMMetricObserver* GetTimeMetricObserver();
+#endif // TIME_TESTER
+
+
+ protected:
+
+ /**
+ * @brief Store adapter state where applicable
+ */
+ virtual void Store() const;
+
+ /**
+ * @brief Restore adapter state where applicable
+ *
+ * @return True on success false otherwise (or vacuous true)
+ */
+ virtual bool Restore();
+
+ /**
+ * @brief Returns true if \a device is to be connected automatically
+ */
+ virtual bool ToBeAutoConnected(DeviceSptr device) const;
+
+ /**
+ * @brief Find connection that has state - ESTABLISHED.
+ *
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ *
+ * @return ConnectionSptr smart pointer to the connection.
+ */
+ ConnectionSptr FindEstablishedConnection(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) const;
+
+ private:
+ /**
+ * @brief Connect to all applications discovered on device
+ * @param device Pointer to device
+ * @return Error information about connecting applications on device
+ */
+ TransportAdapter::Error ConnectDevice(DeviceSptr device);
+
+ /**
+ * @brief Remove specified device
+ * @param device_handle Device unique identifier.
+ */
+ void RemoveDevice(const DeviceUID& device_handle);
+
+ /**
+ * @brief Listener for device adapter notifications.
+ **/
+ TransportAdapterListenerList listeners_;
+
+ /**
+ * @brief Flag variable that notify initialized device adapter or not.
+ */
+ bool initialised_;
+
+ /**
+ * @brief Structure that holds information about connection.
+ */
+ struct ConnectionInfo {
+ ConnectionSptr connection;
+ DeviceUID device_id;
+ ApplicationHandle app_handle;
+ enum {
+ NEW,
+ ESTABLISHED,
+ FINALISING
+ } state;
+ };
+
+ /**
+ * @brief Type definition of container(map) that holds pair<device unique
+ * identifier, handle of application>(key value) and structure that holds
+ * information
+ * about connection(mapped value).
+ */
+ typedef std::map<std::pair<DeviceUID, ApplicationHandle>, ConnectionInfo>
+ ConnectionMap;
+
+ /**
+ * @brief Map of device handle to device.
+ *
+ * This map contains all currently available devices.
+ **/
+ DeviceMap devices_;
+
+ /**
+ * @brief Mutex restricting access to device map.
+ **/
+ mutable pthread_mutex_t devices_mutex_;
+
+ /**
+ * @brief Container(map) of connections.
+ **/
+ ConnectionMap connections_;
+
+ /**
+ * @brief Mutex restricting access to connections map.
+ **/
+ mutable pthread_mutex_t connections_mutex_;
+
+ protected:
+ /**
+ * @brief Pointer to the device scanner.
+ */
+ DeviceScanner* device_scanner_;
+
+ /**
+ * @brief Pointer to the factory if connections initiated from server.
+ */
+ ServerConnectionFactory* server_connection_factory_;
+
+ /**
+ * @brief Pointer to the factory of connections initiated from client.
+ */
+ ClientConnectionListener* client_connection_listener_;
+
+#ifdef TIME_TESTER
+ /**
+ * @brief Pointer to time metric observer
+ */
+ TMMetricObserver* metric_observer_;
+#endif // TIME_TESTER
+};
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
new file mode 100644
index 0000000000..1adfa0ad2e
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_H_
+
+#include "transport_manager/common.h"
+#include "transport_manager/error.h"
+#include "protocol/common.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapter;
+
+/**
+ * @brief Abstract class for device adapter listener.
+ */
+class TransportAdapterListener {
+ public:
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TransportAdapterListener() {
+ }
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available,
+ * launch event ON_SEARCH_DONE in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ */
+ virtual void OnSearchDeviceDone(
+ const TransportAdapter* transport_adapter) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create search device error,
+ * launch event ON_SEARCH_FAIL in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param error Error class with information about possible reason of search device failure.
+ */
+ virtual void OnSearchDeviceFailed(const TransportAdapter* transport_adapter,
+ const SearchDeviceError& error) = 0;
+
+ /**
+ * @brief Notification by transport adapter that list of known devices has
+ * changed. Updated list can be obtained using
+ * TransportAdapter::GetDeviceList()
+ *
+ * @param transport_adapter Transport adapter that sent notifcation
+ */
+ virtual void OnDeviceListUpdated(
+ const TransportAdapter* transport_adapter) = 0;
+
+ /**
+ * @brief Reaction to "Find new applications" request
+ * @param adapter Current transport adapter
+ */
+ virtual void OnFindNewApplicationsRequest(const TransportAdapter* adapter) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available,
+ * launch event ON_CONNECT_DONE in transport manager.
+ *
+ * @param device_adater Pointer to the device adapter.
+ * @param device_handle Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnConnectDone(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available,
+ * launch event ON_CONNECT_FAIL in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of connect failure.
+ */
+ virtual void OnConnectFailed(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const ConnectError& error) = 0;
+
+ /**
+ * @brief
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void OnConnectRequested(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available,
+ * launch event ON_UNEXPECTED_DISCONNECT in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of unexpected Disconnect.
+ */
+ virtual void OnUnexpectedDisconnect(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const CommunicationError& error) = 0;
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available,
+ * launch event ON_DISCONNECT_DONE in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param devcie_id Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnDisconnectDone(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create Disconnect error,
+ * launch event ON_DISCONNECT_FAIL in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of Disconnect failure.
+ */
+ virtual void OnDisconnectFailed(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DisconnectError& error) = 0;
+
+ /**
+ * @brief
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param devic Device unique identifier.
+ */
+ virtual void OnDisconnectDeviceDone(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle) = 0;
+
+ /**
+ * @brief
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param error Error class with information about possible reason of Disconnect from device failure.
+ */
+ virtual void OnDisconnectDeviceFailed(
+ const TransportAdapter* transport_adapter, const DeviceUID& device_handle,
+ const DisconnectDeviceError& error) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create error,
+ * launch event ON_RECEIVED_DONE in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param devcie Device unique identifier.
+ * @param app_id Handle of application.
+ * @param data_container Smart pointer to the raw message.
+ */
+ virtual void OnDataSendDone(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const RawMessagePtr data_container) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create data receive error,
+ * launch event ON_RECEIVED_DONE in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of data receive failure.
+ */
+ virtual void OnDataSendFailed(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const RawMessagePtr data_container,
+ const DataSendError& error) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create error,
+ * launch event ON_SEND_DONE in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param data_container Smart pointer to the raw message.
+ */
+ virtual void OnDataReceiveDone(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const RawMessagePtr data_container) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create data send error,
+ * launch event ON_SEND_FAIL in transport manager.
+ */
+ virtual void OnDataReceiveFailed(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle,
+ const DataReceiveError& error) = 0;
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers to device adapters to be sure it is available, create error,
+ * launch event ON_COMMUNICATION_ERROR in transport manager.
+ *
+ * @param transport_adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnCommunicationError(const TransportAdapter* transport_adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) = 0;
+};
+
+} // transport_adapter namespace
+} // transport_manager namespace
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
new file mode 100644
index 0000000000..ea01dba49c
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_IMPL_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_IMPL_H_
+
+#include "transport_manager/common.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace transport_manager {
+
+using transport_manager::transport_adapter::TransportAdapter;
+
+class TransportManagerImpl;
+
+/**
+ * @brief Implementation of TransportAdapterListener class.
+ */
+class TransportAdapterListenerImpl
+ : public transport_adapter::TransportAdapterListener {
+ public:
+ /**
+ * @enum Available types of events.
+ */
+ enum EventTypeEnum {
+ ON_SEARCH_DONE = 0,
+ ON_SEARCH_FAIL,
+ ON_DEVICE_LIST_UPDATED,
+ ON_FIND_NEW_APPLICATIONS_REQUEST,
+ ON_CONNECT_DONE,
+ ON_CONNECT_FAIL,
+ ON_DISCONNECT_DONE,
+ ON_DISCONNECT_FAIL,
+ ON_SEND_DONE,
+ ON_SEND_FAIL,
+ ON_RECEIVED_DONE,
+ ON_RECEIVED_FAIL,
+ ON_COMMUNICATION_ERROR,
+ ON_UNEXPECTED_DISCONNECT
+ };
+
+ /**
+ * @brief Constructor.
+ *
+ * @param manager Pointer to the transport manager implementation class.
+ * @param adapter Pointer to the transport adapter associated with listener.
+ */
+ TransportAdapterListenerImpl(TransportManagerImpl* manager,
+ TransportAdapter* adapter);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available,
+ * launch event ON_SEARCH_DONE in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ */
+ virtual void OnSearchDeviceDone(const TransportAdapter* adapter);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available, create search device error,
+ * launch event ON_SEARCH_FAIL in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param error Error class with information about possible reason of search
+ *device failure.
+ */
+ virtual void OnSearchDeviceFailed(const TransportAdapter* adapter,
+ const SearchDeviceError& error);
+
+ /**
+ * @brief Passes notification to TransportManagerImpl
+ *
+ * @param adapter Transport adapter that sent notification
+ */
+ virtual void OnDeviceListUpdated(const TransportAdapter* adapter);
+
+ virtual void OnFindNewApplicationsRequest(const TransportAdapter* adapter);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available,
+ * launch event ON_CONNECT_DONE in transport manager.
+ *
+ * @param device_adater Pointer to the device adapter.
+ * @param device_handle Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnConnectDone(const TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_id);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available,
+ * launch event ON_CONNECT_FAIL in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of failure.
+ */
+ virtual void OnConnectFailed(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const ConnectError& error);
+
+ /**
+ * @brief
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device_handle Device unique identifier.
+ * @param app_handle Handle of application.
+ */
+ virtual void OnConnectRequested(const TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available,
+ * launch event ON_UNEXPECTED_DISCONNECT in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of
+ *unexpected Disconnect.
+ */
+ virtual void OnUnexpectedDisconnect(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const CommunicationError& error);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available,
+ * launch event ON_DISCONNECT_DONE in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param devcie_id Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnDisconnectDone(const TransportAdapter* adapter,
+ const DeviceUID& device_id,
+ const ApplicationHandle& app_id);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available, create Disconnect error,
+ * launch event ON_DISCONNECT_FAIL in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of
+ *Disconnect failure.
+ */
+ virtual void OnDisconnectFailed(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const DisconnectError& error);
+
+ /**
+ * @brief
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param devic Device unique identifier.
+ */
+ virtual void OnDisconnectDeviceDone(const TransportAdapter* adapter,
+ const DeviceUID& device);
+
+ /**
+ * @brief
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param error Error class with information about possible reason of
+ *Disconnect from device failure.
+ */
+ virtual void OnDisconnectDeviceFailed(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const DisconnectDeviceError& error);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available, create error,
+ * launch event ON_RECEIVED_DONE in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param devcie Device unique identifier.
+ * @param app_id Handle of application.
+ * @param data_container Smart pointer to the raw message.
+ */
+ virtual void OnDataReceiveDone(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const RawMessagePtr data_container);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available, create data receive error,
+ * launch event ON_RECEIVED_DONE in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param error Error class with information about possible reason of data
+ *receive failure.
+ */
+ virtual void OnDataReceiveFailed(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const DataReceiveError& error);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available, create error,
+ * launch event ON_SEND_DONE in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ * @param data_container Smart pointer to the raw message.
+ */
+ virtual void OnDataSendDone(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const RawMessagePtr data_container);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ * to device adapters to be sure it is available, create data send error,
+ * launch event ON_SEND_FAIL in transport manager.
+ */
+ virtual void OnDataSendFailed(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id,
+ const RawMessagePtr data_container,
+ const DataSendError& error);
+
+ /**
+ * @brief Search specified device adapter in the container of shared pointers
+ *to device adapters to be sure it is available, create error,
+ * launch event ON_COMMUNICATION_ERROR in transport manager.
+ *
+ * @param adapter Pointer to the device adapter.
+ * @param device Device unique identifier.
+ * @param app_id Handle of application.
+ */
+ virtual void OnCommunicationError(const TransportAdapter* adapter,
+ const DeviceUID& device,
+ const ApplicationHandle& app_id);
+
+ private:
+ TransportManagerImpl* transport_manager_impl_;
+ TransportAdapter* transport_adapter_;
+};
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_transport_adapter_transport_adapter_LISTENER_IMPL_H
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_default.h b/src/components/transport_manager/include/transport_manager/transport_manager_default.h
new file mode 100644
index 0000000000..6857a5c670
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_default.h
@@ -0,0 +1,71 @@
+/*
+ * \file transport_manager_default.h
+ * \brief Transport manager default class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_DEFAULT_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_DEFAULT_H_
+
+#include "utils/singleton.h"
+
+#include "transport_manager/transport_manager_impl.h"
+
+namespace transport_manager {
+
+/**
+ * @brief Default realization of transport_manager_impl class.
+ */
+class TransportManagerDefault : public TransportManagerImpl,
+ public utils::Singleton<TransportManagerDefault> {
+
+ /**
+ * @brief Initialize transport manager.
+ *
+ * @return Code error.
+ */
+ virtual int Init();
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TransportManagerDefault();
+
+ TransportManagerDefault();
+
+ DISALLOW_COPY_AND_ASSIGN(TransportManagerDefault);
+
+ FRIEND_BASE_SINGLETON_CLASS(TransportManagerDefault);
+};
+}
+
+#endif /* TRANSPORT_MANAGER_DEFAULT_H_ */
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
new file mode 100644
index 0000000000..181c4089ed
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
@@ -0,0 +1,461 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
+
+#include <pthread.h>
+
+#ifdef RWLOCK_SUPPORT
+# if (defined(OS_LINUX) && (defined(__USE_UNIX98) || defined(__USE_XOPEN2K))) || \
+ (defined(OS_QNX) && (defined(__EXT_POSIX1_200112)))
+# define USE_RWLOCK
+# endif
+#endif
+
+#include <queue>
+#include <map>
+#include <list>
+#include <algorithm>
+
+#include "utils/timer_thread.h"
+#include "utils/rwlock.h"
+
+#include "transport_manager/transport_manager.h"
+#include "transport_manager/transport_manager_listener.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
+#include "protocol/common.h"
+#ifdef TIME_TESTER
+#include "transport_manager/time_metric_observer.h"
+#endif // TIME_TESTER
+
+namespace transport_manager {
+
+/**
+ * @brief Implementation of transport manager.s
+ */
+class TransportManagerImpl : public TransportManager {
+ public:
+ /**
+ * @brief Hold connection parameters.
+ */
+ struct Connection {
+ ConnectionUID id;
+ DeviceUID device;
+ ApplicationHandle application;
+ };
+
+ private:
+ /**
+ * @brief Structure that contains internal connection parameters
+ */
+ struct ConnectionInternal: public Connection {
+ TransportManagerImpl* transport_manager;
+ TransportAdapter* transport_adapter;
+ typedef timer::TimerThread<ConnectionInternal> TimerInternal;
+ typedef utils::SharedPtr<TimerInternal> TimerInternalSharedPointer;
+ TimerInternalSharedPointer timer;
+ bool shutDown;
+ DeviceHandle device_handle_;
+ int messages_count;
+
+ ConnectionInternal(TransportManagerImpl* transport_manager,
+ TransportAdapter* transport_adapter,
+ const ConnectionUID& id, const DeviceUID& dev_id,
+ const ApplicationHandle& app_id,
+ const DeviceHandle& device_handle);
+ void DisconnectFailedRoutine();
+ };
+ public:
+
+ /**
+ * @brief Destructor.
+ **/
+ virtual ~TransportManagerImpl();
+
+ /**
+ * @brief Initialize transport manager.
+ *
+ * @return Code error.
+ */
+ virtual int Init();
+
+ /**
+ * @brief Start scanning for new devices.
+ *
+ * @return Code error.
+ **/
+ virtual int SearchDevices();
+
+ /**
+ * @brief Connect to all applications discovered on device.
+ *
+ * @param device_id Handle of device to connect to.
+ *
+ * @return Code error.
+ **/
+ virtual int ConnectDevice(const DeviceHandle& device_id);
+
+ /**
+ * @brief Disconnect from all applications connected on device.
+ *
+ * @param device_id Handle of device to Disconnect from.
+ *
+ * @return Code error.
+ **/
+ virtual int DisconnectDevice(const DeviceHandle& device_id);
+
+ /**
+ * @brief Disconnect from applications connected on device by connection
+ *unique identifier.
+ *
+ * @param connection Connection unique identifier.
+ *
+ * @return Code error.
+ **/
+ virtual int Disconnect(const ConnectionUID& connection_id);
+
+ /**
+ * @brief Disconnect and clear all unreceived data.
+ *
+ * @param connection Connection unique identifier.
+ */
+ virtual int DisconnectForce(const ConnectionUID& connection_id);
+ /**
+ * @brief Post new message in queue for massages destined to device.
+ *
+ * @param message Smart pointer to the raw massage.
+ *
+ * @return Code error.
+ **/
+ virtual int SendMessageToDevice(const RawMessagePtr message);
+
+ /**
+ * @brief Post event in the event queue.
+ *
+ * @param event Current event information.
+ *
+ * @return Code error.
+ **/
+ virtual int ReceiveEventFromDevice(const TransportAdapterEvent& event);
+
+ /**
+ * @brief Post listener to the container of transport manager listeners.
+ *
+ * @param listener Pointer to the transport manager listener.
+ *
+ * @return Code error.
+ **/
+ virtual int AddEventListener(TransportManagerListener* listener);
+
+ virtual int Stop();
+
+ /**
+ * @brief Add device adapter to the container of device adapters.
+ *
+ * @param transport_adapter Smart pointer to the device adapter.
+ *
+ * @return Code error.
+ **/
+ virtual int AddTransportAdapter(
+ transport_adapter::TransportAdapter* transport_adapter);
+
+ /**
+ * @brief Remove device from the container that hold devices.
+ *
+ * @param device Handle of device.
+ *
+ * @return Code error.
+ **/
+ virtual int RemoveDevice(const DeviceHandle& device);
+
+ /**
+ * @brief Turns on or off visibility of SDL to mobile devices
+ * when visibility is ON (on_off = true) mobile devices are able to connect
+ * otherwise ((on_off = false)) SDL is not visible from outside
+ *
+ * @return Code error.
+ */
+ virtual int Visibility(const bool& on_off) const;
+
+ /**
+ * @brief Updates total device list with info from specific transport adapter.
+ * @param ta Transport adapter
+ */
+ void UpdateDeviceList(TransportAdapter* ta);
+
+#ifdef TIME_TESTER
+ /**
+ * @brief Setup observer for time metric.
+ *
+ * @param observer - pointer to observer
+ */
+ void SetTimeMetricObserver(TMMetricObserver* observer);
+#endif // TIME_TESTER
+
+
+ /**
+ * @brief Constructor.
+ **/
+ TransportManagerImpl();
+
+ protected:
+
+ template <class Proc, class... Args>
+ void RaiseEvent(Proc proc, Args... args) {
+ for (TransportManagerListenerList::iterator it =
+ transport_manager_listener_.begin();
+ it != transport_manager_listener_.end(); ++it) {
+ ((*it)->*proc)(args...);
+ }
+ }
+
+ /**
+ * @brief Put massage in the container of massages.
+ *
+ * @param message Smart pointer to the raw massage.
+ **/
+ void PostMessage(const RawMessagePtr message);
+
+ /**
+ * @brief update message in queue
+ *
+ * @param message shared pointer to raw massage
+ *
+ * @see @ref components_transportmanager_client_connection_management
+ **/
+ /*not clear when this function shall be used
+ * void updateMessage(const RawMessagePtr old_message, const RawMessagePtr
+ * new_message);*/
+
+ /**
+ * @brief Remove message from the container of massages.
+ *
+ * @param message Smart pointer to the raw massage.
+ **/
+ void RemoveMessage(const RawMessagePtr message);
+
+ /**
+ * @brief Post event to the container of events.
+ *
+ * @param event Event of device adapter.
+ **/
+ void PostEvent(const TransportAdapterEvent& event);
+
+ /**
+ * @brief Type definition of container that holds smart pointer to the raw
+ *massages.
+ **/
+ typedef std::list<RawMessagePtr> MessageQueue;
+
+ /**
+ * @brief Type definition of container that holds events of device adapters.
+ **/
+ typedef std::vector<TransportAdapterEvent> EventQueue;
+
+ static void* MessageQueueStartThread(void* data);
+
+ /**
+ * @brief Scan message's queue and pull messages according to priority and
+ *serial number
+ *
+ * @param
+ *
+ * @see @ref components_transportmanager_client_connection_management
+ */
+ void MessageQueueThread();
+
+ /**
+ * @brief Launch EventListenerThread().
+ */
+ static void* EventListenerStartThread(void*);
+ /**
+ * @brief wait until event happens
+ *
+ * @param
+ *
+ * @see @ref components_transportmanager_client_connection_management
+ */
+ void EventListenerThread();
+
+ /**
+ * @brief store messages
+ *
+ * @see @ref components_transportmanager_client_connection_management
+ **/
+ MessageQueue message_queue_;
+
+ /**
+ * @brief Mutex restricting access to messages.
+ **/
+
+#ifdef USE_RWLOCK
+ mutable sync_primitives::RWLock message_queue_rwlock_;
+#endif
+ mutable pthread_mutex_t message_queue_mutex_;
+
+ pthread_cond_t message_queue_cond_;
+
+ /**
+ * @brief store events from comming device
+ *
+ * @see @ref components_transportmanager_client_connection_management
+ **/
+ EventQueue event_queue_;
+
+ /**
+ * @brief flag that indicates that thread is active
+ * if it is false then threads exist main loop
+ **/
+ volatile bool all_thread_active_;
+
+ typedef std::list<TransportManagerListener*> TransportManagerListenerList;
+ /**
+ * @brief listener that would be called when TM's event happened.
+ **/
+ TransportManagerListenerList transport_manager_listener_;
+
+ // TODO(Eamakhov): change to threads::Thread usage
+ /**
+ * @brief ID of message queue processing thread
+ **/
+ pthread_t message_queue_thread_;
+
+ /**
+ * @brief Conditional event thread
+ **/
+ pthread_t event_queue_thread_;
+
+ /**
+ * @brief Condition variable to wake up event
+ **/
+ pthread_cond_t device_listener_thread_wakeup_;
+
+ /**
+ * @brief Mutex restricting access to events.
+ **/
+
+#ifdef USE_RWLOCK
+ mutable sync_primitives::RWLock event_queue_rwlock_;
+#endif
+ mutable pthread_mutex_t event_queue_mutex_;
+
+ /**
+ * @brief Flag that TM is initialized
+ */
+ bool is_initialized_;
+
+#ifdef TIME_TESTER
+ TMMetricObserver* metric_observer_;
+#endif // TIME_TESTER
+
+ private:
+ /**
+ * @brief Structure that contains conversion functions (Device ID -> Device
+ * Handle; Device Handle -> Device ID)
+ */
+ struct Handle2GUIDConverter {
+ typedef std::vector<DeviceUID> ConversionTable;
+
+ DeviceHandle UidToHandle(const DeviceUID& dev_uid) {
+ bool is_new = true;
+ return UidToHandle(dev_uid, is_new);
+ }
+
+ DeviceHandle UidToHandle(const DeviceUID& dev_uid, bool& is_new) {
+ ConversionTable::iterator it = std::find(
+ conversion_table_.begin(), conversion_table_.end(), dev_uid);
+ if (it != conversion_table_.end()) {
+ is_new = false;
+ return std::distance(conversion_table_.begin(), it) +
+ 1; // handle begin since 1 (one)
+ }
+ is_new = true;
+ conversion_table_.push_back(dev_uid);
+ return conversion_table_.size(); // handle begin since 1 (one)
+ }
+
+ DeviceUID HandleToUid(DeviceHandle handle) {
+ if (handle == 0 || handle > conversion_table_.size()) {
+ return DeviceUID();
+ }
+ return conversion_table_[handle - 1]; // handle begin since 1 (one)
+ }
+
+ ConversionTable conversion_table_;
+ };
+
+ /**
+ * @brief Converter variable (Device ID -> Device Handle; Device Handle ->
+ * Device ID)
+ */
+ Handle2GUIDConverter converter_;
+
+ explicit TransportManagerImpl(const TransportManagerImpl&);
+ int connection_id_counter_;
+ std::vector<ConnectionInternal> connections_;
+ std::map<DeviceUID, TransportAdapter*> device_to_adapter_map_;
+ std::vector<TransportAdapter*> transport_adapters_;
+ /** For keep listeners which were add TMImpl */
+ std::map<TransportAdapter*, TransportAdapterListenerImpl*>
+ transport_adapter_listeners_;
+
+ typedef std::vector<std::pair<const TransportAdapter*, DeviceInfo> >
+ DeviceInfoList;
+ DeviceInfoList device_list_;
+
+ void AddConnection(const ConnectionInternal& c);
+ void RemoveConnection(uint32_t id);
+ ConnectionInternal* GetConnection(const ConnectionUID& id);
+ ConnectionInternal* GetConnection(const DeviceUID& device,
+ const ApplicationHandle& application);
+
+ void AddDataToContainer(
+ ConnectionUID id,
+ std::map<ConnectionUID, std::pair<unsigned int, unsigned char*> >&
+ container,
+ unsigned char* data, unsigned int data_size);
+ bool GetFrameSize(unsigned char* data, unsigned int data_size,
+ unsigned int& frame_size);
+ bool GetFrame(std::map<ConnectionUID,
+ std::pair<unsigned int, unsigned char*> >& container,
+ ConnectionUID id, unsigned int frame_size,
+ unsigned char** frame);
+
+ void OnDeviceListUpdated(TransportAdapter* ta);
+ static Connection convert(const ConnectionInternal& p);
+};
+// class ;
+
+} // namespace transport_manager
+
+#endif
diff --git a/src/components/transport_manager/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h
new file mode 100644
index 0000000000..283d224536
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/common.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_COMMON_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_COMMON_H_
+
+#include <stdint.h>
+
+#include "utils/shared_ptr.h"
+
+#if defined(__QNXNTO__)
+#include "transport_manager/usb/qnx/usb_handler.h"
+#else
+#include "transport_manager/usb/libusb/usb_handler.h"
+#endif
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+static const uint16_t kAoaVid = 0x18d1;
+static const uint16_t kAoaPid1 = 0x2d00;
+static const uint16_t kAoaPid2 = 0x2d01;
+static const uint8_t kAoaInterfaceSubclass = 0xff;
+
+static const uint16_t kAppleVid = 0x05ac;
+static const uint16_t kApplePid1 = 0x1290; // iPhone
+static const uint16_t kApplePid2 = 0x1292; // iPhone 3G
+static const uint16_t kApplePid3 = 0x1294; // iPhone 3GS
+static const uint16_t kApplePid4 = 0x1297; // iPhone 4
+static const uint16_t kApplePid5 = 0x129a; // iPad
+static const uint16_t kApplePid6 = 0x129f; // iPad 2
+static const uint16_t kApplePid7 = 0x12a0; // iPhone 4S
+static const uint16_t kApplePid8 = 0x12a8; // iPhone 5
+
+static const int kUsbConfiguration = 1;
+
+typedef utils::SharedPtr<UsbHandler> UsbHandlerSptr;
+
+class UsbDeviceListener {
+ public:
+ virtual ~UsbDeviceListener() {}
+
+ UsbHandlerSptr GetUsbHandler() { return usb_handler_; }
+
+ void SetUsbHandler(UsbHandlerSptr usb_handler) {
+ usb_handler_ = usb_handler;
+ usb_handler_->usb_device_listeners_.push_back(this);
+ }
+
+ virtual void OnDeviceArrived(PlatformUsbDevice* device) = 0;
+ virtual void OnDeviceLeft(PlatformUsbDevice* device) = 0;
+
+ private:
+ UsbHandlerSptr usb_handler_;
+};
+
+inline bool IsGoogleAccessory(const PlatformUsbDevice* device) {
+ return (kAoaVid == device->vendor_id()) &&
+ ((kAoaPid1 == device->product_id()) || (kAoaPid2 == device->product_id()));
+}
+
+inline bool IsAppleIAPDevice(const PlatformUsbDevice* device) {
+ return (kAppleVid == device->vendor_id()) &&
+ ((kApplePid1 == device->product_id()) ||
+ (kApplePid2 == device->product_id()) ||
+ (kApplePid3 == device->product_id()) ||
+ (kApplePid4 == device->product_id()) ||
+ (kApplePid5 == device->product_id()) ||
+ (kApplePid6 == device->product_id()) ||
+ (kApplePid7 == device->product_id()));
+}
+
+inline bool IsAppleIAP2Device(const PlatformUsbDevice* device) {
+ return (kAppleVid == device->vendor_id()) &&
+ (kApplePid8 == device->product_id());
+}
+
+inline bool IsAppleDevice(const PlatformUsbDevice* device) {
+ return IsAppleIAPDevice(device) || IsAppleIAP2Device(device);
+}
+
+} // namespace
+} // namespace
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_COMMON_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
new file mode 100644
index 0000000000..d1f485c9d5
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
@@ -0,0 +1,78 @@
+/**
+ * \file platform_usb_device.h
+ * \brief libusb PlatformUsbDevice class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
+
+#include <string>
+#include <libusb/libusb.h>
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class PlatformUsbDevice {
+ public:
+ uint8_t bus_number() const { return bus_number_; }
+ uint8_t address() const { return address_; }
+ uint16_t vendor_id() const { return vendor_id_; }
+ uint16_t product_id() const { return product_id_; }
+ std::string GetManufacturer() const;
+ std::string GetProductName() const;
+ std::string GetSerialNumber() const;
+ PlatformUsbDevice(uint8_t bus, uint8_t address,
+ const libusb_device_descriptor& device_descriptor,
+ libusb_device* device_libusb,
+ libusb_device_handle* device_handle_libusb);
+ libusb_device_handle* GetLibusbHandle() { return libusb_device_handle_; }
+ libusb_device* GetLibusbDevice() { return libusb_device_; }
+
+ private:
+ std::string GetDescString(uint8_t index) const;
+
+ private:
+ uint8_t bus_number_;
+ uint8_t address_;
+ uint16_t vendor_id_;
+ uint16_t product_id_;
+ libusb_device_descriptor device_descriptor_;
+ libusb_device_handle* libusb_device_handle_;
+ libusb_device* libusb_device_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
new file mode 100644
index 0000000000..868f7d59fd
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2013-2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_CONNECTION_H_
+
+#include <list>
+
+#include "utils/lock.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/usb/common.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class UsbConnection : public Connection {
+ public:
+ UsbConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller,
+ const UsbHandlerSptr& usb_handler, PlatformUsbDevice* device);
+ bool Init();
+ virtual ~UsbConnection();
+
+ protected:
+ virtual TransportAdapter::Error SendData(RawMessagePtr message);
+ virtual TransportAdapter::Error Disconnect();
+
+ private:
+ void PopOutMessage();
+ bool PostInTransfer();
+ bool PostOutTransfer();
+ void OnInTransfer(struct libusb_transfer*);
+ void OnOutTransfer(struct libusb_transfer*);
+ void Finalise();
+ void AbortConnection();
+ bool FindEndpoints();
+
+ const DeviceUID device_uid_;
+ const ApplicationHandle app_handle_;
+ TransportAdapterController* controller_;
+ UsbHandlerSptr usb_handler_;
+ libusb_device* libusb_device_;
+ libusb_device_handle* device_handle_;
+ uint8_t in_endpoint_;
+ uint16_t in_endpoint_max_packet_size_;
+ uint8_t out_endpoint_;
+ uint16_t out_endpoint_max_packet_size_;
+ unsigned char* in_buffer_;
+ libusb_transfer* in_transfer_;
+ libusb_transfer* out_transfer_;
+
+ std::list<RawMessagePtr> out_messages_;
+ RawMessagePtr current_out_message_;
+ sync_primitives::Lock out_messages_mutex_;
+ size_t bytes_sent_;
+ bool disconnecting_;
+ bool waiting_in_transfer_cancel_;
+ bool waiting_out_transfer_cancel_;
+ friend void InTransferCallback(struct libusb_transfer*);
+ friend void OutTransferCallback(struct libusb_transfer*);
+};
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_CONNECTION_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
new file mode 100644
index 0000000000..fd6e77013a
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h
@@ -0,0 +1,101 @@
+/**
+ * \file usb_handler.h
+ * \brief libusb USB handler class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
+
+#include <pthread.h>
+
+#include <libusb/libusb.h>
+
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/usb/usb_control_transfer.h"
+#include "transport_manager/usb/libusb/platform_usb_device.h"
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class UsbHandler {
+ public:
+ UsbHandler();
+ ~UsbHandler();
+ void StartControlTransferSequence(UsbControlTransferSequence* sequence,
+ PlatformUsbDevice* device);
+ TransportAdapter::Error Init();
+
+ public:
+ void CloseDeviceHandle(libusb_device_handle* device_handle);
+
+ private:
+ class ControlTransferSequenceState;
+
+ void Thread();
+ void DeviceArrived(libusb_device* device);
+ void DeviceLeft(libusb_device* device);
+
+ void ControlTransferCallback(libusb_transfer* transfer);
+ void SubmitControlTransfer(ControlTransferSequenceState* sequence_state);
+ friend void UsbTransferSequenceCallback(libusb_transfer* transfer);
+
+ private:
+ bool shutdown_requested_;
+ // TODO(Eamakhov): change to threads::Thread usage
+ pthread_t thread_;
+
+ friend class UsbDeviceListener;
+ std::list<class UsbDeviceListener*> usb_device_listeners_;
+
+ typedef std::vector<PlatformUsbDevice*> Devices;
+ Devices devices_;
+
+ typedef std::list<ControlTransferSequenceState*> TransferSequences;
+ TransferSequences transfer_sequences_;
+ std::list<libusb_device_handle*> device_handles_to_close_;
+ libusb_context* libusb_context_;
+ libusb_hotplug_callback_handle arrived_callback_handle_;
+ libusb_hotplug_callback_handle left_callback_handle_;
+
+ friend void* UsbHandlerThread(void* data);
+ friend int ArrivedCallback(libusb_context* context, libusb_device* device,
+ libusb_hotplug_event event, void* data);
+ friend int LeftCallback(libusb_context* context, libusb_device* device,
+ libusb_hotplug_event event, void* data);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_USB_HANDLER_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
new file mode 100644
index 0000000000..939a8fcb3c
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/platform_usb_device.h
@@ -0,0 +1,78 @@
+/**
+ * \file platform_usb_device.h
+ * \brief QNX PlatfromUsbDevice class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_PLATFORM_USB_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_PLATFORM_USB_DEVICE_H_
+
+#include <string>
+#include <sys/usbdi.h>
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class PlatformUsbDevice {
+ public:
+ uint8_t bus_number() const { return bus_number_; }
+ uint8_t address() const { return address_; }
+ uint16_t vendor_id() const { return vendor_id_; }
+ uint16_t product_id() const { return product_id_; }
+ std::string GetManufacturer() const;
+ std::string GetProductName() const;
+ std::string GetSerialNumber() const;
+ PlatformUsbDevice(usbd_device_instance_t* instance, usbd_device* device,
+ const usbd_device_descriptor_t& device_descriptor);
+ const usbd_device_instance_t& GetDeviceInstance() {
+ return usbd_device_instance_;
+ }
+ usbd_device* GetUsbdDevice() { return usbd_device_; }
+
+ private:
+ std::string GetDescString(uint8_t index) const;
+
+ private:
+ uint8_t bus_number_;
+ uint8_t address_;
+ uint16_t vendor_id_;
+ uint16_t product_id_;
+ usbd_device_descriptor_t device_descriptor_;
+ usbd_device_instance_t usbd_device_instance_;
+ usbd_device* usbd_device_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_PLATFORM_USB_DEVICE_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
new file mode 100644
index 0000000000..47a25907d5
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_connection.h
@@ -0,0 +1,101 @@
+/**
+ * \file usb_connection.h
+ * \brief UsbConnection class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_CONNECTION_H_
+
+#include <pthread.h>
+
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/usb/common.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class UsbConnection : public Connection {
+ static const uint32_t kInBufferSize = 2048;
+ public:
+ UsbConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller,
+ const UsbHandlerSptr& libusb_handler,
+ PlatformUsbDevice* device);
+
+ bool Init();
+
+ virtual ~UsbConnection();
+ protected:
+ virtual TransportAdapter::Error SendData(RawMessagePtr message);
+ virtual TransportAdapter::Error Disconnect();
+ private:
+ friend void InTransferCallback(usbd_urb* urb, usbd_pipe*, void*);
+ friend void OutTransferCallback(usbd_urb* urb, usbd_pipe*, void*);
+ bool OpenEndpoints();
+ void PopOutMessage();
+ bool PostInTransfer();
+ bool PostOutTransfer();
+ void OnInTransfer(usbd_urb* urb);
+ void OnOutTransfer(usbd_urb* urb);
+ void Finalise();
+
+ const DeviceUID device_uid_;
+ const ApplicationHandle app_handle_;
+ TransportAdapterController* controller_;
+ UsbHandlerSptr libusb_handler_;
+ usbd_device* usbd_device_;
+
+ usbd_pipe* in_pipe_;
+ usbd_pipe* out_pipe_;
+
+ unsigned char* in_buffer_;
+ void* out_buffer_;
+
+ usbd_urb* in_urb_;
+ usbd_urb* out_urb_;
+
+ std::list<RawMessagePtr> out_messages_;
+ RawMessagePtr current_out_message_;
+ pthread_mutex_t out_messages_mutex_;
+ size_t bytes_sent_;
+ bool disconnecting_;
+ bool pending_in_transfer_;
+ bool pending_out_transfer_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_CONNECTION_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
new file mode 100644
index 0000000000..26b00087ff
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/qnx/usb_handler.h
@@ -0,0 +1,85 @@
+/**
+ * \file usb_handler.h
+ * \brief QNX USB handler class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_HANDLER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_HANDLER_H_
+
+#include <sys/usbdi.h>
+
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/usb/usb_control_transfer.h"
+#include "transport_manager/usb/qnx/platform_usb_device.h"
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class UsbHandler {
+ public:
+ UsbHandler();
+ ~UsbHandler();
+ void StartControlTransferSequence(UsbControlTransferSequence* sequence,
+ PlatformUsbDevice* device);
+ TransportAdapter::Error Init();
+
+ private:
+ void DeviceArrived(usbd_connection* connection,
+ usbd_device_instance_t* instance);
+ void DeviceLeft(usbd_device_instance_t* instance);
+
+ private:
+ friend class UsbDeviceListener;
+ std::list<class UsbDeviceListener*> usb_device_listeners_;
+
+ typedef std::vector<PlatformUsbDevice*> Devices;
+ Devices devices_;
+
+ struct usbd_connection* usbd_general_connection_;
+ struct usbd_connection* usbd_aoa_connection_;
+
+ friend void ArrivedCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance);
+ friend void LeftCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance);
+ friend void ArrivedAoaCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance);
+ friend void LeftAoaCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_QNX_USB_HANDLER_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
new file mode 100644
index 0000000000..55fb028ef7
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h
@@ -0,0 +1,64 @@
+/**
+ * \file usb_aoa_adapter.h
+ * \brief UsbAoaAdapter class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_AOA_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_AOA_ADAPTER_H_
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/common.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class UsbAoaAdapter : public TransportAdapterImpl {
+ public:
+ UsbAoaAdapter();
+ virtual ~UsbAoaAdapter();
+
+ protected:
+ virtual DeviceType GetDeviceType() const;
+ virtual bool IsInitialised() const;
+ virtual TransportAdapter::Error Init();
+ virtual bool ToBeAutoConnected(DeviceSptr device) const;
+
+ private:
+ bool is_initialised_;
+ UsbHandlerSptr usb_handler_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_AOA_ADAPTER
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h b/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h
new file mode 100644
index 0000000000..ed0fda91ee
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h
@@ -0,0 +1,67 @@
+/**
+ * \file usb_connection_factory.h
+ * \brief UsbConnectionFactory class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONNECTION_FACTORY_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONNECTION_FACTORY_H_
+
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/usb/common.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class UsbConnectionFactory : public ServerConnectionFactory {
+ public:
+ UsbConnectionFactory(TransportAdapterController* controller);
+ void SetUsbHandler(const UsbHandlerSptr& usb_handler);
+
+ protected:
+ virtual TransportAdapter::Error Init();
+ virtual TransportAdapter::Error CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle);
+ virtual void Terminate();
+ virtual bool IsInitialised() const;
+ virtual ~UsbConnectionFactory();
+
+ private:
+ TransportAdapterController* controller_;
+ UsbHandlerSptr usb_handler_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h b/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
new file mode 100644
index 0000000000..8c4f8a9d4c
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h
@@ -0,0 +1,105 @@
+/**
+ * \file aoa_common.h
+ * \brief Google AOA protocol header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONTROL_TRANSFER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONTROL_TRANSFER_H_
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class UsbControlTransfer;
+class UsbControlInTransfer;
+class UsbControlOutTransfer;
+
+class UsbControlTransfer {
+ public:
+ enum TransferDirection {
+ IN,
+ OUT
+ };
+
+ enum RequestType {
+ VENDOR
+ };
+
+ virtual ~UsbControlTransfer() {}
+ virtual TransferDirection Direction() const = 0;
+ virtual RequestType Type() const = 0;
+ virtual uint8_t Request() const = 0;
+ virtual uint16_t Value() const = 0;
+ virtual uint16_t Index() const = 0;
+ virtual uint16_t Length() const = 0;
+};
+
+class UsbControlInTransfer : public UsbControlTransfer {
+ public:
+ virtual ~UsbControlInTransfer() {}
+ virtual TransferDirection Direction() const { return IN; }
+ virtual bool OnCompleted(unsigned char* data) const = 0;
+};
+
+class UsbControlOutTransfer : public UsbControlTransfer {
+ public:
+ virtual ~UsbControlOutTransfer() {}
+ virtual TransferDirection Direction() const { return OUT; }
+ virtual const char* Data() const = 0;
+};
+
+class UsbControlTransferSequence {
+ public:
+ typedef std::list<UsbControlTransfer*> Transfers;
+ const Transfers& transfers() const { return transfers_; }
+
+ virtual ~UsbControlTransferSequence() {
+ for (Transfers::iterator it = transfers_.begin(); it != transfers_.end();
+ ++it) {
+ delete *it;
+ }
+ }
+
+ protected:
+ void AddTransfer(UsbControlTransfer* transfer) {
+ transfers_.push_back(transfer);
+ }
+
+ private:
+ Transfers transfers_;
+};
+
+} // namespace
+} // namespace
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONTROL_TRANSFER_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
new file mode 100644
index 0000000000..48c5867f90
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * \file usb_device.h
+ * \brief UsbDevice class header file.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_H_
+
+#include "transport_manager/transport_adapter/device.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class UsbDevice : public Device {
+ public:
+ UsbDevice(PlatformUsbDevice* usb_device, const std::string& name,
+ const DeviceUID& unique_device_id)
+ : Device(name, unique_device_id), usb_device_(usb_device) {}
+
+ PlatformUsbDevice* usb_device() const { return usb_device_; }
+
+ protected:
+ virtual ~UsbDevice() {}
+
+ virtual bool IsSameAs(const Device* other_device) const {
+ return unique_device_id() == other_device->unique_device_id();
+ }
+
+ virtual ApplicationList GetApplicationList() const {
+ ApplicationList app_list;
+ app_list.push_back(1);
+ return app_list;
+ }
+
+ private:
+ PlatformUsbDevice* usb_device_;
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
new file mode 100644
index 0000000000..0937222155
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
@@ -0,0 +1,78 @@
+/**
+ * \file usb_device_scanner.h
+ * \brief UsbDeviceScanner class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_DEVICE_SCANNER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_DEVICE_SCANNER_H_
+
+#include <list>
+
+#include <pthread.h>
+
+#include "transport_manager/transport_adapter/device_scanner.h"
+#include "transport_manager/usb/common.h"
+
+namespace transport_manager {
+
+namespace transport_adapter {
+
+class UsbDeviceScanner : public DeviceScanner, public UsbDeviceListener {
+ public:
+ UsbDeviceScanner(class TransportAdapterController* controller);
+ virtual ~UsbDeviceScanner();
+
+ protected:
+ virtual TransportAdapter::Error Init();
+ virtual TransportAdapter::Error Scan();
+ virtual void Terminate();
+ virtual bool IsInitialised() const;
+ virtual void OnDeviceArrived(PlatformUsbDevice* device);
+ virtual void OnDeviceLeft(PlatformUsbDevice* device);
+
+ private:
+ void UpdateList();
+ void TurnIntoAccessoryMode(PlatformUsbDevice* device);
+ void SupportedDeviceFound(PlatformUsbDevice* device);
+
+ TransportAdapterController* controller_;
+
+ typedef std::list<PlatformUsbDevice*> Devices;
+ Devices devices_;
+ pthread_mutex_t devices_mutex_;
+};
+
+} // namespace
+} // namespace
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_DEVICE_SCANNER
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
new file mode 100644
index 0000000000..421104422b
--- /dev/null
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -0,0 +1,82 @@
+/**
+ * \file bluetooth_connection_factory.cc
+ * \brief BluetoothConnectionFactory class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+BluetoothConnectionFactory::BluetoothConnectionFactory(
+ TransportAdapterController* controller)
+ : controller_(controller) {
+}
+
+TransportAdapter::Error BluetoothConnectionFactory::Init() {
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error BluetoothConnectionFactory::CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. device_uid: " << &device_uid << ", app_handle: " <<
+ &app_handle);
+ BluetoothSocketConnection* connection(
+ new BluetoothSocketConnection(device_uid, app_handle, controller_));
+ TransportAdapter::Error error = connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_, "connection::Start() failed");
+ delete connection;
+ }
+ LOG4CXX_TRACE(logger_, "exit with error: " << error);
+ return error;
+}
+
+void BluetoothConnectionFactory::Terminate() {
+}
+
+bool BluetoothConnectionFactory::IsInitialised() const {
+ return true;
+}
+
+BluetoothConnectionFactory::~BluetoothConnectionFactory() {
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
new file mode 100644
index 0000000000..1a47f6c7ff
--- /dev/null
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device.cc
@@ -0,0 +1,112 @@
+/*
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/bluetooth/bluetooth_device.h"
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <algorithm>
+#include <limits>
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+bool BluetoothDevice::GetRfcommChannel(const ApplicationHandle app_handle,
+ uint8_t* channel_out) {
+ LOG4CXX_TRACE(logger_, "enter. app_handle: " << app_handle << ", channel_out: " <<
+ channel_out);
+ if (app_handle < 0 || app_handle > std::numeric_limits<uint8_t>::max()) {
+ LOG4CXX_TRACE(logger_,
+ "exit with FALSE. Condition: app_handle < 0 || app_handle > numeric_limits::max()");
+ return false;
+ }
+ const uint8_t channel = static_cast<uint8_t>(app_handle);
+ RfcommChannelVector::const_iterator it = std::find(rfcomm_channels_.begin(),
+ rfcomm_channels_.end(),
+ channel);
+ if (it == rfcomm_channels_.end()) {
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: channel not found in RfcommChannelVector");
+ return false;
+ }
+ *channel_out = channel;
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+std::string BluetoothDevice::GetUniqueDeviceId(const bdaddr_t& device_address) {
+ LOG4CXX_TRACE(logger_, "enter. device_adress: " << &device_address);
+ char device_address_string[32];
+ ba2str(&device_address, device_address_string);
+ LOG4CXX_TRACE(logger_, "exit with BT-" << device_address_string);
+ return std::string("BT-") + device_address_string;
+}
+
+BluetoothDevice::BluetoothDevice(const bdaddr_t& device_address, const char* device_name,
+ const RfcommChannelVector& rfcomm_channels)
+ : Device(device_name, GetUniqueDeviceId(device_address)),
+ address_(device_address),
+ rfcomm_channels_(rfcomm_channels) {
+}
+
+bool BluetoothDevice::IsSameAs(const Device* other) const {
+ LOG4CXX_TRACE(logger_, "enter. device: " << other);
+ bool result = false;
+
+ const BluetoothDevice* other_bluetooth_device =
+ dynamic_cast<const BluetoothDevice*>(other);
+
+ if (0 != other_bluetooth_device) {
+ if (0
+ == memcmp(&address_, &other_bluetooth_device->address_,
+ sizeof(bdaddr_t))) {
+ result = true;
+ }
+ }
+ if (result) {
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ }
+ return result;
+}
+
+ApplicationList BluetoothDevice::GetApplicationList() const {
+ return ApplicationList(rfcomm_channels_.begin(), rfcomm_channels_.end());
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
new file mode 100644
index 0000000000..e440ccb830
--- /dev/null
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -0,0 +1,497 @@
+/**
+ * \file bluetooth_device_scanner.cc
+ * \brief BluetoothDeviceScanner class header file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/bluetooth/bluetooth_device_scanner.h"
+
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+#include <bluetooth/rfcomm.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <vector>
+#include <sstream>
+#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
+#include "transport_manager/bluetooth/bluetooth_device.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+namespace {
+char* SplitToAddr(char* dev_list_entry) {
+ char* bl_address = strtok(dev_list_entry, "()");
+ if (bl_address != NULL) {
+ bl_address = strtok(NULL, "()");
+ return bl_address;
+ } else {
+ return NULL;
+ }
+}
+
+int FindPairedDevs(std::vector<bdaddr_t>* result) {
+ LOG4CXX_TRACE(logger_, "enter. result adress: " << result);
+ DCHECK(result != NULL);
+
+ const char* cmd = "bt-device -l";
+
+ FILE* pipe = popen(cmd, "r");
+ if (!pipe) {
+ LOG4CXX_TRACE(logger_, "exit -1. Condition: !pipe");
+ return -1;
+ }
+ char* buffer = new char[1028];
+ size_t counter = 0;
+ while (fgets(buffer, 1028, pipe) != NULL) {
+ if (0 < counter++) { // skip first line
+ char* bt_address = SplitToAddr(buffer);
+ if (bt_address) {
+ bdaddr_t address;
+ str2ba(bt_address, &address);
+ result->push_back(address);
+ }
+ }
+ delete [] buffer;
+ buffer = new char[1028];
+ }
+ pclose(pipe);
+ LOG4CXX_TRACE(logger_, "exit with 0");
+ return 0;
+}
+} // namespace
+
+BluetoothDeviceScanner::BluetoothDeviceScanner(
+ TransportAdapterController* controller, bool auto_repeat_search,
+ int auto_repeat_pause_sec)
+ : controller_(controller),
+ thread_(NULL),
+ shutdown_requested_(false),
+ ready_(true),
+ device_scan_requested_(false),
+ device_scan_requested_lock_(),
+ device_scan_requested_cv_(),
+ auto_repeat_search_(auto_repeat_search),
+ auto_repeat_pause_sec_(auto_repeat_pause_sec) {
+ uint8_t smart_device_link_service_uuid_data[] = { 0x93, 0x6D, 0xA0, 0x1F,
+ 0x9A, 0xBD, 0x4D, 0x9D, 0x80, 0xC7, 0x02, 0xAF, 0x85, 0xC8, 0x22, 0xA8
+ };
+ sdp_uuid128_create(&smart_device_link_service_uuid_,
+ smart_device_link_service_uuid_data);
+ thread_ = new threads::Thread("BT Device Scaner", new BluetoothDeviceScannerDelegate(this));
+}
+
+BluetoothDeviceScanner::~BluetoothDeviceScanner() {
+}
+
+
+bool BluetoothDeviceScanner::IsInitialised() const {
+ return thread_->is_running();
+}
+
+void BluetoothDeviceScanner::UpdateTotalDeviceList() {
+ LOG4CXX_TRACE(logger_, "enter");
+ DeviceVector devices;
+ devices.insert(devices.end(), paired_devices_with_sdl_.begin(),
+ paired_devices_with_sdl_.end());
+ devices.insert(devices.end(), found_devices_with_sdl_.begin(),
+ found_devices_with_sdl_.end());
+ controller_->SearchDeviceDone(devices);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void BluetoothDeviceScanner::DoInquiry() {
+ LOG4CXX_TRACE(logger_, "enter");
+
+ const int device_id = hci_get_route(0);
+ if (device_id < 0) {
+ LOG4CXX_INFO(logger_, "HCI device is not available");
+ shutdown_requested_ = true;
+ controller_->SearchDeviceFailed(SearchDeviceError());
+ LOG4CXX_TRACE(logger_, "exit. Condition: device_id < 0");
+ return;
+ }
+
+ int device_handle = hci_open_dev(device_id);
+ if (device_handle < 0) {
+ controller_->SearchDeviceFailed(SearchDeviceError());
+ LOG4CXX_TRACE(logger_, "exit. Condition: device_handle < 0");
+ return;
+ }
+
+ if (paired_devices_.empty()) {
+ LOG4CXX_INFO(logger_, "Searching for paired devices.");
+ if (-1 == FindPairedDevs(&paired_devices_)) {
+ LOG4CXX_ERROR(logger_, "Failed to retrieve list of paired devices.");
+ controller_->SearchDeviceFailed(SearchDeviceError());
+ }
+ }
+
+ LOG4CXX_INFO(logger_, "Check rfcomm channel on "
+ << paired_devices_.size() << " paired devices.");
+
+ paired_devices_with_sdl_.clear();
+ CheckSDLServiceOnDevices(paired_devices_, device_handle,
+ &paired_devices_with_sdl_);
+ UpdateTotalDeviceList();
+
+ LOG4CXX_INFO(logger_, "Starting hci_inquiry on device " << device_id);
+ const uint8_t inquiry_time = 8u; // Time unit is 1.28 seconds
+ const size_t max_devices = 256u;
+ inquiry_info* inquiry_info_list = new inquiry_info[max_devices];
+
+ const int number_of_devices = hci_inquiry(device_id, inquiry_time,
+ max_devices, 0, &inquiry_info_list,
+ IREQ_CACHE_FLUSH);
+
+ if (number_of_devices >= 0) {
+ LOG4CXX_INFO(logger_,
+ "hci_inquiry: found " << number_of_devices << " devices");
+ std::vector < bdaddr_t > found_devices(number_of_devices);
+ for (int i = 0; i < number_of_devices; ++i) {
+ found_devices[i] = inquiry_info_list[i].bdaddr;
+ }
+ found_devices_with_sdl_.clear();
+ CheckSDLServiceOnDevices(found_devices, device_handle,
+ &found_devices_with_sdl_);
+ }
+ UpdateTotalDeviceList();
+
+ close(device_handle);
+ delete[] inquiry_info_list;
+
+ if (number_of_devices < 0) {
+ LOG4CXX_DEBUG(logger_, "number_of_devices < 0");
+ controller_->SearchDeviceFailed(SearchDeviceError());
+ }
+
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void BluetoothDeviceScanner::CheckSDLServiceOnDevices(
+ const std::vector<bdaddr_t>& bd_addresses, int device_handle,
+ DeviceVector* discovered_devices) {
+ LOG4CXX_TRACE(logger_, "enter. bd_addresses: " << &bd_addresses << ", device_handle: " <<
+ device_handle << ", discovered_devices: " << discovered_devices);
+ std::vector<RfcommChannelVector> sdl_rfcomm_channels =
+ DiscoverSmartDeviceLinkRFCOMMChannels(bd_addresses);
+
+ for (size_t i = 0; i < bd_addresses.size(); ++i) {
+ if (sdl_rfcomm_channels[i].empty()) {
+ continue;
+ }
+
+ const bdaddr_t& bd_address = bd_addresses[i];
+ char deviceName[256];
+ int hci_read_remote_name_ret = hci_read_remote_name(
+ device_handle, &bd_address, sizeof(deviceName) / sizeof(deviceName[0]),
+ deviceName, 0);
+
+ if (hci_read_remote_name_ret != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "hci_read_remote_name failed");
+ strncpy(deviceName,
+ BluetoothDevice::GetUniqueDeviceId(bd_address).c_str(),
+ sizeof(deviceName) / sizeof(deviceName[0]));
+ }
+
+ Device* bluetooth_device = new BluetoothDevice(bd_address, deviceName,
+ sdl_rfcomm_channels[i]);
+ if (bluetooth_device) {
+ LOG4CXX_INFO(logger_, "Bluetooth device created successfully");
+ discovered_devices->push_back(bluetooth_device);
+ } else {
+ LOG4CXX_WARN(logger_, "Can't create bluetooth device " << deviceName);
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+std::vector<BluetoothDeviceScanner::RfcommChannelVector>
+BluetoothDeviceScanner::DiscoverSmartDeviceLinkRFCOMMChannels(
+ const std::vector<bdaddr_t>& device_addresses) {
+ LOG4CXX_TRACE(logger_, "enter device_addresses: " << &device_addresses);
+ const size_t size = device_addresses.size();
+ std::vector<RfcommChannelVector> result(size);
+
+ static const int attempts = 4;
+ static const int attempt_timeout = 5;
+ std::vector<bool> processed(size, false);
+ unsigned processed_count = 0;
+ for (int nattempt = 0; nattempt < attempts; ++nattempt) {
+ for (size_t i = 0; i < size; ++i) {
+ if (processed[i]) {
+ continue;
+ }
+ const bool final = DiscoverSmartDeviceLinkRFCOMMChannels(
+ device_addresses[i], &result[i]);
+ if (final) {
+ processed[i] = true;
+ ++processed_count;
+ }
+ }
+ if (++processed_count >= size) {
+ break;
+ }
+ sleep(attempt_timeout);
+ }
+ LOG4CXX_TRACE(logger_, "exit with vector<RfcommChannelVector>: size = " << result.size());
+ return result;
+}
+
+bool BluetoothDeviceScanner::DiscoverSmartDeviceLinkRFCOMMChannels(
+ const bdaddr_t& device_address, RfcommChannelVector* channels) {
+ LOG4CXX_TRACE(logger_, "enter. device_address: " << &device_address << ", channels: " <<
+ channels);
+ static bdaddr_t any_address = { { 0, 0, 0, 0, 0, 0 } };
+
+ sdp_session_t* sdp_session = sdp_connect(
+ &any_address, &device_address, SDP_RETRY_IF_BUSY | SDP_WAIT_ON_CLOSE);
+ if (sdp_session == 0) {
+ bool result = !(errno == 31 || errno == 16 || errno == 117 || errno == 114);
+ if (result) {
+ LOG4CXX_TRACE(logger_, "exit with TRUE. Condition: sdp_session == 0");
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: sdp_session == 0");
+ }
+ return result;
+ }
+
+ sdp_list_t* search_list = sdp_list_append(0,
+ &smart_device_link_service_uuid_);
+ uint32_t range = 0x0000ffff;
+ sdp_list_t* attr_list = sdp_list_append(0, &range);
+ sdp_list_t* response_list = 0;
+
+ if (0 == sdp_service_search_attr_req(sdp_session, search_list,
+ SDP_ATTR_REQ_RANGE, attr_list,
+ &response_list)) {
+ for (sdp_list_t* r = response_list; 0 != r; r = r->next) {
+ sdp_record_t* sdp_record = static_cast<sdp_record_t*>(r->data);
+ sdp_list_t* proto_list = 0;
+
+ if (0 == sdp_get_access_protos(sdp_record, &proto_list)) {
+ for (sdp_list_t* p = proto_list; 0 != p; p = p->next) {
+ sdp_list_t* pdsList = static_cast<sdp_list_t*>(p->data);
+
+ for (sdp_list_t* pds = pdsList; 0 != pds; pds = pds->next) {
+ sdp_data_t* sdpData = static_cast<sdp_data_t*>(pds->data);
+ int proto = 0;
+
+ for (sdp_data_t* d = sdpData; 0 != d; d = d->next) {
+ switch (d->dtd) {
+ case SDP_UUID16:
+ case SDP_UUID32:
+ case SDP_UUID128:
+ proto = sdp_uuid_to_proto(&d->val.uuid);
+ break;
+
+ case SDP_UINT8:
+ if (RFCOMM_UUID == proto) {
+ channels->push_back(d->val.uint8);
+ }
+ break;
+ }
+ }
+ }
+
+ sdp_list_free(pdsList, 0);
+ }
+
+ sdp_list_free(proto_list, 0);
+ }
+ }
+ }
+ sdp_list_free(search_list, 0);
+ sdp_list_free(attr_list, 0);
+ sdp_list_free(response_list, 0);
+ sdp_close(sdp_session);
+
+ if (!channels->empty()) {
+ LOG4CXX_INFO(logger_, "channels not empty");
+ std::stringstream rfcomm_channels_string;
+
+ for (RfcommChannelVector::const_iterator it = channels->begin();
+ it != channels->end(); ++it) {
+ if (it != channels->begin()) {
+ rfcomm_channels_string << ", ";
+ }
+ rfcomm_channels_string << static_cast<uint32_t>(*it);
+ }
+
+ LOG4CXX_INFO(logger_,
+ "SmartDeviceLink service was discovered on device "
+ << BluetoothDevice::GetUniqueDeviceId(device_address)
+ << " at channel(s): " << rfcomm_channels_string.str().c_str());
+ } else {
+ LOG4CXX_INFO(logger_,
+ "SmartDeviceLink service was not discovered on device "
+ << BluetoothDevice::GetUniqueDeviceId(device_address));
+ }
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+void BluetoothDeviceScanner::Thread() {
+ LOG4CXX_TRACE(logger_, "enter");
+ ready_ = true;
+ if (auto_repeat_search_) {
+ while (!shutdown_requested_) {
+ DoInquiry();
+ device_scan_requested_ = false;
+ TimedWaitForDeviceScanRequest();
+ }
+ } else { // search only on demand
+ while (true) {
+ {
+ sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
+ while (!(device_scan_requested_ || shutdown_requested_)) {
+ device_scan_requested_cv_.Wait(auto_lock);
+ }
+ }
+ if (shutdown_requested_) {
+ break;
+ }
+ DoInquiry();
+ device_scan_requested_ = false;
+ }
+ }
+
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void BluetoothDeviceScanner::TimedWaitForDeviceScanRequest() {
+ LOG4CXX_TRACE(logger_, "enter");
+
+ if (auto_repeat_pause_sec_ == 0) {
+ LOG4CXX_TRACE(logger_, "exit. Condition: auto_repeat_pause_sec_ == 0");
+ return;
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
+ while (!(device_scan_requested_ || shutdown_requested_)) {
+ const sync_primitives::ConditionalVariable::WaitStatus wait_status =
+ device_scan_requested_cv_.WaitFor(auto_lock, auto_repeat_pause_sec_ * 1000);
+ if (wait_status == sync_primitives::ConditionalVariable::kTimeout) {
+ LOG4CXX_INFO(logger_, "Bluetooth scanner timeout, performing scan");
+ device_scan_requested_ = true;
+ }
+ }
+ }
+
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error BluetoothDeviceScanner::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if(!thread_->start()) {
+ LOG4CXX_ERROR(logger_, "Bluetooth device scanner thread start failed");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter:Fail");
+ return TransportAdapter::FAIL;
+ }
+ LOG4CXX_INFO(logger_, "Bluetooth device scanner thread started");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter:OK");
+ return TransportAdapter::OK;
+}
+
+void BluetoothDeviceScanner::Terminate() {
+ LOG4CXX_TRACE(logger_, "enter");
+ shutdown_requested_ = true;
+ if (thread_->is_running()) {
+ {
+ sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
+ device_scan_requested_ = false;
+ device_scan_requested_cv_.NotifyOne();
+ }
+ LOG4CXX_INFO(logger_,
+ "Waiting for bluetooth device scanner thread termination");
+ thread_->join();
+ LOG4CXX_INFO(logger_, "PASA Bluetooth device scanner thread joined");
+ }
+ delete thread_;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error BluetoothDeviceScanner::Scan() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if ((!IsInitialised()) || shutdown_requested_) {
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::BAD_STATE");
+ return TransportAdapter::BAD_STATE;
+ }
+ if (auto_repeat_pause_sec_ == 0) {
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+ }
+ TransportAdapter::Error ret = TransportAdapter::OK;
+
+ {
+ sync_primitives::AutoLock auto_lock(device_scan_requested_lock_);
+ if (false == device_scan_requested_) {
+ LOG4CXX_INFO(logger_, "Requesting device Scan");
+ device_scan_requested_ = true;
+ device_scan_requested_cv_.NotifyOne();
+ } else {
+ ret = TransportAdapter::BAD_STATE;
+ LOG4CXX_INFO(logger_, "Device Scan is currently in progress");
+ }
+ }
+
+ LOG4CXX_TRACE(logger_, "exit with Error: " << ret);
+ return ret;
+}
+
+BluetoothDeviceScanner::BluetoothDeviceScannerDelegate::BluetoothDeviceScannerDelegate(
+ BluetoothDeviceScanner* scanner)
+ : scanner_(scanner) {
+}
+
+void BluetoothDeviceScanner::BluetoothDeviceScannerDelegate::threadMain()
+{
+ LOG4CXX_TRACE_ENTER(logger_);
+ DCHECK(scanner_);
+ scanner_->Thread();
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
new file mode 100644
index 0000000000..ac1ccecfb5
--- /dev/null
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
@@ -0,0 +1,132 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
+
+#include <unistd.h>
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+#include <bluetooth/rfcomm.h>
+
+#include "transport_manager/bluetooth/bluetooth_device.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+BluetoothSocketConnection::BluetoothSocketConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_uid, app_handle, controller) {
+}
+
+BluetoothSocketConnection::~BluetoothSocketConnection() {
+}
+
+bool BluetoothSocketConnection::Establish(ConnectError** error) {
+ LOG4CXX_TRACE(logger_, "enter. (#" << pthread_self() << "), error: " << error);
+ DeviceSptr device = controller()->FindDevice(device_handle());
+
+ BluetoothDevice* bluetooth_device =
+ static_cast<BluetoothDevice*>(device.get());
+
+ uint8_t rfcomm_channel;
+ if (!bluetooth_device->GetRfcommChannel(application_handle(),
+ &rfcomm_channel)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << application_handle() << " not found");
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ return false;
+ }
+
+ struct sockaddr_rc remoteSocketAddress = { 0 };
+ remoteSocketAddress.rc_family = AF_BLUETOOTH;
+ memcpy(&remoteSocketAddress.rc_bdaddr, &bluetooth_device->address(),
+ sizeof(bdaddr_t));
+ remoteSocketAddress.rc_channel = rfcomm_channel;
+
+ int rfcomm_socket;
+
+ int attempts = 4;
+ int connect_status = 0;
+ LOG4CXX_DEBUG(logger_, "start rfcomm Connect attempts");
+ do {
+ rfcomm_socket = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
+ if (-1 == rfcomm_socket) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to create RFCOMM socket for device " << device_handle());
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ return false;
+ }
+ connect_status = ::connect(rfcomm_socket,
+ (struct sockaddr*) &remoteSocketAddress,
+ sizeof(remoteSocketAddress));
+ if (0 == connect_status) {
+ LOG4CXX_DEBUG(logger_, "rfcomm Connect ok");
+ break;
+ }
+ if (errno != 111 && errno != 104) {
+ LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno);
+ break;
+ }
+ if (errno) {
+ LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno);
+ close(rfcomm_socket);
+ }
+ sleep(2);
+ } while (--attempts > 0);
+ LOG4CXX_INFO(logger_, "rfcomm Connect attempts finished");
+ if (0 != connect_status) {
+ LOG4CXX_DEBUG(logger_,
+ "Failed to Connect to remote device " << BluetoothDevice::GetUniqueDeviceId(
+ remoteSocketAddress.rc_bdaddr) << " for session " << this);
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ return false;
+ }
+
+ set_socket(rfcomm_socket);
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
new file mode 100644
index 0000000000..7d60213b01
--- /dev/null
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -0,0 +1,161 @@
+/**
+ * \file bluetooth_transport_adapter.cc
+ * \brief BluetoothTransportAdapter class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <iomanip>
+#include <set>
+#include <bluetooth/bluetooth.h>
+
+#include "resumption/last_state.h"
+
+#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
+#include "transport_manager/bluetooth/bluetooth_device_scanner.h"
+#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
+#include "transport_manager/bluetooth/bluetooth_device.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+BluetoothTransportAdapter::~BluetoothTransportAdapter() {
+}
+
+BluetoothTransportAdapter::BluetoothTransportAdapter()
+ : TransportAdapterImpl(new BluetoothDeviceScanner(this, true, 0),
+ new BluetoothConnectionFactory(this), 0) {
+}
+
+DeviceType BluetoothTransportAdapter::GetDeviceType() const {
+ return "sdl-bluetooth";
+}
+
+void BluetoothTransportAdapter::Store() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ Json::Value bluetooth_adapter_dictionary;
+ Json::Value devices_dictionary;
+ DeviceList device_ids = GetDeviceList();
+ for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end(); ++i) {
+ DeviceUID device_id = *i;
+ DeviceSptr device = FindDevice(device_id);
+ if (!device) { // device could have been disconnected
+ continue;
+ }
+ utils::SharedPtr<BluetoothDevice> bluetooth_device =
+ DeviceSptr::static_pointer_cast<BluetoothDevice>(device);
+ Json::Value device_dictionary;
+ device_dictionary["name"] = bluetooth_device->name();
+ char address[18];
+ ba2str(&bluetooth_device->address(), address);
+ device_dictionary["address"] = std::string(address);
+ Json::Value applications_dictionary;
+ ApplicationList app_ids = bluetooth_device->GetApplicationList();
+ for (ApplicationList::const_iterator j = app_ids.begin(); j != app_ids.end(); ++j) {
+ ApplicationHandle app_handle = *j;
+ if (FindEstablishedConnection(bluetooth_device->unique_device_id(), app_handle)) {
+ uint8_t rfcomm_channel;
+ bluetooth_device->GetRfcommChannel(app_handle, &rfcomm_channel);
+ Json::Value application_dictionary;
+ char rfcomm_channel_record[4];
+ sprintf(rfcomm_channel_record, "%u", rfcomm_channel);
+ application_dictionary["rfcomm_channel"] = std::string(rfcomm_channel_record);
+ applications_dictionary.append(application_dictionary);
+ }
+ }
+ if (!applications_dictionary.empty()) {
+ device_dictionary["applications"] = applications_dictionary;
+ devices_dictionary.append(device_dictionary);
+ }
+ }
+ bluetooth_adapter_dictionary["devices"] = devices_dictionary;
+ resumption::LastState::instance()->dictionary["TransportManager"]["BluetoothAdapter"] =
+ bluetooth_adapter_dictionary;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool BluetoothTransportAdapter::Restore() {
+ LOG4CXX_TRACE(logger_, "enter");
+ bool errors_occured = false;
+ const Json::Value bluetooth_adapter_dictionary =
+ resumption::LastState::instance()->dictionary["TransportManager"]["BluetoothAdapter"];
+ const Json::Value devices_dictionary = bluetooth_adapter_dictionary["devices"];
+ for (Json::Value::const_iterator i = devices_dictionary.begin();
+ i != devices_dictionary.end(); ++i) {
+ const Json::Value device_dictionary = *i;
+ std::string name = device_dictionary["name"].asString();
+ std::string address_record = device_dictionary["address"].asString();
+ bdaddr_t address;
+ str2ba(address_record.c_str(), &address);
+ RfcommChannelVector rfcomm_channels;
+ const Json::Value applications_dictionary = device_dictionary["applications"];
+ for (Json::Value::const_iterator j = applications_dictionary.begin();
+ j != applications_dictionary.end(); ++j) {
+ const Json::Value application_dictionary = *j;
+ std::string rfcomm_channel_record =
+ application_dictionary["rfcomm_channel"].asString();
+ uint8_t rfcomm_channel =
+ static_cast<uint8_t>(atoi(rfcomm_channel_record.c_str()));
+ rfcomm_channels.push_back(rfcomm_channel);
+ }
+ BluetoothDevice* bluetooth_device =
+ new BluetoothDevice(address, name.c_str(), rfcomm_channels);
+ DeviceSptr device(bluetooth_device);
+ AddDevice(device);
+ for (RfcommChannelVector::const_iterator j =
+ rfcomm_channels.begin(); j != rfcomm_channels.end(); ++j) {
+ ApplicationHandle app_handle =
+ *j; // for Bluetooth device app_handle is just RFCOMM channel
+ if (Error::OK != Connect(device->unique_device_id(), app_handle)) {
+ errors_occured = true;
+ }
+ }
+ }
+ bool result = !errors_occured;
+ if (result) {
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ }
+ return result;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/dnssd_service_browser.cc b/src/components/transport_manager/src/tcp/dnssd_service_browser.cc
new file mode 100644
index 0000000000..5580585766
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/dnssd_service_browser.cc
@@ -0,0 +1,381 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+#include <map>
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/tcp/tcp_device.h"
+#include "transport_manager/tcp/dnssd_service_browser.h"
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+bool operator==(const DnssdServiceRecord& a, const DnssdServiceRecord& b) {
+ return a.name == b.name && a.type == b.type && a.interface == b.interface
+ && a.protocol == b.protocol && a.domain_name == b.domain_name;
+}
+
+void DnssdServiceBrowser::Terminate() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (0 != avahi_threaded_poll_) {
+ avahi_threaded_poll_stop(avahi_threaded_poll_);
+ }
+ if (0 != avahi_service_browser_) {
+ avahi_service_browser_free(avahi_service_browser_);
+ }
+ if (0 != avahi_client_) {
+ avahi_client_free(avahi_client_);
+ }
+ if (0 != avahi_threaded_poll_) {
+ avahi_threaded_poll_free(avahi_threaded_poll_);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool DnssdServiceBrowser::IsInitialised() const {
+ return initialised_;
+}
+
+DnssdServiceBrowser::DnssdServiceBrowser(TransportAdapterController* controller)
+ : controller_(controller),
+ avahi_service_browser_(0),
+ avahi_threaded_poll_(0),
+ avahi_client_(0),
+ service_records_(),
+ mutex_(),
+ initialised_(false) {
+ pthread_mutex_init(&mutex_, 0);
+}
+
+DnssdServiceBrowser::~DnssdServiceBrowser() {
+ pthread_mutex_destroy(&mutex_);
+}
+
+void DnssdServiceBrowser::OnClientConnected() {
+ initialised_ = true;
+ LOG4CXX_INFO(logger_, "AvahiClient ready");
+}
+
+void DnssdServiceBrowser::OnClientFailure() {
+ LOG4CXX_TRACE(logger_, "enter");
+ const int avahi_errno = avahi_client_errno(avahi_client_);
+ if (avahi_errno == AVAHI_ERR_DISCONNECTED) {
+ LOG4CXX_DEBUG(logger_, "AvahiClient disconnected");
+ CreateAvahiClientAndBrowser();
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "AvahiClient failure: " << avahi_strerror(avahi_errno));
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void AvahiClientCallback(AvahiClient* avahi_client,
+ AvahiClientState avahi_client_state, void* data) {
+ LOG4CXX_TRACE(logger_,
+ "enter. avahi_client " << avahi_client << "avahi_client_state " <<
+ avahi_client_state << "data " << data);
+ DnssdServiceBrowser* dnssd_service_browser =
+ static_cast<DnssdServiceBrowser*>(data);
+
+ switch (avahi_client_state) {
+ case AVAHI_CLIENT_S_RUNNING:
+ dnssd_service_browser->OnClientConnected();
+ LOG4CXX_DEBUG(logger_, "avahi_client_state: AVAHI_CLIENT_S_RUNNING");
+ break;
+ case AVAHI_CLIENT_FAILURE:
+ dnssd_service_browser->OnClientFailure();
+ LOG4CXX_DEBUG(logger_, "avahi_client_state: AVAHI_CLIENT_FAILURE");
+ break;
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown avahi_client_state: " << avahi_client_state);
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void AvahiServiceBrowserCallback(AvahiServiceBrowser* avahi_service_browser,
+ AvahiIfIndex interface, AvahiProtocol protocol,
+ AvahiBrowserEvent event, const char* name,
+ const char* type, const char* domain,
+ AvahiLookupResultFlags flags, void* data) {
+ LOG4CXX_TRACE(logger_, "enter. avahi_service_browser " << avahi_service_browser <<
+ " interface " << interface << " protocol " << protocol <<
+ " event " << event << " name " << name << " type " << type << " domain " << domain <<
+ " flags " << flags << " data " << data);
+ DnssdServiceBrowser* dnssd_service_browser =
+ static_cast<DnssdServiceBrowser*>(data);
+
+ switch (event) {
+ case AVAHI_BROWSER_FAILURE:
+ LOG4CXX_ERROR(
+ logger_,
+ "AvahiServiceBrowser failure: " << avahi_strerror(
+ avahi_client_errno(
+ avahi_service_browser_get_client(
+ avahi_service_browser))));
+ break;
+
+ case AVAHI_BROWSER_NEW:
+ dnssd_service_browser->AddService(interface, protocol, name, type,
+ domain);
+ LOG4CXX_DEBUG(logger_, "event: AVAHI_BROWSER_NEW");
+ break;
+
+ case AVAHI_BROWSER_REMOVE:
+ dnssd_service_browser->RemoveService(interface, protocol, name, type,
+ domain);
+ LOG4CXX_DEBUG(logger_, "event: AVAHI_BROWSER_REMOVE");
+ break;
+
+ case AVAHI_BROWSER_ALL_FOR_NOW:
+ LOG4CXX_DEBUG(logger_, "event: AVAHI_BROWSER_ALL_FOR_NOW");
+ case AVAHI_BROWSER_CACHE_EXHAUSTED:
+ LOG4CXX_DEBUG(logger_, "event: AVAHI_BROWSER_CACHE_EXHAUSTED");
+ break;
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void DnssdServiceBrowser::ServiceResolved(
+ const DnssdServiceRecord& service_record) {
+ LOG4CXX_TRACE(logger_, "enter");
+ pthread_mutex_lock(&mutex_);
+ ServiceRecords::iterator service_record_it = std::find(
+ service_records_.begin(), service_records_.end(), service_record);
+ if (service_record_it != service_records_.end()) {
+ *service_record_it = service_record;
+ }
+ DeviceVector device_vector = PrepareDeviceVector();
+ controller_->SearchDeviceDone(device_vector);
+ pthread_mutex_unlock(&mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void DnssdServiceBrowser::ServiceResolveFailed(
+ const DnssdServiceRecord& service_record) {
+ LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_ERROR(logger_,
+ "AvahiServiceResolver failure for: " << service_record.name);
+ pthread_mutex_lock(&mutex_);
+ ServiceRecords::iterator service_record_it = std::find(
+ service_records_.begin(), service_records_.end(), service_record);
+ if (service_record_it != service_records_.end()) {
+ service_records_.erase(service_record_it);
+ }
+ pthread_mutex_unlock(&mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void AvahiServiceResolverCallback(AvahiServiceResolver* avahi_service_resolver,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiResolverEvent event, const char* name,
+ const char* type, const char* domain,
+ const char* host_name,
+ const AvahiAddress* avahi_address,
+ uint16_t port, AvahiStringList* txt,
+ AvahiLookupResultFlags flags, void* data) {
+ LOG4CXX_TRACE(logger_, "enter. avahi_service_resolver " << avahi_service_resolver <<
+ " interface " << interface <<
+ " protocol " << protocol << " event " << event << " name " << name << " type " << type <<
+ " domain " << domain << " host_name " << host_name <<
+ " avahi_address " << avahi_address << " port " << port << " txt " << txt << " flags " <<
+ flags << " data " << data);
+ DnssdServiceBrowser* dnssd_service_browser =
+ static_cast<DnssdServiceBrowser*>(data);
+
+ DnssdServiceRecord service_record;
+ service_record.interface = interface;
+ service_record.protocol = protocol;
+ service_record.domain_name = domain;
+ service_record.host_name = host_name;
+ service_record.name = name;
+ service_record.type = type;
+ switch (event) {
+ case AVAHI_RESOLVER_FOUND:
+ service_record.addr = avahi_address->data.ipv4.address;
+ service_record.port = port;
+ dnssd_service_browser->ServiceResolved(service_record);
+ LOG4CXX_DEBUG(logger_, "event: AVAHI_RESOLVER_FOUND");
+ break;
+ case AVAHI_RESOLVER_FAILURE:
+ dnssd_service_browser->ServiceResolveFailed(service_record);
+ LOG4CXX_DEBUG(logger_, "event: AVAHI_RESOLVER_FAILURE");
+ break;
+ }
+
+ avahi_service_resolver_free(avahi_service_resolver);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error DnssdServiceBrowser::CreateAvahiClientAndBrowser() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (0 != avahi_service_browser_) {
+ avahi_service_browser_free(avahi_service_browser_);
+ }
+ if (0 != avahi_client_) {
+ avahi_client_free(avahi_client_);
+ }
+
+ int avahi_error;
+ avahi_client_ = avahi_client_new(
+ avahi_threaded_poll_get(avahi_threaded_poll_), AVAHI_CLIENT_NO_FAIL,
+ AvahiClientCallback, this, &avahi_error);
+ if (0 == avahi_client_) {
+ LOG4CXX_ERROR(logger_, "Failed to create AvahiClient: " << avahi_strerror(avahi_error));
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ return TransportAdapter::FAIL;
+ }
+
+ pthread_mutex_lock(&mutex_);
+ service_records_.clear();
+ pthread_mutex_unlock(&mutex_);
+
+ avahi_service_browser_ = avahi_service_browser_new(
+ avahi_client_, AVAHI_IF_UNSPEC, /* TODO use only required iface */
+ AVAHI_PROTO_INET, DNSSD_DEFAULT_SERVICE_TYPE, NULL, /* use default domain */
+ static_cast<AvahiLookupFlags>(0), AvahiServiceBrowserCallback, this);
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error DnssdServiceBrowser::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ avahi_threaded_poll_ = avahi_threaded_poll_new();
+ if (0 == avahi_threaded_poll_) {
+ LOG4CXX_ERROR(logger_, "Failed to create AvahiThreadedPoll");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ return TransportAdapter::FAIL;
+ }
+
+ const TransportAdapter::Error err = CreateAvahiClientAndBrowser();
+ if (err != TransportAdapter::OK) {
+ LOG4CXX_TRACE(logger_, "exit with error " << err);
+ return err;
+ }
+
+ const int poll_start_status = avahi_threaded_poll_start(avahi_threaded_poll_);
+ if (0 != poll_start_status) {
+ LOG4CXX_ERROR(logger_, "Failed to start AvahiThreadedPoll");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL. Condition: 0 != poll_start_status");
+ return TransportAdapter::FAIL;
+ }
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error DnssdServiceBrowser::Scan() {
+ return TransportAdapter::NOT_SUPPORTED;
+}
+
+void DnssdServiceBrowser::AddService(AvahiIfIndex interface,
+ AvahiProtocol protocol, const char* name,
+ const char* type, const char* domain) {
+ LOG4CXX_TRACE(logger_, "enter: interface " << interface << " protocol " << protocol <<
+ " name " << name << " type " << type << " domain " << domain);
+ DnssdServiceRecord record;
+ record.interface = interface;
+ record.protocol = protocol;
+ record.domain_name = domain;
+ record.name = name;
+ record.type = type;
+
+ pthread_mutex_lock(&mutex_);
+ if (service_records_.end()
+ == std::find(service_records_.begin(), service_records_.end(), record)) {
+ service_records_.push_back(record);
+ avahi_service_resolver_new(
+ avahi_client_, interface, protocol, name, type, domain,
+ AVAHI_PROTO_INET, static_cast<AvahiLookupFlags>(0),
+ AvahiServiceResolverCallback, this);
+ }
+ pthread_mutex_unlock(&mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void DnssdServiceBrowser::RemoveService(AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ const char* name, const char* type,
+ const char* domain) {
+ LOG4CXX_TRACE(logger_, "enter: interface " << interface << " protocol " << protocol <<
+ " name " << name << " type " << type << " domain " << domain);
+ DnssdServiceRecord record;
+ record.interface = interface;
+ record.protocol = protocol;
+ record.name = name;
+ record.type = type;
+ record.domain_name = domain;
+
+ pthread_mutex_lock(&mutex_);
+ service_records_.erase(
+ std::remove(service_records_.begin(), service_records_.end(), record),
+ service_records_.end());
+ pthread_mutex_unlock(&mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+DeviceVector DnssdServiceBrowser::PrepareDeviceVector() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ std::map<uint32_t, TcpDevice*> devices;
+ for (ServiceRecords::const_iterator it = service_records_.begin();
+ it != service_records_.end(); ++it) {
+ const DnssdServiceRecord& service_record = *it;
+ if (service_record.host_name.empty()) {
+ continue;
+ }
+ if (devices[service_record.addr] == 0) {
+ devices[service_record.addr] = new TcpDevice(service_record.addr,
+ service_record.host_name);
+ }
+ if (devices[service_record.addr] != 0) {
+ devices[service_record.addr]->AddDiscoveredApplication(
+ service_record.port);
+ }
+ }
+ DeviceVector device_vector;
+ device_vector.reserve(devices.size());
+ for (std::map<uint32_t, TcpDevice*>::const_iterator it = devices.begin();
+ it != devices.end(); ++it) {
+ device_vector.push_back(DeviceSptr(it->second));
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+ return device_vector;
+}
+
+} // namespace
+} // namespace
+
diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
new file mode 100644
index 0000000000..514fbe66eb
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -0,0 +1,286 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/tcp/tcp_client_listener.h"
+
+#include <memory.h>
+#include <signal.h>
+#include <errno.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#ifdef __linux__
+# include <linux/tcp.h>
+#else // __linux__
+# include <sys/time.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+# include <netinet/tcp_var.h>
+#endif // __linux__
+
+#include "utils/logger.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/tcp_device.h"
+#include "transport_manager/tcp/tcp_socket_connection.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TcpClientListener::TcpClientListener(TransportAdapterController* controller,
+ const uint16_t port,
+ const bool enable_keepalive)
+ : port_(port),
+ enable_keepalive_(enable_keepalive),
+ controller_(controller),
+ thread_(),
+ socket_(-1),
+ thread_started_(false),
+ shutdown_requested_(false),
+ thread_stop_requested_(false) {}
+
+void* tcpClientListenerThread(void* data) {
+ LOG4CXX_TRACE(logger_, "enter. data " << data);
+ TcpClientListener* tcpClientListener = static_cast<TcpClientListener*>(data);
+ assert(tcpClientListener != 0);
+ tcpClientListener->Thread();
+ LOG4CXX_TRACE(logger_, "exit");
+ return 0;
+}
+
+TransportAdapter::Error TcpClientListener::Init() {
+ return TransportAdapter::OK;
+}
+
+void TcpClientListener::Terminate() {
+ LOG4CXX_TRACE(logger_, "enter");
+ shutdown_requested_ = true;
+ if (TransportAdapter::OK != StopListening()) {
+ LOG4CXX_ERROR(logger_, "Cannot stop listening TCP");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool TcpClientListener::IsInitialised() const {
+ return true;
+}
+
+TcpClientListener::~TcpClientListener() {
+ LOG4CXX_INFO(logger_, "destructor");
+}
+
+void SetKeepaliveOptions(const int fd) {
+ LOG4CXX_TRACE(logger_, "enter. fd: " << fd);
+ int yes = 1;
+ int keepidle = 3; // 3 seconds to disconnection detecting
+ int keepcnt = 5;
+ int keepintvl = 1;
+#ifdef __linux__
+ int user_timeout = 7000; // milliseconds
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle));
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt));
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl));
+ setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout,
+ sizeof(user_timeout));
+#elif __QNX__ // __linux__
+ // TODO (KKolodiy): Out of order!
+ const int kMidLength = 4;
+ int mib[kMidLength];
+ timeval tval;
+
+ mib[0] = CTL_NET;
+ mib[1] = AF_INET;
+ mib[2] = IPPROTO_TCP;
+ mib[3] = TCPCTL_KEEPIDLE;
+ sysctl(mib, kMidLength, NULL, NULL, &keepidle, sizeof(keepidle));
+
+ mib[0] = CTL_NET;
+ mib[1] = AF_INET;
+ mib[2] = IPPROTO_TCP;
+ mib[3] = TCPCTL_KEEPCNT;
+ sysctl(mib, kMidLength, NULL, NULL, &keepcnt, sizeof(keepcnt));
+
+ mib[0] = CTL_NET;
+ mib[1] = AF_INET;
+ mib[2] = IPPROTO_TCP;
+ mib[3] = TCPCTL_KEEPINTVL;
+ sysctl(mib, kMidLength, NULL, NULL, &keepintvl, sizeof(keepintvl));
+
+ memset(&tval, sizeof(tval), 0);
+ tval.tv_sec = keepidle;
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tval, sizeof(tval));
+#endif // __QNX__
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TcpClientListener::Thread() {
+ LOG4CXX_TRACE(logger_, "enter");
+ while (false == thread_stop_requested_) {
+ sockaddr_in client_address;
+ socklen_t client_address_size = sizeof(client_address);
+ const int connection_fd = accept(socket_, (struct sockaddr*)&client_address,
+ &client_address_size);
+ if (thread_stop_requested_) {
+ LOG4CXX_DEBUG(logger_, "thread_stop_requested_");
+ break;
+ }
+
+ if (connection_fd < 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "accept() failed");
+ continue;
+ }
+
+ if (AF_INET != client_address.sin_family) {
+ LOG4CXX_DEBUG(logger_, "Address of connected client is invalid");
+ continue;
+ }
+
+ char device_name[32];
+ strncpy(device_name, inet_ntoa(client_address.sin_addr),
+ sizeof(device_name) / sizeof(device_name[0]));
+ LOG4CXX_INFO(logger_, "Connected client " << device_name);
+
+ if (enable_keepalive_) {
+ SetKeepaliveOptions(connection_fd);
+ }
+
+ TcpDevice* tcp_device = new TcpDevice(client_address.sin_addr.s_addr, device_name);
+ DeviceSptr device = controller_->AddDevice(tcp_device);
+ tcp_device = static_cast<TcpDevice*>(device.get());
+ const ApplicationHandle app_handle = tcp_device->AddIncomingApplication(
+ connection_fd);
+
+ TcpSocketConnection* connection(
+ new TcpSocketConnection(device->unique_device_id(), app_handle,
+ controller_));
+ connection->set_socket(connection_fd);
+ const TransportAdapter::Error error = connection->Start();
+ if (error != TransportAdapter::OK) {
+ delete connection;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error TcpClientListener::StartListening() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (thread_started_) {
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::BAD_STATE. Condition: thread_started_");
+ return TransportAdapter::BAD_STATE;
+ }
+
+ socket_ = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (-1 == socket_) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to create socket");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL. Condition: -1 == socket_");
+ return TransportAdapter::FAIL;
+ }
+
+ sockaddr_in server_address;
+ memset(&server_address, 0, sizeof(server_address));
+ server_address.sin_family = AF_INET;
+ server_address.sin_port = htons(port_);
+ server_address.sin_addr.s_addr = INADDR_ANY;
+
+ int optval = 1;
+ setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
+
+ if (0 != bind(socket_, (sockaddr*) &server_address, sizeof(server_address))) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "bind() failed");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: 0 != bind(socket_, (sockaddr*) &server_address, sizeof(server_address))");
+ return TransportAdapter::FAIL;
+ }
+
+ if (0 != listen(socket_, 128)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "listen() failed");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: 0 != listen(socket_, 128)");
+ return TransportAdapter::FAIL;
+ }
+
+ const int thread_start_error = pthread_create(&thread_, 0,
+ &tcpClientListenerThread, this);
+ if (0 == thread_start_error) {
+ thread_started_ = true;
+ LOG4CXX_DEBUG(logger_, "Tcp client listener thread started");
+ pthread_setname_np(thread_, "TCP listener");
+ } else {
+ LOG4CXX_ERROR(logger_, "Tcp client listener thread start failed, error code "
+ << thread_start_error);
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: 0 !== thread_start_error");
+ return TransportAdapter::FAIL;
+ }
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error TcpClientListener::StopListening() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (!thread_started_) {
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::BAD_STATE. Condition !thread_started_");
+ return TransportAdapter::BAD_STATE;
+ }
+
+ thread_stop_requested_ = true;
+ int byebyesocket = socket(AF_INET, SOCK_STREAM, 0);
+ sockaddr_in server_address;
+ memset(&server_address, 0, sizeof(server_address));
+ server_address.sin_family = AF_INET;
+ server_address.sin_port = htons(port_);
+ server_address.sin_addr.s_addr = INADDR_ANY;
+ connect(byebyesocket, (sockaddr*)&server_address, sizeof(server_address));
+ shutdown(byebyesocket, SHUT_RDWR);
+ close(byebyesocket);
+ pthread_join(thread_, 0);
+ LOG4CXX_DEBUG(logger_, "Tcp client listener thread terminated");
+ close(socket_);
+ socket_ = -1;
+ thread_started_ = false;
+ thread_stop_requested_ = false;
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
new file mode 100644
index 0000000000..69173a0e06
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -0,0 +1,79 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/tcp/tcp_connection_factory.h"
+#include "transport_manager/tcp/tcp_socket_connection.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TcpConnectionFactory::TcpConnectionFactory(TransportAdapterController* controller)
+ : controller_(controller) {
+}
+
+TransportAdapter::Error TcpConnectionFactory::Init() {
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error TcpConnectionFactory::CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. DeviceUID: " << &device_uid << ", ApplicationHandle: " <<
+ &app_handle);
+ TcpServerOiginatedSocketConnection* connection(
+ new TcpServerOiginatedSocketConnection(device_uid, app_handle,
+ controller_));
+ TransportAdapter::Error error = connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_, "Transport adapter error " << error);
+ delete connection;
+ }
+ LOG4CXX_TRACE(logger_, "exit with error " << error);
+ return error;
+}
+
+void TcpConnectionFactory::Terminate() {
+}
+
+bool TcpConnectionFactory::IsInitialised() const {
+ return true;
+}
+
+TcpConnectionFactory::~TcpConnectionFactory() {
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_device.cc b/src/components/transport_manager/src/tcp/tcp_device.cc
new file mode 100644
index 0000000000..2540c26ed0
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/tcp_device.cc
@@ -0,0 +1,153 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/tcp/tcp_device.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TcpDevice::TcpDevice(const in_addr_t& in_addr, const std::string& name)
+ :
+ Device(name, name),
+ in_addr_(in_addr),
+ last_handle_(0) {
+ pthread_mutex_init(&applications_mutex_, 0);
+}
+
+bool TcpDevice::IsSameAs(const Device* other) const {
+ LOG4CXX_TRACE(logger_, "enter. Device: " << other);
+ const TcpDevice* other_tcp_device = static_cast<const TcpDevice*>(other);
+
+ if (other_tcp_device->in_addr_ == in_addr_) {
+ LOG4CXX_TRACE(logger_,
+ "exit with TRUE. Condition: other_tcp_device->in_addr_ == in_addr_");
+ return true;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ return false;
+ }
+}
+
+ApplicationList TcpDevice::GetApplicationList() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ pthread_mutex_lock(&applications_mutex_);
+ ApplicationList app_list;
+ for (std::map<ApplicationHandle, Application>::const_iterator it =
+ applications_.begin(); it != applications_.end(); ++it) {
+ app_list.push_back(it->first);
+ }
+ pthread_mutex_unlock(&applications_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with app_list. It's size = " << app_list.size());
+ return app_list;
+}
+
+ApplicationHandle TcpDevice::AddIncomingApplication(int socket_fd) {
+ LOG4CXX_TRACE(logger_, "enter. Socket_fd: " << socket_fd);
+ Application app;
+ app.incoming = true;
+ app.socket = socket_fd;
+ app.port = 0; // this line removes compiler warning
+ pthread_mutex_lock(&applications_mutex_);
+ const ApplicationHandle app_handle = ++last_handle_;
+ applications_[app_handle] = app;
+ pthread_mutex_unlock(&applications_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with app_handle " << app_handle);
+ return app_handle;
+}
+
+ApplicationHandle TcpDevice::AddDiscoveredApplication(int port) {
+ LOG4CXX_TRACE(logger_, "enter. port " << port);
+ Application app;
+ app.incoming = false;
+ app.socket = 0; // this line removes compiler warning
+ app.port = port;
+ pthread_mutex_lock(&applications_mutex_);
+ const ApplicationHandle app_handle = ++last_handle_;
+ applications_[app_handle] = app;
+ pthread_mutex_unlock(&applications_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with app_handle " << app_handle);
+ return app_handle;
+}
+
+
+void TcpDevice::RemoveApplication(const ApplicationHandle app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. ApplicationHandle: " << app_handle);
+ pthread_mutex_lock(&applications_mutex_);
+ applications_.erase(app_handle);
+ pthread_mutex_unlock(&applications_mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TcpDevice::~TcpDevice() {
+ pthread_mutex_destroy(&applications_mutex_);
+}
+
+int TcpDevice::GetApplicationSocket(const ApplicationHandle app_handle) const {
+ LOG4CXX_TRACE(logger_, "enter. ApplicationHandle: " << app_handle);
+ std::map<ApplicationHandle, Application>::const_iterator it = applications_.find(
+ app_handle);
+ if (applications_.end() == it) {
+ LOG4CXX_TRACE(logger_, "exit with -1. Condition: applications_.end() == it");
+ return -1;
+ }
+ if (!it->second.incoming) {
+ LOG4CXX_TRACE(logger_, "exit with -1. Condition: !it->second.incoming");
+ return -1;
+ }
+ LOG4CXX_TRACE(logger_, "exit with socket " << it->second.socket);
+ return it->second.socket;
+}
+
+int TcpDevice::GetApplicationPort(const ApplicationHandle app_handle) const {
+ LOG4CXX_TRACE(logger_, "enter. ApplicationHandle: " << app_handle);
+ std::map<ApplicationHandle, Application>::const_iterator it = applications_.find(
+ app_handle);
+ if (applications_.end() == it) {
+ LOG4CXX_TRACE(logger_, "exit with -1. Condition: applications_.end() == it");
+ return -1;
+ }
+ if (it->second.incoming) {
+ LOG4CXX_TRACE(logger_, "exit with -1. Condition: it->second.incoming");
+ return -1;
+ }
+ LOG4CXX_TRACE(logger_, "exit with port " << it->second.port);
+ return it->second.port;
+}
+
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/tcp/tcp_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
new file mode 100644
index 0000000000..cea5805348
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
@@ -0,0 +1,121 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/tcp/tcp_socket_connection.h"
+#include "transport_manager/tcp/tcp_device.h"
+#include "utils/logger.h"
+
+#include <memory.h>
+#include <signal.h>
+#include <errno.h>
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+
+TcpSocketConnection::TcpSocketConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_uid, app_handle, controller) {
+}
+
+TcpSocketConnection::~TcpSocketConnection() {
+}
+
+bool TcpSocketConnection::Establish(ConnectError** error) {
+ return true;
+}
+
+TcpServerOiginatedSocketConnection::TcpServerOiginatedSocketConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_uid, app_handle, controller) {
+}
+
+TcpServerOiginatedSocketConnection::~TcpServerOiginatedSocketConnection() {
+}
+
+bool TcpServerOiginatedSocketConnection::Establish(ConnectError** error) {
+ LOG4CXX_TRACE(logger_, "enter. error " << error);
+ DeviceSptr device = controller()->FindDevice(device_handle());
+ if (!device.valid()) {
+ LOG4CXX_ERROR(logger_, "Device " << device_handle() << " not found");
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !device.valid()");
+ return false;
+ }
+ TcpDevice* tcp_device = static_cast<TcpDevice*>(device.get());
+
+ int port;
+ if (-1 == (port = tcp_device->GetApplicationPort(application_handle()))) {
+ LOG4CXX_ERROR(logger_, "Application port for " << application_handle() << " not found");
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: port not found");
+ return false;
+ }
+
+ const int socket = ::socket(AF_INET, SOCK_STREAM, 0);
+ if (socket < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to create socket");
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: failed to create socket");
+ return false;
+ }
+
+ struct sockaddr_in addr;
+ memset((char*) &addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = tcp_device->in_addr();
+ addr.sin_port = htons(port);
+
+ LOG4CXX_INFO(logger_, "Connecting " << inet_ntoa(addr.sin_addr) << ":"
+ << port);
+ if (::connect(socket, (struct sockaddr*) &addr, sizeof(addr)) < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to connect for application "
+ << application_handle() << ", error " << errno);
+ *error = new ConnectError();
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: failed to connect to application");
+ return false;
+ }
+
+ set_socket(socket);
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
new file mode 100644
index 0000000000..6067def111
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc
@@ -0,0 +1,158 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <memory.h>
+#include <signal.h>
+#include <errno.h>
+#include <sstream>
+#include <cstdlib>
+
+#include "resumption/last_state.h"
+
+#include "utils/logger.h"
+
+#include "transport_manager/tcp/tcp_transport_adapter.h"
+#include "transport_manager/tcp/tcp_client_listener.h"
+#include "transport_manager/tcp/tcp_connection_factory.h"
+#include "transport_manager/tcp/tcp_device.h"
+
+#ifdef AVAHI_SUPPORT
+#include "transport_manager/tcp/dnssd_service_browser.h"
+#endif
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportAdapterImpl")
+
+TcpTransportAdapter::TcpTransportAdapter(const uint16_t port)
+ : TransportAdapterImpl(
+#ifdef AVAHI_SUPPORT
+ new DnssdServiceBrowser(this),
+#else
+ NULL,
+#endif
+ new TcpConnectionFactory(this),
+ new TcpClientListener(this, port, false)) {
+}
+
+TcpTransportAdapter::~TcpTransportAdapter() {
+}
+
+DeviceType TcpTransportAdapter::GetDeviceType() const {
+ return "sdl-tcp";
+}
+
+void TcpTransportAdapter::Store() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ Json::Value tcp_adapter_dictionary;
+ Json::Value devices_dictionary;
+ DeviceList device_ids = GetDeviceList();
+ for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end(); ++i) {
+ DeviceUID device_id = *i;
+ DeviceSptr device = FindDevice(device_id);
+ if (!device) { // device could have been disconnected
+ continue;
+ }
+ utils::SharedPtr<TcpDevice> tcp_device =
+ DeviceSptr::static_pointer_cast<TcpDevice>(device);
+ Json::Value device_dictionary;
+ device_dictionary["name"] = tcp_device->name();
+ struct in_addr address;
+ address.s_addr = tcp_device->in_addr();
+ device_dictionary["address"] = std::string(inet_ntoa(address));
+ Json::Value applications_dictionary;
+ ApplicationList app_ids = tcp_device->GetApplicationList();
+ for (ApplicationList::const_iterator j = app_ids.begin(); j != app_ids.end(); ++j) {
+ ApplicationHandle app_handle = *j;
+ if (FindEstablishedConnection(tcp_device->unique_device_id(), app_handle)) {
+ int port = tcp_device->GetApplicationPort(app_handle);
+ if (port != -1) { // don't want to store incoming applications
+ Json::Value application_dictionary;
+ char port_record[12];
+ sprintf(port_record, "%d", port);
+ application_dictionary["port"] = std::string(port_record);
+ applications_dictionary.append(application_dictionary);
+ }
+ }
+ }
+ if (!applications_dictionary.empty()) {
+ device_dictionary["applications"] = applications_dictionary;
+ devices_dictionary.append(device_dictionary);
+ }
+ }
+ tcp_adapter_dictionary["devices"] = devices_dictionary;
+ resumption::LastState::instance()->dictionary["TransportManager"]["TcpAdapter"] =
+ tcp_adapter_dictionary;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool TcpTransportAdapter::Restore() {
+ LOG4CXX_TRACE(logger_, "enter");
+ bool errors_occurred = false;
+ const Json::Value tcp_adapter_dictionary =
+ resumption::LastState::instance()->dictionary["TransportManager"]["TcpAdapter"];
+ const Json::Value devices_dictionary = tcp_adapter_dictionary["devices"];
+ for (Json::Value::const_iterator i = devices_dictionary.begin();
+ i != devices_dictionary.end(); ++i) {
+ const Json::Value device_dictionary = *i;
+ std::string name = device_dictionary["name"].asString();
+ std::string address_record = device_dictionary["address"].asString();
+ in_addr_t address = inet_addr(address_record.c_str());
+ TcpDevice* tcp_device = new TcpDevice(address, name);
+ DeviceSptr device(tcp_device);
+ AddDevice(device);
+ const Json::Value applications_dictionary = device_dictionary["applications"];
+ for (Json::Value::const_iterator j = applications_dictionary.begin();
+ j != applications_dictionary.end(); ++j) {
+ const Json::Value application_dictionary = *j;
+ std::string port_record = application_dictionary["port"].asString();
+ int port = atoi(port_record.c_str());
+ ApplicationHandle app_handle = tcp_device->AddDiscoveredApplication(port);
+ if (Error::OK != Connect(device->unique_device_id(), app_handle)) {
+ errors_occurred = true;
+ }
+ }
+ }
+ bool result = !errors_occurred;
+ if (result) {
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with FALSE");
+ }
+ return result;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
diff --git a/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
new file mode 100644
index 0000000000..2c365ca405
--- /dev/null
+++ b/src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc
@@ -0,0 +1,357 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <memory.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include "utils/logger.h"
+
+#include "transport_manager/transport_adapter/threaded_socket_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+ThreadedSocketConnection::ThreadedSocketConnection(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : read_fd_(-1), write_fd_(-1), controller_(controller),
+ frames_to_send_(),
+ frames_to_send_mutex_(),
+ thread_(),
+ socket_(-1),
+ terminate_flag_(false),
+ unexpected_disconnect_(false),
+ device_uid_(device_id),
+ app_handle_(app_handle) {
+ pthread_mutex_init(&frames_to_send_mutex_, 0);
+}
+
+ThreadedSocketConnection::~ThreadedSocketConnection() {
+ terminate_flag_ = true;
+ Notify();
+ pthread_join(thread_, 0);
+ pthread_mutex_destroy(&frames_to_send_mutex_);
+
+ if (-1 != read_fd_) {
+ close(read_fd_);
+ }
+ if (-1 != write_fd_) {
+ close(write_fd_);
+ }
+}
+
+void ThreadedSocketConnection::Abort() {
+ LOG4CXX_TRACE(logger_, "enter");
+ unexpected_disconnect_ = true;
+ terminate_flag_ = true;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void* StartThreadedSocketConnection(void* v) {
+ LOG4CXX_TRACE(logger_, "enter");
+ ThreadedSocketConnection* connection =
+ static_cast<ThreadedSocketConnection*>(v);
+ connection->Thread();
+ LOG4CXX_TRACE(logger_, "exit with 0");
+ return 0;
+}
+
+TransportAdapter::Error ThreadedSocketConnection::Start() {
+ LOG4CXX_TRACE(logger_, "enter");
+ int fds[2];
+ const int pipe_ret = pipe(fds);
+ if (0 == pipe_ret) {
+ LOG4CXX_DEBUG(logger_, "pipe created(#" << pthread_self() << ")");
+ read_fd_ = fds[0];
+ write_fd_ = fds[1];
+ } else {
+ LOG4CXX_WARN(logger_, "pipe creation failed (#" << pthread_self() << ")");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ return TransportAdapter::FAIL;
+ }
+ const int fcntl_ret = fcntl(read_fd_, F_SETFL,
+ fcntl(read_fd_, F_GETFL) | O_NONBLOCK);
+ if (0 != fcntl_ret) {
+ LOG4CXX_WARN(logger_, "fcntl failed (#" << pthread_self() << ")");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ return TransportAdapter::FAIL;
+ }
+
+ if (0 != pthread_create(&thread_, 0, &StartThreadedSocketConnection, this)) {
+ LOG4CXX_WARN(logger_, "thread creation failed (#" << pthread_self() << ")");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ return TransportAdapter::FAIL;
+ }
+ LOG4CXX_DEBUG(logger_, "thread created (#" << pthread_self() << ")");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ const std::string thread_name = std::string("Socket ") + device_handle();
+ pthread_setname_np(thread_, thread_name.c_str());
+ return TransportAdapter::OK;
+}
+
+void ThreadedSocketConnection::Finalize() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (unexpected_disconnect_) {
+ LOG4CXX_DEBUG(logger_, "unexpected_disconnect (#" << pthread_self() << ")");
+ controller_->ConnectionAborted(device_handle(), application_handle(),
+ CommunicationError());
+ } else {
+ LOG4CXX_DEBUG(logger_, "not unexpected_disconnect (#" << pthread_self() << ")");
+ controller_->ConnectionFinished(device_handle(), application_handle());
+ }
+ close(socket_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error ThreadedSocketConnection::Notify() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (-1 == write_fd_) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "Failed to wake up connection thread for connection " << this);
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::BAD_STATE");
+ return TransportAdapter::BAD_STATE;
+ }
+ uint8_t c = 0;
+ if (1 == write(write_fd_, &c, 1)) {
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+ } else {
+ LOG4CXX_ERROR_WITH_ERRNO(
+ logger_, "Failed to wake up connection thread for connection " << this);
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL");
+ return TransportAdapter::FAIL;
+ }
+}
+
+TransportAdapter::Error ThreadedSocketConnection::SendData(
+ RawMessagePtr message) {
+ LOG4CXX_TRACE(logger_, "enter");
+ pthread_mutex_lock(&frames_to_send_mutex_);
+ frames_to_send_.push(message);
+ pthread_mutex_unlock(&frames_to_send_mutex_);
+ TransportAdapter::Error error = Notify();
+ LOG4CXX_TRACE(logger_, "exit with error" << error);
+ return error;
+}
+
+TransportAdapter::Error ThreadedSocketConnection::Disconnect() {
+ LOG4CXX_TRACE(logger_, "enter");
+ terminate_flag_ = true;
+ TransportAdapter::Error error = Notify();
+ LOG4CXX_TRACE(logger_, "exit with error" << error);
+ return error;
+}
+
+void ThreadedSocketConnection::Thread() {
+ LOG4CXX_TRACE(logger_, "enter");
+ controller_->ConnectionCreated(this, device_uid_, app_handle_);
+ ConnectError* connect_error = NULL;
+ if (Establish(&connect_error)) {
+ LOG4CXX_DEBUG(logger_, "Connection established (#" << pthread_self() << ")");
+ controller_->ConnectDone(device_handle(), application_handle());
+ while (!terminate_flag_) {
+ Transmit();
+ }
+ LOG4CXX_DEBUG(logger_, "Connection is to finalize (#" << pthread_self() << ")");
+ Finalize();
+ while (!frames_to_send_.empty()) {
+ LOG4CXX_INFO(logger_, "removing message (#" << pthread_self() << ")");
+ RawMessagePtr message = frames_to_send_.front();
+ frames_to_send_.pop();
+ controller_->DataSendFailed(device_handle(), application_handle(),
+ message, DataSendError());
+ }
+ controller_->DisconnectDone(device_handle(), application_handle());
+ } else {
+ LOG4CXX_ERROR(logger_, "Connection Establish failed (#" << pthread_self() << ")");
+ controller_->ConnectFailed(device_handle(), application_handle(),
+ *connect_error);
+ delete connect_error;
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void ThreadedSocketConnection::Transmit() {
+ LOG4CXX_TRACE(logger_, "enter");
+
+ const nfds_t poll_fds_size = 2;
+ pollfd poll_fds[poll_fds_size];
+ poll_fds[0].fd = socket_;
+ poll_fds[0].events = POLLIN | POLLPRI | (frames_to_send_.empty() ? 0 : POLLOUT);
+ poll_fds[1].fd = read_fd_;
+ poll_fds[1].events = POLLIN | POLLPRI;
+
+ LOG4CXX_DEBUG(logger_, "poll (#" << pthread_self() << ") " << this);
+ if (-1 == poll(poll_fds, poll_fds_size, -1)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "poll failed for connection " << this);
+ Abort();
+ LOG4CXX_TRACE(logger_, "exit. Condition: -1 == poll(poll_fds, poll_fds_size, -1)");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "poll is ok (#" << pthread_self() << ") " << this << " revents0:"
+ <<
+ std::hex << poll_fds[0].revents << " revents1:" << std::hex << poll_fds[1].revents);
+ // error check
+ if (0 != (poll_fds[1].revents & (POLLERR | POLLHUP | POLLNVAL))) {
+ LOG4CXX_ERROR(logger_,
+ "Notification pipe for connection " << this << " terminated");
+ Abort();
+ LOG4CXX_TRACE(logger_,
+ "exit. Condition: 0 != (poll_fds[1].revents & (POLLERR | POLLHUP | POLLNVAL))");
+ return;
+ }
+
+ if (poll_fds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
+ LOG4CXX_WARN(logger_, "Connection " << this << " terminated");
+ Abort();
+ LOG4CXX_TRACE(logger_,
+ "exit. Condition: poll_fds[0].revents & (POLLERR | POLLHUP | POLLNVAL");
+ return;
+ }
+
+ // clear notifications
+ char buffer[256];
+ ssize_t bytes_read = -1;
+ do {
+ bytes_read = read(read_fd_, buffer, sizeof(buffer));
+ } while (bytes_read > 0);
+ if ((bytes_read < 0) && (EAGAIN != errno)) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to clear notification pipe");
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "poll failed for connection " << this);
+ Abort();
+ LOG4CXX_TRACE(logger_, "exit. Condition: (bytes_read < 0) && (EAGAIN != errno)");
+ return;
+ }
+
+ // send data if possible
+ if (!frames_to_send_.empty() && (poll_fds[0].revents | POLLOUT)) {
+ LOG4CXX_DEBUG(logger_, "frames_to_send_ not empty() (#" << pthread_self() << ")");
+
+ // send data
+ const bool send_ok = Send();
+ if (!send_ok) {
+ LOG4CXX_ERROR(logger_, "Send() failed (#" << pthread_self() << ")");
+ Abort();
+ LOG4CXX_TRACE(logger_, "exit. Condition: !send_ok");
+ return;
+ }
+ }
+
+ // receive data
+ if (poll_fds[0].revents & (POLLIN | POLLPRI)) {
+ const bool receive_ok = Receive();
+ if (!receive_ok) {
+ LOG4CXX_ERROR(logger_, "Receive() failed (#" << pthread_self() << ")");
+ Abort();
+ LOG4CXX_TRACE(logger_, "exit. Condition: !receive_ok");
+ return;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool ThreadedSocketConnection::Receive() {
+ LOG4CXX_TRACE(logger_, "enter");
+ uint8_t buffer[4096];
+ ssize_t bytes_read = -1;
+
+ do {
+ bytes_read = recv(socket_, buffer, sizeof(buffer), MSG_DONTWAIT);
+
+ if (bytes_read > 0) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Received " << bytes_read << " bytes for connection " << this);
+ RawMessagePtr frame(
+ new protocol_handler::RawMessage(0, 0, buffer, bytes_read));
+ controller_->DataReceiveDone(device_handle(), application_handle(),
+ frame);
+ } else if (bytes_read < 0) {
+ if (EAGAIN != errno && EWOULDBLOCK != errno) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_,
+ "recv() failed for connection " << this);
+ LOG4CXX_TRACE(logger_,
+ "exit with FALSE. Condition: EAGAIN != errno && EWOULDBLOCK != errno");
+ return false;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Connection " << this << " closed by remote peer");
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: bytes_read >= 0");
+ return false;
+ }
+ } while (bytes_read > 0);
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+bool ThreadedSocketConnection::Send() {
+ LOG4CXX_TRACE(logger_, "enter");
+ FrameQueue frames_to_send;
+ pthread_mutex_lock(&frames_to_send_mutex_);
+ std::swap(frames_to_send, frames_to_send_);
+ pthread_mutex_unlock(&frames_to_send_mutex_);
+
+ size_t offset = 0;
+ while (!frames_to_send.empty()) {
+ LOG4CXX_INFO(logger_, "frames_to_send is not empty" << pthread_self() << ")");
+ RawMessagePtr frame = frames_to_send.front();
+ const ssize_t bytes_sent = ::send(socket_, frame->data() + offset,
+ frame->data_size() - offset, 0);
+
+ if (bytes_sent >= 0) {
+ LOG4CXX_DEBUG(logger_, "bytes_sent >= 0" << pthread_self() << ")");
+ offset += bytes_sent;
+ if (offset == frame->data_size()) {
+ frames_to_send.pop();
+ offset = 0;
+ controller_->DataSendDone(device_handle(), application_handle(), frame);
+ }
+ } else {
+ LOG4CXX_DEBUG(logger_, "bytes_sent < 0" << pthread_self() << ")");
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Send failed for connection " << this);
+ frames_to_send.pop();
+ offset = 0;
+ controller_->DataSendFailed(device_handle(), application_handle(), frame,
+ DataSendError());
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+} // namespace
+} // namespace
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
new file mode 100644
index 0000000000..e1d6197072
--- /dev/null
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc
@@ -0,0 +1,845 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config_profile/profile.h"
+#include "utils/logger.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener.h"
+#include "transport_manager/transport_adapter/device_scanner.h"
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+#include "transport_manager/transport_adapter/client_connection_listener.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TransportAdapterImpl::TransportAdapterImpl(
+ DeviceScanner* device_scanner,
+ ServerConnectionFactory* server_connection_factory,
+ ClientConnectionListener* client_connection_listener)
+ : listeners_(),
+ initialised_(0),
+ devices_(),
+ devices_mutex_(),
+ connections_(),
+ connections_mutex_(),
+ device_scanner_(device_scanner),
+ server_connection_factory_(server_connection_factory),
+ client_connection_listener_(client_connection_listener)
+#ifdef TIME_TESTER
+ , metric_observer_(NULL)
+#endif // TIME_TESTER
+{
+ pthread_mutex_init(&devices_mutex_, 0);
+ pthread_mutex_init(&connections_mutex_, 0);
+}
+
+TransportAdapterImpl::~TransportAdapterImpl() {
+ if (device_scanner_) {
+ device_scanner_->Terminate();
+ LOG4CXX_DEBUG(logger_, "device_scanner_ " << device_scanner_ << " terminated.");
+ delete device_scanner_;
+ LOG4CXX_DEBUG(logger_, "device_scanner_ " << device_scanner_ << " deleted.");
+ }
+ if (server_connection_factory_) {
+ server_connection_factory_->Terminate();
+ LOG4CXX_DEBUG(logger_, "server_connection_factory " << server_connection_factory_ << " terminated.");
+ delete server_connection_factory_;
+ LOG4CXX_DEBUG(logger_, "server_connection_factory " << server_connection_factory_ << " deleted.");
+ }
+ if (client_connection_listener_) {
+ client_connection_listener_->Terminate();
+ LOG4CXX_DEBUG(logger_, "client_connection_listener_ " << client_connection_listener_ << " terminated.");
+ delete client_connection_listener_;
+ LOG4CXX_DEBUG(logger_, "client_connection_listener_ " << client_connection_listener_ << " deleted.");
+ }
+
+ pthread_mutex_lock(&connections_mutex_);
+ ConnectionMap connections;
+ std::swap(connections, connections_);
+ pthread_mutex_unlock(&connections_mutex_);
+ connections.clear();
+
+ LOG4CXX_DEBUG(logger_, "Connections deleted");
+
+ pthread_mutex_lock(&devices_mutex_);
+ DeviceMap devices;
+ std::swap(devices, devices_);
+ pthread_mutex_unlock(&devices_mutex_);
+ devices.clear();
+
+ LOG4CXX_DEBUG(logger_, "Devices deleted");
+
+ pthread_mutex_destroy(&connections_mutex_);
+ pthread_mutex_destroy(&devices_mutex_);
+}
+
+TransportAdapter::Error TransportAdapterImpl::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+
+ Error error = OK;
+
+ if ((error == OK) && device_scanner_) {
+ error = device_scanner_->Init();
+ }
+ if ((error == OK) && server_connection_factory_) {
+ error = server_connection_factory_->Init();
+ }
+ if ((error == OK) && client_connection_listener_) {
+ error = client_connection_listener_->Init();
+ }
+
+ initialised_ = (error == OK);
+
+ if (profile::Profile::instance()->use_last_state()) {
+ if (!Restore()) {
+ LOG4CXX_WARN(logger_, "could not restore transport adapter state");
+ error = FAIL;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit with error: " << error);
+ return error;
+}
+
+TransportAdapter::Error TransportAdapterImpl::SearchDevices() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (device_scanner_ == NULL) {
+ LOG4CXX_TRACE(logger_, "exit with NOT_SUPPORTED");
+ return NOT_SUPPORTED;
+ } else if (!device_scanner_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+ TransportAdapter::Error er = device_scanner_->Scan();
+ LOG4CXX_TRACE(logger_, "exit with error: " << er);
+ return er;
+}
+
+TransportAdapter::Error TransportAdapterImpl::Connect(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. DeviceUID " << device_id << " ApplicationHandle " <<
+ app_handle);
+ if (server_connection_factory_ == 0) {
+ LOG4CXX_TRACE(logger_, "exit with NOT_SUPPORTED");
+ return NOT_SUPPORTED;
+ }
+ if (!server_connection_factory_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+
+ pthread_mutex_lock(&connections_mutex_);
+ const bool already_exists =
+ connections_.end() !=
+ connections_.find(std::make_pair(device_id, app_handle));
+ if (!already_exists) {
+ ConnectionInfo& info = connections_[std::make_pair(device_id, app_handle)];
+ info.app_handle = app_handle;
+ info.device_id = device_id;
+ info.state = ConnectionInfo::NEW;
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+ if (already_exists) {
+ LOG4CXX_TRACE(logger_, "exit with ALREADY_EXISTS");
+ return ALREADY_EXISTS;
+ }
+
+ const TransportAdapter::Error err =
+ server_connection_factory_->CreateConnection(device_id, app_handle);
+ if (TransportAdapter::OK != err) {
+ pthread_mutex_lock(&connections_mutex_);
+ connections_.erase(std::make_pair(device_id, app_handle));
+ pthread_mutex_unlock(&connections_mutex_);
+ }
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+}
+
+TransportAdapter::Error TransportAdapterImpl::ConnectDevice(
+ const DeviceUID& device_handle) {
+ LOG4CXX_TRACE(logger_, "enter with device_handle: " << &device_handle);
+ DeviceSptr device = FindDevice(device_handle);
+ if (device) {
+ TransportAdapter::Error err = ConnectDevice(device);
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with BAD_PARAM");
+ return BAD_PARAM;
+ }
+}
+
+TransportAdapter::Error TransportAdapterImpl::Disconnect(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", device_id: " <<
+ &device_id);
+ if (!initialised_) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+ ConnectionSptr connection = FindEstablishedConnection(device_id, app_handle);
+ if (connection.valid()) {
+ TransportAdapter::Error err = connection->Disconnect();
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with BAD_PARAM");
+ return BAD_PARAM;
+ }
+}
+
+TransportAdapter::Error TransportAdapterImpl::DisconnectDevice(
+ const DeviceUID& device_id) {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
+ if (!initialised_) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+
+ Error error = OK;
+ pthread_mutex_lock(&connections_mutex_);
+ for (ConnectionMap::iterator it = connections_.begin();
+ it != connections_.end(); ++it) {
+
+ ConnectionInfo& info = it->second;
+ if (info.device_id == device_id &&
+ info.state != ConnectionInfo::FINALISING) {
+ if (OK != info.connection->Disconnect()) {
+ error = FAIL;
+ LOG4CXX_ERROR(logger_, "Error on disconnect" << error);
+ }
+ }
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with error " << error);
+ return error;
+}
+
+TransportAdapter::Error TransportAdapterImpl::SendData(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle,
+ const RawMessagePtr data) {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
+ &app_handle << ", data: " << data);
+ if (!initialised_) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+
+ ConnectionSptr connection = FindEstablishedConnection(device_id, app_handle);
+ if (connection.get() != 0) {
+ TransportAdapter::Error err = connection->SendData(data);
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with BAD_PARAM");
+ return BAD_PARAM;
+ }
+}
+
+TransportAdapter::Error TransportAdapterImpl::StartClientListening() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (client_connection_listener_ == 0) {
+ LOG4CXX_TRACE(logger_, "exit with NOT_SUPPORTED");
+ return NOT_SUPPORTED;
+ }
+ if (!client_connection_listener_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+ TransportAdapter::Error err = client_connection_listener_->StartListening();
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+}
+
+TransportAdapter::Error TransportAdapterImpl::StopClientListening() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (client_connection_listener_ == 0) {
+ LOG4CXX_TRACE(logger_, "exit with NOT_SUPPORTED");
+ return NOT_SUPPORTED;
+ }
+ if (!client_connection_listener_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
+ TransportAdapter::Error err = client_connection_listener_->StopListening();
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+}
+
+DeviceList TransportAdapterImpl::GetDeviceList() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ DeviceList devices;
+ pthread_mutex_lock(&devices_mutex_);
+ for (DeviceMap::const_iterator it = devices_.begin(); it != devices_.end();
+ ++it) {
+ devices.push_back(it->first);
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with DeviceList. It's' size = " << devices.size());
+ return devices;
+}
+
+DeviceSptr TransportAdapterImpl::AddDevice(DeviceSptr device) {
+ LOG4CXX_TRACE(logger_, "enter. device: " << device);
+ DeviceSptr existing_device;
+ bool same_device_found = false;
+ pthread_mutex_lock(&devices_mutex_);
+ for (DeviceMap::const_iterator i = devices_.begin(); i != devices_.end();
+ ++i) {
+ existing_device = i->second;
+ if (device->IsSameAs(existing_device.get())) {
+ same_device_found = true;
+ LOG4CXX_DEBUG(logger_, "device " << device << "already exists");
+ break;
+ }
+ }
+ if (!same_device_found) {
+ devices_[device->unique_device_id()] = device;
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+ if (same_device_found) {
+ LOG4CXX_TRACE(logger_, "exit with TRUE. Condition: same_device_found");
+ return existing_device;
+ } else {
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnDeviceListUpdated(this);
+ }
+ if (ToBeAutoConnected(device)) {
+ ConnectDevice(device);
+ }
+ LOG4CXX_TRACE(logger_, "exit with DeviceSptr " << device);
+ return device;
+ }
+}
+
+void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) {
+ LOG4CXX_TRACE(logger_, "enter. devices: " << &devices);
+ DeviceMap new_devices;
+ for (DeviceVector::const_iterator it = devices.begin(); it != devices.end();
+ ++it) {
+ DeviceSptr device = *it;
+ bool device_found = false;
+
+ pthread_mutex_lock(&devices_mutex_);
+ for (DeviceMap::iterator it = devices_.begin(); it != devices_.end();
+ ++it) {
+ DeviceSptr existing_device = it->second;
+ if (device->IsSameAs(existing_device.get())) {
+ existing_device->set_keep_on_disconnect(true);
+ device_found = true;
+ LOG4CXX_DEBUG(logger_, "device found. DeviceSptr" << it->second);
+ break;
+ }
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+
+ if (!device_found) {
+ LOG4CXX_INFO(logger_, "Adding new device " << device->unique_device_id()
+ << " (\"" << device->name()
+ << "\")");
+ }
+
+ device->set_keep_on_disconnect(true);
+ new_devices[device->unique_device_id()] = device;
+ }
+
+ pthread_mutex_lock(&connections_mutex_);
+ std::set<DeviceUID> connected_devices;
+ for (ConnectionMap::const_iterator it = connections_.begin();
+ it != connections_.end(); ++it) {
+ const ConnectionInfo& info = it->second;
+ if (info.state != ConnectionInfo::FINALISING) {
+ connected_devices.insert(info.device_id);
+ }
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+
+ DeviceMap all_devices = new_devices;
+ pthread_mutex_lock(&devices_mutex_);
+ for (DeviceMap::iterator it = devices_.begin(); it != devices_.end(); ++it) {
+ DeviceSptr existing_device = it->second;
+
+ if (all_devices.end() == all_devices.find(it->first)) {
+ if (connected_devices.end() != connected_devices.find(it->first)) {
+ existing_device->set_keep_on_disconnect(false);
+ all_devices[it->first] = existing_device;
+ }
+ }
+ }
+ devices_ = all_devices;
+ pthread_mutex_unlock(&devices_mutex_);
+
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnDeviceListUpdated(this);
+ (*it)->OnSearchDeviceDone(this);
+ }
+
+ for (DeviceMap::iterator it = new_devices.begin(); it != new_devices.end(); ++it) {
+ DeviceSptr device = it->second;
+ if (ToBeAutoConnected(device)) {
+ ConnectDevice(device);
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::ApplicationListUpdated(const DeviceUID& device_handle) {
+ // default implementation does nothing
+ // and is reimplemented in MME transport adapter only
+}
+
+void TransportAdapterImpl::FindNewApplicationsRequest() {
+ LOG4CXX_TRACE(logger_, "enter");
+ for (TransportAdapterListenerList::iterator i = listeners_.begin(); i != listeners_.end();
+ ++i) {
+ TransportAdapterListener* listener = *i;
+ listener->OnFindNewApplicationsRequest(this);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::SearchDeviceFailed(const SearchDeviceError& error) {
+ LOG4CXX_TRACE(logger_, "enter");
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnSearchDeviceFailed(this, error);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool TransportAdapterImpl::IsSearchDevicesSupported() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ return device_scanner_ != 0;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool TransportAdapterImpl::IsServerOriginatedConnectSupported() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ return server_connection_factory_ != 0;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool TransportAdapterImpl::IsClientOriginatedConnectSupported() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ return client_connection_listener_ != 0;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::ConnectionCreated(
+ ConnectionSptr connection, const DeviceUID& device_id,
+ const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter connection:" << connection << ", device_id: " << &device_id
+ << ", app_handle: " << &app_handle);
+ pthread_mutex_lock(&connections_mutex_);
+ ConnectionInfo& info = connections_[std::make_pair(device_id, app_handle)];
+ info.app_handle = app_handle;
+ info.device_id = device_id;
+ info.connection = connection;
+ info.state = ConnectionInfo::NEW;
+ pthread_mutex_unlock(&connections_mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::DeviceDisconnected(
+ const DeviceUID& device_handle, const DisconnectDeviceError& error) {
+ const DeviceUID device_uid = device_handle;
+ LOG4CXX_TRACE(logger_, "enter. device_handle: " << &device_uid << ", error: " <<
+ &error);
+ ApplicationList app_list = GetApplicationList(device_uid);
+ for (ApplicationList::const_iterator i = app_list.begin(); i != app_list.end(); ++i) {
+ ApplicationHandle app_handle = *i;
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ TransportAdapterListener* listener = *it;
+ listener->OnUnexpectedDisconnect(this, device_uid, app_handle, CommunicationError());
+ }
+ }
+
+ pthread_mutex_lock(&connections_mutex_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ TransportAdapterListener* listener = *it;
+ listener->OnDisconnectDeviceDone(this, device_uid);
+ }
+ for (ApplicationList::const_iterator i = app_list.begin(); i != app_list.end(); ++i) {
+ ApplicationHandle app_handle = *i;
+ connections_.erase(std::make_pair(device_uid, app_handle));
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+
+ RemoveDevice(device_uid);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::DisconnectDone(
+ const DeviceUID& device_handle, const ApplicationHandle& app_handle) {
+ const DeviceUID device_uid = device_handle;
+ const ApplicationHandle app_uid = app_handle;
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " <<
+ &app_uid);
+ bool device_disconnected = true;
+ pthread_mutex_lock(&connections_mutex_);
+ for (ConnectionMap::const_iterator it = connections_.begin();
+ it != connections_.end(); ++it) {
+ const DeviceUID& current_device_id = it->first.first;
+ const ApplicationHandle& current_app_handle = it->first.second;
+ if (current_device_id == device_uid && current_app_handle != app_uid) {
+ device_disconnected = false;
+ LOG4CXX_DEBUG(logger_,
+ "break. Condition: current_device_id == device_id && current_app_handle != app_handle");
+ break;
+ }
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ TransportAdapterListener* listener = *it;
+ listener->OnDisconnectDone(this, device_uid, app_uid);
+ if (device_disconnected) {
+ listener->OnDisconnectDeviceDone(this, device_uid);
+ }
+ }
+ pthread_mutex_lock(&connections_mutex_);
+ connections_.erase(std::make_pair(device_uid, app_uid));
+ pthread_mutex_unlock(&connections_mutex_);
+
+ if (device_disconnected) {
+ RemoveDevice(device_uid);
+ }
+
+ Store();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::DataReceiveDone(const DeviceUID& device_id,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message) {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
+ &app_handle << ", message: " << message);
+
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ metric_observer_->StartRawMsg(message.get());
+ }
+#endif // TIME_TESTER
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnDataReceiveDone(this, device_id, app_handle, message);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::DataReceiveFailed(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle,
+ const DataReceiveError& error) {
+ LOG4CXX_TRACE(logger_, "enter");
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnDataReceiveFailed(this, device_id, app_handle, error);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::DataSendDone(const DeviceUID& device_id,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message) {
+ LOG4CXX_TRACE(logger_, "enter");
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnDataSendDone(this, device_id, app_handle, message);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::DataSendFailed(const DeviceUID& device_id,
+ const ApplicationHandle& app_handle,
+ RawMessagePtr message,
+ const DataSendError& error) {
+ LOG4CXX_TRACE(logger_, "enter");
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnDataSendFailed(this, device_id, app_handle, message, error);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
+ DeviceSptr ret;
+ LOG4CXX_DEBUG(logger_, "devices_.size() = " << devices_.size());
+ pthread_mutex_lock(&devices_mutex_);
+ DeviceMap::const_iterator it = devices_.find(device_id);
+ if (it != devices_.end()) {
+ ret = it->second;
+ } else {
+ LOG4CXX_WARN(logger_, "Device " << device_id << " not found.");
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with DeviceSptr: " << ret);
+ return ret;
+}
+
+void TransportAdapterImpl::ConnectDone(const DeviceUID& device_id,
+ const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
+ &app_handle);
+ pthread_mutex_lock(&connections_mutex_);
+ ConnectionMap::iterator it_conn =
+ connections_.find(std::make_pair(device_id, app_handle));
+ if (it_conn != connections_.end()) {
+ ConnectionInfo& info = it_conn->second;
+ info.state = ConnectionInfo::ESTABLISHED;
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnConnectDone(this, device_id, app_handle);
+ }
+
+ Store();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::ConnectFailed(const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle, const ConnectError& error) {
+ const DeviceUID device_uid = device_handle;
+ const ApplicationHandle app_uid = app_handle;
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " <<
+ &app_uid << ", error: " << &error);
+ pthread_mutex_lock(&connections_mutex_);
+ connections_.erase(std::make_pair(device_uid, app_uid));
+ pthread_mutex_unlock(&connections_mutex_);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnConnectFailed(this, device_uid, app_uid, error);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::AddListener(TransportAdapterListener* listener) {
+ LOG4CXX_TRACE(logger_, "enter");
+ listeners_.push_back(listener);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+ApplicationList TransportAdapterImpl::GetApplicationList(
+ const DeviceUID& device_id) const {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
+ DeviceSptr device = FindDevice(device_id);
+ if (device.valid()) {
+ ApplicationList lst = device->GetApplicationList();
+ LOG4CXX_TRACE(logger_, "exit with ApplicationList. It's size = " << lst.size() <<
+ " Condition: device.valid()");
+ return lst;
+ }
+ LOG4CXX_TRACE(logger_, "exit with empty ApplicationList. Condition: NOT device.valid()");
+ return ApplicationList();
+}
+
+void TransportAdapterImpl::ConnectionFinished(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
+ &app_handle);
+ pthread_mutex_lock(&connections_mutex_);
+ ConnectionMap::iterator it =
+ connections_.find(std::make_pair(device_id, app_handle));
+ if (it != connections_.end()) {
+ ConnectionInfo& info = it->second;
+ info.state = ConnectionInfo::FINALISING;
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterImpl::ConnectionAborted(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle,
+ const CommunicationError& error) {
+ ConnectionFinished(device_id, app_handle);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ (*it)->OnUnexpectedDisconnect(this, device_id, app_handle, error);
+ }
+}
+
+bool TransportAdapterImpl::IsInitialised() const {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (!initialised_) {
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !initialised_");
+ return false;
+ }
+ if (device_scanner_ && !device_scanner_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_,
+ "exit with FALSE. Condition: device_scanner_ && !device_scanner_->IsInitialised()");
+ return false;
+ }
+ if (server_connection_factory_ &&
+ !server_connection_factory_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_,
+ "exit with FALSE. Condition: server_connection_factory_ && !server_connection_factory_->IsInitialised()");
+ return false;
+ }
+ if (client_connection_listener_ &&
+ !client_connection_listener_->IsInitialised()) {
+ LOG4CXX_TRACE(logger_,
+ "exit with FALSE. Condition: client_connection_listener_ && !client_connection_listener_->IsInitialised()");
+ return false;
+ }
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
+ DeviceSptr device = FindDevice(device_id);
+ if (device.valid()) {
+ return device->name();
+ } else {
+ return "";
+ }
+}
+
+std::string TransportAdapterImpl::GetConnectionType() const {
+ const std::string deviceType = GetDeviceType();
+ std::string result("USB_serial_number");
+ if ("sdl-tcp" == deviceType || "sdl-bluetooth" == deviceType) {
+ result.assign("BTMAC");
+ }
+ return result;
+}
+
+#ifdef TIME_TESTER
+void TransportAdapterImpl::SetTimeMetricObserver(TMMetricObserver* observer) {
+ metric_observer_ = observer;
+}
+#endif // TIME_TESTER
+
+#ifdef TIME_TESTER
+TMMetricObserver* TransportAdapterImpl::GetTimeMetricObserver() {
+ return metric_observer_;
+}
+#endif // TIME_TESTER
+
+void TransportAdapterImpl::Store() const {
+}
+
+bool TransportAdapterImpl::Restore() {
+ return true;
+}
+
+bool TransportAdapterImpl::ToBeAutoConnected(DeviceSptr device) const {
+ return false;
+}
+
+ConnectionSptr TransportAdapterImpl::FindEstablishedConnection(
+ const DeviceUID& device_id, const ApplicationHandle& app_handle) const {
+ LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " <<
+ &app_handle);
+ ConnectionSptr connection;
+ pthread_mutex_lock(&connections_mutex_);
+ ConnectionMap::const_iterator it =
+ connections_.find(std::make_pair(device_id, app_handle));
+ if (it != connections_.end()) {
+ const ConnectionInfo& info = it->second;
+ if (info.state == ConnectionInfo::ESTABLISHED) {
+ connection = info.connection;
+ }
+ }
+ pthread_mutex_unlock(&connections_mutex_);
+ LOG4CXX_TRACE(logger_, "exit with ConnectionSptr: " << connection);
+ return connection;
+}
+
+TransportAdapter::Error TransportAdapterImpl::ConnectDevice(DeviceSptr device) {
+ LOG4CXX_TRACE(logger_, "enter. device: " << device);
+ DeviceUID device_id = device->unique_device_id();
+ ApplicationList app_list = device->GetApplicationList();
+ LOG4CXX_INFO(logger_, "Device " << device->name() << " has "
+ << app_list.size() << " applications.");
+ bool errors_occurred = false;
+ for (ApplicationList::iterator it = app_list.begin(); it != app_list.end(); ++it) {
+ const ApplicationHandle app_handle = *it;
+ LOG4CXX_DEBUG(logger_, "Attempt to connect device " << device_id <<
+ ", channel " << app_handle);
+ const Error error = Connect(device_id, app_handle);
+ switch (error) {
+ case OK:
+ LOG4CXX_DEBUG(logger_, "error = OK");
+ break;
+ case ALREADY_EXISTS:
+ LOG4CXX_DEBUG(logger_, "error = ALREADY_EXISTS");
+ break;
+ default:
+ LOG4CXX_ERROR(logger_, "Connect to device " << device_id <<
+ ", channel " << app_handle <<
+ " failed with error " << error);
+ errors_occurred = true;
+ LOG4CXX_DEBUG(logger_, "switch (error), default case");
+ break;
+ }
+ }
+ if (errors_occurred) {
+ LOG4CXX_TRACE(logger_, "exit with error:FAIL");
+ return FAIL;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with error:OK");
+ return OK;
+ }
+}
+
+void TransportAdapterImpl::RemoveDevice(const DeviceUID& device_handle) {
+ LOG4CXX_TRACE(logger_, "enter. device_handle: " << &device_handle);
+ pthread_mutex_lock(&devices_mutex_);
+ DeviceMap::iterator i = devices_.find(
+ device_handle); //ykazakov: there is no erase for const iterator on QNX
+ if (i != devices_.end()) {
+ DeviceSptr device = i->second;
+ if (!device->keep_on_disconnect()) {
+ devices_.erase(i);
+ for (TransportAdapterListenerList::iterator it = listeners_.begin();
+ it != listeners_.end(); ++it) {
+ TransportAdapterListener* listener = *it;
+ listener->OnDeviceListUpdated(this);
+ }
+ }
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+
+} // namespace transport_adapter
+
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
new file mode 100644
index 0000000000..18128d681e
--- /dev/null
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+
+#include "utils/logger.h"
+
+#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
+#include "transport_manager/transport_manager_impl.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+
+namespace transport_manager {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TransportAdapterListenerImpl::TransportAdapterListenerImpl(
+ TransportManagerImpl* manager, TransportAdapter* adapter) :
+ transport_manager_impl_(manager), transport_adapter_(adapter) {
+}
+
+void TransportAdapterListenerImpl::OnSearchDeviceDone(
+ const TransportAdapter* adapter) {
+ LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE,
+ transport_adapter_, "", 0, RawMessagePtr(), BaseErrorPtr());
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnSearchDeviceFailed(
+ const TransportAdapter* adapter, const SearchDeviceError& error) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", error: " << &error);
+ SearchDeviceError* err = new SearchDeviceError(error);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL,
+ transport_adapter_, "", 0, RawMessagePtr(), BaseErrorPtr(err));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDeviceListUpdated(
+ const TransportAdapter* adapter) {
+ LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ transport_adapter_, "", 0, RawMessagePtr(), BaseErrorPtr());
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnFindNewApplicationsRequest(
+ const TransportAdapter* adapter) {
+ LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::ON_FIND_NEW_APPLICATIONS_REQUEST,
+ transport_adapter_, "", 0, RawMessagePtr(), BaseErrorPtr());
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnConnectDone(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& application_id) {
+ LOG4CXX_TRACE(logger_, "enter adapter*: " << adapter << ", device: " << &device <<
+ ", application_id: " << &application_id);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE,
+ transport_adapter_, device, application_id, RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnConnectFailed(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id, const ConnectError& error) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id << ", error: " << &error);
+ ConnectError* err = new ConnectError(error);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL,
+ transport_adapter_, device, app_id, RawMessagePtr(), BaseErrorPtr(err));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDisconnectDone(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE,
+ transport_adapter_, device, app_id, RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDisconnectFailed(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id, const DisconnectError& error) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id << ", error: " << &error);
+ DisconnectError* err = new DisconnectError(error);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL,
+ transport_adapter_, device, app_id, RawMessagePtr(), BaseErrorPtr(err));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDisconnectDeviceDone(
+ const TransportAdapter* adapter, const DeviceUID& device) {
+}
+
+void TransportAdapterListenerImpl::OnDisconnectDeviceFailed(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const DisconnectDeviceError& error) {
+}
+
+void TransportAdapterListenerImpl::OnDataReceiveDone(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id, const RawMessagePtr data_container) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id << ", data_container: " << data_container);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE,
+ transport_adapter_, device, app_id, data_container,
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDataReceiveFailed(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id, const DataReceiveError& error) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id << ", error: " << &error);
+ DataReceiveError* err = new DataReceiveError(error);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL,
+ transport_adapter_, device, app_id, RawMessagePtr(), BaseErrorPtr(err));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDataSendDone(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id, const RawMessagePtr data_container) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id << ", data_container: " << data_container);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE,
+ transport_adapter_, device, app_id, data_container,
+ new BaseError());
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnDataSendFailed(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id, const RawMessagePtr data_container,
+ const DataSendError& error) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id << ", data_container: " << data_container << ", error: "
+ << &error);
+ DataSendError* err = new DataSendError(error);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL,
+ transport_adapter_, device, app_id, data_container, BaseErrorPtr(err));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnConnectRequested(
+ const TransportAdapter* adapter, const DeviceUID& device_handle,
+ const ApplicationHandle& app_handle) {
+}
+
+void TransportAdapterListenerImpl::OnUnexpectedDisconnect(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& application, const CommunicationError& error) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application: " << &application << ", error: " << &error);
+ CommunicationError* err = new CommunicationError(error);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
+ transport_adapter_, device, application, RawMessagePtr(), BaseErrorPtr(err));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnCommunicationError(
+ const TransportAdapter* adapter, const DeviceUID& device,
+ const ApplicationHandle& app_id) {
+ LOG4CXX_TRACE(logger_, "enter. adapter: " << adapter << ", device: " << &device <<
+ ", application_id: " << &app_id);
+ const TransportAdapterEvent event(
+ TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR,
+ transport_adapter_, device, app_id, RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager::E_SUCCESS
+ != transport_manager_impl_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc
new file mode 100644
index 0000000000..ffd1b3d860
--- /dev/null
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -0,0 +1,107 @@
+/*
+ * \file transport_manager_default.cc
+ * \brief TransportManagerDefault class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config_profile/profile.h"
+
+#include "transport_manager/transport_manager_default.h"
+#include "transport_manager/tcp/tcp_transport_adapter.h"
+#include "utils/logger.h"
+
+#ifdef BLUETOOTH_SUPPORT
+#include "transport_manager/bluetooth/bluetooth_transport_adapter.h"
+#endif
+
+// CUSTOMER_PASA
+
+#if defined(USB_SUPPORT)
+#include "transport_manager/usb/usb_aoa_adapter.h"
+#endif // USB_SUPPORT
+
+
+
+namespace transport_manager {
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+int TransportManagerDefault::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (E_SUCCESS != TransportManagerImpl::Init()) {
+ LOG4CXX_TRACE(logger_, "exit with E_TM_IS_NOT_INITIALIZED. Condition: E_SUCCESS != TransportManagerImpl::Init()");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ transport_adapter::TransportAdapterImpl* ta;
+#ifdef BLUETOOTH_SUPPORT
+
+ ta = new transport_adapter::BluetoothTransportAdapter;
+
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ ta->SetTimeMetricObserver(metric_observer_);
+ }
+#endif // TIME_TESTER
+ AddTransportAdapter(ta);
+#endif
+ uint16_t port = profile::Profile::instance()->transport_manager_tcp_adapter_port();
+ ta = new transport_adapter::TcpTransportAdapter(port);
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ ta->SetTimeMetricObserver(metric_observer_);
+ }
+#endif // TIME_TESTER
+ AddTransportAdapter(ta);
+
+// CUSTOMER_PASA
+
+#if defined(USB_SUPPORT)
+ ta = new transport_adapter::UsbAoaAdapter();
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ ta->SetTimeMetricObserver(metric_observer_);
+ }
+#endif // TIME_TESTER
+ AddTransportAdapter(ta);
+#endif // USB_SUPPORT
+
+
+
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+TransportManagerDefault::~TransportManagerDefault() {}
+
+TransportManagerDefault::TransportManagerDefault()
+ : TransportManagerImpl() {}
+
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
new file mode 100644
index 0000000000..16810ef47d
--- /dev/null
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -0,0 +1,987 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/transport_manager_impl.h"
+
+#include <pthread.h>
+#include <stdint.h>
+#include <cstring>
+#include <queue>
+#include <set>
+#include <algorithm>
+#include <limits>
+#include <functional>
+#include <sstream>
+
+#include "utils/macro.h"
+#include "utils/logger.h"
+#include "transport_manager/common.h"
+#include "transport_manager/transport_manager_listener.h"
+#include "transport_manager/transport_manager_listener_empty.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+#include "transport_manager/transport_adapter/transport_adapter_event.h"
+#include "config_profile/profile.h"
+
+using ::transport_manager::transport_adapter::TransportAdapter;
+
+namespace transport_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TransportManagerImpl::Connection TransportManagerImpl::convert(
+ const TransportManagerImpl::ConnectionInternal& p) {
+ LOG4CXX_TRACE(logger_, "enter. ConnectionInternal: " << &p);
+ TransportManagerImpl::Connection c;
+ c.application = p.application;
+ c.device = p.device;
+ c.id = p.id;
+ LOG4CXX_TRACE(logger_, "exit with TransportManagerImpl::Connection. It's ConnectionUID = "
+ << c.id);
+ return c;
+}
+
+TransportManagerImpl::TransportManagerImpl()
+ : message_queue_mutex_(),
+ all_thread_active_(false),
+ message_queue_thread_(),
+ event_queue_thread_(),
+ device_listener_thread_wakeup_(),
+ is_initialized_(false),
+#ifdef TIME_TESTER
+ metric_observer_(NULL),
+#endif // TIME_TESTER
+ connection_id_counter_(0) {
+ LOG4CXX_INFO(logger_, "==============================================");
+ pthread_mutex_init(&message_queue_mutex_, NULL);
+ pthread_cond_init(&message_queue_cond_, NULL);
+ pthread_mutex_init(&event_queue_mutex_, 0);
+ pthread_cond_init(&device_listener_thread_wakeup_, NULL);
+ LOG4CXX_DEBUG(logger_, "TransportManager object created");
+}
+
+TransportManagerImpl::~TransportManagerImpl() {
+ LOG4CXX_DEBUG(logger_, "TransportManager object destroying");
+
+ for (std::vector<TransportAdapter*>::iterator it =
+ transport_adapters_.begin();
+ it != transport_adapters_.end(); ++it) {
+ delete *it;
+ }
+
+ for (std::map<TransportAdapter*, TransportAdapterListenerImpl*>::iterator it =
+ transport_adapter_listeners_.begin();
+ it != transport_adapter_listeners_.end(); ++it) {
+ delete it->second;
+ }
+
+ pthread_mutex_destroy(&message_queue_mutex_);
+ pthread_cond_destroy(&message_queue_cond_);
+ pthread_mutex_destroy(&event_queue_mutex_);
+ pthread_cond_destroy(&device_listener_thread_wakeup_);
+ LOG4CXX_INFO(logger_, "TransportManager object destroyed");
+}
+
+int TransportManagerImpl::ConnectDevice(const DeviceHandle& device_handle) {
+ LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
+ if (!this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TransportManager is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+
+ DeviceUID device_id = converter_.HandleToUid(device_handle);
+ LOG4CXX_DEBUG(logger_, "Convert handle to id " << device_id);
+
+ transport_adapter::TransportAdapter* ta = device_to_adapter_map_[device_id];
+ if (NULL == ta) {
+ LOG4CXX_ERROR(logger_, "No device adapter found by id " << device_id);
+ LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == ta");
+ return E_INVALID_HANDLE;
+ }
+
+ TransportAdapter::Error ta_error = ta->ConnectDevice(device_id);
+ int err = (TransportAdapter::OK == ta_error) ? E_SUCCESS : E_INTERNAL_ERROR;
+ LOG4CXX_TRACE(logger_, "exit with error: " << err);
+ return err;
+}
+
+int TransportManagerImpl::DisconnectDevice(const DeviceHandle& device_handle) {
+ LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
+ if (!this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TransportManager is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ DeviceUID device_id = converter_.HandleToUid(device_handle);
+ LOG4CXX_DEBUG(logger_, "Convert handle to id" << device_id);
+
+ transport_adapter::TransportAdapter* ta = device_to_adapter_map_[device_id];
+ if (NULL == ta) {
+ LOG4CXX_WARN(logger_, "No device adapter found by id " << device_id);
+ LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == ta");
+ return E_INVALID_HANDLE;
+ }
+ ta->DisconnectDevice(device_id);
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::Disconnect(const ConnectionUID& cid) {
+ LOG4CXX_TRACE(logger_, "enter. ConnectionUID: " << &cid);
+ if (!this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TransportManager is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+
+ ConnectionInternal* connection = GetConnection(cid);
+ if (NULL == connection) {
+ LOG4CXX_ERROR(logger_, "TransportManagerImpl::Disconnect: Connection does not exist.");
+ LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection");
+ return E_INVALID_HANDLE;
+ }
+
+ pthread_mutex_lock(&event_queue_mutex_);
+ int messages_count = 0;
+ for (EventQueue::const_iterator it = event_queue_.begin();
+ it != event_queue_.end();
+ ++it) {
+ if (it->application_id == static_cast<ApplicationHandle>(cid)) {
+ ++messages_count;
+ }
+ }
+ pthread_mutex_unlock(&event_queue_mutex_);
+
+ if (messages_count > 0) {
+ connection->messages_count = messages_count;
+ connection->shutDown = true;
+
+ const uint32_t disconnect_timeout =
+ profile::Profile::instance()->transport_manager_disconnect_timeout();
+ if (disconnect_timeout > 0) {
+ connection->timer->start(disconnect_timeout);
+ }
+ } else {
+ connection->transport_adapter->Disconnect(connection->device,
+ connection->application);
+ }
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::DisconnectForce(const ConnectionUID& cid) {
+ LOG4CXX_TRACE(logger_, "enter ConnectionUID: " << &cid);
+ if (false == this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TransportManager is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ pthread_mutex_lock(&event_queue_mutex_);
+ // Clear messages for this connection
+ // Note that MessageQueue typedef is assumed to be std::list,
+ // or there is a problem here. One more point versus typedefs-everywhere
+ MessageQueue::iterator e = message_queue_.begin();
+ while (e != message_queue_.end()) {
+ if (static_cast<ConnectionUID>((*e)->connection_key()) == cid) {
+ RaiseEvent(&TransportManagerListener::OnTMMessageSendFailed,
+ DataSendTimeoutError(), *e);
+ e = message_queue_.erase(e);
+ } else {
+ ++e;
+ }
+ }
+ pthread_mutex_unlock(&event_queue_mutex_);
+ const ConnectionInternal* connection = GetConnection(cid);
+ if (NULL == connection) {
+ LOG4CXX_ERROR(
+ logger_,
+ "TransportManagerImpl::DisconnectForce: Connection does not exist.");
+ LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection");
+ return E_INVALID_HANDLE;
+ }
+ connection->transport_adapter->Disconnect(connection->device,
+ connection->application);
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::AddEventListener(TransportManagerListener* listener) {
+ LOG4CXX_TRACE(logger_, "enter. TransportManagerListener: " << listener);
+ transport_manager_listener_.push_back(listener);
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::Stop() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (!all_thread_active_) {
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: !all_thread_active_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ all_thread_active_ = false;
+
+ pthread_mutex_lock(&event_queue_mutex_);
+ pthread_cond_signal(&device_listener_thread_wakeup_);
+ pthread_mutex_unlock(&event_queue_mutex_);
+
+ pthread_mutex_lock(&message_queue_mutex_);
+ pthread_cond_signal(&message_queue_cond_);
+ pthread_mutex_unlock(&message_queue_mutex_);
+
+ pthread_join(message_queue_thread_, 0);
+ pthread_join(event_queue_thread_, 0);
+
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::SendMessageToDevice(const RawMessagePtr message) {
+ LOG4CXX_TRACE(logger_, "enter. RawMessageSptr: " << message);
+ LOG4CXX_INFO(logger_, "Send message to device called with arguments "
+ << message.get());
+ if (false == this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TM is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+
+ const ConnectionInternal* connection =
+ GetConnection(message->connection_key());
+ if (NULL == connection) {
+ LOG4CXX_ERROR(logger_, "Connection with id " << message->connection_key()
+ << " does not exist.");
+ LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection");
+ return E_INVALID_HANDLE;
+ }
+
+ if (connection->shutDown) {
+ LOG4CXX_ERROR(logger_, "TransportManagerImpl::Disconnect: Connection is to shut down.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_CONNECTION_IS_TO_SHUTDOWN. Condition: connection->shutDown");
+ return E_CONNECTION_IS_TO_SHUTDOWN;
+ }
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ metric_observer_->StartRawMsg(message.get());
+ }
+#endif // TIME_TESTER
+ this->PostMessage(message);
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::ReceiveEventFromDevice(const TransportAdapterEvent& event) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapterEvent: " << &event);
+ if (!is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TM is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ this->PostEvent(event);
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::RemoveDevice(const DeviceHandle& device_handle) {
+ LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
+ DeviceUID device_id = converter_.HandleToUid(device_handle);
+ if (false == this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TM is not initialized.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ device_to_adapter_map_.erase(device_id);
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::AddTransportAdapter(
+ transport_adapter::TransportAdapter* transport_adapter) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << transport_adapter);
+
+ if (transport_adapter_listeners_.find(transport_adapter) !=
+ transport_adapter_listeners_.end()) {
+ LOG4CXX_ERROR(logger_, "Adapter already exists.");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_ADAPTER_EXISTS. Condition: transport_adapter_listeners_.find(transport_adapter) != transport_adapter_listeners_.end()");
+ return E_ADAPTER_EXISTS;
+ }
+ transport_adapter_listeners_[transport_adapter] =
+ new TransportAdapterListenerImpl(this, transport_adapter);
+ transport_adapter->AddListener(
+ transport_adapter_listeners_[transport_adapter]);
+
+ if (transport_adapter->IsInitialised() ||
+ transport_adapter->Init() == TransportAdapter::OK) {
+ transport_adapters_.push_back(transport_adapter);
+ }
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::SearchDevices() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (!this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TM is not initialized");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+
+ LOG4CXX_INFO(logger_, "Search device called");
+
+ bool success_occurred = false;
+
+ for (std::vector<TransportAdapter*>::iterator it =
+ transport_adapters_.begin();
+ it != transport_adapters_.end(); ++it) {
+ LOG4CXX_DEBUG(logger_, "Iterating over transport adapters");
+ TransportAdapter::Error scanResult = (*it)->SearchDevices();
+ if (transport_adapter::TransportAdapter::OK == scanResult) {
+ success_occurred = true;
+ } else {
+ LOG4CXX_ERROR(logger_, "Transport Adapter search failed "
+ << *it << "[" << (*it)->GetDeviceType()
+ << "]");
+ switch (scanResult) {
+ case transport_adapter::TransportAdapter::NOT_SUPPORTED: {
+ LOG4CXX_ERROR(logger_, "Search feature is not supported "
+ << *it << "[" << (*it)->GetDeviceType()
+ << "]");
+ LOG4CXX_DEBUG(logger_, "scanResult = TransportAdapter::NOT_SUPPORTED");
+ break;
+ }
+ case transport_adapter::TransportAdapter::BAD_STATE: {
+ LOG4CXX_ERROR(logger_, "Transport Adapter has bad state " << *it << "[" <<
+ (*it)->GetDeviceType()
+ << "]");
+ LOG4CXX_DEBUG(logger_, "scanResult = TransportAdapter::BAD_STATE");
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Invalid scan result");
+ LOG4CXX_DEBUG(logger_, "scanResult = default switch case");
+ return E_ADAPTERS_FAIL;
+ }
+ }
+ }
+ }
+ int transport_adapter_search = (success_occurred || transport_adapters_.empty())
+ ? E_SUCCESS
+ : E_ADAPTERS_FAIL;
+ if (transport_adapter_search == E_SUCCESS) {
+ LOG4CXX_TRACE(logger_,
+ "exit with E_SUCCESS. Condition: success_occured || transport_adapters_.empty()");
+ } else {
+ LOG4CXX_TRACE(logger_,
+ "exit with E_ADAPTERS_FAIL. Condition: success_occured || transport_adapters_.empty()");
+ }
+ return transport_adapter_search;
+}
+
+int TransportManagerImpl::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ all_thread_active_ = true;
+
+ int error_code = pthread_create(&message_queue_thread_, 0,
+ &MessageQueueStartThread, this);
+ if (0 != error_code) {
+ LOG4CXX_ERROR(logger_,
+ "Message queue thread is not created exit with error code "
+ << error_code);
+ LOG4CXX_TRACE(logger_, "exit with E_TM_IS_NOT_INITIALIZED. Condition: 0 != error_code");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ pthread_setname_np(message_queue_thread_, "TM MessageQueue");
+
+ error_code = pthread_create(&event_queue_thread_, 0,
+ &EventListenerStartThread, this);
+ if (0 != error_code) {
+ LOG4CXX_ERROR(logger_,
+ "Event queue thread is not created exit with error code "
+ << error_code);
+ LOG4CXX_TRACE(logger_, "exit with E_TM_IS_NOT_INITIALIZED. Condition: 0 != error_code");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+ pthread_setname_np(event_queue_thread_, "TM EventListener");
+
+ is_initialized_ = true;
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+int TransportManagerImpl::Visibility(const bool& on_off) const {
+ LOG4CXX_TRACE(logger_, "enter. On_off: " << &on_off);
+ TransportAdapter::Error ret;
+
+ LOG4CXX_DEBUG(logger_, "Visibility change requested to " << on_off);
+ if (false == this->is_initialized_) {
+ LOG4CXX_ERROR(logger_, "TM is not initialized");
+ LOG4CXX_TRACE(logger_,
+ "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_");
+ return E_TM_IS_NOT_INITIALIZED;
+ }
+
+ for (std::vector<TransportAdapter*>::const_iterator it =
+ transport_adapters_.begin();
+ it != transport_adapters_.end(); ++it) {
+ if (on_off) {
+ ret = (*it)->StartClientListening();
+ } else {
+ ret = (*it)->StopClientListening();
+ }
+ if (TransportAdapter::Error::NOT_SUPPORTED == ret) {
+ LOG4CXX_DEBUG(logger_, "Visibility change is not supported for adapter "
+ << *it << "[" << (*it)->GetDeviceType() << "]");
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
+ return E_SUCCESS;
+}
+
+void TransportManagerImpl::UpdateDeviceList(TransportAdapter* ta) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << ta);
+ std::set<DeviceInfo> old_devices;
+ for (DeviceInfoList::iterator it = device_list_.begin();
+ it != device_list_.end();) {
+ if (it->first == ta) {
+ old_devices.insert(it->second);
+ it = device_list_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+ std::set<DeviceInfo> new_devices;
+ const DeviceList dev_list = ta->GetDeviceList();
+ for (DeviceList::const_iterator it = dev_list.begin();
+ it != dev_list.end(); ++it) {
+ DeviceHandle device_handle = converter_.UidToHandle(*it);
+ DeviceInfo info(device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType());
+ device_list_.push_back(std::make_pair(ta, info));
+ new_devices.insert(info);
+ }
+
+ std::set<DeviceInfo> added_devices;
+ std::set_difference(new_devices.begin(), new_devices.end(),
+ old_devices.begin(), old_devices.end(),
+ std::inserter(added_devices, added_devices.begin()));
+ for (std::set<DeviceInfo>::const_iterator it = added_devices.begin();
+ it != added_devices.end();
+ ++it) {
+ RaiseEvent(&TransportManagerListener::OnDeviceAdded, *it);
+ }
+
+ std::set<DeviceInfo> removed_devices;
+ std::set_difference(old_devices.begin(), old_devices.end(),
+ new_devices.begin(), new_devices.end(),
+ std::inserter(removed_devices, removed_devices.begin()));
+
+ for (std::set<DeviceInfo>::const_iterator it = removed_devices.begin();
+ it != removed_devices.end();
+ ++it) {
+ RaiseEvent(&TransportManagerListener::OnDeviceRemoved, *it);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportManagerImpl::PostMessage(const RawMessagePtr message) {
+ LOG4CXX_TRACE(logger_, "enter. RawMessageSptr: " << message);
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.AcquireForWriting();
+#else
+ pthread_mutex_lock(&message_queue_mutex_);
+#endif
+ message_queue_.push_back(message);
+ pthread_cond_signal(&message_queue_cond_);
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.Release();
+#else
+ pthread_mutex_unlock(&message_queue_mutex_);
+#endif
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportManagerImpl::RemoveMessage(const RawMessagePtr message) {
+ // TODO: Reconsider necessity of this method, remove if it's useless,
+ // make to work otherwise.
+ // 2013-08-21 dchmerev@luxoft.com
+ LOG4CXX_TRACE(logger_, "enter RawMessageSptr: " << message);
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.AcquireForWriting();
+#else
+ pthread_mutex_lock(&message_queue_mutex_);
+#endif
+ std::remove(message_queue_.begin(), message_queue_.end(), message);
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.Release();
+#else
+ pthread_mutex_unlock(&message_queue_mutex_);
+#endif
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportManagerImpl::PostEvent(const TransportAdapterEvent& event) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapterEvent: " << &event);
+#ifdef USE_RWLOCK
+ event_queue_rwlock_.AcquireForWriting();
+#else
+ pthread_mutex_lock(&event_queue_mutex_);
+#endif
+ event_queue_.push_back(event);
+ pthread_cond_signal(&device_listener_thread_wakeup_);
+#ifdef USE_RWLOCK
+ event_queue_rwlock_.Release();
+#else
+ pthread_mutex_unlock(&event_queue_mutex_);
+#endif
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void* TransportManagerImpl::EventListenerStartThread(void* data) {
+ LOG4CXX_TRACE(logger_, "enter Data: " << data);
+ if (NULL != data) {
+ static_cast<TransportManagerImpl*>(data)->EventListenerThread();
+ }
+ LOG4CXX_TRACE(logger_, "exit with 0");
+ return 0;
+}
+
+void TransportManagerImpl::AddConnection(const ConnectionInternal& c) {
+ LOG4CXX_TRACE(logger_, "enter ConnectionInternal: " << &c);
+ connections_.push_back(c);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportManagerImpl::RemoveConnection(uint32_t id) {
+ LOG4CXX_TRACE(logger_, "enter Id: " << id);
+ for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ it != connections_.end(); ++it) {
+ if (it->id == id) {
+ connections_.erase(it);
+ break;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
+ const ConnectionUID& id) {
+ LOG4CXX_TRACE(logger_, "enter. ConnectionUID: " << &id);
+ for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ it != connections_.end(); ++it) {
+ if (it->id == id) {
+ LOG4CXX_TRACE(logger_, "exit with ConnectionInternal. It's adress: " << &*it);
+ return &*it;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit with NULL");
+ return NULL;
+
+}
+
+TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
+ const DeviceUID& device, const ApplicationHandle& application) {
+ LOG4CXX_TRACE(logger_, "enter DeviceUID: " << &device << "ApplicationHandle: " <<
+ &application);
+ for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ it != connections_.end(); ++it) {
+ if (it->device == device && it->application == application) {
+ LOG4CXX_TRACE(logger_, "exit with ConnectionInternal. It's adress: " << &*it);
+ return &*it;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit with NULL");
+ return NULL;
+}
+
+void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << ta);
+ const DeviceList device_list = ta->GetDeviceList();
+ LOG4CXX_INFO(logger_, "DEVICE_LIST_UPDATED " << device_list.size());
+ for (DeviceList::const_iterator it = device_list.begin();
+ it != device_list.end(); ++it) {
+ device_to_adapter_map_.insert(std::make_pair(*it, ta));
+ DeviceHandle device_handle = converter_.UidToHandle(*it);
+ DeviceInfo info(device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType());
+ RaiseEvent(&TransportManagerListener::OnDeviceFound, info);
+ }
+ UpdateDeviceList(ta);
+ std::vector<DeviceInfo> device_infos;
+ for (DeviceInfoList::const_iterator it = device_list_.begin();
+ it != device_list_.end(); ++it) {
+ device_infos.push_back(it->second);
+ }
+ RaiseEvent(&TransportManagerListener::OnDeviceListUpdated, device_infos);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportManagerImpl::EventListenerThread() {
+ LOG4CXX_TRACE(logger_, "enter");
+#ifndef USE_RWLOCK
+ pthread_mutex_lock(&event_queue_mutex_);
+#endif
+ LOG4CXX_INFO(logger_, "Event listener thread started");
+ while (true) {
+ while (event_queue_.size() > 0) {
+#ifdef USE_RWLOCK
+ event_queue_rwlock_.AcquireForReading();
+#endif
+ LOG4CXX_INFO(logger_, "Event listener queue pushed to process events");
+ EventQueue::iterator current_it = event_queue_.begin();
+ const TransportAdapterEvent event = *(current_it);
+ event_queue_.erase(current_it);
+#ifdef USE_RWLOCK
+ event_queue_rwlock_.Release();
+#else
+ pthread_mutex_unlock(&event_queue_mutex_);
+#endif
+ ConnectionInternal* connection = GetConnection(event.device_uid, event.application_id);
+
+ switch (event.event_type) {
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE: {
+ RaiseEvent(&TransportManagerListener::OnScanDevicesFinished);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_SEARCH_DONE");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL: {
+ // error happened in real search process (external error)
+ RaiseEvent(&TransportManagerListener::OnScanDevicesFailed,
+ *static_cast<SearchDeviceError*>(event.event_error.get()));
+ LOG4CXX_DEBUG(logger_, "event_type = ON_SEARCH_FAIL");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED: {
+ OnDeviceListUpdated(event.transport_adapter);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_DEVICE_LIST_UPDATED");
+ break;
+ }
+ case TransportAdapterListenerImpl::ON_FIND_NEW_APPLICATIONS_REQUEST: {
+ RaiseEvent(&TransportManagerListener::OnFindNewApplicationsRequest);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_FIND_NEW_APPLICATIONS_REQUEST");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE: {
+ const DeviceHandle device_handle = converter_.UidToHandle(event.device_uid);
+ AddConnection(ConnectionInternal(this, event.transport_adapter, ++connection_id_counter_,
+ event.device_uid, event.application_id,
+ device_handle));
+ RaiseEvent(&TransportManagerListener::OnConnectionEstablished,
+ DeviceInfo(device_handle, event.device_uid,
+ event.transport_adapter->DeviceName(event.device_uid),
+ event.transport_adapter->GetConnectionType()),
+ connection_id_counter_);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_DONE");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL: {
+ RaiseEvent(&TransportManagerListener::OnConnectionFailed,
+ DeviceInfo(converter_.UidToHandle(event.device_uid), event.device_uid,
+ event.transport_adapter->DeviceName(event.device_uid),
+ event.transport_adapter->GetConnectionType()),
+ ConnectError());
+ LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_FAIL");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE: {
+ if (NULL == connection) {
+ LOG4CXX_ERROR(logger_, "Connection not found");
+ LOG4CXX_DEBUG(logger_,
+ "event_type = ON_DISCONNECT_DONE && NULL == connection");
+ break;
+ }
+ RaiseEvent(&TransportManagerListener::OnConnectionClosed,
+ connection->id);
+ RemoveConnection(connection->id);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_DONE");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL: {
+ const DeviceHandle device_handle = converter_.UidToHandle(event.device_uid);
+ RaiseEvent(&TransportManagerListener::OnDisconnectFailed,
+ device_handle, DisconnectDeviceError());
+ LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_FAIL");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE: {
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ metric_observer_->StopRawMsg(event.event_data.get());
+ }
+#endif // TIME_TESTER
+ if (connection == NULL) {
+ LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", "
+ << event.application_id
+ << ") not found");
+ LOG4CXX_DEBUG(logger_, "event_type = ON_SEND_DONE. Condition: NULL == connection");
+ break;
+ }
+ RaiseEvent(&TransportManagerListener::OnTMMessageSend, event.event_data);
+ this->RemoveMessage(event.event_data);
+ if (connection->shutDown && --connection->messages_count == 0) {
+ connection->timer->stop();
+ connection->transport_adapter->Disconnect(connection->device,
+ connection->application);
+ }
+ LOG4CXX_DEBUG(logger_, "event_type = ON_SEND_DONE");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL: {
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ metric_observer_->StopRawMsg(event.event_data.get());
+ }
+#endif // TIME_TESTER
+ if (connection == NULL) {
+ LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", "
+ << event.application_id
+ << ") not found");
+ LOG4CXX_DEBUG(logger_, "event_type = ON_SEND_FAIL. Condition: NULL == connection");
+ break;
+ }
+
+ // TODO(YK): start timer here to wait before notify caller
+ // and remove unsent messages
+ LOG4CXX_ERROR(logger_, "Transport adapter failed to send data");
+ // TODO(YK): potential error case -> thread unsafe
+ // update of message content
+ if (event.event_data.valid()) {
+ event.event_data->set_waiting(true);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Data is invalid");
+ }
+ LOG4CXX_DEBUG(logger_, "eevent_type = ON_SEND_FAIL");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE: {
+ if (connection == NULL) {
+ LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", "
+ << event.application_id
+ << ") not found");
+ LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_DONE. Condition: NULL == connection");
+ break;
+ }
+ event.event_data->set_connection_key(connection->id);
+#ifdef TIME_TESTER
+ if (metric_observer_) {
+ metric_observer_->StopRawMsg(event.event_data.get());
+ }
+#endif // TIME_TESTER
+ RaiseEvent(&TransportManagerListener::OnTMMessageReceived, event.event_data);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_DONE");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL: {
+ LOG4CXX_DEBUG(logger_, "Event ON_RECEIVED_FAIL");
+ if (connection == NULL) {
+ LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", "
+ << event.application_id
+ << ") not found");
+ break;
+ }
+
+ RaiseEvent(&TransportManagerListener::OnTMMessageReceiveFailed,
+ connection->id, *static_cast<DataReceiveError*>(event.event_error.get()));
+ LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_FAIL");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR: {
+ LOG4CXX_DEBUG(logger_, "event_type = ON_COMMUNICATION_ERROR");
+ break;
+ }
+ case TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT: {
+ if (connection) {
+ RaiseEvent(&TransportManagerListener::OnUnexpectedDisconnect,
+ connection->id,
+ *static_cast<CommunicationError*>(event.event_error.get()));
+ RemoveConnection(connection->id);
+ } else {
+ LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", "
+ << event.application_id
+ << ") not found");
+ }
+ LOG4CXX_DEBUG(logger_, "eevent_type = ON_UNEXPECTED_DISCONNECT");
+ break;
+ }
+ } // switch
+#ifndef USE_RWLOCK
+ pthread_mutex_lock(&event_queue_mutex_);
+#endif
+ } // while (event_queue_.size() > 0)
+
+ if (all_thread_active_) {
+ pthread_cond_wait(&device_listener_thread_wakeup_, &event_queue_mutex_);
+ } else {
+ LOG4CXX_DEBUG(logger_, "break. Condition: NOT all_thread_active_");
+ break;
+ }
+ } // while (true)
+
+ pthread_mutex_unlock(&event_queue_mutex_);
+
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+#ifdef TIME_TESTER
+void TransportManagerImpl::SetTimeMetricObserver(TMMetricObserver* observer) {
+ metric_observer_ = observer;
+}
+#endif // TIME_TESTER
+
+void* TransportManagerImpl::MessageQueueStartThread(void* data) {
+ LOG4CXX_TRACE(logger_, "enter. Data:" << data);
+ if (NULL != data) {
+ static_cast<TransportManagerImpl*>(data)->MessageQueueThread();
+ }
+ LOG4CXX_TRACE(logger_, "exit with 0");
+ return 0;
+}
+
+void TransportManagerImpl::MessageQueueThread() {
+ LOG4CXX_TRACE(logger_, "enter");
+#ifndef USE_RWLOCK
+ pthread_mutex_lock(&message_queue_mutex_);
+#endif
+
+ while (all_thread_active_) {
+ // TODO(YK): add priority processing
+
+ while (message_queue_.size() > 0) {
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.AcquireForReading();
+#endif
+ MessageQueue::iterator it = message_queue_.begin();
+ while (it != message_queue_.end() && it->valid() && (*it)->IsWaiting()) {
+ ++it;
+ }
+ if (it == message_queue_.end()) {
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.Release();
+#endif
+ LOG4CXX_TRACE(logger_, "break. Condition: it == message_queue_.end()");
+ break;
+ }
+ RawMessagePtr active_msg = *it;
+#ifdef USE_RWLOCK
+ message_queue_rwlock_.Release();
+#else
+ pthread_mutex_unlock(&message_queue_mutex_);
+#endif
+ if (active_msg.valid() && !active_msg->IsWaiting()) {
+ ConnectionInternal* connection =
+ GetConnection(active_msg->connection_key());
+ if (connection == NULL) {
+ std::stringstream ss;
+ ss << "Connection " << active_msg->connection_key() << " not found";
+ LOG4CXX_ERROR(logger_, ss.str());
+ RaiseEvent(&TransportManagerListener::OnTMMessageSendFailed,
+ DataSendError(ss.str()), active_msg);
+ message_queue_.remove(active_msg);
+ continue;
+ }
+ TransportAdapter* transport_adapter = connection->transport_adapter;
+ LOG4CXX_DEBUG(logger_, "Got adapter "
+ << transport_adapter << "["
+ << transport_adapter->GetDeviceType() << "]"
+ << " by session id "
+ << active_msg->connection_key());
+
+ if (NULL == transport_adapter) {
+ std::string error_text =
+ "Transport adapter is not found - message removed";
+ LOG4CXX_ERROR(logger_, error_text);
+ RaiseEvent(&TransportManagerListener::OnTMMessageSendFailed,
+ DataSendError(error_text), active_msg);
+ message_queue_.remove(active_msg);
+ } else {
+ if (TransportAdapter::OK ==
+ transport_adapter->SendData(
+ connection->device, connection->application, active_msg)) {
+ LOG4CXX_INFO(logger_, "Data sent to adapter");
+ active_msg->set_waiting(true);
+ } else {
+ LOG4CXX_ERROR(logger_, "Data sent error");
+ RaiseEvent(&TransportManagerListener::OnTMMessageSendFailed,
+ DataSendError("Send failed - message removed"),
+ active_msg);
+ message_queue_.remove(active_msg);
+ }
+ }
+ }
+#ifndef USE_RWLOCK
+ pthread_mutex_lock(&message_queue_mutex_);
+#endif
+ }
+ pthread_cond_wait(&message_queue_cond_, &message_queue_mutex_);
+ } // while(true)
+
+ message_queue_.clear();
+
+ pthread_mutex_unlock(&message_queue_mutex_);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportManagerImpl::ConnectionInternal::ConnectionInternal(
+ TransportManagerImpl* transport_manager, TransportAdapter* transport_adapter,
+ const ConnectionUID& id, const DeviceUID& dev_id, const ApplicationHandle& app_id,
+ const DeviceHandle& device_handle)
+ : transport_manager(transport_manager),
+ transport_adapter(transport_adapter),
+ timer(new TimerInternal("TM DiscRoutine", this, &ConnectionInternal::DisconnectFailedRoutine)),
+ shutDown(false),
+ device_handle_(device_handle),
+ messages_count(0) {
+ Connection::id = id;
+ Connection::device = dev_id;
+ Connection::application = app_id;
+}
+
+void TransportManagerImpl::ConnectionInternal::DisconnectFailedRoutine() {
+ LOG4CXX_TRACE(logger_, "enter");
+ transport_manager->RaiseEvent(&TransportManagerListener::OnDisconnectFailed,
+ device_handle_, DisconnectDeviceError());
+ shutDown = false;
+ timer->stop();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+} // namespace transport_manager
+
+
diff --git a/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc b/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
new file mode 100644
index 0000000000..103e03a4f6
--- /dev/null
+++ b/src/components/transport_manager/src/usb/libusb/platform_usb_device.cc
@@ -0,0 +1,85 @@
+/**
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/usb/libusb/platform_usb_device.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+
+PlatformUsbDevice::PlatformUsbDevice(
+ uint8_t bus_number, uint8_t address,
+ const libusb_device_descriptor& device_descriptor,
+ libusb_device* device_libusb, libusb_device_handle* device_handle_libusb)
+ : bus_number_(bus_number),
+ address_(address),
+ vendor_id_(device_descriptor.idVendor),
+ product_id_(device_descriptor.idProduct),
+ device_descriptor_(device_descriptor),
+ libusb_device_handle_(device_handle_libusb),
+ libusb_device_(device_libusb) {}
+
+std::string PlatformUsbDevice::GetDescString(uint8_t index) const {
+ LOG4CXX_TRACE(logger_, "enter. index: " << int(index));
+ unsigned char buf[128];
+ const int libusb_ret = libusb_get_string_descriptor_ascii(
+ libusb_device_handle_, index, buf, sizeof(buf));
+ if (libusb_ret < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to get USB string descriptor: "
+ << libusb_error_name(libusb_ret));
+ LOG4CXX_TRACE(logger_, "exit with empty string");
+ return "";
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+ return std::string(reinterpret_cast<char*>(buf));
+}
+
+std::string PlatformUsbDevice::GetManufacturer() const {
+ return GetDescString(device_descriptor_.iManufacturer);
+}
+
+std::string PlatformUsbDevice::GetProductName() const {
+ return GetDescString(device_descriptor_.iProduct);
+}
+
+std::string PlatformUsbDevice::GetSerialNumber() const {
+ return GetDescString(device_descriptor_.iSerialNumber);
+}
+
+} // namespace
+} // namespace
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
new file mode 100644
index 0000000000..76f2f99e4c
--- /dev/null
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2013-2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+#include <iomanip>
+
+#include <libusb/libusb.h>
+
+#include <sstream>
+
+#include "transport_manager/usb/libusb/usb_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+
+UsbConnection::UsbConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller,
+ const UsbHandlerSptr& usb_handler,
+ PlatformUsbDevice* device)
+ : device_uid_(device_uid),
+ app_handle_(app_handle),
+ controller_(controller),
+ usb_handler_(usb_handler),
+ libusb_device_(device->GetLibusbDevice()),
+ device_handle_(device->GetLibusbHandle()),
+ in_endpoint_(0),
+ in_endpoint_max_packet_size_(0),
+ out_endpoint_(0),
+ out_endpoint_max_packet_size_(0),
+ in_buffer_(NULL),
+ in_transfer_(NULL),
+ out_transfer_(0),
+ out_messages_(),
+ current_out_message_(),
+ bytes_sent_(0),
+ disconnecting_(false),
+ waiting_in_transfer_cancel_(false),
+ waiting_out_transfer_cancel_(false) {
+}
+
+UsbConnection::~UsbConnection() {
+ LOG4CXX_TRACE(logger_, "enter with this" << this);
+ Finalise();
+ libusb_free_transfer(in_transfer_);
+ delete[] in_buffer_;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+// Callback for handling income and outcome data from lib_usb
+void InTransferCallback(libusb_transfer* transfer) {
+ static_cast<UsbConnection*>(transfer->user_data)->OnInTransfer(transfer);
+}
+
+void OutTransferCallback(libusb_transfer* transfer) {
+ static_cast<UsbConnection*>(transfer->user_data)->OnOutTransfer(transfer);
+}
+
+bool UsbConnection::PostInTransfer() {
+ LOG4CXX_TRACE(logger_, "enter");
+ libusb_fill_bulk_transfer(in_transfer_, device_handle_, in_endpoint_,
+ in_buffer_, in_endpoint_max_packet_size_,
+ InTransferCallback, this, 0);
+ const int libusb_ret = libusb_submit_transfer(in_transfer_);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_, "libusb_submit_transfer failed: "
+ << libusb_error_name(libusb_ret));
+ LOG4CXX_TRACE(logger_,
+ "exit with FALSE. Condition: LIBUSB_SUCCESS != libusb_submit_transfer");
+ return false;
+ }
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+std::string hex_data(const unsigned char* const buffer, const int actual_length) {
+ std::ostringstream hexdata;
+ for (int i = 0; i < actual_length; ++i) {
+ hexdata << " " << std::hex << std::setw(2) << std::setfill('0')
+ << int(buffer[i]);
+ }
+ return hexdata.str();
+}
+
+void UsbConnection::OnInTransfer(libusb_transfer* transfer) {
+ LOG4CXX_TRACE(logger_, "enter with Libusb_transfer*: " << transfer);
+ if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
+ LOG4CXX_DEBUG(logger_,
+ "USB incoming transfer, size:" << transfer->actual_length
+ << ", data:" << hex_data(transfer->buffer, transfer->actual_length));
+ RawMessagePtr data(new protocol_handler::RawMessage(
+ 0, 0, in_buffer_, transfer->actual_length));
+ controller_->DataReceiveDone(device_uid_, app_handle_, data);
+ } else {
+ LOG4CXX_ERROR(logger_, "USB incoming transfer failed: "
+ << libusb_error_name(transfer->status));
+ controller_->DataReceiveFailed(device_uid_, app_handle_,
+ DataReceiveError());
+ }
+ if (disconnecting_) {
+ waiting_in_transfer_cancel_ = false;
+ } else {
+ if (!PostInTransfer()) {
+ LOG4CXX_ERROR(logger_, "USB incoming transfer failed with "
+ << "LIBUSB_TRANSFER_NO_DEVICE. Abort connection.");
+ AbortConnection();
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbConnection::PopOutMessage() {
+ LOG4CXX_TRACE(logger_, "enter");
+ bytes_sent_ = 0;
+ if (out_messages_.empty()) {
+ current_out_message_.reset();
+ } else {
+ current_out_message_ = out_messages_.front();
+ out_messages_.pop_front();
+ PostOutTransfer();
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+bool UsbConnection::PostOutTransfer() {
+ LOG4CXX_TRACE(logger_, "enter");
+ out_transfer_ = libusb_alloc_transfer(0);
+ if (0 == out_transfer_) {
+ LOG4CXX_ERROR(logger_, "libusb_alloc_transfer failed");
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: 0 == out_transfer_");
+ return false;
+ }
+ libusb_fill_bulk_transfer(out_transfer_, device_handle_, out_endpoint_,
+ current_out_message_->data() + bytes_sent_,
+ current_out_message_->data_size() - bytes_sent_,
+ OutTransferCallback, this, 0);
+ const int libusb_ret = libusb_submit_transfer(out_transfer_);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_, "libusb_submit_transfer failed: "
+ << libusb_error_name(libusb_ret) << ". Abort connection.");
+ AbortConnection();
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: "
+ << "LIBUSB_SUCCESS != libusb_fill_bulk_transfer");
+ return false;
+ }
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+void UsbConnection::OnOutTransfer(libusb_transfer* transfer) {
+ LOG4CXX_TRACE(logger_, "enter with Libusb_transfer*: " << transfer);
+ sync_primitives::AutoLock locker(out_messages_mutex_);
+ if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
+ bytes_sent_ += transfer->actual_length;
+ if (bytes_sent_ == current_out_message_->data_size()) {
+ LOG4CXX_DEBUG(logger_, "USB out transfer, data sent: "
+ << current_out_message_.get());
+ controller_->DataSendDone(device_uid_, app_handle_, current_out_message_);
+ PopOutMessage();
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "USB out transfer failed: "
+ << libusb_error_name(transfer->status));
+ controller_->DataSendFailed(device_uid_, app_handle_, current_out_message_,
+ DataSendError());
+ PopOutMessage();
+ }
+ if (!current_out_message_.valid()) {
+ libusb_free_transfer(transfer);
+ out_transfer_ = NULL;
+ waiting_out_transfer_cancel_ = false;
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error UsbConnection::SendData(RawMessagePtr message) {
+ LOG4CXX_TRACE(logger_, "enter with RawMessagePtr: " << message.get());
+ if (disconnecting_) {
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::BAD_STATE. Condition: "
+ << "disconnecting_");
+ return TransportAdapter::BAD_STATE;
+ }
+ sync_primitives::AutoLock locker(out_messages_mutex_);
+ if (current_out_message_.valid()) {
+ out_messages_.push_back(message);
+ } else {
+ current_out_message_ = message;
+ if (!PostOutTransfer()) {
+ controller_->DataSendFailed(device_uid_, app_handle_, message,
+ DataSendError());
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL. Condition: !PostOutTransfer()");
+ return TransportAdapter::FAIL;
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK.");
+ return TransportAdapter::OK;
+}
+
+void UsbConnection::Finalise() {
+ LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_DEBUG(logger_, "Finalise USB connection " << device_uid_);
+ {
+ sync_primitives::AutoLock locker(out_messages_mutex_);
+ disconnecting_ = true;
+ if (out_transfer_) {
+ waiting_out_transfer_cancel_ = true;
+ if ( LIBUSB_SUCCESS != libusb_cancel_transfer(out_transfer_)) {
+ waiting_out_transfer_cancel_ = false;
+ }
+ }
+ if (in_transfer_) {
+ waiting_in_transfer_cancel_ = true;
+ if ( LIBUSB_SUCCESS != libusb_cancel_transfer(in_transfer_)) {
+ waiting_in_transfer_cancel_ = false;
+ }
+ }
+ for (std::list<RawMessagePtr>::iterator it = out_messages_.begin();
+ it != out_messages_.end(); it = out_messages_.erase(it)) {
+ controller_->DataSendFailed(device_uid_, app_handle_, *it, DataSendError());
+ }
+ }
+ while (waiting_in_transfer_cancel_ || waiting_out_transfer_cancel_) {
+ pthread_yield();
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbConnection::AbortConnection() {
+ LOG4CXX_TRACE(logger_, "enter");
+ controller_->ConnectionAborted(device_uid_, app_handle_, CommunicationError());
+ Disconnect();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error UsbConnection::Disconnect() {
+ Finalise();
+ controller_->DisconnectDone(device_uid_, app_handle_);
+ return TransportAdapter::OK;
+}
+
+bool UsbConnection::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (!FindEndpoints()) {
+ LOG4CXX_ERROR(logger_, "EndPoints was not found");
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !FindEndpoints()");
+ return false;
+ }
+ in_buffer_ = new unsigned char[in_endpoint_max_packet_size_];
+ in_transfer_ = libusb_alloc_transfer(0);
+ if (NULL == in_transfer_) {
+ LOG4CXX_ERROR(logger_, "libusb_alloc_transfer failed");
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: NULL == in_transfer_");
+ return false;
+ }
+
+ controller_->ConnectDone(device_uid_, app_handle_);
+ if (!PostInTransfer()) {
+ LOG4CXX_ERROR(logger_, "PostInTransfer failed. Call ConnectionAborted");
+ controller_->ConnectionAborted(device_uid_, app_handle_,
+ CommunicationError());
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !PostInTransfer()");
+ return false;
+ }
+
+ LOG4CXX_TRACE(logger_, "exit with TRUE");
+ return true;
+}
+
+bool UsbConnection::FindEndpoints() {
+ LOG4CXX_TRACE(logger_, "enter");
+ struct libusb_config_descriptor* config;
+ const int libusb_ret =
+ libusb_get_active_config_descriptor(libusb_device_, &config);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_, "libusb_get_active_config_descriptor failed: "
+ << libusb_error_name(libusb_ret));
+ LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return false;
+ }
+
+ bool find_in_endpoint = true;
+ bool find_out_endpoint = true;
+
+ for (int i = 0; i < config->bNumInterfaces; ++i) {
+ const libusb_interface& interface = config->interface[i];
+ for (int i = 0; i < interface.num_altsetting; ++i) {
+ const libusb_interface_descriptor& iface_desc = interface.altsetting[i];
+ for (int i = 0; i < iface_desc.bNumEndpoints; ++i) {
+ const libusb_endpoint_descriptor& endpoint_desc =
+ iface_desc.endpoint[i];
+
+ const uint8_t endpoint_dir =
+ endpoint_desc.bEndpointAddress & LIBUSB_ENDPOINT_DIR_MASK;
+ if (find_in_endpoint && endpoint_dir == LIBUSB_ENDPOINT_IN) {
+ in_endpoint_ = endpoint_desc.bEndpointAddress;
+ in_endpoint_max_packet_size_ = endpoint_desc.wMaxPacketSize;
+ find_in_endpoint = false;
+ } else if (find_out_endpoint && endpoint_dir == LIBUSB_ENDPOINT_OUT) {
+ out_endpoint_ = endpoint_desc.bEndpointAddress;
+ out_endpoint_max_packet_size_ = endpoint_desc.wMaxPacketSize;
+ find_out_endpoint = false;
+ }
+ }
+ }
+ }
+ libusb_free_config_descriptor(config);
+
+ const bool result = !(find_in_endpoint || find_out_endpoint);
+ LOG4CXX_TRACE(logger_, "exit with " << (result ? "TRUE" : "FALSE"));
+ return result;
+}
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/libusb/usb_handler.cc b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
new file mode 100644
index 0000000000..eb0ffdb4dc
--- /dev/null
+++ b/src/components/transport_manager/src/usb/libusb/usb_handler.cc
@@ -0,0 +1,474 @@
+/**
+ * \file usb_handler.cc
+ * \brief UsbHandler class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstring>
+#include <cstdlib>
+
+#include "transport_manager/usb/common.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+class UsbHandler::ControlTransferSequenceState {
+ public:
+ ControlTransferSequenceState(class UsbHandler* usb_handler,
+ UsbControlTransferSequence* sequence,
+ PlatformUsbDevice* device);
+ ~ControlTransferSequenceState();
+ void Finish();
+ bool Finished() const {
+ return finished_;
+ }
+ UsbControlTransfer* CurrentTransfer();
+ UsbControlTransfer* Next();
+ UsbHandler* usb_handler() const {
+ return usb_handler_;
+ }
+ PlatformUsbDevice* device() const {
+ return device_;
+ }
+
+ private:
+ UsbHandler* usb_handler_;
+ PlatformUsbDevice* device_;
+ bool finished_;
+ UsbControlTransferSequence* sequence_;
+ UsbControlTransferSequence::Transfers::const_iterator current_transfer_;
+};
+
+UsbHandler::UsbHandler()
+ : shutdown_requested_(false),
+ thread_(),
+ usb_device_listeners_(),
+ devices_(),
+ transfer_sequences_(),
+ device_handles_to_close_(),
+ libusb_context_(NULL),
+ arrived_callback_handle_(),
+ left_callback_handle_() {}
+
+UsbHandler::~UsbHandler() {
+ shutdown_requested_ = true;
+ if (libusb_context_ != 0) {
+ libusb_hotplug_deregister_callback(libusb_context_,
+ arrived_callback_handle_);
+ libusb_hotplug_deregister_callback(libusb_context_, left_callback_handle_);
+ }
+ pthread_join(thread_, 0);
+ LOG4CXX_INFO(logger_, "UsbHandler thread finished");
+ if (libusb_context_) {
+ libusb_exit(libusb_context_);
+ libusb_context_ = 0;
+ }
+}
+
+void UsbHandler::DeviceArrived(libusb_device* device_libusb) {
+ LOG4CXX_TRACE(logger_, "enter. libusb_device* " << device_libusb);
+ const uint8_t bus_number = libusb_get_bus_number(device_libusb);
+ const uint8_t device_address = libusb_get_device_address(device_libusb);
+ libusb_device_descriptor descriptor;
+ int libusb_ret = libusb_get_device_descriptor(device_libusb, &descriptor);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_, "libusb_get_device_descriptor failed: " << libusb_ret);
+ LOG4CXX_TRACE(logger_, "exit. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return;
+ }
+
+ libusb_device_handle* device_handle_libusb;
+ libusb_ret = libusb_open(device_libusb, &device_handle_libusb);
+ if (libusb_ret != LIBUSB_SUCCESS) {
+ LOG4CXX_ERROR(logger_, "libusb_open failed: " << libusb_error_name(libusb_ret));
+ LOG4CXX_TRACE(logger_, "exit. Condition: libusb_ret != LIBUSB_SUCCESS");
+ return;
+ }
+
+ int configuration;
+ libusb_ret = libusb_get_configuration(device_handle_libusb, &configuration);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_INFO(logger_, "libusb_get_configuration failed: " << libusb_error_name(
+ libusb_ret));
+ LOG4CXX_TRACE(logger_, "exit. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return;
+ }
+
+ if (configuration != kUsbConfiguration) {
+ libusb_ret = libusb_set_configuration(device_handle_libusb, kUsbConfiguration);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_INFO(logger_, "libusb_set_configuration failed: " << libusb_error_name(
+ libusb_ret));
+ LOG4CXX_TRACE(logger_, "exit. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return;
+ }
+ }
+
+ libusb_ret = libusb_claim_interface(device_handle_libusb, 0);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_INFO(logger_, "libusb_claim_interface failed: " << libusb_error_name(libusb_ret));
+ CloseDeviceHandle(device_handle_libusb);
+ LOG4CXX_TRACE(logger_, "exit. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return;
+ }
+
+ PlatformUsbDevice* device(new PlatformUsbDevice(bus_number, device_address,
+ descriptor, device_libusb,
+ device_handle_libusb));
+ devices_.push_back(device);
+
+ for (std::list<UsbDeviceListener*>::iterator it =
+ usb_device_listeners_.begin();
+ it != usb_device_listeners_.end(); ++it) {
+ (*it)->OnDeviceArrived(device);
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbHandler::DeviceLeft(libusb_device* device_libusb) {
+ LOG4CXX_TRACE(logger_, "enter. libusb_device* " << device_libusb);
+ PlatformUsbDevice* device = NULL;
+ for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) {
+ if ((*it)->GetLibusbDevice() == device_libusb) {
+ device = *it;
+ break;
+ }
+ }
+ if (NULL == device) {
+ LOG4CXX_TRACE(logger_, "enter. Condition: NULL == device");
+ return;
+ }
+
+ for (std::list<UsbDeviceListener*>::iterator it =
+ usb_device_listeners_.begin();
+ it != usb_device_listeners_.end(); ++it) {
+ (*it)->OnDeviceLeft(device);
+ }
+
+ for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) {
+ if ((*it)->GetLibusbDevice() == device_libusb) {
+ devices_.erase(it);
+ break;
+ }
+ }
+
+ if (device->GetLibusbHandle()) {
+ libusb_release_interface(device->GetLibusbHandle(), 0);
+ CloseDeviceHandle(device->GetLibusbHandle());
+ }
+ delete device;
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbHandler::StartControlTransferSequence(
+ UsbControlTransferSequence* sequence, PlatformUsbDevice* device) {
+ LOG4CXX_TRACE(logger_, "enter. UsbControlTransferSequence* " << sequence <<
+ "PlatformUsbDevice* " << device);
+ TransferSequences::iterator it = transfer_sequences_.insert(
+ transfer_sequences_.end(),
+ new ControlTransferSequenceState(this, sequence, device));
+ SubmitControlTransfer(*it);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbHandler::CloseDeviceHandle(libusb_device_handle* device_handle) {
+ device_handles_to_close_.push_back(device_handle);
+}
+
+void* UsbHandlerThread(void* data) {
+ static_cast<UsbHandler*>(data)->Thread();
+ return 0;
+}
+
+int ArrivedCallback(libusb_context* context, libusb_device* device,
+ libusb_hotplug_event event, void* data) {
+ LOG4CXX_TRACE(logger_, "enter. libusb device arrived (bus number "
+ << static_cast<int>(libusb_get_bus_number(device))
+ << ", device address "
+ << static_cast<int>(
+ libusb_get_device_address(device)) << ")");
+ UsbHandler* usb_handler = static_cast<UsbHandler*>(data);
+ usb_handler->DeviceArrived(device);
+ LOG4CXX_TRACE(logger_, "exit with 0");
+ return 0;
+}
+
+int LeftCallback(libusb_context* context, libusb_device* device,
+ libusb_hotplug_event event, void* data) {
+ LOG4CXX_TRACE(logger_, "enter libusb device left (bus number "
+ << static_cast<int>(libusb_get_bus_number(device))
+ << ", device address "
+ << static_cast<int>(
+ libusb_get_device_address(device)) << ")");
+ UsbHandler* usb_handler = static_cast<UsbHandler*>(data);
+ usb_handler->DeviceLeft(device);
+ LOG4CXX_TRACE(logger_, "exit with 0");
+ return 0;
+}
+
+TransportAdapter::Error UsbHandler::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ int libusb_ret = libusb_init(&libusb_context_);
+
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_, "libusb_init failed: " << libusb_ret);
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return TransportAdapter::FAIL;
+ }
+
+ if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {
+ LOG4CXX_ERROR(logger_, "LIBUSB_CAP_HAS_HOTPLUG not supported");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: !libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)");
+ return TransportAdapter::FAIL;
+ }
+
+ libusb_ret = libusb_hotplug_register_callback(
+ libusb_context_, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED,
+ LIBUSB_HOTPLUG_ENUMERATE, LIBUSB_HOTPLUG_MATCH_ANY,
+ LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, ArrivedCallback, this,
+ &arrived_callback_handle_);
+
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_,
+ "libusb_hotplug_register_callback failed: " << libusb_ret);
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return TransportAdapter::FAIL;
+ }
+
+ libusb_ret = libusb_hotplug_register_callback(
+ libusb_context_, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT,
+ static_cast<libusb_hotplug_flag>(0), LIBUSB_HOTPLUG_MATCH_ANY,
+ LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, LeftCallback, this,
+ &left_callback_handle_);
+
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_,
+ "libusb_hotplug_register_callback failed: " << libusb_ret);
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: LIBUSB_SUCCESS != libusb_ret");
+ return TransportAdapter::FAIL;
+ }
+
+ const int thread_start_error =
+ pthread_create(&thread_, 0, &UsbHandlerThread, this);
+ if (0 != thread_start_error) {
+ LOG4CXX_ERROR(logger_, "USB device scanner thread start failed, error code "
+ << thread_start_error);
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::FAIL. Condition: 0 !== thread_start_error");
+ return TransportAdapter::FAIL;
+ }
+ LOG4CXX_INFO(logger_, "UsbHandler thread started");
+ pthread_setname_np(thread_, "UsbHandler" );
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::OK. Condition: 0 == thread_start_error");
+ return TransportAdapter::OK;
+}
+
+void UsbHandler::Thread() {
+ LOG4CXX_TRACE(logger_, "enter");
+ int completed = 0;
+ while (!shutdown_requested_) {
+ libusb_handle_events_completed(libusb_context_, &completed);
+
+ for (TransferSequences::iterator it = transfer_sequences_.begin();
+ it != transfer_sequences_.end();) {
+ ControlTransferSequenceState* sequence_state = *it;
+ if (sequence_state->Finished()) {
+ delete *it;
+ it = transfer_sequences_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+ for (std::list<libusb_device_handle*>::iterator it =
+ device_handles_to_close_.begin();
+ it != device_handles_to_close_.end();
+ it = device_handles_to_close_.erase(it)) {
+ libusb_close(*it);
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbTransferSequenceCallback(libusb_transfer* transfer) {
+ LOG4CXX_TRACE(logger_, "enter. libusb_transfer* " << transfer);
+ UsbHandler::ControlTransferSequenceState* sequence_state =
+ static_cast<UsbHandler::ControlTransferSequenceState*>(transfer->user_data);
+ sequence_state->usb_handler()->ControlTransferCallback(transfer);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbHandler::SubmitControlTransfer(
+ ControlTransferSequenceState* sequence_state) {
+ LOG4CXX_TRACE(logger_, "enter. ControlTransferSequenceState* " << sequence_state);
+ UsbControlTransfer* transfer = sequence_state->CurrentTransfer();
+ if (NULL == transfer) {
+ LOG4CXX_TRACE(logger_, "exit. Condition: NULL == transfer");
+ return;
+ }
+
+ libusb_transfer* libusb_transfer = libusb_alloc_transfer(0);
+ if (0 == libusb_transfer) {
+ LOG4CXX_ERROR(logger_, "libusb_alloc_transfer failed");
+ sequence_state->Finish();
+ LOG4CXX_TRACE(logger_, "exit. Condition: 0 == libusb_transfer");
+ return;
+ }
+
+ assert(transfer->Type() == UsbControlTransfer::VENDOR);
+ const libusb_request_type request_type = LIBUSB_REQUEST_TYPE_VENDOR;
+
+ libusb_endpoint_direction endpoint_direction;
+ if (transfer->Direction() == UsbControlTransfer::IN) {
+ endpoint_direction = LIBUSB_ENDPOINT_IN;
+ } else if (transfer->Direction() == UsbControlTransfer::OUT) {
+ endpoint_direction = LIBUSB_ENDPOINT_OUT;
+ } else {
+ assert(0);
+ }
+ const uint8_t request = transfer->Request();
+ const uint16_t value = transfer->Value();
+ const uint16_t index = transfer->Index();
+ const uint16_t length = transfer->Length();
+
+ unsigned char* buffer =
+ static_cast<unsigned char*>(malloc(length + LIBUSB_CONTROL_SETUP_SIZE));
+ if (NULL == buffer) {
+ LOG4CXX_ERROR(logger_, "buffer allocation failed");
+ libusb_free_transfer(libusb_transfer);
+ sequence_state->Finish();
+ LOG4CXX_TRACE(logger_, "exit. Condition: NULL == buffer");
+ return;
+ }
+
+ libusb_fill_control_setup(buffer, request_type | endpoint_direction, request,
+ value, index, length);
+
+ if (0 != length && endpoint_direction == LIBUSB_ENDPOINT_OUT) {
+ const char* data = static_cast<UsbControlOutTransfer*>(transfer)->Data();
+ memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, length);
+ }
+ libusb_fill_control_transfer(
+ libusb_transfer, sequence_state->device()->GetLibusbHandle(), buffer,
+ UsbTransferSequenceCallback, sequence_state, 0);
+ libusb_transfer->flags = LIBUSB_TRANSFER_FREE_BUFFER;
+
+ const int libusb_ret = libusb_submit_transfer(libusb_transfer);
+ if (LIBUSB_SUCCESS != libusb_ret) {
+ LOG4CXX_ERROR(logger_, "libusb_submit_transfer failed: "
+ << libusb_error_name(libusb_ret));
+ libusb_free_transfer(libusb_transfer);
+ sequence_state->Finish();
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbHandler::ControlTransferCallback(libusb_transfer* transfer) {
+ LOG4CXX_TRACE(logger_, "enter. libusb_transfer* " << transfer);
+ ControlTransferSequenceState* sequence_state =
+ static_cast<ControlTransferSequenceState*>(transfer->user_data);
+ if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
+ LOG4CXX_INFO(logger_, "USB control transfer completed");
+ UsbControlTransfer* current_transfer = sequence_state->CurrentTransfer();
+ bool submit_next = true;
+ if (current_transfer &&
+ current_transfer->Direction() == UsbControlTransfer::IN) {
+ submit_next =
+ static_cast<UsbControlInTransfer*>(current_transfer)
+ ->OnCompleted(libusb_control_transfer_get_data(transfer));
+ }
+
+ sequence_state->Next();
+ if (submit_next && !sequence_state->Finished()) {
+ SubmitControlTransfer(sequence_state);
+ } else {
+ sequence_state->Finish();
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "USB control transfer failed: " << transfer->status);
+ sequence_state->Finish();
+ }
+ libusb_free_transfer(transfer);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+UsbHandler::ControlTransferSequenceState::ControlTransferSequenceState(
+ UsbHandler* usb_handler, UsbControlTransferSequence* sequence,
+ PlatformUsbDevice* device)
+ : usb_handler_(usb_handler),
+ device_(device),
+ finished_(false),
+ sequence_(sequence),
+ current_transfer_(sequence->transfers().begin()) {}
+
+UsbHandler::ControlTransferSequenceState::~ControlTransferSequenceState() {
+ delete sequence_;
+}
+
+UsbControlTransfer* UsbHandler::ControlTransferSequenceState::Next() {
+ LOG4CXX_TRACE(logger_, "enter");
+ if (finished_) {
+ LOG4CXX_TRACE(logger_, "exit with NULL. Condition: finished_");
+ return NULL;
+ }
+ if (++current_transfer_ == sequence_->transfers().end()) {
+ Finish();
+ LOG4CXX_TRACE(logger_,
+ "exit with NULL. Condition: ++current_transfer_ == sequence_->transfers().end()");
+ return NULL;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with UsbControlTransfer* " << *current_transfer_ <<
+ ".Condition: ++current_transfer_ !== sequence_->transfers().end()");
+ return *current_transfer_;
+ }
+}
+
+UsbControlTransfer* UsbHandler::ControlTransferSequenceState::CurrentTransfer() {
+ return finished_ ? NULL : *current_transfer_;
+}
+
+void UsbHandler::ControlTransferSequenceState::Finish() {
+ finished_ = true;
+}
+
+} // namespace
+} // namespace
diff --git a/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc b/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
new file mode 100644
index 0000000000..0f35a16ae7
--- /dev/null
+++ b/src/components/transport_manager/src/usb/qnx/platform_usb_device.cc
@@ -0,0 +1,79 @@
+/**
+ * \file platform_usb_device.cc
+ * \brief QNX PlatformUsbDevice class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/usb/qnx/platform_usb_device.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+PlatformUsbDevice::PlatformUsbDevice(
+ usbd_device_instance_t* instance, usbd_device* device,
+ const usbd_device_descriptor_t& device_descriptor)
+ : bus_number_(instance->path),
+ address_(instance->devno),
+ vendor_id_(instance->ident.vendor),
+ product_id_(instance->ident.device),
+ device_descriptor_(device_descriptor),
+ usbd_device_instance_(*instance),
+ usbd_device_(device) {}
+
+std::string PlatformUsbDevice::GetDescString(uint8_t index) const {
+ char* str = usbd_string(usbd_device_, index, 0);
+ if (NULL == str) {
+ LOG4CXX_INFO(logger_, "Failed to get USB string descriptor");
+ return "";
+ }
+ return std::string(str);
+}
+
+std::string PlatformUsbDevice::GetManufacturer() const {
+ return GetDescString(device_descriptor_.iManufacturer);
+}
+
+std::string PlatformUsbDevice::GetProductName() const {
+ return GetDescString(device_descriptor_.iProduct);
+}
+
+std::string PlatformUsbDevice::GetSerialNumber() const {
+ return GetDescString(device_descriptor_.iSerialNumber);
+}
+
+} // namespace
+} // namespace
diff --git a/src/components/transport_manager/src/usb/qnx/usb_connection.cc b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
new file mode 100644
index 0000000000..da5d30136b
--- /dev/null
+++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc
@@ -0,0 +1,404 @@
+/**
+ * \file usb_connection.cc
+ * \brief UsbConnection class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <sched.h>
+#include <cstring>
+
+#include "transport_manager/usb/qnx/usb_connection.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+UsbConnection::UsbConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller,
+ const UsbHandlerSptr& libusb_handler,
+ PlatformUsbDevice* device)
+ : device_uid_(device_uid),
+ app_handle_(app_handle),
+ controller_(controller),
+ libusb_handler_(libusb_handler),
+ usbd_device_(device->GetUsbdDevice()),
+ in_pipe_(NULL),
+ out_pipe_(NULL),
+ in_buffer_(NULL),
+ in_urb_(NULL),
+ out_urb_(NULL),
+ out_messages_(),
+ current_out_message_(),
+ out_messages_mutex_(),
+ bytes_sent_(0),
+ disconnecting_(false),
+ pending_in_transfer_(false),
+ pending_out_transfer_(false) {
+ pthread_mutex_init(&out_messages_mutex_, 0);
+}
+
+UsbConnection::~UsbConnection() {
+ Finalise();
+ if (in_urb_) usbd_free_urb(in_urb_);
+ if (out_urb_) usbd_free_urb(out_urb_);
+
+ if (in_pipe_) {
+ const int close_pipe_rc = usbd_close_pipe(in_pipe_);
+ if (EOK != close_pipe_rc) {
+ LOG4CXX_ERROR(logger_, "Failed to close pipe: " << close_pipe_rc);
+ }
+ }
+ if (out_pipe_) {
+ const int close_pipe_rc = usbd_close_pipe(out_pipe_);
+ if (EOK != close_pipe_rc) {
+ LOG4CXX_ERROR(logger_, "Failed to close pipe: " << close_pipe_rc);
+ }
+ }
+
+ pthread_mutex_destroy(&out_messages_mutex_);
+}
+
+void InTransferCallback(usbd_urb* urb, usbd_pipe*, void* data) {
+ static_cast<UsbConnection*>(data)->OnInTransfer(urb);
+}
+
+void OutTransferCallback(usbd_urb* urb, usbd_pipe*, void* data) {
+ static_cast<UsbConnection*>(data)->OnOutTransfer(urb);
+}
+
+bool UsbConnection::PostInTransfer() {
+ usbd_setup_bulk(in_urb_, URB_DIR_IN, in_buffer_, kInBufferSize);
+ pending_in_transfer_ = true;
+ const int io_rc =
+ usbd_io(in_urb_, in_pipe_, InTransferCallback, this, USBD_TIME_INFINITY);
+ if (EOK != io_rc) {
+ pending_in_transfer_ = false;
+ LOG4CXX_ERROR(logger_, "Failed to post in transfer: " << io_rc);
+ return false;
+ }
+ return true;
+}
+
+void UsbConnection::OnInTransfer(usbd_urb* urb) {
+ uint32_t status = 0;
+ uint32_t len = 0;
+ bool error = false;
+ const int urb_status_rc = usbd_urb_status(urb, &status, &len);
+ if (EOK != urb_status_rc && EIO != urb_status_rc) { // EIO is OK
+ LOG4CXX_ERROR(logger_, "Get in urb status failed: " << urb_status_rc);
+ error = true;
+ }
+ LOG4CXX_INFO(logger_, "USB in transfer, status " << std::hex << status
+ << ", length " << std::dec
+ << len);
+
+ if (!error) {
+ switch (status) {
+ case USBD_STATUS_CMP:
+ case USBD_STATUS_CMP_ERR | USBD_STATUS_DATA_UNDERRUN:
+ error = false;
+ break;
+ default:
+ error = true;
+ break;
+ }
+ }
+
+ if (error) {
+ LOG4CXX_ERROR(logger_, "USB in transfer failed");
+ controller_->DataReceiveFailed(device_uid_, app_handle_,
+ DataReceiveError());
+ } else {
+ RawMessagePtr msg(new protocol_handler::RawMessage(0, 0, in_buffer_, len));
+ controller_->DataReceiveDone(device_uid_, app_handle_, msg);
+ }
+
+ pending_in_transfer_ = false;
+ if (!disconnecting_) {
+ if (!PostInTransfer()) {
+ controller_->ConnectionAborted(device_uid_, app_handle_,
+ CommunicationError());
+ Disconnect();
+ }
+ }
+}
+
+void UsbConnection::PopOutMessage() {
+ bytes_sent_ = 0;
+ if (out_messages_.empty()) {
+ current_out_message_.reset();
+ } else {
+ current_out_message_ = out_messages_.front();
+ out_messages_.pop_front();
+ }
+}
+
+bool UsbConnection::PostOutTransfer() {
+ const int len = current_out_message_->data_size() - bytes_sent_;
+ out_buffer_ = usbd_alloc(len);
+ memmove(out_buffer_, current_out_message_->data() + bytes_sent_, len);
+ usbd_setup_bulk(out_urb_, URB_DIR_OUT, out_buffer_, len);
+ LOG4CXX_INFO(logger_, "out transfer :" << len);
+ pending_out_transfer_ = true;
+ const int io_rc = usbd_io(out_urb_, out_pipe_, OutTransferCallback, this,
+ USBD_TIME_INFINITY);
+ if (EOK != io_rc) {
+ pending_out_transfer_ = false;
+ usbd_free(out_buffer_);
+ LOG4CXX_ERROR(logger_, "Failed to post out transfer: " << io_rc);
+ return false;
+ }
+ return true;
+}
+
+void UsbConnection::OnOutTransfer(usbd_urb* urb) {
+ usbd_free(out_buffer_);
+ uint32_t status = 0;
+ uint32_t len = 0;
+ bool error = false;
+ const int urb_status_rc = usbd_urb_status(urb, &status, &len);
+ if (EOK != urb_status_rc && EIO != urb_status_rc) { // EIO is OK
+ LOG4CXX_ERROR(logger_, "Get out urb status failed: " << urb_status_rc);
+ error = true;
+ }
+ LOG4CXX_INFO(logger_, "USB out transfer, status " << std::hex << status
+ << ", length " << std::dec
+ << len);
+
+ if (!error) {
+ switch (status) {
+ case USBD_STATUS_CMP:
+ case USBD_STATUS_CMP_ERR | USBD_STATUS_DATA_UNDERRUN:
+ error = false;
+ break;
+ default:
+ error = true;
+ break;
+ }
+ }
+
+ pthread_mutex_lock(&out_messages_mutex_);
+
+ if (error) {
+ LOG4CXX_ERROR(logger_, "USB out transfer failed");
+ controller_->DataSendFailed(device_uid_, app_handle_, current_out_message_,
+ DataSendError());
+ PopOutMessage();
+ } else {
+ bytes_sent_ += len;
+ if (bytes_sent_ == current_out_message_->data_size()) {
+ LOG4CXX_INFO(logger_, "USB out transfer, data sent: "
+ << current_out_message_.get());
+ controller_->DataSendDone(device_uid_, app_handle_, current_out_message_);
+ PopOutMessage();
+ }
+ }
+
+ if ((!disconnecting_) && current_out_message_.valid()) {
+ PostOutTransfer();
+ } else {
+ pending_out_transfer_ = false;
+ }
+ pthread_mutex_unlock(&out_messages_mutex_);
+}
+
+TransportAdapter::Error UsbConnection::SendData(RawMessagePtr message) {
+ if (disconnecting_) {
+ return TransportAdapter::BAD_STATE;
+ }
+ pthread_mutex_lock(&out_messages_mutex_);
+ if (current_out_message_.valid()) {
+ out_messages_.push_back(message);
+ } else {
+ current_out_message_ = message;
+ if (!PostOutTransfer()) {
+ controller_->DataSendFailed(device_uid_, app_handle_, message,
+ DataSendError());
+ }
+ }
+ pthread_mutex_unlock(&out_messages_mutex_);
+ return TransportAdapter::OK;
+}
+
+void UsbConnection::Finalise() {
+ LOG4CXX_INFO(logger_, "Finalising");
+ pthread_mutex_lock(&out_messages_mutex_);
+ disconnecting_ = true;
+ usbd_abort_pipe(in_pipe_);
+ usbd_abort_pipe(out_pipe_);
+ for (std::list<RawMessagePtr>::iterator it = out_messages_.begin();
+ it != out_messages_.end(); it = out_messages_.erase(it)) {
+ controller_->DataSendFailed(device_uid_, app_handle_, *it, DataSendError());
+ }
+ pthread_mutex_unlock(&out_messages_mutex_);
+ while (pending_in_transfer_ || pending_out_transfer_) sched_yield();
+}
+
+TransportAdapter::Error UsbConnection::Disconnect() {
+ LOG4CXX_INFO(logger_, "Disconnecting");
+ Finalise();
+ controller_->DisconnectDone(device_uid_, app_handle_);
+ return TransportAdapter::OK;
+}
+
+bool UsbConnection::Init() {
+ if (!OpenEndpoints()) return false;
+
+ in_urb_ = usbd_alloc_urb(NULL);
+ out_urb_ = usbd_alloc_urb(NULL);
+ if (NULL == in_urb_ || NULL == out_urb_) {
+ LOG4CXX_ERROR(logger_, "usbd_alloc_urb failed");
+ return false;
+ }
+
+ in_buffer_ = static_cast<unsigned char*>(usbd_alloc(kInBufferSize));
+ if (NULL == in_buffer_) {
+ LOG4CXX_ERROR(logger_, "usbd_alloc failed");
+ return false;
+ }
+
+ controller_->ConnectDone(device_uid_, app_handle_);
+
+ if (!PostInTransfer()) {
+ controller_->ConnectionAborted(device_uid_, app_handle_,
+ CommunicationError());
+ return true;
+ }
+
+ return true;
+}
+
+bool UsbConnection::OpenEndpoints() {
+ usbd_descriptors_t* in_endpoint_desc = NULL;
+ usbd_descriptors_t* out_endpoint_desc = NULL;
+
+ usbd_desc_node* device_desc_node = NULL;
+ usbd_device_descriptor_t* device_desc =
+ usbd_device_descriptor(usbd_device_, &device_desc_node);
+ if (0 == device_desc) {
+ LOG4CXX_ERROR(logger_, "Device descriptor not found");
+ return false;
+ }
+ usbd_desc_node* cfg_desc_node = NULL;
+ usbd_descriptors_t* config_desc = NULL;
+ usbd_descriptors_t* iface_desc = NULL;
+ int cfg = 0;
+ bool found = false;
+ while (!found) {
+ config_desc =
+ usbd_parse_descriptors(usbd_device_, device_desc_node,
+ USB_DESC_CONFIGURATION, cfg++, &cfg_desc_node);
+ if (config_desc == NULL) {
+ break;
+ }
+ LOG4CXX_INFO(logger_, "USB configuration "
+ << static_cast<int>(config_desc->configuration
+ .bConfigurationValue));
+ int iface = 0;
+ usbd_desc_node* iface_desc_node;
+ while (!found) {
+ iface_desc =
+ usbd_parse_descriptors(usbd_device_, cfg_desc_node,
+ USB_DESC_INTERFACE, iface++, &iface_desc_node);
+ if (iface_desc == NULL) {
+ break;
+ }
+#if ENABLE_LOG
+ const uint8_t interface_number = iface_desc->interface.bInterfaceNumber;
+#endif
+ const uint8_t interface_subclass =
+ iface_desc->interface.bInterfaceSubClass;
+ LOG4CXX_INFO(logger_, "USB interface number "
+ << static_cast<int>(interface_number)
+ << ", subclass " << std::hex
+ << static_cast<int>(interface_subclass)
+ << std::dec);
+ if (interface_subclass != 0xff) {
+ continue;
+ }
+ int endpoint = 0;
+ in_endpoint_desc = NULL;
+ out_endpoint_desc = NULL;
+ while (true) {
+ usbd_descriptors_t* endpoint_desc = usbd_parse_descriptors(
+ usbd_device_, iface_desc_node, USB_DESC_ENDPOINT, endpoint++, NULL);
+ if (NULL == endpoint_desc) break;
+ const uint8_t attributes = endpoint_desc->endpoint.bmAttributes;
+ if ((attributes & 0x03) == USB_ATTRIB_BULK) {
+ const uint8_t endpoint_address =
+ endpoint_desc->endpoint.bEndpointAddress;
+ LOG4CXX_INFO(logger_, "Endpoint with address "
+ << std::hex
+ << static_cast<int>(endpoint_address)
+ << std::dec << " found");
+ if (endpoint_address & USB_ENDPOINT_IN) {
+ if (NULL == in_endpoint_desc) {
+ in_endpoint_desc = endpoint_desc;
+ }
+ } else {
+ if (NULL == out_endpoint_desc) {
+ out_endpoint_desc = endpoint_desc;
+ }
+ }
+ }
+ }
+ if (in_endpoint_desc != NULL && out_endpoint_desc != NULL) {
+ found = true;
+ }
+ }
+ }
+
+ if (!found) return false;
+
+ int open_pipe_rc = usbd_open_pipe(usbd_device_, in_endpoint_desc, &in_pipe_);
+ if (EOK != open_pipe_rc) {
+ LOG4CXX_ERROR(logger_, "Cannot open input pipe, error " << open_pipe_rc);
+ return false;
+ }
+
+ open_pipe_rc = usbd_open_pipe(usbd_device_, out_endpoint_desc, &out_pipe_);
+ if (EOK != open_pipe_rc) {
+ LOG4CXX_ERROR(logger_, "Cannot open output pipe, error " << open_pipe_rc);
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/qnx/usb_handler.cc b/src/components/transport_manager/src/usb/qnx/usb_handler.cc
new file mode 100644
index 0000000000..7ab36169b1
--- /dev/null
+++ b/src/components/transport_manager/src/usb/qnx/usb_handler.cc
@@ -0,0 +1,302 @@
+/**
+ * \file usb_handler.cc
+ * \brief UsbHandler class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+
+#include <cstring>
+#include <cstdlib>
+
+#include "transport_manager/usb/common.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+namespace {
+UsbHandler* usb_handler;
+}
+
+UsbHandler::UsbHandler()
+ : usb_device_listeners_(),
+ devices_(),
+ usbd_general_connection_(NULL),
+ usbd_aoa_connection_(NULL) {
+ usb_handler = this;
+}
+
+UsbHandler::~UsbHandler() {
+ usb_handler = NULL;
+ if (usbd_general_connection_) {
+ const int disconnect_rc = usbd_disconnect(usbd_general_connection_);
+ if (EOK != disconnect_rc) {
+ LOG4CXX_ERROR(logger_, "usbd_disconnect failed, error code "
+ << disconnect_rc);
+ }
+ }
+ if (usbd_aoa_connection_) {
+ const int disconnect_rc = usbd_disconnect(usbd_aoa_connection_);
+ if (EOK != disconnect_rc) {
+ LOG4CXX_ERROR(logger_, "usbd_disconnect failed, error code "
+ << disconnect_rc);
+ }
+ }
+}
+
+bool operator==(const usbd_device_instance_t& a,
+ const usbd_device_instance_t& b) {
+ return a.path == b.path && a.devno == b.devno;
+}
+
+void UsbHandler::DeviceArrived(usbd_connection* connection,
+ usbd_device_instance_t* instance) {
+ for (Devices::const_iterator it = devices_.begin(); it != devices_.end();
+ ++it) {
+ if ((*it)->GetDeviceInstance() == *instance) return;
+ }
+ usbd_device* device_usbd = 0;
+ const int attach_rc = usbd_attach(connection, instance, 0, &device_usbd);
+ if (EOK != attach_rc) {
+ LOG4CXX_ERROR(logger_, "usbd_attach failed: " << attach_rc);
+ return;
+ }
+
+ usbd_desc_node* node;
+ usbd_device_descriptor_t* descriptor =
+ usbd_device_descriptor(device_usbd, &node);
+ if (NULL == descriptor) {
+ LOG4CXX_ERROR(logger_, "usbd_device_descriptor failed");
+ return;
+ }
+
+ PlatformUsbDevice* device(
+ new PlatformUsbDevice(instance, device_usbd, *descriptor));
+ devices_.push_back(device);
+ for (std::list<UsbDeviceListener*>::iterator it =
+ usb_device_listeners_.begin();
+ it != usb_device_listeners_.end(); ++it) {
+ (*it)->OnDeviceArrived(device);
+ }
+}
+
+void UsbHandler::DeviceLeft(usbd_device_instance_t* instance) {
+ PlatformUsbDevice* device = NULL;
+ for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) {
+ if (((*it)->GetDeviceInstance()) == *instance) {
+ device = *it;
+ break;
+ }
+ }
+ if (NULL == device) {
+ return;
+ }
+
+ for (std::list<UsbDeviceListener*>::iterator it =
+ usb_device_listeners_.begin();
+ it != usb_device_listeners_.end(); ++it) {
+ (*it)->OnDeviceLeft(device);
+ }
+
+ for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) {
+ if ((*it)->GetDeviceInstance() == *instance) {
+ const int detach_rc = usbd_detach((*it)->GetUsbdDevice());
+ if (EOK != detach_rc)
+ LOG4CXX_ERROR(logger_, "usbd_detach failed: " << detach_rc);
+ devices_.erase(it);
+ break;
+ }
+ }
+
+ delete device;
+}
+
+void UsbHandler::StartControlTransferSequence(
+ UsbControlTransferSequence* sequence, PlatformUsbDevice* device) {
+ usbd_descriptors_t* descriptor = usbd_parse_descriptors(
+ device->GetUsbdDevice(), NULL, USB_DESC_DEVICE, 0, NULL);
+ if (NULL == descriptor) {
+ LOG4CXX_ERROR(logger_, "usbd_parse_descriptors failed");
+ }
+
+ usbd_pipe* usb_pipe = 0;
+ const int open_pipe_rc =
+ usbd_open_pipe(device->GetUsbdDevice(), descriptor, &usb_pipe);
+ if (EOK != open_pipe_rc) {
+ LOG4CXX_ERROR(logger_, "usbd_open_pipe failed, error " << open_pipe_rc);
+ return;
+ }
+
+ for (UsbControlTransferSequence::Transfers::const_iterator it =
+ sequence->transfers().begin();
+ it != sequence->transfers().end(); ++it) {
+ UsbControlTransfer* transfer = *it;
+
+ usbd_urb* urb = usbd_alloc_urb(NULL);
+ if (NULL == urb) {
+ LOG4CXX_ERROR(logger_, "usbd_alloc_urb failed");
+ break;
+ }
+
+ unsigned char* buf =
+ static_cast<unsigned char*>(usbd_alloc(transfer->Length()));
+ if (NULL == buf) {
+ LOG4CXX_ERROR(logger_, "usbd_alloc failed");
+ break;
+ }
+
+ uint32_t flags = 0;
+ if (transfer->Direction() == UsbControlTransfer::IN) {
+ flags = URB_DIR_IN;
+ } else if (transfer->Direction() == UsbControlTransfer::OUT) {
+ flags = URB_DIR_OUT;
+ UsbControlOutTransfer* out_transfer =
+ static_cast<UsbControlOutTransfer*>(transfer);
+ std::copy(out_transfer->Data(),
+ out_transfer->Data() + out_transfer->Length(), buf);
+ } else {
+ assert(0);
+ }
+
+ assert(transfer->Type() == UsbControlTransfer::VENDOR);
+
+ usbd_setup_vendor(urb, flags, transfer->Request(), USB_TYPE_VENDOR,
+ transfer->Value(), transfer->Index(), buf,
+ transfer->Length());
+ const int io_rc = usbd_io(urb, usb_pipe, 0, 0, USBD_TIME_DEFAULT);
+
+ bool submit_next = true;
+ if (io_rc == EOK) {
+ if (transfer->Direction() == UsbControlTransfer::IN) {
+ submit_next =
+ static_cast<UsbControlInTransfer*>(transfer)->OnCompleted(buf);
+ }
+ } else {
+ LOG4CXX_ERROR(logger_, "usbd_io failed, error " << io_rc);
+ submit_next = false;
+ }
+ usbd_free(buf);
+ usbd_free_urb(urb);
+ if (!submit_next) break;
+ }
+ usbd_close_pipe(usb_pipe);
+
+ delete sequence;
+}
+
+void ArrivedCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance) {
+ if (kAoaVid == instance->ident.vendor) return;
+ LOG4CXX_INFO(logger_, "USB device arrived (path "
+ << static_cast<int>(instance->path) << ", devno "
+ << static_cast<int>(instance->devno) << ", config "
+ << static_cast<int>(instance->config) << ", iface "
+ << static_cast<int>(instance->iface) << ")");
+ usb_handler->DeviceArrived(connection, instance);
+}
+
+void ArrivedAoaCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance) {
+ if (kAoaVid != instance->ident.vendor) return;
+ LOG4CXX_INFO(logger_, "USB AOA device arrived (path "
+ << static_cast<int>(instance->path) << ", devno "
+ << static_cast<int>(instance->devno) << ", config "
+ << static_cast<int>(instance->config) << ", iface "
+ << static_cast<int>(instance->iface) << ")");
+ usb_handler->DeviceArrived(connection, instance);
+}
+
+void LeftCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance) {
+ if (kAoaVid == instance->ident.vendor) return;
+ LOG4CXX_INFO(logger_, "USB device left (path "
+ << static_cast<int>(instance->path) << ", devno "
+ << static_cast<int>(instance->devno) << ", config "
+ << static_cast<int>(instance->config) << ", iface "
+ << static_cast<int>(instance->iface) << ")");
+ usb_handler->DeviceLeft(instance);
+}
+
+void LeftAoaCallback(usbd_connection* connection,
+ usbd_device_instance_t* instance) {
+ if (kAoaVid != instance->ident.vendor) return;
+ LOG4CXX_INFO(logger_, "USB AOA device left (path "
+ << static_cast<int>(instance->path) << ", devno "
+ << static_cast<int>(instance->devno) << ", config "
+ << static_cast<int>(instance->config) << ", iface "
+ << static_cast<int>(instance->iface) << ")");
+ usb_handler->DeviceLeft(instance);
+}
+
+TransportAdapter::Error UsbHandler::Init() {
+ {
+ usbd_device_ident_t interest = {
+ USBD_CONNECT_WILDCARD, USBD_CONNECT_WILDCARD, kAoaInterfaceSubclass,
+ USBD_CONNECT_WILDCARD, USBD_CONNECT_WILDCARD};
+ usbd_funcs_t funcs = {_USBDI_NFUNCS, ArrivedCallback, LeftCallback, NULL};
+ usbd_connect_parm_t cparms = {NULL, USB_VERSION, USBD_VERSION, 0, 0,
+ NULL, 0, &interest, &funcs};
+
+ const int connect_rc = usbd_connect(&cparms, &usbd_general_connection_);
+
+ if (EOK != connect_rc) {
+ LOG4CXX_ERROR(logger_, "usbd_connect failed, error code " << connect_rc);
+ return TransportAdapter::FAIL;
+ }
+ }
+ {
+ usbd_device_ident_t interest = {
+ kAoaVid, USBD_CONNECT_WILDCARD, USBD_CONNECT_WILDCARD,
+ kAoaInterfaceSubclass, USBD_CONNECT_WILDCARD};
+ usbd_funcs_t funcs = {_USBDI_NFUNCS, ArrivedAoaCallback,
+ LeftAoaCallback, NULL};
+ usbd_connect_parm_t cparms = {NULL, USB_VERSION, USBD_VERSION, 0, 0,
+ NULL, 0, &interest, &funcs};
+
+ const int connect_rc = usbd_connect(&cparms, &usbd_aoa_connection_);
+
+ if (EOK != connect_rc) {
+ LOG4CXX_ERROR(logger_, "usbd_connect failed, error code " << connect_rc);
+ return TransportAdapter::FAIL;
+ }
+ }
+
+ return TransportAdapter::OK;
+}
+
+} // namespace
+} // namespace
diff --git a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
new file mode 100644
index 0000000000..464b9ea35e
--- /dev/null
+++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
@@ -0,0 +1,90 @@
+/**
+ * \file usb_aoa_adapter.cpp
+ * \brief UsbAoaAdapter class source file.
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/usb/usb_aoa_adapter.h"
+#include "transport_manager/usb/usb_device_scanner.h"
+#include "transport_manager/usb/usb_connection_factory.h"
+#include "transport_manager/usb/common.h"
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+UsbAoaAdapter::UsbAoaAdapter()
+ : TransportAdapterImpl(new UsbDeviceScanner(this),
+ new UsbConnectionFactory(this), 0),
+ is_initialised_(false),
+ usb_handler_(new UsbHandler()) {
+ static_cast<UsbDeviceScanner*>(device_scanner_)->SetUsbHandler(usb_handler_);
+ static_cast<UsbConnectionFactory*>(server_connection_factory_)
+ ->SetUsbHandler(usb_handler_);
+}
+
+UsbAoaAdapter::~UsbAoaAdapter() {}
+
+DeviceType UsbAoaAdapter::GetDeviceType() const {
+ return "sdl-usb-aoa";
+}
+
+bool UsbAoaAdapter::IsInitialised() const {
+ return is_initialised_ && TransportAdapterImpl::IsInitialised();
+}
+
+TransportAdapter::Error UsbAoaAdapter::Init() {
+ LOG4CXX_TRACE(logger_, "enter");
+ TransportAdapter::Error error = usb_handler_->Init();
+ if (error != TransportAdapter::OK) {
+ LOG4CXX_TRACE(logger_, "exit with error " << error <<
+ ". Condition: error != TransportAdapter::OK");
+ return error;
+ }
+ error = TransportAdapterImpl::Init();
+ if (error != TransportAdapter::OK) {
+ LOG4CXX_TRACE(logger_, "exit with error " << error <<
+ ". Condition: error != TransportAdapter::OK");
+ return error;
+ }
+ is_initialised_ = true;
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK");
+ return TransportAdapter::OK;
+}
+
+bool UsbAoaAdapter::ToBeAutoConnected(DeviceSptr device) const {
+ return true;
+}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc
new file mode 100644
index 0000000000..f68edebd06
--- /dev/null
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/usb/usb_connection_factory.h"
+#include "transport_manager/usb/usb_device.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "utils/logger.h"
+
+#if defined(__QNXNTO__)
+#include "transport_manager/usb/qnx/usb_connection.h"
+#else
+#include "transport_manager/usb/libusb/usb_connection.h"
+#endif
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+UsbConnectionFactory::UsbConnectionFactory(
+ TransportAdapterController* controller)
+ : controller_(controller), usb_handler_() {}
+
+TransportAdapter::Error UsbConnectionFactory::Init() {
+ return TransportAdapter::OK;
+}
+
+void UsbConnectionFactory::SetUsbHandler(const UsbHandlerSptr& usb_handler) {
+ usb_handler_ = usb_handler;
+}
+
+TransportAdapter::Error UsbConnectionFactory::CreateConnection(
+ const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
+ LOG4CXX_TRACE(logger_, "enter DeviceUID: " << &device_uid << ", ApplicationHandle: " <<
+ &app_handle);
+ DeviceSptr device = controller_->FindDevice(device_uid);
+ if (!device.valid()) {
+ LOG4CXX_ERROR(logger_, "device " << device_uid << " not found");
+ LOG4CXX_TRACE(logger_,
+ "exit with TransportAdapter::BAD_PARAM. Condition: !device.valid()");
+ return TransportAdapter::BAD_PARAM;
+ }
+
+ UsbDevice* usb_device = static_cast<UsbDevice*>(device.get());
+ UsbConnection* usb_connection =
+ new UsbConnection(device_uid, app_handle, controller_, usb_handler_,
+ usb_device->usb_device());
+ ConnectionSptr connection(usb_connection);
+
+ controller_->ConnectionCreated(connection, device_uid, app_handle);
+
+ if (usb_connection->Init()) {
+ LOG4CXX_INFO(logger_, "USB connection initialised");
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::OK. Condition: USB connection initialised");
+ return TransportAdapter::OK;
+ } else {
+ LOG4CXX_TRACE(logger_, "exit with TransportAdapter::FAIL. Condition: USB connection NOT initialised");
+ return TransportAdapter::FAIL;
+ }
+}
+
+void UsbConnectionFactory::Terminate() {}
+
+bool UsbConnectionFactory::IsInitialised() const {
+ return true;
+}
+
+UsbConnectionFactory::~UsbConnectionFactory() {}
+
+} // namespace transport_adapter
+} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/usb_device_scanner.cc b/src/components/transport_manager/src/usb/usb_device_scanner.cc
new file mode 100644
index 0000000000..bf9535941c
--- /dev/null
+++ b/src/components/transport_manager/src/usb/usb_device_scanner.cc
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sstream>
+
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
+#include "transport_manager/usb/usb_device_scanner.h"
+#include "transport_manager/usb/usb_device.h"
+#include "transport_manager/usb/common.h"
+
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+class AoaInitSequence : public UsbControlTransferSequence {
+ public:
+ AoaInitSequence();
+ virtual ~AoaInitSequence() {}
+
+ private:
+ class AoaGetProtocolRequest;
+ class AoaSendIdString;
+ class AoaTurnIntoAccessoryMode;
+};
+
+void UsbDeviceScanner::OnDeviceArrived(PlatformUsbDevice* device) {
+ LOG4CXX_TRACE(logger_, "enter. PlatformUsbDevice* " << device);
+ if (IsAppleDevice(device)) {
+ SupportedDeviceFound(device);
+ } else {
+ if (IsGoogleAccessory(device)) {
+ SupportedDeviceFound(device);
+ } else {
+ TurnIntoAccessoryMode(device);
+ }
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbDeviceScanner::OnDeviceLeft(PlatformUsbDevice* device) {
+ LOG4CXX_TRACE(logger_, "enter. PlatformUsbDevice " << device);
+ bool list_changed = false;
+ pthread_mutex_lock(&devices_mutex_);
+ for (Devices::iterator it = devices_.begin(); it != devices_.end(); ++it) {
+ if (device == *it) {
+ devices_.erase(it);
+ list_changed = true;
+ break;
+ }
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+ if (list_changed) {
+ UpdateList();
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+UsbDeviceScanner::UsbDeviceScanner(TransportAdapterController* controller)
+ : controller_(controller) {
+ pthread_mutex_init(&devices_mutex_, 0);
+}
+
+UsbDeviceScanner::~UsbDeviceScanner() {
+ pthread_mutex_destroy(&devices_mutex_);
+}
+
+class AoaInitSequence::AoaGetProtocolRequest : public UsbControlInTransfer {
+ virtual ~AoaGetProtocolRequest() {}
+ virtual RequestType Type() const {
+ return VENDOR;
+ }
+ virtual uint8_t Request() const {
+ return 51;
+ }
+ virtual uint16_t Value() const {
+ return 0;
+ }
+ virtual uint16_t Index() const {
+ return 0;
+ }
+ virtual uint16_t Length() const {
+ return 2;
+ }
+ virtual bool OnCompleted(unsigned char* data) const {
+ const int protocol_version = data[1] << 8 | data[0];
+ LOG4CXX_INFO(logger_, "AOA protocol version " << protocol_version);
+ if (protocol_version == 0) {
+ // AOA protocol not supported
+ return false;
+ }
+ return true;
+ }
+};
+
+class AoaInitSequence::AoaSendIdString : public UsbControlOutTransfer {
+ public:
+ AoaSendIdString(uint16_t index, const char* string, uint16_t length)
+ : index_(index), string_(string), length_(length) {}
+
+ private:
+ virtual ~AoaSendIdString() {}
+ virtual RequestType Type() const {
+ return VENDOR;
+ }
+ virtual uint8_t Request() const {
+ return 52;
+ }
+ virtual uint16_t Value() const {
+ return 0;
+ }
+ virtual uint16_t Index() const {
+ return index_;
+ }
+ virtual uint16_t Length() const {
+ return length_;
+ }
+ virtual const char* Data() const {
+ return string_;
+ }
+ uint16_t index_;
+ const char* string_;
+ uint16_t length_;
+};
+
+class AoaInitSequence::AoaTurnIntoAccessoryMode : public UsbControlOutTransfer {
+ virtual ~AoaTurnIntoAccessoryMode() {}
+ virtual RequestType Type() const {
+ return VENDOR;
+ }
+ virtual uint8_t Request() const {
+ return 53;
+ }
+ virtual uint16_t Value() const {
+ return 0;
+ }
+ virtual uint16_t Index() const {
+ return 0;
+ }
+ virtual uint16_t Length() const {
+ return 0;
+ }
+ virtual const char* Data() const {
+ return 0;
+ }
+};
+
+static char manufacturer[] = "Ford";
+static char model_name[] = "HMI";
+static char description[] = "Human machine interface";
+static char version[] = "1.0";
+static char uri[] = "http://www.ford.com";
+static char serial_num[] = "N000000";
+
+AoaInitSequence::AoaInitSequence() : UsbControlTransferSequence() {
+ AddTransfer(new AoaGetProtocolRequest);
+ AddTransfer(new AoaSendIdString(0, manufacturer, sizeof(manufacturer)));
+ AddTransfer(new AoaSendIdString(1, model_name, sizeof(model_name)));
+ AddTransfer(new AoaSendIdString(2, description, sizeof(description)));
+ AddTransfer(new AoaSendIdString(3, version, sizeof(version)));
+ AddTransfer(new AoaSendIdString(4, uri, sizeof(uri)));
+ AddTransfer(new AoaSendIdString(5, serial_num, sizeof(serial_num)));
+ AddTransfer(new AoaTurnIntoAccessoryMode);
+}
+
+void UsbDeviceScanner::TurnIntoAccessoryMode(PlatformUsbDevice* device) {
+ LOG4CXX_TRACE(logger_, "enter. PlatformUsbDevice: " << device);
+ GetUsbHandler()->StartControlTransferSequence(new AoaInitSequence, device);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbDeviceScanner::SupportedDeviceFound(PlatformUsbDevice* device) {
+ LOG4CXX_TRACE(logger_, "enter PlatformUsbDevice: " << device);
+
+ pthread_mutex_lock(&devices_mutex_);
+ devices_.push_back(device);
+ pthread_mutex_unlock(&devices_mutex_);
+ LOG4CXX_INFO(logger_, "USB device (bus number "
+ << static_cast<int>(device->bus_number())
+ << ", address "
+ << static_cast<int>(device->address())
+ << ") identified as: " << device->GetManufacturer()
+ << ", " << device->GetProductName());
+ UpdateList();
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+TransportAdapter::Error UsbDeviceScanner::Init() {
+ return TransportAdapter::OK;
+}
+
+TransportAdapter::Error UsbDeviceScanner::Scan() {
+ return TransportAdapter::OK;
+}
+
+void UsbDeviceScanner::UpdateList() {
+ LOG4CXX_TRACE(logger_, "enter");
+ DeviceVector device_vector;
+ pthread_mutex_lock(&devices_mutex_);
+ for (Devices::const_iterator it = devices_.begin(); it != devices_.end();
+ ++it) {
+ const std::string device_name =
+ (*it)->GetManufacturer() + " " + (*it)->GetProductName();
+ std::ostringstream oss;
+ oss << (*it)->GetManufacturer() << ":" << (*it)->GetProductName() << ":"
+ << (*it)->GetSerialNumber() << ":"
+ << static_cast<int>((*it)->bus_number()) << ":"
+ << static_cast<int>((*it)->address());
+ const DeviceUID device_uid = oss.str();
+ DeviceSptr device(new UsbDevice(*it, device_name, device_uid));
+ device_vector.push_back(device);
+ }
+ pthread_mutex_unlock(&devices_mutex_);
+
+ LOG4CXX_INFO(logger_, "USB search done " << device_vector.size());
+ controller_->SearchDeviceDone(device_vector);
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void UsbDeviceScanner::Terminate() {}
+
+bool UsbDeviceScanner::IsInitialised() const {
+ return true;
+}
+
+} // namespace
+} // namespace
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
new file mode 100644
index 0000000000..12c70746d7
--- /dev/null
+++ b/src/components/utils/CMakeLists.txt
@@ -0,0 +1,64 @@
+set(UtilsIncludeDir ${CMAKE_SOURCE_DIR}/src/components/utils/include)
+
+include_directories (
+ ./include
+ ../config_profile/include
+ ../media_manager/include/
+ ../protocol_handler/include/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set (SOURCES
+ ./src/bitstream.cc
+ ./src/conditional_variable_posix.cc
+ ./src/file_system.cc
+ ./src/threads/posix_thread.cc
+ ./src/threads/thread_manager.cc
+ ./src/threads/thread_validator.cc
+ ./src/lock_posix.cc
+ ./src/rwlock_posix.cc
+ ./src/date_time.cc
+ ./src/signals_linux.cc
+ ./src/system.cc
+ ./src/resource_usage.cc
+ ./src/appenders_loader.cc
+)
+
+if(ENABLE_LOG)
+ list(APPEND SOURCES
+ ./src/push_log.cc
+ ./src/log_message_loop_thread.cc
+ ./src/logger_status.cc
+ )
+endif()
+
+if (BUILD_BACKTRACE_SUPPORT)
+ list(APPEND SOURCES
+ ./src/back_trace.cc
+ )
+endif()
+
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ list(APPEND SOURCES
+ ./src/threads/pulse_thread_delegate.cc
+ )
+endif()
+
+add_library("Utils" ${SOURCES})
+
+if(ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
+ target_link_libraries("Utils" ${LIBRARIES})
+ ADD_DEPENDENCIES(Utils install-3rd_party_logger)
+endif()
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ target_link_libraries("Utils" pthread ${RTLIB})
+endif()
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
+
diff --git a/src/components/utils/include/utils/appenders_loader.h b/src/components/utils/include/utils/appenders_loader.h
new file mode 100644
index 0000000000..03d3217994
--- /dev/null
+++ b/src/components/utils/include/utils/appenders_loader.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_APPENDERS_LOADER_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_APPENDERS_LOADER_H_
+
+namespace utils {
+
+class AppendersLoader {
+ public:
+ AppendersLoader();
+ ~AppendersLoader();
+ bool Loaded() const;
+ private:
+ void* handle_;
+};
+
+extern AppendersLoader appenders_loader;
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_APPENDERS_LOADER_H_
diff --git a/src/components/utils/include/utils/back_trace.h b/src/components/utils/include/utils/back_trace.h
new file mode 100644
index 0000000000..7f8912faf9
--- /dev/null
+++ b/src/components/utils/include/utils/back_trace.h
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BACK_TRACE_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BACK_TRACE_H_
+
+#include <ostream>
+#include <vector>
+#include <string>
+#include "utils/threads/thread.h"
+
+namespace utils {
+
+/*
+ * Class that captures stack trace in place where it was created.
+ * Can be stored and passed for further processing
+ * ostream output operator is available for these objects so stacktrace
+ * here and now can be easily printed as
+ *
+ * std::cout<<utils::Backtrace()<<std::endl;
+ */
+class Backtrace {
+ public:
+ // Inspect stack up to 128 calls back
+ static const int32_t kDefaultDepth = 128;
+ static const int32_t kSkipTop = 0;
+ /* Capture backtrace and store. Limit captured stack length to
+ * count symbols and remove first skip_top elements from it
+ * (to avoid polluting stack trace with debugging function names)
+ */
+ Backtrace(int32_t count = kDefaultDepth, int32_t skip_top = kSkipTop);
+ ~Backtrace();
+
+ // Captured symbols in order from topmost stack frame to last captured
+ std::vector<std::string> CallStack() const;
+ threads::Thread::Id ThreadId() const;
+
+ private:
+ threads::Thread::Id thread_id_;
+ std::vector<void*> backtrace_;
+};
+
+std::ostream& operator<< (std::ostream& os, const Backtrace& bt);
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BACK_TRACE_H_
diff --git a/src/components/utils/include/utils/bitstream.h b/src/components/utils/include/utils/bitstream.h
new file mode 100644
index 0000000000..cba15abd8b
--- /dev/null
+++ b/src/components/utils/include/utils/bitstream.h
@@ -0,0 +1,170 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BITSTREAM_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BITSTREAM_H_
+
+#include "stdint.h"
+
+#include <climits>
+#include <cstring>
+#include <string>
+#include <vector>
+
+#include "utils/macro.h"
+
+namespace utils {
+
+// Big endian input bitstream class
+// Tool to read and parse incoming data in a recursive way
+// Has sublte similarity to standard stream classes in a way
+// it handles stream parsing errors:
+// If error while parsing stream occurs, whole stream is marked as
+// "bad" and all subsequent parsing is stopped.
+class BitStream {
+ public:
+ BitStream(uint8_t* bytes, size_t bytes_count);
+ ~BitStream();
+
+ // Mark stream as badly-formed.
+ // Should be called by Extract* family of procedures if they decide
+ // that stream is invalid
+ void MarkBad() { bad_ = true; }
+ // Predicates to check whether there were errors while parsing
+ // Stream is good when it is created
+ bool IsGood() { return !bad_; }
+ bool IsBad() { return bad_; }
+ operator bool() { return IsGood(); }
+ private:
+ // These two functions are used for internal stream checks only
+ // Stream parser procedures must not define their logic depending on
+ // amount of data left in particular bit stream
+
+ // Amount of full bytes left in stream
+ size_t FullBytesLeft();
+ // Amount of total bits left in stream
+ size_t BitsLeft();
+
+ // These stream extractors are helpers for direct friend extractors
+ // of this class.
+
+ // Extract single value, amount of bits read from stream depends on T size
+ // If there is not enough data in the stream, stream is marked bad
+ template<typename T>
+ void Extract(T& val);
+
+ // Read single value, amount of bits read from stream is signaled by |bits|
+ // parameter. T must be wide enough to hold this amount of bits.
+ // If there is not enough data in the stream, stream is marked bad
+ template<typename T>
+ void ExtractBits(T& val, size_t bits);
+
+ // Extract |length| bytes from the stream. Stream read position
+ // must be byte aligned when it is called, stream is marked bad otherwise.
+ // If there is not enough data in the stream, it is marked bad.
+ void ExtractBytes(void* buffer, size_t length);
+
+ private:
+ const uint8_t* bytes_;
+ const size_t bytes_count_;
+ size_t byte_offset_;
+ size_t bit_offset_;
+ bool bad_;
+ private:
+ friend void Extract(BitStream*, uint8_t*);
+ friend void Extract(BitStream*, uint8_t*, size_t);
+ friend void Extract(BitStream*, uint32_t*);
+ friend void Extract(BitStream*, uint32_t*, size_t);
+ friend void Extract(BitStream*, std::string*, size_t);
+ friend void Extract(BitStream*, std::vector<uint8_t>*, size_t);
+
+};
+
+// Extract single byte from stream
+// If there is not enough data in the stream it is marked bad.
+void Extract(BitStream* bs, uint8_t* val);
+
+// Extract defined amount of |bits| from stream and store them
+// in a byte size |val|. Hence |bits| must be less than 8.
+void Extract(BitStream* bs, uint8_t* val, size_t bits);
+
+// Extract 32 bit word from stream.
+// If there is not enough data in the stream it is marked bad.
+void Extract(BitStream* bs, uint32_t* val);
+
+// Extract up to 32 |bits| from stream and store them in a |val|
+// If there is not enough data in the stream it is marked bad.
+void Extract(BitStream* bs, uint32_t* val, size_t bits);
+
+// Extract |length| bytes from stream and store them to the
+// string |str|. If stream is too short it is marked bad.
+// String must not contain zero bytes.
+void Extract(BitStream* bs, std::string* str, size_t length);
+
+// Extract |length| bytes from stream and store them to the
+// vector |data|. If stream is too short it is marked bad.
+void Extract(BitStream* bs, std::vector<uint8_t>* data, size_t length);
+
+
+// Template member definitions
+template<typename T>
+void BitStream::Extract(T& val) {
+ // Slow but simple implementation
+ // It's a space for bit stream reading optimization
+ ExtractBits(val, sizeof(val) * CHAR_BIT);
+}
+
+template<typename T>
+void BitStream::ExtractBits(T& val, size_t bits) {
+ DCHECK(sizeof(val) * CHAR_BIT >= bits);
+ if (IsGood()) {
+ if (bits > BitsLeft()) {
+ MarkBad();
+ return;
+ }
+ val = T(); // Clear value
+ for (size_t i = 0; i < bits; ++i) {
+ size_t next_bit_number = CHAR_BIT - 1 - bit_offset_;
+ uint8_t nextbit = (bytes_[byte_offset_] >> next_bit_number) & 1;
+ val = (val << 1) | nextbit;
+ ++bit_offset_;
+ if (bit_offset_ == CHAR_BIT) {
+ ++byte_offset_;
+ bit_offset_ = 0;
+ }
+ }
+ }
+}
+
+} // namespace utils
+
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_BITSTREAM_H_
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
new file mode 100644
index 0000000000..d68ec484f9
--- /dev/null
+++ b/src/components/utils/include/utils/file_system.h
@@ -0,0 +1,241 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
+
+#include <string.h>
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include <iostream>
+
+namespace file_system {
+
+
+/**
+ * @brief Get available disc space.
+ *
+ * @param path to directory
+ * @return free disc space.
+ */
+uint64_t GetAvailableDiskSpace(const std::string& path);
+
+/*
+ * @brief Get size of current directory
+ *
+ * @param path to directory
+ */
+size_t DirectorySize(const std::string& path);
+
+/*
+ * @brief Get size of current file
+ *
+ * @param path to file
+ * @return size of file, return 0 if file not exist
+ */
+int64_t FileSize(const std::string& path);
+
+/**
+ * @brief Creates directory
+ * @param name path to directory
+ * @return path to created directory.
+ */
+std::string CreateDirectory(const std::string& name);
+
+/**
+ * @brief Creates directory recursively
+ * @param path - full path to directory
+ * @return return true if directory was created or already exist
+ */
+bool CreateDirectoryRecursively(const std::string& path);
+
+/**
+ * @brief Checks the file to see whether the file is a directory
+ * @param name path to file
+ * @return returns true if file is directory.
+ */
+bool IsDirectory(const std::string& name);
+
+/**
+ * @brief Is directory exist
+ * @param name path to directory
+ * @return returns true if directory is exists.
+ */
+bool DirectoryExists(const std::string& name);
+
+/**
+ * @brief Is file exist
+ * @param name path to file
+ * @return returns true if file is exists.
+ */
+bool FileExists(const std::string& name);
+
+/**
+ * @brief Writes to file
+ *
+ * @remark - create file if it doesn't exist
+ * @param name path to file
+ * @param data data to write
+ * @return returns true if the operation is successfully.
+ */
+bool Write(const std::string& file_name,
+ const std::vector<uint8_t>& data,
+ std::ios_base::openmode mode = std::ios_base::out);
+
+/**
+ * @brief Opens file stream for writing
+ * @param file_name path to file to write data to
+ * @return returns pointer to opened stream in case of success;
+ * otherwise returns NULL
+ */
+std::ofstream* Open(const std::string& file_name,
+ std::ios_base::openmode mode = std::ios_base::out);
+
+/**
+ * @brief Writes to file stream
+ * @param file_stream file stream to be written to
+ * @param data data to be written to file
+ * @param data_size size of data to be written to file
+ * @return returns true if the operation is successfully.
+ */
+bool Write(std::ofstream* const file_stream,
+ const uint8_t* data,
+ uint32_t data_size);
+
+/**
+ * @brief Closes file stream
+ * @param file_stream file stream to be closed
+ */
+void Close(std::ofstream* file_stream);
+
+/**
+ * @brief Returns current working directory path
+ * If filename begins with "/", return unchanged filename
+ * @param name file name
+ * @return returns full file path.
+ */
+std::string CurrentWorkingDirectory();
+
+/**
+ * @brief Removes file
+ *
+ * @param name path to file
+ * @return returns true if the file is successfully deleted.
+ */
+bool DeleteFile(const std::string& name);
+
+/**
+ * @brief Removes directory.
+ *
+ * @param name path to directory.
+ * @param is_recursively true if you need delete directory recursively, otherwise false.
+ * @return returns true if the directory is successfully deleted.
+ */
+bool RemoveDirectory(const std::string& directory_name,
+ bool is_recursively = true);
+
+/**
+ * @brief Check access rights
+ *
+ * @param name path to file.
+ * @param how Read/write attribute.
+ * @return returns true if file has the given mode.
+ */
+bool IsAccessible(const std::string& name, int32_t how);
+
+/**
+ * @brief Check access rights for writing
+ *
+ * @param name path to file or folder
+ * @return returns true if has access rights.
+ */
+bool IsWritingAllowed(const std::string& name);
+
+/**
+ * @brief Check access rights for reading
+ *
+ * @param name path to file.
+ * @return returns true if file has access rights.
+ */
+bool IsReadingAllowed(const std::string& name);
+
+/**
+ * @brief Lists all files in given directory
+ *
+ * @param name path to directory.
+ * @return returns list of files.
+ */
+std::vector<std::string> ListFiles(const std::string& directory_name);
+
+/**
+ * @brief Creates or overwrites file with given binary contents
+ * @param name path to the file
+ * @param contents data to be written into the file
+ * @returns true if file write succeeded
+ */
+bool WriteBinaryFile(const std::string& name,
+ const std::vector<uint8_t>& contents);
+
+/**
+ * @brief Reads from file
+ *
+ * @param name path to file
+ * @param result read data
+ * @return returns true if the operation is successfully.
+ */
+bool ReadBinaryFile(const std::string& name,
+ std::vector<uint8_t>& result);
+
+bool ReadFile(const std::string& name, std::string& result);
+
+/**
+ * @brief Convert special symbols in system path to percent-encoded
+ *
+ * @param name path to file
+ * @return returns converted path.
+*/
+const std::string ConvertPathForURL(const std::string& path);
+
+/**
+ * @brief Create empty file
+ *
+ * @param name path to file
+ * @return if result success return true
+*/
+bool CreateFile(const std::string& path);
+
+void remove_directory_content(const std::string& directory_name);
+
+} // namespace file_system
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_FILE_SYSTEM_H_
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
new file mode 100644
index 0000000000..b23a246e13
--- /dev/null
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOG_MESSAGE_LOOP_THREAD_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOG_MESSAGE_LOOP_THREAD_H_
+
+#include <string>
+#include <queue>
+#include <log4cxx/logger.h>
+
+#include "utils/threads/message_loop_thread.h"
+#include "utils/singleton.h"
+
+namespace logger {
+
+typedef struct {
+ log4cxx::LoggerPtr logger;
+ log4cxx::LevelPtr level;
+ std::string entry;
+ log4cxx_time_t timeStamp;
+ log4cxx::spi::LocationInfo location;
+ log4cxx::LogString threadName;
+} LogMessage;
+
+typedef std::queue<LogMessage> LogMessageQueue;
+
+typedef threads::MessageLoopThread<LogMessageQueue> LogMessageLoopThreadTemplate;
+
+class LogMessageHandler : public LogMessageLoopThreadTemplate::Handler {
+ public:
+ virtual void Handle(const LogMessage message) OVERRIDE;
+};
+
+class LogMessageLoopThread :
+ public LogMessageLoopThreadTemplate,
+ public utils::Singleton<LogMessageLoopThread> {
+
+ public:
+ ~LogMessageLoopThread();
+
+ private:
+ LogMessageLoopThread();
+
+DISALLOW_COPY_AND_ASSIGN(LogMessageLoopThread);
+FRIEND_BASE_SINGLETON_CLASS(LogMessageLoopThread);
+
+};
+
+} // namespace logger
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_LOG_MESSAGE_LOOP_THREAD_H_
diff --git a/src/components/utils/include/utils/resource_usage.h b/src/components/utils/include/utils/resource_usage.h
new file mode 100644
index 0000000000..a8fa4aa7d9
--- /dev/null
+++ b/src/components/utils/include/utils/resource_usage.h
@@ -0,0 +1,168 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RESOURCE_USAGE_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RESOURCE_USAGE_H_
+
+#include <sys/resource.h>
+#if defined(__QNXNTO__)
+#include <sys/procfs.h>
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "utils/logger.h"
+
+#define MAX_COMM_LEN 128
+#define MAX_CMDLINE_LEN 128
+
+namespace utils {
+
+struct ResourseUsage {
+ long long int utime;
+ long long int stime;
+ long long int memory;
+};
+
+class Resources {
+ public:
+ typedef uint32_t MemInfo;
+#if defined(__QNXNTO__)
+ typedef procfs_info PidStats;
+
+#elif defined(OS_LINUX)
+
+ struct PidStats {
+ int pid;
+ char comm[MAX_COMM_LEN];
+ char state;
+ int ppid;
+ int pgrp;
+ int session;
+ int tty_nr;
+ int tpgid;
+ unsigned int flags;
+ unsigned long minflt;
+ unsigned long cminflt;
+ unsigned long majflt;
+ unsigned long cmajflt;
+ unsigned long utime;
+ long stime;
+ long cutime;
+ long cstime;
+ long priority;
+ long nice;
+ long num_threads;
+ long itrealvalue;
+ unsigned long long starttime;
+ unsigned long vsize;
+ long rss;
+ unsigned long rsslim;
+ unsigned long startcode;
+ unsigned long endcode;
+ unsigned long startstack;
+ unsigned long kstkesp;
+ unsigned long kstkeip;
+ unsigned long signal;
+ unsigned long blocked;
+ unsigned long sigignore;
+ unsigned long sigcatch;
+ unsigned long wchan;
+ unsigned long nswap;
+ unsigned long cnswap;
+ int exit_signal;
+ int processor;
+ unsigned int rt_priority;
+ unsigned int policy;
+ unsigned long long delayacct_blkio_ticks;
+ unsigned long guest_time;
+ long int cguest_time;
+ };
+#else
+
+#endif
+ public:
+ /*
+ * @brief Returns current resource usage of process
+ * @return Raw pointer on ResourseUsage if success, otherwise return NULL
+ */
+ static ResourseUsage* getCurrentResourseUsage();
+
+private:
+
+ /*
+ * @brief reads /proc/PID/stat file on linux
+ * do not work on QNX ( return false, output wan't be changed )
+ * @param output - storage for result string ( there will be separated content of /proc/PID/stat )
+ * @return true on succes false onb fail
+ */
+ static bool ReadStatFile(std::string& output);
+
+ /*
+ * @brief Grab information about curent process
+ * @param output - storage for result struct
+ * @return true on succes false onb fail
+ */
+ static bool GetProcInfo(PidStats& output);
+
+ /*
+ * @brief Grab process memory information
+ * @param output - storage for result struct
+ * @return true on succes false onb fail
+ */
+ static bool GetMemInfo(MemInfo& output);
+
+ /*
+ * @brief return path to /proc/PID/stat file on linux
+ * return path to /proc/PID/as file on linux
+ * @return path to file
+ */
+ static std::string GetStatPath();
+
+ /*
+ * @brief return path to /proc/PID directry
+ * @return path to dir
+ */
+ static std::string GetProcPath();
+
+ /*
+ * path to /proc/ directory
+ */
+ static const char* proc;
+};
+
+}
+
+
+
+#endif /* SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RESOURCE_USAGE_H_ */
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
new file mode 100644
index 0000000000..28e8afd9d6
--- /dev/null
+++ b/src/components/utils/include/utils/signals.h
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
+
+namespace utils {
+bool SubscribeToTerminateSignal(void (*func)(int32_t p));
+bool ResetSubscribeToTerminateSignal();
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
diff --git a/src/components/utils/include/utils/singleton.h b/src/components/utils/include/utils/singleton.h
new file mode 100644
index 0000000000..d7b625e0a1
--- /dev/null
+++ b/src/components/utils/include/utils/singleton.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
+
+#include "utils/lock.h"
+#include "utils/memory_barrier.h"
+#include "utils/atomic.h"
+
+namespace utils {
+
+namespace deleters {
+
+class DummyDeleter {
+ public:
+ void grab(void* pointer) {
+ }
+};
+
+template<typename T>
+class Deleter {
+ public:
+ Deleter() : pointer_(0) {
+ }
+ ~Deleter() {
+ if (pointer_) {
+ delete pointer_;
+ }
+ }
+ void grab(T* pointer) {
+ pointer_ = pointer;
+ }
+ private:
+ T* pointer_;
+};
+
+} // namespace deleters
+
+template<typename T, class Deleter = deleters::DummyDeleter>
+class Singleton {
+/**
+ * @brief Singleton template
+ * Singleton classes must derive from this template specialized with class itself:
+ *
+ * class MySingleton : public Singleton<MySingleton> {...};
+ *
+ * All such classes must declare instance() method as friend
+ * by adding FRIEND_BASE_SINGLETON_CLASS macro from macro.h to class definition:
+ *
+ * FRIEND_BASE_SINGLETON_CLASS(MySingleton);
+ *
+ * Instance of this class (if created) can be deleted by Deleter destructor
+ * which is called after main() (or from exit())
+ * This requires T destructor to be accessible for Deleter (e.g. public)
+ * Deleter template parameter can be specified with any class
+ * with public default constructor, destructor and method
+ * void grab(T*);
+ * However, default Deleter specification does nothing
+ *
+ * Also instance can be deleted explicitly by calling destroy() method
+ *
+ * Both instance() and destroy() methods are thread safe
+ * but not thread safety between simultaneous calls
+ * of instance() and destroy() is cared about
+ */
+ public:
+/**
+ * @brief Returns the singleton of class
+ */
+ static T* instance();
+/**
+ * @brief Destroys the singleton (if it had been created)
+ */
+ static void destroy();
+/**
+ * @brief Checks whether the singleton exists
+ */
+ static bool exists();
+
+ private:
+
+ static T** instance_pointer();
+ static Deleter* deleter();
+};
+
+template<typename T, class Deleter>
+T* Singleton<T, Deleter>::instance() {
+ static sync_primitives::Lock lock;
+
+ T* local_instance;
+ atomic_pointer_assign(local_instance, *instance_pointer());
+ memory_barrier();
+
+ if (!local_instance) {
+ lock.Acquire();
+ local_instance = *instance_pointer();
+ if (!local_instance) {
+ local_instance = new T();
+ memory_barrier();
+ atomic_pointer_assign(*instance_pointer(), local_instance);
+ deleter()->grab(local_instance);
+ }
+ lock.Release();
+ }
+
+ return local_instance;
+}
+
+template<typename T, class Deleter>
+void Singleton<T, Deleter>::destroy() {
+ static sync_primitives::Lock lock;
+
+ T* local_instance;
+ atomic_pointer_assign(local_instance, *instance_pointer());
+ memory_barrier();
+
+ if (local_instance) {
+ lock.Acquire();
+ local_instance = *instance_pointer();
+ if (local_instance) {
+ atomic_pointer_assign(*instance_pointer(), 0);
+ memory_barrier();
+ delete local_instance;
+ deleter()->grab(0);
+ }
+ lock.Release();
+ }
+}
+
+template<typename T, class Deleter>
+bool Singleton<T, Deleter>::exists() {
+ return *instance_pointer() != 0;
+}
+
+template<typename T, class Deleter>
+T** Singleton<T, Deleter>::instance_pointer() {
+ static T* instance = 0;
+ return &instance;
+}
+
+template<typename T, class Deleter>
+Deleter* Singleton<T, Deleter>::deleter() {
+ static Deleter deleter;
+ return &deleter;
+}
+
+} // namespace utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SINGLETON_H_
diff --git a/src/components/utils/include/utils/stl_utils.h b/src/components/utils/include/utils/stl_utils.h
new file mode 100644
index 0000000000..f525c6429f
--- /dev/null
+++ b/src/components/utils/include/utils/stl_utils.h
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_
+
+#include "utils/macro.h"
+
+namespace utils {
+
+/*
+ * Utility class that automatically deletes STL collection of
+ * freestore objects
+ */
+template<class T>
+class StlCollectionDeleter {
+ public:
+ typedef T Collection;
+ StlCollectionDeleter(T* collection): collection_(collection) {
+ DCHECK(collection_);
+ }
+ ~StlCollectionDeleter() {
+ for (typename Collection::iterator i = collection_->begin(),
+ end = collection_->end();
+ i != end; ++i) {
+ delete *i;
+ }
+ }
+ private:
+ Collection* collection_;
+};
+
+template<class T>
+class StlMapDeleter {
+ public:
+ typedef T Collection;
+ StlMapDeleter(T* collection): collection_(collection) {
+ DCHECK(collection_);
+ }
+ ~StlMapDeleter() {
+ for (typename Collection::iterator i = collection_->begin(),
+ end = collection_->end();
+ i != end; ++i) {
+ delete i->second;
+ }
+ }
+ private:
+ Collection* collection_;
+};
+
+} // namespace utils
+
+#endif /* SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_ */
diff --git a/src/components/utils/include/utils/system.h b/src/components/utils/include/utils/system.h
new file mode 100644
index 0000000000..16bdc03673
--- /dev/null
+++ b/src/components/utils/include/utils/system.h
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_H_
+
+#include <string>
+#include <vector>
+
+namespace utils {
+
+/**
+ * Class to execute shell scripts
+ */
+class System {
+ public:
+ /**
+ * Constructs instantiation
+ * @param command name of command for executing
+ */
+ explicit System(const std::string& command);
+
+ /**
+ * Constructs instantiation
+ * @param file name of file for executing
+ * @param command name of command
+ */
+ System(const std::string& file, const std::string& command);
+
+ /**
+ * Adds argument
+ * @param arg argument of command
+ * @return itself object
+ */
+ System& Add(const std::string& arg);
+
+ /**
+ * Executes command as new child process
+ * @return true if success
+ */
+ bool Execute();
+
+ /**
+ * Executes command
+ * @param wait if this flag is true then wait until command is terminated
+ * @return true if success
+ */
+ bool Execute(bool wait);
+
+ private:
+ /**
+ * Command for executing
+ */
+ std::string command_;
+
+ /**
+ * List of arguments
+ */
+ std::vector<std::string> argv_;
+};
+
+} // utils
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SYSTEM_H_
diff --git a/src/components/utils/include/utils/threads/pulse_thread_delegate.h b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
new file mode 100644
index 0000000000..bb109bde94
--- /dev/null
+++ b/src/components/utils/include/utils/threads/pulse_thread_delegate.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_PULSE_THREAD_DELEGATE_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_PULSE_THREAD_DELEGATE_H_
+
+#include <sys/neutrino.h>
+
+#include "utils/threads/thread_delegate.h"
+
+namespace threads {
+
+/**
+ * @brief This ThreadDelegate derivative is designed
+ * to implement threads waiting for QNX Pulse messages
+ * When constucted, an instance of this class creates QNX channel and connects to it
+ * In exitThreadMain() channel is disconnected and destroyed
+ * In threadMain() endless loop event is armed via pure virtual method ArmEvent()
+ * and thread blocks on MsgReceivePulse() waiting for Pulse
+ * When Pulse comes, OnPulse() pure virtual method is invoked
+ * Subclassed must implement ArmEvent() for events of interest
+ * and OnPulse() for reaction on such events
+ */
+class PulseThreadDelegate : public ThreadDelegate {
+ public:
+/**
+ * @brief default constructor
+ */
+ PulseThreadDelegate();
+ virtual void threadMain();
+ virtual bool exitThreadMain();
+
+ protected:
+/**
+ * @brief This method is to be implemented to arm events of interest
+ * @param event pointer to structure sigevent
+ * @return If this method returns true, thread is blocked on MsgReceivePulse() waiting for Pulse
+ */
+ virtual bool ArmEvent(struct sigevent* event) = 0;
+/**
+ * @brief This method is invoked from threadMain() when Pulse comes
+ */
+ virtual void OnPulse() = 0;
+
+ /**
+ * This method is to be initialize child class
+ * @return If this method returns false, thread will be stopped
+ */
+ virtual bool Init() { return true; }
+
+/**
+ * Finalizes thread
+ * Can free resources
+ */
+ virtual void Finalize() {}
+
+ private:
+ enum {PULSE_CODE = _PULSE_CODE_MINAVAIL + 1};
+
+ bool run_;
+ int chid_;
+ int coid_;
+};
+
+} // namespace threads
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_PULSE_THREAD_DELEGATE_H_
diff --git a/src/components/utils/include/utils/threads/thread_manager.h b/src/components/utils/include/utils/threads/thread_manager.h
new file mode 100644
index 0000000000..03330170e1
--- /dev/null
+++ b/src/components/utils/include/utils/threads/thread_manager.h
@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_MANAGER_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_MANAGER_H_
+
+#include "utils/threads/thread.h"
+#include "utils/lock.h"
+
+#include <map>
+#include <string>
+#include <set>
+
+#include "utils/macro.h"
+#include "utils/singleton.h"
+
+namespace threads {
+namespace impl {
+
+/*
+ * Generates short and unique names for unnamed threads
+ * and remembers association between thread handle and that short name
+ */
+class UnnamedThreadRegistry {
+ public:
+ UnnamedThreadRegistry();
+ ~UnnamedThreadRegistry();
+ /*
+ * Returns a name for given unnamed thread id.
+ * If id is first seen, new name is generated and memorized
+ * If id is already known, previously generated name is returned
+ */
+ std::string GetUniqueName(PlatformThreadHandle id);
+ private:
+ typedef std::map<PlatformThreadHandle, std::string> IdNameMap;
+ IdNameMap id_number_;
+ int32_t last_thread_number_;
+ sync_primitives::Lock state_lock_;
+};
+
+/*
+ * This class is here currently to remember names associated to threads.
+ * It manages raw impl::PlatformHandles because Thread::Id's do not provide
+ * comparison operator. Current linux implementation relies on fact that
+ * pthread_t is just an integer and every thread has single unique value
+ * associated with it.
+ * OS provides it's own facilities to name threads but
+ */
+class ThreadManager : public utils::Singleton<ThreadManager> {
+ public:
+ // Name a thread. Should be called only once for every thread.
+ // Threads can't be renamed
+ void RegisterName(PlatformThreadHandle id, const std::string& name);
+
+ // Get a name for previously registered thread
+ std::string GetName(PlatformThreadHandle id) const;
+
+ // Forget a name of (possibly destroyed) thread
+ // Make sure to call it after thread is finished
+ // Because thread id's can be recycled
+ void Unregister(PlatformThreadHandle id);
+ private:
+ ThreadManager();
+ ~ThreadManager();
+
+ private:
+ typedef std::set<std::string> NamesSet;
+ typedef std::map<PlatformThreadHandle, std::string> IdNamesMap;
+ // Set of thread names for fast checking if name is unique
+ NamesSet names_;
+ // Map from system handle to the thread name
+ IdNamesMap id_names_;
+ mutable sync_primitives::Lock state_lock_;
+
+ // Generator of shorter sequental names for unnamed threads
+ // Has to memorize every generated name this is why it is mutable
+ mutable UnnamedThreadRegistry unnamed_thread_namer_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ThreadManager);
+
+ FRIEND_BASE_SINGLETON_CLASS(ThreadManager);
+};
+
+} // namespace impl
+} // namespace threads
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_MANAGER_H_
diff --git a/src/components/utils/include/utils/threads/thread_validator.h b/src/components/utils/include/utils/threads/thread_validator.h
new file mode 100644
index 0000000000..def1994b76
--- /dev/null
+++ b/src/components/utils/include/utils/threads/thread_validator.h
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_THREADS_THREAD_VALIDATOR_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_THREADS_THREAD_VALIDATOR_H_
+
+#include "utils/threads/thread.h"
+
+namespace threads {
+/*
+ * Use objects of this class to validate (in run-time) access
+ * to single-threaded objects. It remembers the thread it was
+ * created on and then allows to easily check whether an object is
+ * being accessed from different thread and log an error in that case
+ *
+ * Put a member of type SingleThreadValidator in your class and call
+ * AssertRunningOnCreationThread in it's every public method
+ *
+ * class MySingleThreadedThing {
+ * .....
+ * public:
+ * void DoSomeWork();
+ * .....
+ * private:
+ * SingleThreadValidator thread_validator_;
+ * .....
+ * };
+ *
+ * void MySingleThreadedThing::DoSomeWork() {
+ * thread_validator_.AssertRunningOnCreationThread();
+ * .....
+ * }
+ */
+class SingleThreadSimpleValidator {
+ public:
+ SingleThreadSimpleValidator();
+ ~SingleThreadSimpleValidator();
+
+ // This method should be called in every public method
+ // of classes being checked for absence of concurrent access
+ void AssertRunningOnCreationThread() const;
+ private:
+ const Thread::Id creation_thread_id_;
+};
+
+
+/*
+ * This is bit more sophisticated debug helper which allows
+ * objects being checked to be transferred between threads.
+ * Make sure to pass ownership calling PassToThread before
+ * object is accessed from that thread!
+ *
+ * It's better to virtually inherit it to make PassToThread publicly
+ * available to code that uses objects of your classes and make sure
+ * that if your object consists of different thread-validated
+ * parts you'll need not to call PassToThread proxy method for
+ * every part of your composite object
+ */
+class SingleThreadValidator {
+ public:
+ SingleThreadValidator();
+ ~SingleThreadValidator();
+
+ // Must be called prior to transferring object being validated to
+ // another thread or when passing it back
+ void PassToThread(Thread::Id thread_id) const;
+ // This method should be called in every public method
+ // of classes being checked for absence of unintended concurrent
+ // access
+ void AssertRunningOnValidThread() const;
+ private:
+ mutable Thread::Id owning_thread_id_;
+};
+
+} // namespace threads
+
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_THREADS_THREAD_VALIDATOR_H_
diff --git a/src/components/utils/src/appenders_loader.cc b/src/components/utils/src/appenders_loader.cc
new file mode 100644
index 0000000000..cbbd039060
--- /dev/null
+++ b/src/components/utils/src/appenders_loader.cc
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dlfcn.h>
+
+#include "utils/appenders_loader.h"
+
+namespace utils {
+
+AppendersLoader appenders_loader;
+
+AppendersLoader::AppendersLoader() {
+ handle_ = dlopen("libappenders.so", RTLD_LAZY | RTLD_NODELETE);
+}
+
+AppendersLoader::~AppendersLoader() {
+ if (handle_ != 0) {
+ dlclose(handle_);
+ }
+}
+
+bool AppendersLoader::Loaded() const {
+ return handle_ != 0;
+}
+
+} // namespace utils
diff --git a/src/components/utils/src/back_trace.cc b/src/components/utils/src/back_trace.cc
new file mode 100644
index 0000000000..23b1b4d1e9
--- /dev/null
+++ b/src/components/utils/src/back_trace.cc
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/back_trace.h"
+
+#include <algorithm>
+#include <vector>
+#include <sstream>
+
+#include <cxxabi.h>
+#include <execinfo.h>
+
+#include "utils/macro.h"
+
+using std::ostream;
+using std::string;
+using std::vector;
+using threads::Thread;
+
+namespace utils {
+
+namespace {
+string demangle(const char* symbol) {
+ char temp[2048];
+ if (1 == sscanf(symbol, "%*[^(]%*[^_]%2047[^)+]", temp)) {
+ size_t size;
+ int32_t status;
+ char* demangled = abi::__cxa_demangle(temp, NULL, &size, &status);
+ if (demangled != NULL) {
+ string result(demangled);
+ free(demangled);
+ return result;
+ }
+ }
+ return symbol;
+}
+}
+
+Backtrace::Backtrace(int32_t count, int32_t skip_top)
+ : thread_id_(threads::Thread::CurrentId()) {
+ int32_t skip = skip_top + 1; // Skip this constructor
+ vector<void*> full_trace (count + skip);
+ int32_t captured = backtrace(&full_trace.front(), count + skip);
+ int32_t first_call = std::min(captured, skip);
+ int32_t last_call = std::min(first_call + count, captured);
+ backtrace_.assign(full_trace.begin() + first_call, full_trace.begin() + last_call);
+}
+
+Backtrace::~Backtrace() {
+}
+
+vector<string> Backtrace::CallStack() const {
+ vector<string> callstack;
+ callstack.reserve(backtrace_.size());
+ char** mangled = backtrace_symbols(&backtrace_.front(), backtrace_.size());
+ for (size_t i = 0; i != backtrace_.size(); ++i) {
+ callstack.push_back(demangle(mangled[i]));
+ }
+ free(mangled);
+ return callstack;
+}
+
+Thread::Id Backtrace::ThreadId() const {
+ return thread_id_;
+}
+
+ostream& operator<< (ostream& os, const Backtrace& bt) {
+ const vector<string> symbols = bt.CallStack();
+ os<<"Stack trace ("<<bt.ThreadId()<<")\n";
+ if (symbols.empty()) {
+ os<<"Not available"<<std::endl;
+ } else for (size_t i = 0; i < symbols.size(); ++i) {
+ os<<symbols[i]<<std::endl;
+ }
+ return os;
+}
+
+} // namespace utils
diff --git a/src/components/utils/src/bitstream.cc b/src/components/utils/src/bitstream.cc
new file mode 100644
index 0000000000..c616b1ae4a
--- /dev/null
+++ b/src/components/utils/src/bitstream.cc
@@ -0,0 +1,132 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "utils/bitstream.h"
+
+namespace utils {
+
+BitStream::BitStream(uint8_t* bytes, size_t bytes_count)
+ : bytes_(bytes),
+ bytes_count_(bytes_count),
+ byte_offset_(0),
+ bit_offset_(0),
+ bad_(false) {
+}
+
+BitStream::~BitStream() {
+}
+
+size_t BitStream::FullBytesLeft() {
+ size_t left = bytes_count_ - byte_offset_;
+ if (bit_offset_ != 0)
+ left -= 1;
+ return left;
+}
+
+size_t BitStream::BitsLeft() {
+ return (bytes_count_ - byte_offset_) * CHAR_BIT - bit_offset_;
+}
+
+void BitStream::ExtractBytes(void* buffer, size_t length) {
+ DCHECK(length == 0 || buffer != NULL);
+ if (IsGood()) {
+ if (bit_offset_ != 0 || // bytes can be extracted only when
+ FullBytesLeft() < length) { // stream is byte-aligned
+ MarkBad();
+ return;
+ }
+ }
+ memcpy(buffer, &bytes_[byte_offset_], length);
+ byte_offset_ += length;
+}
+
+void Extract(BitStream* bs, uint8_t* val) {
+ DCHECK(bs && val);
+ if (*bs) {
+ bs->Extract(*val);
+ }
+}
+
+void Extract(BitStream* bs, uint8_t* val, size_t bits) {
+ DCHECK(bs && val);
+ if (*bs) {
+ bs->ExtractBits(*val, bits);
+ }
+}
+
+void Extract(BitStream* bs, uint32_t* val) {
+ DCHECK(bs && val);
+ if (*bs) {
+ bs->Extract(*val);
+ }
+}
+
+void Extract(BitStream* bs, uint32_t* val, size_t bits) {
+ DCHECK(bs && val);
+ if (*bs) {
+ bs->ExtractBits(*val, bits);
+ }
+}
+
+void Extract(BitStream* bs, std::string* str, size_t length) {
+ DCHECK(bs && str);
+ if (*bs) {
+ // Prevent memory over-allocation
+ if (bs->FullBytesLeft() < length) {
+ bs->MarkBad();
+ return;
+ }
+ str->resize(length+1);
+ void* stringdata = &(*str)[0];
+ bs->ExtractBytes(stringdata, length);
+ str->resize(length);
+ }
+}
+
+void Extract(BitStream* bs, std::vector<uint8_t>* data, size_t length) {
+ DCHECK(bs && data);
+ if (*bs) {
+ // Prevent memory over-allocation
+ if (bs->FullBytesLeft() < length) {
+ bs->MarkBad();
+ return;
+ }
+ data->resize(length);
+
+ if (0 != length) {
+ void* dataptr = &data->front();
+ bs->ExtractBytes(dataptr, length);
+ }
+ }
+}
+
+} // namespace utils
+
diff --git a/src/components/utils/src/conditional_variable_posix.cc b/src/components/utils/src/conditional_variable_posix.cc
new file mode 100644
index 0000000000..a89f8cab65
--- /dev/null
+++ b/src/components/utils/src/conditional_variable_posix.cc
@@ -0,0 +1,136 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "utils/conditional_variable.h"
+
+#include <errno.h>
+#include <time.h>
+
+#include "utils/lock.h"
+#include "utils/logger.h"
+
+namespace {
+const long kNanosecondsPerSecond = 1000000000;
+const long kMillisecondsPerSecond = 1000;
+const long kNanosecondsPerMillisecond = 1000000;
+}
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+ConditionalVariable::ConditionalVariable() {
+ pthread_condattr_t attrs;
+ int32_t initialized = pthread_condattr_init(&attrs);
+ if (initialized != 0)
+ LOG4CXX_ERROR(logger_, "Failed to initialize "
+ "conditional variable attributes");
+ pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC);
+ initialized = pthread_cond_init(&cond_var_, &attrs);
+ if (initialized != 0)
+ LOG4CXX_ERROR(logger_, "Failed to initialize "
+ "conditional variable");
+ int32_t rv = pthread_condattr_destroy(&attrs);
+ if (rv != 0)
+ LOG4CXX_ERROR(logger_, "Failed to destroy "
+ "conditional variable attributes");
+}
+
+ConditionalVariable::~ConditionalVariable() {
+ pthread_cond_destroy(&cond_var_);
+
+}
+
+void ConditionalVariable::NotifyOne() {
+ int32_t signaled = pthread_cond_signal(&cond_var_);
+ if (signaled != 0)
+ LOG4CXX_ERROR(logger_, "Failed to signal conditional variable");
+
+}
+
+void ConditionalVariable::Broadcast() {
+ int32_t signaled = pthread_cond_broadcast(&cond_var_);
+ if (signaled != 0)
+ LOG4CXX_ERROR(logger_, "Failed to broadcast conditional variable");
+
+}
+
+void ConditionalVariable::Wait(AutoLock& auto_lock) {
+ Lock& lock = auto_lock.GetLock();
+ lock.AssertTakenAndMarkFree();
+ int32_t wait_status = pthread_cond_wait(&cond_var_,
+ &lock.mutex_);
+ lock.AssertFreeAndMarkTaken();
+ if (wait_status != 0)
+ LOG4CXX_ERROR(logger_, "Failed to wait for conditional variable");
+}
+
+ConditionalVariable::WaitStatus ConditionalVariable::WaitFor(
+ AutoLock& auto_lock, int32_t milliseconds){
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ timespec wait_interval;
+ wait_interval.tv_sec = now.tv_sec +
+ (milliseconds / kMillisecondsPerSecond);
+ wait_interval.tv_nsec = now.tv_nsec +
+ (milliseconds % kMillisecondsPerSecond) * kNanosecondsPerMillisecond;
+ wait_interval.tv_sec += wait_interval.tv_nsec / kNanosecondsPerSecond;
+ wait_interval.tv_nsec %= kNanosecondsPerSecond;
+
+ Lock& lock = auto_lock.GetLock();
+ lock.AssertTakenAndMarkFree();
+ int32_t timedwait_status = pthread_cond_timedwait(&cond_var_,
+ &lock.mutex_,
+ &wait_interval);
+ lock.AssertFreeAndMarkTaken();
+ WaitStatus wait_status = kNoTimeout;
+ switch(timedwait_status) {
+ case 0: {
+ wait_status = kNoTimeout;
+ break;
+ }
+ case EINTR: {
+ wait_status = kNoTimeout;
+ break;
+ }
+ case ETIMEDOUT: {
+ wait_status = kTimeout;
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Failed to timewait for conditional variable timedwait_status: " << timedwait_status);
+ }
+ }
+
+ return wait_status;
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/date_time.cc b/src/components/utils/src/date_time.cc
new file mode 100644
index 0000000000..f190951647
--- /dev/null
+++ b/src/components/utils/src/date_time.cc
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <sys/time.h>
+#include <stdint.h>
+#include "utils/date_time.h"
+
+namespace date_time {
+
+TimevalStruct DateTime::getCurrentTime() {
+ TimevalStruct currentTime;
+ timezone timeZone;
+
+ gettimeofday(&currentTime, &timeZone);
+
+ return currentTime;
+}
+
+int64_t date_time::DateTime::getSecs(const TimevalStruct &time) {
+ return static_cast<int64_t>(time.tv_sec);
+}
+
+int64_t DateTime::getmSecs(const TimevalStruct &time) {
+ return static_cast<int64_t>(time.tv_sec) * MILLISECONDS_IN_SECOND
+ + time.tv_usec / MICROSECONDS_IN_MILLISECONDS;
+}
+
+int64_t DateTime::getuSecs(const TimevalStruct &time) {
+ return static_cast<int64_t>(time.tv_sec) * MILLISECONDS_IN_SECOND
+ * MICROSECONDS_IN_MILLISECONDS + time.tv_usec;
+}
+
+int64_t DateTime::calculateTimeSpan(const TimevalStruct& sinceTime) {
+ return calculateTimeDiff(getCurrentTime(), sinceTime);
+}
+
+int64_t DateTime::calculateTimeDiff(const TimevalStruct &time1,
+ const TimevalStruct &time2){
+ TimevalStruct ret;
+ if (Greater(time1, time2)) {
+ ret = Sub(time1, time2);
+ } else {
+ ret = Sub(time2, time1);
+ }
+ return getmSecs(ret);
+}
+
+TimevalStruct DateTime::Sub(const TimevalStruct& time1,
+ const TimevalStruct& time2) {
+ TimevalStruct ret;
+ timersub(&time1, &time2, &ret);
+ return ret;
+}
+
+bool DateTime::Greater(const TimevalStruct& time1, const TimevalStruct& time2) {
+ return timercmp(&time1, &time2, >);
+}
+
+bool DateTime::Less(const TimevalStruct& time1, const TimevalStruct& time2) {
+ return timercmp(&time1, &time2, <);
+}
+
+bool DateTime::Equal(const TimevalStruct& time1, const TimevalStruct& time2) {
+ return !timercmp(&time1, &time2, !=);
+}
+
+TimeCompare date_time::DateTime::compareTime(const TimevalStruct &time1, const TimevalStruct &time2) {
+ if (Greater(time1, time2)) return GREATER;
+ if (Less(time1, time2)) return LESS;
+ return EQUAL;
+}
+
+} // namespace date_time
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
new file mode 100644
index 0000000000..5eb2457a09
--- /dev/null
+++ b/src/components/utils/src/file_system.cc
@@ -0,0 +1,423 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/file_system.h"
+#include "utils/logger.h"
+
+#include <sys/statvfs.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sstream>
+
+#include <dirent.h>
+#include <unistd.h>
+// TODO(VS): lint error: Streams are highly discouraged.
+#include <fstream>
+#include <cstddef>
+#include <algorithm>
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+uint64_t file_system::GetAvailableDiskSpace(const std::string& path) {
+ struct statvfs fsInfo;
+ memset(reinterpret_cast<void*>(&fsInfo), 0, sizeof(fsInfo));
+ if (statvfs(path.c_str(), &fsInfo) == 0) {
+ return fsInfo.f_bsize * fsInfo.f_bfree;
+ } else {
+ return 0;
+ }
+}
+
+int64_t file_system::FileSize(const std::string &path) {
+ if (file_system::FileExists(path)) {
+ struct stat file_info;
+ memset(reinterpret_cast<void*>(&file_info), 0, sizeof(file_info));
+ stat(path.c_str(), &file_info);
+ return file_info.st_size;
+ }
+ return 0;
+}
+
+size_t file_system::DirectorySize(const std::string& path) {
+ size_t size = 0;
+ int32_t return_code = 0;
+ DIR* directory = NULL;
+
+#ifndef __QNXNTO__
+ struct dirent dir_element_;
+ struct dirent* dir_element = &dir_element_;
+#else
+ char* direntbuffer =
+ new char[offsetof(struct dirent, d_name) +
+ pathconf(path.c_str(), _PC_NAME_MAX) + 1];
+ struct dirent* dir_element = new(direntbuffer) dirent;
+#endif
+ struct dirent* result = NULL;
+ struct stat file_info;
+ directory = opendir(path.c_str());
+ if (NULL != directory) {
+ return_code = readdir_r(directory, dir_element, &result);
+ for (; NULL != result && 0 == return_code;
+ return_code = readdir_r(directory, dir_element, &result)) {
+ if (0 == strcmp(result->d_name, "..")
+ || 0 == strcmp(result->d_name, ".")) {
+ continue;
+ }
+ std::string full_element_path = path + "/" + result->d_name;
+ if (file_system::IsDirectory(full_element_path)) {
+ size += DirectorySize(full_element_path);
+ } else {
+ memset(reinterpret_cast<void*>(&file_info), 0, sizeof(file_info));
+ stat(full_element_path.c_str(), &file_info);
+ size += file_info.st_size;
+ }
+ }
+ }
+ closedir(directory);
+#ifdef __QNXNTO__
+ delete[] direntbuffer;
+#endif
+ return size;
+}
+
+std::string file_system::CreateDirectory(const std::string& name) {
+ if (!DirectoryExists(name)) {
+ mkdir(name.c_str(), S_IRWXU);
+ }
+
+ return name;
+}
+
+bool file_system::CreateDirectoryRecursively(const std::string& path) {
+ size_t pos = 0;
+ bool ret_val = true;
+
+ while (ret_val == true && pos <= path.length()) {
+ pos = path.find('/', pos + 1);
+ if (!DirectoryExists(path.substr(0, pos))) {
+ if (0 != mkdir(path.substr(0, pos).c_str(), S_IRWXU)) {
+ ret_val = false;
+ }
+ }
+ }
+
+ return ret_val;
+}
+
+bool file_system::IsDirectory(const std::string& name) {
+ struct stat status;
+ memset(&status, 0, sizeof(status));
+
+ if (-1 == stat(name.c_str(), &status)) {
+ return false;
+ }
+
+ return S_ISDIR(status.st_mode);
+}
+
+bool file_system::DirectoryExists(const std::string& name) {
+ struct stat status;
+ memset(&status, 0, sizeof(status));
+
+ if (-1 == stat(name.c_str(), &status) || !S_ISDIR(status.st_mode)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool file_system::FileExists(const std::string& name) {
+ struct stat status;
+ memset(&status, 0, sizeof(status));
+
+ if (-1 == stat(name.c_str(), &status)) {
+ return false;
+ }
+ return true;
+}
+
+bool file_system::Write(
+ const std::string& file_name, const std::vector<uint8_t>& data,
+ std::ios_base::openmode mode) {
+ std::ofstream file(file_name.c_str(), std::ios_base::binary | mode);
+ if (file.is_open()) {
+ for (uint32_t i = 0; i < data.size(); ++i) {
+ file << data[i];
+ }
+ file.close();
+ return true;
+ }
+ return false;
+}
+
+std::ofstream* file_system::Open(const std::string& file_name,
+ std::ios_base::openmode mode) {
+
+
+ std::ofstream* file = new std::ofstream();
+ file->open( file_name.c_str(),std::ios_base::binary | mode);
+ if (file->is_open()) {
+
+ return file;
+ }
+
+ return NULL;
+}
+
+bool file_system::Write(std::ofstream* const file_stream,
+ const uint8_t* data,
+ uint32_t data_size) {
+ bool result = false;
+ if (file_stream) {
+ for (size_t i = 0; i < data_size; ++i) {
+ (*file_stream) << data[i];
+ }
+ result = true;
+ }
+ return result;
+}
+
+void file_system::Close(std::ofstream* file_stream) {
+ if (file_stream) {
+ file_stream->close();
+ }
+}
+
+std::string file_system::CurrentWorkingDirectory() {
+ size_t filename_max_lenght = 1024;
+ char currentAppPath[filename_max_lenght];
+ memset(currentAppPath, 0, filename_max_lenght);
+ if (0 == getcwd(currentAppPath, filename_max_lenght)) {
+ LOG4CXX_WARN(logger_, "Could not get CWD");
+ }
+
+ char path[filename_max_lenght];
+ memset(path, 0, filename_max_lenght);
+ snprintf(path, filename_max_lenght - 1, "%s", currentAppPath);
+ return std::string(path);
+}
+
+bool file_system::DeleteFile(const std::string& name) {
+ if (FileExists(name) && IsAccessible(name, W_OK)) {
+ return !remove(name.c_str());
+ }
+ return false;
+}
+
+void file_system::remove_directory_content(const std::string& directory_name) {
+ int32_t return_code = 0;
+ DIR* directory = NULL;
+#ifndef __QNXNTO__
+ struct dirent dir_element_;
+ struct dirent* dir_element = &dir_element_;
+#else
+ char* direntbuffer =
+ new char[offsetof(struct dirent, d_name) +
+ pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
+ struct dirent* dir_element = new(direntbuffer) dirent;
+#endif
+ struct dirent* result = NULL;
+
+ directory = opendir(directory_name.c_str());
+
+ if (NULL != directory) {
+ return_code = readdir_r(directory, dir_element, &result);
+
+ for (; NULL != result && 0 == return_code;
+ return_code = readdir_r(directory, dir_element, &result)) {
+ if (0 == strcmp(result->d_name, "..")
+ || 0 == strcmp(result->d_name, ".")) {
+ continue;
+ }
+
+ std::string full_element_path = directory_name + "/" + result->d_name;
+
+ if (file_system::IsDirectory(full_element_path)) {
+ remove_directory_content(full_element_path);
+ rmdir(full_element_path.c_str());
+ } else {
+ remove(full_element_path.c_str());
+ }
+ }
+ }
+
+ closedir(directory);
+#ifdef __QNXNTO__
+ delete[] direntbuffer;
+#endif
+}
+
+bool file_system::RemoveDirectory(const std::string& directory_name,
+ bool is_recursively) {
+ if (DirectoryExists(directory_name)
+ && IsAccessible(directory_name, W_OK)) {
+ if (is_recursively) {
+ remove_directory_content(directory_name);
+ }
+
+ return !rmdir(directory_name.c_str());
+ }
+ return false;
+}
+
+bool file_system::IsAccessible(const std::string& name, int32_t how) {
+ return !access(name.c_str(), how);
+}
+
+bool file_system::IsWritingAllowed(const std::string& name) {
+ return IsAccessible(name, W_OK);
+}
+
+bool file_system::IsReadingAllowed(const std::string& name) {
+ return IsAccessible(name, R_OK);
+}
+
+std::vector<std::string> file_system::ListFiles(
+ const std::string& directory_name) {
+ std::vector<std::string> listFiles;
+ if (!DirectoryExists(directory_name)) {
+ return listFiles;
+ }
+
+ int32_t return_code = 0;
+ DIR* directory = NULL;
+#ifndef __QNXNTO__
+ struct dirent dir_element_;
+ struct dirent* dir_element = &dir_element_;
+#else
+ char* direntbuffer =
+ new char[offsetof(struct dirent, d_name) +
+ pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
+ struct dirent* dir_element = new(direntbuffer) dirent;
+#endif
+ struct dirent* result = NULL;
+
+ directory = opendir(directory_name.c_str());
+ if (NULL != directory) {
+ return_code = readdir_r(directory, dir_element, &result);
+
+ for (; NULL != result && 0 == return_code;
+ return_code = readdir_r(directory, dir_element, &result)) {
+ if (0 == strcmp(result->d_name, "..")
+ || 0 == strcmp(result->d_name, ".")) {
+ continue;
+ }
+
+ listFiles.push_back(std::string(result->d_name));
+ }
+
+ closedir(directory);
+#ifdef __QNXNTO__
+ delete[] direntbuffer;
+#endif
+ }
+
+ return listFiles;
+}
+
+bool file_system::WriteBinaryFile(const std::string& name,
+ const std::vector<uint8_t>& contents) {
+ using namespace std;
+ ofstream output(name.c_str(), ios_base::binary|ios_base::trunc);
+ output.write(reinterpret_cast<const char*>(&contents.front()),
+ contents.size());
+ return output.good();
+}
+
+bool file_system::ReadBinaryFile(const std::string& name,
+ std::vector<uint8_t>& result) {
+ if (!FileExists(name) || !IsAccessible(name, R_OK)) {
+ return false;
+ }
+
+ std::ifstream file(name.c_str(), std::ios_base::binary);
+ std::ostringstream ss;
+ ss << file.rdbuf();
+ const std::string& s = ss.str();
+
+ result.resize(s.length());
+ std::copy(s.begin(), s.end(), result.begin());
+ return true;
+}
+
+bool file_system::ReadFile(const std::string& name, std::string& result) {
+ if (!FileExists(name) || !IsAccessible(name, R_OK)) {
+ return false;
+ }
+
+ std::ifstream file(name.c_str());
+ std::ostringstream ss;
+ ss << file.rdbuf();
+ result = ss.str();
+ return true;
+}
+
+const std::string file_system::ConvertPathForURL(const std::string& path) {
+ std::string::const_iterator it_path = path.begin();
+ std::string::const_iterator it_path_end = path.end();
+
+ const std::string reserved_symbols = "!#$&'()*+,:;=?@[] ";
+ std::string::const_iterator it_sym = reserved_symbols.begin();
+ std::string::const_iterator it_sym_end = reserved_symbols.end();
+
+ std::string converted_path;
+ while (it_path != it_path_end) {
+
+ it_sym = reserved_symbols.begin();
+ for (; it_sym != it_sym_end; ++it_sym) {
+
+ if (*it_path == *it_sym) {
+ size_t size = 100;
+ char percent_value[size];
+ snprintf(percent_value, size, "%%%x", *it_path);
+ converted_path += percent_value;
+ ++it_path;
+ continue;
+ }
+ }
+
+ converted_path += *it_path;
+ ++it_path;
+ }
+
+ return converted_path;
+}
+
+bool file_system::CreateFile(const std::string& path) {
+ std::ofstream file(path);
+ if (!(file.is_open())) {
+ return false;
+ } else {
+ file.close();
+ return true;
+ }
+}
diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_posix.cc
new file mode 100644
index 0000000000..7591d4b525
--- /dev/null
+++ b/src/components/utils/src/lock_posix.cc
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/lock.h"
+
+#include <errno.h>
+#include <stdint.h>
+
+#include "utils/logger.h"
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+Lock::Lock()
+#ifndef NDEBUG
+ : lock_taken_(0),
+ is_mutex_recursive_(false)
+#endif // NDEBUG
+{
+ int32_t status = pthread_mutex_init(&mutex_, NULL);
+ if (status != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to initialize mutex");
+ }
+}
+
+Lock::Lock(bool is_mutex_recursive)
+#ifndef NDEBUG
+ : lock_taken_(0),
+ is_mutex_recursive_(is_mutex_recursive)
+#endif // NDEBUG
+{
+ int32_t status;
+
+ if (is_mutex_recursive) {
+ pthread_mutexattr_t attr;
+
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ status = pthread_mutex_init(&mutex_, &attr);
+ } else {
+ status = pthread_mutex_init(&mutex_, NULL);
+ }
+
+ if (status != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to initialize mutex");
+ }
+}
+
+Lock::~Lock() {
+#ifndef NDEBUG
+ if (lock_taken_ > 0) {
+ LOG4CXX_ERROR(logger_, "Destroying non-released mutex");
+ }
+#endif
+ int32_t status = pthread_mutex_destroy(&mutex_);
+ if (status != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to destroy mutex");
+ }
+}
+
+void Lock::Acquire() {
+ int32_t status = pthread_mutex_lock(&mutex_);
+ if (status != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to acquire mutex");
+ }
+ AssertFreeAndMarkTaken();
+}
+
+void Lock::Release() {
+ AssertTakenAndMarkFree();
+ int32_t status = pthread_mutex_unlock(&mutex_);
+ if (status != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to unlock mutex");
+ }
+}
+
+bool Lock::Try() {
+ bool ackquired = false;
+#ifndef NDEBUG
+ if ((lock_taken_ > 0) && !is_mutex_recursive_) {
+ LOG4CXX_ERROR(logger_, "Trying to lock already taken not recurcive mutex");
+ }
+#endif
+ switch(pthread_mutex_trylock(&mutex_)) {
+ case 0: {
+ ackquired = true;
+#ifndef NDEBUG
+ lock_taken_++;
+#endif
+ } break;
+ case EBUSY: {
+ ackquired = false;
+ } break;
+ default: {
+ ackquired = false;
+ LOG4CXX_ERROR(logger_, "Failed to try lock the mutex");
+ }
+ }
+ return ackquired;
+}
+
+#ifndef NDEBUG
+void Lock::AssertFreeAndMarkTaken() {
+ if ((lock_taken_ > 0) && !is_mutex_recursive_) {
+ LOG4CXX_ERROR(logger_, "Locking already taken not recurcive mutex");
+ NOTREACHED();
+ }
+ lock_taken_++;
+}
+void Lock::AssertTakenAndMarkFree() {
+ if (lock_taken_ == 0) {
+ LOG4CXX_ERROR(logger_, "Unlocking a mutex that is not taken");
+ NOTREACHED();
+ }
+ lock_taken_--;
+}
+#endif
+
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/log_message_loop_thread.cc b/src/components/utils/src/log_message_loop_thread.cc
new file mode 100644
index 0000000000..1403a5f712
--- /dev/null
+++ b/src/components/utils/src/log_message_loop_thread.cc
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/log_message_loop_thread.h"
+#include "utils/logger_status.h"
+
+namespace logger {
+
+void LogMessageHandler::Handle(const LogMessage message) {
+ message.logger->forcedLog(message.level,
+ message.entry,
+ message.timeStamp,
+ message.location,
+ message.threadName);
+}
+
+LogMessageLoopThread::LogMessageLoopThread() :
+ LogMessageLoopThreadTemplate("Logger", new LogMessageHandler()) {
+}
+
+LogMessageLoopThread::~LogMessageLoopThread() {
+// we'll have to drop messages
+// while deleting logger thread
+ logger_status = DeletingLoggerThread;
+}
+
+} // namespace logger
diff --git a/src/components/utils/src/logger_status.cc b/src/components/utils/src/logger_status.cc
new file mode 100644
index 0000000000..be341b9add
--- /dev/null
+++ b/src/components/utils/src/logger_status.cc
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/logger_status.h"
+
+namespace logger {
+
+LoggerStatus logger_status = LoggerThreadNotCreated;
+
+} // namespace logger
diff --git a/src/components/utils/src/push_log.cc b/src/components/utils/src/push_log.cc
new file mode 100644
index 0000000000..49525a4f27
--- /dev/null
+++ b/src/components/utils/src/push_log.cc
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/push_log.h"
+#include "utils/log_message_loop_thread.h"
+#include "utils/logger_status.h"
+
+namespace logger {
+
+bool push_log(log4cxx::LoggerPtr logger,
+ log4cxx::LevelPtr level,
+ const std::string& entry,
+ log4cxx_time_t timeStamp,
+ const log4cxx::spi::LocationInfo& location,
+ const log4cxx::LogString& threadName
+ ) {
+ if (LoggerThreadCreated == logger_status) {
+ LogMessage message = {logger, level, entry, timeStamp, location, threadName};
+ LogMessageLoopThread::instance()->PostMessage(message);
+ return true;
+ }
+
+ if (LoggerThreadNotCreated == logger_status) {
+ logger_status = CreatingLoggerThread;
+// we'll have to drop messages
+// while creating logger thread
+ LogMessage message = {logger, level, entry, timeStamp, location, threadName};
+ LogMessageLoopThread::instance()->PostMessage(message);
+ logger_status = LoggerThreadCreated;
+ return true;
+ }
+
+// also we drop messages
+// while deleting logger thread
+
+ return false;
+}
+
+} // namespace logger
diff --git a/src/components/utils/src/resource_usage.cc b/src/components/utils/src/resource_usage.cc
new file mode 100644
index 0000000000..aaa9c1b4a7
--- /dev/null
+++ b/src/components/utils/src/resource_usage.cc
@@ -0,0 +1,192 @@
+#include "utils/resource_usage.h"
+#if defined(__QNXNTO__)
+#include <dirent.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <sys/neutrino.h>
+#include <sys/procfs.h>
+#include <sys/stat.h>
+#include <sys/trace.h>
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+#include <sys/resource.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <sstream>
+#include "utils/file_system.h"
+
+namespace utils {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+const char* Resources::proc = "/proc/";
+
+ResourseUsage* Resources::getCurrentResourseUsage() {
+ PidStats pid_stats;
+ if (false == GetProcInfo(pid_stats)) {
+ LOG4CXX_ERROR(logger_, "Failed to get cpu proc info");
+ return NULL;
+ }
+ MemInfo mem_info;
+ if (false == GetMemInfo(mem_info)) {
+ LOG4CXX_ERROR(logger_, "Failed to get memory info");
+ return NULL;
+ }
+ ResourseUsage* usage = new ResourseUsage();
+ usage->utime = pid_stats.utime;
+ usage->stime = pid_stats.stime;
+ usage->memory = static_cast<long long int>(mem_info);
+ return usage;
+}
+
+bool Resources::ReadStatFile(std::string& output) {
+ std::string filename = GetStatPath();
+ if (false == file_system::FileExists(filename)) {
+ return false;
+ }
+ if (false == file_system::ReadFile(filename,output)) {
+ return false;
+ }
+ return true;
+}
+
+bool Resources::GetProcInfo(Resources::PidStats& output) {
+#if defined(OS_LINUX)
+ std::string proc_buf;
+ if (false == ReadStatFile(proc_buf)) {
+ return false;
+ }
+ uint32_t num_succes = sscanf(proc_buf.c_str(),
+ "%d" //pid
+ " %*s"//com
+ " %c" //state
+ " %d" //ppid
+ " %d" //pgrp
+ " %d" //session
+ " %d" //tty_nr
+ " %d" //tpgid
+ " %u" //flags
+ " %lu" //minflt
+ " %lu" //cminflt
+ " %lu" //majflt
+ " %lu" //cmajflt
+ " %lu" //utime
+ " %lu" //stime
+ " %ld" //cutime
+ " %ld" //cstime
+ " %ld" //priority
+ " %ld" //nice
+ " %ld" //num_threads
+ " %ld" //itrealvalue
+ " %llu" //starttime
+ " %lu" //vsize
+ " %ld" //rss
+ " %lu" //rsslim
+ " %lu" //startcode
+ " %lu" //endcode
+ " %lu" //startstack
+ " %lu" //kstkesp
+ " %lu" //kstkip
+ " %lu" //signal
+ " %lu" //blocked
+ " %lu" //sigignore
+ " %lu" //sigcatch
+ " %lu" //wchan
+ " %lu" //nswap
+ " %lu" //cnswap
+ " %d" //exit_signal
+ " %d" //processor
+ " %u" //rt_priority
+ " %u" //policy
+ " %llu" //delayacct_blkio_ticks
+ " %lu" //guest_time
+ " %ld" //cguest_time
+ ,&(output.pid), &(output.state), &(output.ppid), &(output.pgrp), &(output.session),
+ &(output.tty_nr), &(output.tpgid), &(output.flags), &(output.minflt), &(output.cminflt),
+ &(output.majflt), &(output.cmajflt), &(output.utime), &(output.stime), &(output.cutime),
+ &(output.cstime), &(output.priority), &( output.nice), &(output.num_threads), &(output.itrealvalue),
+ &(output.starttime), &(output.vsize), &(output.rss), &(output.rsslim), &(output.startcode),
+ &(output.endcode), &(output.startstack), &(output.kstkesp), &(output.kstkeip), &(output.signal),
+ &(output.blocked), &(output.sigignore), &(output.sigcatch), &(output.wchan), &(output.nswap),
+ &(output.cnswap), &(output.exit_signal), &(output.processor), &(output.rt_priority), &(output.policy),
+ &(output.delayacct_blkio_ticks), &(output.guest_time), &(output.cguest_time)
+ );
+ if(num_succes != 43) { // 43 is number of iteams in Resources::PidStats
+ LOG4CXX_ERROR(logger_, "Couldn't parse all iteams in /proc/PID/stat file");
+ return false;
+ }
+ return true;
+#elif defined(__QNXNTO__)
+ int fd = open(GetProcPath().c_str(), O_RDONLY);
+ if (0 >= fd) {
+ LOG4CXX_ERROR(logger_, "Failed open process proc file : " << GetProcPath() <<
+ "; error no : " << strerror( errno ) );
+ return false;
+ }
+ devctl(fd, DCMD_PROC_INFO, &output, sizeof(output), 0);
+ close(fd);
+ return true;
+#endif
+}
+
+bool Resources::GetMemInfo(Resources::MemInfo &output) {
+ bool result = false;
+ #if defined(OS_LINUX)
+ Resources::PidStats pid_stat;
+ if (false == GetProcInfo(pid_stat)) {
+ LOG4CXX_ERROR(logger_, "Failed to get proc info");
+ result = false;
+ } else {
+ output = pid_stat.vsize;
+ result = true;
+ }
+
+#elif defined(__QNXNTO__)
+ std::string as_path = GetStatPath();
+ struct stat st;
+ struct _dir* proc_dir = 0;
+ struct dirent* proc_entry = 0;
+ if (0 == (proc_dir = opendir(proc))) {
+ LOG4CXX_ERROR(logger_, "Unable to access to " << proc);
+ result = false;
+ return result;
+ }
+ if (0 == (proc_entry = readdir(proc_dir))) {
+ LOG4CXX_ERROR(logger_, "Unable to read : " << proc_dir);
+ result = false;
+ return result;
+ }
+ closedir(proc_dir);
+ if (-1 == stat(as_path.c_str(), &st) || 0 == st.st_size) {
+ LOG4CXX_ERROR(logger_, "Unable to stat : " << as_path.c_str());
+ result = false;
+ return result;
+ }
+ output = st.st_size;
+ result = true;
+#endif
+ return result;
+}
+
+std::string Resources::GetStatPath() {
+ std::string filename;
+#if defined(OS_LINUX)
+ filename = GetProcPath() + "/stat";
+#elif defined(__QNXNTO__)
+ filename = GetProcPath() + "/as";
+#endif
+ return filename;
+}
+
+std::string Resources::GetProcPath() {
+ char buffer[1024];
+ pid_t my_pid = getpid();
+ snprintf(buffer, sizeof(buffer), "%s%d/", proc , my_pid);
+ std::string filename(buffer);
+ return filename;
+}
+
+} // namespace utils
diff --git a/src/components/utils/src/rwlock_posix.cc b/src/components/utils/src/rwlock_posix.cc
new file mode 100644
index 0000000000..7cc850b25b
--- /dev/null
+++ b/src/components/utils/src/rwlock_posix.cc
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/rwlock.h"
+#include "utils/logger.h"
+
+namespace sync_primitives {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+RWLock::RWLock() {
+ if (pthread_rwlock_init(&rwlock_, 0) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to initialize rwlock");
+ }
+}
+
+RWLock::~RWLock() {
+ if (pthread_rwlock_destroy(&rwlock_) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to destroy rwlock");
+ }
+}
+
+void RWLock::AcquireForReading() {
+ if (pthread_rwlock_rdlock(&rwlock_) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to acquire rwlock for reading");
+ }
+}
+
+void RWLock::AcquireForWriting() {
+ if (pthread_rwlock_wrlock(&rwlock_) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to acquire rwlock for writing");
+ }
+}
+
+void RWLock::Release() {
+ if (pthread_rwlock_unlock(&rwlock_) != 0) {
+ LOG4CXX_ERROR(logger_, "Failed to release rwlock");
+ }
+}
+
+} // namespace sync_primitives
diff --git a/src/components/utils/src/signals_linux.cc b/src/components/utils/src/signals_linux.cc
new file mode 100644
index 0000000000..f592a1e22b
--- /dev/null
+++ b/src/components/utils/src/signals_linux.cc
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+#include <csignal>
+#include <stdint.h>
+
+namespace utils {
+
+bool SubscribeToTerminateSignal(void (*func)(int32_t p)) {
+ void (*prev_func)(int32_t p);
+
+ prev_func = signal(SIGINT, func);
+ return (SIG_ERR != prev_func);
+}
+
+bool ResetSubscribeToTerminateSignal() {
+ void (*prev_func)(int32_t p);
+ prev_func = signal(SIGINT, SIG_DFL);
+ return (SIG_ERR != prev_func);
+}
+
+} // namespace utils
diff --git a/src/components/utils/src/system.cc b/src/components/utils/src/system.cc
new file mode 100644
index 0000000000..ee90315db0
--- /dev/null
+++ b/src/components/utils/src/system.cc
@@ -0,0 +1,167 @@
+/**
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifdef __QNX__
+# include <process.h>
+#else // __QNX__
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <sys/stat.h>
+# include <fcntl.h>
+# include <unistd.h>
+#endif // __QNX__
+
+#include <algorithm>
+#include <functional>
+#include <cstring>
+
+#include "utils/logger.h"
+#include "utils/system.h"
+
+namespace utils {
+
+CREATE_LOGGERPTR_LOCAL(logger_, "Utils")
+
+struct GetCString {
+ char * operator ()(const std::string& string) {
+ return const_cast<char*>(string.c_str());
+ }
+};
+
+System::System(const std::string& command)
+ : command_(command) {
+ argv_.push_back(command);
+}
+
+System::System(const std::string& file, const std::string& command)
+ : command_(file) {
+ argv_.push_back(command);
+}
+
+bool System::Execute() {
+ return Execute(false);
+}
+
+System& System::Add(const std::string& arg) {
+ argv_.push_back(arg);
+ return *this;
+}
+
+#ifdef __QNX__
+
+bool System::Execute(bool wait) {
+ size_t size = argv_.size();
+ char * *argv = new char*[size + 1];
+ std::transform(argv_.begin(), argv_.end(), argv, GetCString());
+ argv[size] = NULL;
+
+ int mode = wait ? P_WAIT : P_NOWAIT;
+ int ret = spawnvp(mode, command_.c_str(), argv);
+ delete[] argv;
+
+ if (ret == -1) {
+ LOG4CXX_ERROR(logger_, "Can't execute command: " << command_
+ << " Errno is: " << std::strerror(errno));
+ return false;
+ }
+
+ if (wait) {
+ return WEXITSTATUS(ret) == 0;
+ }
+
+ return true;
+}
+
+#else // __QNX__
+
+bool System::Execute(bool wait) {
+ // Create a child process.
+ pid_t pid_command = fork();
+
+ switch (pid_command) {
+ case -1: { // Error
+ LOG4CXX_FATAL(logger_, "fork() failed!");
+ return false;
+ }
+ case 0: { // Child process
+ int32_t fd_dev0 = open("/dev/null", O_RDWR, S_IWRITE);
+ if (0 > fd_dev0) {
+ LOG4CXX_FATAL(logger_, "Open dev0 failed!");
+ return false;
+ }
+ // close input/output file descriptors.
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
+
+ // move input/output to /dev/null.
+ dup2(fd_dev0, STDIN_FILENO);
+ dup2(fd_dev0, STDOUT_FILENO);
+ dup2(fd_dev0, STDERR_FILENO);
+
+ size_t size = argv_.size();
+ char * *argv = new char*[size + 1];
+ std::transform(argv_.begin(), argv_.end(), argv, GetCString());
+ argv[size] = NULL;
+
+ // Execute the program.
+ if (execvp(command_.c_str(), argv) == -1) {
+ LOG4CXX_ERROR(logger_, "Can't execute command: " << command_);
+ _exit(EXIT_FAILURE);
+ }
+ delete[] argv;
+
+ return true;
+ }
+ default: { /* Parent process */
+ LOG4CXX_INFO(logger_, "Process created with pid " << pid_command);
+ if (wait) {
+ int status;
+ pid_t wait_pid;
+ do {
+ wait_pid = waitpid(pid_command, &status, WUNTRACED | WCONTINUED);
+ if (wait_pid == -1) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Can't wait");
+ _exit(EXIT_FAILURE);
+ return false;
+ }
+ } while (!WIFEXITED(status) && !WIFSIGNALED(status));
+ return WEXITSTATUS(status) == 0;
+ }
+
+ return true;
+ }
+ }
+}
+
+#endif // __QNX__
+
+} // utils
diff --git a/src/components/utils/src/threads/posix_thread.cc b/src/components/utils/src/threads/posix_thread.cc
new file mode 100644
index 0000000000..faaadd673c
--- /dev/null
+++ b/src/components/utils/src/threads/posix_thread.cc
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+
+#include <limits.h>
+#include <stddef.h>
+#include <signal.h>
+
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_manager.h"
+#include "utils/logger.h"
+#include "pthread.h"
+
+using namespace std;
+using namespace threads::impl;
+
+namespace {
+
+static void* threadFunc(void* closure) {
+ threads::ThreadDelegate* delegate =
+ static_cast<threads::ThreadDelegate*>(closure);
+ delegate->threadMain();
+ return NULL;
+}
+
+static pthread_t main_thread_id;
+static bool main_thread_id_set = false;
+
+#ifndef __QNXNTO__
+ const int EOK = 0;
+#endif
+
+#if defined(OS_POSIX)
+ const size_t THREAD_NAME_SIZE = 15;
+#endif
+}
+
+namespace threads {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+size_t Thread::kMinStackSize = PTHREAD_STACK_MIN; /* Ubuntu : 16384 ; QNX : 256; */
+
+bool Thread::Id::operator==(const Thread::Id& other) const {
+ return pthread_equal(id_, other.id_) != 0;
+}
+
+// static
+Thread::Id Thread::CurrentId() {
+ return Id(pthread_self());
+}
+
+//static
+std::string Thread::NameFromId(const Id& thread_id) {
+ return ThreadManager::instance()->GetName(thread_id.id_);
+}
+
+//static
+void Thread::SetNameForId(const Id& thread_id, const std::string& name) {
+ ThreadManager::instance()->RegisterName(thread_id.id_, name);
+
+ const std::string striped_name =
+ name.length() > THREAD_NAME_SIZE ? std::string(name.begin(), name.begin() + THREAD_NAME_SIZE) : name;
+
+ const int pthread_result = pthread_setname_np(thread_id.id_, striped_name.c_str());
+ if (pthread_result != EOK) {
+ LOG4CXX_WARN(logger_,"Couldn't set pthread name \"" << striped_name
+ << "\", error code " << pthread_result <<
+ " (" << strerror(pthread_result) << ")");
+ }
+}
+
+//static
+void Thread::SetMainThread() {
+ main_thread_id = pthread_self();
+ main_thread_id_set = true;
+}
+
+//static
+bool Thread::InterruptMainThread() {
+ if (!main_thread_id_set) {
+ LOG4CXX_WARN(logger_, "Cannot interrupt main thread: not specified");
+ return false;
+ }
+ pthread_kill(main_thread_id, SIGINT);
+ return true;
+}
+
+//static
+void Thread::MaskSignals() {
+ sigset_t sigset;
+ sigfillset(&sigset);
+ pthread_sigmask(SIG_SETMASK, &sigset, 0);
+}
+
+//static
+void Thread::UnmaskSignals() {
+ sigset_t sigset;
+ sigemptyset(&sigset);
+ pthread_sigmask(SIG_SETMASK, &sigset, 0);
+}
+
+Thread::Thread(const char* name, ThreadDelegate* delegate)
+ : name_(name ? name : "undefined"),
+ delegate_(delegate),
+ thread_handle_(0),
+ thread_options_(),
+ isThreadRunning_(false) {
+}
+
+Thread::~Thread() {
+ ThreadManager::instance()->Unregister(thread_handle_);
+ delete delegate_;
+ LOG4CXX_INFO(logger_,"Deleted thread: " << name_);
+}
+
+bool Thread::start() {
+ return startWithOptions(thread_options_);
+}
+
+bool Thread::startWithOptions(const ThreadOptions& options) {
+ LOG4CXX_TRACE_ENTER(logger_);
+ if (!delegate_) {
+ NOTREACHED();
+ LOG4CXX_ERROR(logger_, "NULL delegate");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return false;
+ }
+
+ thread_options_ = options;
+
+ pthread_attr_t attributes;
+ int pthread_result = pthread_attr_init(&attributes);
+ if (pthread_result != EOK) {
+ LOG4CXX_WARN(logger_,"Couldn't init pthread attributes. Error code = "
+ << pthread_result << "(\"" << strerror(pthread_result) << "\")");
+ }
+
+ if (!thread_options_.is_joinable()) {
+ pthread_result = pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED);
+ if (pthread_result != EOK) {
+ LOG4CXX_WARN(logger_,"Couldn't set detach state attribute.. Error code = "
+ << pthread_result << "(\"" << strerror(pthread_result) << "\")");
+ }
+ }
+
+ const size_t stack_size = thread_options_.stack_size();
+ if (stack_size >= Thread::kMinStackSize) {
+ pthread_result = pthread_attr_setstacksize(&attributes, stack_size);
+ if (pthread_result != EOK) {
+ LOG4CXX_WARN(logger_,"Couldn't set stacksize = " << stack_size <<
+ ". Error code = " << pthread_result << "(\""
+ << strerror(pthread_result) << "\")");
+ }
+ }
+
+ pthread_result = pthread_create(&thread_handle_, &attributes, threadFunc, delegate_);
+ isThreadRunning_ = (pthread_result == EOK);
+ if (!isThreadRunning_) {
+ LOG4CXX_WARN(logger_, "Couldn't create thread. Error code = "
+ << pthread_result << "(\"" << strerror(pthread_result) << "\")");
+ } else {
+ LOG4CXX_INFO(logger_,"Created thread: " << name_);
+ SetNameForId(Id(thread_handle_), name_);
+ }
+ LOG4CXX_TRACE_EXIT(logger_);
+ return isThreadRunning_;
+}
+
+void Thread::stop() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_DEBUG(logger_, "Canceling thread (#" << thread_handle_
+ << " \"" << name_ << "\") from #" << pthread_self());
+ if (!is_running()) {
+ LOG4CXX_WARN(logger_, "Thread (#" << thread_handle_
+ << " \"" << name_ << "\") is not running");
+ LOG4CXX_TRACE_EXIT(logger_);
+ return;
+ }
+
+ // TODO (EZamakhov): why exitThreadMain return bool and stop does not?
+ if (delegate_ && !delegate_->exitThreadMain()) {
+ if (pthread_self() == thread_handle_) {
+ LOG4CXX_ERROR(logger_,
+ "Couldn't cancel the same thread (#" << thread_handle_
+ << "\"" << name_ << "\")");
+ } else {
+ const int pthread_result = pthread_cancel(thread_handle_);
+ if (pthread_result != EOK) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't cancel thread (#" << thread_handle_ << " \"" << name_ <<
+ "\") from thread #" << pthread_self() << ". Error code = "
+ << pthread_result << " (\"" << strerror(pthread_result) << "\")");
+ }
+ }
+ }
+
+ // Wait for the thread to exit. It should already have terminated but make
+ // sure this assumption is valid.
+ join();
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+void Thread::join() {
+ LOG4CXX_TRACE_ENTER(logger_);
+ LOG4CXX_DEBUG(logger_, "Join thread (#" << thread_handle_
+ << " \"" << name_ << "\") from #" << pthread_self());
+ if (thread_handle_ == pthread_self()) {
+ LOG4CXX_ERROR(logger_,
+ "Couldn't join with the same thread (#" << thread_handle_
+ << " \"" << name_ << "\")");
+ } else {
+ const int pthread_result = pthread_join(thread_handle_, NULL);
+ if (pthread_result != EOK) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't join thread (#" << thread_handle_ << " \"" << name_ <<
+ "\") from thread #" << pthread_self() << ". Error code = "
+ << pthread_result << "(\"" << strerror(pthread_result) << "\")");
+ }
+ }
+ isThreadRunning_ = false;
+ LOG4CXX_TRACE_EXIT(logger_);
+}
+
+std::ostream& operator<<(std::ostream& os, const Thread::Id& thread_id) {
+ return os<<Thread::NameFromId(thread_id);
+}
+
+} // namespace threads
diff --git a/src/components/utils/src/threads/pulse_thread_delegate.cc b/src/components/utils/src/threads/pulse_thread_delegate.cc
new file mode 100644
index 0000000000..8c580bea83
--- /dev/null
+++ b/src/components/utils/src/threads/pulse_thread_delegate.cc
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/netmgr.h>
+
+#include "utils/threads/pulse_thread_delegate.h"
+#include "utils/logger.h"
+
+namespace threads {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+PulseThreadDelegate::PulseThreadDelegate() : run_(false) {
+ LOG4CXX_TRACE(logger_, "Creating QNX channel");
+ chid_ = ChannelCreate(0);
+ if (chid_ == -1) {
+ LOG4CXX_ERROR(logger_, "Failed to create QNX channel");
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "Created QNX channel " << chid_);
+
+ LOG4CXX_TRACE(logger_, "Connecting to QNX channel " << chid_);
+ coid_ = ConnectAttach(ND_LOCAL_NODE, 0, chid_, _NTO_SIDE_CHANNEL, 0);
+ if (coid_ == -1) {
+ LOG4CXX_ERROR(logger_, "Failed to connect to QNX channel " << chid_);
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "Connected to QNX channel " << chid_);
+
+ run_ = true;
+}
+
+void PulseThreadDelegate::threadMain() {
+ if (!Init()) {
+ LOG4CXX_ERROR(logger_, "Failed to initialize thread for QNX channel " << chid_);
+ return;
+ }
+ while (run_) {
+ struct sigevent event;
+ SIGEV_PULSE_INIT(&event, coid_, SIGEV_PULSE_PRIO_INHERIT, PULSE_CODE, 0);
+ if (ArmEvent(&event)) {
+ struct _pulse pulse;
+ LOG4CXX_INFO(logger_, "Waiting for pulse on QNX channel " << chid_);
+ if (MsgReceivePulse(chid_, &pulse, sizeof(pulse), 0) != -1) {
+ LOG4CXX_INFO(logger_, "Received pulse on QNX channel " << chid_);
+ switch (pulse.code) {
+ case PULSE_CODE:
+ OnPulse();
+ break;
+ }
+ }
+ else {
+ if (run_) {
+ LOG4CXX_WARN(logger_, "Error occurred while waiting for pulse on QNX channel " << chid_);
+ }
+ else {
+ LOG4CXX_INFO(logger_, "QNX channel " << chid_ << " is apparently destroyed");
+ }
+ }
+ }
+ }
+ Finalize();
+}
+
+bool PulseThreadDelegate::exitThreadMain() {
+ run_ = false;
+
+ LOG4CXX_TRACE(logger_, "Disconnecting from QNX channel " << chid_);
+ if (ConnectDetach(coid_) != -1) {
+ LOG4CXX_DEBUG(logger_, "Disconnected from QNX channel " << chid_);
+ }
+ else {
+ LOG4CXX_WARN(logger_, "Failed to disconnect from QNX channel " << chid_);
+ }
+
+ LOG4CXX_TRACE(logger_, "Destroying QNX channel " << chid_);
+ if (ChannelDestroy(chid_) != -1) { // unblocks MsgReceivePulse()
+ LOG4CXX_DEBUG(logger_, "QNX channel " << chid_ << " destroyed");
+ }
+ else {
+ LOG4CXX_WARN(logger_, "Failed to destroy QNX channel " << chid_);
+ }
+
+ return true;
+}
+
+} // namespace threads
diff --git a/src/components/utils/src/threads/thread_manager.cc b/src/components/utils/src/threads/thread_manager.cc
new file mode 100644
index 0000000000..32a073ad15
--- /dev/null
+++ b/src/components/utils/src/threads/thread_manager.cc
@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/threads/thread_manager.h"
+#include "utils/logger.h"
+
+#include <sstream>
+
+#if defined(OS_LINUX)
+#include <sys/syscall.h>
+#include <unistd.h>
+#endif
+
+namespace threads {
+namespace impl {
+using namespace std;
+using namespace sync_primitives;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+namespace {
+ const char* kUnknownName = "UnnamedThread";
+}
+
+UnnamedThreadRegistry::UnnamedThreadRegistry() {
+}
+
+UnnamedThreadRegistry::~UnnamedThreadRegistry() {
+}
+
+std::string UnnamedThreadRegistry::GetUniqueName(PlatformThreadHandle id) {
+ AutoLock auto_lock(state_lock_);
+ IdNameMap::iterator found = id_number_.find(id);
+ if (found != id_number_.end()) {
+ return found->second;
+ }
+ ++last_thread_number_;
+ std::stringstream namestream;
+ namestream << kUnknownName << last_thread_number_;
+ return id_number_[id] = namestream.str();
+}
+
+ThreadManager::ThreadManager() {
+ names_.insert(kUnknownName);
+}
+
+ThreadManager::~ThreadManager() {
+}
+
+void ThreadManager::RegisterName(PlatformThreadHandle id, const string& name) {
+ AutoLock auto_lock(state_lock_);
+ if (names_.find(name) != names_.end()) {
+ LOG4CXX_ERROR(logger_, "Ignoring duplicate thread name: " << name);
+ return;
+ }
+ names_.insert(name);
+ pair<IdNamesMap::iterator, bool> inserted =
+ id_names_.insert(make_pair(id, name));
+ if (!inserted.second) {
+ LOG4CXX_ERROR(logger_, "Trying to register thread name " << name
+ <<", but it is already registered with name "
+ <<inserted.first->second);
+ }
+}
+
+string ThreadManager::GetName(PlatformThreadHandle id) const {
+ AutoLock auto_lock(state_lock_);
+ IdNamesMap::const_iterator found = id_names_.find(id);
+ if (found == id_names_.end()) {
+ LOG4CXX_WARN(logger_, "Thread " << id << " doesn't have associated name");
+ return unnamed_thread_namer_.GetUniqueName(id);
+ }
+ return found->second;
+}
+
+void ThreadManager::Unregister(PlatformThreadHandle id) {
+ AutoLock auto_lock(state_lock_);
+ IdNamesMap::iterator it = id_names_.find(id);
+ if(it != id_names_.end()) {
+ names_.erase(it->second);
+ id_names_.erase(it);
+ }
+}
+
+} // namespace impl
+} // namespace threads
diff --git a/src/components/utils/src/threads/thread_validator.cc b/src/components/utils/src/threads/thread_validator.cc
new file mode 100644
index 0000000000..5e9c88a7c9
--- /dev/null
+++ b/src/components/utils/src/threads/thread_validator.cc
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "utils/threads/thread_validator.h"
+
+#include "utils/logger.h"
+#include "utils/back_trace.h"
+
+namespace threads {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Utils")
+
+SingleThreadSimpleValidator::SingleThreadSimpleValidator()
+ : creation_thread_id_(Thread::CurrentId()) {
+}
+
+SingleThreadSimpleValidator::~SingleThreadSimpleValidator() {
+}
+
+void SingleThreadSimpleValidator::AssertRunningOnCreationThread() const {
+ Thread::Id current_id = Thread::CurrentId();
+ if (creation_thread_id_ != current_id) {
+ LOG4CXX_ERROR(logger_, "Single-threaded object created at thread "
+ << creation_thread_id_
+ <<" is accessed from thread "
+ << current_id
+#ifdef BACKTRACE_SUPPORT
+ << "\n"
+ << utils::Backtrace()
+#endif
+ );
+ }
+}
+
+
+SingleThreadValidator::SingleThreadValidator()
+ : owning_thread_id_(Thread::CurrentId()){
+}
+
+SingleThreadValidator::~SingleThreadValidator() {
+}
+
+void SingleThreadValidator::PassToThread(Thread::Id thread_id) const {
+ owning_thread_id_ = thread_id;
+}
+
+void SingleThreadValidator::AssertRunningOnValidThread() const {
+ Thread::Id current_id = Thread::CurrentId();
+ if (owning_thread_id_ != current_id) {
+ LOG4CXX_ERROR(logger_, "Single-threaded object owned by thread "
+ << owning_thread_id_
+ << " is accessed from thread "
+ << current_id << "\n"
+#ifdef BACKTRACE_SUPPORT
+ << utils::Backtrace()
+#endif
+ );
+ }
+}
+
+
+} // namespace threads
+
+// vim: set ts=2 sw=2 et:
diff --git a/src/components/utils/test/CMakeLists.txt b/src/components/utils/test/CMakeLists.txt
new file mode 100644
index 0000000000..a9ed5acdac
--- /dev/null
+++ b/src/components/utils/test/CMakeLists.txt
@@ -0,0 +1,17 @@
+include_directories (
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/include
+ ${CMAKE_SOURCE_DIR}/src/3rd_party-static/gmock-1.7.0/gtest/include)
+
+set(testSources
+ main.cc
+ file_system_test.cc
+ date_time_test.cc)
+
+set(testLibraries
+ gmock
+ gtest
+ Utils)
+
+add_executable(utils_test ${testSources})
+target_link_libraries(utils_test ${testLibraries})
+
diff --git a/src/components/utils/test/date_time_test.cc b/src/components/utils/test/date_time_test.cc
new file mode 100644
index 0000000000..ddcf679a16
--- /dev/null
+++ b/src/components/utils/test/date_time_test.cc
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <unistd.h>
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "utils/date_time.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+TEST(DateTimeTest, GetCurrentTime) {
+ const TimevalStruct time1 = date_time::DateTime::getCurrentTime();
+ ASSERT_NE(0, time1.tv_sec);
+ ASSERT_GE(time1.tv_usec, 0);
+
+ const TimevalStruct time2 = date_time::DateTime::getCurrentTime();
+ ASSERT_NE(0, time2.tv_sec);
+ ASSERT_GE(time2.tv_usec, 0);
+ ASSERT_GE(time2.tv_sec, time1.tv_sec);
+}
+
+TEST(DateTimeTest, GetmSecs) {
+ TimevalStruct time;
+ time.tv_sec = 1;
+ time.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ ASSERT_EQ(time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND +
+ time.tv_usec / date_time::DateTime::MICROSECONDS_IN_MILLISECONDS,
+ date_time::DateTime::getmSecs(time));
+}
+
+TEST(DateTimeTest, GetuSecs) {
+ TimevalStruct time;
+ time.tv_sec = 3;
+ time.tv_usec = 4;
+
+ ASSERT_EQ(time.tv_sec * date_time::DateTime::MILLISECONDS_IN_SECOND *
+ date_time::DateTime::MICROSECONDS_IN_MILLISECONDS + time.tv_usec,
+ date_time::DateTime::getuSecs(time));
+}
+
+TEST(DateTimeTest, GetuSecsmSecs) {
+ TimevalStruct time;
+ time.tv_sec = 5;
+ time.tv_usec = 6;
+
+ ASSERT_EQ( date_time::DateTime::getmSecs(time),
+ date_time::DateTime::getuSecs(time) / date_time::DateTime::MICROSECONDS_IN_MILLISECONDS);
+}
+
+TEST(DateTimeTest, CalculateTimeSpan) {
+ const TimevalStruct time = date_time::DateTime::getCurrentTime();
+
+ const uint32_t sleep_time_mSec = 10;
+ usleep(sleep_time_mSec * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS);
+
+ ASSERT_GE(date_time::DateTime::calculateTimeSpan(time),
+ sleep_time_mSec);
+}
+
+TEST(DateTimeTest, CalculateTimeDiff) {
+ TimevalStruct time1;
+ time1.tv_sec = 1;
+ time1.tv_usec = 2 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ TimevalStruct time2;
+ time2.tv_sec = 3;
+ time2.tv_usec = 4 * date_time::DateTime::MICROSECONDS_IN_MILLISECONDS;
+
+ //time2 to time1
+ TimevalStruct diff1;
+ diff1.tv_sec = time2.tv_sec - time1.tv_sec;
+ diff1.tv_usec = time2.tv_usec - time1.tv_usec;
+
+ const int64_t mSecDiff = static_cast<int64_t>(diff1.tv_sec) * 1000
+ + diff1.tv_usec / 1000;
+
+ ASSERT_EQ(mSecDiff,
+ date_time::DateTime::calculateTimeDiff(time2, time1));
+
+ //time1 to time2
+ TimevalStruct diff2;
+ diff2.tv_sec = time1.tv_sec - time2.tv_sec;
+ diff2.tv_usec = time1.tv_usec - time2.tv_usec;
+
+ const int64_t mSecDiff2 = -(static_cast<int64_t>(diff2.tv_sec) * 1000
+ + diff2.tv_usec / 1000);
+
+ ASSERT_EQ(mSecDiff2,
+ date_time::DateTime::calculateTimeDiff(time1, time2));
+}
+
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/file_system_test.cc b/src/components/utils/test/file_system_test.cc
new file mode 100644
index 0000000000..abf09735ba
--- /dev/null
+++ b/src/components/utils/test/file_system_test.cc
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gmock/gmock.h"
+#include "utils/file_system.h"
+
+namespace test {
+namespace components {
+namespace utils {
+
+TEST(FileSystemTest, CommonFileSystemTest) {
+ // Directory creation
+ ASSERT_FALSE(file_system::DirectoryExists("./Test directory"));
+
+ file_system::CreateDirectory("./Test directory");
+
+ ASSERT_TRUE(file_system::DirectoryExists("./Test directory"));
+
+ ASSERT_TRUE(file_system::IsDirectory("./Test directory"));
+
+ // File creation
+ ASSERT_FALSE(file_system::FileExists("./Test directory/test file"));
+
+ std::vector<unsigned char> data;
+ data.push_back('t');
+ data.push_back('e');
+ data.push_back('s');
+ data.push_back('t');
+
+ ASSERT_TRUE(file_system::Write("./Test directory/test file", data));
+
+ ASSERT_TRUE(file_system::FileExists("./Test directory/test file"));
+
+ ASSERT_FALSE(file_system::IsDirectory("./Test directory/test file"));
+
+ // Read data from file
+ std::vector<unsigned char> result;
+
+ ASSERT_TRUE(file_system::ReadBinaryFile("./Test directory/test file",
+ result));
+ ASSERT_FALSE(result.empty());
+
+ // list files
+ ASSERT_TRUE(file_system::Write("./Test directory/test file 2", data));
+
+ std::vector<std::string> list;
+ list = file_system::ListFiles("./Test directory");
+
+ ASSERT_FALSE(list.empty());
+ std::sort(list.begin(), list.end());
+ ASSERT_EQ("test file", list[0]);
+ ASSERT_EQ("test file 2", list[1]);
+
+ // Delete file
+ ASSERT_TRUE(file_system::FileExists("./Test directory/test file 2"));
+ ASSERT_TRUE(file_system::DeleteFile("./Test directory/test file 2"));
+ ASSERT_FALSE(file_system::FileExists("./Test directory/test file 2"));
+
+ // Delete empty directory
+ file_system::CreateDirectory("./Test directory/Empty directory");
+
+ ASSERT_TRUE(file_system::DirectoryExists(
+ "./Test directory/Empty directory"));
+ ASSERT_TRUE(file_system::RemoveDirectory(
+ "./Test directory/Empty directory", false));
+ ASSERT_FALSE(file_system::DirectoryExists(
+ "./Test directory/Empty directory"));
+
+ ASSERT_FALSE(file_system::RemoveDirectory("./Test directory", false));
+ ASSERT_TRUE(file_system::DirectoryExists("./Test directory"));
+
+ // Delete directory recursively
+ file_system::CreateDirectory("./Test directory/Test directory 2");
+ ASSERT_TRUE(file_system::Write(
+ "./Test directory/Test directory 2/test file 2", data));
+ ASSERT_TRUE(file_system::RemoveDirectory("./Test directory", true));
+
+ ASSERT_FALSE(file_system::DirectoryExists("./Test directory"));
+}
+} // namespace utils
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/main.cc b/src/components/utils/test/main.cc
new file mode 100644
index 0000000000..d8242c89a0
--- /dev/null
+++ b/src/components/utils/test/main.cc
@@ -0,0 +1,7 @@
+#include "gmock/gmock.h"
+
+int main(int argc, char** argv) {
+ testing::InitGoogleMock(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+